Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RISC-V 64 Hypervisor: rCore on rCore #80

Merged
merged 18 commits into from
Sep 23, 2021

Conversation

gjz010
Copy link
Contributor

@gjz010 gjz010 commented May 10, 2021

综述

本commit为rCore以及RVM实现了Hypervisor机制;借助于qemu对RISC-V Hypervisor Extension的支持,我们基于RVM实现了硬件加速的RISC-V虚拟化,并对rCore进行了相应调整;另一方面,考虑到rCore是至今为止对RISC-V支持最好的实验OS,我们选择同时直接将rCore(而不是ucore)作为Guest OS运行在RVM之上。此外,本Commit还涵盖了从驱动到内存管理机制的一系列调整和Bugfix。

output.mp4

相关PR和仓库

Features

  • 增强了rCore对新版OpenSBI的支持,使得rCore可以运行于新版本的qemu之上 (已合并入主分支:Migrating to OpenSBI 0.9 with SBI spec 0.2 #72)
  • 调整时间相关模块,使得RTC可以在riscv64上被使用
  • 修复了一个和Delayed Mapping相关的内存bug:原来的逻辑会将present的页简单粗暴地判定成无法处理的fault;假如两个线程同时访问了同一个delayed page,第二个delayed page handler会直接失败(因为第一个handler成功处理缺页,将页设为present);这个bug被通过引入更细化的检查解决。(TODO:现在只支持riscv64,需要其它平台同样实现)
  • 通过SBI输出RISC-V平台启动时的早期(串口成功初始化之前)日志;同时,日志输出不再需要堆内存分配。
  • 加入了新的board类型rcore_vmm_guest,只会加载uart16650和PLIC驱动,并且会将GUEST_USER_IMG链接入内核中。
  • 修复了Uart16650输出时的一个判断值错误。
  • 加入了VirtIO串口驱动,可以通过UART2=on/tmp/rcore_uart2埠上开启第二串口。同时,将所有的串口在devfs中以/dev/ttySx的形式暴露出来,使得用户程序可以直接操作第二串口。参考Rust用户程序uart2

Known Issues

  • 强行把RVM bump到了master版本,而新版RVM(x86_64平台)仍然没有适配rCore(例如,两个新的hook)
  • VirtIO console偶尔会有卡顿

@jiegec
Copy link
Member

jiegec commented May 12, 2021

Please fix ci.

kernel/src/rvm/mod.rs Outdated Show resolved Hide resolved
@jiegec jiegec merged commit 13ad2d1 into rcore-os:master Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants