AArch64 EL2 hypervisor for QEMU virt that boots at EL2
1

Configure Feed

Select the types of activity you want to include in your feed.

Add allocator ownership assertions for stage two table pages

+11
+11
mm/stage2.c
··· 101 101 return (uint64_t *)(uintptr_t)desc_addr(g_l1[l1_index]); 102 102 } 103 103 104 + static bool l2_table_owned(const uint64_t *table) 105 + { 106 + uintptr_t base = (uintptr_t)&g_l2_tables[0][0]; 107 + uintptr_t end = (uintptr_t)g_l2_tables + sizeof(g_l2_tables); 108 + uintptr_t addr = (uintptr_t)table; 109 + return addr >= base && addr < end && hv_is_aligned_u64((uint64_t)addr, CONFIG_PAGE_SIZE); 110 + } 111 + 104 112 bool stage2_map_range(ipa_t ipa, paddr_t pa, uint64_t size, enum stage2_mem_type type, uint32_t perms) 105 113 { 106 114 uint64_t ipa_end; ··· 332 340 } 333 341 if ((g_l1[i] & S2_DESC_VALID) != 0u) { 334 342 uint64_t *l2 = (uint64_t *)(uintptr_t)desc_addr(g_l1[i]); 343 + if (!l2_table_owned(l2)) { 344 + return false; 345 + } 335 346 for (uint32_t j = 0; j < S2_ENTRIES; j++) { 336 347 if ((l2[j] & S2_DESC_VALID) != 0u && !descriptor_valid(l2[j])) { 337 348 return false;