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 87676C43602 for ; Tue, 7 Jul 2026 08:06:32 +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-Type:MIME-Version: Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ea0IOau1aAltI3DRKVxyYkxeEjLOa5kYpwFj12qVzqc=; b=aj6zb9AXSKVcbuHWftnzjzudzH wuRVBy3QlsSTCHUiBEj9FHFkxJol1pQav5uavcEzLAV1letsnr0T0zJ+TZSM62x5Il/tyxppZenJB q0iHkdmML7sqpmVnuitcCzHvSuSxdbCeUCPsNClbsidTyw15os9dakSqiUfjSFs87TnS3OG2dPgQT 7cgENJo4jOQVJywxjV7KWm4ihw3wWe3C/UytDIOrxvUEIlXDOTCaZF3Iifhcw/VJ92hK7FYnjHqrj 0lXQ9V/q3GZPjlADpTOGOuqTSGFLnHoOI/W8eeLpG9aRnx/fkC/9r+nqoThJBoN3J+NLl6NkrC7/5 YFjTFZJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wh0oz-0000000EPhA-34Fz; Tue, 07 Jul 2026 08:06:25 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wh0oy-0000000EPgn-2C6o for linux-arm-kernel@lists.infradead.org; Tue, 07 Jul 2026 08:06:24 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id DB220618A6; Tue, 7 Jul 2026 08:06:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E980D1F000E9; Tue, 7 Jul 2026 08:06:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783411583; bh=ea0IOau1aAltI3DRKVxyYkxeEjLOa5kYpwFj12qVzqc=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=ehzJVAlxIC/pC2sXhGD1Zd5xyp2mkGV8OuobvUJm80sNhARBCJldhVJnR/fvzUlg8 t2QQb326FSv7l+dfyMjQn+q4qi0x/iJZD8qCoLvIATEMQErD8y3iRKIcZPoxzVgszV oRoggpbomDjX7tQZq9G9GaoCtyybcTlqjfRz4+F1rB3X4H4ooSWHLgUZt7CnfLeeFM zwEb6VljE8Xh9Fi9TviWiquZI1cqM+c0j9tSvLQJ700z+8l/66JsCg+ZgzcpDbHZNA MK5IFv5kO6A9ODArwj2zGJLks6KS3/uwYgDXQCaGY1s1PvXpmfKk7P0jRMoD6rRJUF QGcIHGnDYecHw== X-Mailer: emacs 30.2 (via feedmail 11-beta-1 I) From: Aneesh Kumar K.V To: iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev Cc: 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 , linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , x86@kernel.org Subject: Re: [PATCH v7 00/22] dma-mapping: Track shared DMA state through direct, pool and swiotlb paths In-Reply-To: <20260701054926.825925-1-aneesh.kumar@kernel.org> References: <20260701054926.825925-1-aneesh.kumar@kernel.org> Date: Tue, 07 Jul 2026 13:36:10 +0530 Message-ID: MIME-Version: 1.0 Content-Type: text/plain 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 "Aneesh Kumar K.V (Arm)" writes: > This series tracks confidential-computing shared DMA state through the > dma-direct, dma-pool, and swiotlb paths so that encrypted and decrypted > DMA buffers are handled consistently. > > Today, the direct DMA path mostly relies on force_dma_unencrypted() for > shared/decrypted buffer handling. This series consolidates the > force_dma_unencrypted() checks in the top-level functions and ensures > that the remaining DMA interfaces use DMA attributes to make the correct > decisions. > > The series separates mapping and allocation state: > - DMA_ATTR_CC_SHARED describes the DMA address attribute requested for a > mapping. It tells the DMA mapping path that the DMA address must target > shared/decrypted memory. > - __DMA_ATTR_ALLOC_CC_SHARED is an internal DMA-mapping attribute used only > by allocation paths after the DMA core decides that the backing pages > must be allocated as shared/decrypted memory. > > The series: > - moves swiotlb-backed allocations out of __dma_direct_alloc_pages(), > - uses __DMA_ATTR_ALLOC_CC_SHARED through the dma-direct alloc/free paths > - teaches the atomic DMA pools to track encrypted versus decrypted > state > - tracks swiotlb pool encryption state and enforces strict pool > selection > - centralizes encrypted/decrypted pgprot handling in dma_pgprot() using > DMA attributes > - passes DMA attributes down to dma_capable() so capability checks can > validate whether the selected DMA address encoding matches > DMA_ATTR_CC_SHARED > - makes dma_direct_map_phys() choose the DMA address encoding from > DMA_ATTR_CC_SHARED and fall back to swiotlb when a shared DMA request > cannot use the direct mapping, which lets arm64 and x86 CCA guests stop > relying on SWIOTLB_FORCE for DMA mappings > - use the selected swiotlb pool state to derive the returned DMA > address > - reports CC_ATTR_GUEST_MEM_ENCRYPT for arm64 Realms, powerpc secure > guests, and s390 protected virtualization guests. > > Dependency: > This series depends on the pKVM changes posted at: > https://lore.kernel.org/all/20260603110522.3331819-1-smostafa@google.com > > Please merge this series only after the pKVM changes above are merged. > Otherwise pKVM will be broken. > A rebased tree on top of the dependent pKVM changes can be found at: https://gitlab.arm.com/linux-arm/linux-cca/-/tree/scratch/pkvm/testing?ref_type=heads The patches had minor conflicts. I am not sure how we want to get this merged. Should we ask the pKVM maintainers for a topic branch, and then I can repost the updated series on top of that? -aneesh