Home
last modified time | relevance | path

Searched hist:"1502 e43d750cd645beec7186994d5492a910f358" (Results 1 – 1 of 1) sorted by relevance

/optee_os/core/mm/
H A Dcore_mmu.c1502e43d750cd645beec7186994d5492a910f358 Wed Aug 14 10:28:52 UTC 2024 Yu Chien Peter Lin <peterlin@andestech.com> core: mm: core_mmu: don't use check_va_matches_pa() on RISC-V

The arch_va2pa_helper() in the RISC-V implements a software page table
walker. It requires phys_to_virt() to convert the physical page on the
PTE to the virtual address of the next level page table. The process
can lead to a stack overflow caused by indirect recursion as below:

phys_to_virt() <--------------------------------.
-> check_va_matches_pa() |
-> virt_to_phys() |
-> arch_va2pa_helper() |
-> core_mmu_xlat_table_entry_pa2va()-'

As arch_va2pa_helper() can return true if va matches pa, we
don't use and check_va_matches_pa() when CFG_TEE_CORE_DEBUG
is enabled.

Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Alvin Chang <alvinga@andestech.com>
Tested-by: Alvin Chang <alvinga@andestech.com>
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>