Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information