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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 67A8FC3064D for ; Wed, 26 Jun 2024 17:57:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9ZM4co7+zgQAd1qBwWCVAAvV8TVVgRW2ezKZ6IWngwg=; b=GSfMlpIsaF4bs0DQA7I71+FoTK XpQJ/vUTZdrtoSTZq9WuPq1HooBsKvbauylU862TNlOOcl0Q2D1G6erFFEcQ8VVMJom9H2u49Q0Xm kFFzfaUdj5juREfBMmwNiZDJLhgdj0ce1erZVpOIkam4cKKh47dkp8O6DEYXzRpCFBDVuMqmFV7uK w9p4qWkzR22gloy0JQJXF+XJbXg7esCihU2zWudVs3aPHpX2J2APa22QaJM+un8FcDuZpLLWi54DI vi3mWAcipmBfyjzj3f1nZenBOiVUc7B6y9KxW9pGExvXZmr5kA+69G9OWyaYCZ/ei3glNog/BLYpO I30NKy5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMWt6-00000007pmf-2Jk5; Wed, 26 Jun 2024 17:56:57 +0000 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMWsz-00000007pkC-2Hs2 for linux-arm-kernel@lists.infradead.org; Wed, 26 Jun 2024 17:56:51 +0000 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2ed5af6b214so955091fa.1 for ; Wed, 26 Jun 2024 10:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1719424607; x=1720029407; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:from:to:cc:subject:date:message-id:reply-to; bh=9ZM4co7+zgQAd1qBwWCVAAvV8TVVgRW2ezKZ6IWngwg=; b=CKkrJgmiWAwmmKn0qhTwxgvKbbg/isyAUUgeLdwm3DOk0hZ/J7pq7HE5o2phmyY9V1 GL9V4qB0hSinGG0Xti6CU1Lzf+hRD9GyXIyz5ODbtQ28E7CT3NRKVfI+bp4RLbRHxJw5 hNe4fMdZyRn8crEJz7zvjfttJRzzdhta5qU48= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719424607; x=1720029407; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9ZM4co7+zgQAd1qBwWCVAAvV8TVVgRW2ezKZ6IWngwg=; b=rRz4LNkeO3NTN4LET09JWg3TWi8m0L2/L/nGjkCEYIjUi8HvR05wgjPlfXDu5woVi9 WLI1df5rcGeHe7qA+ebcmyVXiR7AgP+tygl6UyQMadnj8QHJ1YdIu4vRtu5KrIkmKCWo tgksQ/W87sToP8n0vOOSYQ+et3WZpQrCjY8G5XZN7Pcz38K3R8pIeh1vFcgFW0+siHTs u6uQu8Sjy7bUauPRC6dx4ImvJYSIfkZX3fuf/0u1pREL59RowpSsgTLA/C7CHxH2Oe+9 iErVErv5Mj2WokxItWB5pQH+3cXF0S6cM+LZaCe0tA1UQasKkxdUZrppNAUDraDruGCr YmJw== X-Forwarded-Encrypted: i=1; AJvYcCVi5uBJ4wdpVOOzqJFLZjjFsi7g2pponwvfUt0ENDkv/qe3ETw5mnsPM207mzNPgpW6gwGUU4Sxz2MrcIdMjaXkJeImv1v6mumU/9oZ2O34FFIY/ks= X-Gm-Message-State: AOJu0YyFBKgG1ilAob9ad/grIwUvlzDIv23eAJMAouMn+2EyY+2gaJfh 0Fv9YxDRdwNP/VR25ewVkAkgNU+wpPXtQLlMr9/ZBMQuSjhPO0ipcQlpDYRiPys= X-Google-Smtp-Source: AGHT+IHpT050wLlCJMuYquS/RZZlwvPNrgj194MZbf2u4dKv3AnFWfObCpyKJAMPQnTOJYHQGnJJZA== X-Received: by 2002:a2e:9903:0:b0:2ec:4176:dcaf with SMTP id 38308e7fff4ca-2ec54ce1c2bmr76783881fa.3.1719424605371; Wed, 26 Jun 2024 10:56:45 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-424c84245f0sm34437855e9.33.2024.06.26.10.56.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 10:56:44 -0700 (PDT) Date: Wed, 26 Jun 2024 19:56:42 +0200 From: Daniel Vetter To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: Jason-JH Lin =?utf-8?B?KOael+edv+elpSk=?= , "matthias.bgg@gmail.com" , Yong Wu =?utf-8?B?KOWQtOWLhyk=?= , "sumit.semwal@linaro.org" , "robh+dt@kernel.org" , "akpm@linux-foundation.org" , "mripard@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mediatek@lists.infradead.org" , "jstultz@google.com" , "linaro-mm-sig@lists.linaro.org" , "linux-media@vger.kernel.org" , "devicetree@vger.kernel.org" , Jianjiao Zeng =?utf-8?B?KOabvuWBpeWnoyk=?= , "willy@infradead.org" , Kuohong Wang =?utf-8?B?KOeOi+Wci+m0uyk=?= , "quic_vjitta@quicinc.com" , "pavel@ucw.cz" , "robin.murphy@arm.com" , "contact@emersion.fr" , "logang@deltatee.com" , "daniel@ffwll.ch" , "jkardatzke@google.com" , "conor+dt@kernel.org" , "Brian.Starkey@arm.com" , "benjamin.gaignard@collabora.com" , "tjmercier@google.com" , "krzysztof.kozlowski+dt@linaro.org" , "dri-devel@lists.freedesktop.org" , "linux-arm-kernel@lists.infradead.org" , "joakim.bech@linaro.org" , "ppaalanen@gmail.com" , "angelogioacchino.delregno@collabora.com" , Youlin Pei =?utf-8?B?KOijtOWPi+aelyk=?= Subject: Re: [PATCH v5 2/9] scatterlist: Add a flag for the restricted memory Message-ID: Mail-Followup-To: Christian =?iso-8859-1?Q?K=F6nig?= , Jason-JH Lin =?utf-8?B?KOael+edv+elpSk=?= , "matthias.bgg@gmail.com" , Yong Wu =?utf-8?B?KOWQtOWLhyk=?= , "sumit.semwal@linaro.org" , "robh+dt@kernel.org" , "akpm@linux-foundation.org" , "mripard@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mediatek@lists.infradead.org" , "jstultz@google.com" , "linaro-mm-sig@lists.linaro.org" , "linux-media@vger.kernel.org" , "devicetree@vger.kernel.org" , Jianjiao Zeng =?utf-8?B?KOabvuWBpeWnoyk=?= , "willy@infradead.org" , Kuohong Wang =?utf-8?B?KOeOi+Wci+m0uyk=?= , "quic_vjitta@quicinc.com" , "pavel@ucw.cz" , "robin.murphy@arm.com" , "contact@emersion.fr" , "logang@deltatee.com" , "jkardatzke@google.com" , "conor+dt@kernel.org" , "Brian.Starkey@arm.com" , "benjamin.gaignard@collabora.com" , "tjmercier@google.com" , "krzysztof.kozlowski+dt@linaro.org" , "dri-devel@lists.freedesktop.org" , "linux-arm-kernel@lists.infradead.org" , "joakim.bech@linaro.org" , "ppaalanen@gmail.com" , "angelogioacchino.delregno@collabora.com" , Youlin Pei =?utf-8?B?KOijtOWPi+aelyk=?= References: <20240515112308.10171-1-yong.wu@mediatek.com> <20240515112308.10171-3-yong.wu@mediatek.com> <98721904-003d-4d0d-8cfe-1cecdd59ce01@amd.com> <779ce30a657754ff945ebd32b66e1c644635e84d.camel@mediatek.com> <1050c44512374031d1349b5dced228d0efc3fbde.camel@mediatek.com> <3104b765-5666-44e4-8788-f1b1b296fe17@amd.com> <98c11bad7f40bcc79ed7a2039ddb3a46f99908f5.camel@mediatek.com> <75dc1136-7751-4772-9fa7-dd9124684cd2@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <75dc1136-7751-4772-9fa7-dd9124684cd2@amd.com> X-Operating-System: Linux phenom 6.8.9-amd64 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240626_105649_617947_E2A29E36 X-CRM114-Status: GOOD ( 32.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 26, 2024 at 12:49:02PM +0200, Christian König wrote: > Am 26.06.24 um 10:05 schrieb Jason-JH Lin (林睿祥): > > > > I think I have the same problem as the ECC_FLAG mention in: > > > > > > https://lore.kernel.org/linux-media/20240515-dma-buf-ecc-heap-v1-0-54cbbd049511@kernel.org/ > > > > > > I think it would be better to have the user configurable private > > > > information in dma-buf, so all the drivers who have the same > > > > requirement can get their private information from dma-buf directly > > > > and > > > > no need to change or add the interface. > > > > > > What's your opinion in this point? > > > > Well of hand I don't see the need for that. > > > > What happens if you get a non-secure buffer imported in your secure > > > device? > > > > We use the same mediatek-drm driver for secure and non-secure buffer. > > If non-secure buffer imported to mediatek-drm driver, it's go to the > > normal flow with normal hardware settings. > > > > We use different configurations to make hardware have different > > permission to access the buffer it should access. > > > > So if we can't get the information of "the buffer is allocated from > > restricted_mtk_cma" when importing the buffer into the driver, we won't > > be able to configure the hardware correctly. > > Why can't you get this information from userspace? Same reason amd and i915/xe also pass this around internally in the kernel, it's just that for those gpus the render and kms node are the same driver so this is easy. But on arm you have split designs everywhere and dma-buf import/export, so something else is needed. And neither current kms uapi nor protocols/extensions have provisions for this (afaik) because it works on the big gpus, and on android it's just hacked up with backchannels. So yeah essentially I think we probably need something like this, as much as it sucks. I see it somewhat similar to handling pcip2pdma limitations in the kernel too. Not sure where/how it should be handled though, and maybe I've missed something around protocols, in which case I guess we should add some secure buffer flags to the ADDFB2 ioctl. -Sima -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch