On 1/7/2026 8:55 PM, Aristo Chen wrote:
> Hi Mario,
>
> Mario Limonciello <superm1(a)kernel.org> 於 2026年1月7日週三 下午11:28寫道:
>>
>> On 1/7/26 9:26 AM, Aristo Chen wrote:
>>> Add a generic TEE revision sysfs attribute backed by a new
>>> optional get_tee_revision() callback. The revision string is
>>> diagnostic-only and must not be used to infer feature support.
>>>
>>> Signed-off-by: Aristo Chen <aristo.chen(a)canonical.com>
>>> ---
>>> Documentation/ABI/testing/sysfs-class-tee | 10 +++++
>>> drivers/tee/tee_core.c | 51 ++++++++++++++++++++++-
>>> include/linux/tee_core.h | 9 ++++
>>> 3 files changed, 69 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/Documentation/ABI/testing/sysfs-class-tee b/Documentation/ABI/testing/sysfs-class-tee
>>> index c9144d16003e..6e783210104e 100644
>>> --- a/Documentation/ABI/testing/sysfs-class-tee
>>> +++ b/Documentation/ABI/testing/sysfs-class-tee
>>> @@ -13,3 +13,13 @@ Description:
>>> space if the variable is absent. The primary purpose
>>> of this variable is to let systemd know whether
>>> tee-supplicant is needed in the early boot with initramfs.
>>> +
>>> +What: /sys/class/tee/tee{,priv}X/revision
>>> +Date: Dec 2025
>>> +KernelVersion: 6.18
>>
>> This needs to be bumped up and dates pushed out.
>
> I will fix this in the v6 patch, thanks!
>
>>
>>> +Contact: op-tee(a)lists.trustedfirmware.org
>>> +Description:
>>> + Read-only revision string reported by the TEE driver. This is
>>> + for diagnostics only and must not be used to infer feature
>>> + support. Use TEE_IOC_VERSION for capability and compatibility
>>> + checks.
>>> diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c
>>> index d65d47cc154e..0a00499811c1 100644
>>> --- a/drivers/tee/tee_core.c
>>> +++ b/drivers/tee/tee_core.c
>>> @@ -1146,7 +1146,56 @@ static struct attribute *tee_dev_attrs[] = {
>>> NULL
>>> };
>>>
>>> -ATTRIBUTE_GROUPS(tee_dev);
>>> +static const struct attribute_group tee_dev_group = {
>>> + .attrs = tee_dev_attrs,
>>> +};
>>> +
>>> +static ssize_t revision_show(struct device *dev,
>>> + struct device_attribute *attr, char *buf)
>>> +{
>>> + struct tee_device *teedev = container_of(dev, struct tee_device, dev);
>>> + char version[TEE_REVISION_STR_SIZE];
>>> + int ret;
>>> +
>>> + if (!teedev->desc->ops->get_tee_revision)
>>> + return -ENODEV;
>>> +
>>> + ret = teedev->desc->ops->get_tee_revision(teedev, version,
>>> + sizeof(version));
>>> + if (ret)
>>> + return ret;
>>> +
>>> + return sysfs_emit(buf, "%s\n", version);
>>> +}
>>> +static DEVICE_ATTR_RO(revision);
>>> +
>>> +static struct attribute *tee_revision_attrs[] = {
>>> + &dev_attr_revision.attr,
>>> + NULL
>>> +};
>>> +
>>> +static umode_t tee_revision_attr_is_visible(struct kobject *kobj,
>>> + struct attribute *attr, int n)
>>> +{
>>> + struct device *dev = kobj_to_dev(kobj);
>>> + struct tee_device *teedev = container_of(dev, struct tee_device, dev);
>>> +
>>> + if (teedev->desc->ops->get_tee_revision)
>>> + return attr->mode;
>>> +
>>> + return 0;
>>> +}
>>> +
>>> +static const struct attribute_group tee_revision_group = {
>>> + .attrs = tee_revision_attrs,
>>> + .is_visible = tee_revision_attr_is_visible,
>>> +};
>>> +
>>> +static const struct attribute_group *tee_dev_groups[] = {
>>> + &tee_dev_group,
>>> + &tee_revision_group,
>>> + NULL
>>> +};
>>>
>>> static const struct class tee_class = {
>>> .name = "tee",
>>> diff --git a/include/linux/tee_core.h b/include/linux/tee_core.h
>>> index 1f3e5dad6d0d..ee5f0bd41f43 100644
>>> --- a/include/linux/tee_core.h
>>> +++ b/include/linux/tee_core.h
>>> @@ -76,6 +76,9 @@ struct tee_device {
>>> /**
>>> * struct tee_driver_ops - driver operations vtable
>>> * @get_version: returns version of driver
>>> + * @get_tee_revision: returns revision string (diagnostic only);
>>
>> Why is this comment here about it being for diagnostics only? I feel
>> it's up to the implementation how it would be used.
>
> According to the previous discussion, we would like to prevent user
> thinking about optee os version x.y means z feature, and we should
> always use TEE_IOC_VERSION for capability and compatibility
> check.
>
> Is there any other specific use case that makes you think removing
> the wording is required?
Ah I didn't realize there was previous discussion that lead to this, I
saw some earlier versions in my holiday mailbox glut but ignored them
when I saw the new one.
Leave it as is then.
>
>>
>>> + * do not infer feature support from this, use
>>> + * TEE_IOC_VERSION instead
>>> * @open: called for a context when the device file is opened
>>> * @close_context: called when the device file is closed
>>> * @release: called to release the context
>>> @@ -95,9 +98,12 @@ struct tee_device {
>>> * client closes the device file, even if there are existing references to the
>>> * context. The TEE driver can use @close_context to start cleaning up.
>>> */
>>> +
>>> struct tee_driver_ops {
>>> void (*get_version)(struct tee_device *teedev,
>>> struct tee_ioctl_version_data *vers);
>>> + int (*get_tee_revision)(struct tee_device *teedev,
>>> + char *buf, size_t len);
>>> int (*open)(struct tee_context *ctx);
>>> void (*close_context)(struct tee_context *ctx);
>>> void (*release)(struct tee_context *ctx);
>>> @@ -123,6 +129,9 @@ struct tee_driver_ops {
>>> int (*shm_unregister)(struct tee_context *ctx, struct tee_shm *shm);
>>> };
>>>
>>> +/* Size for TEE revision string buffer used by get_tee_revision(). */
>>> +#define TEE_REVISION_STR_SIZE 128
>>> +
>>> /**
>>> * struct tee_desc - Describes the TEE driver to the subsystem
>>> * @name: name of driver
>>
>
> Best regards,
> Aristo
Enable QCOMTEE driver on Qualcomm SM8650+ SoCs to facilitate communication
with the Qualcomm Trusted Execution Environment (QTEE).
(No enablement required in DTS files since QCOMTEE device is dynamically
registered by the QCOM_SCM firmware driver)
Signed-off-by: Harshal Dev <harshal.dev(a)oss.qualcomm.com>
---
Changes in v3:
- Updated the commit message to reflect the supported Qualcomm platforms.
- Link to v2: https://lore.kernel.org/r/20251205-qcom_qcomtee_defconfig-v2-1-c92560b0346e…
Changes in v2:
- Updated CONFIG_QCOMTEE flag to 'm' since QCOMTEE can be built as a module.
- Link to v1: https://lore.kernel.org/r/20251202-qcom_qcomtee_defconfig-v1-1-11bfe40a8ea4…
---
arch/arm64/configs/defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index cdb7d69e3b24..e952d24bef77 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -1789,6 +1789,7 @@ CONFIG_FPGA_MGR_ZYNQMP_FPGA=m
CONFIG_FPGA_MGR_VERSAL_FPGA=m
CONFIG_TEE=y
CONFIG_OPTEE=y
+CONFIG_QCOMTEE=m
CONFIG_MUX_GPIO=m
CONFIG_MUX_MMIO=y
CONFIG_SLIMBUS=m
---
base-commit: 47b7b5e32bb7264b51b89186043e1ada4090b558
change-id: 20251202-qcom_qcomtee_defconfig-8dc0fed1411b
Best regards,
--
Harshal Dev <harshal.dev(a)oss.qualcomm.com>
Hello,
the objective of this series is to make tee driver stop using callbacks
in struct device_driver. These were superseded by bus methods in 2006
(commit 594c8281f905 ("[PATCH] Add bus_type probe, remove, shutdown
methods.")) but nobody cared to convert all subsystems accordingly.
Here the tee drivers are converted. The first commit is somewhat
unrelated, but simplifies the conversion (and the drivers). It
introduces driver registration helpers that care about setting the bus
and owner. (The latter is missing in all drivers, so by using these
helpers the drivers become more correct.)
v1 of this series is available at
https://lore.kernel.org/all/cover.1765472125.git.u.kleine-koenig@baylibre.c…
Changes since v1:
- rebase to v6.19-rc1 (no conflicts)
- add tags received so far
- fix whitespace issues pointed out by Sumit Garg
- fix shutdown callback to shutdown and not remove
As already noted in v1's cover letter, this series should go in during a
single merge window as there are runtime warnings when the series is
only applied partially. Sumit Garg suggested to apply the whole series
via Jens Wiklander's tree.
If this is done the dependencies in this series are honored, in case the
plan changes: Patches #4 - #17 depend on the first two.
Note this series is only build tested.
Uwe Kleine-König (17):
tee: Add some helpers to reduce boilerplate for tee client drivers
tee: Add probe, remove and shutdown bus callbacks to tee_client_driver
tee: Adapt documentation to cover recent additions
hwrng: optee - Make use of module_tee_client_driver()
hwrng: optee - Make use of tee bus methods
rtc: optee: Migrate to use tee specific driver registration function
rtc: optee: Make use of tee bus methods
efi: stmm: Make use of module_tee_client_driver()
efi: stmm: Make use of tee bus methods
firmware: arm_scmi: optee: Make use of module_tee_client_driver()
firmware: arm_scmi: Make use of tee bus methods
firmware: tee_bnxt: Make use of module_tee_client_driver()
firmware: tee_bnxt: Make use of tee bus methods
KEYS: trusted: Migrate to use tee specific driver registration
function
KEYS: trusted: Make use of tee bus methods
tpm/tpm_ftpm_tee: Make use of tee specific driver registration
tpm/tpm_ftpm_tee: Make use of tee bus methods
Documentation/driver-api/tee.rst | 18 +----
drivers/char/hw_random/optee-rng.c | 26 ++----
drivers/char/tpm/tpm_ftpm_tee.c | 31 +++++---
drivers/firmware/arm_scmi/transports/optee.c | 32 +++-----
drivers/firmware/broadcom/tee_bnxt_fw.c | 30 ++-----
drivers/firmware/efi/stmm/tee_stmm_efi.c | 25 ++----
drivers/rtc/rtc-optee.c | 27 ++-----
drivers/tee/tee_core.c | 84 ++++++++++++++++++++
include/linux/tee_drv.h | 12 +++
security/keys/trusted-keys/trusted_tee.c | 17 ++--
10 files changed, 164 insertions(+), 138 deletions(-)
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
--
2.47.3
The function cmd_alloc_suppl() was renamed as
optee_rpc_cmd_alloc_suppl() in commit c51a564a5b48
("optee: isolate smc abi"). Update the comment
accordingly.
Signed-off-by: Julia Lawall <Julia.Lawall(a)inria.fr>
---
drivers/tee/optee/rpc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tee/optee/rpc.c b/drivers/tee/optee/rpc.c
index ebbbd42b0e3e..97fc5b14db0c 100644
--- a/drivers/tee/optee/rpc.c
+++ b/drivers/tee/optee/rpc.c
@@ -247,8 +247,8 @@ void optee_rpc_cmd_free_suppl(struct tee_context *ctx, struct tee_shm *shm)
param.u.value.c = 0;
/*
- * Match the tee_shm_get_from_id() in cmd_alloc_suppl() as secure
- * world has released its reference.
+ * Match the tee_shm_get_from_id() in optee_rpc_cmd_alloc_suppl()
+ * as secure world has released its reference.
*
* It's better to do this before sending the request to supplicant
* as we'd like to let the process doing the initial allocation to
Initializing automatic __free variables to NULL without need (e.g.
branches with different allocations), followed by actual allocation is
in contrary to explicit coding rules guiding cleanup.h:
"Given that the "__free(...) = NULL" pattern for variables defined at
the top of the function poses this potential interdependency problem the
recommendation is to always define and assign variables in one statement
and not group variable definitions at the top of the function when
__free() is used."
Code does not have a bug, but is less readable and uses discouraged
coding practice, so fix that by moving declaration to the place of
assignment.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski(a)oss.qualcomm.com>
---
drivers/tee/qcomtee/call.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/tee/qcomtee/call.c b/drivers/tee/qcomtee/call.c
index 65f9140d4e1f..8f8830f0df26 100644
--- a/drivers/tee/qcomtee/call.c
+++ b/drivers/tee/qcomtee/call.c
@@ -395,9 +395,7 @@ static int qcomtee_object_invoke(struct tee_context *ctx,
struct tee_ioctl_object_invoke_arg *arg,
struct tee_param *params)
{
- struct qcomtee_object_invoke_ctx *oic __free(kfree) = NULL;
struct qcomtee_context_data *ctxdata = ctx->data;
- struct qcomtee_arg *u __free(kfree) = NULL;
struct qcomtee_object *object;
int i, ret, result;
@@ -412,12 +410,14 @@ static int qcomtee_object_invoke(struct tee_context *ctx,
}
/* Otherwise, invoke a QTEE object: */
- oic = qcomtee_object_invoke_ctx_alloc(ctx);
+ struct qcomtee_object_invoke_ctx *oic __free(kfree) =
+ qcomtee_object_invoke_ctx_alloc(ctx);
if (!oic)
return -ENOMEM;
/* +1 for ending QCOMTEE_ARG_TYPE_INV. */
- u = kcalloc(arg->num_params + 1, sizeof(*u), GFP_KERNEL);
+ struct qcomtee_arg *u __free(kfree) = kcalloc(arg->num_params + 1, sizeof(*u),
+ GFP_KERNEL);
if (!u)
return -ENOMEM;
@@ -562,9 +562,8 @@ static int qcomtee_supp_send(struct tee_context *ctx, u32 errno, u32 num_params,
static int qcomtee_open(struct tee_context *ctx)
{
- struct qcomtee_context_data *ctxdata __free(kfree) = NULL;
-
- ctxdata = kzalloc(sizeof(*ctxdata), GFP_KERNEL);
+ struct qcomtee_context_data *ctxdata __free(kfree) = kzalloc(sizeof(*ctxdata),
+ GFP_KERNEL);
if (!ctxdata)
return -ENOMEM;
@@ -645,12 +644,12 @@ static void qcomtee_get_version(struct tee_device *teedev,
static void qcomtee_get_qtee_feature_list(struct tee_context *ctx, u32 id,
u32 *version)
{
- struct qcomtee_object_invoke_ctx *oic __free(kfree) = NULL;
struct qcomtee_object *client_env, *service;
struct qcomtee_arg u[3] = { 0 };
int result;
- oic = qcomtee_object_invoke_ctx_alloc(ctx);
+ struct qcomtee_object_invoke_ctx *oic __free(kfree) =
+ qcomtee_object_invoke_ctx_alloc(ctx);
if (!oic)
return;
--
2.51.0
Main updates from version V19[3]:
--------------------------------
The devicetree is now structured as follows:
firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
#address-cells = <1>;
#size-cells = <0>;
rproc-service@0 {
compatible = "rproc-service-80a4c275-0a47-4905-8285-1486a9771a08";
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
m4: m4@0 {
compatible = "st,stm32mp15-m4-tee";
reg = <0>;
mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
mbox-names = "vq0", "vq1", "shutdown";
memory-region = <&vdev0vring0>, <&m_ipc_shm>, <&mcuram2>,
<&vdev0vring1>, <&vdev0buffer>, <&retram>;
interrupt-parent = <&exti>;
interrupts = <68 1>;
status = "okay";
};
};
};
};
As a consequence, this version:
- Introduces a new stm32_rproc_tee.c remoteproc driver.
Instead of further complicating the existing stm32_rproc.c driver, a
dedicated TEE-based driver is added. Both drivers are intended to also
support the STM32MP2x Cortex-M33 remote processor in a next step.
- Reworks the bindings:
- Drop the st,stm32-rproc.yaml updates that were introduced in previous
revisions.
- Add remoteproc-tee.yaml for the
"rproc-service-80a4c275-0a47-4905-8285-1486a9771a08" compatible.
- Add st,stm32-rproc-tee.yaml for the "st,stm32mp15-m4-tee" compatible.
- Reworks the probing sequence:
The m4@0 device is now probed by the remoteproc-tee driver, which itself
is instantiated by the TEE (OP-TEE) bus.
Main updates from version V18[2]:
--------------------------------
- rework documentation for the release_fw ops
- rework function documentation in remoteproc_tee.c
- replace spinlock by mutex and generalize usage in remoteproc_tee.c
Main updates from version V17[1]:
--------------------------------
- Fix: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h>
is missing
More details are available in each patch commit message.
[1] https://lore.kernel.org/linux-remoteproc/20250613091650.2337411-1-arnaud.po…
[2] https://lore.kernel.org/linux-remoteproc/20250616075530.4106090-1-arnaud.po…
[3] https://lore.kernel.org/linux-devicetree/20250625094028.758016-1-arnaud.pou…
Tested-on:
---------
commit 7d0a66e4bb90 ("Linux 6.18")
Description of the feature:
--------------------------
This series proposes the implementation of a remoteproc tee driver to
communicate with a TEE trusted application responsible for authenticating
and loading the remoteproc firmware image in an Arm secure context.
1) Principle:
The remoteproc tee driver provides services to communicate with the OP-TEE
trusted application running on the Trusted Execution Context (TEE).
The trusted application in TEE manages the remote processor lifecycle:
- authenticating and loading firmware images,
- isolating and securing the remote processor memories,
- supporting multi-firmware (e.g., TF-M + Zephyr on a Cortex-M33),
- managing the start and stop of the firmware by the TEE.
2) Format of the signed image:
Refer to:
https://github.com/OP-TEE/optee_os/blob/master/ta/remoteproc/src/remoteproc…
3) OP-TEE trusted application API:
Refer to:
https://github.com/OP-TEE/optee_os/blob/master/ta/remoteproc/include/ta_rem…
4) OP-TEE signature script
Refer to:
https://github.com/OP-TEE/optee_os/blob/master/scripts/sign_rproc_fw.py
Example of usage:
sign_rproc_fw.py --in <fw1.elf> --in <fw2.elf> --out <signed_fw.sign> --key ${OP-TEE_PATH}/keys/default.pem
5) Impact on User space Application
No sysfs impact. The user only needs to provide the signed firmware image
instead of the ELF image.
For more information about the implementation, a presentation is available here
(note that the format of the signed image has evolved between the presentation
and the integration in OP-TEE).
https://resources.linaro.org/en/resource/6c5bGvZwUAjX56fvxthxds
Arnaud Pouliquen (6):
dt-bindings: firmware: Add TEE remoteproc service binding
dt-bindings: remoteproc: Add STM32 TEE-controlled rproc binding
remoteproc: core: Introduce rproc_pa_to_va helper
remoteproc: Introduce optional release_fw operation
remoteproc: Add TEE support
remoteproc: stm32: Add TEE-controlled STM32 driver
.../arm/firmware/linaro,optee-tz.yaml | 6 +
.../bindings/remoteproc/remoteproc-tee.yaml | 47 ++
.../remoteproc/st,stm32-rproc-tee.yaml | 100 +++
drivers/remoteproc/Kconfig | 10 +
drivers/remoteproc/Makefile | 3 +-
drivers/remoteproc/remoteproc_core.c | 52 ++
drivers/remoteproc/remoteproc_internal.h | 6 +
drivers/remoteproc/remoteproc_tee.c | 771 ++++++++++++++++++
drivers/remoteproc/stm32_rproc_tee.c | 526 ++++++++++++
include/linux/remoteproc.h | 6 +
include/linux/remoteproc_tee.h | 89 ++
11 files changed, 1615 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/remoteproc/remoteproc-tee.yaml
create mode 100644 Documentation/devicetree/bindings/remoteproc/st,stm32-rproc-tee.yaml
create mode 100644 drivers/remoteproc/remoteproc_tee.c
create mode 100644 drivers/remoteproc/stm32_rproc_tee.c
create mode 100644 include/linux/remoteproc_tee.h
base-commit: 7d0a66e4bb9081d75c82ec4957c50034cb0ea449
--
2.43.0
[BCC all OP-TEE maintainers]
Hi OP-TEE maintainers & contributors,
OP-TEE version 4.9.0 is now scheduled for release on 2026-01-16. So,
now is a good time to start testing the master branch across various
platforms and report or fix any bugs.
The GitHub pull request for collecting Tested-by tags or any other
comments is https://github.com/OP-TEE/optee_os/pull/7666.
I have now created the 4.9.0-rc1 tags in the various OP-TEE gits.
Please proceed with the testing.
You can find more information related to releases here:
https://optee.readthedocs.io/en/latest/general/releases.html
Thanks,
Jens
When I try building with `make run WITH_SCMI=y` then the build fails:
core/lib/scmi-server/scmi_server.c: In function ‘scmi_server_initialize’:
core/lib/scmi-server/scmi_server.c:83:22: error: implicit declaration of function ‘scmi_configure’ [-Wimplicit-function-declaration]
83 | rc = scmi_configure(cfg);
| ^~~~~~~~~~~~~~
This was introduced in commit ce6ea4112008 ("scmi-server: configure
SCP-firmware from DT"). A grep for scmi_configure() turns up empty.
Was part of the commit missing?
regards,
dan carpenter