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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 D7D99C98302 for ; Wed, 23 Sep 2026 15:11:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3D3A710E158; Wed, 23 Sep 2026 15:11:53 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.b="bOu4yUj0"; dkim-atps=neutral Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id DDC2910E158 for ; Wed, 23 Sep 2026 15:11:51 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B8C911A32; Wed, 23 Sep 2026 08:11:47 -0700 (PDT) Received: from [192.168.4.158] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8BF113F86F; Wed, 23 Sep 2026 08:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1790176311; bh=0ZF92qlGhBT9ghFKBAdomT/d7B9mUVR6sojJo9EGm84=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=bOu4yUj0Q/cyKCDPQmnlZSSfBzN2YZFcQ+BYeXIGsn3j2NxCyoWazWfOEchSwBK6z p7crav7v88lmt9BsVnUEIn7iRY066xMU2EuJK+FPQ0L1X2J3RaUrkxZaBNckO20vz+ 0TW+qGgaK5iTEA87RU/L+SeG35VjqNjOB4ZTOJt0= Message-ID: <86fb3438-8028-49c5-9b4e-2a0970efb91d@arm.com> Date: Wed, 23 Sep 2026 16:11:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v7 02/13] mm: Add an allocator for CoCo shared memory Content-Language: en-GB To: "Aneesh Kumar K.V" , Jason Gunthorpe , Catalin Marinas Cc: linux-coco@lists.linux.dev, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, Andrew Morton , christian.koenig@amd.com, Joerg Roedel , Marc Zyngier , Marek Szyprowski , Robin Murphy , Steven Price , Sumit Semwal , Thomas Gleixner , Will Deacon , dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org, linux-mm@kvack.org, Michael Kelley References: <20260921144847.501151-1-aneesh.kumar@kernel.org> <20260921144847.501151-3-aneesh.kumar@kernel.org> <20260923130611.GF1540250@ziepe.ca> From: Suzuki K Poulose In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Cc: Michael Kelley On 23/09/2026 15:58, Aneesh Kumar K.V wrote: > Jason Gunthorpe writes: > >> On Wed, Sep 23, 2026 at 11:40:36AM +0100, Catalin Marinas wrote: >> >>> The simplest is probably to always zero in the backend and ignore >>> __GFP_ZERO to the allocator. But it's probably only marginally smaller >>> than passing a CC_SHARED_ZERO flag down. Get codex to try this as well >>> and compare the diffstat. >> >> For patch ordering I would convert to use the allocator first >> >> The semantics of the new API should be clear >> >> If you pass GFP_ZERO then the resulting allocated memory is zero >> >> Otherwise the allocator does Whatever The Arch Needs to not leak >> private data out. >> > > ok > >> >> Once places are converted to the allocator lets go see what is left >> and ask why it is left and what API it actually needs. >> > > I'm also considering requiring the address passed to cc_make_shared() to > be in the linear map. This is currently required by both TDX and CCA, > while AMD SNP appears to support vmalloc addresses. The only user of > that vmalloc support is Hyper-V VMBus GPADL setup > (vmbus_establish_gpadl()). How should the generic CoCo shared-memory > allocator handle this? This came up in the past and there was a recommendation to alloc shared pages and vmap them ? I have lost track of it. Cheers Suzuki> > -aneesh