百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

RVirt

> 编程语言
开源

使用 Rust 编写的 RISC-V 超级管理程序

370 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

使用 Rust 编写的 RISC-V 超级管理程序

RVirt

RVirt is an S-mode trap-and-emulate hypervisor for RISC-V. It is currently targeted at QEMU's virt machine type, but partially supports the HiFive Unleashed as well. It can run either on either the Berkeley Boot Loader or with its own (considerably faster) M-mode stub. It is powerful enough to run multiple instances of Linux as guest operating systems.

FAQ

How is RVirt different from other hypervisors like Firecracker, Cloud Hypervisor or xvisor?

All three of the other projects can only run on processors that have hardware virtualization extensions like Intel VT-x or RISC-V's planned H-extension. Firecracker and Cloud Hypervisor additionally depend on KVM (and by extension the entire Linux kernel). By contrast, RVirt doesn't need KVM or Linux and can run on any sufficiently powerful 64-bit RISC-V processor with an MMU.

Why RISC-V?

RISC-V is classically virtualizable which means that a hypervisor can rely on any privileged instruction triggering an illegal instruction fault when executed by the (unprivileged) guest OS. This is in contrast to other ISAs like x86 which have instructions that behave differently in user and kernel mode but never trap. Additionally, RISC-V has only 12 supervisor level control registers and only a handful of privileged instructions making the work to implement trap and emulate much more manageable.

Why Rust?

Why not? Rust is a pleasant language to work with and can directly target bare metal platforms. I was also excited by Rust's ability to guarantee memory safety for safe code, but I found the amount of unsafe code required for initialization and vm entry/exit partially negated this benefit.

Getting Started

For more detailed instructions, see the getting started guide.

Install Dependencies

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ sudo apt-get install qemu-system-misc

Clone the repository

$ git clone https://github.com/mit-pdos/rvirt && cd rvirt

Download guest images

$ wget https://fedorapeople.org/groups/risc-v/disk-images/vmlinux
$ mv vmlinux fedora-vmlinux
$ wget https://fedorapeople.org/groups/risc-v/disk-images/stage4-disk.img.xz
$ unxz stage4-disk.img.xz

Compile and run

$ make qemu

This command launches an instance of QEMU with RVirt running inside and Linux running inside that. Once the boot process has completed you can SSH in through all the layers and directly interact with the guest (root password is 'riscv'):

$ ssh -p 10001 root@localhost

Current Status

RVirt supports running both inside an emulator and on real hardware and does runtime detection to learn what platform it is executing on. It has so far been tested with Fedora RISC-V builds, but may work with other distributions as well.

Supported Platforms

Tier 1: Boots fully and supports interaction via SSH / serial console

  • QEMU virt machine type

Tier 2: Boots partially but lacks driver support for block/network device to complete boot process

  • HiFive Unleashed board
  • QEMU sifiveu machine type

Correctness

  • Trap and emulate of privileged instructions (CSR related and SFENCE.VMA)
  • Shadow page tables
  • Update PTE accessed and dirty bits
  • Timers
  • Expose and/or emulate peripherals
  • Address lingering bugs in boot process

Functionality

In addition to being able to boot and run a single guest, RVirt also supports some features not needed for the correct virtualization of a single guest:

  • multiple guests
  • passthrough of virtio block and network devices
  • paravirtualized network devices backed by HiFive Unleashed's NIC (in progress)
  • multicore guests and inter-processor interrupts between them

Other features not used by Linux / not supported by current platforms are unlikely to be implemented:

  • ASID support
  • Sv48 or Sv57 guest page tables (only Sv39 currently allowed)
  • SR-IOV PCIe devices
  • 32-bit guests

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言