x86/kvm/nVMX: read from MSR_IA32_VMX_PROCBASED_CTLS2 only when it is available
PATCH 1/1 x86/kvm/nVMX: read from MSR_IA32_VMX_PROCBASED_CTLS2 only when it is available
SDM says MSR_IA32_VMX_PROCBASED_CTLS2 is only available "If (CPUID.01H:ECX.[5] && IA32_VMX_PROCBASED_CTLS[63])". It was found that some old cpus (namely "Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz (family: 0x6,
model: 0xf, stepping: 0x6") don't have it. Add the missing check.
--- arch/x86/kvm/vmx/nested.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
arch/x86/kvm/vmx/nested.c +5 -3
@@ -5557,9 +5557,11 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps,* secondary cpu-based controls. Do not include those that * depend on CPUID bits, they are added later by vmx_cpuid_update. */ -rdmsr (MSR_IA32_VMX_PROCBASED_CTLS2 , - msrs->secondary_ctls_low, - msrs->secondary_ctls_high); +if (msrs->procbased_ctls_high &CPU_BASED_ACTIVATE_SECONDARY_CONTROLS ) +rdmsr (MSR_IA32_VMX_PROCBASED_CTLS2 , + msrs->secondary_ctls_low, + msrs->secondary_ctls_high); + msrs->secondary_ctls_low =0 ; msrs->secondary_ctls_high &= SECONDARY_EXEC_DESC |
Signature · 1 line
2.20.1
Quoted 9 lines · Vitaly Kuznetsov
SDM says
MSR_IA32_VMX_PROCBASED_CTLS2is only available "If (CPUID.01H:ECX.[5] && IA32_VMX_PROCBASED_CTLS[63])". It was found that some old cpus (namely "Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz (family:0x6,
model:0xf, stepping:0x6") don't have it. Add the missing check.Reported-by Zdenek Kaspar <[email protected]>Tested-by Zdenek Kaspar <[email protected]>Signed-off-by Vitaly Kuznetsov <[email protected]>
Quoted 10 lines · Jim Mattson
Quoted 8 lines
SDM says
MSR_IA32_VMX_PROCBASED_CTLS2is only available "If (CPUID.01H:ECX.[5] && IA32_VMX_PROCBASED_CTLS[63])". It was found that some old cpus (namely "Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz (family:0x6,
model:0xf, stepping:0x6") don't have it. Add the missing check.Reported-by Zdenek Kaspar <[email protected]>Tested-by Zdenek Kaspar <[email protected]>Signed-off-by Vitaly Kuznetsov <[email protected]>Reviewed-by Jim Mattson <[email protected]>
Queued, thanks.
Paolo
Quoted 11 lines · Paolo Bonzini
Quoted 9 lines · Jim Mattson
Quoted 8 lines
SDM says
MSR_IA32_VMX_PROCBASED_CTLS2is only available "If (CPUID.01H:ECX.[5] && IA32_VMX_PROCBASED_CTLS[63])". It was found that some old cpus (namely "Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz (family:0x6,
model:0xf, stepping:0x6") don't have it. Add the missing check.Reported-by Zdenek Kaspar <[email protected]>Tested-by Zdenek Kaspar <[email protected]>Signed-off-by Vitaly Kuznetsov <[email protected]>
Quoted 5 lines
Quoted 1 line
Reviewed-by Jim Mattson <[email protected]>Queued, thanks.
Paolo
Alternatively, rdmsr could be changed to rdmsr_safe.