Received: from eggs.gnu.org ([208.118.235.92]:33813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfyGT-0002bp-QJ for qemu-devel@nongnu.org; Tue, 04 Dec 2012 14:34:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfyGP-0006Vg-9M for qemu-devel@nongnu.org; Tue, 04 Dec 2012 14:34:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfyGO-0006Ud-OX for qemu-devel@nongnu.org; Tue, 04 Dec 2012 14:34:41 -0500 Date: Tue, 4 Dec 2012 17:36:14 -0200 From: Eduardo Habkost Message-ID: <20121204193614.GD4986@otherpad.lan.raisama.net> References: <1354649683-9078-1-git-send-email-ehabkost@redhat.com> <1354649683-9078-5-git-send-email-ehabkost@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1354649683-9078-5-git-send-email-ehabkost@redhat.com> Subject: Re: [Qemu-devel] [PATCH 4/6] target-i386: postpone cpuid_level update to realize time List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Igor Mammedov , Don Slutz , Andreas =?iso-8859-1?Q?F=E4rber?= On Tue, Dec 04, 2012 at 05:34:41PM -0200, Eduardo Habkost wrote: > From: Igor Mammedov > > 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 Reviewed-by: Eduardo Habkost > --- > 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 > > -- Eduardo