From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38007 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvYUc-0002WU-NI for qemu-devel@nongnu.org; Tue, 14 Sep 2010 12:36:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OvYJ9-0002Ke-21 for qemu-devel@nongnu.org; Tue, 14 Sep 2010 12:24:35 -0400 Received: from va3ehsobe006.messaging.microsoft.com ([216.32.180.16]:55189 helo=VA3EHSOBE006.bigfish.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvYJ8-0002KV-Vc for qemu-devel@nongnu.org; Tue, 14 Sep 2010 12:24:35 -0400 Date: Tue, 14 Sep 2010 18:21:36 +0200 From: "Roedel, Joerg" Message-ID: <20100914162135.GD17759@amd.com> References: <1284479530-4748-1-git-send-email-joerg.roedel@amd.com> <1284479530-4748-2-git-send-email-joerg.roedel@amd.com> <4C8F9B8B.9060205@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <4C8F9B8B.9060205@suse.de> Subject: [Qemu-devel] Re: [PATCH 1/3] Make kvm64 the default cpu model when kvm_enabled() List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Marcelo Tosatti , Avi Kivity , "kvm@vger.kernel.org" , "qemu-devel@nongnu.org" On Tue, Sep 14, 2010 at 11:58:03AM -0400, Alexander Graf wrote: > > + if (kvm_enabled()) > > + cpu_model = DEFAULT_KVM_CPU_MODEL; > > + else > > + cpu_model = DEFAULT_QEMU_CPU_MODEL; > > > > Braces :(. Okay, here is the new patch: >>From f49e78edbd4143d05128228d9cc24bd5abc3abf1 Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Tue, 14 Sep 2010 16:52:11 +0200 Subject: [PATCH 1/3] Make kvm64 the default cpu model when kvm_enabled() As requested by Alex this patch makes kvm64 the default CPU model when qemu is started with -enable-kvm. Signed-off-by: Joerg Roedel --- hw/pc.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 69b13bf..a6355f3 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,11 @@ 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++) { -- 1.7.0.4 -- AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo, Andrew Bowd Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632