-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tee: OCALL support for kernel TEE client drivers
Enable Trusted Applications (TAs) to invoke functions on their corresponding client in Linux kernel driver during both both session open and command invocation. These function invocations from TA to client are referred to as "Out Calls", or OCALLs for short. The fundamental mechanism is one whereby upon a function invocation from the client to the TA, the TEE returns prematurely from the invocation with an RPC. This RPC is generated after a TA calls a TEEC_InvokeCommand() equivalent function in secure world. The RPC carries information describing the OCALL as well as its parameters. When this happens, the driver saves the state of the current call and returns to user-mode. The TEE kernel client API has to call tee_client_open_session() or tee_client_invoke_command() with a special parameter that carries OCALL information. When the function returns prematurely, this parameter includes information about what the client is expected to do on behalf of the TA along with data to be used to reply to the request. Once that is done, TEE kernel client API calls tee_client_open_session() (respectively tee_client_invoke_command()) again with the modified OCALL parameter and associated information (such as the result of the OCALL and the output parameters as requested by the TA). The driver notices that this invocation is in fact a resumption as opposed to a brand-new invocation, and resumes the secure world thread that sent the RPC in the first place. The same mechanism applies to OCALLs during session open. This patch also minimally updates the OP-TEE and AMD TEE drivers to match the new signatures for session open and invoke. If an OCALL is specified by the CA, EOPNOTSUPP is returned. This change it based on the OCALL implementation proposal from Hernan Gatta posted in [1] with few modifications to remove changes in shared memory from/to sequence since OCALL is not yet available to user client application, and to remove TEE drivers pre-release handler that are not needed when supporting OCalls only in Linux kernel TEE client drivers. Link: [1] linaro-swg/linux#72 Co-developed-by: Hernan Gatta <[email protected]> Signed-off-by: Hernan Gatta <[email protected]> Signed-off-by: Etienne Carriere <[email protected]> Change-Id: I95b35e2447bfb24b729d7bf1d3dec4cc620100e6
- Loading branch information
1 parent
9061b6f
commit a2264d2
Showing
8 changed files
with
165 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.