How op-tee/optee_linuxdriver works
Project type and purpose
• This is a Linux kernel driver module (“optee.ko”) that implements the client-side interface for OP-TEE (Open Portable Trusted Execution Environment).
• Purpose: facilitate communication between the Rich OS (normal world) applications, the secure world Trusted OS, and a user-space “tee-supplicant” daemon. It uses ARM TrustZone mechanisms (SMC calls) and shared memory to proxy requests.
File structure
• Top level:
• Makefile, Kconfig, .travis.yml – build and CI integration.
• arm tz folder (“armtz”) – ARM/ARM64 assembly stubs and transport layer implementing SMC calling conventions and memory setup.
• core folder – main kernel driver code: context, session, shared memory, sysfs/debugfs interfaces, mutex and wait-queue primitives, TEE kernel API.
• – public and internal headers: Linux TEE client APIs, OP-TEE message formats, SMCCC definitions.
• fdts – device tree snippets describing foundation models for FVP testing.
• Patterns:
• Kernel module layering: low-level transport (armtz) → core driver logic (core/) → user-space interface (ioctl, sysfs, debugfs).
• Clear separation of ark (transport), core (business logic), and includes (APIs).
Insights from README
• The module bridges secure and normal worlds via SMC and the tee-supplicant.
• It registers a character-device or ioctl interface for user-space clients.
• It relies on Linux kernel subsystems: sysfs, debugfs, wait queues, mutexes.
• Target hardware: ARM TrustZone platforms, FVP Foundation model.