Skip to contentSkip to conversation

VMX disabled by Feature Control MSR

DISCUSSION Guillaume Thouvenin 2 participants 3 messages Jun 14, 2006

lore
Share & tools
lore
#0 lore raw

Hello,

I already posted a message about this problem on this mailing list but
I went more deeply in the analysis of the problem and I'd like to have your opinion.

The problem is: I have a processor (pentium D) that supports the VT
technology but when I boot Xen I have the following message:

(XEN) VMX disabled by Feature Control MSR.

Here is how I understand that. Xen is using the CPUID instruction to
identify the processor functionality. This is done in arch/x86/hvm/vmx/vmx.c:start_vmx(). As VMXON is controlled by the IA32_FEATURE_CONTROL we must test the lock bit (bit0) and the bit2. I found in the intel documentation that if the bit2 is clear, VMXON causes a general-protection exeption. In our case, we stop the start_vmx() function and display the message VMX disabled by feature control MSR.

Thus my question is: What to do to set the bit 2 of the
IA32_FEATURE_CONTROL to 1? Is it only possible by using the option in the BIOS menu (and it's not present in mine) or is it possible to set it to 1 before switching in protected mode when Xen is booting. For exemple somwhere in arch/x86/boot/x86_64.S?

Thanks for your help,

Guillaume

#1 lore raw
Quoted 5 lines · On Wed, 14 Jun 2006 13:45:49 +0200 Guillaume Thouvenin…

Thus my question is: What to do to set the bit 2 of the
IA32_FEATURE_CONTROL to 1? Is it only possible by using the option in the BIOS menu (and it's not present in mine) or is it possible to set it to 1 before switching in protected mode when Xen is booting. For exemple somwhere in arch/x86/boot/x86_64.S?

In fact the problem is how to set the lock bit to 0. In the following code found in arch/x86/hvm/vmx/vmx.c :

start_vmx() {
...

   if (eax & IA32_FEATURE_CONTROL_MSR_LOCK) {
        if ((eax & IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON) == 0x0) {
            printk("VMX disabled by Feature Control MSR.\n");
            return 0;
        }
    }
    else {
        wrmsr(IA32_FEATURE_CONTROL_MSR,
              IA32_FEATURE_CONTROL_MSR_LOCK |
              IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON, 0);
    }

...

If the "VMX disabled..." message is displayed, it means that the lock bit is set to 1. Otherwise we set bit2 to 1. If I try to clear it while it is set it causes a general-protection fault. Is it possible to modify before Xen switches from real mode to protected mode?

I will try to modify the arch/x86/boot/x86_64.S

Regards,
Guillaume

#2 lore raw
Quoted 6 lines · Guillaume Thouvenin

If the "VMX disabled..." message is displayed, it means that the lock bit is set to 1. Otherwise we set bit2 to 1. If I try to clear it while it is set it causes a general-protection fault. Is it possible to modify before Xen switches from real mode to protected mode?

I will try to modify the arch/x86/boot/x86_64.S

No, it's called a lock bit because it is sticky once set. The intention is presumably to allow OEMs an easy way (in their BIOS) to disable VMX on their systems if they don't want to have to support it.

-- Keir