Skip to content

Commit 40b561e

Browse files
committed
Merge tag 'tee-ts-for-v6.10' of https://git.linaro.org/people/jens.wiklander/linux-tee into soc/drivers
TEE driver for Trusted Services This introduces a TEE driver for Trusted Services [1]. Trusted Services is a TrustedFirmware.org project that provides a framework for developing and deploying device Root of Trust services in FF-A [2] Secure Partitions. The project hosts the reference implementation of Arm Platform Security Architecture [3] for Arm A-profile devices. The FF-A Secure Partitions are accessible through the FF-A driver in Linux. However, the FF-A driver doesn't have a user space interface so user space clients currently cannot access Trusted Services. The goal of this TEE driver is to bridge this gap and make Trusted Services functionality accessible from user space. [1] https://www.trustedfirmware.org/projects/trusted-services/ [2] https://developer.arm.com/documentation/den0077/ [3] https://www.arm.com/architecture/security-features/platform-security * tag 'tee-ts-for-v6.10' of https://git.linaro.org/people/jens.wiklander/linux-tee: MAINTAINERS: tee: tstee: Add entry Documentation: tee: Add TS-TEE driver tee: tstee: Add Trusted Services TEE driver tee: optee: Move pool_op helper functions tee: Refactor TEE subsystem header files Link: https://lore.kernel.org/r/20240425073119.GA3261080@rayden Signed-off-by: Arnd Bergmann <[email protected]>
2 parents d9f843f + 31611cc commit 40b561e

File tree

28 files changed

+1095
-389
lines changed

28 files changed

+1095
-389
lines changed

Documentation/tee/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ TEE Subsystem
1010
tee
1111
op-tee
1212
amd-tee
13+
ts-tee
1314

1415
.. only:: subproject and html
1516

Documentation/tee/ts-tee.rst

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
=================================
4+
TS-TEE (Trusted Services project)
5+
=================================
6+
7+
This driver provides access to secure services implemented by Trusted Services.
8+
9+
Trusted Services [1] is a TrustedFirmware.org project that provides a framework
10+
for developing and deploying device Root of Trust services in FF-A [2] S-EL0
11+
Secure Partitions. The project hosts the reference implementation of the Arm
12+
Platform Security Architecture [3] for Arm A-profile devices.
13+
14+
The FF-A Secure Partitions (SP) are accessible through the FF-A driver [4] which
15+
provides the low level communication for this driver. On top of that the Trusted
16+
Services RPC protocol is used [5]. To use the driver from user space a reference
17+
implementation is provided at [6], which is part of the Trusted Services client
18+
library called libts [7].
19+
20+
All Trusted Services (TS) SPs have the same FF-A UUID; it identifies the TS RPC
21+
protocol. A TS SP can host one or more services (e.g. PSA Crypto, PSA ITS, etc).
22+
A service is identified by its service UUID; the same type of service cannot be
23+
present twice in the same SP. During SP boot each service in the SP is assigned
24+
an "interface ID". This is just a short ID to simplify message addressing.
25+
26+
The generic TEE design is to share memory at once with the Trusted OS, which can
27+
then be reused to communicate with multiple applications running on the Trusted
28+
OS. However, in case of FF-A, memory sharing works on an endpoint level, i.e.
29+
memory is shared with a specific SP. User space has to be able to separately
30+
share memory with each SP based on its endpoint ID; therefore a separate TEE
31+
device is registered for each discovered TS SP. Opening the SP corresponds to
32+
opening the TEE device and creating a TEE context. A TS SP hosts one or more
33+
services. Opening a service corresponds to opening a session in the given
34+
tee_context.
35+
36+
Overview of a system with Trusted Services components::
37+
38+
User space Kernel space Secure world
39+
~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~
40+
+--------+ +-------------+
41+
| Client | | Trusted |
42+
+--------+ | Services SP |
43+
/\ +-------------+
44+
|| /\
45+
|| ||
46+
|| ||
47+
\/ \/
48+
+-------+ +----------+--------+ +-------------+
49+
| libts | | TEE | TS-TEE | | FF-A SPMC |
50+
| | | subsys | driver | | + SPMD |
51+
+-------+----------------+----+-----+--------+-----------+-------------+
52+
| Generic TEE API | | FF-A | TS RPC protocol |
53+
| IOCTL (TEE_IOC_*) | | driver | over FF-A |
54+
+-----------------------------+ +--------+-------------------------+
55+
56+
References
57+
==========
58+
59+
[1] https://www.trustedfirmware.org/projects/trusted-services/
60+
61+
[2] https://developer.arm.com/documentation/den0077/
62+
63+
[3] https://www.arm.com/architecture/security-features/platform-security
64+
65+
[4] drivers/firmware/arm_ffa/
66+
67+
[5] https://trusted-services.readthedocs.io/en/v1.0.0/developer/service-access-protocols.html#abi
68+
69+
[6] https://git.trustedfirmware.org/TS/trusted-services.git/tree/components/rpc/ts_rpc/caller/linux/ts_rpc_caller_linux.c?h=v1.0.0
70+
71+
[7] https://git.trustedfirmware.org/TS/trusted-services.git/tree/deployments/libts/arm-linux/CMakeLists.txt?h=v1.0.0

MAINTAINERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21753,6 +21753,7 @@ F: Documentation/driver-api/tee.rst
2175321753
F: Documentation/tee/
2175421754
F: Documentation/userspace-api/tee.rst
2175521755
F: drivers/tee/
21756+
F: include/linux/tee_core.h
2175621757
F: include/linux/tee_drv.h
2175721758
F: include/uapi/linux/tee.h
2175821759

@@ -22546,6 +22547,15 @@ F: Documentation/ABI/testing/configfs-tsm
2254622547
F: drivers/virt/coco/tsm.c
2254722548
F: include/linux/tsm.h
2254822549

22550+
TRUSTED SERVICES TEE DRIVER
22551+
M: Balint Dobszay <[email protected]>
22552+
M: Sudeep Holla <[email protected]>
22553+
L: [email protected] (moderated for non-subscribers)
22554+
22555+
S: Maintained
22556+
F: Documentation/tee/ts-tee.rst
22557+
F: drivers/tee/tstee/
22558+
2254922559
TTY LAYER AND SERIAL DRIVERS
2255022560
M: Greg Kroah-Hartman <[email protected]>
2255122561
M: Jiri Slaby <[email protected]>

drivers/tee/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ if TEE
1515

1616
source "drivers/tee/optee/Kconfig"
1717
source "drivers/tee/amdtee/Kconfig"
18+
source "drivers/tee/tstee/Kconfig"
1819

1920
endif

drivers/tee/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ tee-objs += tee_shm.o
55
tee-objs += tee_shm_pool.o
66
obj-$(CONFIG_OPTEE) += optee/
77
obj-$(CONFIG_AMDTEE) += amdtee/
8+
obj-$(CONFIG_ARM_TSTEE) += tstee/

drivers/tee/amdtee/amdtee_private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include <linux/mutex.h>
1111
#include <linux/spinlock.h>
12-
#include <linux/tee_drv.h>
12+
#include <linux/tee_core.h>
1313
#include <linux/kref.h>
1414
#include <linux/types.h>
1515
#include "amdtee_if.h"

drivers/tee/amdtee/call.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <linux/device.h>
77
#include <linux/tee.h>
8-
#include <linux/tee_drv.h>
8+
#include <linux/tee_core.h>
99
#include <linux/psp-tee.h>
1010
#include <linux/slab.h>
1111
#include <linux/psp.h>

drivers/tee/amdtee/core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@
99
#include <linux/slab.h>
1010
#include <linux/string.h>
1111
#include <linux/device.h>
12-
#include <linux/tee_drv.h>
12+
#include <linux/tee_core.h>
1313
#include <linux/types.h>
1414
#include <linux/mm.h>
1515
#include <linux/uaccess.h>
1616
#include <linux/firmware.h>
1717
#include "amdtee_private.h"
18-
#include "../tee_private.h"
1918
#include <linux/psp-tee.h>
2019

2120
static struct amdtee_driver_data *drv_data;

drivers/tee/amdtee/shm_pool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
#include <linux/slab.h>
7-
#include <linux/tee_drv.h>
7+
#include <linux/tee_core.h>
88
#include <linux/psp.h>
99
#include "amdtee_private.h"
1010

drivers/tee/optee/call.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <linux/errno.h>
88
#include <linux/mm.h>
99
#include <linux/slab.h>
10-
#include <linux/tee_drv.h>
10+
#include <linux/tee_core.h>
1111
#include <linux/types.h>
1212
#include "optee_private.h"
1313

0 commit comments

Comments
 (0)