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 1CDC3E7E0DB for ; Mon, 9 Feb 2026 20:08:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8217A10E36C; Mon, 9 Feb 2026 20:08:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="Zxzfq94r"; dkim-atps=neutral Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 72E5010E36C for ; Mon, 9 Feb 2026 20:08:17 +0000 (UTC) Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-b884ad1026cso13359466b.2 for ; Mon, 09 Feb 2026 12:08:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1770667696; cv=none; d=google.com; s=arc-20240605; b=P23AI58EhbS4y43UiHcz0BK7V2HF7ZApDno80dlepR/41UdT74ncIThNVYg5X6GauZ ujOT6NsZgyPRv4jqaNBNzUJp27qWfAFo6Zc5xqFkoll67+gSyWalNxn5zZNUeJEIDJAc qnOAVxFf9zhi21ILblFOuRbLlURW5vKimXYuV6cPMjYsh4WDMzSaKyrdm+XRYrOmq5WJ sR1gjNjLoJ+U/5poUs77WYsWVKlSyvKzSKRGfJdU2T1y9yusW1MI0pEmrWhTPhJjMJQH uN3B/6OeemTqVxK8bJ6LTbUwx0jqwq7+SWxGzzWt1cBNEOPutRCLbUkV0WX9tCZyQ185 k5hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=/ogWTbSZ6gUFcHF4DB6Cif+r0lW3KkX6R4Nx10iOT0E=; fh=mfhnUmUQeqTNzS9rwMuBAPxcROppY5k8sgmAq7oo4JA=; b=Wv90m3MdoUSQnaepD8aZgHgNGZ8LPBsZys39g13MFXhVM54uhkagpCqM+OE+u6N/Ks znsfNz7m9FLOH+Ukf+9PJIkXgorVGLEULppEEhkxymgPxSR9eDVylHPDHDpqwLgdmhkj t95buHLtpLxisx2PRz+DkSy1fNqQKnNcscGuOXRJolMFthxlSVpoTua0MvQ4TYd17LII cALUdS/tMDYqBCD9UNjaAsAWFpu3GfUizMaPciz823eDcX7QWZOqBKz19YFHFa5ZtkMo GnZ/+/nDkL2KoU8TpPW7UarAIXArCUbPVHHWUqTCoHnXIVVHwsvj7HnwLaYsrHTZK0CA miyA==; darn=lists.freedesktop.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770667696; x=1771272496; darn=lists.freedesktop.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/ogWTbSZ6gUFcHF4DB6Cif+r0lW3KkX6R4Nx10iOT0E=; b=Zxzfq94rSmoEL6xKhFuijBTPpVvTyYZtOj36S+2GDyi+nyc6WdMOah1JiMnhT+6VFg BefV4Y7l3LhD5gzSQw/kpEm/hbkqtk0XwBU8PA4MZ6sSTvd1q0f8sMP48djYqvVsv50u PNBXECeS3rJvSo50nRlZF5aqR92Q6T3w8LQHUpa9O7Ts6qe0lQPdwBrmk0vxJdF9lEi7 z/OYC2rAIhvDGM54omzLOxGmkoF1vGOIZvS3REZ5rEf1rAbot3W4huYGZVqHzYg5xztw XZjVbNSFpzqen9vRv5Kjd9RfN9fJ5dGgeY4GB3W2hf5gsZnn284SgkyQDcQOsfdXe7sL F4kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770667696; x=1771272496; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/ogWTbSZ6gUFcHF4DB6Cif+r0lW3KkX6R4Nx10iOT0E=; b=HDUixalEbuxuRYF/Ad145BDYg+p4jQc0Bny+at9DwAWImZlGMD1RJnq8WqFCdZB9s6 dpF0x1BXAEmZlF5Yk27pGjxzrIrJVYXwMlAbKK+6wcZ5Q+VtpyVF0UJrhJgO14gVr4o+ xCnPCMOhQReB/DAd0UAIK0l6y62N7ZTdAyENcTrOuNIohbTr3piD9/FSnE3ecWDWRuj+ /vKyXxuJtgi20VM41yKtUsFr5rDU+qnup60t6J0/YgVpMt+akEKQMHWvPz3SEtCQJxrL vsBi/Mrx/psnFduzryfEnXWZwyFOe428QEN96Jks5IVrbe/Ymdj4vetdN80lE/TEys+U bknQ== X-Gm-Message-State: AOJu0YyPNR0Rwd1r7P+cLIUaUlnsvuF8bNfuMJjdnRANgHkfNd5fcgms JUFQQ64mXErR9D9MThMN37KZOBDV9449ZsDqtS6+rL7NxLU0tMerjXZyliUPYzRh7QFcZ85pLYy 1uxEbM2sr/vGdkw6fasfQTpMvOENrl2gF0i97xJk= X-Gm-Gg: AZuq6aKXBCHXB0HinCXKfhlaij7auuEmMzM2/Eor9J2Q/J1HMD9giK4gV0Ib5W0a4uF 8DBVfGR3dxMQk/8re6aYPenZuDnh+ySDAfdgAxFfG1BwAeNjRKUYS7tMgS3qH/i9dIpfeWntcpV fXq01m6mIG9PtErs8IswMiEkSqIsnCjxsupTxy4JP2EbiAkUXF80yeZm7J7aXX2QUBxPpXvL0YU AVIXn6PMjavUjaw3peD7OrJXwo4sGgWh341sUU6jH/o4eqcKDCqoLpj87Q1dxrznIlmc9i14T4O Ps7xN3uSTMhSfKhaCGI= X-Received: by 2002:a17:907:6d0f:b0:b74:984c:a3de with SMTP id a640c23a62f3a-b8edf25a954mr696952366b.28.1770667695453; Mon, 09 Feb 2026 12:08:15 -0800 (PST) MIME-Version: 1.0 References: <20260209153809.250835-1-jiri@resnulli.us> <20260209153809.250835-5-jiri@resnulli.us> In-Reply-To: <20260209153809.250835-5-jiri@resnulli.us> From: John Stultz Date: Mon, 9 Feb 2026 12:08:03 -0800 X-Gm-Features: AZwV_QgqaltPSA0q99dWV0j2auNF_GQoTvkX0OemEzMtzBNfhVP0pPFcsDiXkzY Message-ID: Subject: Re: [PATCH 4/5] dma-buf: heaps: allow heap to specify valid heap flags To: Jiri Pirko Cc: 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, jgg@ziepe.ca, 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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" On Mon, Feb 9, 2026 at 7:38=E2=80=AFAM Jiri Pirko wrote: > > From: Jiri Pirko > > Currently the flags, which are unused, are validated for all heaps. > Since the follow-up patch introduces a flag valid for only one of the > heaps, allow to specify the valid flags per-heap. I'm not really in this space anymore, so take my feedback with a grain of s= alt. While the heap allocate flags argument is unused, it was intended to be used for generic allocation flags that would apply to all or at least a wide majority of heaps. It was definitely not added to allow for per-heap or heap specific flags (as this patch tries to utilize it). That was the mess we had with ION driver that we were trying to avoid. The intent of dma-buf heaps is to try to abstract all the different device memory constraints so there only needs to be a [usage] -> [heap] mapping, and otherwise userland can be generalized so that it doesn't need to be re-written to work with different devices/memory types. Adding heap-specific allocation flags prevents that generalization. So instead of adding heap specific flags, the general advice has been to add a separate heap name for the flag property. Now, there has been many discussions around "protected buffers" (which doesn't seem to map exactly to this confidental computing primitive, but sounds like it might be related) , which have bounced between being a allocation flag or a device specific heap without much resolution. I appreciate in this patch seires you've pushed your concept down into a DMA_ATTR_, as I do feel the kernel should have a deeper sense of protected buffers (or any general propery like this) as a concept if it is going to be a generic allocation flag, instead of it being a somewhat thin creation of the outer heap-driver layer. But, it seems like the use case here is still far too narrow for a top level allocation flag. So I'd advocate against introducing heap-specific flags like this. thanks -john