提交 c58f010b 编写于 作者: V Vitaly Kuznetsov 提交者: Greg Kroah-Hartman

x86/kvm/nVMX: read from MSR_IA32_VMX_PROCBASED_CTLS2 only when it is available

commit 6b1971c694975e49af302229202c0043568b1791 upstream.

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.
Reported-by: NZdenek Kaspar <zkaspar82@gmail.com>
Tested-by: NZdenek Kaspar <zkaspar82@gmail.com>
Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: NJim Mattson <jmattson@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2ab14838
...@@ -3601,9 +3601,11 @@ static void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, bool apicv) ...@@ -3601,9 +3601,11 @@ static void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, bool apicv)
* secondary cpu-based controls. Do not include those that * secondary cpu-based controls. Do not include those that
* depend on CPUID bits, they are added later by vmx_cpuid_update. * depend on CPUID bits, they are added later by vmx_cpuid_update.
*/ */
rdmsr(MSR_IA32_VMX_PROCBASED_CTLS2, if (msrs->procbased_ctls_high & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS)
msrs->secondary_ctls_low, rdmsr(MSR_IA32_VMX_PROCBASED_CTLS2,
msrs->secondary_ctls_high); msrs->secondary_ctls_low,
msrs->secondary_ctls_high);
msrs->secondary_ctls_low = 0; msrs->secondary_ctls_low = 0;
msrs->secondary_ctls_high &= msrs->secondary_ctls_high &=
SECONDARY_EXEC_DESC | SECONDARY_EXEC_DESC |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册