HyperPlatform
HyperPlatform copied to clipboard
Enhancement: Support for VMCS Shadowing
This would allow using hyperplatform while still enjoying the use of Virtual Box, VMWare, or other virtualization software (note that supporting Hyper-V would not be possible, as it enables the hypervisor at boot).
Thanks for this proposal. Running with other hypervisors would be good enhancement. In order to assess amount of work and priority, can you tell me a couple of things?
- Do you think I can test a fix on a VMware VM that also run VMware or VirtualBox? As I do not have facility to debug a real device, it would be great if I can reproduce the issue and test a fix on a virtual machine.
- Do you know of any references can be helpful for researching and implementing the enhancement? I was not quite familiar with VMCS shadowing and thought it was only for implementing nested-VM. If you could tell me anything could be helpful for understanding the idea (ie, other project's source code, presentation slides etc), that would help me estimate amount of work and speed up development.
VMCS-shadowing allows hardware-accelerated support for vmread, vmwrite instructions, where VMCS fields can be stored in VMX-specific format, keeping VMM robust. It allows certain fields of VMCS reading/writing won't be intercepted by VMM, which means vmread and vmwrite instructions won't be VM-Exit of obligation. Since shadow-VMCS can be both read/written by VM and VMM, it becomes simple when it comes to analyze VMCS. To virtualize VM-Entry, vmlaunch and vmresume will be intercepted. Replace guest rip with guest rip in shadow-VMCS and execute vmresume. Perform source check is requried (e.g. guest has executed vmxon successfully, loaded VMCS successfully etc.) Note that msr-loading should be performed on emulated VM-Entry. To virtualize VM-Exit, replace guest rip with host rip in shadow-VMCS and execute vmresume. Note that msr-loading and msr-storing should be performed on emulated VM-Exit. Emulate a VMX-Abort if certain condition is met. For Intel EPT emulation, merge the page table.