-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic RPC Support #3292
Closed
Closed
Generic RPC Support #3292
Conversation
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
* CFG_GENERIC_RPC: Enabled by default.
* UUID: ad0fd0ae-09e1-464b-98ed-0607ec9ebd8b
* Request that shared memory be allocated to communicate between the host and the PTA.
* Enable with CFG_GENERIC_RPC.
* When calling the GRPC PTA, the caller passes the GRPC PTA command ID in the upper 4 bits of the cmd_id parameter, and uses the remaining bits for the function ID it wishes the host to execute on its behalf; * In turn, the same mechanism is used in Linux to determine whether an RPC is a GRPC request, what the command ID is, and which function ID the host is expected to execute.
* The argument attributes are not updated on RPC return.
This was referenced Sep 23, 2019
This pull request has been marked as stale because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed pull request at any time. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new PTA, the Generic RPC (GRPC) PTA, that allows user-mode TA's to perform calls out to their corresponding host application running in the REE on a session-by-session basis. The logic behind this feature mirrors that utilized to communicate with the TEE supplicant. In this sense, a TA's host application effectively becomes its own little supplicant.
This mechanism was originally developed for the Open Enclave SDK. This SDK provides developers with an abstraction layer on top of multiple TEE technologies, allowing them to write hosts and enclaves once which can run anywhere. Currently, it supports Intel SGX and work is underway to support OP-TEE, too. The SDK's master branch has preliminary support for OP-TEE and allows one to build and load TA's, to invoke commands (aka. "enclave calls", or "ECALLs") and for TA's to invoke commands on their host (aka. "out calls" or "OCALLs"), for parity with SGX.
In the SDK, a code generator produces stubs that serialize function parameters into known structures (one for input, one for output, and a control structure), then passes that to the enclave or host, depending on the direction of the call. On the other side of the call, the structure is deserialized and the underlying function is invoked automatically. In this sense, the developer merely executes a function call on either side and the complexities of performing an ECALL or an OCALL are completely hidden by the SDK.
The flow for an OCALL is exactly the same as for an RPC to the TEE supplicant; this method just allows for arbitrary parameters and for routing the request to the host application.
To support this functionality, changes were made to the Linux TEE and OP-TEE drivers. These may be viewed here.
Open questions:
Associated PR's: