From patchwork Wed Jul 28 10:05:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jes Sorensen X-Patchwork-Id: 60130 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 35DD5B6F04 for ; Wed, 28 Jul 2010 20:09:52 +1000 (EST) Received: from localhost ([127.0.0.1]:56496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oe3a9-000881-BC for incoming@patchwork.ozlabs.org; Wed, 28 Jul 2010 06:09:49 -0400 Received: from [140.186.70.92] (port=44476 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oe3WG-00072k-NB for qemu-devel@nongnu.org; Wed, 28 Jul 2010 06:05:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oe3W3-00076F-5n for qemu-devel@nongnu.org; Wed, 28 Jul 2010 06:05:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60918) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oe3W2-00075n-VD for qemu-devel@nongnu.org; Wed, 28 Jul 2010 06:05:35 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6SA5VpS023576 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 Jul 2010 06:05:32 -0400 Received: from localhost.localdomain ([10.3.121.7]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6SA5UPk013550; Wed, 28 Jul 2010 06:05:30 -0400 From: Jes.Sorensen@redhat.com To: qemu-devel@nongnu.org Date: Wed, 28 Jul 2010 12:05:27 +0200 Message-Id: <1280311527-2650-1-git-send-email-Jes.Sorensen@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH] Use kvm32/kvm64 as default CPUs when running under KVM. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jes Sorensen KVM has a minimum CPU requirement in order to run, so there is no reason to default to the very basic family 6, model 2 (or model 3 for qemu32) CPU since the additional features are going to be available on the host CPU. Signed-off-by: Jes Sorensen --- hw/pc.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 58dea57..b17a199 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -39,6 +39,7 @@ #include "msix.h" #include "sysbus.h" #include "sysemu.h" +#include "kvm.h" /* output Bochs bios info messages */ //#define DEBUG_BIOS @@ -866,11 +867,19 @@ void pc_cpus_init(const char *cpu_model) /* init CPUs */ if (cpu_model == NULL) { + if (kvm_enabled()) { #ifdef TARGET_X86_64 - cpu_model = "qemu64"; + cpu_model = "kvm64"; #else - cpu_model = "qemu32"; + cpu_model = "kvm32"; #endif + } else { +#ifdef TARGET_X86_64 + cpu_model = "qemu64"; +#else + cpu_model = "qemu32"; +#endif + } } for(i = 0; i < smp_cpus; i++) {