Skip to content

Commit c87474a

Browse files
jenswi-linaroAlex Shi
authored andcommitted
tee: generic TEE subsystem
Initial patch for generic TEE subsystem. This subsystem provides: * Registration/un-registration of TEE drivers. * Shared memory between normal world and secure world. * Ioctl interface for interaction with user space. * Sysfs implementation_id of TEE driver A TEE (Trusted Execution Environment) driver is a driver that interfaces with a trusted OS running in some secure environment, for example, TrustZone on ARM cpus, or a separate secure co-processor etc. The TEE subsystem can serve a TEE driver for a Global Platform compliant TEE, but it's not limited to only Global Platform TEEs. This patch builds on other similar implementations trying to solve the same problem: * "optee_linuxdriver" by among others Jean-michel DELORME<jean-michel.delorme@st.com> and Emmanuel MICHEL <emmanuel.michel@st.com> * "Generic TrustZone Driver" by Javier González <javier@javigon.com> Acked-by: Andreas Dannenberg <dannenberg@ti.com> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey) Tested-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> (RCAR H3) Tested-by: Scott Branden <scott.branden@broadcom.com> Reviewed-by: Javier González <javier@javigon.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> (cherry picked from commit 967c9cca2cc50569efc65945325c173cecba83bd) Signed-off-by: Alex Shi <alex.shi@linaro.org> Conflicts: remove fsi from drivers drivers/Kconfig drivers/Makefile
1 parent 78668d8 commit c87474a

12 files changed

Lines changed: 2182 additions & 0 deletions

File tree

Documentation/ioctl/ioctl-number.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ Code Seq#(hex) Include File Comments
307307
0xA3 80-8F Port ACL in development:
308308
<mailto:tlewis@mindspring.com>
309309
0xA3 90-9F linux/dtlk.h
310+
0xA4 00-1F uapi/linux/tee.h Generic TEE subsystem
310311
0xAA 00-3F linux/uapi/linux/userfaultfd.h
311312
0xAB 00-1F linux/nbd.h
312313
0xAC 00-1F linux/raw.h

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9361,6 +9361,13 @@ F: drivers/hwtracing/stm/
93619361
F: include/linux/stm.h
93629362
F: include/uapi/linux/stm.h
93639363

9364+
TEE SUBSYSTEM
9365+
M: Jens Wiklander <jens.wiklander@linaro.org>
9366+
S: Maintained
9367+
F: include/linux/tee_drv.h
9368+
F: include/uapi/linux/tee.h
9369+
F: drivers/tee/
9370+
93649371
THUNDERBOLT DRIVER
93659372
M: Andreas Noever <andreas.noever@gmail.com>
93669373
S: Maintained

drivers/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,6 @@ source "drivers/hwtracing/intel_th/Kconfig"
198198

199199
source "drivers/fpga/Kconfig"
200200

201+
source "drivers/tee/Kconfig"
202+
201203
endmenu

drivers/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,4 @@ obj-$(CONFIG_STM) += hwtracing/stm/
173173
obj-$(CONFIG_ANDROID) += android/
174174
obj-$(CONFIG_NVMEM) += nvmem/
175175
obj-$(CONFIG_FPGA) += fpga/
176+
obj-$(CONFIG_TEE) += tee/

drivers/tee/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Generic Trusted Execution Environment Configuration
2+
config TEE
3+
tristate "Trusted Execution Environment support"
4+
select DMA_SHARED_BUFFER
5+
select GENERIC_ALLOCATOR
6+
help
7+
This implements a generic interface towards a Trusted Execution
8+
Environment (TEE).

drivers/tee/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
obj-$(CONFIG_TEE) += tee.o
2+
tee-objs += tee_core.o
3+
tee-objs += tee_shm.o
4+
tee-objs += tee_shm_pool.o

0 commit comments

Comments
 (0)