From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19578606A32A for ; Tue, 1 Dec 2026 16:04:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=l8FkKPG2 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 75A5A10FA49; Tue, 1 Dec 2026 16:04:51 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6BBDC10FA84 for ; Tue, 1 Dec 2026 16:04:44 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 31A5E416BE; Tue, 1 Dec 2026 16:04:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C8D71F000C1; Tue, 1 Dec 2026 16:04:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796141083; bh=MidEpAiy5lgZFmG3TCwvRMS2/tLPLO/0gpP78lOl/gA=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=l8FkKPG2i+dzTNxkvpdqt62GSry5VMbB/ndBY+gN3k+yjvcGAOcJVjFsfxraPLmVM lXJCCTv19cJ5xxgZwVph/lEA/71GUS8nOK18N1vAqEieWJOkCSWr0lp5DRD9CQ1WFj 7WLKahjBRtEl2BxsNctQBwC8znxU3CONZfus9+uoIixet2E22Gy8S1V8A+fVs7VmcI 8R9zkr3XUq689SIm4hoOLhlwuvnwILLGQ/hLw0+rNgQbXbJsjn/EybOyhVaOGVdL/F Yq0wlnbBZ+EFeHNJbqxvQYCl4vVNkT1lLoQ1TLh84ZUbGkbEjMfX54yv1eForTCBq2 7YTTVsvRaHdyA== X-Mailer: emacs 31.1 (via feedmail 11-beta-1 I) From: Aneesh Kumar K.V To: linux-coco@lists.linux.dev Cc: Andrew Morton , Baoquan He , Mike Rapoport , Pasha Tatashin , Pratyush Yadav , Catalin Marinas , Christian =?utf-8?Q?K=C3=B6nig?= , Jason Gunthorpe , Joerg Roedel , Marc Zyngier , Marek Szyprowski , Robin Murphy , Steven Price , Sumit Semwal , Suzuki K Poulose , Thomas Gleixner , Will Deacon , Russell King , Benjamin Gaignard , Brian Starkey , John Stultz , Mark Rutland , Radu Rendec , "T.J. Mercier" , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Ritesh Harjani , Shrikanth Hegde , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , Kiryl Shutsemau , Rick Edgecombe , "K . Y . Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Paolo Bonzini , Vitaly Kuznetsov , Andy Lutomirski , Peter Zijlstra , dri-devel@lists.freedesktop.org, iommu@lists.linux.dev, linaro-mm-sig@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-mm@kvack.org, kvmarm@lists.linux.dev, patches@lists.linux.dev Subject: Re: [PATCH v10 02/13] mm: Zero memory during shared memory transitions In-Reply-To: <20261116091137.94252-3-aneesh.kumar@kernel.org> References: <20261116091137.94252-1-aneesh.kumar@kernel.org> <20261116091137.94252-3-aneesh.kumar@kernel.org> Date: Tue, 01 Dec 2026 21:34:20 +0530 Message-ID: X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 "Aneesh Kumar K.V (Arm)" writes: > Architectures need to zero memory at different points in a private-to-shared > transition. For example, pKVM must clear memory before sharing it, while Arm > CCA can only clear it after the RSI transition has completed. > > Make zeroing an implicit property of set_memory_decrypted(). Each architecture > or platform performs the clear at the safe point in its transition. TDX > clears memory after the private-to-shared conversion succeeds in the finish > callback. AMD clears memory in its finish callback after the page-table > update, TLB flush, and hypervisor notification, including for SEV-SNP. This > zeros the final shared mapping without adding a flag to > set_memory_decrypted() or threading it through architecture-specific callbacks. > > Keep allocations on platforms without memory encryption on the ordinary page > allocator path so the original GFP constraints, including __GFP_ZERO, remain > intact. Remove post-transition memset() calls that are now redundant and > explicitly clear allocations on paths where no transition occurs. > > This intentionally makes every private-to-shared transition destructive; > callers can no longer use set_memory_decrypted() to preserve existing contents. > Could the x86 and s390 maintainers please review this change? > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Mark Rutland > Cc: Madhavan Srinivasan > Cc: Michael Ellerman > Cc: Nicholas Piggin > Cc: Christophe Leroy (CS GROUP) > Cc: Ritesh Harjani (IBM) > Cc: Shrikanth Hegde > Cc: Alexander Gordeev > Cc: Gerald Schaefer > Cc: Heiko Carstens > Cc: Vasily Gorbik > Cc: Christian Borntraeger > Cc: Sven Schnelle > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: Dave Hansen > Cc: x86@kernel.org > Cc: H. Peter Anvin > Cc: Kiryl Shutsemau > Cc: Rick Edgecombe > Cc: K. Y. Srinivasan > Cc: Haiyang Zhang > Cc: Wei Liu > Cc: Dexuan Cui > Cc: Long Li > Cc: Paolo Bonzini > Cc: Vitaly Kuznetsov > Cc: Andy Lutomirski > Cc: Peter Zijlstra > Cc: Marek Szyprowski > Cc: Robin Murphy > Cc: Andrew Morton > Signed-off-by: Aneesh Kumar K.V (Arm) [ ... 506 lines skipped ... ]