core: pager: fix get_linear_map_end()

With paging enabled there is an unpaged portion of OP-TEE which ends at
the address returned by get_linear_map_end(). Without ASLR enabled this
is both a virtual and physical address. However, with ASLR enabled it's
important to keep these addresses apart so add get_linear_map_end_va()
and get_linear_map_end_pa() and use the right function in
phys_to_virt_tee_ram() and is_unpaged().

This fixes occasional errors like:
E/TC:0 0 Panic 'can't find mmu tables' at core/arch/arm/mm/tee_pager.c:549 <tee_pager_early_init>
E/TC:0 0 TEE load address @ 0x50b9000
E/TC:0 0 Call stack:
E/TC:0 0  0x050bf144

with paging and ASLR enabled.

Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (vexpress-qemu_armv8a)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
1 file changed
tree: cbb78a267e8a5ccc1ccd8d0265997a81c30dc90c
  1. .github/
  2. core/
  3. keys/
  4. ldelf/
  5. lib/
  6. mk/
  7. scripts/
  8. ta/
  9. .azure-pipelines.yml
  10. .checkpatch.conf
  11. .gitattributes
  12. .gitignore
  13. CHANGELOG.md
  14. LICENSE
  15. MAINTAINERS
  16. Makefile
  17. README.md
  18. 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