]> git.proxmox.com Git - mirror_qemu.git/blobdiff - target/i386/kvm.c
i386/cpu: make -cpu host support monitor/mwait
[mirror_qemu.git] / target / i386 / kvm.c
index dc991f6aca322484aa1db01a4d0589392975527a..c5f72d645b6ce53a14c0fa2a3f83e9d3b36e01df 100644 (file)
@@ -366,6 +366,15 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
         if (!kvm_irqchip_in_kernel()) {
             ret &= ~CPUID_EXT_X2APIC;
         }
+
+        if (enable_cpu_pm) {
+            int disable_exits = kvm_check_extension(s,
+                                                    KVM_CAP_X86_DISABLE_EXITS);
+
+            if (disable_exits & KVM_X86_DISABLE_EXITS_MWAIT) {
+                ret |= CPUID_EXT_MONITOR;
+            }
+        }
     } else if (function == 6 && reg == R_EAX) {
         ret |= CPUID_6_EAX_ARAT; /* safe to allow because of emulated APIC */
     } else if (function == 7 && index == 0 && reg == R_EBX) {