From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81AB834107D for ; Mon, 13 Jul 2026 19:13:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783970018; cv=none; b=DkeXaw6sMSA4RIpzfzeGrY299S4ibtbkmyQAvdjfQvtsSmI97FBiIbehKIua1asGyhabIZqnFV3f5lJWq0ePallq4Qop14yVmHMERg79+CYJ4rQ8MkFYzzv9jKNrrapMRGXRy7MInGZDdlfJpBavtwZgTuA9Cs/fs6c29wrvXqo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783970018; c=relaxed/simple; bh=92pQU4Hi+MtUFsgN9vNGOKjNaZ7KSv66gg2PCC2d0mk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fnas2fHNOfC4lszn9/oLWH19XBUqEopy+jPdBE9XBkZ8Iwyh8lsGGNlIeOGD0KjLWGDhQEN7GSYMOvFgCGLmptViczBVIC+wFmwcQxoV+C/60HW6QUKs2JCxdejJCU33wEnkh5FL3RbmCd4Hszcg2CwH2LbnTy/a/I+DvRSHmkQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=X+FJtney; arc=none smtp.client-ip=209.85.222.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="X+FJtney" Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-92e7632b193so21091185a.2 for ; Mon, 13 Jul 2026 12:13:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1783970016; x=1784574816; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=GfyQxZTxEaV2M3A7Wuj8sGJT6iMHPBQ3Q1zHUbuKZKY=; b=X+FJtneytfqfXy7zQB93jwoK0szhm67je+1u5mvahofIgGkRha+WGnKKDDJvr0Vwx0 fSL3ile12+AbINr9+y6IGQn57MHIx03b06e8kMOfc3jN5anp+E5lbWghOAYXuryZ1G93 BvgYwh3edykCohmB/57obh41mAePg9Kfna/lgID17uAEf2y3xQqkJXUdul63WRjqcVSa KBqLQapMgvO0dkbCZSSFHPGbI2bDosyFFoMiM6oMnJ8sAl68VTunQ1zEr9uFfalm0Vzf FBEM5Gj631BRH0T1Ntim5bRqXSWXmgZaP3DzVJZYkniqMoMs/1FwmyP/Pu5hE/603YSH v2Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783970016; x=1784574816; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=GfyQxZTxEaV2M3A7Wuj8sGJT6iMHPBQ3Q1zHUbuKZKY=; b=YWPO3h4ruHgdl3DyI3Ze0LwhPnDEW0ld8OHLn4nZltYo0JPZRWrSwuS6Mj+OyQr/R5 ktSfzAnmhhBJ6+FhvO/cem6DO0dT6og+DtlT0cm/PPp3y8rTsrLPtpHFjZ8csQ51W1oA SVCYqdiJMiDHqLCEO3NhYzxFL4cJt0ruvHCfNN+ZgsSlNzZuTlqtBLHTYbVrAxSF/ZG5 plxwOXeax15EtZyI9hglMNF6XTj1sxIMzJktdv4ps90b8oDBlhUKd1N/4LQQsNbaaD6i F5QhZHRKOkWyjLD9dJZqDh+cN7IoXWLMWwfEuXderez2NDHWpXVpWwXIJ83qYShBEfKW Rzgg== X-Forwarded-Encrypted: i=1; AHgh+Rq9+EOqFLOq7Ksg2doFrKNCbhfg8BJomy78s8vhRGWMmG37xOU0xhhkJlhxBDavBy9a/La4gkRjkbOsFAE=@vger.kernel.org X-Gm-Message-State: AOJu0YxDYFUUfayzCdKVH4MK/JonV5WT1GtdPmJ3ri8D0Hx047mkZd36 oRm3D29dU/13GEtHbel45FJPKFfMG0aIF8zGn8yYBY5OGhHV9u5XDncLHHlUvFZigVs= X-Gm-Gg: AfdE7cntwIDaeF19I3YMSjGLdv6iAl7P/1iF5K60L7HQS/H/X0R6gYzxiRarWkG2CaU ywv65mPIRK0znnIPdj7vhbW3Oz8oCjMdbyPWRnNRwismo/1sa1btFo0N/emGGEcutdURE6sxuuI xqY2Ib1/1nbKD2mPMA8ONt275iwk9ycy8te9iT9vAN4j1BSq1w0ZRA4dFJ1ERX59F7ULzcBswT6 OfDppwwT7q9t9xgzK5w+eVknoWbNkmPWIus5nQeOIsAdk6harpmop8canBZG/BLSQE8VK9E85Gq kpdgRM6KykwRSO1Altfww7ol1eJ2kH/xRn85yx0QYFh6F5ktq3HAFZypXdeW2X9ZvXGPgE7fTy8 hQNNAxL5P0TVPFPagzvWhJv+Z2hKQFPRKiTOejfCanrqX2K9J83xDc4NiePx8 X-Received: by 2002:a05:620a:8908:b0:92b:6805:9198 with SMTP id af79cd13be357-92ef2c69c53mr1083302685a.64.1783970016442; Mon, 13 Jul 2026 12:13:36 -0700 (PDT) Received: from ziepe.ca ([159.2.72.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-92ee5bab293sm1169545085a.18.2026.07.13.12.13.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 12:13:35 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wjM5v-0000000E4M5-1cBx; Mon, 13 Jul 2026 16:13:35 -0300 Date: Mon, 13 Jul 2026 16:13:35 -0300 From: Jason Gunthorpe To: "Aneesh Kumar K.V (Arm)" Cc: iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, Robin Murphy , Marek Szyprowski , Will Deacon , Marc Zyngier , Steven Price , Suzuki K Poulose , Catalin Marinas , Jiri Pirko , 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 09/22] dma-mapping: Add internal shared allocation attribute Message-ID: <20260713191335.GP3133966@ziepe.ca> References: <20260701054926.825925-1-aneesh.kumar@kernel.org> <20260701054926.825925-10-aneesh.kumar@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260701054926.825925-10-aneesh.kumar@kernel.org> On Wed, Jul 01, 2026 at 11:19:13AM +0530, Aneesh Kumar K.V (Arm) wrote: > DMA_ATTR_CC_SHARED describes an existing DMA mapping whose backing memory > is already shared, or decrypted, for confidential computing. It is a > mapping attribute: callers use it to request a shared DMA address encoding > for memory that has already been prepared for shared DMA. > > Allocation paths need a related but different state. Once the DMA core > decides that an allocation must use shared backing pages, the lower-level > allocation helpers need to select shared pools, decrypt newly allocated > pages, derive the DMA address with the shared-memory translation and > restore encryption on free. That state is internal to the DMA-mapping > implementation and should not be passed by drivers to dma_alloc_attrs(). > > Signed-off-by: Aneesh Kumar K.V (Arm) > --- > Documentation/core-api/dma-attributes.rst | 29 +++++++++++++++++++++++ > include/linux/dma-mapping.h | 8 +++++++ > include/trace/events/dma.h | 3 ++- > 3 files changed, 39 insertions(+), 1 deletion(-) Reviewed-by: Jason Gunthorpe Jason