Re: KVM & VMX root mode

Sander van Leeuwen
2007-09-01T15:09:54Z

Hi Avi,

Our non-vmx mode fails, because the cpu is in vmx root mode.

Two products that use vt-x for virtualization could perfectly co-exist
if both comply with the way Intel recommends people to use vt-x.
See figure 19.1 in chapter 19.4 of the 'Intel 64 and IA-32 Architectures
Software Developer's Manual'. VirtualBox is programmed to
follow these rules and therefor allows any other virtualizer to run
side-by-side.

Currently KVM prevents us from using our generic virtualization engine
and does not allow anybody else to use the vt-x extensions (without
explicitely leaving vmx root mode).

As your product is included in the mainline Linux kernel and enabled by
default, it would be nice if you could follow Intel's recommendations.

Thank you.

Avi Kivity wrote:
> Sander van Leeuwen wrote:
>> Hi,
>>
>> We have had several reports of users saying our product VirtualBox
>> crashes their (Linux) host. It turned out that KVM is responsible,
>> because
>> it leaves the CPU in VMX root mode.
>>
>> Doing this changes the way the cpu operates: updates to reserved bits
>> in control registers cause general protection faults.
>> We hit such cases on two occasions; clearing the X86_CR4_VMXE bit in
>> CR4 and turning off paging.
>>
>> I have added a workaround to detect VMX root mode, simply refuse to
>> run and recommend that the user disables KVM.
>> I would however appreciate if you could fix KVM instead.
>>
>>
>
> Simply '/sbin/rmmod kvm-intel' and kvm will exit vmx root mode.
>
> If VirtualBox uses vmx, then it can't be run side-by-side with kvm.

--
Kind regards / mit freundlichen Gruessen / Met vriendelijke groet
Sander van Leeuwen

innoTek GmbH
sandervl-2taLTamkYL2ELgA04lAiVw@public.gmane.org
http://www.innotek.de
Germany