On Mon, Aug 10, 2026 at 04:58:42PM +0100, Will Deacon wrote: > On Mon, Aug 10, 2026 at 04:44:51PM +0100, Catalin Marinas wrote: > > I can see x86 in mem_encrypt_setup_arch() adjusting the bounce buffer to > > 6% of the guest memory. We could make up similar logic for arm64 or we > > could just rely on CONFIG_SWIOTLB_DYNAMIC (default off currently for > > arm64 I think). > > As Jason said, this should be done outside the arch code.
I agree, better in the core code. I'd prefer to go for some dynamic resizing than random percentage of guest memory like x86 (but, in the absence of dynamic swiotlb, we could pick some default). I noticed we still have a small change in behaviour regarding dynamic swiotlb. The increment for new allocations is based on default_nslabs which is reduced with the new patches. It gets even weirder if one sets the same IO_TLB_DEFAULT_SIZE on the kernel command line, it will be overridden by swiotlb_adjust_size() anyway. I think this core code needs a bit more tidying up. -- Catalin
