OP-TEE / optee_docs

This git contains the official documentation for the OP-TEE project
BSD 2-Clause "Simplified" License
58 stars 96 forks source link

archi/core: correct shared memory and add dynamic shm #5

Closed etienne-lms closed 5 years ago

etienne-lms commented 5 years ago
Remove deprecated references to Linux driver resources. This
prevents dependency on Linux OP-TEE driver evolution and opens
perspective to alternate non-secure clients as U-Boot.

Fix Joakim TODO tag on deprecated bootcfg_get_memory().

Add description of the dynamic shared memory: registration/discovery
from secure world and buffer registration by non-secure world.

While exploring the new docs, found some untrue statement and deprecated info (incl @jbech-linaro todo tag). This is an attempt to clean the Shared Memory description part while not adding to much info that could deprecate.

jbech-linaro commented 5 years ago

Reviewed-by: Joakim Bech <joakim.bech@linaro.org>

etienne-lms commented 5 years ago

tag applied

jbech-linaro commented 5 years ago

It introduces a couple of warnings, see: https://travis-ci.org/OP-TEE/optee_docs/jobs/504589879#L558-L566

Not sure why line-numbers are pointing to wrong places, but I can see the same warnings, but with correct lines numbers when compiling the docs locally. You can try it out on your own: https://optee.readthedocs.io/building/gits/optee_docs.html#build-optee-docs

jbech-linaro commented 5 years ago

And regarding levels, the "order" is like this: https://optee.readthedocs.io/building/gits/optee_docs.html#sections-chapters

etienne-lms commented 5 years ago

Removed review tag. Issue still open, @jbech-linaro comments to address...

etienne-lms commented 5 years ago

2 fixup commits for the make html issues.

etienne-lms commented 5 years ago

This P-R should also fix the following description in core.rst#using-shared-memory:

(...) In such a case, the provided memory must be physically contiguous, since OP-TEE core, who does not handle scatter-gather memory, is able to use the provided range of memory addresses. (...)

jbech-linaro commented 5 years ago

@etienne-lms , so this is ready for merge now I suppose. I.e., you don't intend to make any further changes? If that is the case, feel free to add my R-B and squash/rebase the patches.

etienne-lms commented 5 years ago

I saw this morning that there is still a description to fix (above). I'll do it straight with the following proposal and apply you tag if you're OK:

edited: see proposal in last appended commit (here). and forget proposal below.

"The client application can ask for shared memory allocation using the GlobalPlatform Client API function TEEC_AllocateSharedMemory(...). The client application can also provide shared memory register a memory buffer through the GlobalPlatform Client API function TEEC_RegisterSharedMemory(...). In such a case, the provided memory must be physically contiguous, since OP-TEE core, who does not handle scatter-gather memory, is able to use the provided range of memory addresses. Note that the reference count of a shared memory chunk is incremented when shared memory is registered, and initialized to 1 on allocation. The shared memory reference returned can be used as parameter when invoking a trusted application."

jbech-linaro commented 5 years ago

LGTM, thanks! Reviewed-by: Joakim Bech <joakim.bech@linaro.org>

etienne-lms commented 5 years ago

ok, thanks. I'm squashing the series.