diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-16 18:24:22 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-16 18:24:22 -0800 |
commit | acf1cf6a1c0966ef64a73083ca985605a12b032d (patch) | |
tree | 710902446708686aa67ea9888b366258512c92b3 /arch/x86/kvm/vmx.c | |
parent | 295c799ae45b3678d9b8d3e845635ed07ce3b66a (diff) | |
parent | f4a75d2eb7b1e2206094b901be09adb31ba63681 (diff) | |
download | linux-acf1cf6a1c0966ef64a73083ca985605a12b032d.tar.gz linux-acf1cf6a1c0966ef64a73083ca985605a12b032d.tar.bz2 linux-acf1cf6a1c0966ef64a73083ca985605a12b032d.zip |
Merge 3.7-rc6 into staging-next
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index ad6b1dd06f8b..f85815945fc6 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -6549,19 +6549,22 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu) } } - exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL); /* Exposing INVPCID only when PCID is exposed */ best = kvm_find_cpuid_entry(vcpu, 0x7, 0); if (vmx_invpcid_supported() && best && (best->ebx & bit(X86_FEATURE_INVPCID)) && guest_cpuid_has_pcid(vcpu)) { + exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL); exec_control |= SECONDARY_EXEC_ENABLE_INVPCID; vmcs_write32(SECONDARY_VM_EXEC_CONTROL, exec_control); } else { - exec_control &= ~SECONDARY_EXEC_ENABLE_INVPCID; - vmcs_write32(SECONDARY_VM_EXEC_CONTROL, - exec_control); + if (cpu_has_secondary_exec_ctrls()) { + exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL); + exec_control &= ~SECONDARY_EXEC_ENABLE_INVPCID; + vmcs_write32(SECONDARY_VM_EXEC_CONTROL, + exec_control); + } if (best) best->ebx &= ~bit(X86_FEATURE_INVPCID); } |