Skip to content

optee: share TA binaries through a global UUID map - #1142

Open
Praveen K Paladugu (praveen-pk) wants to merge 9 commits into
microsoft:mainfrom
praveen-pk:global_ta_uuid
Open

optee: share TA binaries through a global UUID map#1142
Praveen K Paladugu (praveen-pk) wants to merge 9 commits into
microsoft:mainfrom
praveen-pk:global_ta_uuid

Conversation

@praveen-pk

Copy link
Copy Markdown
Contributor

Move the TA UUID-to-binary map out of individual shim instances so TA binaries can be registered once and reused across instances. This global map is required to support Dyanamically Loading TAs and using them across sessions.

Protect the map with a spin-based RwLock and expose shim methods for storing and retrieving TA binaries.

Register the LVBS runner's embedded TA during BSP initialization and resolve new TA instances through the shared map.

@praveen-pk Praveen K Paladugu (praveen-pk) changed the title optee: share TA binaries through a global UUID map [Draft] optee: share TA binaries through a global UUID map Aug 6, 2026

@sangho2 Sangho Lee (sangho2) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your effort! Yes, we should differentiate shim-global from runner-global. I left some comments/suggestions.

Comment thread litebox_runner_lvbs/src/lib.rs
Comment thread litebox_runner_lvbs/src/lib.rs Outdated
Comment thread litebox_runner_lvbs/src/lib.rs Outdated
Comment thread litebox_shim_optee/src/lib.rs
Comment thread litebox_shim_optee/src/lib.rs Outdated
Comment thread litebox_shim_optee/src/lib.rs Outdated
Comment thread litebox_shim_optee/src/lib.rs Outdated
@praveen-pk
Praveen K Paladugu (praveen-pk) force-pushed the global_ta_uuid branch 2 times, most recently from 7881679 to 321b69f Compare August 11, 2026 19:55
@praveen-pk

Copy link
Copy Markdown
Contributor Author

I confirmed that static TAs continue to function with this change.

$ sudo /usr/share/optee_examples/optee_example_hello_world
Invoking TA to increment 42
TA incremented value to 43

@sangho2 Sangho Lee (sangho2) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Please take a look at the new comment.

Feel free to drop "[Draft]" from the title if it is ready to merge and replace optee with OP-TEE or OP-TEE shim. Thanks!

Comment thread litebox_runner_lvbs/src/lib.rs Outdated
Move the TA UUID-to-binary map out of individual shim instances
so TA binaries can be registered once and reused across instances.
This global map is required to support Dyanamically Loading TAs and
using them across sessions.

Protect the map with a spin-based RwLock and expose shim methods for
storing and retrieving TA binaries.

Register the LVBS runner's embedded TA during BSP initialization and
resolve new TA instances through the shared map.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Restore TA_BINARIES, to keep supporting mulitple embedded binaries

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
TaUuidMap is already sychronized with an interior RwLock. An Arc
wrapping adds un-necessary reference counting overhead.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
This drops the need for deep copy while getting a binary.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Now references to ta_uuid_map in shim object will be scoped to the lifetime
of the shim object.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
@praveen-pk Praveen K Paladugu (praveen-pk) changed the title [Draft] optee: share TA binaries through a global UUID map optee: share TA binaries through a global UUID map Aug 13, 2026
ldelf stores TA in the UUID Map while loading it. Drop this redundant
step.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
@praveen-pk
Praveen K Paladugu (praveen-pk) force-pushed the global_ta_uuid branch 2 times, most recently from e41b33d to e681468 Compare August 13, 2026 21:22
Drop ta_bin arg in ldelf casls from Linux Userland.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
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.

2 participants