Message ID | 1284479530-4748-2-git-send-email-joerg.roedel@amd.com |
---|---|
State | New |
Headers | show |
Joerg Roedel wrote: > As requested by Alex this patch makes kvm64 the default CPU > model when qemu is started with -enable-kvm. > > Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> > --- > hw/pc.c | 19 ++++++++++++++----- > 1 files changed, 14 insertions(+), 5 deletions(-) > > diff --git a/hw/pc.c b/hw/pc.c > index 69b13bf..f531d0d 100644 > --- a/hw/pc.c > +++ b/hw/pc.c > @@ -40,6 +40,16 @@ > #include "sysbus.h" > #include "sysemu.h" > #include "blockdev.h" > +#include "kvm.h" > + > + > +#ifdef TARGET_X86_64 > +#define DEFAULT_KVM_CPU_MODEL "kvm64" > +#define DEFAULT_QEMU_CPU_MODEL "qemu64" > +#else > +#define DEFAULT_KVM_CPU_MODEL "kvm32" > +#define DEFAULT_QEMU_CPU_MODEL "qemu32" > +#endif > > /* output Bochs bios info messages */ > //#define DEBUG_BIOS > @@ -867,11 +877,10 @@ void pc_cpus_init(const char *cpu_model) > > /* init CPUs */ > if (cpu_model == NULL) { > -#ifdef TARGET_X86_64 > - cpu_model = "qemu64"; > -#else > - cpu_model = "qemu32"; > -#endif > + if (kvm_enabled()) > + cpu_model = DEFAULT_KVM_CPU_MODEL; > + else > + cpu_model = DEFAULT_QEMU_CPU_MODEL; > Braces :(. Alex
On 09/14/2010 05:52 PM, Joerg Roedel wrote: > As requested by Alex this patch makes kvm64 the default CPU > model when qemu is started with -enable-kvm. > > This breaks compatiblity; if started with -M 0.13 or prior we should default to qemu64.
On Thu, Sep 16, 2010 at 10:03:19AM -0400, Avi Kivity wrote: > On 09/14/2010 05:52 PM, Joerg Roedel wrote: > > As requested by Alex this patch makes kvm64 the default CPU > > model when qemu is started with -enable-kvm. > > > > > > This breaks compatiblity; if started with -M 0.13 or prior we should > default to qemu64. Ok, I can change that. But its ok to make kvm64 the default for anything > 0.13? Joerg
On 09/16/2010 04:21 PM, Roedel, Joerg wrote: > On Thu, Sep 16, 2010 at 10:03:19AM -0400, Avi Kivity wrote: > > On 09/14/2010 05:52 PM, Joerg Roedel wrote: > > > As requested by Alex this patch makes kvm64 the default CPU > > > model when qemu is started with -enable-kvm. > > > > > > > > > > This breaks compatiblity; if started with -M 0.13 or prior we should > > default to qemu64. > > Ok, I can change that. But its ok to make kvm64 the default for > anything> 0.13? > Sure.
diff --git a/hw/pc.c b/hw/pc.c index 69b13bf..f531d0d 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -40,6 +40,16 @@ #include "sysbus.h" #include "sysemu.h" #include "blockdev.h" +#include "kvm.h" + + +#ifdef TARGET_X86_64 +#define DEFAULT_KVM_CPU_MODEL "kvm64" +#define DEFAULT_QEMU_CPU_MODEL "qemu64" +#else +#define DEFAULT_KVM_CPU_MODEL "kvm32" +#define DEFAULT_QEMU_CPU_MODEL "qemu32" +#endif /* output Bochs bios info messages */ //#define DEBUG_BIOS @@ -867,11 +877,10 @@ void pc_cpus_init(const char *cpu_model) /* init CPUs */ if (cpu_model == NULL) { -#ifdef TARGET_X86_64 - cpu_model = "qemu64"; -#else - cpu_model = "qemu32"; -#endif + if (kvm_enabled()) + cpu_model = DEFAULT_KVM_CPU_MODEL; + else + cpu_model = DEFAULT_QEMU_CPU_MODEL; } for(i = 0; i < smp_cpus; i++) {
As requested by Alex this patch makes kvm64 the default CPU model when qemu is started with -enable-kvm. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> --- hw/pc.c | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-)