[arch][mmu] add another routine to query if the arch supports user aspaces

Trim the arch mmu unit tests accordingly.

Should probably switch this to a #define, but it's possible some of
these queries could be dynamically detected (XN for example). May
revisit at some point.
This commit is contained in:
Travis Geiselbrecht
2022-10-23 22:40:00 -07:00
parent 550256d6bc
commit 7017a8fff9
7 changed files with 101 additions and 85 deletions

View File

@@ -405,6 +405,7 @@ int arch_mmu_map(arch_aspace_t * const aspace, const vaddr_t vaddr, const paddr_
bool arch_mmu_supports_nx_mappings(void) { return false; }
bool arch_mmu_supports_ns_mappings(void) { return false; }
bool arch_mmu_supports_user_aspaces(void) { return false; }
void x86_mmu_early_init(void) {
/* Set WP bit in CR0*/

View File

@@ -604,6 +604,7 @@ int arch_mmu_map(arch_aspace_t *const aspace, const vaddr_t vaddr, const paddr_t
bool arch_mmu_supports_nx_mappings(void) { return true; }
bool arch_mmu_supports_ns_mappings(void) { return false; }
bool arch_mmu_supports_user_aspaces(void) { return false; }
void x86_mmu_early_init(void) {
volatile uint64_t efer_msr, cr0, cr4;