qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] target-i386: do not force-expose WAITPKG if -overcommit cpu-pm=o


From: Paolo Bonzini
Subject: [PATCH] target-i386: do not force-expose WAITPKG if -overcommit cpu-pm=on
Date: Thu, 21 May 2020 10:42:29 +0200

By force-enabling the WAITPKG bit whenever -overcommit cpu-pm=on is used,
commit 67192a298f ("x86/cpu: Add support for UMONITOR/UMWAIT/TPAUSE",
2019-10-23) broke that option is the host processor does not have
WAITPKG or the host kernel is too old.  This is because TPAUSE, UMWAIT
and UMONITOR are not NOPs on older processors (though perhaps they should
have been!).

Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>
---
 target/i386/kvm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 6513584948..6554fdef3c 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -408,9 +408,7 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t 
function,
             ret &= ~(CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_HLE);
         }
     } else if (function == 7 && index == 0 && reg == R_ECX) {
-        if (enable_cpu_pm) {
-            ret |= CPUID_7_0_ECX_WAITPKG;
-        } else {
+        if (!enable_cpu_pm) {
             ret &= ~CPUID_7_0_ECX_WAITPKG;
         }
     } else if (function == 7 && index == 0 && reg == R_EDX) {
-- 
2.25.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]