From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bs0tH-0006pH-9F for qemu-devel@nongnu.org; Thu, 06 Oct 2016 01:06:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bs0tG-0004Ke-51 for qemu-devel@nongnu.org; Thu, 06 Oct 2016 01:06:43 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:50565) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bs0tF-0004Jy-5d for qemu-devel@nongnu.org; Thu, 06 Oct 2016 01:06:42 -0400 Date: Thu, 6 Oct 2016 16:04:40 +1100 From: David Gibson Message-ID: <20161006050440.GI18733@umbus.fritz.box> References: <1475696333-8706-1-git-send-email-lvivier@redhat.com> <1475696333-8706-17-git-send-email-lvivier@redhat.com> <57F5936E.2030607@emindsoft.com.cn> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MPkR1dXiUZqK+927" Content-Disposition: inline In-Reply-To: <57F5936E.2030607@emindsoft.com.cn> Subject: Re: [Qemu-devel] [PATCH 16/19] target-tilegx: move cpu_exec_realize() to realize function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chen Gang Cc: Laurent Vivier , qemu-devel@nongnu.org, Paolo Bonzini , Markus Armbruster , Eduardo Habkost , Bharata B Rao , Peter Maydell , Matthew Rosato , Chen Gang --MPkR1dXiUZqK+927 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 06, 2016 at 07:57:34AM +0800, Chen Gang wrote: >=20 > On 10/6/16 03:38, Laurent Vivier wrote: > > I've removed the cannot_destroy_with_object_finalize_yet field as > > cpu_exec_init() is not called by tilegx_cpu_initfn() anymore > > (not tested with QOM command as tilegx is only available in linux-user > > mode) > >=20 >=20 >=20 > For master branch, I can not find cpu_exec_realize in total source code, > I am not quite sure whether it is ok or not. It's a new function introduced in the first patch of this series. The old cpu_exec_init() was split into cpu_exec_init() which contains things which are safe at init time, and cpu_exec_realize() which is supposed to be called at realize() time. >=20 > And in honest, now, tilegx-linux-user is not implemented completely, the > floating point insns are not supported by our main branch (which should > be one of main feature for tilegx) -- which I should try. >=20 > Thanks. >=20 > > CC: Chen Gang > > Signed-off-by: Laurent Vivier > > --- > > target-tilegx/cpu.c | 15 +++++++-------- > > 1 file changed, 7 insertions(+), 8 deletions(-) > >=20 > > diff --git a/target-tilegx/cpu.c b/target-tilegx/cpu.c > > index f7ec920..6be69ef 100644 > > --- a/target-tilegx/cpu.c > > +++ b/target-tilegx/cpu.c > > @@ -92,6 +92,13 @@ static void tilegx_cpu_realizefn(DeviceState *dev, E= rror **errp) > > { > > CPUState *cs =3D CPU(dev); > > TileGXCPUClass *tcc =3D TILEGX_CPU_GET_CLASS(dev); > > + Error *local_err =3D NULL; > > + > > + cpu_exec_realize(cs, &local_err); > > + if (local_err !=3D NULL) { > > + error_propagate(errp, local_err); > > + return; > > + } > > =20 > > cpu_reset(cs); > > qemu_init_vcpu(cs); > > @@ -108,7 +115,6 @@ static void tilegx_cpu_initfn(Object *obj) > > =20 > > cs->env_ptr =3D env; > > cpu_exec_init(cs, &error_abort); > > - cpu_exec_realize(cs, &error_abort); > > =20 > > if (tcg_enabled() && !tcg_initialized) { > > tcg_initialized =3D true; > > @@ -163,13 +169,6 @@ static void tilegx_cpu_class_init(ObjectClass *oc,= void *data) > > cc->set_pc =3D tilegx_cpu_set_pc; > > cc->handle_mmu_fault =3D tilegx_cpu_handle_mmu_fault; > > cc->gdb_num_core_regs =3D 0; > > - > > - /* > > - * Reason: tilegx_cpu_initfn() calls cpu_exec_init(), which saves > > - * the object in cpus -> dangling pointer after final > > - * object_unref(). > > - */ > > - dc->cannot_destroy_with_object_finalize_yet =3D true; > > } > > =20 > > static const TypeInfo tilegx_cpu_type_info =3D { > >=20 >=20 --=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 --MPkR1dXiUZqK+927 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX9dtnAAoJEGw4ysog2bOS/zQQAOUD0mkXE5kYO3foURo8rWcm i2LfaIzMkPbjHGCyI59hxHUZr9jbQrhlk1Y1eqNzyGJH24/Sw/ZtlbJgk/s/HcrI yo7KyILY5XQOLzjrtFTZb05+OJJPWrKhPo9ogP3qnPwBZ0uRiVSSVthDErvje2pi U4MC/ANyOQEG9KSljr/um1rLmTWK5afPZgosdA32CVzbL+4UKZBZajSmNd2rgtLZ xnKHG593A9LRzGuj/J45Ek4/drksnVYzD347Cn9Obj2L/k16KegmHWO+GXmABrqs NNFnLQbiyFH9IGSsNT37jh2V3JoX+yXBinKgJS3IxMU7ubQUN/srnQ6zjOfRDJNJ z7xcMqGifAmtgabhjNUox5QJlxf5QMohsegP/weih4O3DGeq4QLJY8aJQDrIJhxj d/dPtWBwI/nGOnWinW1Qq59Vmq4v7FGXxBGIqIkIe7ao1IkHvHwtngj7IvKEySXN fZgbipFLZGsaexBJSFiTKVGSC+hGy7PMhzEzOW90pSMOXsqhY09F3DRGLA6B2QVg rkq1mUlAC2kPVVzCjN45JUbQtG6fMf6DOgFKdvnvT9/iOmAj2/sc5ZoqqAPnoXbo 10wMLNqZKeOMQMioVXA2QshRNwaypgVqeShCthcupSI2m73cbyjSzOyKT7YHReMM KHIfbmym656QyKqhLOQr =Rtmc -----END PGP SIGNATURE----- --MPkR1dXiUZqK+927--