type
status
date
slug
summary
tags
category
icon
password
The code is based on: https://gitlab.com/riseproject/riscv-optee/linux/-/tree/dev-optee-mpxy
Commit ID:
df5dc01764820f113312f7a39f221b49985bbd7a- TEE supplicant
/etc/init.d/S30-tee-supplicant/dev/teepriv0
main()
process_one_request()read_request()- Issue
TEE_IOC_SUPPL_RECVioctl to receive the TEE supplicant request from OP-TEE. - This will be blocked until TEE supplicant request is received.
- Spawn a new thread to process for the new request:
thread_main() - The original thread will continue to handle the TEE supplicant request from OP-TEE:
- If RPC command:
-
OPTEE_MSG_RPC_CMD_LOAD_TA: - Call
load_ta()to load the TA according to the UUID. load_ta()will callTEECI_LoadSecureModule()to load the TA.TEECI_LoadSecureModule()will callfopen(),ftell()to open TA and get the size of TA.- If the buffer size (
ta_size) is not enough to hold the TA, return the required size to let the caller increase the buffer size and try again. - Otherwise, call
fread()to read TA and save it to the buffer. - …
- Call
write_response()to send the TEE supplicant response to OP-TEE.
write_response()- Issue
TEE_IOC_SUPPL_SENDioctl to send the TEE supplicant response to OP-TEE.