Page MenuHomePhabricator

SPM: remove early SP code from memory after the SP is loaded
Open, Needs TriagePublic

Description

The early SP read-only code is loaded inside non pageable memory before the thread is started. Free this memory so we can use it for something else.

Event Timeline

After the initial investigation I found two possible approaches to the task:

  1. Use the OP-TEE pager and put the SP code into paged memory.
  2. Implement a reclaim mechanism similar to TF-A BL31 init code reclaiming.

I asked Jens from Linaro about this, it turns out option 2 is not ideal in this case, and they're already using option 1 for the StMM prototype. He also suggested a 3rd option, to map the embedded SP binary directly to user mode, but that requires deeper understanding and modifications to OP-TEE memory management.

Considering these, I'll implement option 1 for this task, and maybe later adopt option 3 if there is progress in this direction from Linaro.