diff options
author | Ren, Yongjie <yongjie.ren@intel.com> | 2012-09-07 03:36:59 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-09-09 10:34:01 -0400 |
commit | 4f97704555672f9ab48ca623561e96a9430bec9a (patch) | |
tree | 0dd625a70ee60f208bf4f68321fff6031ff2c0e0 /arch | |
parent | 749c59fd15b2c18dd6c15c353a899fb6ac49b865 (diff) |
KVM: x86: Check INVPCID feature bit in EBX of leaf 7
Checks and operations on the INVPCID feature bit should use EBX
of CPUID leaf 7 instead of ECX.
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Yongjie Ren <yongjien.ren@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/vmx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index c00f03de1b79..002b4a566e2d 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -6575,7 +6575,7 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu) | |||
6575 | /* Exposing INVPCID only when PCID is exposed */ | 6575 | /* Exposing INVPCID only when PCID is exposed */ |
6576 | best = kvm_find_cpuid_entry(vcpu, 0x7, 0); | 6576 | best = kvm_find_cpuid_entry(vcpu, 0x7, 0); |
6577 | if (vmx_invpcid_supported() && | 6577 | if (vmx_invpcid_supported() && |
6578 | best && (best->ecx & bit(X86_FEATURE_INVPCID)) && | 6578 | best && (best->ebx & bit(X86_FEATURE_INVPCID)) && |
6579 | guest_cpuid_has_pcid(vcpu)) { | 6579 | guest_cpuid_has_pcid(vcpu)) { |
6580 | exec_control |= SECONDARY_EXEC_ENABLE_INVPCID; | 6580 | exec_control |= SECONDARY_EXEC_ENABLE_INVPCID; |
6581 | vmcs_write32(SECONDARY_VM_EXEC_CONTROL, | 6581 | vmcs_write32(SECONDARY_VM_EXEC_CONTROL, |
@@ -6585,7 +6585,7 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu) | |||
6585 | vmcs_write32(SECONDARY_VM_EXEC_CONTROL, | 6585 | vmcs_write32(SECONDARY_VM_EXEC_CONTROL, |
6586 | exec_control); | 6586 | exec_control); |
6587 | if (best) | 6587 | if (best) |
6588 | best->ecx &= ~bit(X86_FEATURE_INVPCID); | 6588 | best->ebx &= ~bit(X86_FEATURE_INVPCID); |
6589 | } | 6589 | } |
6590 | } | 6590 | } |
6591 | 6591 | ||