From patchwork Wed Jul 28 12:42:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jes Sorensen X-Patchwork-Id: 60136 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 50148B6EF7 for ; Wed, 28 Jul 2010 22:43:59 +1000 (EST) Received: from localhost ([127.0.0.1]:57067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oe5zI-0005pb-J4 for incoming@patchwork.ozlabs.org; Wed, 28 Jul 2010 08:43:56 -0400 Received: from [140.186.70.92] (port=49209 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oe5xy-0005nm-Rn for qemu-devel@nongnu.org; Wed, 28 Jul 2010 08:42:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oe5xx-0006zn-25 for qemu-devel@nongnu.org; Wed, 28 Jul 2010 08:42:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41913) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oe5xw-0006zf-Ra for qemu-devel@nongnu.org; Wed, 28 Jul 2010 08:42:33 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6SCgUxr003535 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 Jul 2010 08:42:31 -0400 Received: from localhost.localdomain ([10.3.121.7]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6SCgQTq015728; Wed, 28 Jul 2010 08:42:29 -0400 From: Jes.Sorensen@redhat.com To: qemu-devel@nongnu.org Date: Wed, 28 Jul 2010 14:42:24 +0200 Message-Id: <1280320944-5560-3-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: <1280320944-5560-1-git-send-email-Jes.Sorensen@redhat.com> References: <1280320944-5560-1-git-send-email-Jes.Sorensen@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kvm@vger.kernel.org, avi@redhat.com Subject: [Qemu-devel] [PATCH 2/2] 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++) {