From nobody Wed Nov 5 05:42:58 2025 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 1504278345101523.2570763380472; Fri, 1 Sep 2017 08:05:45 -0700 (PDT) Received: from localhost ([::1]:44993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnVu-00018C-VZ for importer@patchew.org; Fri, 01 Sep 2017 11:05:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnTi-0007m1-Mj for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnTg-0002rr-VI for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48896) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnTg-0002rO-N6 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:24 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADF3913AB3; Fri, 1 Sep 2017 15:03:23 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4977E66D4D; Fri, 1 Sep 2017 15:03:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ADF3913AB3 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:02:49 -0300 Message-Id: <20170901150317.10380-2-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 01 Sep 2017 15:03:23 +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] [PULL 01/29] qom: Remove unused errp parameter from can_be_deleted() 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: qemu-devel@nongnu.org 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" The errp argument is ignored by all implementations of the method, and user_creatable_del() would break if any implementation set an error (because it calls error_setg(errp) if the function returns false). Remove the unused parameter. Signed-off-by: Eduardo Habkost Message-Id: <20170829220337.23427-1-ehabkost@redhat.com> Reviewed-by: Gonglei Reviewed-by: Igor Mammedov Signed-off-by: Eduardo Habkost --- include/qom/object_interfaces.h | 5 ++--- backends/cryptodev.c | 2 +- backends/hostmem.c | 2 +- qom/object_interfaces.c | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/qom/object_interfaces.h b/include/qom/object_interface= s.h index fdd7603c84..d63c1c28f8 100644 --- a/include/qom/object_interfaces.h +++ b/include/qom/object_interfaces.h @@ -51,7 +51,7 @@ typedef struct UserCreatableClass { =20 /* */ void (*complete)(UserCreatable *uc, Error **errp); - bool (*can_be_deleted)(UserCreatable *uc, Error **errp); + bool (*can_be_deleted)(UserCreatable *uc); } UserCreatableClass; =20 /** @@ -68,12 +68,11 @@ void user_creatable_complete(Object *obj, Error **errp); /** * user_creatable_can_be_deleted: * @uc: the object whose can_be_deleted() method is called if implemented - * @errp: if an error occurs, a pointer to an area to store the error * * Wrapper to call can_be_deleted() method if one of types it's inherited * from implements USER_CREATABLE interface. */ -bool user_creatable_can_be_deleted(UserCreatable *uc, Error **errp); +bool user_creatable_can_be_deleted(UserCreatable *uc); =20 /** * user_creatable_add_type: diff --git a/backends/cryptodev.c b/backends/cryptodev.c index 1764c179fe..67edfa5328 100644 --- a/backends/cryptodev.c +++ b/backends/cryptodev.c @@ -215,7 +215,7 @@ bool cryptodev_backend_is_ready(CryptoDevBackend *backe= nd) } =20 static bool -cryptodev_backend_can_be_deleted(UserCreatable *uc, Error **errp) +cryptodev_backend_can_be_deleted(UserCreatable *uc) { return !cryptodev_backend_is_used(CRYPTODEV_BACKEND(uc)); } diff --git a/backends/hostmem.c b/backends/hostmem.c index 4606b73849..34550b9067 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -342,7 +342,7 @@ out: } =20 static bool -host_memory_backend_can_be_deleted(UserCreatable *uc, Error **errp) +host_memory_backend_can_be_deleted(UserCreatable *uc) { if (host_memory_backend_is_mapped(MEMORY_BACKEND(uc))) { return false; diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index ff27e0669e..3bb8959f09 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -23,13 +23,13 @@ void user_creatable_complete(Object *obj, Error **errp) } } =20 -bool user_creatable_can_be_deleted(UserCreatable *uc, Error **errp) +bool user_creatable_can_be_deleted(UserCreatable *uc) { =20 UserCreatableClass *ucc =3D USER_CREATABLE_GET_CLASS(uc); =20 if (ucc->can_be_deleted) { - return ucc->can_be_deleted(uc, errp); + return ucc->can_be_deleted(uc); } else { return true; } @@ -178,7 +178,7 @@ void user_creatable_del(const char *id, Error **errp) return; } =20 - if (!user_creatable_can_be_deleted(USER_CREATABLE(obj), errp)) { + if (!user_creatable_can_be_deleted(USER_CREATABLE(obj))) { error_setg(errp, "object '%s' is in use, can not be deleted", id); return; } --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504278340608659.08886428143; Fri, 1 Sep 2017 08:05:40 -0700 (PDT) Received: from localhost ([::1]:44991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnVr-00013S-JC for importer@patchew.org; Fri, 01 Sep 2017 11:05:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnTn-0007mw-9l for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnTi-0002sM-Mj for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53548) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnTi-0002s7-HG for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:26 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9513C806CC; Fri, 1 Sep 2017 15:03:25 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 22C607B0FE; Fri, 1 Sep 2017 15:03:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9513C806CC 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=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:02:50 -0300 Message-Id: <20170901150317.10380-3-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 01 Sep 2017 15:03:25 +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] [PULL 02/29] cpu: cpu_by_arch_id() helper 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: qemu-devel@nongnu.org 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" The helper can be used for CPU object lookup using the CPU's arch-specific ID (the one returned by CPUClass::get_arch_id()). Signed-off-by: Eduardo Habkost [Yi Wang: Added documentation comments] Signed-off-by: Yi Wang Signed-off-by: Yun Liu [ehabkost: extracted cpu_by_arch_id() to a separate patch] Signed-off-by: Eduardo Habkost --- include/qom/cpu.h | 10 ++++++++++ qom/cpu.c | 11 ++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 25eefea7ab..b7ac9491c8 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -755,6 +755,16 @@ CPUState *qemu_get_cpu(int index); bool cpu_exists(int64_t id); =20 /** + * cpu_by_arch_id: + * @id: Guest-exposed CPU ID of the CPU to obtain. + * + * Get a CPU with matching @id. + * + * Returns: The CPU or %NULL if there is no matching CPU. + */ +CPUState *cpu_by_arch_id(int64_t id); + +/** * cpu_throttle_set: * @new_throttle_pct: Percent of sleep time. Valid range is 1 to 99. * diff --git a/qom/cpu.c b/qom/cpu.c index 4f38db0dac..e6210d5949 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -34,7 +34,7 @@ =20 CPUInterruptHandler cpu_interrupt_handler; =20 -bool cpu_exists(int64_t id) +CPUState *cpu_by_arch_id(int64_t id) { CPUState *cpu; =20 @@ -42,10 +42,15 @@ bool cpu_exists(int64_t id) CPUClass *cc =3D CPU_GET_CLASS(cpu); =20 if (cc->get_arch_id(cpu) =3D=3D id) { - return true; + return cpu; } } - return false; + return NULL; +} + +bool cpu_exists(int64_t id) +{ + return !!cpu_by_arch_id(id); } =20 CPUState *cpu_generic_init(const char *typename, const char *cpu_model) --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504278504877796.7977437417951; Fri, 1 Sep 2017 08:08:24 -0700 (PDT) Received: from localhost ([::1]:45001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnYV-0003oE-Ls for importer@patchew.org; Fri, 01 Sep 2017 11:08:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnTl-0007mG-Hs for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnTk-0002tD-PS for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62756) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnTk-0002sq-Jo for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:28 -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 74A1BC047B74; Fri, 1 Sep 2017 15:03:27 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF35778209; Fri, 1 Sep 2017 15:03:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 74A1BC047B74 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:02:51 -0300 Message-Id: <20170901150317.10380-4-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@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.31]); Fri, 01 Sep 2017 15:03:27 +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] [PULL 03/29] hmp: allow apic-id for "info lapic" 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: Yi Wang , qemu-devel@nongnu.org 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" From: Yi Wang Add [apic-id] support for hmp command "info lapic", which is useful when debugging ipi and so on. Current behavior is not changed when the parameter isn't specified. Signed-off-by: Yi Wang Signed-off-by: Yun Liu Message-Id: <1501049917-4701-3-git-send-email-wang.yi59@zte.com.cn> Signed-off-by: Eduardo Habkost --- target/i386/monitor.c | 10 +++++++++- hmp-commands-info.hx | 7 ++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 77ead60437..fe7d57b6aa 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -632,7 +632,15 @@ const MonitorDef *target_monitor_defs(void) =20 void hmp_info_local_apic(Monitor *mon, const QDict *qdict) { - CPUState *cs =3D mon_get_cpu(); + CPUState *cs; + + if (qdict_haskey(qdict, "apic-id")) { + int id =3D qdict_get_try_int(qdict, "apic-id", 0); + cs =3D cpu_by_arch_id(id); + } else { + cs =3D mon_get_cpu(); + } + =20 if (!cs) { monitor_printf(mon, "No CPU available\n"); diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index d9df238a5f..4ab7fcee98 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -115,9 +115,10 @@ ETEXI #if defined(TARGET_I386) { .name =3D "lapic", - .args_type =3D "", - .params =3D "", - .help =3D "show local apic state", + .args_type =3D "apic-id:i?", + .params =3D "[apic-id]", + .help =3D "show local apic state (apic-id: local apic to rea= d, default is which of current CPU)", + .cmd =3D hmp_info_local_apic, }, #endif --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504278509409540.926596551113; Fri, 1 Sep 2017 08:08:29 -0700 (PDT) Received: from localhost ([::1]:45002 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnYa-0003ry-Bp for importer@patchew.org; Fri, 01 Sep 2017 11:08:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnTr-0007r8-LR for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnTm-0002u8-K8 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35392) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnTm-0002ti-AT for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:30 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B92AC04D28D; Fri, 1 Sep 2017 15:03:29 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id C956F6A57B; Fri, 1 Sep 2017 15:03:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4B92AC04D28D Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:02:52 -0300 Message-Id: <20170901150317.10380-5-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 01 Sep 2017 15:03:29 +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] [PULL 04/29] target-i386/cpu: Add new EPYC 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: Paolo Bonzini , Tom Lendacky , Brijesh Singh , qemu-devel@nongnu.org, Richard Henderson 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" From: Brijesh Singh Add a new base CPU model called 'EPYC' to model processors from AMD EPYC family (which includes EPYC 76xx,75xx,74xx, 73xx and 72xx). The following features bits have been added/removed compare to Opteron_G5 Added: monitor, movbe, rdrand, mmxext, ffxsr, rdtscp, cr8legacy, osvw, fsgsbase, bmi1, avx2, smep, bmi2, rdseed, adx, smap, clfshopt, sha xsaveopt, xsavec, xgetbv1, arat Removed: xop, fma4, tbm Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Tom Lendacky Signed-off-by: Brijesh Singh Message-Id: <20170815170051.127257-1-brijesh.singh@amd.com> Reviewed-by: Eduardo Habkost Signed-off-by: Eduardo Habkost --- target/i386/cpu.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ddc45abd70..6617e01a72 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1522,6 +1522,50 @@ static X86CPUDefinition builtin_x86_defs[] =3D { .xlevel =3D 0x8000001A, .model_id =3D "AMD Opteron 63xx class CPU", }, + { + .name =3D "EPYC", + .level =3D 0xd, + .vendor =3D CPUID_VENDOR_AMD, + .family =3D 23, + .model =3D 1, + .stepping =3D 2, + .features[FEAT_1_EDX] =3D + CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX | CPUID_CLFLUS= H | + CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA | CPUID_PGE | + CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 | CPUID_MCE | + CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE | CPUID_DE | + CPUID_VME | CPUID_FP87, + .features[FEAT_1_ECX] =3D + CPUID_EXT_RDRAND | CPUID_EXT_F16C | CPUID_EXT_AVX | + CPUID_EXT_XSAVE | CPUID_EXT_AES | CPUID_EXT_POPCNT | + CPUID_EXT_MOVBE | CPUID_EXT_SSE42 | CPUID_EXT_SSE41 | + CPUID_EXT_CX16 | CPUID_EXT_FMA | CPUID_EXT_SSSE3 | + CPUID_EXT_MONITOR | CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3, + .features[FEAT_8000_0001_EDX] =3D + CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_PDPE1GB | + CPUID_EXT2_FFXSR | CPUID_EXT2_MMXEXT | CPUID_EXT2_NX | + CPUID_EXT2_SYSCALL, + .features[FEAT_8000_0001_ECX] =3D + CPUID_EXT3_OSVW | CPUID_EXT3_3DNOWPREFETCH | + CPUID_EXT3_MISALIGNSSE | CPUID_EXT3_SSE4A | CPUID_EXT3_ABM | + CPUID_EXT3_CR8LEG | CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM, + .features[FEAT_7_0_EBX] =3D + CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_AV= X2 | + CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_RDSEED= | + CPUID_7_0_EBX_ADX | CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLFLUSH= OPT | + CPUID_7_0_EBX_SHA_NI, + /* Missing: XSAVES (not supported by some Linux versions, + * including v4.1 to v4.12). + * KVM doesn't yet expose any XSAVES state save component. + */ + .features[FEAT_XSAVE] =3D + CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | + CPUID_XSAVE_XGETBV1, + .features[FEAT_6_EAX] =3D + CPUID_6_EAX_ARAT, + .xlevel =3D 0x8000000A, + .model_id =3D "AMD EPYC Processor", + }, }; =20 typedef struct PropValue { --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 150427846980266.05044444057239; Fri, 1 Sep 2017 08:07:49 -0700 (PDT) Received: from localhost ([::1]:45000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnXw-0003Hj-Oe for importer@patchew.org; Fri, 01 Sep 2017 11:07:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnTr-0007rQ-WB for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnTo-0002v4-RI for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45358) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnTo-0002uS-MN for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:32 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A989B61497; Fri, 1 Sep 2017 15:03:31 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2222A81F84; Fri, 1 Sep 2017 15:03:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A989B61497 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:02:53 -0300 Message-Id: <20170901150317.10380-6-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 01 Sep 2017 15:03:31 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 05/29] qom: cpu: fix parsed feature string length 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov since commit ( 9262685b cpu: Factor out cpu_generic_init() ) features parsed by it were truncated only to the 1st feature after CPU name due to fact that featurestr =3D strtok(NULL, ","); cc->parse_features(cpu, featurestr, &err); would extract exactly one feature and parse_features() callback would parse it and only it leaving the rest of features ignored. Reuse approach from x86 custom impl. i.e. replace strtok() token parsing with g_strsplit(), which would split feature string in 2 parts name and features list and pass the later to parse_features() callback. Signed-off-by: Igor Mammedov Message-Id: <1503592308-93913-2-git-send-email-imammedo@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eduardo Habkost Signed-off-by: Eduardo Habkost --- qom/cpu.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/qom/cpu.c b/qom/cpu.c index e6210d5949..deb8880930 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -55,28 +55,26 @@ bool cpu_exists(int64_t id) =20 CPUState *cpu_generic_init(const char *typename, const char *cpu_model) { - char *str, *name, *featurestr; CPUState *cpu =3D NULL; ObjectClass *oc; CPUClass *cc; Error *err =3D NULL; + gchar **model_pieces; =20 - str =3D g_strdup(cpu_model); - name =3D strtok(str, ","); + model_pieces =3D g_strsplit(cpu_model, ",", 2); =20 - oc =3D cpu_class_by_name(typename, name); + oc =3D cpu_class_by_name(typename, model_pieces[0]); if (oc =3D=3D NULL) { - g_free(str); + g_strfreev(model_pieces); return NULL; } =20 cc =3D CPU_CLASS(oc); - featurestr =3D strtok(NULL, ","); /* TODO: all callers of cpu_generic_init() need to be converted to * call parse_features() only once, before calling cpu_generic_init(). */ - cc->parse_features(object_class_get_name(oc), featurestr, &err); - g_free(str); + cc->parse_features(object_class_get_name(oc), model_pieces[1], &err); + g_strfreev(model_pieces); if (err !=3D NULL) { goto out; } --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504278514587366.7822356252001; Fri, 1 Sep 2017 08:08:34 -0700 (PDT) Received: from localhost ([::1]:45003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnYf-0003vy-G6 for importer@patchew.org; Fri, 01 Sep 2017 11:08:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnU1-0007wW-GC for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnTw-0002wl-GK for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36104) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnTw-0002wa-7y for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:40 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 004C3C05091F; Fri, 1 Sep 2017 15:03:37 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E08E81F84; Fri, 1 Sep 2017 15:03:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 004C3C05091F Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:02:54 -0300 Message-Id: <20170901150317.10380-7-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 01 Sep 2017 15:03:39 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 06/29] sparc: convert cpu models to SPARC cpu subclasses 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov QOMfy cpu models handling introducing propper cpu types for each cpu model. Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1503592308-93913-3-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/sparc/cpu-qom.h | 2 + target/sparc/cpu.c | 120 +++++++++++++++++++++++++++++++++------------= ---- 2 files changed, 83 insertions(+), 39 deletions(-) diff --git a/target/sparc/cpu-qom.h b/target/sparc/cpu-qom.h index f63af728ee..af6d57a9e0 100644 --- a/target/sparc/cpu-qom.h +++ b/target/sparc/cpu-qom.h @@ -35,6 +35,7 @@ #define SPARC_CPU_GET_CLASS(obj) \ OBJECT_GET_CLASS(SPARCCPUClass, (obj), TYPE_SPARC_CPU) =20 +typedef struct sparc_def_t sparc_def_t; /** * SPARCCPUClass: * @parent_realize: The parent class' realize handler. @@ -49,6 +50,7 @@ typedef struct SPARCCPUClass { =20 DeviceRealize parent_realize; void (*parent_reset)(CPUState *cpu); + sparc_def_t *cpu_def; } SPARCCPUClass; =20 typedef struct SPARCCPU SPARCCPU; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index d606eb53f4..a82fc238f4 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -25,8 +25,6 @@ =20 //#define DEBUG_FEATURES =20 -static int cpu_sparc_find_by_name(sparc_def_t *cpu_def, const char *cpu_mo= del); - /* CPUClass::reset() */ static void sparc_cpu_reset(CPUState *s) { @@ -111,17 +109,9 @@ static int cpu_sparc_register(SPARCCPU *cpu, const cha= r *cpu_model) { CPUSPARCState *env =3D &cpu->env; char *s =3D g_strdup(cpu_model); - char *featurestr, *name =3D strtok(s, ","); - sparc_def_t def1, *def =3D &def1; + char *featurestr =3D strtok(s, ","); Error *err =3D NULL; =20 - if (cpu_sparc_find_by_name(def, name) < 0) { - g_free(s); - return -1; - } - - env->def =3D g_memdup(def, sizeof(*def)); - featurestr =3D strtok(NULL, ","); sparc_cpu_parse_features(CPU(cpu), featurestr, &err); g_free(s); @@ -130,18 +120,18 @@ static int cpu_sparc_register(SPARCCPU *cpu, const ch= ar *cpu_model) return -1; } =20 - env->version =3D def->iu_version; - env->fsr =3D def->fpu_version; - env->nwindows =3D def->nwindows; + 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 def->mmu_version; + env->mmuregs[0] |=3D env->def->mmu_version; cpu_sparc_set_id(env, 0); - env->mxccregs[7] |=3D def->mxcc_version; + env->mxccregs[7] |=3D env->def->mxcc_version; #else - env->mmu_version =3D def->mmu_version; - env->maxtl =3D def->maxtl; - env->version |=3D def->maxtl << 8; - env->version |=3D def->nwindows - 1; + 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; } @@ -149,8 +139,18 @@ static int cpu_sparc_register(SPARCCPU *cpu, const cha= r *cpu_model) SPARCCPU *cpu_sparc_init(const char *cpu_model) { SPARCCPU *cpu; + ObjectClass *oc; + char *str, *name; + + str =3D g_strdup(cpu_model); + name =3D strtok(str, ","); + oc =3D cpu_class_by_name(TYPE_SPARC_CPU, name); + g_free(str); + if (oc =3D=3D NULL) { + return NULL; + } =20 - cpu =3D SPARC_CPU(object_new(TYPE_SPARC_CPU)); + cpu =3D SPARC_CPU(object_new(object_class_get_name(oc))); =20 if (cpu_sparc_register(cpu, cpu_model) < 0) { object_unref(OBJECT(cpu)); @@ -553,23 +553,6 @@ static void add_flagname_to_bitmaps(const char *flagna= me, uint32_t *features) error_report("CPU feature %s not found", flagname); } =20 -static int cpu_sparc_find_by_name(sparc_def_t *cpu_def, const char *name) -{ - unsigned int i; - const sparc_def_t *def =3D NULL; - - for (i =3D 0; i < ARRAY_SIZE(sparc_defs); i++) { - if (strcasecmp(name, sparc_defs[i].name) =3D=3D 0) { - def =3D &sparc_defs[i]; - } - } - if (!def) { - return -1; - } - memcpy(cpu_def, def, sizeof(*def)); - return 0; -} - static void sparc_cpu_parse_features(CPUState *cs, char *features, Error **errp) { @@ -796,6 +779,36 @@ static bool sparc_cpu_has_work(CPUState *cs) cpu_interrupts_enabled(env); } =20 +static char *sparc_cpu_type_name(const char *cpu_model) +{ + char *name =3D g_strdup_printf("%s-" TYPE_SPARC_CPU, cpu_model); + char *s =3D name; + + /* SPARC cpu model names happen to have whitespaces, + * as type names shouldn't have spaces replace them with '-' + */ + while ((s =3D strchr(s, ' '))) { + *s =3D '-'; + } + + return name; +} + +static ObjectClass *sparc_cpu_class_by_name(const char *cpu_model) +{ + ObjectClass *oc; + char *typename; + + if (cpu_model =3D=3D NULL) { + return NULL; + } + + typename =3D sparc_cpu_type_name(cpu_model); + oc =3D object_class_by_name(typename); + g_free(typename); + return oc; +} + static void sparc_cpu_realizefn(DeviceState *dev, Error **errp) { CPUState *cs =3D CPU(dev); @@ -825,6 +838,7 @@ static void sparc_cpu_initfn(Object *obj) { CPUState *cs =3D CPU(obj); SPARCCPU *cpu =3D SPARC_CPU(obj); + SPARCCPUClass *scc =3D SPARC_CPU_GET_CLASS(obj); CPUSPARCState *env =3D &cpu->env; =20 cs->env_ptr =3D env; @@ -832,6 +846,8 @@ static void sparc_cpu_initfn(Object *obj) if (tcg_enabled()) { gen_intermediate_code_init(env); } + + env->def =3D g_memdup(scc->cpu_def, sizeof(*scc->cpu_def)); } =20 static void sparc_cpu_uninitfn(Object *obj) @@ -854,6 +870,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void = *data) scc->parent_reset =3D cc->reset; cc->reset =3D sparc_cpu_reset; =20 + cc->class_by_name =3D sparc_cpu_class_by_name; cc->has_work =3D sparc_cpu_has_work; cc->do_interrupt =3D sparc_cpu_do_interrupt; cc->cpu_exec_interrupt =3D sparc_cpu_exec_interrupt; @@ -888,14 +905,39 @@ static const TypeInfo sparc_cpu_type_info =3D { .instance_size =3D sizeof(SPARCCPU), .instance_init =3D sparc_cpu_initfn, .instance_finalize =3D sparc_cpu_uninitfn, - .abstract =3D false, + .abstract =3D true, .class_size =3D sizeof(SPARCCPUClass), .class_init =3D sparc_cpu_class_init, }; =20 +static void sparc_cpu_cpudef_class_init(ObjectClass *oc, void *data) +{ + SPARCCPUClass *scc =3D SPARC_CPU_CLASS(oc); + scc->cpu_def =3D data; +} + +static void sparc_register_cpudef_type(const struct sparc_def_t *def) +{ + char *typename =3D sparc_cpu_type_name(def->name); + TypeInfo ti =3D { + .name =3D typename, + .parent =3D TYPE_SPARC_CPU, + .class_init =3D sparc_cpu_cpudef_class_init, + .class_data =3D (void *)def, + }; + + type_register(&ti); + g_free(typename); +} + static void sparc_cpu_register_types(void) { + int i; + type_register_static(&sparc_cpu_type_info); + for (i =3D 0; i < ARRAY_SIZE(sparc_defs); i++) { + sparc_register_cpudef_type(&sparc_defs[i]); + } } =20 type_init(sparc_cpu_register_types) --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504278663253903.9032883398413; Fri, 1 Sep 2017 08:11:03 -0700 (PDT) Received: from localhost ([::1]:45026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnb3-0006Vm-RO for importer@patchew.org; Fri, 01 Sep 2017 11:11:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnTx-0007vO-Nt for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnTv-0002we-SY for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42210) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnTv-0002wO-Ix for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:39 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 67969C0546FF; Fri, 1 Sep 2017 15:03:38 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 218619343E; Fri, 1 Sep 2017 15:03:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 67969C0546FF Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:02:55 -0300 Message-Id: <20170901150317.10380-8-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 01 Sep 2017 15:03:38 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 07/29] sparc: embed sparc_def_t into CPUSPARCState 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov Make CPUSPARCState::def embedded so it would be allocated as part of cpu instance and we won't have to worry about cleaning def pointer up mannualy on cpu destruction. Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1503592308-93913-4-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- linux-user/sparc/target_syscall.h | 2 +- target/sparc/cpu.h | 8 ++++---- target/sparc/cpu.c | 39 ++++++++++++++++-------------------= ---- target/sparc/int32_helper.c | 2 +- target/sparc/int64_helper.c | 2 +- target/sparc/ldst_helper.c | 14 +++++++------- target/sparc/mmu_helper.c | 2 +- target/sparc/translate.c | 2 +- target/sparc/win_helper.c | 4 ++-- 9 files changed, 34 insertions(+), 41 deletions(-) diff --git a/linux-user/sparc/target_syscall.h b/linux-user/sparc/target_sy= scall.h index f97aa6b075..5f09abfe89 100644 --- a/linux-user/sparc/target_syscall.h +++ b/linux-user/sparc/target_syscall.h @@ -31,7 +31,7 @@ struct target_pt_regs { =20 static inline abi_ulong target_shmlba(CPUSPARCState *env) { - if (!(env->def->features & CPU_FEATURE_FLUSH)) { + if (!(env->def.features & CPU_FEATURE_FLUSH)) { return 64 * 1024; } else { return 256 * 1024; diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 95a36a4bdc..0e41916a52 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -529,7 +529,7 @@ struct CPUSPARCState { #define SOFTINT_INTRMASK (0xFFFE) #define SOFTINT_REG_MASK (SOFTINT_STIMER|SOFTINT_INTRMASK|SOFTINT_TIMER) #endif - sparc_def_t *def; + sparc_def_t def; =20 void *irq_manager; void (*qemu_irq_ack)(CPUSPARCState *env, void *irq_manager, int intno); @@ -679,7 +679,7 @@ int cpu_sparc_signal_handler(int host_signum, void *pin= fo, void *puc); #if defined (TARGET_SPARC64) static inline int cpu_has_hypervisor(CPUSPARCState *env1) { - return env1->def->features & CPU_FEATURE_HYPV; + return env1->def.features & CPU_FEATURE_HYPV; } =20 static inline int cpu_hypervisor_mode(CPUSPARCState *env1) @@ -788,14 +788,14 @@ static inline void cpu_get_tb_cpu_state(CPUSPARCState= *env, target_ulong *pc, if (env->pstate & PS_AM) { flags |=3D TB_FLAG_AM_ENABLED; } - if ((env->def->features & CPU_FEATURE_FLOAT) + if ((env->def.features & CPU_FEATURE_FLOAT) && (env->pstate & PS_PEF) && (env->fprs & FPRS_FEF)) { flags |=3D TB_FLAG_FPU_ENABLED; } flags |=3D env->asi << TB_FLAG_ASI_SHIFT; #else - if ((env->def->features & CPU_FEATURE_FLOAT) && env->psref) { + if ((env->def.features & CPU_FEATURE_FLOAT) && env->psref) { flags |=3D TB_FLAG_FPU_ENABLED; } #endif diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index a82fc238f4..281a99f8dd 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -66,7 +66,7 @@ static void sparc_cpu_reset(CPUState *s) env->lsu =3D 0; #else env->mmuregs[0] &=3D ~(MMU_E | MMU_NF); - env->mmuregs[0] |=3D env->def->mmu_bm; + env->mmuregs[0] |=3D env->def.mmu_bm; #endif env->pc =3D 0; env->npc =3D env->pc + 4; @@ -120,18 +120,18 @@ static int cpu_sparc_register(SPARCCPU *cpu, const ch= ar *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; + 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; + env->mmuregs[0] |=3D env->def.mmu_version; cpu_sparc_set_id(env, 0); - env->mxccregs[7] |=3D env->def->mxcc_version; + 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; + 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; } @@ -557,7 +557,7 @@ static void sparc_cpu_parse_features(CPUState *cs, char= *features, Error **errp) { SPARCCPU *cpu =3D SPARC_CPU(cs); - sparc_def_t *cpu_def =3D cpu->env.def; + sparc_def_t *cpu_def =3D &cpu->env.def; char *featurestr; uint32_t plus_features =3D 0; uint32_t minus_features =3D 0; @@ -818,8 +818,8 @@ static void sparc_cpu_realizefn(DeviceState *dev, Error= **errp) SPARCCPU *cpu =3D SPARC_CPU(dev); CPUSPARCState *env =3D &cpu->env; =20 - if ((env->def->features & CPU_FEATURE_FLOAT)) { - env->def->features |=3D CPU_FEATURE_FLOAT128; + if ((env->def.features & CPU_FEATURE_FLOAT)) { + env->def.features |=3D CPU_FEATURE_FLOAT128; } #endif =20 @@ -847,15 +847,9 @@ static void sparc_cpu_initfn(Object *obj) gen_intermediate_code_init(env); } =20 - env->def =3D g_memdup(scc->cpu_def, sizeof(*scc->cpu_def)); -} - -static void sparc_cpu_uninitfn(Object *obj) -{ - SPARCCPU *cpu =3D SPARC_CPU(obj); - CPUSPARCState *env =3D &cpu->env; - - g_free(env->def); + if (scc->cpu_def) { + env->def =3D *scc->cpu_def; + } } =20 static void sparc_cpu_class_init(ObjectClass *oc, void *data) @@ -904,7 +898,6 @@ static const TypeInfo sparc_cpu_type_info =3D { .parent =3D TYPE_CPU, .instance_size =3D sizeof(SPARCCPU), .instance_init =3D sparc_cpu_initfn, - .instance_finalize =3D sparc_cpu_uninitfn, .abstract =3D true, .class_size =3D sizeof(SPARCCPUClass), .class_init =3D sparc_cpu_class_init, diff --git a/target/sparc/int32_helper.c b/target/sparc/int32_helper.c index eec9a4d49f..c7724928c0 100644 --- a/target/sparc/int32_helper.c +++ b/target/sparc/int32_helper.c @@ -108,7 +108,7 @@ void sparc_cpu_do_interrupt(CPUState *cs) #if !defined(CONFIG_USER_ONLY) if (env->psret =3D=3D 0) { if (cs->exception_index =3D=3D 0x80 && - env->def->features & CPU_FEATURE_TA0_SHUTDOWN) { + env->def.features & CPU_FEATURE_TA0_SHUTDOWN) { qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); } else { cpu_abort(cs, "Trap 0x%02x while interrupts disabled, Error st= ate", diff --git a/target/sparc/int64_helper.c b/target/sparc/int64_helper.c index f942973c22..f3e7f32de6 100644 --- a/target/sparc/int64_helper.c +++ b/target/sparc/int64_helper.c @@ -147,7 +147,7 @@ void sparc_cpu_do_interrupt(CPUState *cs) } } =20 - if (env->def->features & CPU_FEATURE_GL) { + if (env->def.features & CPU_FEATURE_GL) { tsptr->tstate |=3D (env->gl & 7ULL) << 40; cpu_gl_switch_gregs(env, env->gl + 1); env->gl++; diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c index 57968d9143..fb489cb5fd 100644 --- a/target/sparc/ldst_helper.c +++ b/target/sparc/ldst_helper.c @@ -513,7 +513,7 @@ uint64_t helper_ld_asi(CPUSPARCState *env, target_ulong= addr, case 0x00: /* Leon3 Cache Control */ case 0x08: /* Leon3 Instruction Cache config */ case 0x0C: /* Leon3 Date Cache config */ - if (env->def->features & CPU_FEATURE_CACHE_CTRL) { + if (env->def.features & CPU_FEATURE_CACHE_CTRL) { ret =3D leon3_cache_control_ld(env, addr, size); } break; @@ -736,7 +736,7 @@ void helper_st_asi(CPUSPARCState *env, target_ulong add= r, uint64_t val, case 0x00: /* Leon3 Cache Control */ case 0x08: /* Leon3 Instruction Cache config */ case 0x0C: /* Leon3 Date Cache config */ - if (env->def->features & CPU_FEATURE_CACHE_CTRL) { + if (env->def.features & CPU_FEATURE_CACHE_CTRL) { leon3_cache_control_st(env, addr, val, size); } break; @@ -904,15 +904,15 @@ void helper_st_asi(CPUSPARCState *env, target_ulong a= ddr, uint64_t val, /* Mappings generated during no-fault mode are invalid in normal mode. */ if ((oldreg ^ env->mmuregs[reg]) - & (MMU_NF | env->def->mmu_bm)) { + & (MMU_NF | env->def.mmu_bm)) { tlb_flush(CPU(cpu)); } break; case 1: /* Context Table Pointer Register */ - env->mmuregs[reg] =3D val & env->def->mmu_ctpr_mask; + env->mmuregs[reg] =3D val & env->def.mmu_ctpr_mask; break; case 2: /* Context Register */ - env->mmuregs[reg] =3D val & env->def->mmu_cxr_mask; + env->mmuregs[reg] =3D val & env->def.mmu_cxr_mask; if (oldreg !=3D env->mmuregs[reg]) { /* we flush when the MMU context changes because QEMU has no MMU context support */ @@ -923,11 +923,11 @@ void helper_st_asi(CPUSPARCState *env, target_ulong a= ddr, uint64_t val, case 4: /* Synchronous Fault Address Register */ break; case 0x10: /* TLB Replacement Control Register */ - env->mmuregs[reg] =3D val & env->def->mmu_trcr_mask; + env->mmuregs[reg] =3D val & env->def.mmu_trcr_mask; break; case 0x13: /* Synchronous Fault Status Register with Read and Clear */ - env->mmuregs[3] =3D val & env->def->mmu_sfsr_mask; + env->mmuregs[3] =3D val & env->def.mmu_sfsr_mask; break; case 0x14: /* Synchronous Fault Address Register */ env->mmuregs[4] =3D val; diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index 8b4664d996..126ea5e3ee 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -95,7 +95,7 @@ static int get_physical_address(CPUSPARCState *env, hwadd= r *physical, if (mmu_idx =3D=3D MMU_PHYS_IDX) { *page_size =3D TARGET_PAGE_SIZE; /* Boot mode: instruction fetches are taken from PROM */ - if (rw =3D=3D 2 && (env->mmuregs[0] & env->def->mmu_bm)) { + if (rw =3D=3D 2 && (env->mmuregs[0] & env->def.mmu_bm)) { *physical =3D env->prom_addr | (address & 0x7ffffULL); *prot =3D PAGE_READ | PAGE_EXEC; return 0; diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 3bde47be83..6290705b11 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -5756,7 +5756,7 @@ void gen_intermediate_code(CPUState *cs, TranslationB= lock * tb) dc->npc =3D (target_ulong) tb->cs_base; dc->cc_op =3D CC_OP_DYNAMIC; dc->mem_idx =3D tb->flags & TB_FLAG_MMU_MASK; - dc->def =3D env->def; + dc->def =3D &env->def; dc->fpu_enabled =3D tb_fpu_enabled(tb->flags); dc->address_mask_32bit =3D tb_am_enabled(tb->flags); dc->singlestep =3D (cs->singlestep_enabled || singlestep); diff --git a/target/sparc/win_helper.c b/target/sparc/win_helper.c index 154279ecda..8290a21142 100644 --- a/target/sparc/win_helper.c +++ b/target/sparc/win_helper.c @@ -295,7 +295,7 @@ void helper_wrcwp(CPUSPARCState *env, target_ulong new_= cwp) =20 static inline uint64_t *get_gregset(CPUSPARCState *env, uint32_t pstate) { - if (env->def->features & CPU_FEATURE_GL) { + if (env->def.features & CPU_FEATURE_GL) { return env->glregs + (env->gl & 7) * 8; } =20 @@ -343,7 +343,7 @@ void cpu_change_pstate(CPUSPARCState *env, uint32_t new= _pstate) uint32_t pstate_regs, new_pstate_regs; uint64_t *src, *dst; =20 - if (env->def->features & CPU_FEATURE_GL) { + if (env->def.features & CPU_FEATURE_GL) { /* PS_AG, IG and MG are not implemented in this case */ new_pstate &=3D ~(PS_AG | PS_IG | PS_MG); env->pstate =3D new_pstate; --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504278723561196.0105544981344; Fri, 1 Sep 2017 08:12:03 -0700 (PDT) Received: from localhost ([::1]:45032 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnc2-0007eu-BP for importer@patchew.org; Fri, 01 Sep 2017 11:12:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnU5-0007z4-48 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnU0-0002xv-A7 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5187) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnU0-0002xf-0B for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:44 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DDC19369C4; Fri, 1 Sep 2017 15:03:42 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 26C77A63B6; Fri, 1 Sep 2017 15:03:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DDC19369C4 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:02:56 -0300 Message-Id: <20170901150317.10380-9-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 01 Sep 2017 15:03:43 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 08/29] sparc: convert cpu features to qdev properties 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov SPARC is the last target that uses legacy way of parsing and initializing cpu features, drop legacy approach and convert features to properties so that SPARC could as minimum benefit from generic cpu_generic_init(), common with x86 +-feat parser PS: the main purpose is to remove legacy way of cpu creation as a blocker for unifying cpu creation code across targets. Signed-off-by: Igor Mammedov Reviewed-by: Eduardo Habkost Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1503592308-93913-5-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/sparc/cpu.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 66 insertions(+) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 281a99f8dd..82ab5ad8d9 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -22,6 +22,8 @@ #include "cpu.h" #include "qemu/error-report.h" #include "exec/exec-all.h" +#include "hw/qdev-properties.h" +#include "qapi/visitor.h" =20 //#define DEBUG_FEATURES =20 @@ -852,6 +854,69 @@ static void sparc_cpu_initfn(Object *obj) } } =20 +static void sparc_get_nwindows(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + SPARCCPU *cpu =3D SPARC_CPU(obj); + int64_t value =3D cpu->env.def.nwindows; + + visit_type_int(v, name, &value, errp); +} + +static void sparc_set_nwindows(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + const int64_t min =3D MIN_NWINDOWS; + const int64_t max =3D MAX_NWINDOWS; + SPARCCPU *cpu =3D SPARC_CPU(obj); + Error *err =3D NULL; + int64_t value; + + visit_type_int(v, name, &value, &err); + if (err) { + error_propagate(errp, err); + return; + } + + if (value < min || value > max) { + error_setg(errp, "Property %s.%s doesn't take value %" PRId64 + " (minimum: %" PRId64 ", maximum: %" PRId64 ")", + object_get_typename(obj), name ? name : "null", + value, min, max); + return; + } + cpu->env.def.nwindows =3D value; +} + +static PropertyInfo qdev_prop_nwindows =3D { + .name =3D "int", + .get =3D sparc_get_nwindows, + .set =3D sparc_set_nwindows, +}; + +static Property sparc_cpu_properties[] =3D { + DEFINE_PROP_BIT("float", SPARCCPU, env.def.features, 0, false), + DEFINE_PROP_BIT("float128", SPARCCPU, env.def.features, 1, false), + DEFINE_PROP_BIT("swap", SPARCCPU, env.def.features, 2, false), + DEFINE_PROP_BIT("mul", SPARCCPU, env.def.features, 3, false), + DEFINE_PROP_BIT("div", SPARCCPU, env.def.features, 4, false), + DEFINE_PROP_BIT("flush", SPARCCPU, env.def.features, 5, false), + DEFINE_PROP_BIT("fsqrt", SPARCCPU, env.def.features, 6, false), + DEFINE_PROP_BIT("fmul", SPARCCPU, env.def.features, 7, false), + DEFINE_PROP_BIT("vis1", SPARCCPU, env.def.features, 8, false), + DEFINE_PROP_BIT("vis2", SPARCCPU, env.def.features, 9, false), + DEFINE_PROP_BIT("fsmuld", SPARCCPU, env.def.features, 10, false), + DEFINE_PROP_BIT("hypv", SPARCCPU, env.def.features, 11, false), + DEFINE_PROP_BIT("cmt", SPARCCPU, env.def.features, 12, false), + DEFINE_PROP_BIT("gl", SPARCCPU, env.def.features, 13, false), + DEFINE_PROP_UNSIGNED("iu-version", SPARCCPU, env.def.iu_version, 0, + qdev_prop_uint64, target_ulong), + DEFINE_PROP_UINT32("fpu-version", SPARCCPU, env.def.fpu_version, 0), + DEFINE_PROP_UINT32("mmu-version", SPARCCPU, env.def.mmu_version, 0), + { .name =3D "nwindows", .info =3D &qdev_prop_nwindows }, + DEFINE_PROP_END_OF_LIST() +}; + static void sparc_cpu_class_init(ObjectClass *oc, void *data) { SPARCCPUClass *scc =3D SPARC_CPU_CLASS(oc); @@ -860,6 +925,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void = *data) =20 scc->parent_realize =3D dc->realize; dc->realize =3D sparc_cpu_realizefn; + dc->props =3D sparc_cpu_properties; =20 scc->parent_reset =3D cc->reset; cc->reset =3D sparc_cpu_reset; --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504278881654347.0222451027297; Fri, 1 Sep 2017 08:14:41 -0700 (PDT) Received: from localhost ([::1]:45050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnneZ-0001WB-FD for importer@patchew.org; Fri, 01 Sep 2017 11:14:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnU3-0007y5-CH for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnTy-0002xF-Jp for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40961) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnTy-0002x2-CH for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:42 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2BB767DD08; Fri, 1 Sep 2017 15:03:40 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED5979615B; Fri, 1 Sep 2017 15:03:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2BB767DD08 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=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:02:57 -0300 Message-Id: <20170901150317.10380-10-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 01 Sep 2017 15:03:41 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 09/29] 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov SPARCCPU::env was initialized from previously 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1503592308-93913-6-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- 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 82ab5ad8d9..9dfc15007d 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 @@ -816,15 +802,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.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504279047519458.848421098568; Fri, 1 Sep 2017 08:17:27 -0700 (PDT) Received: from localhost ([::1]:45070 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnhG-0004H7-3o for importer@patchew.org; Fri, 01 Sep 2017 11:17:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnU5-0007zk-Jx for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnU0-0002y1-H5 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46262) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnU0-0002xj-8E for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:44 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ECF2E6524; Fri, 1 Sep 2017 15:03:42 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id BBCE27EBFB; Fri, 1 Sep 2017 15:03:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ECF2E6524 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:02:58 -0300 Message-Id: <20170901150317.10380-11-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 01 Sep 2017 15:03:43 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 10/29] sparc: make cpu feature parsing property based 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov with features converted to properties we can use the same approach as x86 for features parsing and drop legacy approach that manipulated CPU instance directly. New sparc_cpu_parse_features() will allow only +-feat and explicitly disable feat=3Don|off syntax for now. With that in place and sparc_cpu_parse_features() providing generic CPUClass::parse_features callback, the cpu_sparc_init() will do the same job as cpu_generic_init() so replace content of cpu_sparc_init() with it. Signed-off-by: Igor Mammedov Acked-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1503672460-109436-1-git-send-email-imammedo@redhat.com> Reviewed-by: Eduardo Habkost Signed-off-by: Eduardo Habkost --- target/sparc/cpu.c | 215 ++++++++++++++++++++-----------------------------= ---- 1 file changed, 82 insertions(+), 133 deletions(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 9dfc15007d..29296b2411 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -104,50 +104,99 @@ static void cpu_sparc_disas_set_info(CPUState *cpu, d= isassemble_info *info) #endif } =20 -static void sparc_cpu_parse_features(CPUState *cs, char *features, - Error **errp); +static void +cpu_add_feat_as_prop(const char *typename, const char *name, const char *v= al) +{ + GlobalProperty *prop =3D g_new0(typeof(*prop), 1); + prop->driver =3D typename; + prop->property =3D g_strdup(name); + prop->value =3D g_strdup(val); + prop->errp =3D &error_fatal; + qdev_prop_register_global(prop); +} =20 -static int cpu_sparc_register(SPARCCPU *cpu, const char *cpu_model) +/* Parse "+feature,-feature,feature=3Dfoo" CPU feature string */ +static void sparc_cpu_parse_features(const char *typename, char *features, + Error **errp) { - char *s =3D g_strdup(cpu_model); - char *featurestr =3D strtok(s, ","); - Error *err =3D NULL; + GList *l, *plus_features =3D NULL, *minus_features =3D NULL; + char *featurestr; /* Single 'key=3Dvalue" string being parsed */ + static bool cpu_globals_initialized; =20 - featurestr =3D strtok(NULL, ","); - sparc_cpu_parse_features(CPU(cpu), featurestr, &err); - g_free(s); - if (err) { - error_report_err(err); - return -1; + if (cpu_globals_initialized) { + return; } + cpu_globals_initialized =3D true; =20 - return 0; -} + if (!features) { + return; + } =20 -SPARCCPU *cpu_sparc_init(const char *cpu_model) -{ - SPARCCPU *cpu; - ObjectClass *oc; - char *str, *name; + for (featurestr =3D strtok(features, ","); + featurestr; + featurestr =3D strtok(NULL, ",")) { + const char *name; + const char *val =3D NULL; + char *eq =3D NULL; =20 - str =3D g_strdup(cpu_model); - name =3D strtok(str, ","); - oc =3D cpu_class_by_name(TYPE_SPARC_CPU, name); - g_free(str); - if (oc =3D=3D NULL) { - return NULL; - } + /* Compatibility syntax: */ + if (featurestr[0] =3D=3D '+') { + plus_features =3D g_list_append(plus_features, + g_strdup(featurestr + 1)); + continue; + } else if (featurestr[0] =3D=3D '-') { + minus_features =3D g_list_append(minus_features, + g_strdup(featurestr + 1)); + continue; + } =20 - cpu =3D SPARC_CPU(object_new(object_class_get_name(oc))); + eq =3D strchr(featurestr, '=3D'); + name =3D featurestr; + if (eq) { + *eq++ =3D 0; + val =3D eq; + + /* + * Temporarily, only +feat/-feat will be supported + * for boolean properties until we remove the + * minus-overrides-plus semantics and just follow + * the order options appear on the command-line. + * + * TODO: warn if user is relying on minus-override-plus semant= ics + * TODO: remove minus-override-plus semantics after + * warning for a few releases + */ + if (!strcasecmp(val, "on") || + !strcasecmp(val, "off") || + !strcasecmp(val, "true") || + !strcasecmp(val, "false")) { + error_setg(errp, "Boolean properties in format %s=3D%s" + " are not supported", name, val); + return; + } + } else { + error_setg(errp, "Unsupported property format: %s", name); + return; + } + cpu_add_feat_as_prop(typename, name, val); + } =20 - if (cpu_sparc_register(cpu, cpu_model) < 0) { - object_unref(OBJECT(cpu)); - return NULL; + for (l =3D plus_features; l; l =3D l->next) { + const char *name =3D l->data; + cpu_add_feat_as_prop(typename, name, "on"); } + g_list_free_full(plus_features, g_free); =20 - object_property_set_bool(OBJECT(cpu), true, "realized", NULL); + for (l =3D minus_features; l; l =3D l->next) { + const char *name =3D l->data; + cpu_add_feat_as_prop(typename, name, "off"); + } + g_list_free_full(minus_features, g_free); +} =20 - return cpu; +SPARCCPU *cpu_sparc_init(const char *cpu_model) +{ + return SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model)); } =20 void cpu_sparc_set_id(CPUSPARCState *env, unsigned int cpu) @@ -528,107 +577,6 @@ static void print_features(FILE *f, fprintf_function = cpu_fprintf, } } =20 -static void add_flagname_to_bitmaps(const char *flagname, uint32_t *featur= es) -{ - unsigned int i; - - for (i =3D 0; i < ARRAY_SIZE(feature_name); i++) { - if (feature_name[i] && !strcmp(flagname, feature_name[i])) { - *features |=3D 1 << i; - return; - } - } - error_report("CPU feature %s not found", flagname); -} - -static void sparc_cpu_parse_features(CPUState *cs, char *features, - Error **errp) -{ - SPARCCPU *cpu =3D SPARC_CPU(cs); - sparc_def_t *cpu_def =3D &cpu->env.def; - char *featurestr; - uint32_t plus_features =3D 0; - uint32_t minus_features =3D 0; - uint64_t iu_version; - uint32_t fpu_version, mmu_version, nwindows; - - featurestr =3D features ? strtok(features, ",") : NULL; - while (featurestr) { - char *val; - - if (featurestr[0] =3D=3D '+') { - add_flagname_to_bitmaps(featurestr + 1, &plus_features); - } else if (featurestr[0] =3D=3D '-') { - add_flagname_to_bitmaps(featurestr + 1, &minus_features); - } else if ((val =3D strchr(featurestr, '=3D'))) { - *val =3D 0; val++; - if (!strcmp(featurestr, "iu_version")) { - char *err; - - iu_version =3D strtoll(val, &err, 0); - if (!*val || *err) { - error_setg(errp, "bad numerical value %s", val); - return; - } - cpu_def->iu_version =3D iu_version; -#ifdef DEBUG_FEATURES - fprintf(stderr, "iu_version %" PRIx64 "\n", iu_version); -#endif - } else if (!strcmp(featurestr, "fpu_version")) { - char *err; - - fpu_version =3D strtol(val, &err, 0); - if (!*val || *err) { - error_setg(errp, "bad numerical value %s", val); - return; - } - cpu_def->fpu_version =3D fpu_version; -#ifdef DEBUG_FEATURES - fprintf(stderr, "fpu_version %x\n", fpu_version); -#endif - } else if (!strcmp(featurestr, "mmu_version")) { - char *err; - - mmu_version =3D strtol(val, &err, 0); - if (!*val || *err) { - error_setg(errp, "bad numerical value %s", val); - return; - } - cpu_def->mmu_version =3D mmu_version; -#ifdef DEBUG_FEATURES - fprintf(stderr, "mmu_version %x\n", mmu_version); -#endif - } else if (!strcmp(featurestr, "nwindows")) { - char *err; - - nwindows =3D strtol(val, &err, 0); - if (!*val || *err || nwindows > MAX_NWINDOWS || - nwindows < MIN_NWINDOWS) { - error_setg(errp, "bad numerical value %s", val); - return; - } - cpu_def->nwindows =3D nwindows; -#ifdef DEBUG_FEATURES - fprintf(stderr, "nwindows %d\n", nwindows); -#endif - } else { - error_setg(errp, "unrecognized feature %s", featurestr); - return; - } - } else { - error_setg(errp, "feature string `%s' not in format " - "(+feature|-feature|feature=3Dxyz)", features= tr); - return; - } - featurestr =3D strtok(NULL, ","); - } - cpu_def->features |=3D plus_features; - cpu_def->features &=3D ~minus_features; -#ifdef DEBUG_FEATURES - print_features(stderr, fprintf, cpu_def->features, NULL); -#endif -} - void sparc_cpu_list(FILE *f, fprintf_function cpu_fprintf) { unsigned int i; @@ -931,6 +879,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void = *data) cc->reset =3D sparc_cpu_reset; =20 cc->class_by_name =3D sparc_cpu_class_by_name; + cc->parse_features =3D sparc_cpu_parse_features; cc->has_work =3D sparc_cpu_has_work; cc->do_interrupt =3D sparc_cpu_do_interrupt; cc->cpu_exec_interrupt =3D sparc_cpu_exec_interrupt; --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504278822548662.8377664208168; Fri, 1 Sep 2017 08:13:42 -0700 (PDT) Received: from localhost ([::1]:45047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnndd-0000gA-Gu for importer@patchew.org; Fri, 01 Sep 2017 11:13:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnU6-00080c-JF for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnU1-0002ya-Tn for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45198) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnU1-0002yC-LI for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:45 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 867F23D3FA9; Fri, 1 Sep 2017 15:03:44 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id B39CD81F84; Fri, 1 Sep 2017 15:03:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 867F23D3FA9 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:02:59 -0300 Message-Id: <20170901150317.10380-12-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 01 Sep 2017 15:03:44 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 11/29] sparc: replace cpu_sparc_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov it's just a wrapper, drop it and use cpu_generic_init() directly Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1503592308-93913-8-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/sparc/cpu.h | 3 +-- hw/sparc/leon3.c | 2 +- hw/sparc/sun4m.c | 2 +- hw/sparc64/sparc64.c | 2 +- target/sparc/cpu.c | 5 ----- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 0e41916a52..b45cfb4708 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -579,7 +579,6 @@ void cpu_raise_exception_ra(CPUSPARCState *, int, uintp= tr_t) QEMU_NORETURN; =20 #ifndef NO_CPU_IO_DEFS /* cpu_init.c */ -SPARCCPU *cpu_sparc_init(const char *cpu_model); void cpu_sparc_set_id(CPUSPARCState *env, unsigned int cpu); void sparc_cpu_list(FILE *f, fprintf_function cpu_fprintf); /* mmu_helper.c */ @@ -656,7 +655,7 @@ hwaddr cpu_get_phys_page_nofault(CPUSPARCState *env, ta= rget_ulong addr, int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc); =20 #ifndef NO_CPU_IO_DEFS -#define cpu_init(cpu_model) CPU(cpu_sparc_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_SPARC_CPU, cpu_model) #endif =20 #define cpu_signal_handler cpu_sparc_signal_handler diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index d5ff188d9e..56512ecd00 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -126,7 +126,7 @@ static void leon3_generic_hw_init(MachineState *machine) cpu_model =3D "LEON3"; } =20 - cpu =3D cpu_sparc_init(cpu_model); + cpu =3D SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model)); if (cpu =3D=3D NULL) { fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n"); exit(1); diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 89dd8a96c3..cf47dca83a 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -797,7 +797,7 @@ static void cpu_devinit(const char *cpu_model, unsigned= int id, SPARCCPU *cpu; CPUSPARCState *env; =20 - cpu =3D cpu_sparc_init(cpu_model); + cpu =3D SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model)); if (cpu =3D=3D NULL) { fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n"); exit(1); diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index 4e4fdab065..ecf38a45da 100644 --- a/hw/sparc64/sparc64.c +++ b/hw/sparc64/sparc64.c @@ -353,7 +353,7 @@ SPARCCPU *sparc64_cpu_devinit(const char *cpu_model, if (cpu_model =3D=3D NULL) { cpu_model =3D default_cpu_model; } - cpu =3D cpu_sparc_init(cpu_model); + cpu =3D SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model)); if (cpu =3D=3D NULL) { fprintf(stderr, "Unable to find Sparc CPU definition\n"); exit(1); diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 29296b2411..0806d699e6 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -194,11 +194,6 @@ static void sparc_cpu_parse_features(const char *typen= ame, char *features, g_list_free_full(minus_features, g_free); } =20 -SPARCCPU *cpu_sparc_init(const char *cpu_model) -{ - return SPARC_CPU(cpu_generic_init(TYPE_SPARC_CPU, cpu_model)); -} - void cpu_sparc_set_id(CPUSPARCState *env, unsigned int cpu) { #if !defined(TARGET_SPARC64) --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504279231261461.32879254664545; Fri, 1 Sep 2017 08:20:31 -0700 (PDT) Received: from localhost ([::1]:45160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnkE-00079g-4Z for importer@patchew.org; Fri, 01 Sep 2017 11:20:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnU8-00082h-Bs for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnU3-0002zA-My for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33108) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnU3-0002yw-EP for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:47 -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 374797F41D; Fri, 1 Sep 2017 15:03:46 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85EBA78217; Fri, 1 Sep 2017 15:03:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 374797F41D Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:00 -0300 Message-Id: <20170901150317.10380-13-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@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.25]); Fri, 01 Sep 2017 15:03:46 +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] [PULL 12/29] s390x: replace cpu_s390x_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org 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" From: Igor Mammedov cpu_s390x_init() is used only *-user targets indirectly via cpu_init() macro and has a hack to assign ids to created cpus (I'm not sure if 'id' really matters to *-user emulation). So to on safe side, instead of having custom wrapper to do numbering replace it with cpu_generic_init() and use S390CPUClass::next_cpu_id which could serve the same purpose as static variable and move cpu->id initialization to s390_cpu_initfn for CONFIG_USER_ONLY use-case. PS: ifdef is ugly but it allows us to hide s390x detail that isn't set by *-user targets and reuse generic cpu creation utility for btoh machine and user emulation. Signed-off-by: Igor Mammedov Acked-by: Cornelia Huck Message-Id: <1504185578-80843-1-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/s390x/cpu.h | 3 +-- target/s390x/cpu.c | 7 +++++++ target/s390x/helper.c | 14 -------------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 4ec338077e..0bd97a5670 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -688,8 +688,7 @@ const char *s390_default_cpu_model_name(void); =20 =20 /* helper.c */ -S390CPU *cpu_s390x_init(const char *cpu_model); -#define cpu_init(model) CPU(cpu_s390x_init(model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_S390_CPU, cpu_model) S390CPU *s390x_new_cpu(const char *cpu_model, int64_t id, Error **errp); /* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 7267b60d41..74b3e4fd0d 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -306,6 +306,13 @@ static void s390_cpu_initfn(Object *obj) inited =3D true; s390x_translate_init(); } + +#if defined(CONFIG_USER_ONLY) + { + S390CPUClass *scc =3D S390_CPU_GET_CLASS(obj); + cpu->id =3D scc->next_cpu_id; + } +#endif } =20 static void s390_cpu_finalize(Object *obj) diff --git a/target/s390x/helper.c b/target/s390x/helper.c index 3adb9de122..ba29504476 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -129,20 +129,6 @@ out: return cpu; } =20 -S390CPU *cpu_s390x_init(const char *cpu_model) -{ - Error *err =3D NULL; - S390CPU *cpu; - /* Use to track CPU ID for linux-user only */ - static int64_t next_cpu_id; - - cpu =3D s390x_new_cpu(cpu_model, next_cpu_id++, &err); - if (err) { - error_report_err(err); - } - return cpu; -} - #ifndef CONFIG_USER_ONLY =20 hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr) --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504278670768775.9325397753548; Fri, 1 Sep 2017 08:11:10 -0700 (PDT) Received: from localhost ([::1]:45027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnbB-0006hR-Lf for importer@patchew.org; Fri, 01 Sep 2017 11:11:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUB-00086Q-0h for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnU5-0002zo-SH for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35922) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnU5-0002zZ-Ip for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:49 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C7757EBDB; Fri, 1 Sep 2017 15:03:48 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F9427ADCC; Fri, 1 Sep 2017 15:03:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5C7757EBDB 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=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:01 -0300 Message-Id: <20170901150317.10380-14-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 01 Sep 2017 15:03:48 +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] [PULL 13/29] alpha: replace cpu_alpha_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org 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" From: Igor Mammedov cpu_alpha_init() used to provide default fallback if invalid (i.e. non existent) cpu_model were provided. dp264 machine provides its own default so sole user of fallback is [bsd|linux]-user targets which specifies 'any' cpu model that fallbacks to "ev67" in cpu_alpha_init(). Push fallback handling into alpha_cpu_class_by_name() and replace cpu_alpha_init() with cpu_generic_init(). Signed-off-by: Igor Mammedov Acked-by: Richard Henderson Message-Id: <1503592308-93913-10-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/alpha/cpu.h | 4 +--- hw/alpha/dp264.c | 8 ++++++-- target/alpha/cpu.c | 20 +++++--------------- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index e95be2b34b..0738e97d6d 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -468,9 +468,7 @@ enum { =20 void alpha_translate_init(void); =20 -AlphaCPU *cpu_alpha_init(const char *cpu_model); - -#define cpu_init(cpu_model) CPU(cpu_alpha_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_ALPHA_CPU, cpu_model) =20 void alpha_cpu_list(FILE *f, fprintf_function cpu_fprintf); /* you can call this signal handler from your SIGBUS and SIGSEGV diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 3b307ad873..1c5a177102 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -51,7 +51,7 @@ static int clipper_pci_map_irq(PCIDevice *d, int irq_num) static void clipper_init(MachineState *machine) { ram_addr_t ram_size =3D machine->ram_size; - const char *cpu_model =3D machine->cpu_model; + const char *cpu_model =3D machine->cpu_model ? machine->cpu_model : "e= v67"; const char *kernel_filename =3D machine->kernel_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; const char *initrd_filename =3D machine->initrd_filename; @@ -67,7 +67,11 @@ static void clipper_init(MachineState *machine) /* Create up to 4 cpus. */ memset(cpus, 0, sizeof(cpus)); for (i =3D 0; i < smp_cpus; ++i) { - cpus[i] =3D cpu_alpha_init(cpu_model ? cpu_model : "ev67"); + cpus[i] =3D ALPHA_CPU(cpu_generic_init(TYPE_ALPHA_CPU, cpu_model)); + if (!cpus[i]) { + error_report("Unable to find CPU definition"); + exit(1); + } } =20 cpus[0]->env.trap_arg0 =3D ram_size; diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 76150f48d3..1ea597b9dd 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -155,24 +155,14 @@ static ObjectClass *alpha_cpu_class_by_name(const cha= r *cpu_model) if (oc !=3D NULL && object_class_is_abstract(oc)) { oc =3D NULL; } - return oc; -} - -AlphaCPU *cpu_alpha_init(const char *cpu_model) -{ - AlphaCPU *cpu; - ObjectClass *cpu_class; =20 - cpu_class =3D alpha_cpu_class_by_name(cpu_model); - if (cpu_class =3D=3D NULL) { - /* Default to ev67; no reason not to emulate insns by default. */ - cpu_class =3D object_class_by_name(TYPE("ev67")); + /* TODO: remove match everything nonsense */ + /* Default to ev67; no reason not to emulate insns by default. */ + if (!oc) { + oc =3D object_class_by_name(TYPE("ev67")); } - cpu =3D ALPHA_CPU(object_new(object_class_get_name(cpu_class))); - - object_property_set_bool(OBJECT(cpu), true, "realized", NULL); =20 - return cpu; + return oc; } =20 static void ev4_cpu_initfn(Object *obj) --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504278626600450.44064412713396; Fri, 1 Sep 2017 08:10:26 -0700 (PDT) Received: from localhost ([::1]:45019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnaT-0005kX-Af for importer@patchew.org; Fri, 01 Sep 2017 11:10:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUA-00085h-JT for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnU7-000309-Eh for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33228) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnU7-0002zv-9G for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:51 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 06C437AEBE; Fri, 1 Sep 2017 15:03:50 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 213F77B154; Fri, 1 Sep 2017 15:03:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 06C437AEBE Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:02 -0300 Message-Id: <20170901150317.10380-15-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 01 Sep 2017 15:03:50 +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] [PULL 14/29] hppa: replace cpu_hppa_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org 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" From: Igor Mammedov drop custom cpu_hppa_init() in favor of cpu_generic_init(), to make cpu_generic_init() work all we need is to provide cc->class_by_name callback that would resolve any cpu_model to the sole TYPE_HPPA_CPU to match current behaviour. Signed-off-by: Igor Mammedov Acked-by: Richard Henderson Message-Id: <1503592308-93913-11-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/hppa/cpu.h | 4 +--- target/hppa/cpu.c | 11 +++-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 4cf4ac65e3..8d14077763 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -112,9 +112,7 @@ static inline int cpu_mmu_index(CPUHPPAState *env, bool= ifetch) =20 void hppa_translate_init(void); =20 -HPPACPU *cpu_hppa_init(const char *cpu_model); - -#define cpu_init(cpu_model) CPU(cpu_hppa_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_HPPA_CPU, cpu_model) =20 void hppa_cpu_list(FILE *f, fprintf_function cpu_fprintf); =20 diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 30299e990d..a477b452f0 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -112,15 +112,9 @@ static void hppa_cpu_initfn(Object *obj) hppa_translate_init(); } =20 -HPPACPU *cpu_hppa_init(const char *cpu_model) +static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model) { - HPPACPU *cpu; - - cpu =3D HPPA_CPU(object_new(TYPE_HPPA_CPU)); - - object_property_set_bool(OBJECT(cpu), true, "realized", NULL); - - return cpu; + return object_class_by_name(TYPE_HPPA_CPU); } =20 static void hppa_cpu_class_init(ObjectClass *oc, void *data) @@ -132,6 +126,7 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *= data) acc->parent_realize =3D dc->realize; dc->realize =3D hppa_cpu_realizefn; =20 + cc->class_by_name =3D hppa_cpu_class_by_name; cc->do_interrupt =3D hppa_cpu_do_interrupt; cc->cpu_exec_interrupt =3D hppa_cpu_exec_interrupt; cc->dump_state =3D hppa_cpu_dump_state; --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504279409536795.161710433415; Fri, 1 Sep 2017 08:23:29 -0700 (PDT) Received: from localhost ([::1]:45345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnn6-00021D-Bd for importer@patchew.org; Fri, 01 Sep 2017 11:23:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUH-0008Bv-8d for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnU9-00030Z-8J for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46580) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnU8-00030L-VY for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:53 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DC86561B92; Fri, 1 Sep 2017 15:03:51 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id E46461965D; Fri, 1 Sep 2017 15:03:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DC86561B92 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:03 -0300 Message-Id: <20170901150317.10380-16-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 01 Sep 2017 15:03:52 +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] [PULL 15/29] m68k: replace cpu_m68k_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org 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" From: Igor Mammedov call register_m68k_insns() at realize time which makes cpu_m68k_init() typical object creation function. As result we can replace it with cpu_generic_init() which does the same job, reducing code duplication a bit. Signed-off-by: Igor Mammedov Tested-by: Thomas Huth Acked-by: Laurent Vivier Message-Id: <1503592308-93913-12-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/m68k/cpu.h | 3 +-- hw/m68k/an5206.c | 2 +- hw/m68k/mcf5208.c | 2 +- target/m68k/cpu.c | 2 ++ target/m68k/helper.c | 20 -------------------- 5 files changed, 5 insertions(+), 24 deletions(-) diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index 38a7e11b92..d9365476e5 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -163,7 +163,6 @@ int m68k_cpu_gdb_write_register(CPUState *cpu, uint8_t = *buf, int reg); =20 void m68k_tcg_init(void); void m68k_cpu_init_gdb(M68kCPU *cpu); -M68kCPU *cpu_m68k_init(const char *cpu_model); /* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */ @@ -322,7 +321,7 @@ void register_m68k_insns (CPUM68KState *env); #define TARGET_PHYS_ADDR_SPACE_BITS 32 #define TARGET_VIRT_ADDR_SPACE_BITS 32 =20 -#define cpu_init(cpu_model) CPU(cpu_m68k_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_M68K_CPU, cpu_model) =20 #define cpu_signal_handler cpu_m68k_signal_handler #define cpu_list m68k_cpu_list diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c index c76244176f..7b9b15d6c4 100644 --- a/hw/m68k/an5206.c +++ b/hw/m68k/an5206.c @@ -42,7 +42,7 @@ static void an5206_init(MachineState *machine) if (!cpu_model) { cpu_model =3D "m5206"; } - cpu =3D cpu_m68k_init(cpu_model); + cpu =3D M68K_CPU(cpu_generic_init(TYPE_M68K_CPU, cpu_model)); if (!cpu) { error_report("Unable to find m68k CPU definition"); exit(1); diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index f4b1387c0d..1a0f18073a 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -232,7 +232,7 @@ static void mcf5208evb_init(MachineState *machine) if (!cpu_model) { cpu_model =3D "m5208"; } - cpu =3D cpu_m68k_init(cpu_model); + cpu =3D M68K_CPU(cpu_generic_init(TYPE_M68K_CPU, cpu_model)); if (!cpu) { fprintf(stderr, "Unable to find m68k CPU definition\n"); exit(1); diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index a14b6dda7f..55bf24bae6 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -230,6 +230,8 @@ static void m68k_cpu_realizefn(DeviceState *dev, Error = **errp) M68kCPUClass *mcc =3D M68K_CPU_GET_CLASS(dev); Error *local_err =3D NULL; =20 + register_m68k_insns(&cpu->env); + cpu_exec_realizefn(cs, &local_err); if (local_err !=3D NULL) { error_propagate(errp, local_err); diff --git a/target/m68k/helper.c b/target/m68k/helper.c index caae29100c..7e50ff5871 100644 --- a/target/m68k/helper.c +++ b/target/m68k/helper.c @@ -156,26 +156,6 @@ static int m68k_fpu_gdb_set_reg(CPUM68KState *env, uin= t8_t *mem_buf, int n) return 0; } =20 -M68kCPU *cpu_m68k_init(const char *cpu_model) -{ - M68kCPU *cpu; - CPUM68KState *env; - ObjectClass *oc; - - oc =3D cpu_class_by_name(TYPE_M68K_CPU, cpu_model); - if (oc =3D=3D NULL) { - return NULL; - } - cpu =3D M68K_CPU(object_new(object_class_get_name(oc))); - env =3D &cpu->env; - - register_m68k_insns(env); - - object_property_set_bool(OBJECT(cpu), true, "realized", NULL); - - return cpu; -} - void m68k_cpu_init_gdb(M68kCPU *cpu) { CPUState *cs =3D CPU(cpu); --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504279681441146.25909800430838; Fri, 1 Sep 2017 08:28:01 -0700 (PDT) Received: from localhost ([::1]:45550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnrU-00060q-Bq for importer@patchew.org; Fri, 01 Sep 2017 11:28:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUG-0008Aj-5T for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnUB-00031I-E6 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43166) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnUB-00030s-63 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:55 -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 04735C05678D; Fri, 1 Sep 2017 15:03:54 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id B229A78348; Fri, 1 Sep 2017 15:03:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 04735C05678D Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:04 -0300 Message-Id: <20170901150317.10380-17-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> MIME-Version: 1.0 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.32]); Fri, 01 Sep 2017 15:03:54 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 16/29] microblaze: replace cpu_mb_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov cpu_mb_init() always falls back to TYPE_MICROBLAZE_CPU object regardless of cpu_model. Put fallback logic into mb_cpu_class_by_name() which would translate any cpu_model into TYPE_MICROBLAZE_CPU class and replace cpu_mb_init() with cpu_generic_init(). Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1503592308-93913-13-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/microblaze/cpu.h | 3 +-- target/microblaze/cpu.c | 6 ++++++ target/microblaze/translate.c | 11 ----------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 5ce4c82657..52b6b6aec7 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -331,7 +331,6 @@ int mb_cpu_gdb_read_register(CPUState *cpu, uint8_t *bu= f, int reg); int mb_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); =20 void mb_tcg_init(void); -MicroBlazeCPU *cpu_mb_init(const char *cpu_model); /* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */ @@ -344,7 +343,7 @@ int cpu_mb_signal_handler(int host_signum, void *pinfo, #define TARGET_PHYS_ADDR_SPACE_BITS 32 #define TARGET_VIRT_ADDR_SPACE_BITS 32 =20 -#define cpu_init(cpu_model) CPU(cpu_mb_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_MICROBLAZE_CPU, cpu_mode= l) =20 #define cpu_signal_handler cpu_mb_signal_handler =20 diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index f85ff01b39..ddffe86e9b 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -253,6 +253,11 @@ static Property mb_properties[] =3D { DEFINE_PROP_END_OF_LIST(), }; =20 +static ObjectClass *mb_cpu_class_by_name(const char *cpu_model) +{ + return object_class_by_name(TYPE_MICROBLAZE_CPU); +} + static void mb_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc =3D DEVICE_CLASS(oc); @@ -265,6 +270,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *da= ta) mcc->parent_reset =3D cc->reset; cc->reset =3D mb_cpu_reset; =20 + cc->class_by_name =3D mb_cpu_class_by_name; cc->has_work =3D mb_cpu_has_work; cc->do_interrupt =3D mb_cpu_do_interrupt; cc->cpu_exec_interrupt =3D mb_cpu_exec_interrupt; diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index a24373c0be..83e2ef4960 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1845,17 +1845,6 @@ void mb_cpu_dump_state(CPUState *cs, FILE *f, fprint= f_function cpu_fprintf, cpu_fprintf(f, "\n\n"); } =20 -MicroBlazeCPU *cpu_mb_init(const char *cpu_model) -{ - MicroBlazeCPU *cpu; - - cpu =3D MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); - - object_property_set_bool(OBJECT(cpu), true, "realized", NULL); - - return cpu; -} - void mb_tcg_init(void) { int i; --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504279547805605.5554730357859; Fri, 1 Sep 2017 08:25:47 -0700 (PDT) Received: from localhost ([::1]:45434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnpK-000489-R5 for importer@patchew.org; Fri, 01 Sep 2017 11:25:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUH-0008CG-PH for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnUC-00032m-Sh for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36724) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnUC-00031S-K5 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:03:56 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 609CFC0467D8; Fri, 1 Sep 2017 15:03:55 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8487C7BB51; Fri, 1 Sep 2017 15:03:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 609CFC0467D8 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:05 -0300 Message-Id: <20170901150317.10380-18-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 01 Sep 2017 15:03:55 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 17/29] nios2: replace cpu_nios2_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov cpu_nios2_init() always falls back to TYPE_NIOS2_CPU object regardless of cpu_model. Put fallback logic into nios2_cpu_class_by_name() which would translate any cpu_model into TYPE_NIOS2_CPU class and replace cpu_nios2_init() with cpu_generic_init() Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1503592308-93913-14-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/nios2/cpu.h | 3 +-- hw/nios2/10m50_devboard.c | 2 +- target/nios2/cpu.c | 9 +++------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 13931f3f0b..50d803a217 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -212,7 +212,6 @@ static inline Nios2CPU *nios2_env_get_cpu(CPUNios2State= *env) #define ENV_OFFSET offsetof(Nios2CPU, env) =20 void nios2_tcg_init(void); -Nios2CPU *cpu_nios2_init(const char *cpu_model); void nios2_cpu_do_interrupt(CPUState *cs); int cpu_nios2_signal_handler(int host_signum, void *pinfo, void *puc); void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUNios2State *env); @@ -229,7 +228,7 @@ void nios2_check_interrupts(CPUNios2State *env); #define TARGET_PHYS_ADDR_SPACE_BITS 32 #define TARGET_VIRT_ADDR_SPACE_BITS 32 =20 -#define cpu_init(cpu_model) CPU(cpu_nios2_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_NIOS2_CPU, cpu_model) =20 #define cpu_gen_code cpu_nios2_gen_code #define cpu_signal_handler cpu_nios2_signal_handler diff --git a/hw/nios2/10m50_devboard.c b/hw/nios2/10m50_devboard.c index b6868b8233..e4007f6d7f 100644 --- a/hw/nios2/10m50_devboard.c +++ b/hw/nios2/10m50_devboard.c @@ -75,7 +75,7 @@ static void nios2_10m50_ghrd_init(MachineState *machine) phys_ram_alias); =20 /* Create CPU -- FIXME */ - cpu =3D cpu_nios2_init("nios2"); + cpu =3D NIOS2_CPU(cpu_generic_init(TYPE_NIOS2_CPU, "nios2")); =20 /* Register: CPU interrupt controller (PIC) */ cpu_irq =3D nios2_cpu_pic_init(cpu); diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index d56bb7245a..5b02fb67ea 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -83,13 +83,9 @@ static void nios2_cpu_initfn(Object *obj) } } =20 -Nios2CPU *cpu_nios2_init(const char *cpu_model) +static ObjectClass *nios2_cpu_class_by_name(const char *cpu_model) { - Nios2CPU *cpu =3D NIOS2_CPU(object_new(TYPE_NIOS2_CPU)); - - object_property_set_bool(OBJECT(cpu), true, "realized", NULL); - - return cpu; + return object_class_by_name(TYPE_NIOS2_CPU); } =20 static void nios2_cpu_realizefn(DeviceState *dev, Error **errp) @@ -203,6 +199,7 @@ static void nios2_cpu_class_init(ObjectClass *oc, void = *data) ncc->parent_reset =3D cc->reset; cc->reset =3D nios2_cpu_reset; =20 + cc->class_by_name =3D nios2_cpu_class_by_name; cc->has_work =3D nios2_cpu_has_work; cc->do_interrupt =3D nios2_cpu_do_interrupt; cc->cpu_exec_interrupt =3D nios2_cpu_exec_interrupt; --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504279161743536.9441223439939; Fri, 1 Sep 2017 08:19:21 -0700 (PDT) Received: from localhost ([::1]:45157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnj6-00067s-Ky for importer@patchew.org; Fri, 01 Sep 2017 11:19:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUW-0008Tr-RS for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnUP-00037X-3J for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44706) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnUO-00037L-UH for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E196CC056819; Fri, 1 Sep 2017 15:04:07 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E64B6E8E5; Fri, 1 Sep 2017 15:03:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E196CC056819 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:06 -0300 Message-Id: <20170901150317.10380-19-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 01 Sep 2017 15:04:08 +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] [PULL 18/29] tilegx: replace cpu_tilegx_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org 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" From: Igor Mammedov cpu_tilegx_init() always falls back to TYPE_TILEGX_CPU object regardless of cpu_model. Put fallback logic into tilegx_cpu_class_by_name() which would translate any cpu_model into TYPE_TILEGX_CPU class and replace cpu_tilegx_init() with cpu_generic_init(). Signed-off-by: Igor Mammedov Reviewed-by: Eduardo Habkost Message-Id: <1503592308-93913-15-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/tilegx/cpu.h | 4 +--- target/tilegx/cpu.c | 11 +++-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/target/tilegx/cpu.h b/target/tilegx/cpu.h index f32be49f65..71cea04589 100644 --- a/target/tilegx/cpu.h +++ b/target/tilegx/cpu.h @@ -164,9 +164,7 @@ static inline TileGXCPU *tilegx_env_get_cpu(CPUTLGState= *env) void tilegx_tcg_init(void); int cpu_tilegx_signal_handler(int host_signum, void *pinfo, void *puc); =20 -TileGXCPU *cpu_tilegx_init(const char *cpu_model); - -#define cpu_init(cpu_model) CPU(cpu_tilegx_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_TILEGX_CPU, cpu_model) =20 #define cpu_signal_handler cpu_tilegx_signal_handler =20 diff --git a/target/tilegx/cpu.c b/target/tilegx/cpu.c index 45326398cc..7345f5a8b5 100644 --- a/target/tilegx/cpu.c +++ b/target/tilegx/cpu.c @@ -52,15 +52,9 @@ static void tilegx_cpu_dump_state(CPUState *cs, FILE *f, env->pc, env->spregs[TILEGX_SPR_CMPEXCH]); } =20 -TileGXCPU *cpu_tilegx_init(const char *cpu_model) +static ObjectClass *tilegx_cpu_class_by_name(const char *cpu_model) { - TileGXCPU *cpu; - - cpu =3D TILEGX_CPU(object_new(TYPE_TILEGX_CPU)); - - object_property_set_bool(OBJECT(cpu), true, "realized", NULL); - - return cpu; + return object_class_by_name(TYPE_TILEGX_CPU); } =20 static void tilegx_cpu_set_pc(CPUState *cs, vaddr value) @@ -159,6 +153,7 @@ static void tilegx_cpu_class_init(ObjectClass *oc, void= *data) tcc->parent_reset =3D cc->reset; cc->reset =3D tilegx_cpu_reset; =20 + cc->class_by_name =3D tilegx_cpu_class_by_name; cc->has_work =3D tilegx_cpu_has_work; cc->do_interrupt =3D tilegx_cpu_do_interrupt; cc->cpu_exec_interrupt =3D tilegx_cpu_exec_interrupt; --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 150427898131945.26383342748852; Fri, 1 Sep 2017 08:16:21 -0700 (PDT) Received: from localhost ([::1]:45065 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnngB-0003Dh-R4 for importer@patchew.org; Fri, 01 Sep 2017 11:16:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUV-0008Sv-Oo for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnUQ-000386-T4 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37582) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnUQ-00037r-Kn for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:10 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B4FBDC04D28D; Fri, 1 Sep 2017 15:04:09 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4674866840; Fri, 1 Sep 2017 15:04:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B4FBDC04D28D Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:07 -0300 Message-Id: <20170901150317.10380-20-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 01 Sep 2017 15:04:09 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 19/29] xtensa: replace cpu_xtensa_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov call xtensa_irq_init() at realize time which makes cpu_xtensa_init() like generic cpu creation function. As result we can replace it with cpu_generic_init() which does the same job, reducing code duplication a bit. Signed-off-by: Igor Mammedov Reviewed-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1503592308-93913-16-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/xtensa/cpu.h | 4 +--- hw/xtensa/sim.c | 2 +- hw/xtensa/xtfpga.c | 2 +- target/xtensa/cpu.c | 3 +++ target/xtensa/helper.c | 22 ---------------------- 5 files changed, 6 insertions(+), 27 deletions(-) diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index ee29fb1a14..48033313c5 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -475,9 +475,7 @@ void xtensa_cpu_do_unaligned_access(CPUState *cpu, vadd= r addr, #define XTENSA_DEFAULT_CPU_MODEL "dc232b" #endif =20 -XtensaCPU *cpu_xtensa_init(const char *cpu_model); - -#define cpu_init(cpu_model) CPU(cpu_xtensa_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_XTENSA_CPU, cpu_model) =20 void xtensa_translate_init(void); void xtensa_breakpoint_handler(CPUState *cs); diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c index 249cd1e8c9..1b4767f58b 100644 --- a/hw/xtensa/sim.c +++ b/hw/xtensa/sim.c @@ -84,7 +84,7 @@ static void xtensa_sim_init(MachineState *machine) } =20 for (n =3D 0; n < smp_cpus; n++) { - cpu =3D cpu_xtensa_init(cpu_model); + cpu =3D XTENSA_CPU(cpu_generic_init(TYPE_XTENSA_CPU, cpu_model)); if (cpu =3D=3D NULL) { error_report("unable to find CPU definition '%s'", cpu_model); diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 635a4d4ec3..182ec1e31c 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -232,7 +232,7 @@ static void lx_init(const LxBoardDesc *board, MachineSt= ate *machine) } =20 for (n =3D 0; n < smp_cpus; n++) { - cpu =3D cpu_xtensa_init(cpu_model); + cpu =3D XTENSA_CPU(cpu_generic_init(TYPE_XTENSA_CPU, cpu_model)); if (cpu =3D=3D NULL) { error_report("unable to find CPU definition '%s'", cpu_model); diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index cd7f95823f..85897df0a8 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -100,9 +100,12 @@ static ObjectClass *xtensa_cpu_class_by_name(const cha= r *cpu_model) static void xtensa_cpu_realizefn(DeviceState *dev, Error **errp) { CPUState *cs =3D CPU(dev); + XtensaCPU *cpu =3D XTENSA_CPU(dev); XtensaCPUClass *xcc =3D XTENSA_CPU_GET_CLASS(dev); Error *local_err =3D NULL; =20 + xtensa_irq_init(&cpu->env); + cpu_exec_realizefn(cs, &local_err); if (local_err !=3D NULL) { error_propagate(errp, local_err); diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index bcd0b7738d..e8fba20918 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -113,28 +113,6 @@ void xtensa_breakpoint_handler(CPUState *cs) } } =20 -XtensaCPU *cpu_xtensa_init(const char *cpu_model) -{ - ObjectClass *oc; - XtensaCPU *cpu; - CPUXtensaState *env; - - oc =3D cpu_class_by_name(TYPE_XTENSA_CPU, cpu_model); - if (oc =3D=3D NULL) { - return NULL; - } - - cpu =3D XTENSA_CPU(object_new(object_class_get_name(oc))); - env =3D &cpu->env; - - xtensa_irq_init(env); - - object_property_set_bool(OBJECT(cpu), true, "realized", NULL); - - return cpu; -} - - void xtensa_cpu_list(FILE *f, fprintf_function cpu_fprintf) { XtensaConfigList *core =3D xtensa_cores; --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 15042787824350.18573024374450142; Fri, 1 Sep 2017 08:13:02 -0700 (PDT) Received: from localhost ([::1]:45044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnncz-0008Vn-Dl for importer@patchew.org; Fri, 01 Sep 2017 11:13:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUT-0008Qv-Sz for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnUS-00038W-KF for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51690) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnUS-00038L-EB for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:12 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7D5D7552D1; Fri, 1 Sep 2017 15:04:11 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16D476A57B; Fri, 1 Sep 2017 15:04:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7D5D7552D1 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:08 -0300 Message-Id: <20170901150317.10380-21-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 01 Sep 2017 15:04:11 +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] [PULL 20/29] tricore: replace cpu_tricore_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org 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" From: Igor Mammedov it's just a wrapper, drop it and use cpu_generic_init() directly Signed-off-by: Igor Mammedov Reviewed-by: Eduardo Habkost Message-Id: <1503592308-93913-17-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/tricore/cpu.h | 4 +--- hw/tricore/tricore_testboard.c | 2 +- target/tricore/helper.c | 5 ----- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h index a3493a123c..bc53c40774 100644 --- a/target/tricore/cpu.h +++ b/target/tricore/cpu.h @@ -411,9 +411,7 @@ static inline void cpu_get_tb_cpu_state(CPUTriCoreState= *env, target_ulong *pc, *flags =3D 0; } =20 -TriCoreCPU *cpu_tricore_init(const char *cpu_model); - -#define cpu_init(cpu_model) CPU(cpu_tricore_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_TRICORE_CPU, cpu_model) =20 =20 /* helpers.c */ diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c index 6c574231d5..3fcd8bb70e 100644 --- a/hw/tricore/tricore_testboard.c +++ b/hw/tricore/tricore_testboard.c @@ -74,7 +74,7 @@ static void tricore_testboard_init(MachineState *machine,= int board_id) if (!machine->cpu_model) { machine->cpu_model =3D "tc1796"; } - cpu =3D cpu_tricore_init(machine->cpu_model); + cpu =3D TRICORE_CPU(cpu_generic_init(TYPE_TRICORE_CPU, machine->cpu_mo= del)); if (!cpu) { error_report("Unable to find CPU definition"); exit(1); diff --git a/target/tricore/helper.c b/target/tricore/helper.c index 3118905eca..378c2a4a76 100644 --- a/target/tricore/helper.c +++ b/target/tricore/helper.c @@ -78,11 +78,6 @@ int cpu_tricore_handle_mmu_fault(CPUState *cs, target_ul= ong address, return ret; } =20 -TriCoreCPU *cpu_tricore_init(const char *cpu_model) -{ - return TRICORE_CPU(cpu_generic_init(TYPE_TRICORE_CPU, cpu_model)); -} - static void tricore_cpu_list_entry(gpointer data, gpointer user_data) { ObjectClass *oc =3D data; --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 150427893833916.718311063063766; Fri, 1 Sep 2017 08:15:38 -0700 (PDT) Received: from localhost ([::1]:45063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnfV-0002V8-6y for importer@patchew.org; Fri, 01 Sep 2017 11:15:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUc-00005A-9B for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnUU-000397-H8 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37518) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnUU-00038n-9X for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:14 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F91C7F7B0; Fri, 1 Sep 2017 15:04:13 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC2477BB5A; Fri, 1 Sep 2017 15:04:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4F91C7F7B0 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:09 -0300 Message-Id: <20170901150317.10380-22-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 01 Sep 2017 15:04:13 +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] [PULL 21/29] sh4: replace cpu_sh4_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org 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" From: Igor Mammedov it's just a wrapper, drop it and use cpu_generic_init() directly Signed-off-by: Igor Mammedov Reviewed-by: Eduardo Habkost Message-Id: <1503592308-93913-18-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/sh4/cpu.h | 3 +-- hw/sh4/r2d.c | 2 +- hw/sh4/shix.c | 2 +- target/sh4/cpu.c | 5 ----- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 3c47f0de89..79f85d3365 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -238,7 +238,6 @@ void superh_cpu_do_unaligned_access(CPUState *cpu, vadd= r addr, int mmu_idx, uintptr_t retaddr); =20 void sh4_translate_init(void); -SuperHCPU *cpu_sh4_init(const char *cpu_model); int cpu_sh4_signal_handler(int host_signum, void *pinfo, void *puc); int superh_cpu_handle_mmu_fault(CPUState *cpu, vaddr address, int rw, @@ -269,7 +268,7 @@ int cpu_sh4_is_cached(CPUSH4State * env, target_ulong a= ddr); =20 void cpu_load_tlb(CPUSH4State * env); =20 -#define cpu_init(cpu_model) CPU(cpu_sh4_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_SUPERH_CPU, cpu_model) =20 #define cpu_signal_handler cpu_sh4_signal_handler #define cpu_list sh4_cpu_list diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index a0462adb97..22bc534e5f 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -246,7 +246,7 @@ static void r2d_init(MachineState *machine) cpu_model =3D "SH7751R"; } =20 - cpu =3D cpu_sh4_init(cpu_model); + cpu =3D SUPERH_CPU(cpu_generic_init(TYPE_SUPERH_CPU, cpu_model)); if (cpu =3D=3D NULL) { fprintf(stderr, "Unable to find CPU definition\n"); exit(1); diff --git a/hw/sh4/shix.c b/hw/sh4/shix.c index e22eaf0c8f..7f8a4b6484 100644 --- a/hw/sh4/shix.c +++ b/hw/sh4/shix.c @@ -56,7 +56,7 @@ static void shix_init(MachineState *machine) if (!cpu_model) cpu_model =3D "any"; =20 - cpu =3D cpu_sh4_init(cpu_model); + cpu =3D SUPERH_CPU(cpu_generic_init(TYPE_SUPERH_CPU, cpu_model)); if (cpu =3D=3D NULL) { fprintf(stderr, "Unable to find CPU definition\n"); exit(1); diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 8536f6d002..6ce7cba5a9 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -156,11 +156,6 @@ static ObjectClass *superh_cpu_class_by_name(const cha= r *cpu_model) return oc; } =20 -SuperHCPU *cpu_sh4_init(const char *cpu_model) -{ - return SUPERH_CPU(cpu_generic_init(TYPE_SUPERH_CPU, cpu_model)); -} - static void sh7750r_cpu_initfn(Object *obj) { SuperHCPU *cpu =3D SUPERH_CPU(obj); --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 150427995716219.937986130640866; Fri, 1 Sep 2017 08:32:37 -0700 (PDT) Received: from localhost ([::1]:45779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnvv-0001XW-TN for importer@patchew.org; Fri, 01 Sep 2017 11:32:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUg-0000Az-OY for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnUW-00039e-Py for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6650) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnUW-00039Q-Hc for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:16 -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 90551155E0; Fri, 1 Sep 2017 15:04:15 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA2E07821A; Fri, 1 Sep 2017 15:04:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 90551155E0 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:10 -0300 Message-Id: <20170901150317.10380-23-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> MIME-Version: 1.0 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.29]); Fri, 01 Sep 2017 15:04:15 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 22/29] arm: replace cpu_arm_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov it's just a wrapper, drop it and use cpu_generic_init() directly Signed-off-by: Igor Mammedov Reviewed-by: Andrew Jones Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1503592308-93913-19-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/arm/cpu.h | 3 +-- hw/arm/musicpal.c | 2 +- hw/arm/omap1.c | 2 +- hw/arm/omap2.c | 2 +- hw/arm/pxa2xx.c | 4 ++-- hw/arm/strongarm.c | 2 +- target/arm/helper.c | 5 ----- 7 files changed, 7 insertions(+), 13 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index b39d64aa0b..5932ef1e22 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -748,7 +748,6 @@ int aarch64_cpu_gdb_read_register(CPUState *cpu, uint8_= t *buf, int reg); int aarch64_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); #endif =20 -ARMCPU *cpu_arm_init(const char *cpu_model); target_ulong do_arm_semihosting(CPUARMState *env); void aarch64_sync_32_to_64(CPUARMState *env); void aarch64_sync_64_to_32(CPUARMState *env); @@ -2001,7 +2000,7 @@ static inline bool arm_excp_unmasked(CPUState *cs, un= signed int excp_idx, return unmasked || pstate_unmasked; } =20 -#define cpu_init(cpu_model) CPU(cpu_arm_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_ARM_CPU, cpu_model) =20 #define cpu_signal_handler cpu_arm_signal_handler #define cpu_list arm_cpu_list diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 7e8ab3184c..a8b3d463fc 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -1593,7 +1593,7 @@ static void musicpal_init(MachineState *machine) if (!cpu_model) { cpu_model =3D "arm926"; } - cpu =3D cpu_arm_init(cpu_model); + cpu =3D ARM_CPU(cpu_generic_init(TYPE_ARM_CPU, cpu_model)); if (!cpu) { fprintf(stderr, "Unable to find CPU definition\n"); exit(1); diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 3d15ff6779..400ba30c94 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -3863,7 +3863,7 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegio= n *system_memory, =20 /* Core */ s->mpu_model =3D omap310; - s->cpu =3D cpu_arm_init(core); + s->cpu =3D ARM_CPU(cpu_generic_init(TYPE_ARM_CPU, core)); if (s->cpu =3D=3D NULL) { fprintf(stderr, "Unable to find CPU definition\n"); exit(1); diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index bbf0b7e188..ece25ae744 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -2261,7 +2261,7 @@ struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegi= on *sysmem, =20 /* Core */ s->mpu_model =3D omap2420; - s->cpu =3D cpu_arm_init(core ?: "arm1136-r2"); + s->cpu =3D ARM_CPU(cpu_generic_init(TYPE_ARM_CPU, core ?: "arm1136-r2"= )); if (s->cpu =3D=3D NULL) { fprintf(stderr, "Unable to find CPU definition\n"); exit(1); diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 194b0bc808..b0ac3cfd64 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -2066,7 +2066,7 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, if (!revision) revision =3D "pxa270"; =20 - s->cpu =3D cpu_arm_init(revision); + s->cpu =3D ARM_CPU(cpu_generic_init(TYPE_ARM_CPU, revision)); if (s->cpu =3D=3D NULL) { fprintf(stderr, "Unable to find CPU definition\n"); exit(1); @@ -2196,7 +2196,7 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space,= unsigned int sdram_size) =20 s =3D g_new0(PXA2xxState, 1); =20 - s->cpu =3D cpu_arm_init("pxa255"); + s->cpu =3D ARM_CPU(cpu_generic_init(TYPE_ARM_CPU, "pxa255")); if (s->cpu =3D=3D NULL) { fprintf(stderr, "Unable to find CPU definition\n"); exit(1); diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c index 6a45dcc009..884242b2dc 100644 --- a/hw/arm/strongarm.c +++ b/hw/arm/strongarm.c @@ -1597,7 +1597,7 @@ StrongARMState *sa1110_init(MemoryRegion *sysmem, exit(1); } =20 - s->cpu =3D cpu_arm_init(rev); + s->cpu =3D ARM_CPU(cpu_generic_init(TYPE_ARM_CPU, rev)); =20 if (!s->cpu) { error_report("Unable to find CPU definition"); diff --git a/target/arm/helper.c b/target/arm/helper.c index fa60040361..0ec92d3214 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -5233,11 +5233,6 @@ void register_cp_regs_for_features(ARMCPU *cpu) } } =20 -ARMCPU *cpu_arm_init(const char *cpu_model) -{ - return ARM_CPU(cpu_generic_init(TYPE_ARM_CPU, cpu_model)); -} - void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) { CPUState *cs =3D CPU(cpu); --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504279810700472.5049272235117; Fri, 1 Sep 2017 08:30:10 -0700 (PDT) Received: from localhost ([::1]:45670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnntY-0007uA-Q0 for importer@patchew.org; Fri, 01 Sep 2017 11:30:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUd-000069-8m for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnUY-0003A6-HB for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62718) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnUY-00039x-BV for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:18 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 69B8F6147F; Fri, 1 Sep 2017 15:04:17 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 052E1A63BC; Fri, 1 Sep 2017 15:04:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 69B8F6147F Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:11 -0300 Message-Id: <20170901150317.10380-24-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 01 Sep 2017 15:04:17 +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] [PULL 23/29] cris: replace cpu_cris_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org 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" From: Igor Mammedov it's just a wrapper, drop it and use cpu_generic_init() directly Signed-off-by: Igor Mammedov Reviewed-by: Eduardo Habkost Message-Id: <1503592308-93913-20-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/cris/cpu.h | 3 +-- hw/cris/axis_dev88.c | 2 +- target/cris/cpu.c | 5 ----- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/target/cris/cpu.h b/target/cris/cpu.h index 920e1c33ba..5d822dee16 100644 --- a/target/cris/cpu.h +++ b/target/cris/cpu.h @@ -216,7 +216,6 @@ int crisv10_cpu_gdb_read_register(CPUState *cpu, uint8_= t *buf, int reg); int cris_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg); int cris_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); =20 -CRISCPU *cpu_cris_init(const char *cpu_model); /* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */ @@ -268,7 +267,7 @@ enum { #define TARGET_PHYS_ADDR_SPACE_BITS 32 #define TARGET_VIRT_ADDR_SPACE_BITS 32 =20 -#define cpu_init(cpu_model) CPU(cpu_cris_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_CRIS_CPU, cpu_model) =20 #define cpu_signal_handler cpu_cris_signal_handler =20 diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c index 80674f6bbb..5eb552bce2 100644 --- a/hw/cris/axis_dev88.c +++ b/hw/cris/axis_dev88.c @@ -271,7 +271,7 @@ void axisdev88_init(MachineState *machine) if (cpu_model =3D=3D NULL) { cpu_model =3D "crisv32"; } - cpu =3D cpu_cris_init(cpu_model); + cpu =3D CRIS_CPU(cpu_generic_init(TYPE_CRIS_CPU, cpu_model)); env =3D &cpu->env; =20 /* allocate RAM */ diff --git a/target/cris/cpu.c b/target/cris/cpu.c index 5f766f09d6..ceebfed79b 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -89,11 +89,6 @@ static ObjectClass *cris_cpu_class_by_name(const char *c= pu_model) return oc; } =20 -CRISCPU *cpu_cris_init(const char *cpu_model) -{ - return CRIS_CPU(cpu_generic_init(TYPE_CRIS_CPU, cpu_model)); -} - /* Sort alphabetically by VR. */ static gint cris_cpu_list_compare(gconstpointer a, gconstpointer b) { --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 150427882649669.50940548791027; Fri, 1 Sep 2017 08:13:46 -0700 (PDT) Received: from localhost ([::1]:45048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnndh-0000jF-Bi for importer@patchew.org; Fri, 01 Sep 2017 11:13:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUf-00007u-36 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnUa-0003BB-FY for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48374) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnUa-0003Ai-9T for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:20 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4196061493; Fri, 1 Sep 2017 15:04:19 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id CDBAE7B0FC; Fri, 1 Sep 2017 15:04:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4196061493 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:12 -0300 Message-Id: <20170901150317.10380-25-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 01 Sep 2017 15:04:19 +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] [PULL 24/29] x86: replace cpu_x86_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org 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" From: Igor Mammedov it's just a wrapper, drop it and use cpu_generic_init() directly Signed-off-by: Igor Mammedov Reviewed-by: Eduardo Habkost Message-Id: <1503592308-93913-21-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/i386/cpu.h | 3 +-- target/i386/cpu.c | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 051867399b..525d35d836 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1327,7 +1327,6 @@ int x86_cpu_gdb_write_register(CPUState *cpu, uint8_t= *buf, int reg); void x86_cpu_exec_enter(CPUState *cpu); void x86_cpu_exec_exit(CPUState *cpu); =20 -X86CPU *cpu_x86_init(const char *cpu_model); void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf); int cpu_x86_support_mca_broadcast(CPUX86State *env); =20 @@ -1507,7 +1506,7 @@ uint64_t cpu_get_tsc(CPUX86State *env); =20 #define PHYS_ADDR_MASK MAKE_64BIT_MASK(0, TCG_PHYS_ADDR_BITS) =20 -#define cpu_init(cpu_model) CPU(cpu_x86_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_X86_CPU, cpu_model) =20 #define cpu_signal_handler cpu_x86_signal_handler #define cpu_list x86_cpu_list diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 6617e01a72..f81576d11d 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2686,11 +2686,6 @@ static gchar *x86_gdb_arch_name(CPUState *cs) #endif } =20 -X86CPU *cpu_x86_init(const char *cpu_model) -{ - return X86_CPU(cpu_generic_init(TYPE_X86_CPU, cpu_model)); -} - static void x86_cpu_cpudef_class_init(ObjectClass *oc, void *data) { X86CPUDefinition *cpudef =3D data; --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504280101743408.61811081389055; Fri, 1 Sep 2017 08:35:01 -0700 (PDT) Received: from localhost ([::1]:45975 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnyG-0003Q8-KE for importer@patchew.org; Fri, 01 Sep 2017 11:35:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUj-0000E7-Ho for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnUd-0003C7-6U for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47688) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnUc-0003Bp-UB for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:23 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0541C356F2; Fri, 1 Sep 2017 15:04:22 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A20DA63B2; Fri, 1 Sep 2017 15:04:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0541C356F2 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:13 -0300 Message-Id: <20170901150317.10380-26-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 01 Sep 2017 15:04:22 +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] [PULL 25/29] lm32: replace cpu_lm32_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org 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" From: Igor Mammedov it's just a wrapper, drop it and use cpu_generic_init() directly Signed-off-by: Igor Mammedov Acked-by: Michael Walle Reviewed-by: Eduardo Habkost Message-Id: <1503592308-93913-22-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/lm32/cpu.h | 3 +-- hw/lm32/lm32_boards.c | 4 ++-- hw/lm32/milkymist.c | 2 +- target/lm32/helper.c | 5 ----- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/target/lm32/cpu.h b/target/lm32/cpu.h index 1d972cb26b..de265b50d1 100644 --- a/target/lm32/cpu.h +++ b/target/lm32/cpu.h @@ -238,7 +238,6 @@ static inline lm32_wp_t lm32_wp_type(uint32_t dc, int i= dx) return (dc >> (idx+1)*2) & 0x3; } =20 -LM32CPU *cpu_lm32_init(const char *cpu_model); /* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */ @@ -256,7 +255,7 @@ void lm32_watchpoint_insert(CPULM32State *env, int inde= x, target_ulong address, void lm32_watchpoint_remove(CPULM32State *env, int index); bool lm32_cpu_do_semihosting(CPUState *cs); =20 -#define cpu_init(cpu_model) CPU(cpu_lm32_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_LM32_CPU, cpu_model) =20 #define cpu_list lm32_cpu_list #define cpu_signal_handler cpu_lm32_signal_handler diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c index 8f0c3079d6..eccf0ac5a1 100644 --- a/hw/lm32/lm32_boards.c +++ b/hw/lm32/lm32_boards.c @@ -104,7 +104,7 @@ static void lm32_evr_init(MachineState *machine) if (cpu_model =3D=3D NULL) { cpu_model =3D "lm32-full"; } - cpu =3D cpu_lm32_init(cpu_model); + cpu =3D LM32_CPU(cpu_generic_init(TYPE_LM32_CPU, cpu_model)); if (cpu =3D=3D NULL) { fprintf(stderr, "qemu: unable to find CPU '%s'\n", cpu_model); exit(1); @@ -205,7 +205,7 @@ static void lm32_uclinux_init(MachineState *machine) if (cpu_model =3D=3D NULL) { cpu_model =3D "lm32-full"; } - cpu =3D cpu_lm32_init(cpu_model); + cpu =3D LM32_CPU(cpu_generic_init(TYPE_LM32_CPU, cpu_model)); if (cpu =3D=3D NULL) { fprintf(stderr, "qemu: unable to find CPU '%s'\n", cpu_model); exit(1); diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c index 5cae0f19dd..dffd8797bb 100644 --- a/hw/lm32/milkymist.c +++ b/hw/lm32/milkymist.c @@ -111,7 +111,7 @@ milkymist_init(MachineState *machine) if (cpu_model =3D=3D NULL) { cpu_model =3D "lm32-full"; } - cpu =3D cpu_lm32_init(cpu_model); + cpu =3D LM32_CPU(cpu_generic_init(TYPE_LM32_CPU, cpu_model)); if (cpu =3D=3D NULL) { fprintf(stderr, "qemu: unable to find CPU '%s'\n", cpu_model); exit(1); diff --git a/target/lm32/helper.c b/target/lm32/helper.c index 891da18c30..929cc36c14 100644 --- a/target/lm32/helper.c +++ b/target/lm32/helper.c @@ -219,11 +219,6 @@ bool lm32_cpu_exec_interrupt(CPUState *cs, int interru= pt_request) return false; } =20 -LM32CPU *cpu_lm32_init(const char *cpu_model) -{ - return LM32_CPU(cpu_generic_init(TYPE_LM32_CPU, cpu_model)); -} - /* Some soc ignores the MSB on the address bus. Thus creating a shadow mem= ory * area. As a general rule, 0x00000000-0x7fffffff is cached, whereas * 0x80000000-0xffffffff is not cached and used to access IO devices. */ --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504279113161926.8310106320964; Fri, 1 Sep 2017 08:18:33 -0700 (PDT) Received: from localhost ([::1]:45153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnniK-0005Xu-1T for importer@patchew.org; Fri, 01 Sep 2017 11:18:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUf-0000AE-Vn for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnUe-0003Cz-VM for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55750) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnUe-0003Ce-Pb for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:24 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D1C13806BF; Fri, 1 Sep 2017 15:04:23 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 69BE8A63BC; Fri, 1 Sep 2017 15:04:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D1C13806BF 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=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:14 -0300 Message-Id: <20170901150317.10380-27-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 01 Sep 2017 15:04:24 +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] [PULL 26/29] moxie: replace cpu_moxie_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org 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" From: Igor Mammedov it's just a wrapper, drop it and use cpu_generic_init() directly Signed-off-by: Igor Mammedov Reviewed-by: Eduardo Habkost Message-Id: <1503592308-93913-23-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/moxie/cpu.h | 3 +-- hw/moxie/moxiesim.c | 2 +- target/moxie/cpu.c | 5 ----- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/target/moxie/cpu.h b/target/moxie/cpu.h index 8991aaef9a..75decaadd6 100644 --- a/target/moxie/cpu.h +++ b/target/moxie/cpu.h @@ -112,7 +112,6 @@ static inline MoxieCPU *moxie_env_get_cpu(CPUMoxieState= *env) =20 #define ENV_OFFSET offsetof(MoxieCPU, env) =20 -MoxieCPU *cpu_moxie_init(const char *cpu_model); void moxie_cpu_do_interrupt(CPUState *cs); void moxie_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf, int flags); @@ -121,7 +120,7 @@ void moxie_translate_init(void); int cpu_moxie_signal_handler(int host_signum, void *pinfo, void *puc); =20 -#define cpu_init(cpu_model) CPU(cpu_moxie_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_MOXIE_CPU, cpu_model) =20 #define cpu_signal_handler cpu_moxie_signal_handler =20 diff --git a/hw/moxie/moxiesim.c b/hw/moxie/moxiesim.c index df3f1249ae..4c27b45c46 100644 --- a/hw/moxie/moxiesim.c +++ b/hw/moxie/moxiesim.c @@ -118,7 +118,7 @@ static void moxiesim_init(MachineState *machine) if (cpu_model =3D=3D NULL) { cpu_model =3D "MoxieLite-moxie-cpu"; } - cpu =3D cpu_moxie_init(cpu_model); + cpu =3D MOXIE_CPU(cpu_generic_init(TYPE_MOXIE_CPU, cpu_model)); if (!cpu) { fprintf(stderr, "Unable to find CPU definition\n"); exit(1); diff --git a/target/moxie/cpu.c b/target/moxie/cpu.c index 927b1a1e44..748d02f29e 100644 --- a/target/moxie/cpu.c +++ b/target/moxie/cpu.c @@ -150,11 +150,6 @@ static const MoxieCPUInfo moxie_cpus[] =3D { { .name =3D "any", .initfn =3D moxie_any_initfn }, }; =20 -MoxieCPU *cpu_moxie_init(const char *cpu_model) -{ - return MOXIE_CPU(cpu_generic_init(TYPE_MOXIE_CPU, cpu_model)); -} - static void cpu_register(const MoxieCPUInfo *info) { TypeInfo type_info =3D { --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504279362358929.9786468232111; Fri, 1 Sep 2017 08:22:42 -0700 (PDT) Received: from localhost ([::1]:45342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnmK-0001JH-Nw for importer@patchew.org; Fri, 01 Sep 2017 11:22:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUn-0000LG-W1 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnUj-0003EI-0q for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52902) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnUi-0003E4-RM for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:28 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E7451C9D23; Fri, 1 Sep 2017 15:04:27 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3050A81F87; Fri, 1 Sep 2017 15:04:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E7451C9D23 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:15 -0300 Message-Id: <20170901150317.10380-28-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 01 Sep 2017 15:04:28 +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] [PULL 27/29] openrisc: replace cpu_openrisc_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org 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" From: Igor Mammedov it's just a wrapper, drop it and use cpu_generic_init() directly Signed-off-by: Igor Mammedov Acked-by: Stafford Horne Reviewed-by: Eduardo Habkost Message-Id: <1503592308-93913-24-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/openrisc/cpu.h | 4 +--- hw/openrisc/openrisc_sim.c | 2 +- target/openrisc/cpu.c | 5 ----- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index 2721432c4f..f51b89a11c 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -347,8 +347,6 @@ static inline OpenRISCCPU *openrisc_env_get_cpu(CPUOpen= RISCState *env) =20 #define ENV_OFFSET offsetof(OpenRISCCPU, env) =20 -OpenRISCCPU *cpu_openrisc_init(const char *cpu_model); - void cpu_openrisc_list(FILE *f, fprintf_function cpu_fprintf); void openrisc_cpu_do_interrupt(CPUState *cpu); bool openrisc_cpu_exec_interrupt(CPUState *cpu, int int_req); @@ -390,7 +388,7 @@ int cpu_openrisc_get_phys_data(OpenRISCCPU *cpu, int *prot, target_ulong address, int rw); #endif =20 -#define cpu_init(cpu_model) CPU(cpu_openrisc_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_OPENRISC_CPU, cpu_model) =20 #include "exec/cpu-all.h" =20 diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c index e1eeffc490..243d8020db 100644 --- a/hw/openrisc/openrisc_sim.c +++ b/hw/openrisc/openrisc_sim.c @@ -109,7 +109,7 @@ static void openrisc_sim_init(MachineState *machine) } =20 for (n =3D 0; n < smp_cpus; n++) { - cpu =3D cpu_openrisc_init(cpu_model); + cpu =3D OPENRISC_CPU(cpu_generic_init(TYPE_OPENRISC_CPU, cpu_model= )); if (cpu =3D=3D NULL) { fprintf(stderr, "Unable to find CPU definition!\n"); exit(1); diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 1d6330cbcc..a979f0bf8b 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -210,11 +210,6 @@ static void openrisc_cpu_register_types(void) } } =20 -OpenRISCCPU *cpu_openrisc_init(const char *cpu_model) -{ - return OPENRISC_CPU(cpu_generic_init(TYPE_OPENRISC_CPU, cpu_model)); -} - /* Sort alphabetically by type name, except for "any". */ static gint openrisc_cpu_list_compare(gconstpointer a, gconstpointer b) { --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504278985343818.250948228181; Fri, 1 Sep 2017 08:16:25 -0700 (PDT) Received: from localhost ([::1]:45066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnngG-0003Jo-9v for importer@patchew.org; Fri, 01 Sep 2017 11:16:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUq-0000Np-F2 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnUl-0003FI-Oh for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52229) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnUl-0003Ez-JY for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:31 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C90D806C0; Fri, 1 Sep 2017 15:04:30 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B5987B0FF; Fri, 1 Sep 2017 15:04:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9C90D806C0 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=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:16 -0300 Message-Id: <20170901150317.10380-29-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 01 Sep 2017 15:04:30 +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] [PULL 28/29] unicore32: replace uc32_cpu_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org 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" From: Igor Mammedov it's just a wrapper, drop it and use cpu_generic_init() directly Signed-off-by: Igor Mammedov Reviewed-by: Eduardo Habkost Message-Id: <1503592308-93913-25-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/unicore32/cpu.h | 4 +--- hw/unicore32/puv3.c | 2 +- target/unicore32/helper.c | 5 ----- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/target/unicore32/cpu.h b/target/unicore32/cpu.h index 7b5b405e79..7724108281 100644 --- a/target/unicore32/cpu.h +++ b/target/unicore32/cpu.h @@ -165,9 +165,7 @@ static inline int cpu_mmu_index(CPUUniCore32State *env,= bool ifetch) =20 #include "exec/cpu-all.h" =20 -UniCore32CPU *uc32_cpu_init(const char *cpu_model); - -#define cpu_init(cpu_model) CPU(uc32_cpu_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_UNICORE32_CPU, cpu_model) =20 static inline void cpu_get_tb_cpu_state(CPUUniCore32State *env, target_ulo= ng *pc, target_ulong *cs_base, uint32_t *f= lags) diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c index ff62efb4df..eb9862fa2f 100644 --- a/hw/unicore32/puv3.c +++ b/hw/unicore32/puv3.c @@ -127,7 +127,7 @@ static void puv3_init(MachineState *machine) cpu_model =3D "UniCore-II"; } =20 - cpu =3D uc32_cpu_init(cpu_model); + cpu =3D UNICORE32_CPU(cpu_generic_init(TYPE_UNICORE32_CPU, cpu_model)); if (!cpu) { error_report("Unable to find CPU definition"); exit(1); diff --git a/target/unicore32/helper.c b/target/unicore32/helper.c index f9239dc7b8..309dcd1ae1 100644 --- a/target/unicore32/helper.c +++ b/target/unicore32/helper.c @@ -27,11 +27,6 @@ #define DPRINTF(fmt, ...) do {} while (0) #endif =20 -UniCore32CPU *uc32_cpu_init(const char *cpu_model) -{ - return UNICORE32_CPU(cpu_generic_init(TYPE_UNICORE32_CPU, cpu_model)); -} - #ifndef CONFIG_USER_ONLY void helper_cp0_set(CPUUniCore32State *env, uint32_t val, uint32_t creg, uint32_t cop) --=20 2.13.5 From nobody Wed Nov 5 05:42:58 2025 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 1504279511689364.27877054608086; Fri, 1 Sep 2017 08:25:11 -0700 (PDT) Received: from localhost ([::1]:45419 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnok-0003YZ-1u for importer@patchew.org; Fri, 01 Sep 2017 11:25:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnnUv-0000R7-8S for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnnUq-0003Gb-0G for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56516) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnnUp-0003GG-Ns for qemu-devel@nongnu.org; Fri, 01 Sep 2017 11:04:35 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CBC7F806CA; Fri, 1 Sep 2017 15:04:34 +0000 (UTC) Received: from localhost (ovpn-116-66.gru2.redhat.com [10.97.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id F22069568E; Fri, 1 Sep 2017 15:04:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CBC7F806CA 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=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: Peter Maydell Date: Fri, 1 Sep 2017 12:03:17 -0300 Message-Id: <20170901150317.10380-30-ehabkost@redhat.com> In-Reply-To: <20170901150317.10380-1-ehabkost@redhat.com> References: <20170901150317.10380-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 01 Sep 2017 15:04:34 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 29/29] ppc: replace cpu_ppc_init() with cpu_generic_init() 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: Igor Mammedov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov it's just a wrapper, drop it and use cpu_generic_init() directly Signed-off-by: Igor Mammedov Acked-by: David Gibson Reviewed-by: Herv=C3=A9 Poussineau Reviewed-by: Eduardo Habkost Message-Id: <1503592308-93913-26-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost --- target/ppc/cpu.h | 3 +-- hw/ppc/e500.c | 3 ++- hw/ppc/mac_newworld.c | 3 ++- hw/ppc/mac_oldworld.c | 3 ++- hw/ppc/ppc440_bamboo.c | 2 +- hw/ppc/ppc4xx_devs.c | 2 +- hw/ppc/prep.c | 5 +++-- hw/ppc/virtex_ml507.c | 2 +- target/ppc/translate_init.c | 5 ----- 9 files changed, 13 insertions(+), 15 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 46d3dd88f6..12f09492fb 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1276,7 +1276,6 @@ extern const struct VMStateDescription vmstate_ppc_cp= u; #endif =20 /*************************************************************************= ****/ -PowerPCCPU *cpu_ppc_init(const char *cpu_model); void ppc_translate_init(void); const char *ppc_cpu_lookup_alias(const char *alias); /* you can call this signal handler from your SIGBUS and SIGSEGV @@ -1353,7 +1352,7 @@ static inline uint64_t ppc_dump_gpr(CPUPPCState *env,= int gprn) int ppc_dcr_read (ppc_dcr_t *dcr_env, int dcrn, uint32_t *valp); int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, uint32_t val); =20 -#define cpu_init(cpu_model) CPU(cpu_ppc_init(cpu_model)) +#define cpu_init(cpu_model) cpu_generic_init(TYPE_POWERPC_CPU, cpu_model) =20 #define cpu_signal_handler cpu_ppc_signal_handler #define cpu_list ppc_cpu_list diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 62f1857206..f0596f34ff 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -819,7 +819,8 @@ void ppce500_init(MachineState *machine, PPCE500Params = *params) CPUState *cs; qemu_irq *input; =20 - cpu =3D cpu_ppc_init(machine->cpu_model); + cpu =3D POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, + machine->cpu_model)); if (cpu =3D=3D NULL) { fprintf(stderr, "Unable to initialize CPU!\n"); exit(1); diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 3056d5f075..d466634997 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -187,7 +187,8 @@ static void ppc_core99_init(MachineState *machine) #endif } for (i =3D 0; i < smp_cpus; i++) { - cpu =3D cpu_ppc_init(machine->cpu_model); + cpu =3D POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, + machine->cpu_model)); if (cpu =3D=3D NULL) { fprintf(stderr, "Unable to find PowerPC CPU definition\n"); exit(1); diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index f2ae60a360..fcac399562 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -116,7 +116,8 @@ static void ppc_heathrow_init(MachineState *machine) if (machine->cpu_model =3D=3D NULL) machine->cpu_model =3D "G3"; for (i =3D 0; i < smp_cpus; i++) { - cpu =3D cpu_ppc_init(machine->cpu_model); + cpu =3D POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, + machine->cpu_model)); if (cpu =3D=3D NULL) { fprintf(stderr, "Unable to find PowerPC CPU definition\n"); exit(1); diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index 9d997bf743..ca26398036 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c @@ -186,7 +186,7 @@ static void bamboo_init(MachineState *machine) if (machine->cpu_model =3D=3D NULL) { machine->cpu_model =3D "440EP"; } - cpu =3D cpu_ppc_init(machine->cpu_model); + cpu =3D POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, machine->cpu_mo= del)); if (cpu =3D=3D NULL) { fprintf(stderr, "Unable to initialize CPU!\n"); exit(1); diff --git a/hw/ppc/ppc4xx_devs.c b/hw/ppc/ppc4xx_devs.c index e7f413e49d..6b38ed7bc7 100644 --- a/hw/ppc/ppc4xx_devs.c +++ b/hw/ppc/ppc4xx_devs.c @@ -56,7 +56,7 @@ PowerPCCPU *ppc4xx_init(const char *cpu_model, CPUPPCState *env; =20 /* init CPUs */ - cpu =3D cpu_ppc_init(cpu_model); + cpu =3D POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, cpu_model)); if (cpu =3D=3D NULL) { fprintf(stderr, "Unable to find PowerPC %s CPU definition\n", cpu_model); diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 36d3dcd89a..00f3321a60 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -520,7 +520,8 @@ static void ppc_prep_init(MachineState *machine) if (machine->cpu_model =3D=3D NULL) machine->cpu_model =3D "602"; for (i =3D 0; i < smp_cpus; i++) { - cpu =3D cpu_ppc_init(machine->cpu_model); + cpu =3D POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, + machine->cpu_model)); if (cpu =3D=3D NULL) { fprintf(stderr, "Unable to find PowerPC CPU definition\n"); exit(1); @@ -724,7 +725,7 @@ static void ibm_40p_init(MachineState *machine) if (!machine->cpu_model) { machine->cpu_model =3D "604"; } - cpu =3D cpu_ppc_init(machine->cpu_model); + cpu =3D POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, machine->cpu_mo= del)); if (!cpu) { error_report("could not initialize CPU '%s'", machine->cpu_model); diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c index fdbcf22a0c..d5fdc16b59 100644 --- a/hw/ppc/virtex_ml507.c +++ b/hw/ppc/virtex_ml507.c @@ -96,7 +96,7 @@ static PowerPCCPU *ppc440_init_xilinx(ram_addr_t *ram_siz= e, CPUPPCState *env; qemu_irq *irqs; =20 - cpu =3D cpu_ppc_init(cpu_model); + cpu =3D POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, cpu_model)); if (cpu =3D=3D NULL) { fprintf(stderr, "Unable to initialize CPU!\n"); exit(1); diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c index 8fb407ed73..43be9a8331 100644 --- a/target/ppc/translate_init.c +++ b/target/ppc/translate_init.c @@ -10271,11 +10271,6 @@ const char *ppc_cpu_lookup_alias(const char *alias) return NULL; } =20 -PowerPCCPU *cpu_ppc_init(const char *cpu_model) -{ - return POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, cpu_model)); -} - PowerPCCPUClass *ppc_cpu_get_family_class(PowerPCCPUClass *pcc) { ObjectClass *oc =3D OBJECT_CLASS(pcc); --=20 2.13.5