* [PATCH] KVM: x86: Remove the best->function == 0x7 assignment
@ 2021-02-24 2:29 Yejune Deng
2021-02-24 18:04 ` Sean Christopherson
0 siblings, 1 reply; 2+ messages in thread
From: Yejune Deng @ 2021-02-24 2:29 UTC (permalink / raw)
To: pbonzini, seanjc, vkuznets, wanpengli, jmattson, joro, tglx,
mingo, bp, x86, hpa
Cc: kvm, linux-kernel, yejune.deng
In kvm_update_cpuid_runtime(), there is no need the best->function
== 0x7 assignment, because there is e->function == function in
cpuid_entry2_find().
Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
---
arch/x86/kvm/cpuid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index c8f2592ccc99..eb7a01b1907b 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -120,7 +120,7 @@ void kvm_update_cpuid_runtime(struct kvm_vcpu *vcpu)
}
best = kvm_find_cpuid_entry(vcpu, 7, 0);
- if (best && boot_cpu_has(X86_FEATURE_PKU) && best->function == 0x7)
+ if (best && boot_cpu_has(X86_FEATURE_PKU))
cpuid_entry_change(best, X86_FEATURE_OSPKE,
kvm_read_cr4_bits(vcpu, X86_CR4_PKE));
--
2.29.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: x86: Remove the best->function == 0x7 assignment
2021-02-24 2:29 [PATCH] KVM: x86: Remove the best->function == 0x7 assignment Yejune Deng
@ 2021-02-24 18:04 ` Sean Christopherson
0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2021-02-24 18:04 UTC (permalink / raw)
To: Yejune Deng
Cc: pbonzini, vkuznets, wanpengli, jmattson, joro, tglx, mingo, bp,
x86, hpa, kvm, linux-kernel
Hmm, the shortlog should provide a higher level overview of the change. Stating
the literal code change doesn't provide much context. Maybe:
KVM: x86: Remove an unnecessary best->function check
On Wed, Feb 24, 2021, Yejune Deng wrote:
> In kvm_update_cpuid_runtime(), there is no need the best->function
> == 0x7 assignment, because there is e->function == function in
s/assignment/check, here and in the shortlog.
> cpuid_entry2_find().
>
> Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
With the shortlog and changelog cleaned up:
Reviewed-by: Sean Christopherson <seanjc@google.com>
> ---
> arch/x86/kvm/cpuid.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index c8f2592ccc99..eb7a01b1907b 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -120,7 +120,7 @@ void kvm_update_cpuid_runtime(struct kvm_vcpu *vcpu)
> }
>
> best = kvm_find_cpuid_entry(vcpu, 7, 0);
> - if (best && boot_cpu_has(X86_FEATURE_PKU) && best->function == 0x7)
> + if (best && boot_cpu_has(X86_FEATURE_PKU))
> cpuid_entry_change(best, X86_FEATURE_OSPKE,
> kvm_read_cr4_bits(vcpu, X86_CR4_PKE));
>
> --
> 2.29.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-24 18:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24 2:29 [PATCH] KVM: x86: Remove the best->function == 0x7 assignment Yejune Deng
2021-02-24 18:04 ` Sean Christopherson
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.