Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
description of repo status
Open Source
>
Other
>
Operation System
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
458
Star
1.7K
Fork
1.9K
GVP
openEuler
/
kernel
Closed
Code
Issues
1271
Pull Requests
991
Wiki
Insights
Pipelines
Service
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
DevLens
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
【虚拟化】kernel OLK-5.10 supports KVM RISC-V
Done
#I26X9V
Requirement
limingwang
Opened this issue
2020-11-25 15:20
测试RISC-V虚拟化功能 1. 启动虚拟机 1.1 为仿真器配置虚拟网桥 $ brctl addbr virbr0 $ brctl stp virbr0 on $ ifconfig virbr0 up $ ifconfig virbr0 192.168.122.1 netmask 255.255.255.0 1.2 启动仿真器 $ ./qemu-system-riscv64 -M virt -m 4096M -cpu rv64,x-h=true -nographic \ -name guest=riscv-hyp,debug-threads=on \ -smp 4 \ -bios ./fw_jump.bin \ -kernel ./Image \ -drive file=./hypervisor.img,format=raw,id=hd0 \ -device virtio-blk-device,drive=hd0 \ -append "root=/dev/vda rw console=ttyS0 earlycon=sbi" \ -netdev type=tap,script=./ifup.sh,downscript=./ifdown.sh,id=net0 \ -device virtio-net-device,netdev=net0 结果如下:  1.3 启动RISC-V虚拟机 $ ./qemu-system-riscv64 -M virt,accel=kvm -m 512M -cpu host -nographic \ -name guest=riscv-guest \ -bios none \ -smp 2 \ -kernel ./Image \ -drive file=./guest.img,format=raw,id=hd0 \ -device virtio-blk,drive=hd0 \ -append "root=/dev/vda rw console=ttyS0 earlycon=sbi" 结果如下:  2. 热迁移 2.1 在仿真器1上启动源端虚拟机 $ ./qemu-system-riscv64 -M virt,accel=kvm -m 512M -cpu host -nographic \ -name guest=riscv-guest \ -bios none \ -smp 2 \ -kernel ./Image \ -drive file=./guest.img,format=raw,id=hd0 \ -device virtio-blk,drive=hd0 \ -append "root=/dev/vda rw console=ttyS0 earlycon=sbi" \ -monitor tcp:0:55555,server,nowait \ 2.2 在仿真器2上启动对端虚拟机,等待源端迁移 $ ./qemu-system-riscv64 -M virt,accel=kvm -m 512M -cpu host -nographic \ -name guest=riscv-guest \ -bios none \ -smp 2 \ -kernel ./Image \ -drive file=./guest.img,format=raw,id=hd0 \ -device virtio-blk,drive=hd0 \ -append "root=/dev/vda rw console=ttyS0 earlycon=sbi" \ -device i6300esb,id=watchdog \ -serial tcp:0:33333,server,nowait \ -incoming tcp:0:44444 \ -monitor tcp:0:55555,server,nowait 2.3 登录仿真器1,启动热迁移 $ socat -,echo=0,icanon=0 tcp-connect:192.168.122.2:55555 (qemu) migrate -d -i tcp:192.168.122.3:44444 2.4 登录热迁移后的虚拟机 $ socat -,echo=0,icanon=0 tcp-connect:192.168.122.3:33333 结果如下: 
测试RISC-V虚拟化功能 1. 启动虚拟机 1.1 为仿真器配置虚拟网桥 $ brctl addbr virbr0 $ brctl stp virbr0 on $ ifconfig virbr0 up $ ifconfig virbr0 192.168.122.1 netmask 255.255.255.0 1.2 启动仿真器 $ ./qemu-system-riscv64 -M virt -m 4096M -cpu rv64,x-h=true -nographic \ -name guest=riscv-hyp,debug-threads=on \ -smp 4 \ -bios ./fw_jump.bin \ -kernel ./Image \ -drive file=./hypervisor.img,format=raw,id=hd0 \ -device virtio-blk-device,drive=hd0 \ -append "root=/dev/vda rw console=ttyS0 earlycon=sbi" \ -netdev type=tap,script=./ifup.sh,downscript=./ifdown.sh,id=net0 \ -device virtio-net-device,netdev=net0 结果如下:  1.3 启动RISC-V虚拟机 $ ./qemu-system-riscv64 -M virt,accel=kvm -m 512M -cpu host -nographic \ -name guest=riscv-guest \ -bios none \ -smp 2 \ -kernel ./Image \ -drive file=./guest.img,format=raw,id=hd0 \ -device virtio-blk,drive=hd0 \ -append "root=/dev/vda rw console=ttyS0 earlycon=sbi" 结果如下:  2. 热迁移 2.1 在仿真器1上启动源端虚拟机 $ ./qemu-system-riscv64 -M virt,accel=kvm -m 512M -cpu host -nographic \ -name guest=riscv-guest \ -bios none \ -smp 2 \ -kernel ./Image \ -drive file=./guest.img,format=raw,id=hd0 \ -device virtio-blk,drive=hd0 \ -append "root=/dev/vda rw console=ttyS0 earlycon=sbi" \ -monitor tcp:0:55555,server,nowait \ 2.2 在仿真器2上启动对端虚拟机,等待源端迁移 $ ./qemu-system-riscv64 -M virt,accel=kvm -m 512M -cpu host -nographic \ -name guest=riscv-guest \ -bios none \ -smp 2 \ -kernel ./Image \ -drive file=./guest.img,format=raw,id=hd0 \ -device virtio-blk,drive=hd0 \ -append "root=/dev/vda rw console=ttyS0 earlycon=sbi" \ -device i6300esb,id=watchdog \ -serial tcp:0:33333,server,nowait \ -incoming tcp:0:44444 \ -monitor tcp:0:55555,server,nowait 2.3 登录仿真器1,启动热迁移 $ socat -,echo=0,icanon=0 tcp-connect:192.168.122.2:55555 (qemu) migrate -d -i tcp:192.168.122.3:44444 2.4 登录热迁移后的虚拟机 $ socat -,echo=0,icanon=0 tcp-connect:192.168.122.3:33333 结果如下: 
Comments (
2
)
Sign in
to comment
Status
Done
新建
已接纳
已挂起
In Design
In Development
Done
Accepted
Declined
Assignees
Not set
zhengzengkai
zhengzengkai
Assignee
Collaborator
+Assign
+Mention
Labels
Not set
Projects
Unprojected
Unprojected
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (
-
)
Tags (
-
)
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
Duration
(hours)
参与者(3)
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register