From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQJYO-0002dG-Pd for qemu-devel@nongnu.org; Mon, 22 Oct 2012 11:04:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQJYE-0000f8-Bl for qemu-devel@nongnu.org; Mon, 22 Oct 2012 11:04:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQJYE-0000er-3G for qemu-devel@nongnu.org; Mon, 22 Oct 2012 11:04:22 -0400 From: Igor Mammedov Date: Mon, 22 Oct 2012 17:03:00 +0200 Message-Id: <1350918203-25198-15-git-send-email-imammedo@redhat.com> In-Reply-To: <1350918203-25198-1-git-send-email-imammedo@redhat.com> References: <1350918203-25198-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH 14/37] 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: aliguori@us.ibm.com, ehabkost@redhat.com, jan.kiszka@siemens.com, Don@CloudSwitch.com, mdroth@linux.vnet.ibm.com, blauwirbel@gmail.com, stefanha@redhat.com, pbonzini@redhat.com, afaerber@suse.de 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 --- 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 951d12b..3131945 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1480,9 +1480,6 @@ static int cpu_x86_find_by_name(X86CPU *cpu, x86_def_t *x86_cpu_def, if (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; - } g_free(s); return 0; @@ -2040,6 +2037,10 @@ 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; + } + if (!kvm_enabled()) { env->cpuid_features &= TCG_FEATURES; env->cpuid_ext_features &= TCG_EXT_FEATURES; -- 1.7.11.7