From nobody Tue Feb 10 12:57:46 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 1507579017671331.2241395425109; Mon, 9 Oct 2017 12:56:57 -0700 (PDT) Received: from localhost ([::1]:59550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1eAP-0007Q2-QY for importer@patchew.org; Mon, 09 Oct 2017 15:56:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1e5O-0003Oa-MS for qemu-devel@nongnu.org; Mon, 09 Oct 2017 15:51:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1e5N-0006X6-9N for qemu-devel@nongnu.org; Mon, 09 Oct 2017 15:51:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48924) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e1e5N-0006Wp-0j; Mon, 09 Oct 2017 15:51:33 -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 06B3B7E43E; Mon, 9 Oct 2017 19:51:32 +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 B017377BE3; Mon, 9 Oct 2017 19:51:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 06B3B7E43E Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=imammedo@redhat.com From: Igor Mammedov To: qemu-devel@nongnu.org Date: Mon, 9 Oct 2017 21:50:58 +0200 Message-Id: <1507578671-158758-12-git-send-email-imammedo@redhat.com> In-Reply-To: <1507578671-158758-1-git-send-email-imammedo@redhat.com> References: <1507578671-158758-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.27]); Mon, 09 Oct 2017 19:51:32 +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 v2 11/24] ppc: spapr: replace ppc_cpu_parse_features() with cpu_parse_cpu_model() 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: "open list:ppce500" , "Edgar E. Iglesias" , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Alexander Graf , David Gibson 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" ppc_cpu_parse_features() is doing practically the same thing as generic cpu_parse_cpu_model(). So remove duplicated impl. and reuse generic one. Signed-off-by: Igor Mammedov Reviewed-by: Greg Kurz Acked-by: David Gibson --- include/hw/ppc/ppc.h | 2 -- hw/ppc/ppc.c | 25 ------------------------- hw/ppc/spapr_cpu_core.c | 9 ++++----- 3 files changed, 4 insertions(+), 32 deletions(-) diff --git a/include/hw/ppc/ppc.h b/include/hw/ppc/ppc.h index 4e7fe11..ff0ac30 100644 --- a/include/hw/ppc/ppc.h +++ b/include/hw/ppc/ppc.h @@ -105,6 +105,4 @@ enum { =20 /* ppc_booke.c */ void ppc_booke_timers_init(PowerPCCPU *cpu, uint32_t freq, uint32_t flags); - -void ppc_cpu_parse_features(const char *cpu_model); #endif diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index 05da316..7ec35de 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -1359,28 +1359,3 @@ void PPC_debug_write (void *opaque, uint32_t addr, u= int32_t val) break; } } - -void ppc_cpu_parse_features(const char *cpu_model) -{ - CPUClass *cc; - ObjectClass *oc; - const char *typename; - gchar **model_pieces; - - model_pieces =3D g_strsplit(cpu_model, ",", 2); - if (!model_pieces[0]) { - error_report("Invalid/empty CPU model name"); - exit(1); - } - - oc =3D cpu_class_by_name(TYPE_POWERPC_CPU, model_pieces[0]); - if (oc =3D=3D NULL) { - error_report("Unable to find CPU definition: %s", model_pieces[0]); - exit(1); - } - - typename =3D object_class_get_name(oc); - cc =3D CPU_CLASS(oc); - cc->parse_features(typename, model_pieces[1], &error_fatal); - g_strfreev(model_pieces); -} diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 37beb56..79a9615 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -34,6 +34,7 @@ void spapr_cpu_parse_features(sPAPRMachineState *spapr) * before passing it on to the cpu level parser. */ gchar **inpieces; + gchar *newprops; int i, j; gchar *compat_str =3D NULL; =20 @@ -58,17 +59,15 @@ void spapr_cpu_parse_features(sPAPRMachineState *spapr) =20 if (compat_str) { char *val =3D compat_str + strlen("compat=3D"); - gchar *newprops =3D g_strjoinv(",", inpieces); =20 object_property_set_str(OBJECT(spapr), val, "max-cpu-compat", &error_fatal); =20 - ppc_cpu_parse_features(newprops); - g_free(newprops); - } else { - ppc_cpu_parse_features(MACHINE(spapr)->cpu_model); } =20 + newprops =3D g_strjoinv(",", inpieces); + cpu_parse_cpu_model(TYPE_POWERPC_CPU, newprops); + g_free(newprops); g_strfreev(inpieces); } =20 --=20 2.7.4