KVM: x86: simplify kvm_mwait_in_guest()

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/431f5d4443964bcc58ac2e4c6fd8ace6dcd3a8d1
Commit:     431f5d4443964bcc58ac2e4c6fd8ace6dcd3a8d1
Parent:     346f48fa311ceee7478b5b810ba050a4a22e0b2e
Refname:    refs/heads/master
Author:     Radim Krčmář <[email protected]>
AuthorDate: Wed Nov 29 22:23:43 2017 +0100
Committer:  Paolo Bonzini <[email protected]>
CommitDate: Thu Dec 14 09:26:43 2017 +0100

    KVM: x86: simplify kvm_mwait_in_guest()
    
    If Intel/AMD implements MWAIT, we expect that it works well and only
    reject known bugs;  no reason to do it the other way around for minor
    vendors.  (Not that they are relevant ATM.)
    
    This allows further simplification of kvm_mwait_in_guest().
    And use boot_cpu_has() instead of "cpu_has(&boot_cpu_data," while at it.
    
    Reviewed-by: Alexander Graf <[email protected]>
    Acked-by: Borislav Petkov <[email protected]>
    Acked-by: Michael S. Tsirkin <[email protected]>
    Signed-off-by: Radim Krčmář <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
---
 arch/x86/kvm/x86.h | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h
index d15859ec5e92..c69f973111cb 100644
--- a/arch/x86/kvm/x86.h
+++ b/arch/x86/kvm/x86.h
@@ -265,18 +265,8 @@ static inline u64 nsec_to_cycles(struct kvm_vcpu *vcpu, u64 nsec)
 
 static inline bool kvm_mwait_in_guest(void)
 {
-	if (!cpu_has(&boot_cpu_data, X86_FEATURE_MWAIT))
-		return false;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.