aarch64: mmu: Do not assume a single set of pagetables is used

The MMU code is currently assuming that Zephyr only uses one single set
of page tables shared by kernel and user threads. This could possibly be
not longer true in the future when multiple set of page tables can be
present and swapped at run-time.

With this patch a new arm_mmu_ptables struct is introduced that is used
to host a buffer pointing to the memory region containing the page
tables and the helper variables used to manage the page tables. This new
struct is then used by the ARM64 MMU code instead of assuming that the
kernel page tables are the only ones present.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This commit is contained in:
Carlo Caione 2020-10-22 09:39:44 +02:00 committed by Anas Nashif
commit 0a0061d901
2 changed files with 42 additions and 28 deletions

View file

@ -158,6 +158,11 @@ struct arm_mmu_config {
const struct arm_mmu_region *mmu_regions;
};
struct arm_mmu_ptables {
uint64_t *xlat_tables;
unsigned char next_table;
};
/* Convenience macros to represent the ARMv8-A-specific
* configuration for memory access permission and
* cache-ability attribution.