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.

Use translation table alignment invariants at runtime

+15 -1
+15 -1
mm/stage2.c
··· 35 35 return addr & 0x0000fffffffff000ull; 36 36 } 37 37 38 + static bool table_arena_aligned(void) 39 + { 40 + if (!hv_is_aligned_u64((uint64_t)(uintptr_t)g_l1, 65536u)) { 41 + return false; 42 + } 43 + for (uint32_t i = 0; i < HV_ARRAY_SIZE(g_l2_tables); i++) { 44 + if (!hv_is_aligned_u64((uint64_t)(uintptr_t)g_l2_tables[i], CONFIG_PAGE_SIZE)) { 45 + return false; 46 + } 47 + } 48 + return true; 49 + } 50 + 38 51 void stage2_init(void) 39 52 { 53 + BUG_ON(!table_arena_aligned()); 40 54 hv_memset(g_l1, 0, sizeof(g_l1)); 41 55 hv_memset(g_l2_tables, 0, sizeof(g_l2_tables)); 42 56 g_l2_used = 0; ··· 331 345 332 346 bool stage2_selftest(void) 333 347 { 334 - if (!hv_is_aligned_u64((uint64_t)(uintptr_t)g_l1, 65536u)) { 348 + if (!table_arena_aligned()) { 335 349 return false; 336 350 } 337 351 for (uint32_t i = 0; i < S2_ENTRIES; i++) {