From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 61EA9C79F83 for ; Fri, 4 Sep 2026 10:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=tw800+P4uDfhJ9ocmTWTBk5vEmN83SP+jsZApX/yv74=; b=P3u27fjUbLC1oquDJt/CJndE8e 0uBDr9Un3Ge8cMjaVJ3nJtIjzUSmO98Tnxzox9LQTrspgFhvKjkQG5k76qWuMyB0x73ImEbR0vCOR NUDzPP5ztuGQz7e2R9tBNjuuspywxKYzO/mYMRFaMtFJsbGidJxHOork6aOFyThYRSh9p8ycn6rba v7l7FhMeVOf7XX9fFUM29NzP4FySFWE+ZteMJxpnTzB8uff6242S5SG6wEMttg530W5WJTNPkdLwK B/jRGGsBYK/XalgamNeh8Z/FOSxpehdWZj36g4rWJjwYykCwNWBfBNrP+CdCHHkdzyfFUNQnmKYzS BUKqYR0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x2R0B-00000001dxm-2q4s; Fri, 04 Sep 2026 10:18:31 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x2R0A-00000001dxW-34wX; Fri, 04 Sep 2026 10:18:30 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id DFFB160216; Fri, 4 Sep 2026 10:18:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 583791F00A3D; Fri, 4 Sep 2026 10:18:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788517109; bh=tw800+P4uDfhJ9ocmTWTBk5vEmN83SP+jsZApX/yv74=; h=From:To:Cc:Subject:Date; b=VeD6TsvuxNdszngd9kfRSkBJ6wa+qxTTVLQDoCKpXCgqM3cJiEvokNzjA3rxoeTTi MKqpiukio34QjfY74UOEleZKzmBCDhEaOZgLRF4nsRgjo4boReS7dBvvdH4L+8Agv/ UheiOOtvWR52mJOsspkre/rzDUAGWb3jaigazXbTkTsVmbDmSEcuYr5Hlzbmoao8M5 XdMkR1WsmH8Z0lfPojuOIreL3BXvH0yzmNvftiKypljjLqP4B89FE8ETuLNdYr1W4t GG3OxFHpAe6m/5nn8gwJDaHkUMpXRtIRruqKlK+LFkd1ZB4xByDyS+dH2m8zWWMCIj lPBfH2ns3cLUQ== From: "Aneesh Kumar K.V (Arm)" To: iommu@lists.linux.dev 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, linux-kernel@vger.kernel.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 v3 0/4] dma: swiotlb: Centralize default pool policy and sizing Date: Fri, 4 Sep 2026 15:48:06 +0530 Message-ID: <20260904101810.1193505-1-aneesh.kumar@kernel.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 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) (4): dma: swiotlb: Centralize default pool policy selection dma: swiotlb: Centralize minimal pool sizing dma: swiotlb: Centralize memory-encryption pool sizing 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 | 4 +- arch/x86/include/asm/iommu.h | 2 + arch/x86/kernel/amd_gart_64.c | 1 + arch/x86/kernel/pci-dma.c | 19 ++- arch/x86/mm/mem_encrypt.c | 24 --- include/linux/swiotlb.h | 19 ++- kernel/dma/swiotlb.c | 214 ++++++++++++++++++++------- 20 files changed, 236 insertions(+), 141 deletions(-) base-commit: 89a312991dc6e638a36adc43ccb91dbc25504c04 -- 2.43.0