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

DragonOS虚拟化 #389

Merged
merged 44 commits into from
Oct 24, 2023
Merged

DragonOS虚拟化 #389

merged 44 commits into from
Oct 24, 2023

Conversation

ZXXYy
Copy link
Contributor

@ZXXYy ZXXYy commented Sep 22, 2023

通过ioctl创建虚拟机,运行虚拟机,目前实现CPU虚拟化、内存虚拟化以及用户态程序调用。

  1. CPU虚拟化
  • 新增kvm,vm, vcpu三个设备文件,并提供ioctl系统调用接口
  • 新增hypervisor struct,vcpu trait,在内核态为CPU虚拟化提供支持,包括hypervisor的创建,vcpu的创建,vcpu的初始化等。
  • 新增x86架构下的vmcs数据结构封装,并完成vmcs初始化代码
  • 新增vmexit_handler,处理vmexit,并在内核态跑通整个CPU虚拟化的流程。
    主要效果可以在虚拟机中打印出字符串,输出到终端;再通过cpuid指令触发vmexit,回到hypervisor的代码;最后通过vmexit_handler处理cpuid指令,再vmresume返回到虚拟机中。
  1. 内存虚拟化
  • 新建KvmUserspaceMemoryRegion,KvmMemorySlot,KvmMmu等结构,为内存虚拟化提供支持。
  • EPT页表构建,完成GPA-HVA-HPA的转换
  • !目前内存虚拟化还存在bug
  1. 用户态程序
  • 新增用户态程序,完善用户态中的ioctl代码,测试CPU虚拟化。

@fslongjin fslongjin merged commit 40314b3 into DragonOS-Community:master Oct 24, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants