KVM: x86: Remove the best->function == 0x7 assignment
PATCH 1/1 KVM: x86: Remove the best->function == 0x7 assignment
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 <[email protected]>
--- arch/x86/kvm/cpuid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/cpuid.c +1 -1
@@ -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 ));
Signature · 1 line
2.29.0
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
Quoted 2 lines · Yejune Deng
In
kvm_update_cpuid_runtime(), there is no need thebest->function==0x7assignment, because there ise->function== function in
s/assignment/check, here and in the shortlog.
Quoted 3 lines
cpuid_entry2_find().Signed-off-by Yejune Deng <[email protected]>
With the shortlog and changelog cleaned up:
Reviewed-by Sean Christopherson <[email protected]>
Quoted 20 lines
--- arch/x86/kvm/cpuid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kvm/cpuid.c +1
-1@@ -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 ));Signature · 1 line
2.29.0