diff mbox

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

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

Commit Message

Junjie Mao Sept. 1, 2012, 8:12 a.m. UTC
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>
---
 arch/x86/kvm/vmx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Avi Kivity Sept. 4, 2012, 11:58 a.m. UTC | #1
On 09/01/2012 11:12 AM, Mao, Junjie wrote:
> 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>
> ---
>  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 c00f03d..002b4a5 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)
>         /* 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,
> @@ -6585,7 +6585,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);
>         }
>  }
> 

Patch is whitespace damaged, please fix.
diff mbox

Patch

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index c00f03d..002b4a5 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)
        /* 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,
@@ -6585,7 +6585,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);
        }
 }