lkml.org 
[lkml]   [2021]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] KVM: x86: Remove the best->function == 0x7 assignment
Date
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
\
 
 \ /
  Last update: 2021-02-24 03:32    [W:0.039 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site