Skip to content
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

Question Regarding Context Switch Between REE and TEE #3963

Closed
mye-rutgers opened this issue Jul 5, 2020 · 5 comments
Closed

Question Regarding Context Switch Between REE and TEE #3963

mye-rutgers opened this issue Jul 5, 2020 · 5 comments

Comments

@mye-rutgers
Copy link

Hello,

I am wondering if OPTEE supports proactive context switches for both REE and TEE. Based on my current understanding, TA in OPTEE is a passive application that needs to wait for requests from the host to conduct the requested operations. Are there any commands or function calls to support the workflow as the figure shown below? Thank you!

context_switch

@vchong
Copy link
Contributor

vchong commented Jul 5, 2020

See #3673 for details.

@mye-rutgers
Copy link
Author

Thank you!

@mye-rutgers
Copy link
Author

Hello,

I have another question regarding the context switches. Ecall (i.e., TEE_InvokeTACommand) and Ocall (i.e., TEE_InvokeCACommand) are the function calls that pass the input parameters and return the output results. If I would like to conduct a simple context switch with context pointers only (e.g., SMC() as shown in the figure) to switch between the REE and TEE, how could I do that? I am looking for an SMC() function/command, because it could save time/energy consumption if there is no need to pass parameters and return results for some context-switch cases in the example shown below. Thank you!

smc

@mye-rutgers mye-rutgers reopened this Jul 5, 2020
@jenswi-linaro
Copy link
Contributor

TAs and Linux user space are not allowed to use the SMC instruction directly. Allowing that could lead to user mode corrupting kernel mode. In a full context switch from Linux user space to a TA is as you've noted a complex operation. Only skipping the parameter passing/checks should hardly make much difference.

@mye-rutgers
Copy link
Author

I see. Thank you so much for your clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants