Re: KVM & VMX root mode

Avi Kivity
2007-09-01T15:59:15Z

Sander van Leeuwen wrote:
> 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.

As far as I understand, kvm follows these rules. It enables vmx when
loaded and disables then when unloaded.

>
> 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).

Well, obviously kvm can't operate if you disable cr4.vmxe and/or switch
paging off. The two solutions are not run-time compatible. I don't see
why this is a problem as you should simply not run the product you
aren't using, and everything should just work.

>
> 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.

kvm isn't enabled by default. It requires explicit user action to enter
vmx mode ('modprobe kvm-intel').

--
Any sufficiently difficult bug is indistinguishable from a feature.