All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target-i386: do not force-expose WAITPKG if -overcommit cpu-pm=on
@ 2020-05-21  8:42 Paolo Bonzini
  0 siblings, 0 replies; only message in thread
From: Paolo Bonzini @ 2020-05-21  8:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: ehabkost, qemu-stable

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: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-21  8:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21  8:42 [PATCH] target-i386: do not force-expose WAITPKG if -overcommit cpu-pm=on Paolo Bonzini

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.