When running with KVM, people expect to get the best possible performance
inside the VM. To really get this, the guest needs to know about the CPU
features it can use.

We have a CPU type that exports exactly this information to the guest, but
hasn't been used much, as it wasn't the default. Set it as default for the
PC machine now, so people get good performance without changing options.

Signed-off-by: Alexander Graf <ag...@suse.de>
---
 hw/pc.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index a3e8539..475d20e 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -41,6 +41,7 @@
 #include "sysemu.h"
 #include "blockdev.h"
 #include "ui/qemu-spice.h"
+#include "kvm.h"
 
 /* output Bochs bios info messages */
 //#define DEBUG_BIOS
@@ -945,11 +946,15 @@ void pc_cpus_init(const char *cpu_model)
 
     /* init CPUs */
     if (cpu_model == NULL) {
+        if (kvm_enabled()) {
+            cpu_model = "host";
+        } else {
 #ifdef TARGET_X86_64
-        cpu_model = "qemu64";
+            cpu_model = "qemu64";
 #else
-        cpu_model = "qemu32";
+            cpu_model = "qemu32";
 #endif
+        }
     }
 
     for(i = 0; i < smp_cpus; i++) {
-- 
1.7.3.4


Reply via email to