On 24.09.2026 08:07, Aneesh Kumar K.V (Arm) wrote:
This series centralizes swiotlb default-pool selection and sizing, and
simplifies the initialization flags used to describe pool placement.
The first patch replaces the addressing-limit argument with initialization
flags and introduces explicit policies for the different reasons a default
pool may be needed. Architectures now report DMA addressing constraints with
SWIOTLB_INIT_ADDRESSING_LIMIT, while the core selects the corresponding pool
policy.
The second patch moves the reduced sizing used when the pool is needed only
for unaligned kmalloc bouncing from arm64 and RISC-V into the swiotlb core.
The third patch centralizes swiotlb sizing for memory-encrypted systems. It
moves the existing x86 guest-sizing policy into the core. Host memory
encryption retains the normal pool size, and a shared default pool is not
selected solely for guest memory encryption when a restricted DMA pool is
present.
The fourth patch removes SWIOTLB_ANY. Pool placement is derived directly from
SWIOTLB_INIT_ADDRESSING_LIMIT: pools required for limited DMA addressing are
allocated below the architecture's low address limit, while other pools may
be allocated anywhere in directly mapped memory. Xen continues to request a
pool explicitly with SWIOTLB_INIT_REMAP without imposing a low-address
constraint.
I would like to give this patchset some tests in linux-next and merge this to
v7.4-rc1, as this is important continuation of the code already merged to v7.3.
Any chance to get some more acks from arch maintainers (especially x86)?
Unfortunately I had to reduce the CC list due to my smtp limits...
...
Documentation/core-api/swiotlb.rst | 8 +-
arch/arm/mm/init.c | 6 +-
arch/arm/xen/mm.c | 2 +-
arch/arm64/mm/init.c | 14 +-
arch/loongarch/kernel/setup.c | 2 +-
arch/mips/cavium-octeon/dma-octeon.c | 2 +-
arch/mips/loongson64/dma.c | 2 +-
arch/mips/sibyte/common/dma.c | 2 +-
arch/powerpc/kernel/dma-swiotlb.c | 4 +-
arch/powerpc/mm/mem.c | 17 ++-
arch/powerpc/platforms/pseries/svm.c | 10 --
arch/powerpc/sysdev/fsl_pci.c | 1 +
arch/riscv/mm/init.c | 24 +---
arch/s390/mm/init.c | 2 +-
arch/x86/include/asm/crash_reserve.h | 4 +-
arch/x86/kernel/pci-dma.c | 23 +++-
arch/x86/mm/mem_encrypt.c | 24 ----
include/linux/swiotlb.h | 17 ++-
kernel/dma/swiotlb.c | 193 +++++++++++++++++++--------
19 files changed, 210 insertions(+), 147 deletions(-)
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland