nuttx/arch/arm64
Ville Juven a559f3495a arm64_addrenv: Fix the amount of page table levels
The VMSAv8-64 translation system has 4 page table levels in total, ranging
from 0-3. The address environment code assumes only 3 levels, from 1-3 but
this is wrong; the amount of levels _utilized_ depends on the configured
VA size CONFIG_ARM64_VA_BITS. With <= 39 bits 3 levels is enough, while
if the va range is larger, the 4th translation table level is taken into
use dynamically by shifting the base translation table level.

From arm64_mmu.c, where va_bits is the amount of va bits used in address
translations:
(va_bits <= 21)       - base level 3
(22 <= va_bits <= 30) - base level 2
(31 <= va_bits <= 39) - base level 1
(40 <= va_bits <= 48) - base level 0

The base level is what is configured as the page directory root. This also
affects the performance of address translations i.e. if the VA range is
smaller, address translations are also faster as the page table walk is
shorter.
2024-09-21 08:36:23 -03:00
..
include arm64_addrenv: Fix the amount of page table levels 2024-09-21 08:36:23 -03:00
src arm64_addrenv: Fix the amount of page table levels 2024-09-21 08:36:23 -03:00
CMakeLists.txt CMake:init arm64 CMake qemu-armv8a build 2023-12-27 07:27:17 -08:00
Kconfig arm64/Kconfig: Make the ARM64_PA/VA_BITS a true Kconfig variable 2024-09-12 17:16:20 +08:00