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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73028C9830B for ; Wed, 23 Sep 2026 15:11:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 536756B0088; Wed, 23 Sep 2026 11:11:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E7B26B008A; Wed, 23 Sep 2026 11:11:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FDB76B008C; Wed, 23 Sep 2026 11:11:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 22B336B0088 for ; Wed, 23 Sep 2026 11:11:55 -0400 (EDT) Received: from smtpin15.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 979A41A0789 for ; Wed, 23 Sep 2026 15:11:54 +0000 (UTC) X-FDA: 85245366948.15.8312B11 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf08.hostedemail.com (Postfix) with ESMTP id 6E02A160014 for ; Wed, 23 Sep 2026 15:11:52 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=arm.com header.s=foss header.b=bOu4yUj0; spf=pass (imf08.hostedemail.com: domain of suzuki.poulose@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=suzuki.poulose@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1790176312; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=P2btTVDYltsgCYavYwVuiOIHeKZyL8Gt5tbLOPUFFJ0=; b=LrCMsOWInPR+8yTdgqQ/vuRPdKRPKJ9JZgQBg536gB8/iGgZw6VrIDKMzMCZApVltSAg3/ LfXcoosevZhPcwYdRkk9Hhtkh+K/VAjTpLOodyeo41zavBZSt43XSrFln1zJz7SqSSv+kS HBwCSncpPxNBImyRUxCsc/85B+idtHc= ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1790176312; b=NAMVMUgA/wGuSAWRqYK8EKH/ifIGYv9+ci6P0bdpUgE9/4mw3E6I63B/AhJAgRqMRMkYOG RObyJb38lAwMN1/9wXWLfM0v936xmtiXcNMXzLUx8O3rGh2PDkw60j0Qez/iTGqTvs++Dn HTuFw1cBTb/7arsvldj87ISTpwo1CZE= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=arm.com header.s=foss header.b=bOu4yUj0; spf=pass (imf08.hostedemail.com: domain of suzuki.poulose@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=suzuki.poulose@arm.com; dmarc=pass (policy=none) header.from=arm.com 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-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 6E02A160014 X-Stat-Signature: okkoi91to69ye7xdesiqubxgjm7khe5x X-HE-Tag: 1790176312-133452 X-HE-Meta: U2FsdGVkX1+XhRzlOCrGbr7eIidDho85KW14BSz1xY7FEnuIcJbSK9rlC7thTPiOjQ+2KBLvoQu4RpOMGItDwQqcIkex//CJdflmfN+bAWx0FNNbyUpDVotZ5rHthOl1dXh/ervRu0MkNkGdf98Gj/5R+cOwc8M1ah8cbxsduhza8l6HimMpt80ZIY6IIBGZUm51uoZbZED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SRo5xdo0QLP5vy Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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