diff mbox

[v2] KVM: x86: Check INVPCID feature bit in EBX of leaf 7

Message ID 1B4B44D9196EFF41AE41FDA404FC0A101937B1@SHSMSX101.ccr.corp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ren, Yongjie Sept. 7, 2012, 7:36 a.m. UTC
Checks and operations on the INVPCID feature bit should use EBX of CPUID leaf 7 instead of ECX.

Changes from v1:
	- fixed patch format issue.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Yongjie Ren <yongjien.ren@intel.com>
---
 arch/x86/kvm/vmx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Avi Kivity Sept. 9, 2012, 2:34 p.m. UTC | #1
On 09/07/2012 10:36 AM, Ren, Yongjie wrote:
> Checks and operations on the INVPCID feature bit should use EBX of CPUID leaf 7 instead of ECX.
> 
> Changes from v1:
> 	- fixed patch format issue.
> 

Thanks, applied to master for 3.6.
diff mbox

Patch

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 248c2b4..40eacea 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -6552,7 +6552,7 @@  static void vmx_cpuid_update(struct kvm_vcpu *vcpu)
 	/* Exposing INVPCID only when PCID is exposed */
 	best = kvm_find_cpuid_entry(vcpu, 0x7, 0);
 	if (vmx_invpcid_supported() &&
-	    best && (best->ecx & bit(X86_FEATURE_INVPCID)) &&
+	    best && (best->ebx & bit(X86_FEATURE_INVPCID)) &&
 	    guest_cpuid_has_pcid(vcpu)) {
 		exec_control |= SECONDARY_EXEC_ENABLE_INVPCID;
 		vmcs_write32(SECONDARY_VM_EXEC_CONTROL,
@@ -6562,7 +6562,7 @@  static void vmx_cpuid_update(struct kvm_vcpu *vcpu)
 		vmcs_write32(SECONDARY_VM_EXEC_CONTROL,
 			     exec_control);
 		if (best)
-			best->ecx &= ~bit(X86_FEATURE_INVPCID);
+			best->ebx &= ~bit(X86_FEATURE_INVPCID);
 	}
 }