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

[RFC] Prototype/sdp v3 #7159

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jenswi-linaro
Copy link
Contributor

This is the OP-TEE OS counterpart of https://lore.kernel.org/lkml/[email protected]/

I've added dynamic registration of SDP buffers. The buffers can be registered for different use-cases so they will require different access permissions for the hardware.

The implementation in OP-TEE is RFC, but we should be able to finalize the ABI towards the normal world. With the direction this PR has taken it would be nice to get rid of matching SDP buffers against physical addresses and instead only rely on the struct mobj to report the status of the memory range.

Syncs the ABI description files optee_ffa.h and optee_msg.h with their
counterpart in the Linux kernel driver. Small changes in comments and
introduction of uint8_t octets[24] as an alternative to struct
optee_msg_param_value value.

No ABI changes or extensions.

Signed-off-by: Jens Wiklander <[email protected]>
Extend the SMC ABI to return the Secure Data Path configuration.

A capability bit, OPTEE_SMC_SEC_CAP_SDP, is added to announce that the
new SMC fast call OPTEE_SMC_GET_SDP_CONFIG is available.
OPTEE_SMC_GET_SDP_CONFIG returns the physical memory range of SDP
reserved memory.

Signed-off-by: Jens Wiklander <[email protected]>
Extend the SMC and FF-A ABI to handle dynamic restricted memory lending.
The capability bits OPTEE_SMC_SEC_CAP_DYNAMIC_RSTMEM and
OPTEE_FFA_SEC_CAP_RSTMEM respectively tells its availability.

OPTEE_MSG_CMD_GET_RSTMEM_CONFIG tells the minimal size and required
alignment of restricted memory to lend.

For the SMC ABI, OPTEE_MSG_CMD_LEND_RSTMEM lends restricted memory
and OPTEE_MSG_CMD_RECLAIM_RSTMEM returns the memory to normal world use.

For the FF-A ABI, FFA_LEND framework request followed by
OPTEE_MSG_CMD_ASSIGN_RSTMEM lends restricted memory and
OPTEE_FFA_RELEASE_RSTMEM followed by the FFA_RECLAIM framework
request returns the memory to normal world use.

Signed-off-by: Jens Wiklander <[email protected]>
Moves the non-secure shared memory specific fields of struct mobj_ffa
into the new struct mobj_ffa_shm which in turn embeds struct mobj_ffa.

This prepares for another derivate of struct mobj_ffa that deals with
another kind of memory.

No change in functionality.

Signed-off-by: Jens Wiklander <[email protected]>
With CFG_CORE_DYN_RSTMEM=y support dynamic restricted memory lending.

A new internal struct mobj_ffa_rsm is added to handle dynamic restricted
memory for FF-A.

A new internal struct mobj_rstmem is add to handle dynamic restricted
memory without FF-A.

Lending non-secure memory to OP-TEE to use it as restricted memory means
that it should to become inaccessible by the normal world as part of the
process. This part is currently not supported, since it must be done in
a platform specific way for platforms that support that. QEMU don't
support that.

Signed-off-by: Jens Wiklander <[email protected]>
@jenswi-linaro jenswi-linaro marked this pull request as draft November 29, 2024 10:18
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

Successfully merging this pull request may close these issues.

1 participant