* [Qemu-devel] [PATCH 0/3] pc: enable -cpu host as default
@ 2011-06-14 15:29 Alexander Graf
2011-06-14 15:29 ` [Qemu-devel] [PATCH 1/3] pc: add compat machine types for 0.14 and 0.15 Alexander Graf
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Alexander Graf @ 2011-06-14 15:29 UTC (permalink / raw)
To: qemu-devel@nongnu.org Developers; +Cc: Anthony Liguori
As discussed during the community call, -cpu qemu64 breaks for a bunch
of workloads, most prominently recent gcc versions thanks to libgmp.
To work around this and to also give the user the best possible performance
when running with default command line options, let's use -cpu host as
default when running with KVM enabled!
Alexander Graf (3):
pc: add compat machine types for 0.14 and 0.15
pc: use old default cpu type for 0.14 and 0.15 compat machines
pc: use -cpu host as default for kvm
hw/pc.c | 9 +++++++--
hw/pc_piix.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 54 insertions(+), 3 deletions(-)
--
1.7.3.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 1/3] pc: add compat machine types for 0.14 and 0.15
2011-06-14 15:29 [Qemu-devel] [PATCH 0/3] pc: enable -cpu host as default Alexander Graf
@ 2011-06-14 15:29 ` Alexander Graf
2011-06-14 15:29 ` [Qemu-devel] [PATCH 2/3] pc: use old default cpu type for 0.14 and 0.15 compat machines Alexander Graf
2011-06-14 15:29 ` [Qemu-devel] [PATCH 3/3] pc: use -cpu host as default for kvm Alexander Graf
2 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2011-06-14 15:29 UTC (permalink / raw)
To: qemu-devel@nongnu.org Developers; +Cc: Anthony Liguori
We change virtual hardware from time to time, so in order to ensure that
the guest doesn't get confused, we have compatibility machines for the PC
machine.
This patch adds compatibility definitions for 0.14 and 0.15 versions.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
hw/pc_piix.c | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 9a22a8a..3b3ef84 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -213,6 +213,18 @@ static void pc_init_pci(ram_addr_t ram_size,
initrd_filename, cpu_model, 1, 1);
}
+static void pc_init_pci_014(ram_addr_t ram_size,
+ const char *boot_device,
+ const char *kernel_filename,
+ const char *kernel_cmdline,
+ const char *initrd_filename,
+ const char *cpu_model)
+{
+ pc_init1(ram_size, boot_device,
+ kernel_filename, kernel_cmdline,
+ initrd_filename, cpu_model, 1, 1);
+}
+
static void pc_init_pci_no_kvmclock(ram_addr_t ram_size,
const char *boot_device,
const char *kernel_filename,
@@ -258,7 +270,7 @@ static void pc_xen_hvm_init(ram_addr_t ram_size,
#endif
static QEMUMachine pc_machine = {
- .name = "pc-0.14",
+ .name = "pc-0.16",
.alias = "pc",
.desc = "Standard PC",
.init = pc_init_pci,
@@ -266,6 +278,22 @@ static QEMUMachine pc_machine = {
.is_default = 1,
};
+static QEMUMachine pc_machine_v0_15 = {
+ .name = "pc-0.15",
+ .desc = "Standard PC",
+ .init = pc_init_pci_014,
+ .max_cpus = 255,
+ .is_default = 1,
+};
+
+static QEMUMachine pc_machine_v0_14 = {
+ .name = "pc-0.14",
+ .desc = "Standard PC",
+ .init = pc_init_pci_014,
+ .max_cpus = 255,
+ .is_default = 1,
+};
+
static QEMUMachine pc_machine_v0_13 = {
.name = "pc-0.13",
.desc = "Standard PC",
@@ -434,6 +462,8 @@ static QEMUMachine xenfv_machine = {
static void pc_machine_init(void)
{
qemu_register_machine(&pc_machine);
+ qemu_register_machine(&pc_machine_v0_15);
+ qemu_register_machine(&pc_machine_v0_14);
qemu_register_machine(&pc_machine_v0_13);
qemu_register_machine(&pc_machine_v0_12);
qemu_register_machine(&pc_machine_v0_11);
--
1.7.3.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 2/3] pc: use old default cpu type for 0.14 and 0.15 compat machines
2011-06-14 15:29 [Qemu-devel] [PATCH 0/3] pc: enable -cpu host as default Alexander Graf
2011-06-14 15:29 ` [Qemu-devel] [PATCH 1/3] pc: add compat machine types for 0.14 and 0.15 Alexander Graf
@ 2011-06-14 15:29 ` Alexander Graf
2011-06-14 15:29 ` [Qemu-devel] [PATCH 3/3] pc: use -cpu host as default for kvm Alexander Graf
2 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2011-06-14 15:29 UTC (permalink / raw)
To: qemu-devel@nongnu.org Developers; +Cc: Anthony Liguori
When running with the 0.14 or 0.15 machine types, use the old mechanism
of determining the default CPU to choose, so that the guest sees the same
default CPU when running qemu in compat mode.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
hw/pc_piix.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 3b3ef84..84d5650 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -220,6 +220,14 @@ static void pc_init_pci_014(ram_addr_t ram_size,
const char *initrd_filename,
const char *cpu_model)
{
+ if (cpu_model == NULL) {
+#ifdef TARGET_X86_64
+ cpu_model = "qemu64";
+#else
+ cpu_model = "qemu32";
+#endif
+ }
+
pc_init1(ram_size, boot_device,
kernel_filename, kernel_cmdline,
initrd_filename, cpu_model, 1, 1);
@@ -232,6 +240,14 @@ static void pc_init_pci_no_kvmclock(ram_addr_t ram_size,
const char *initrd_filename,
const char *cpu_model)
{
+ if (cpu_model == NULL) {
+#ifdef TARGET_X86_64
+ cpu_model = "qemu64";
+#else
+ cpu_model = "qemu32";
+#endif
+ }
+
pc_init1(ram_size, boot_device,
kernel_filename, kernel_cmdline,
initrd_filename, cpu_model, 1, 0);
--
1.7.3.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 3/3] pc: use -cpu host as default for kvm
2011-06-14 15:29 [Qemu-devel] [PATCH 0/3] pc: enable -cpu host as default Alexander Graf
2011-06-14 15:29 ` [Qemu-devel] [PATCH 1/3] pc: add compat machine types for 0.14 and 0.15 Alexander Graf
2011-06-14 15:29 ` [Qemu-devel] [PATCH 2/3] pc: use old default cpu type for 0.14 and 0.15 compat machines Alexander Graf
@ 2011-06-14 15:29 ` Alexander Graf
2 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2011-06-14 15:29 UTC (permalink / raw)
To: qemu-devel@nongnu.org Developers; +Cc: Anthony Liguori
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 <agraf@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
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-06-14 15:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-14 15:29 [Qemu-devel] [PATCH 0/3] pc: enable -cpu host as default Alexander Graf
2011-06-14 15:29 ` [Qemu-devel] [PATCH 1/3] pc: add compat machine types for 0.14 and 0.15 Alexander Graf
2011-06-14 15:29 ` [Qemu-devel] [PATCH 2/3] pc: use old default cpu type for 0.14 and 0.15 compat machines Alexander Graf
2011-06-14 15:29 ` [Qemu-devel] [PATCH 3/3] pc: use -cpu host as default for kvm Alexander Graf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).