lkml.org 
[lkml]   [2024]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC V1 4/5] x86: CVMs: Allow allocating all DMA memory from SWIOTLB
From
On 1/11/24 21:52, Vishal Annapurve wrote:
> --- a/arch/x86/mm/mem_encrypt.c
> +++ b/arch/x86/mm/mem_encrypt.c
> @@ -112,10 +112,14 @@ void __init mem_encrypt_setup_arch(void)
> * The percentage of guest memory used here for SWIOTLB buffers
> * is more of an approximation of the static adjustment which
> * 64MB for <1G, and ~128M to 256M for 1G-to-4G, i.e., the 6%
> + *
> + * Extra 2% is added to accommodate the requirement of DMA allocations
> + * done using dma_alloc_* APIs.
> */
> - size = total_mem * 6 / 100;
> - size = clamp_val(size, IO_TLB_DEFAULT_SIZE, SZ_1G);
> + size = total_mem * 8 / 100;
> + size = clamp_val(size, IO_TLB_DEFAULT_SIZE, (SZ_1G + SZ_256M));
> swiotlb_adjust_size(size);
> + swiotlb_adjust_alignment(SZ_2M);

FWIW, this appears superficially to just be fiddling with random
numbers. The changelog basically says: "did stuff".

What *are* "the requirement of DMA allocations done using dma_alloc_* APIs"?

\
 
 \ /
  Last update: 2024-05-27 14:43    [W:0.151 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site