qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org, "Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [qom-cpu PATCH v2 1/2] target-i386: Use x86_cpu_get_supported_feature_word() for "-cpu host"
Date: Fri, 16 May 2014 14:58:47 -0300	[thread overview]
Message-ID: <1400263128-19107-2-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1400263128-19107-1-git-send-email-ehabkost@redhat.com>

This will make "-cpu host" reuse the feature filtering logic used by
x86_cpu_filter_features() (i.e. TCG support, and the new "migratable" flag).

This doesn't add "-cpu host" support to TCG mode yet, but that may be
possible eventually.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 715078a..61e8800 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1279,6 +1279,9 @@ static void host_x86_cpu_class_init(ObjectClass *oc, void *data)
     dc->props = host_x86_cpu_properties;
 }
 
+static uint32_t x86_cpu_get_supported_feature_word(FeatureWord w,
+                                                   bool migratable_only);
+
 static void host_x86_cpu_initfn(Object *obj)
 {
     X86CPU *cpu = X86_CPU(obj);
@@ -1293,10 +1296,8 @@ static void host_x86_cpu_initfn(Object *obj)
     env->cpuid_xlevel2 = kvm_arch_get_supported_cpuid(s, 0xC0000000, 0, R_EAX);
 
     for (w = 0; w < FEATURE_WORDS; w++) {
-        FeatureWordInfo *wi = &feature_word_info[w];
         env->features[w] =
-            kvm_arch_get_supported_cpuid(s, wi->cpuid_eax, wi->cpuid_ecx,
-                                         wi->cpuid_reg);
+            x86_cpu_get_supported_feature_word(w, cpu->migratable);
     }
     object_property_set_bool(OBJECT(cpu), true, "pmu", &error_abort);
 }
-- 
1.9.0

  reply	other threads:[~2014-05-16 17:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16 17:58 [Qemu-devel] [qom-cpu PATCH v2 0/2] target-i386: Fixes for migratable/invtsc Eduardo Habkost
2014-05-16 17:58 ` Eduardo Habkost [this message]
2014-05-16 17:58 ` [Qemu-devel] [qom-cpu PATCH v2 2/2] target-i386: Set migratable=yes by default on "host" CPU mooel Eduardo Habkost
2014-06-02 20:45 ` [Qemu-devel] [qom-cpu PATCH v2 0/2] target-i386: Fixes for migratable/invtsc Eduardo Habkost

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=1400263128-19107-2-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=afaerber@suse.de \
    --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).