-
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
Introduce OpTEE complete solution for RISC-V and looking for how to contribute it #6173
Comments
Thanks!
I think this is the most critical part. |
I found the related issues about opensbi tee support list below:
@matthewgui could check our changes and see whether our opensbi changes matched with issue and pr above, if not, maybe we can discuss changes in the related issues. |
For OP-TEE OS |
Hi @gagachang & @maroueneboubakri , how do you run this optee-os standalone project, is there any guidance about how to use it, so @matthewgui can do some contribution, and we can also check how we can integrate with current optee-os riscv support. |
Do you mean how to submit a pull request? |
No, I mean if we added our code, and we need to run some test suite to check our code, what is the current workflow to achive it. Or we just checkin the code, and let other people to review the code, without running any test suites? |
I always run OP-TEE And ensure that new code will not affect ARM side. |
Hi @gagachang , do you mean you just run |
@fanghuaqi |
No~ I only manually run xtest for RISC-V. If you ever submited commits to your local optee-os repository, you might have seen the following checks: |
So are there any steps for us to run |
xtest needs linux side CA and opensbi. https://optee.readthedocs.io/en/latest/faq/faq.html#q-how-are-you-testing-op-tee |
The easiest way would be AMP logic, you may assign one or two cores to trusted domain and run OP-TEE OS there and the remaining cores to un-trusted domain where Linux runs and set a messaging mechanism between 2 domains, we use RPMSG like mechanism. |
This is an early version, we have now done the work of multi-core and interrupt routing, but do not know how to do upstram at the moment。 |
Hi @liushiwei007, could you update the draft version, so we can make some discussion on it, we have done the implementation on our hardware, maybe we can take the common part and finalize a workable TEE extension spec in opensbi. @matthewgui can join in the discussion. Thanks |
hi, @fanghuaqi , the current version covers hardware features,we haven't started to open source hardware features yet, but I would love to discuss on it。 |
May I know the scenario of enabling |
Hello guys, The software features such as SBI extension ID and function ID would be good starting point. |
I think this will be a good suggestion, at least we can have a common tee inteface in opensbi. By the way, we recently implement required hardware features in our qemu emulator, you can also take try with it, see Nuclei-Software/nuclei-linux-sdk#13 |
The patch I submitted contained this, but it didn't get any attention, and I even wondered if I could submit opensbi and linux in the OPTEE project first. |
For linux, I think RISC-V needs another C file in optee driver.
|
Parhaps we should introduce a new compatible: |
Sounds good to me! |
It will be great to have that |
Another option is to use the FF-A approach where drivers can register for an FF-A bus. That doesn't need any DT at all, except possibly for the SBI driver or framework. |
+1 |
This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time. |
Hello, I am wondering if anyone here can regularly review the PRs related to RISC-V. |
My focus is Arm and generic OP-TEE code. I can help review an occasional RISC-V patch especially if it relates to generic OP-TEE code, but I would prefer if the RISC-V patches in general can be reviewed by people having an interest in that architecture. Upstreaming code needs both an author and reviewers. Ironically is writing and debugging the code often the easy part. If you have an interest in RISC-V and can put some time into reviewing RISC-V patches, please help the others who are writing code for RISC-V. |
I am in the same situation as Jens and totally agree with his words. It would be nice to have an entry for RISC-V in MAINTAINERS. |
Hello @fanghuaqi @matthewgui I have a problem about SMP (2 CPU) and I am wondering if you also ever encounter this problem. Did you ever encounter this problem ? It does not happen every time when I execute I enable trace points of RISC-V timer IRQ and OP-TEE invoke function:
|
hello @gagachang Maybe you need to check the return value of invoke function,to get more detailed flow。I search the related issue on google,found resched issue on rpc branch,but this patch is not effect for me。 |
Hi @matthewgui |
Hello @matthewgui I found the root cause is that my OpenSBI save/restore CSR sip during Linux/OP-TEE context switching. |
Hello @maroueneboubakri I see there are two configurations to control OP-TEE runs on which privilege level: In which scenario or architecture, or advantage, that OP-TEE needs to be run as M-mode. |
This is a patch made for optee hardware support, see OP-TEE/optee_os#6173 Signed-off-by: Huaqi Fang <[email protected]>
Hi guys,
We are working a complete OpTEE solution for RISC-V, and now are able to boot opensbi + optee + uboot + linux, and able to pass all the optee test suites and benchmark(except network related ones, due to lack of network interface).
Here is our design guide and user guide located here:
We mainly made the following changes regarding to optee-os, opensbi, optee driver for linux:
Could you take a look at this solution, and see what is left for us to do, and if we want to co-operate our work to upstream, what can we contribute to, and this also involve with opensbi changes, maybe opensbi contribution are also required.
We previously also searched across the web, but not yet find complete source code to try full optee solution on RISC-V, so we start to do it based on some previous work on OpTEE upstream work and keystone TEE project.
This work is mainly done by @matthewgui , and currently we still not solving this issue #6075, but we are able to run in SMP mode when in TEE world REE interrupts are disabled, and in REE world TEE interrupts can be enabled, this is detailed in the guide.
Hope you can give some feedbacks on this solution, @gagachang @maroueneboubakri @liushiwei007
Thanks
The text was updated successfully, but these errors were encountered: