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 explicit linker symbols for image boundary provenance

+37 -1
+1 -1
Makefile
··· 41 41 42 42 HV_C_SRCS := \ 43 43 arch/aarch64/arch.c \ 44 - core/main.c core/el2_mmu.c core/fdt.c core/guest_loader.c core/log.c core/mmio_policy.c core/panic.c core/policy.c core/psci.c core/selftest.c \ 44 + core/main.c core/el2_mmu.c core/fdt.c core/guest_loader.c core/image.c core/log.c core/mmio_policy.c core/panic.c core/policy.c core/psci.c core/selftest.c \ 45 45 core/string.c core/sysreg.c core/trap.c core/vcpu.c core/monitor.c \ 46 46 drivers/gicv3.c drivers/pl011.c drivers/timer.c \ 47 47 mm/allocator.c mm/stage2.c
+21
core/image.c
··· 1 + #include "hv/arch.h" 2 + #include "hv/image.h" 3 + 4 + struct hv_image_span hv_image_span(void) 5 + { 6 + struct hv_image_span span; 7 + span.start = (uint64_t)(uintptr_t)__image_start; 8 + span.end = (uint64_t)(uintptr_t)__image_end; 9 + span.size = span.end - span.start; 10 + return span; 11 + } 12 + 13 + bool hv_image_contains(uint64_t addr, uint64_t len) 14 + { 15 + struct hv_image_span span = hv_image_span(); 16 + uint64_t end; 17 + if (len == 0u || hv_add_overflow_u64(addr, len, &end)) { 18 + return false; 19 + } 20 + return addr >= span.start && end <= span.end; 21 + }
+15
include/hv/image.h
··· 1 + #ifndef HV_IMAGE_H 2 + #define HV_IMAGE_H 3 + 4 + #include "hv/types.h" 5 + 6 + struct hv_image_span { 7 + uint64_t start; 8 + uint64_t end; 9 + uint64_t size; 10 + }; 11 + 12 + struct hv_image_span hv_image_span(void); 13 + bool hv_image_contains(uint64_t addr, uint64_t len); 14 + 15 + #endif