Implementing a RISC-V Hypervisor
Published on: 2025-07-04 05:46:29
To implement a seamless Linux integration into Starina, I decided to go with a Linux lightweight VM approach similar to WSL2. This means I need to implement a hypervisor that can run Linux.
I had implemented an Intel VT-x based hypervisor before, but this time I wanted to try something different: RISC-V H-extension based hypervisor!
This post is a diary of my journey of writing a RISC-V hypervisor incrementally.
RISC-V H-extension
RISC-V H-extension introduces new CPU modes and some more CSRs (so-called control registers) to implement hardware-assisted virtualization. Its design is similar to Intel VT-x in the sense that both host and guest modes have their own kernel mode and user mode. This design makes it easy to run host OS along with guests, that is, guests behave as normal host processes (e.g. QEMU and Firecracker).
How can I test a hypervisor on macOS?
Unlike Linux KVM-based hypervisors (more specifically, virtual machine monitors), Starina is a new operating system and ha
... Read full article.