3.7 KiB
Architecture Stubs Implementation Plan
This implementation plan identifies the existing stubs across the primary supported architectures: ARMv7, AArch64 / ARMv8, and RISC-V, outlining what is needed to complete these development phases.
Note
Per your instructions, Apple Silicon (M1) research code and the associated
linux_stubpayloads have been excluded from the AArch64 analysis.
User Review Required
Please review the identified stubs below and confirm if any specific category or architecture should be prioritized for implementation first. Once approved, we will break these down into concrete tasks.
Proposed Changes / Identified Stubs
1. ARMv7 (kernel/src/arch/armv7/)
The ARMv7 architecture contains several foundational memory management and exception handling stubs that need to be fully implemented.
exceptions.cpp:- FIQ Handling: Platform-specific Fast Interrupt Request (FIQ) handling is currently marked as
TODO.
- FIQ Handling: Platform-specific Fast Interrupt Request (FIQ) handling is currently marked as
uos_cmm.cpp:- MMU Initialization: Contains link-stubs for
uos_arm_init_mmuand_activate_mmu. - Page Table Setup: Writing to
TTBR0/TTBR1, settingTTBCR=1,DACR=0x55555555, and executingTLBIALLis marked as aTODO D-1.3. - PSP Initialization: Contains a PSP (Processor State Parameter) init stub which needs its real body populated from UART, timer, and board halt signals.
- MMU Initialization: Contains link-stubs for
2. AArch64 / ARMv8 (kernel/src/arch/aarch64/)
Excluding the Apple Silicon M1-specific payloads (guest_payload/, apple/, linux_stub), the mainline AArch64 hypervisor code contains the following stubs:
context_switch.S:- Exception Vectors: Mentions that
x0itself is saved by the caller (the exception vector stub) before the branch, which indicates the exception vectors might currently be stubbed or rely on a minimal shim.
- Exception Vectors: Mentions that
el2_guest.cpp:- MMIO Emulation: The MMIO path contains a minimal probe-compatible stub for EL2 guest support that needs expansion for proper guest device emulation.
kernel_aarch64.cpp&virtio_blk.cpp:- VBAR / Guest Booting: Currently references a stub payload supplying its own
VBAR_EL1. This needs to be transitioned to adopt a real Image loaded by QEMU rather than relying on a standalone stub.
- VBAR / Guest Booting: Currently references a stub payload supplying its own
3. RISC-V (kernel/src/arch/riscv/)
The RISC-V architecture implementation has several features related to partition management and memory that are stubbed out.
hm.cpp(Health Monitor):- Partition Control: The logic to
stop partitionandrestart partitionis marked asTODO.
- Partition Control: The logic to
vm.cpp(Virtual Memory):- Memory Management: Both
demand pagingandMMIO emulationare marked asTODOand require full implementations to support advanced guest operating systems.
- Memory Management: Both
guest_loader.cpp:- ELF Parsing: ELF parsing is explicitly noted as not implemented in this layer, meaning the hypervisor cannot currently parse and load standard ELF guests on RISC-V without relying on external payloads or flat binaries.
Verification Plan
Automated Tests
- Build verification for each architecture using existing Make targets (
make ARCH=armv7,make ARCH=aarch64,make ARCH=riscv). - Since there is no unit-test framework, verification relies heavily on successful compilation without linker errors.
Manual Verification
- Boot the generated binaries in QEMU (e.g.,
qemu-system-arm,qemu-system-aarch64,qemu-system-riscv64) according to theAGENTS.mdverification workflow. - Validate that the newly implemented subsystems (e.g., MMU for ARMv7, MMIO for RISC-V/AArch64) correctly output to UART and progress past their previous stubbed states without hanging or faulting.