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 38E3CEA8121 for ; Tue, 10 Feb 2026 14:49:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 95E1110E5A5; Tue, 10 Feb 2026 14:49:09 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=resnulli-us.20230601.gappssmtp.com header.i=@resnulli-us.20230601.gappssmtp.com header.b="jKxfqZ5O"; dkim-atps=neutral Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id A5ABD10E5A3 for ; Tue, 10 Feb 2026 14:49:08 +0000 (UTC) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-47ee3a63300so10918805e9.2 for ; Tue, 10 Feb 2026 06:49:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1770734947; x=1771339747; darn=lists.freedesktop.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=knkS23bKgxD0sGFgNoxwcHFypphehdzY/C+BgKABh1k=; b=jKxfqZ5O1R0bK8xLw9NRRF7R13eGFLt67Y97n9VltOFiR7tof/wGoQ7Og2dLWxzVD3 Ymdwm/7cXvTmdJkG4ZygsOiBM/V0DBrBe3tFltrxcT9MibfyYYUqeXk94vNTTdqGg9Up IFbGBLAzEOzgGBg5yN+7Hb6qP/Z3NtJSfTN+Gh/7JhlRqZ+dkfLCy9XxTctnLqgQo5GA c0tjTPEz0ARGTp7/6QSwEB5uv7DBlKPIDqx29DLONDaWJHi3s5MumjBavKqpDMYA+N5E jH/qr6RPDL4rFfnqOtiNlrK6nun+/LDdfA2DEk9Tmy8jsW+HuaJn8soJt+/g/4eztA/z OZtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770734947; x=1771339747; h=in-reply-to:content-disposition: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; bh=knkS23bKgxD0sGFgNoxwcHFypphehdzY/C+BgKABh1k=; b=abGH/chfaWF6iaCo0W0xAOj3OsfCAWQdtca6ITG0HT1zli1WnNimjwf3F57HKxgAzK QHjR07LbnUpdX7rFk3aYXWVz5xaoRBJmLnCvYNYTj3Q/x3y3PINhWE0STfZ2ZLhculrQ PAshmQxC0jUqInDxbEp2AXgNbeL6o12pYpxEfxadtzSZo98zASiD5PxoLnJ6Fxg2RBFV zas1Y1xXo0JpG4eGu/4OLU1j4w8CWUaPp77IUh1hkgEtGp6v83qcki4WW+hoylOWFUTj XpHk7Dp1O0wJZ67BOBYFSltKLJFmA3SxNgsQN4EPrAelo4aE0vY/uvQczA44FPuv6CI6 VA6g== X-Forwarded-Encrypted: i=1; AJvYcCWoz+PIzwr6FYNZdklMofQ6KQdBUd/k7NJQq6H3bcmsvWlehVEJFSJt4TSN4zh/kqXhbMs8iuXJWtc=@lists.freedesktop.org X-Gm-Message-State: AOJu0Yyu/8tNZ/Q0uu/J7NS6vhZIQhTP9ZT4PBoY/W4Bt6Ujc9Me5C1c CL9k7vAj4M0SOaCh1V/js1E9FCnWaYKtNWTtjSSV+GWo87Yjs6JAo/hY5TrZExOTXXs= X-Gm-Gg: AZuq6aLdhjoJr+qg1KQ8DmEEqnrbd7TpWxpaEC1fhB25Q2eoBnL11s2YdClgL2CLh9K Dw8rA8z/oq7w3zlnainSxZggvKV+dk70rFs23urEiqFwl14N/VhbQZ/2TGKHrlgz7C35PWkMpW8 W2NtZSLu1saxgZ5TUUxbiXKFozd6J3QRiHuMekFhhn7AriZd8scR7tVy+Hs0Yx/7aI2CkaQ9wJo Xa7NqnSEO9EZ0bTPhJkqATVHc0vKWJ8fbxrjiun30Z2X04tN+E7PXlU+HCrND02wY8WL427eLpi UDm8Rqor1ZH8knEHWJH3yAAsnDzKlCitd+k21FJk3mrVN0AUz0o+u0+xEO7ye5uXw53zmIDIE95 C0GTS6ZxIXy+A1Dk5Kx7qRDQDfoxqvXwgpYe+drUyRV9l9vSqw2I/PHSbQWrI5t4KIeEC90RDar s4zuiK6dIDuvPhu17dwaoYPPvu0IkFCZyo9ps= X-Received: by 2002:a05:600c:3f0a:b0:47e:e712:aa88 with SMTP id 5b1f17b1804b1-48320236ad7mr236498725e9.31.1770734946334; Tue, 10 Feb 2026 06:49:06 -0800 (PST) Received: from FV6GYCPJ69 ([140.209.217.211]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-436296bd1c9sm34022302f8f.15.2026.02.10.06.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Feb 2026 06:49:05 -0800 (PST) Date: Tue, 10 Feb 2026 15:49:02 +0100 From: Jiri Pirko To: Jason Gunthorpe Cc: John Stultz , dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, iommu@lists.linux.dev, linux-media@vger.kernel.org, sumit.semwal@linaro.org, benjamin.gaignard@collabora.com, Brian.Starkey@arm.com, tjmercier@google.com, christian.koenig@amd.com, m.szyprowski@samsung.com, robin.murphy@arm.com, leon@kernel.org, sean.anderson@linux.dev, ptesarik@suse.com, catalin.marinas@arm.com, aneesh.kumar@kernel.org, suzuki.poulose@arm.com, steven.price@arm.com, thomas.lendacky@amd.com, john.allen@amd.com, ashish.kalra@amd.com, suravee.suthikulpanit@amd.com, linux-coco@lists.linux.dev Subject: Re: [PATCH 4/5] dma-buf: heaps: allow heap to specify valid heap flags Message-ID: References: <20260209153809.250835-1-jiri@resnulli.us> <20260209153809.250835-5-jiri@resnulli.us> <20260210002927.GC943673@ziepe.ca> <20260210124357.GD943673@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260210124357.GD943673@ziepe.ca> 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" Tue, Feb 10, 2026 at 01:43:57PM +0100, jgg@ziepe.ca wrote: >On Tue, Feb 10, 2026 at 10:14:08AM +0100, Jiri Pirko wrote: > >> >I'd advocate that the right design is for userspace to positively >> >signal via this flag that it wants/accepts shared memory and without >> >the flag shared memory should never be returned. >> >> We can have the same behaviour with the separate heap, can't we? >> Userpace positively signals it wants/accepts the shared memory by >> choosing "system_cc_decrypted" heap name. > >So what do the other heap names do? Always private? Do you ever get >heaps that are unknowably private or shared (eg MMIO backed?) If I understand the code correctly, you may get something like this: $ ls /dev/dma_heap/ default_cma_region protected,secure-video protected,secure-video-record protected,trusted-ui system The "protected*" ones are created by tee. I believe they handle memory that is inaccesible to CPU.