diff --git a/README.ch.md b/README.ch.md index 494647b4cac004af01be914814d5b52562116642..0d0defe1b951c0d8312a463f89920000cec99f16 100644 --- a/README.ch.md +++ b/README.ch.md @@ -18,6 +18,7 @@ Rust-Shyper是由北航计算机学院操作系统研究团队,在华为技术 - [x] NVIDIA Jetson TX2 - [x] Raspberry Pi 4 Model B - [x] QEMU (note that VM migration and Hypervisor Live-update is not supported on QEMU) +- [x] Firefly ROC-RK3588S-PC (note that VM migration and Hypervisor Live-update is not supported on ROC-RK3588S-PC) ## 如何编译 @@ -48,13 +49,13 @@ MVM 是一个可以通过Hypervisor提供的私有特权接口来监控其他虚 通常情况下,MVM仅允许存在一个,且MVM会独占0号核心。 -该内核模块在如下系统作为MVM时,经测试可以正常运行:NVIDIA L4T 32.6.1 (for Jestion TX2). +该内核模块在如下系统作为MVM时,经测试可以正常运行:NVIDIA L4T 32.6.1 (for Jestion TX2), Linux 4.9.140/5.10.160 (for QEMU), Linux 5.10.160 (for Firefly ROC-RK3588S-PC). ## 如何启动客户虚拟机(Guest VM) 由boot-loader(如u-boot等)加载并启动Rust-Shyper镜像。Rust-Shyper完成初始化后,会自动启动MVM。 -登录到MVM中,按照如下步骤,就可以配置并启动客户虚拟机了。 +登录到MVM中,以QEMU为例,按照如下步骤,就可以配置并启动客户虚拟机了。 **Step 1**: 安装内核模块 @@ -67,17 +68,14 @@ insmod tools/shyper.ko 注:shyper-cli是Rust-Shyper配套的一个简单的命令行工具,以二进制的形式提供在tools目录下,其编译的目标平台为aarch64。 ```bash -# mediated-cfg.json is optional sudo tools/shyper system daemon [mediated-cfg.json] & ``` -mediated-cfg.json用于配置其他guest VM的virtio中介磁盘,示例如下: +mediated-cfg.json用于配置其他guest VM的virtio中介磁盘(如果是物理平台可以外接磁盘设备,如/dev/sda2、/dev/nvme0n1p2)。示例如下: ``` { "mediated": [ - "/dev/sda2", - "/dev/nvme0n1p2", "~/vm0.img" ] } @@ -173,7 +171,7 @@ sudo tools/shyper vm config "passthrough_device_list": [ { "name": "gicv", - "base_pa": "0x3886000", + "base_pa": "0x8040000", "base_ipa": "0x8010000", "length": "0x2000", "irq_num": 1, @@ -253,4 +251,3 @@ Rust-Shyper的开发者来自北京航空航天大学计算机学院操作系统 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) - diff --git a/README.md b/README.md index e585ecb8e8c39863420d3143edd82999faa6606b..ae4668e453c9163d4250b29f3b04f2064a5db211 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A Reliable Embedded Hypervisor Supporting VM Migration and Hypervisor Live-Updat ## Introduction -**Rust-Shyper** is an embedded type-1 hypervisor built with Rust, which has both high performance and high reliability. Designed for embedded platform, Rust-Shyper provides a small TCB and ensures isolation between different VMs. Furthermore, it can offer differentiated services for VMs such that the real-time performance of critical VMs are guaranteed. We have proposed low overhead VM migration and hypervisor live-update mechanisms to enable Rust-Shyper to tolerate hardware faults at runtime and dynamically fix hypervisor bugs. +**Rust-Shyper** is an embedded type-1 hypervisor built with Rust, which has both high performance and high reliability. Designed for embedded platform, Rust-Shyper provides a small TCB and ensures isolation between different VMs. Furthermore, it can offer differentiated services for VMs such that the real-time performance of critical VMs are guaranteed. We have proposed low overhead VM migration and hypervisor live-update mechanisms to enable Rust-Shyper to tolerate hardware faults at runtime and dynamically fix hypervisor bugs. Rust-Shyper was developed by the OS research team of the School of Computer Science and Engineering(SCSE), Beihang University(BUAA) with a funding of Huawei Technologies Co.,Ltd. @@ -18,6 +18,7 @@ The list of supported (and work in progress) platforms is presented below: - [x] NVIDIA Jetson TX2 - [x] Raspberry Pi 4 Model B - [x] QEMU (note that VM migration and Hypervisor Live-update is not supported on QEMU) +- [x] Firefly ROC-RK3588S-PC (note that VM migration and Hypervisor Live-update is not supported on ROC-RK3588S-PC) ## How to Build @@ -34,7 +35,7 @@ Simply run `make` make ``` -For example, `make tx2` is to build Rust-Shyper for TX2. +For example, `make tx2` is to build Rust-Shyper for TX2. Note that please edit the MVM profile in src/config/\_def.rs according to your requirements. @@ -47,11 +48,11 @@ Currently, the Firefly ROC-RK3588S-PC platform is supported, and a complete user MVM is a privileged VM that can monitor the status of other VMs through privileged interfaces provided by the hypervisor. We implement a dedicated Linux kernel module for MVM. Through this module, MVM can make a hypercall to realize specific functions, such as VM configuration, VM migration and hypervisor live-update. Generally, there is only one MVM, and it will monopolize core 0. -The kernel module on NVIDIA L4T 32.6.1 (for Jestion TX2) as MVM has been tested. +The kernel module on NVIDIA L4T 32.6.1 (for Jestion TX2), Linux 4.9.140/5.10.160 (for QEMU), Linux 5.10.160 (for Firefly ROC-RK3588S-PC) as MVM has been tested. ## How to Run Guest VM -When starting Rust-Shyper, the MVM will boot automatically. Logging on to the MVM (a Linux priviledged VM), then can we configure and start the Guest VMs. +When starting Rust-Shyper, the MVM will boot automatically. Logging on to the MVM (a Linux priviledged VM), take the QEMU configuration as an example, then can we configure and start the Guest VMs. **Step 1**: Install the kernel module @@ -62,17 +63,14 @@ insmod tools/shyper.ko **Step 2**: Start the shyper-cli daemon ```bash -# mediated-cfg.json is optional sudo tools/shyper system daemon [mediated-cfg.json] & ``` -mediated-cfg.json is used for guest VM as virtio block. For example: +mediated-cfg.json is used for guest VM as virtio block. If it is a physical platform, you can connect external disk devices, such as /dev/sda2, /dev/nvme0n1p2. For example: ``` { "mediated": [ - "/dev/sda2", - "/dev/nvme0n1p2", "~/vm0.img" ] } @@ -168,7 +166,7 @@ sudo tools/shyper vm config "passthrough_device_list": [ { "name": "gicv", - "base_pa": "0x3886000", + "base_pa": "0x8040000", "base_ipa": "0x8010000", "length": "0x2000", "irq_num": 1, diff --git a/src/config/qemu_def.rs b/src/config/qemu_def.rs index eed3179a9e7d5815c10df7e3de0c02ba594accbb..2d4dece9e88046e6589c9725355aff80174f1bdd 100644 --- a/src/config/qemu_def.rs +++ b/src/config/qemu_def.rs @@ -92,6 +92,15 @@ pub fn mvm_config_init() { emu_type: EmuDeviceType::EmuDeviceTVirtioNet, mediated: false, }, + VmEmulatedDeviceConfig { + name: String::from("virtio_console@a002000"), + base_ipa: 0xa002000, + length: 0x1000, + irq_id: 32 + 0x12, + cfg_list: vec![1, 0xa002000], + emu_type: EmuDeviceType::EmuDeviceTVirtioConsole, + mediated: false, + }, VmEmulatedDeviceConfig { name: String::from("shyper"), base_ipa: 0,