From nobody Mon Feb 9 12:25:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500040831828333.0762640277841; Fri, 14 Jul 2017 07:00:31 -0700 (PDT) Received: from localhost ([::1]:38159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dW18w-0001GE-Jv for importer@patchew.org; Fri, 14 Jul 2017 10:00:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dW11l-0001cQ-Jf for qemu-devel@nongnu.org; Fri, 14 Jul 2017 09:53:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dW11k-0001QQ-OA for qemu-devel@nongnu.org; Fri, 14 Jul 2017 09:53:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38510) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dW11k-0001Pk-FN for qemu-devel@nongnu.org; Fri, 14 Jul 2017 09:53:04 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A4937D0D4; Fri, 14 Jul 2017 13:53:03 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.34.112.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CDBC6062B; Fri, 14 Jul 2017 13:53:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5A4937D0D4 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=imammedo@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5A4937D0D4 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Fri, 14 Jul 2017 15:51:58 +0200 Message-Id: <1500040339-119465-8-git-send-email-imammedo@redhat.com> In-Reply-To: <1500040339-119465-1-git-send-email-imammedo@redhat.com> References: <1500040339-119465-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 14 Jul 2017 13:53:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 07/28] sparc: move adhoc CPUSPARCState initialization to realize time X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Mark Cave-Ayland , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Artyom Tarasenko , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" SPARCCPU::env was initialized from previosuly set properties (with help of sparc_cpu_parse_features) in cpu_sparc_register(). However there is not reason to keep it there as this task is typically done at realize time. So move post properties initialization into sparc_cpu_realizefn, which brings cpu_sparc_init() closer to cpu_generic_init(). Signed-off-by: Igor Mammedov --- CC: Mark Cave-Ayland CC: Artyom Tarasenko --- target/sparc/cpu.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index cc89abc..cb13540 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -109,7 +109,6 @@ static void sparc_cpu_parse_features(CPUState *cs, char= *features, =20 static int cpu_sparc_register(SPARCCPU *cpu, const char *cpu_model) { - CPUSPARCState *env =3D &cpu->env; char *s =3D g_strdup(cpu_model); char *featurestr =3D strtok(s, ","); Error *err =3D NULL; @@ -122,19 +121,6 @@ static int cpu_sparc_register(SPARCCPU *cpu, const cha= r *cpu_model) return -1; } =20 - env->version =3D env->def.iu_version; - env->fsr =3D env->def.fpu_version; - env->nwindows =3D env->def.nwindows; -#if !defined(TARGET_SPARC64) - env->mmuregs[0] |=3D env->def.mmu_version; - cpu_sparc_set_id(env, 0); - env->mxccregs[7] |=3D env->def.mxcc_version; -#else - env->mmu_version =3D env->def.mmu_version; - env->maxtl =3D env->def.maxtl; - env->version |=3D env->def.maxtl << 8; - env->version |=3D env->def.nwindows - 1; -#endif return 0; } =20 @@ -817,15 +803,29 @@ static void sparc_cpu_realizefn(DeviceState *dev, Err= or **errp) CPUState *cs =3D CPU(dev); SPARCCPUClass *scc =3D SPARC_CPU_GET_CLASS(dev); Error *local_err =3D NULL; -#if defined(CONFIG_USER_ONLY) SPARCCPU *cpu =3D SPARC_CPU(dev); CPUSPARCState *env =3D &cpu->env; =20 +#if defined(CONFIG_USER_ONLY) if ((env->def.features & CPU_FEATURE_FLOAT)) { env->def.features |=3D CPU_FEATURE_FLOAT128; } #endif =20 + env->version =3D env->def.iu_version; + env->fsr =3D env->def.fpu_version; + env->nwindows =3D env->def.nwindows; +#if !defined(TARGET_SPARC64) + env->mmuregs[0] |=3D env->def.mmu_version; + cpu_sparc_set_id(env, 0); + env->mxccregs[7] |=3D env->def.mxcc_version; +#else + env->mmu_version =3D env->def.mmu_version; + env->maxtl =3D env->def.maxtl; + env->version |=3D env->def.maxtl << 8; + env->version |=3D env->def.nwindows - 1; +#endif + cpu_exec_realizefn(cs, &local_err); if (local_err !=3D NULL) { error_propagate(errp, local_err); --=20 2.7.4