qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Igor Mammedov" <imammedo@redhat.com>,
	"Don Slutz" <Don@CloudSwitch.Com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH 4/6] target-i386: postpone cpuid_level update to realize time
Date: Tue,  4 Dec 2012 17:34:41 -0200	[thread overview]
Message-ID: <1354649683-9078-5-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1354649683-9078-1-git-send-email-ehabkost@redhat.com>

From: Igor Mammedov <imammedo@redhat.com>

delay capping cpuid_level to 7 to realize time so property setters
for cpuid_7_0_ebx_features and "level" could be used in any order/time
between x86_cpu_initfn() and x86_cpu_realize().

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 target-i386/cpu.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 05ac79a..56a5646 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1381,9 +1381,6 @@ static int cpu_x86_parse_featurestr(x86_def_t *x86_cpu_def, char *features)
         if (kvm_check_features_against_host(x86_cpu_def) && enforce_cpuid)
             goto error;
     }
-    if (x86_cpu_def->cpuid_7_0_ebx_features && x86_cpu_def->level < 7) {
-        x86_cpu_def->level = 7;
-    }
     return 0;
 
 error:
@@ -2074,6 +2071,11 @@ static void x86_cpu_apic_init(X86CPU *cpu, Error **errp)
 void x86_cpu_realize(Object *obj, Error **errp)
 {
     X86CPU *cpu = X86_CPU(obj);
+    CPUX86State *env = &cpu->env;
+
+    if (env->cpuid_7_0_ebx_features && env->cpuid_level < 7) {
+        env->cpuid_level = 7;
+    }
 
 #ifndef CONFIG_USER_ONLY
     qemu_register_reset(x86_cpu_machine_reset_cb, cpu);
-- 
1.7.11.7

  parent reply	other threads:[~2012-12-04 19:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04 19:34 [Qemu-devel] [PATCH 0/6] short x86 CPU init cleanup (v3) Eduardo Habkost
2012-12-04 19:34 ` [Qemu-devel] [PATCH 1/6] target-i386/cpu.c: coding style fixes Eduardo Habkost
2012-12-04 19:40   ` Igor Mammedov
2012-12-04 19:34 ` [Qemu-devel] [PATCH 2/6] target-i386: cpu: separate feature string parsing from CPU model lookup Eduardo Habkost
2012-12-04 19:47   ` Igor Mammedov
2012-12-05 15:58   ` Andreas Färber
2012-12-04 19:34 ` [Qemu-devel] [PATCH 3/6] target-i386: use define for cpuid vendor string size Eduardo Habkost
2012-12-04 19:38   ` Eduardo Habkost
2012-12-05 11:29     ` Andreas Färber
2012-12-05 11:51       ` Eduardo Habkost
2012-12-05 12:03         ` Igor Mammedov
2012-12-04 19:34 ` Eduardo Habkost [this message]
2012-12-04 19:36   ` [Qemu-devel] [PATCH 4/6] target-i386: postpone cpuid_level update to realize time Eduardo Habkost
2012-12-04 19:34 ` [Qemu-devel] [PATCH 5/6] add visitor for parsing hz[KMG] input string Eduardo Habkost
2012-12-04 19:41   ` Eduardo Habkost
2012-12-04 23:43   ` Andreas Färber
2012-12-05 17:52   ` mdroth
2012-12-05 19:21     ` Eduardo Habkost
2012-12-05 21:00       ` mdroth
2012-12-06 20:49         ` Igor Mammedov
2012-12-04 19:34 ` [Qemu-devel] [PATCH 6/6] target-i386: use visit_type_hz to parse tsc_freq property value Eduardo Habkost
2012-12-04 19:55   ` Eduardo Habkost
2012-12-05 16:24 ` [Qemu-devel] [PATCH 0/6] short x86 CPU init cleanup (v3) Andreas Färber
  -- strict thread matches above, loose matches on Subject: below --
2012-12-04 18:58 [Qemu-devel] [PATCH 0/6] short x86 CPU init cleanup (v2) Eduardo Habkost
2012-12-04 18:58 ` [Qemu-devel] [PATCH 4/6] target-i386: postpone cpuid_level update to realize time 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=1354649683-9078-5-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=Don@CloudSwitch.Com \
    --cc=afaerber@suse.de \
    --cc=imammedo@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).