core: riscv: refactor MMU enablement code

Replace the set_satp macro with a proper enable_mmu function
to handle the transition to randomized virtual addresses. The
function executes from the identity mapped section to maintain
execution continuity during the VA->PA transition. It adjusts
the stack pointer, global pointer, thread pointer and ra register
with the ASLR offset.

The console is reinitialized after ASLR mapping is active since
the registered addresses need to be updated.

Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
Co-developed-by: Alvin Chang <alvinga@andestech.com>
Signed-off-by: Alvin Chang <alvinga@andestech.com>
2 files changed
tree: 9e3545d185878063c0aefa31c0b0d1ee4c8aa11c
  1. .devcontainer/
  2. .github/
  3. .vscode/
  4. core/
  5. keys/
  6. ldelf/
  7. lib/
  8. mk/
  9. scripts/
  10. ta/
  11. .checkpatch.conf
  12. .clang-format
  13. .gitattributes
  14. .gitignore
  15. CHANGELOG.md
  16. LICENSE
  17. MAINTAINERS
  18. Makefile
  19. README.md
  20. typedefs.checkpatch
README.md

OP-TEE Trusted OS

This git contains source code for the secure side implementation of OP-TEE project.

All official OP-TEE documentation has moved to http://optee.readthedocs.io.

// OP-TEE core maintainers