From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C77A43B19B5; Mon, 14 Sep 2026 07:02:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789369324; cv=none; b=sE4tj0cjH4+GKy07P8hSBiDTKOwpsWDHm2ubWNsfq8By8rfzmloqxxQvdZdvddbVx6pQEolAmA4g2Z26D8bFsvfrZXFriK4WHUBSGgwRe4V7B0SYmtzaKiBpEnVo6/fRALiuX4ErGnHOZbTnIy3zCaSV2IAJm3ox214VJxMMhAk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789369324; c=relaxed/simple; bh=IL1VhYktpJk6FkTqpNJ+GfXCdLkMzuzQSXYzIfRwC2M=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BnGa04SI4FGXxKLWTkGCucXAnD6xjtk+miJkWXvdhL65a9m5grpK993fO5kOUdcbFL2bE2oAC0DPWACGphs2GEXqjyS74haJSkTkCOibEbhxVYXCG6U6Cx8tTdaLCme0qMSJ5a0OhWF0BmVYq7VFBnr+0VQdu7FmygxRSbD5D08= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AoE2rVcx; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AoE2rVcx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8845A1F00899; Mon, 14 Sep 2026 07:01:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789369322; bh=EV5tViAYxnCB0eTkzb4VuPolPmh7ABILOSyo7ZgxW+U=; h=From:To:Cc:Subject:Date; b=AoE2rVcxAkSIhZuxVKzieEvz7ZAE2C92QF70NV2Xb/6ua2K1BkrCWkx0Cj+sV2luM pLe5w2zfqZrnWLQaF/GYvFTb9aOjMpV+QXSavjrRO1RDYa08QrcEZ7ykzan1KvRc7W rA2Y6afoW7hgpWX5KPiHRv+ncJOEvLmN6YdvvKQCf+327IdywVuO4WidouAfjCXoPB 6HUpAbO+76X77FMnHNvj1KegNOGNpUJQdoK2wXuJRT8VSlROLJl8pEZTtTemIY5Sx5 LWS52iN+1Roh5l7E9bksXUlnOioagiTrmMMJ9vFsXRFOn3OtLhGk363yy8eBZJvLL7 ZLUL5UaPQ+BfA== From: "Aneesh Kumar K.V (Arm)" To: iommu@lists.linux.dev, linux-kernel@vger.kernel.org Cc: "Aneesh Kumar K.V (Arm)" , Robin Murphy , Marek Szyprowski , Will Deacon , Marc Zyngier , Steven Price , Suzuki K Poulose , Catalin Marinas , Jiri Pirko , Jason Gunthorpe , Mostafa Saleh , Petr Tesarik , Alexey Kardashevskiy , Dan Williams , Xu Yilun , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , Russell King , Huacai Chen , Thomas Bogendoerfer , Jiaxun Yang , Paul Walmsley , Palmer Dabbelt , Albert Ou , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, x86@kernel.org Subject: [PATCH v4 0/5] dma: swiotlb: Centralize default pool policy and sizing Date: Mon, 14 Sep 2026 12:31:29 +0530 Message-ID: <20260914070135.313337-1-aneesh.kumar@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, 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. Changes from v3: https://lore.kernel.org/all/20260904101810.1193505-1-aneesh.kumar@kernel.org * Add a new patch, "dma: swiotlb: Add an overridable architecture pool opt-out". * Clarify the change in default behavior with the removal of SWIOTLB_ANY. Changes from v2: https://lore.kernel.org/all/20260813102521.1367737-1-aneesh.kumar@kernel.org * Rebase to latest tree. * Drop SWIOTLB_ANY and derive that based on SWIOTLB_INIT_ADDRESSING_LIMIT * Add SWIOTLB_INIT_REMAP. v1: https://lore.kernel.org/all/20260811134056.756015-1-aneesh.kumar@kernel.org Cc: Robin Murphy Cc: Marek Szyprowski Cc: Will Deacon Cc: Marc Zyngier Cc: Steven Price Cc: Suzuki K Poulose Cc: Catalin Marinas Cc: Jiri Pirko Cc: Jason Gunthorpe Cc: Mostafa Saleh Cc: Petr Tesarik Cc: Alexey Kardashevskiy Cc: Dan Williams Cc: Xu Yilun Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nicholas Piggin Cc: "Christophe Leroy (CS GROUP)" Cc: Alexander Gordeev Cc: Gerald Schaefer Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Sven Schnelle Cc: Russell King Cc: Huacai Chen Cc: Thomas Bogendoerfer Cc: Jiaxun Yang Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: loongarch@lists.linux.dev Cc: linux-mips@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-riscv@lists.infradead.org Cc: linux-s390@vger.kernel.org Cc: x86@kernel.org Aneesh Kumar K.V (Arm) (5): dma: swiotlb: Centralize default pool policy selection dma: swiotlb: Centralize minimal pool sizing dma: swiotlb: Centralize memory-encryption pool sizing dma: swiotlb: Add an overridable architecture pool opt-out dma: swiotlb: Remove SWIOTLB_ANY Documentation/core-api/swiotlb.rst | 8 +- arch/arm/mm/init.c | 6 +- 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 | 6 +- arch/x86/include/asm/iommu.h | 2 + arch/x86/kernel/amd_gart_64.c | 1 + arch/x86/kernel/pci-dma.c | 26 +++- arch/x86/mm/mem_encrypt.c | 24 --- include/linux/swiotlb.h | 21 ++- kernel/dma/swiotlb.c | 220 +++++++++++++++++++++------ 20 files changed, 252 insertions(+), 142 deletions(-) base-commit: 704340f1cd0dcef829eb62f5b48ae95a2ce17bdf -- 2.43.0