All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: Check INVPCID feature bit in EBX of leaf 7
@ 2012-09-01  8:12 Mao, Junjie
  2012-09-04 11:58 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Mao, Junjie @ 2012-09-01  8:12 UTC (permalink / raw)
  To: Avi Kivity, 'kvm@vger.kernel.org'

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);
        }
 }

--
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: x86: Check INVPCID feature bit in EBX of leaf 7
  2012-09-01  8:12 [PATCH] KVM: x86: Check INVPCID feature bit in EBX of leaf 7 Mao, Junjie
@ 2012-09-04 11:58 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2012-09-04 11:58 UTC (permalink / raw)
  To: Mao, Junjie; +Cc: 'kvm@vger.kernel.org'

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.



-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-04 11:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-01  8:12 [PATCH] KVM: x86: Check INVPCID feature bit in EBX of leaf 7 Mao, Junjie
2012-09-04 11:58 ` Avi Kivity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.