From patchwork Tue Jun 14 15:29:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 100362 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0E625B6FAB for ; Wed, 15 Jun 2011 01:34:48 +1000 (EST) Received: from localhost ([::1]:35128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWVdd-0006xI-2v for incoming@patchwork.ozlabs.org; Tue, 14 Jun 2011 11:34:45 -0400 Received: from eggs.gnu.org ([140.186.70.92]:52669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWVYx-0006Yo-Sm for qemu-devel@nongnu.org; Tue, 14 Jun 2011 11:29:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWVYw-0005H4-3B for qemu-devel@nongnu.org; Tue, 14 Jun 2011 11:29:55 -0400 Received: from cantor.suse.de ([195.135.220.2]:53135 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWVYv-0005Gg-CL for qemu-devel@nongnu.org; Tue, 14 Jun 2011 11:29:53 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 43E3093717; Tue, 14 Jun 2011 17:29:50 +0200 (CEST) From: Alexander Graf To: "qemu-devel@nongnu.org Developers" Date: Tue, 14 Jun 2011 17:29:49 +0200 Message-Id: <1308065389-11945-4-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1308065389-11945-1-git-send-email-agraf@suse.de> References: <1308065389-11945-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.2 Cc: Anthony Liguori Subject: [Qemu-devel] [PATCH 3/3] pc: use -cpu host as default for kvm X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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++) {