DuVisor: a User-level Hypervisor Through Delegated Virtualization

Jiahao Chen, Dingji Li, Zeyu Mi, Yuxuan Liu, Binyu Zang, Haibing Guan, Haibo ChenarXiv 2022

Abstract

Traditional virtualization architectures face a fundamental trade-off between security and performance. DuVisor introduces "Delegated Virtualization," a hardware-software co-design that moves the virtualization data plane entirely into user space. By leveraging a custom RISC-V hardware extension (DV-Ext), DuVisor reduces the kernel's trusted computing base (TCB) from tens of thousands of lines of code to just 317, while outperforming KVM by up to 48%.

The Virtualization Security-Performance Dilemma

Mainstream hypervisors like KVM/QEMU typically split functionality between a large kernel-resident driver and a user-level management process. This design introduces two critical weaknesses:

  1. Security Risks: The kernel-resident portion is massive and complex. For instance, KVM contains approximately 57,000 lines of code. Operating in kernel mode means any vulnerability can lead to a total host compromise. Historically, KVM has seen over 120 CVEs.
  2. Performance Overheads: Sensitive VM operations (VM exits) require expensive traps into the host kernel. Forwarding these events to user-space managers incurs further "ring crossing" latency.

Previous attempts to improve security by moving logic to user space often exacerbated performance issues due to increased kernel-to-user transitions.

Comparison of DuVisor with traditional monolithic and host-OS-reusing hypervisor architectures.

Delegated Virtualization: The DuVisor Architecture

DuVisor resolves this conflict through a hardware-software co-design that removes the host kernel from the VM's runtime path.

Hardware Extension (DV-Ext)

The core of DuVisor is the Delegated Virtualization Extension (DV-Ext), implemented on a modified RISC-V Rocket CPU. This extension introduces a new user-level hypervisor mode (HU-mode) with dedicated registers and instructions. This allows DuVisor to handle VM exits, configure virtualization state, and inject interrupts directly without kernel intervention.

Architecture of DuVisor showing the interaction between software components and the DV-Ext hardware.

Secure Memory and Interrupts

To maintain isolation, DuVisor utilizes a virtualization-aware Physical Memory Protection (PMP) mechanism. The kernel defines a "sandbox" for DuVisor, and a hardware "V-bit" ensures that DuVisor cannot map physical memory outside its assigned range, even while managing its own stage-2 page tables. Additionally, a hardware-based User-Level Interrupt (UIPI) mechanism allows vCPUs to notify each other directly, bypassing the host kernel's interrupt controller.

Evaluation and Key Results

The system was evaluated using the FireSim cycle-accurate hardware simulation platform on AWS F1 FPGAs, comparing DuVisor against a KVM baseline.

Performance Gains

DuVisor consistently outperformed KVM across various benchmarks:

  • Memcached: Achieved a 47.96% improvement in throughput.
  • MMIO Emulation: ~78% faster than KVM by avoiding kernel-to-user transfers.
  • Stage-2 Page Faults: ~71% faster, bypassing complex Linux kernel memory allocation logic.
  • Virtual IPI: ~78% faster due to the direct hardware UIPI mechanism.

Security Hardening

By treating the host kernel strictly as a control plane for initialization and resource allocation, DuVisor effectively removes it from the data plane. This architectural shift reduced the security-critical kernel code from ~57,000 lines in KVM to a mere 317 lines in the DuVisor CP driver, drastically shrinking the attack surface.

Conclusion and Future Work

DuVisor demonstrates that providing user-space with the right hardware "keys" can eliminate kernel overhead for common virtualization operations without sacrificing system integrity. While currently limited by the requirement for custom hardware (DV-Ext) and basic I/O implementations, future work aims to integrate user-level scheduling frameworks and explore optimizations for nested virtualization.

Summary updated

BibTeX
@misc{chen2022duvisor,
  author = {Jiahao Chen and Dingji Li and Zeyu Mi and Yuxuan Liu and Binyu Zang and Haibing Guan and Haibo Chen},
  title = {{DuVisor: a User-level Hypervisor Through Delegated Virtualization}},
  year = {2022},
  eprint = {2201.09652},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2201.09652},
}
Figure