Skip to contentSkip to conversation

New: Failure to install Hyper-V role on nested KVM guest

Bug 106621 [email protected] 1 participant 4 messages Oct 26, 2015 – Feb 14, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=106621

            Bug ID: 106621
           Summary: Failure to install Hyper-V role on nested KVM guest
           Product: Virtualization
           Version: unspecified
    Kernel Version: 4.3.0-rc7
          Hardware: x86-64
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: kvm
          Assignee: [email protected]
          Reporter: [email protected]
        Regression: No

When installing the Hyper-V role on a Windows guest (tried 2008 R2, 2012 R2 and 2016 TP3), the Windows installer refuses to install because of the error

"Hyper-V cannot be installed because virtualization support is not enabled in the BIOS."

This is because the MSR 0x3a is initialized to "0".

When VMX is activated on the guest CPU, the 0x3a register should return "5".

The following code patch (may be a bit of an overstatement) returns "5" if VMX is set on the guest CPU, thereby reporting to the guest that visualization is enabled in the BIOS.

arch/x86/kvm/vmx.c 2015-10-26 13:35:51.894700786 +0100 renamed from arch/x86/kvm/vmx.c 2015-10-25 02:39:47.000000000 +0100 +6 -1
@@ -2661,7 +2661,12 @@
     case MSR_IA32_FEATURE_CONTROL:
         if (!nested_vmx_allowed(vcpu))
             return 1;
-        msr_info->data = to_vmx(vcpu)->nested.msr_ia32_feature_control;
+        if (nested_vmx_allowed(vcpu)) {
+            //Set all 3 bits in 0x3a
+            msr_info->data = 5;
+        } else {
+            msr_info->data = to_vmx(vcpu)->nested.msr_ia32_feature_control;
+        }
         break;
     case MSR_IA32_VMX_BASIC ... MSR_IA32_VMX_VMFUNC:
         if (!nested_vmx_allowed(vcpu))

This, together with "-cpu host,-hypervisor,+vmx will allow Hyper-V to be installed. It will however not allow to start these Virtual Machines.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#1 lore raw

[Bug 106621] Failure to install Hyper-V role on nested KVM guest

https://bugzilla.kernel.org/show_bug.cgi?id=106621

Alexander E. Patrakov ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #1 from Alexander E. Patrakov ([email protected]) --- While trying to run an L2 VM in HyperV in KVM, I was able to get another potentially useful log message from Windows:

Hypervisor launch failed; Processor does not support the minimum features required to run the hypervisor (MSR index 0x48B, allowed bits 0x2600000000, required bits 0xFB00000000).

That's on linux-4.9.8.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#2 lore raw

[Bug 106621] Failure to install Hyper-V role on nested KVM guest

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=106621

--- Comment #2 from Alexander E. Patrakov ([email protected]) --- in a Linux L1 guest, with "-enable-kvm -cpu host,-hypervisor,+vmx,kvm=off", "rdmsr 0x48b" returns fb00000000, but that's still not good enough for HyperV.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#3 lore raw

[Bug 106621] Failure to install Hyper-V role on nested KVM guest

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=106621

Paolo Bonzini ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |CODE_FIX

--- Comment #3 from Paolo Bonzini ([email protected]) --- Will work in 4.10.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.