OPTEE notes

1. optee_smccc_hvc() and optee_smccc_smc()

During optee_probe(), get_invoke_func() will return one of these two functions based on device tree configure.

OPTEE notes_第1张图片

OPTEE notes_第2张图片

And this returned invoke_fn will register to optee->invoke_fn for other functions to use.

And from the name, we can know optee_smccc_hvc() will trap to hypervisor(EL2), and optee_smccc_smc() will trap to monitor(EL3).

So when other functions,such as optee_do_call_with_arg(), call this optee->invoke_fn(), it could enter hypervisor(EL2) or monitor(EL3). It depends on device tree configuration?

OPTEE notes_第3张图片

2. Build and Run OP-TEE on QEMU

1. refer to https://blog.csdn.net/shuaifengyun/article/details/99855105

2. refer to OP-TEE project(https://optee.readthedocs.io/en/latest/building/gits/build.html) to install all the packages in "Step 1 - Prerequisites"

3. Repo is slow for some GIT. try more times.

4. In OP-TEE, build toolchain step will download toolchain from ARM website. If it's too slow, you can open OP-TEE/build/toolchain.mak to find the ARM toolchain name and path and download them manually from ARM website.

5. When build OP-TEE, make sure no other toolchians on the environment PATH.

6. If Linux kernel ask for manually configure during the build, you can stop it and rm .config and rebuild Linux kernel. 

 

你可能感兴趣的:(linux)