optee_vela itself is used to implement an adaptation layer between Vela tee and optee os, enabling optee_os to run within the Vela tee system.
Therefore, the TA (Trusted Application) and CA (Client Application) programs in optee_os can all run directly in the vela system.
With the help of optee_vela, we don’t need to make any modifications to the optee_os project itself to make optee_os run completely within vela.
The following is the position of optee_vela itself within the entire Vela tee system:
optee_vela mainly contains three parts of functions:
compat: It is a system module used to support the upper framework of optee os to run in vela, such as basic modules for operations like atomic, fs, mem, etc.
server: It is used to receive and handle all requests for vela tee initiated by vela ap, such as operations like opening open TA, invoke TA cmd, etc.
wasm: It is used to support the wasm TA specific to vela to run in optee os.
The following is an introduction for each part respectively:
1. compat
The compat adaptation layer mainly implements the system APIs required by the upper framework of optee os using the system APIs of vela, such as basic APIs like atomic, mem, fs, etc.
The following is an introduction to the main replaced API modules:
fs
The fs module mainly consists of two parts:
host_fshost_fs is mainly used to implement the ree fs operations required by optee os. In optee os, the implementation of ree fs forwards all operations related to the file system to ree for processing.
This is because the support for file system operations in optee os itself is limited, so complex file system operations need to be transferred across cores to ree for processing.
However, since vela tee is a fully functional operating system and also supports complex file system operations in tee, the ree fs in vela tee can be completed directly on the vela tee side.
And host_fs is used to implement this function.
rpmb_fsrpmb_fs is mainly used to implement the implementation of the rpmb driver required by optee os.
vela tee itself supports the rpmb driver, and then through rpmb_fs, the rpmb driver can be directly used in optee os.
atomic
This API module mainly replaces the atomic and spinlock required for the operation of optee os with the atomic and spinlock interface implementations supported by the vela system.
2. server
In vela, the communication process between vela ap and vela tee is carried out through rpmsg socket.
In this process, we can regard vela ap as the client and vela tee as the server.
The server in vela tee is implemented as an rpmsg socket server, which is used to receive and handle requests initiated by the rpmsg socket client.
The server part itself is used to complete the request processing for vela tee initiated by vela ap.
The server part will create an opteed task.
Then, when the system starts, opteed will be started in the background:
opteed &
3. wasm
vela tee itself supports wasm TA. wasm TA means that the TA program itself is compiled and linked in the format of wasm bytecode, and then during runtime, it is loaded and run by the wamr framework built into vela tee.
optee_vela
[English | 中文]
Project Overview
optee_velaitself is used to implement an adaptation layer betweenVela teeandoptee os, enablingoptee_osto run within theVela teesystem. Therefore, theTA(Trusted Application) andCA(Client Application) programs inoptee_oscan all run directly in thevelasystem. With the help ofoptee_vela, we don’t need to make any modifications to theoptee_osproject itself to makeoptee_osrun completely withinvela.The following is the position of
optee_velaitself within the entireVela teesystem:Project Description
optee_velamainly contains three parts of functions:compat: It is a system module used to support the upper framework ofoptee osto run invela, such as basic modules for operations likeatomic,fs,mem, etc.server: It is used to receive and handle all requests forvela teeinitiated byvela ap, such as operations like openingopen TA,invoke TA cmd, etc.wasm: It is used to support thewasm TAspecific tovelato run inoptee os.The following is an introduction for each part respectively:
1. compat
The
compatadaptation layer mainly implements the system APIs required by the upper framework ofoptee osusing the system APIs ofvela, such as basic APIs likeatomic,mem,fs, etc. The following is an introduction to the main replaced API modules:The
fsmodule mainly consists of two parts:host_fshost_fsis mainly used to implement theree fsoperations required byoptee os. Inoptee os, the implementation ofree fsforwards all operations related to the file system toreefor processing. This is because the support for file system operations inoptee ositself is limited, so complex file system operations need to be transferred across cores toreefor processing. However, sincevela teeis a fully functional operating system and also supports complex file system operations intee, theree fsinvela teecan be completed directly on thevela teeside. Andhost_fsis used to implement this function.rpmb_fsrpmb_fsis mainly used to implement the implementation of therpmbdriver required byoptee os.vela teeitself supports therpmbdriver, and then throughrpmb_fs, therpmbdriver can be directly used inoptee os.atomicThis API module mainly replaces the
atomicandspinlockrequired for the operation ofoptee oswith theatomicandspinlockinterface implementations supported by thevelasystem.2. server
In
vela, the communication process betweenvela apandvela teeis carried out throughrpmsg socket. In this process, we can regardvela apas the client andvela teeas the server. Theserverinvela teeis implemented as anrpmsg socket server, which is used to receive and handle requests initiated by therpmsg socket client.The
serverpart itself is used to complete the request processing forvela teeinitiated byvela ap. Theserverpart will create anopteedtask. Then, when the system starts,opteedwill be started in the background:3. wasm
vela teeitself supportswasm TA.wasm TAmeans that theTAprogram itself is compiled and linked in the format ofwasmbytecode, and then during runtime, it is loaded and run by thewamr frameworkbuilt intovela tee.