From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvyqf-0003Tk-Vs for qemu-devel@nongnu.org; Sun, 16 Oct 2016 23:44:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvyqe-00017l-Tc for qemu-devel@nongnu.org; Sun, 16 Oct 2016 23:44:26 -0400 Date: Mon, 17 Oct 2016 14:43:07 +1100 From: David Gibson Message-ID: <20161017034307.GQ25390@umbus.fritz.box> References: <1476485569-6744-1-git-send-email-lvivier@redhat.com> <1476485569-6744-2-git-send-email-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oCBD0SPT9UHZkBMO" Content-Disposition: inline In-Reply-To: <1476485569-6744-2-git-send-email-lvivier@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 1/3] exec: split cpu_exec_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Eduardo Habkost , Igor Mammedov , Bharata B Rao , Peter Maydell , Paolo Bonzini , Alexander Graf , Matthew Rosato , qemu-devel@nongnu.org, Richard Henderson , qemu-arm@nongnu.org, Greg Ungerer , Guan Xuetao , Jia Liu , Markus Armbruster , Artyom Tarasenko , "Edgar E . Iglesias" , Michael Walle , Chen Gang , Aurelien Jarno , Anthony Green , qemu-ppc@nongnu.org, Bastian Koppelmann , Greg Kurz , Max Filippov --oCBD0SPT9UHZkBMO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 15, 2016 at 12:52:47AM +0200, Laurent Vivier wrote: > Put in cpu_exec_initfn() what initializes the CPU, > and let in cpu_exec_init() what adds it to the environment. >=20 > As cpu_exec_initfn() is called by all XX_cpu_initfn() call it > directly in cpu_common_initfn(). > cpu_exec_init() is now a realize function, it will be renamed > to cpu_exec_realizefn() and moved to the XX_cpu_realizefn() > function in a following patch. >=20 > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson > --- > exec.c | 10 ++++++---- > include/qom/cpu.h | 1 + > qom/cpu.c | 2 ++ > 3 files changed, 9 insertions(+), 4 deletions(-) >=20 > diff --git a/exec.c b/exec.c > index 374c364..d1e57c4 100644 > --- a/exec.c > +++ b/exec.c > @@ -610,11 +610,8 @@ void cpu_exec_exit(CPUState *cpu) > } > } > =20 > -void cpu_exec_init(CPUState *cpu, Error **errp) > +void cpu_exec_initfn(CPUState *cpu) > { > - CPUClass *cc ATTRIBUTE_UNUSED =3D CPU_GET_CLASS(cpu); > - Error *local_err ATTRIBUTE_UNUSED =3D NULL; > - > cpu->as =3D NULL; > cpu->num_ases =3D 0; > =20 > @@ -635,6 +632,11 @@ void cpu_exec_init(CPUState *cpu, Error **errp) > cpu->memory =3D system_memory; > object_ref(OBJECT(cpu->memory)); > #endif > +} > + > +void cpu_exec_init(CPUState *cpu, Error **errp) > +{ > + CPUClass *cc ATTRIBUTE_UNUSED =3D CPU_GET_CLASS(cpu); > =20 > cpu_list_add(cpu); > =20 > diff --git a/include/qom/cpu.h b/include/qom/cpu.h > index 6d481a1..d7648a9 100644 > --- a/include/qom/cpu.h > +++ b/include/qom/cpu.h > @@ -946,6 +946,7 @@ AddressSpace *cpu_get_address_space(CPUState *cpu, in= t asidx); > =20 > void QEMU_NORETURN cpu_abort(CPUState *cpu, const char *fmt, ...) > GCC_FMT_ATTR(2, 3); > +void cpu_exec_initfn(CPUState *cpu); > void cpu_exec_exit(CPUState *cpu); > =20 > #ifdef CONFIG_SOFTMMU > diff --git a/qom/cpu.c b/qom/cpu.c > index c40f774..85f1132 100644 > --- a/qom/cpu.c > +++ b/qom/cpu.c > @@ -362,6 +362,8 @@ static void cpu_common_initfn(Object *obj) > QTAILQ_INIT(&cpu->watchpoints); > =20 > cpu->trace_dstate =3D bitmap_new(trace_get_vcpu_event_count()); > + > + cpu_exec_initfn(cpu); > } > =20 > static void cpu_common_finalize(Object *obj) --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --oCBD0SPT9UHZkBMO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYBEjLAAoJEGw4ysog2bOSkSAP/i8lFAjI0vMfUmhhgxyZivTm CeaKqRau0+2b5vw0TN9sejbmClbPgLW6tKrZr5BZUirWubxlaYH5LgJL7ldVvDRe QoomJe5X1J/8DjD4swM52g2z+ZH2ArWzOOfiPWlqokKeKTdMmY6Aa/L0LauDaJH/ mJ7lcKND31I4MnuxaExXpaiDVo9ZCY0R+QlbO+4hm9Aw3k8fTVvC1LvaNkU1ml2A ErR8GQCVyRJSREZf0hWZp289ZghV4jmgFWAXQ6RkeitwQIM+M7ZMY2ihJAeIjTIe 8D8lE9IKxuMnqkdkNFrKDGiCSRqCY+dkvuE62Y8wuIjU+LoF/CLl1baArmqJYVHF SvnyC4CfFfzppvcVFJ9j1A2ae2ryjIacRK1QtAiVPfHvuq5HKPbuiqdA4HAYbmuS SL8lfoMkW+TtOYZvi7NVxuLa6fc0YYGmA1qdB0OlhfXmtDKIGDfzfn61kHXfCrYQ 1qawyY+Ov42dgbdmQ4p6eqvHzuTF88oboxdDoL4zzjrmt51JrS6PtwnvQuLftfAG KR7a0iOSeJwDifaPtQUbVOx0f8VwHwBkbqPIwOi6SKFrqe/vmxtDnonbCnlJzqZK n77D/HpgkH0UTrEMY2mEUoW/FF3JEzcOyHUWKEHCIhQBdJhyDRQnBEE1VCZQpImy hKSHuEC3eYDcSEgZB519 =7JiR -----END PGP SIGNATURE----- --oCBD0SPT9UHZkBMO--