How quic/gunyah-hypervisor works
Main Components
• Hypervisor Core: The “hyp” directory is the heart of Gunyah, and it is subdivided into many functional modules. Be sure to represent key subsystems such as:
– Boot & Initialization (e.g., hyp/core/boot)
– CPU and VCPU Management (e.g., hyp/core, hyp/vm/vcpu and hyp/vm/vcpu_*)
– Scheduling & Threading (modules under hyp/core/thread_standard, hyp/core/scheduler_fprr, hyp/core/scheduler_trivial)
– Memory Management (under hyp/mem, including address space, allocators, and page tables)
– Interrupt, IPI, and ISR Management (modules under hyp/core/irq, hyp/core/ipi, and various “interfaces/irq”)
– Debug and Diagnostics (hyp/core/debug and hyp/debug)
– Device and Peripheral Virtualization (hyp/core/vdevice, hyp/platform and portions of hyp/interfaces such as doorbell, virtio_mmio, and others)
– Hypercall/API Handling (hyp/core/api and corresponding tools/hypercalls)
Architecture-Specific & Platform Support Modules
• Configuration Files: The “config” directory with “arch” and “featureset” files provides architecture- and platform-specific configuration details. Show these as external configuration layers feeding into the hypervisor core.
• Architecture Subdirectories within “hyp/arch” (e.g., aarch64, armv8, cortex variants) should be represented to illustrate how the hypervisor tailors its low-level implementations to different ARM platforms.
Virtual Machine (VM) Subsystem
• VM Management: The “hyp/vm” directory contains submodules that manage different aspects of virtual machine operation and isolation such as “vcpu”, “psci”, “rootvm”, “arm_vm_timer”, etc. Represent the VM manager as a distinct layer interfacing with the core services.
• Emulation and Paravirtualization: Highlight components in “hyp/vdevice” for device emulation and parts of “hyp/ipc” such as doorbell and msgqueue that support inter-VM communication.
Interfaces and Abstraction Layers
• How the various modules (core, VM, platform) interact via these common interfaces.
Tools and Build Infrastructure
• Configuration and quality control files (e.g., SConstruct, .clang-format, .editorconfig, config/quality) that underline the build and deployment processes.
Relationships and Interactions
• Bidirectional interactions between the Hypervisor Core and the VM layer, showing that core services (e.g., scheduling, memory management) directly impact virtual machine operation.
• Connections between Interfaces and the various core components to underscore the common API contracts.
• For platform support, include directional flow from low-level hardware abstraction modules (hyp/platform) to hypervisor initialization and runtime.
Architectural Patterns and Design Principles
• Design as modular and layered:
– The bottom layers (hardware-specific implementations) are abstracted through interfaces.
– A core hypervisor layer provides essential services like scheduling and memory management.
– The VM layer sits on top of the core, managing guest VMs and leveraging the underlying hardware virtualization features.
• Separation between generic hypervisor services and architecture-specific implementations, reinforcing portability and minimal trusted computing base ideas.