• Vineeth Pillai's avatar
    hyperv: Detect Nested virtualization support for SVM · a6c776a9
    Vineeth Pillai authored
    Previously, to detect nested virtualization enlightenment support,
    we were using HV_X64_ENLIGHTENED_VMCS_RECOMMENDED feature bit of
    HYPERV_CPUID_ENLIGHTMENT_INFO.EAX CPUID as docuemented in TLFS:
     "Bit 14: Recommend a nested hypervisor using the enlightened VMCS
      interface. Also indicates that additional nested enlightenments
      may be available (see leaf 0x4000000A)".
    
    Enlightened VMCS, however, is an Intel only feature so the above
    detection method doesn't work for AMD. So, use the
    HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS.EAX CPUID information ("The
    maximum input value for hypervisor CPUID information.") and this
    works for both AMD and Intel.
    Signed-off-by: default avatarVineeth Pillai <viremana@linux.microsoft.com>
    Reviewed-by: default avatarMichael Kelley <mikelley@microsoft.com>
    Message-Id: <43b25ff21cd2d9a51582033c9bdd895afefac056.1622730232.git.viremana@linux.microsoft.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    a6c776a9
mshyperv.c 12.6 KB