qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Roedel, Joerg" <Joerg.Roedel@amd.com>
To: Alexander Graf <agraf@suse.de>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	Avi Kivity <avi@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [PATCH 1/3] Make kvm64 the default cpu model when kvm_enabled()
Date: Tue, 14 Sep 2010 18:21:36 +0200	[thread overview]
Message-ID: <20100914162135.GD17759@amd.com> (raw)
In-Reply-To: <4C8F9B8B.9060205@suse.de>

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 <joerg.roedel@amd.com>
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 <joerg.roedel@amd.com>
---
 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

  reply	other threads:[~2010-09-14 16:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-14 15:52 [Qemu-devel] [PATCH 0/3] SVM feature support for qemu Joerg Roedel
2010-09-14 15:52 ` [Qemu-devel] [PATCH 1/3] Make kvm64 the default cpu model when kvm_enabled() Joerg Roedel
2010-09-14 15:58   ` [Qemu-devel] " Alexander Graf
2010-09-14 16:21     ` Roedel, Joerg [this message]
2010-09-16 14:03   ` Avi Kivity
2010-09-16 14:21     ` Roedel, Joerg
2010-09-16 14:22       ` Avi Kivity
2010-09-14 15:52 ` [Qemu-devel] [PATCH 2/3] Set cpuid definition to 0 before initializing it Joerg Roedel
2010-09-14 15:52 ` [Qemu-devel] [PATCH 3/3] Add svm cpuid features Joerg Roedel
2010-09-16 14:06   ` [Qemu-devel] " Avi Kivity
2010-09-16 14:12     ` Roedel, Joerg
2010-09-16 14:17       ` Alexander Graf
2010-09-16 14:26         ` Roedel, Joerg
2010-09-16 14:28           ` Alexander Graf
2010-09-16 14:35             ` Roedel, Joerg
2010-09-14 20:27 ` [Qemu-devel] [PATCH 0/3] SVM feature support for qemu Alexander Graf
  -- strict thread matches above, loose matches on Subject: below --
2010-09-27 13:16 [Qemu-devel] [PATCH 0/3] SVM feature support for qemu v3 Joerg Roedel
2010-09-27 13:16 ` [Qemu-devel] [PATCH 1/3] Make kvm64 the default cpu model when kvm_enabled() Joerg Roedel
2010-10-06 18:53   ` [Qemu-devel] " Marcelo Tosatti
2010-10-06 19:24     ` Anthony Liguori
2010-10-07  8:42       ` Roedel, Joerg
2010-10-07 12:48         ` Anthony Liguori
2010-10-18  8:22           ` Roedel, Joerg
2010-10-18 14:16             ` Anthony Liguori
2010-10-20 15:53               ` Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100914162135.GD17759@amd.com \
    --to=joerg.roedel@amd.com \
    --cc=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).