From: Sumit Garg <sumit.garg@kernel.org>
To: Kuldeep Singh <quic_kuldsing@quicinc.com>
Cc: "Amirreza Zarrabi" <amirreza.zarrabi@oss.qualcomm.com>,
"Jens Wiklander" <jens.wiklander@linaro.org>,
"Bjorn Andersson" <andersson@kernel.org>,
"Konrad Dybcio" <konradybcio@kernel.org>,
"Bartosz Golaszewski" <bartosz.golaszewski@linaro.org>,
"Apurupa Pattapu" <quic_apurupa@quicinc.com>,
"Kees Cook" <kees@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
linux-arm-msm@vger.kernel.org, op-tee@lists.trustedfirmware.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
linux-doc@vger.kernel.org
Subject: Re: [PATCH v4 08/11] tee: add Qualcomm TEE driver
Date: Thu, 15 May 2025 15:29:46 +0530 [thread overview]
Message-ID: <aCW7Es42TmtMioVH@sumit-X1> (raw)
In-Reply-To: <dc3c6aab-42d8-4741-826f-d22f140184e2@quicinc.com>
On Thu, May 15, 2025 at 02:35:34PM +0530, Kuldeep Singh wrote:
>
>
> On 5/14/2025 6:55 PM, Sumit Garg wrote:
> > Hi Amir,
> >
> > Apologies for getting to this patch review a bit late, mostly due to
> > it's enormous size.
> >
> > On Mon, Apr 28, 2025 at 11:06:29PM -0700, Amirreza Zarrabi wrote:
> >> Introduce qcomtee_object, which represents an object in both QTEE and
> >> the kernel. QTEE clients can invoke an instance of qcomtee_object to
> >> access QTEE services. If this invocation produces a new object in QTEE,
> >> an instance of qcomtee_object will be returned.
> >>
> >> Similarly, QTEE can request services from the kernel by issuing a callback
> >> request, which invokes an instance of qcomtee_object in the kernel.
> >> Any subsystem that exposes a service to QTEE should allocate and initialize
> >> an instance of qcomtee_object with a dispatcher callback that is called
> >> when the object is invoked.
> >
> > I can't see any kernel subsystem exposing a service to QTEE as of now. I
> > suppose RPMB is surely going to be the one. So I would suggest you to
> > drop exposing kernel APIs for that and instead they should be pushed
> > alongside a patch-set adding a real kernel service for QTEE. This will
> > help in the review as well.
> >
> >>
> >> Implement initial support for exporting qcomtee_object to userspace
> >> and QTEE, enabling the invocation of objects hosted in QTEE and userspace
> >> through the TEE subsystem.
> >
> > I think this is the main goal of this patch-set, so we should limit it
> > to that.
> >
> >>
> >> Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
> >> ---
> >> MAINTAINERS | 7 +
> >> drivers/tee/Kconfig | 1 +
> >> drivers/tee/Makefile | 1 +
> >> drivers/tee/qcomtee/Kconfig | 10 +
> >> drivers/tee/qcomtee/Makefile | 9 +
> >> drivers/tee/qcomtee/async.c | 160 +++++++
> >> drivers/tee/qcomtee/call.c | 764 +++++++++++++++++++++++++++++++
> >> drivers/tee/qcomtee/core.c | 806 +++++++++++++++++++++++++++++++++
> >> drivers/tee/qcomtee/qcom_scm.c | 38 ++
> >> drivers/tee/qcomtee/qcomtee_msg.h | 239 ++++++++++
> >> drivers/tee/qcomtee/qcomtee_private.h | 222 +++++++++
> >> drivers/tee/qcomtee/release.c | 48 ++
> >> drivers/tee/qcomtee/shm.c | 149 ++++++
> >> drivers/tee/qcomtee/user_obj.c | 713 +++++++++++++++++++++++++++++
> >> include/linux/firmware/qcom/qcom_tee.h | 302 ++++++++++++
> >> include/uapi/linux/tee.h | 1 +
> >> 16 files changed, 3470 insertions(+)
> >>
> >> diff --git a/MAINTAINERS b/MAINTAINERS
> >> index 906881b6c5cb..88a9ad34bcf6 100644
> >> --- a/MAINTAINERS
> >> +++ b/MAINTAINERS
> >> @@ -20257,6 +20257,13 @@ F: Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst
> >> F: drivers/net/ethernet/qualcomm/rmnet/
> >> F: include/linux/if_rmnet.h
> >>
> >> +QUALCOMM TEE (QCOMTEE) DRIVER
> >> +M: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
> >> +L: linux-arm-msm@vger.kernel.org
> >> +S: Maintained
> >> +F: drivers/tee/qcomtee/
> >> +F: include/linux/firmware/qcom/qcom_tee.h
> >> +
> >> QUALCOMM TRUST ZONE MEMORY ALLOCATOR
> >> M: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >> L: linux-arm-msm@vger.kernel.org
> >> diff --git a/drivers/tee/Kconfig b/drivers/tee/Kconfig
> >> index 61b507c18780..3a995d7f0d74 100644
> >> --- a/drivers/tee/Kconfig
> >> +++ b/drivers/tee/Kconfig
> >> @@ -16,5 +16,6 @@ if TEE
> >> source "drivers/tee/optee/Kconfig"
> >> source "drivers/tee/amdtee/Kconfig"
> >> source "drivers/tee/tstee/Kconfig"
> >> +source "drivers/tee/qcomtee/Kconfig"
> >>
> >> endif
> >> diff --git a/drivers/tee/Makefile b/drivers/tee/Makefile
> >> index 5488cba30bd2..74e987f8f7ea 100644
> >> --- a/drivers/tee/Makefile
> >> +++ b/drivers/tee/Makefile
> >> @@ -6,3 +6,4 @@ tee-objs += tee_shm_pool.o
> >> obj-$(CONFIG_OPTEE) += optee/
> >> obj-$(CONFIG_AMDTEE) += amdtee/
> >> obj-$(CONFIG_ARM_TSTEE) += tstee/
> >> +obj-$(CONFIG_QCOMTEE) += qcomtee/
> >> diff --git a/drivers/tee/qcomtee/Kconfig b/drivers/tee/qcomtee/Kconfig
> >> new file mode 100644
> >> index 000000000000..d180a6d07d33
> >> --- /dev/null
> >> +++ b/drivers/tee/qcomtee/Kconfig
> >> @@ -0,0 +1,10 @@
> >> +# SPDX-License-Identifier: GPL-2.0-only
> >> +# Qualcomm Trusted Execution Environment Configuration
> >> +config QCOMTEE
> >> + tristate "Qualcomm TEE Support"
> >> + select QCOM_SCM
> >
> > You should add a dependency on QCOM_TZMEM_MODE_SHMBRIDGE too here.
>
> I think you meant QCOM_TZMEM because MODE_SHMBRIDGE is one aspect just
> like MODE_GENERIC.
QCOM_TZMEM is selected by QCOM_SCM already. QTEE driver relies on
MODE_SHMBRIDGE to register memory objects with QTEE although if not
supported at runtime may skip that functionality. However, the config
option QCOM_TZMEM_MODE_SHMBRIDGE should get selected by default with
QTEE.
-Sumit
WARNING: multiple messages have this Message-ID (diff)
From: Sumit Garg via OP-TEE <op-tee@lists.trustedfirmware.org>
To: Kuldeep Singh <quic_kuldsing@quicinc.com>
Cc: "Amirreza Zarrabi" <amirreza.zarrabi@oss.qualcomm.com>,
"Bjorn Andersson" <andersson@kernel.org>,
"Konrad Dybcio" <konradybcio@kernel.org>,
"Bartosz Golaszewski" <bartosz.golaszewski@linaro.org>,
"Apurupa Pattapu" <quic_apurupa@quicinc.com>,
"Kees Cook" <kees@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
linux-arm-msm@vger.kernel.org, op-tee@lists.trustedfirmware.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
linux-doc@vger.kernel.org
Subject: Re: [PATCH v4 08/11] tee: add Qualcomm TEE driver
Date: Thu, 15 May 2025 15:29:46 +0530 [thread overview]
Message-ID: <aCW7Es42TmtMioVH@sumit-X1> (raw)
In-Reply-To: <dc3c6aab-42d8-4741-826f-d22f140184e2@quicinc.com>
On Thu, May 15, 2025 at 02:35:34PM +0530, Kuldeep Singh wrote:
>
>
> On 5/14/2025 6:55 PM, Sumit Garg wrote:
> > Hi Amir,
> >
> > Apologies for getting to this patch review a bit late, mostly due to
> > it's enormous size.
> >
> > On Mon, Apr 28, 2025 at 11:06:29PM -0700, Amirreza Zarrabi wrote:
> >> Introduce qcomtee_object, which represents an object in both QTEE and
> >> the kernel. QTEE clients can invoke an instance of qcomtee_object to
> >> access QTEE services. If this invocation produces a new object in QTEE,
> >> an instance of qcomtee_object will be returned.
> >>
> >> Similarly, QTEE can request services from the kernel by issuing a callback
> >> request, which invokes an instance of qcomtee_object in the kernel.
> >> Any subsystem that exposes a service to QTEE should allocate and initialize
> >> an instance of qcomtee_object with a dispatcher callback that is called
> >> when the object is invoked.
> >
> > I can't see any kernel subsystem exposing a service to QTEE as of now. I
> > suppose RPMB is surely going to be the one. So I would suggest you to
> > drop exposing kernel APIs for that and instead they should be pushed
> > alongside a patch-set adding a real kernel service for QTEE. This will
> > help in the review as well.
> >
> >>
> >> Implement initial support for exporting qcomtee_object to userspace
> >> and QTEE, enabling the invocation of objects hosted in QTEE and userspace
> >> through the TEE subsystem.
> >
> > I think this is the main goal of this patch-set, so we should limit it
> > to that.
> >
> >>
> >> Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
> >> ---
> >> MAINTAINERS | 7 +
> >> drivers/tee/Kconfig | 1 +
> >> drivers/tee/Makefile | 1 +
> >> drivers/tee/qcomtee/Kconfig | 10 +
> >> drivers/tee/qcomtee/Makefile | 9 +
> >> drivers/tee/qcomtee/async.c | 160 +++++++
> >> drivers/tee/qcomtee/call.c | 764 +++++++++++++++++++++++++++++++
> >> drivers/tee/qcomtee/core.c | 806 +++++++++++++++++++++++++++++++++
> >> drivers/tee/qcomtee/qcom_scm.c | 38 ++
> >> drivers/tee/qcomtee/qcomtee_msg.h | 239 ++++++++++
> >> drivers/tee/qcomtee/qcomtee_private.h | 222 +++++++++
> >> drivers/tee/qcomtee/release.c | 48 ++
> >> drivers/tee/qcomtee/shm.c | 149 ++++++
> >> drivers/tee/qcomtee/user_obj.c | 713 +++++++++++++++++++++++++++++
> >> include/linux/firmware/qcom/qcom_tee.h | 302 ++++++++++++
> >> include/uapi/linux/tee.h | 1 +
> >> 16 files changed, 3470 insertions(+)
> >>
> >> diff --git a/MAINTAINERS b/MAINTAINERS
> >> index 906881b6c5cb..88a9ad34bcf6 100644
> >> --- a/MAINTAINERS
> >> +++ b/MAINTAINERS
> >> @@ -20257,6 +20257,13 @@ F: Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst
> >> F: drivers/net/ethernet/qualcomm/rmnet/
> >> F: include/linux/if_rmnet.h
> >>
> >> +QUALCOMM TEE (QCOMTEE) DRIVER
> >> +M: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
> >> +L: linux-arm-msm@vger.kernel.org
> >> +S: Maintained
> >> +F: drivers/tee/qcomtee/
> >> +F: include/linux/firmware/qcom/qcom_tee.h
> >> +
> >> QUALCOMM TRUST ZONE MEMORY ALLOCATOR
> >> M: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >> L: linux-arm-msm@vger.kernel.org
> >> diff --git a/drivers/tee/Kconfig b/drivers/tee/Kconfig
> >> index 61b507c18780..3a995d7f0d74 100644
> >> --- a/drivers/tee/Kconfig
> >> +++ b/drivers/tee/Kconfig
> >> @@ -16,5 +16,6 @@ if TEE
> >> source "drivers/tee/optee/Kconfig"
> >> source "drivers/tee/amdtee/Kconfig"
> >> source "drivers/tee/tstee/Kconfig"
> >> +source "drivers/tee/qcomtee/Kconfig"
> >>
> >> endif
> >> diff --git a/drivers/tee/Makefile b/drivers/tee/Makefile
> >> index 5488cba30bd2..74e987f8f7ea 100644
> >> --- a/drivers/tee/Makefile
> >> +++ b/drivers/tee/Makefile
> >> @@ -6,3 +6,4 @@ tee-objs += tee_shm_pool.o
> >> obj-$(CONFIG_OPTEE) += optee/
> >> obj-$(CONFIG_AMDTEE) += amdtee/
> >> obj-$(CONFIG_ARM_TSTEE) += tstee/
> >> +obj-$(CONFIG_QCOMTEE) += qcomtee/
> >> diff --git a/drivers/tee/qcomtee/Kconfig b/drivers/tee/qcomtee/Kconfig
> >> new file mode 100644
> >> index 000000000000..d180a6d07d33
> >> --- /dev/null
> >> +++ b/drivers/tee/qcomtee/Kconfig
> >> @@ -0,0 +1,10 @@
> >> +# SPDX-License-Identifier: GPL-2.0-only
> >> +# Qualcomm Trusted Execution Environment Configuration
> >> +config QCOMTEE
> >> + tristate "Qualcomm TEE Support"
> >> + select QCOM_SCM
> >
> > You should add a dependency on QCOM_TZMEM_MODE_SHMBRIDGE too here.
>
> I think you meant QCOM_TZMEM because MODE_SHMBRIDGE is one aspect just
> like MODE_GENERIC.
QCOM_TZMEM is selected by QCOM_SCM already. QTEE driver relies on
MODE_SHMBRIDGE to register memory objects with QTEE although if not
supported at runtime may skip that functionality. However, the config
option QCOM_TZMEM_MODE_SHMBRIDGE should get selected by default with
QTEE.
-Sumit
next prev parent reply other threads:[~2025-05-15 9:59 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-29 6:06 [PATCH v4 00/11] Trusted Execution Environment (TEE) driver for Qualcomm TEE (QTEE) Amirreza Zarrabi
2025-04-29 6:06 ` Amirreza Zarrabi
2025-04-29 6:06 ` [PATCH v4 01/11] tee: allow a driver to allocate a tee_device without a pool Amirreza Zarrabi
2025-04-29 6:06 ` Amirreza Zarrabi
2025-04-29 6:06 ` [PATCH v4 02/11] tee: add close_context to TEE driver operation Amirreza Zarrabi
2025-04-29 6:06 ` Amirreza Zarrabi
2025-05-14 13:46 ` Sumit Garg
2025-05-14 13:46 ` Sumit Garg
2025-04-29 6:06 ` [PATCH v4 03/11] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_UBUF Amirreza Zarrabi
2025-04-29 6:06 ` Amirreza Zarrabi
2025-05-14 13:46 ` Sumit Garg
2025-05-14 13:46 ` Sumit Garg
2025-04-29 6:06 ` [PATCH v4 04/11] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF Amirreza Zarrabi
2025-04-29 6:06 ` Amirreza Zarrabi
2025-04-29 6:06 ` [PATCH v4 05/11] firmware: qcom: scm: add support for object invocation Amirreza Zarrabi
2025-04-29 6:06 ` Amirreza Zarrabi
2025-05-14 9:37 ` Sumit Garg
2025-05-14 9:37 ` Sumit Garg
2025-05-14 15:27 ` Bartosz Golaszewski
2025-05-14 15:27 ` Bartosz Golaszewski
2025-05-15 6:10 ` Sumit Garg
2025-04-29 6:06 ` [PATCH v4 06/11] firmware: qcom: scm: remove unused arguments to the shm_brige Amirreza Zarrabi
2025-04-29 6:06 ` Amirreza Zarrabi
2025-05-05 10:58 ` Kuldeep Singh
2025-05-05 10:58 ` Kuldeep Singh
2025-05-05 23:18 ` Amirreza Zarrabi
2025-05-05 23:18 ` Amirreza Zarrabi
2025-04-29 6:06 ` [PATCH v4 07/11] firmware: qcom: tzmem: export shm_bridge create/delete Amirreza Zarrabi
2025-04-29 6:06 ` Amirreza Zarrabi
2025-04-29 6:06 ` [PATCH v4 08/11] tee: add Qualcomm TEE driver Amirreza Zarrabi
2025-04-29 6:06 ` Amirreza Zarrabi
2025-05-07 7:58 ` kernel test robot
2025-05-07 7:58 ` kernel test robot
2025-05-14 13:25 ` Sumit Garg
2025-05-14 13:25 ` Sumit Garg via OP-TEE
2025-05-15 9:05 ` Kuldeep Singh
2025-05-15 9:59 ` Sumit Garg [this message]
2025-05-15 9:59 ` Sumit Garg via OP-TEE
2025-05-27 0:59 ` Amirreza Zarrabi
2025-05-27 0:59 ` Amirreza Zarrabi via OP-TEE
2025-04-29 6:06 ` [PATCH v4 09/11] qcomtee: add primordial object Amirreza Zarrabi
2025-04-29 6:06 ` Amirreza Zarrabi
2025-05-14 13:44 ` Sumit Garg
2025-05-14 13:44 ` Sumit Garg
2025-04-29 6:06 ` [PATCH v4 10/11] qcomtee: enable TEE_IOC_SHM_ALLOC ioctl Amirreza Zarrabi
2025-04-29 6:06 ` Amirreza Zarrabi
2025-04-29 6:06 ` [PATCH v4 11/11] Documentation: tee: Add Qualcomm TEE driver Amirreza Zarrabi
2025-04-29 6:06 ` Amirreza Zarrabi
2025-04-29 13:01 ` [PATCH v4 00/11] Trusted Execution Environment (TEE) driver for Qualcomm TEE (QTEE) neil.armstrong
2025-04-29 13:01 ` neil.armstrong
2025-04-30 23:14 ` Amirreza Zarrabi
2025-04-30 23:14 ` Amirreza Zarrabi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aCW7Es42TmtMioVH@sumit-X1 \
--to=sumit.garg@kernel.org \
--cc=amirreza.zarrabi@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gustavoars@kernel.org \
--cc=jens.wiklander@linaro.org \
--cc=kees@kernel.org \
--cc=konradybcio@kernel.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=op-tee@lists.trustedfirmware.org \
--cc=quic_apurupa@quicinc.com \
--cc=quic_kuldsing@quicinc.com \
--cc=sumit.semwal@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.