Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp676188lqp; Wed, 12 Jun 2024 12:44:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX5YCK7DASRt1eNdE2lzKW2xNlQvubm9nynYQQ91tEfkxG9ib0VnAopVIWvpmGfxY4kc8tDoH9fbRzbdGmGoxczFrunWHN4zXp5zEQG/w== X-Google-Smtp-Source: AGHT+IG3OjY6UzndU5+or0o1AUDOndfIK8nD78KpW+NyNBoXqIM9oB/vyh74+9/IxYLVHPFgdVtI X-Received: by 2002:a17:907:320b:b0:a6e:771a:2a8c with SMTP id a640c23a62f3a-a6f47d35a55mr202387966b.21.1718221458202; Wed, 12 Jun 2024 12:44:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718221458; cv=pass; d=google.com; s=arc-20160816; b=SIC9y07kTLx6bMy4ruWjBsOX6Fa5DauPeN8uhPHhg89Jg4wC0mE+Au2Hzn5ryTN4Bi gVKWMtpNTxsvL9Nk7hMDDt0Cy5L09hTzyq0/qogwwM2dg6oMbp5HBt2ZPkZExA70Df79 xOAZ+pXnNRKQTFefKO0U6KpuRyT9Po8tm088ltm09B8LdUTLrfiRxWA60NYu7Hf5onIN kFdq+YYkIeqQXelkSCAcwLJQ3ISc1shnYQaIPAW/lLEDt4sUOmqIgOpv7J/VVdUvvqOK nQQUUpinhG088adZ6gi0OVKljpdQ+1lB0uHUoKlAegGBV1Q9yAEaAj0ygEZD45RcKFic rKEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=O+FtYBDXnbweDOL4R19ZV1/NNhwH5Y4Lp4FSBLIU0eI=; fh=nqydyu/hLhMBD3v8huuVMziJTtPp45Xs0ltj2+A0UuY=; b=miHtgzDvdGkiQPJUEoHPZ+LBoicUGZKLeZ9Gn3Q42NFRC4w1NjYDBf6b15Nq3Thbjq lTXDh6Sz/ztmNxArX4txEsJjSvBe0ZlN+WMNEi/oC5jVbSqI1itkE7vkDcHXrcD/Ejbl 7HUZ5oAhP1ytQh9jrAkOU2Tj7LjCqORqD3a5yA0b8xl7X6D7ksAUtuEgyyVGZLWTvlwu UxpyZmQ0a3p1Q9kXt9azBTag+gQ4I1FmBGMxTyHvp8aZlmAKEfxUGr5jnHFGws5y9tdk 8kf1iSoCqfnVUIi8IF7Oz8K5k1InMTs/wnEU0uqIH2ZICrEMOH56sAr/v5vuq8Y+DzJg c2Sg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JIGHAZj2; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-212168-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212168-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f1c51b6desi369112466b.778.2024.06.12.12.44.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 12:44:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212168-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JIGHAZj2; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-212168-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212168-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E748E1F22A0B for ; Wed, 12 Jun 2024 19:44:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BEE3C84038; Wed, 12 Jun 2024 19:44:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="JIGHAZj2" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7104182860; Wed, 12 Jun 2024 19:44:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718221449; cv=none; b=DSDBoWjlayuag59VSmH5pxhJSn6VgsThd1xZ6Z2fKuZqvoPWkvsp3N7dC1FMdGAMn/Xi60/o0VgNDgRf1QeqmxKxg4igtEaylfHEZc1RQFnsv04tjaEAMKtqOZRD+l/Y3JuDjBE1uqqc91thcKRuS9TY0eCL6leWpB9FQr44yVw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718221449; c=relaxed/simple; bh=O+FtYBDXnbweDOL4R19ZV1/NNhwH5Y4Lp4FSBLIU0eI=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=cFoSL3irj/1Tq2/ZMAtZ3esUuDG6aOz03+JneSVOQ1nzCrqdQDaLaodMeqG7P4uOxFKSn8leIadyZrcO1JlkHpO9DjS1D9p1VnWeIljsZsgJObFvlgLtYM9qsTW3gJZR043/f+LoXmmrvhxcAhsV95URtTwuVBRpeY9S1sVSZa8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=JIGHAZj2; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718221445; bh=O+FtYBDXnbweDOL4R19ZV1/NNhwH5Y4Lp4FSBLIU0eI=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=JIGHAZj2aQD8Hf9VwrqLKLytT4dBeSTIJBFXagatR7vdFUsPH/EF9pjdUJUUfrXbt wqAbkemqdxjfLNrKrzo2anATw1gMq5x59nVVJM9ZY5FRIKfpQmAXV0kpPctLDPLTP1 XtlIewrROieob8JRnMLmwbglgi0JhIjgfuSeA4C3IH9vFvQu+dGxgkrMiTFxO6jMKS 3krRYoi7ipn9fU8f3IkM/GnM/O5BSMPNNWdzVIUveQXL0SplP78uVA+B8WtPoNv4jt m10m9kBwO+tBXqGEaAsWX9nmoPup8osFQUJsYEIa0xMafS+8UQx1Q3V9YAZ/mJaaWr 0CZWeoEVqskVQ== Received: from nicolas-tpx395.localdomain (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nicolas) by madrid.collaboradmins.com (Postfix) with ESMTPSA id B9AEA378065F; Wed, 12 Jun 2024 19:44:01 +0000 (UTC) Message-ID: <33d38919f3f94b6e1848aaee20cf52ac9c1df606.camel@collabora.com> Subject: Re: [PATCH v6,04/24] v4l: add documentation for restricted memory flag From: Nicolas Dufresne To: Tomasz Figa , Laurent Pinchart Cc: Yunfei Dong , Jeffrey Kardatzke , =?ISO-8859-1?Q?N=EDcolas?= "F . R . A . Prado" , Nathan Hebert , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Sebastian Fricke , Mauro Carvalho Chehab , Marek Szyprowski , Chen-Yu Tsai , Yong Wu , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , Sumit Semwal , Brian Starkey , John Stultz , "T . J . Mercier" , Christian =?ISO-8859-1?Q?K=F6nig?= , Matthias Brugger , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com Date: Wed, 12 Jun 2024 15:43:58 -0400 In-Reply-To: References: <20240516122102.16379-1-yunfei.dong@mediatek.com> <20240516122102.16379-5-yunfei.dong@mediatek.com> <20240522111622.GA31185@pendragon.ideasonboard.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.2 (3.52.2-1.fc40) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi, Le mercredi 12 juin 2024 =C3=A0 13:37 +0900, Tomasz Figa a =C3=A9crit=C2=A0= : > > Why is this flag needed ? Given that the usage model requires the V4L2 > > device to be a dma buf importer, why would userspace set the > > V4L2_BUF_CAP_SUPPORTS_RESTRICTED_MEM flag and pass a non-restricted > > buffer to the device ? >=20 > Given that the flag is specified at REQBUF / CREATE_BUFS time, it's > actually useful to tell the driver the queue is operating in restricted > (aka secure) mode. >=20 > I suppose we could handle that at the time of a first QBUF, but that > would make the driver initialization and validation quite a bit of pain. > So I'd say that the design being proposed here makes things simpler and > more clear, even if it doesn't add any extra functionality. There is few more reasons I notice in previous series (haven't read the lat= est): - The driver needs to communicate through the OPTEE rather then SCP and som= e communication are needed just to figure-out things like supported profile/l= evel resolutions etc. - The driver needs to allocate auxiliary buffers in secure heap too, alloca= tion at runtime are not the best Note that the discussion around this flag already took place in the very fi= rst iteration of the serie, it was originally using a CID and that was a propos= ed replacement from Hans. regards, Nicolas