From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yabvn-0003dx-CC for qemu-devel@nongnu.org; Tue, 24 Mar 2015 23:24:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yabvb-0002Dl-7A for qemu-devel@nongnu.org; Tue, 24 Mar 2015 23:24:35 -0400 Date: Wed, 25 Mar 2015 14:25:09 +1100 From: David Gibson Message-ID: <20150325032509.GZ25043@voom.fritz.box> References: <1427117764-23008-1-git-send-email-bharata@linux.vnet.ibm.com> <1427117764-23008-16-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ui+0LsrIBWBNb/ay" Content-Disposition: inline In-Reply-To: <1427117764-23008-16-git-send-email-bharata@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [RFC PATCH v2 15/23] ppc: Move cpu_exec_init() call to realize function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: mdroth@linux.vnet.ibm.com, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com, imammedo@redhat.com, afaerber@suse.de --ui+0LsrIBWBNb/ay Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 23, 2015 at 07:05:56PM +0530, Bharata B Rao wrote: > Move cpu_exec_init() call from instance_init to realize. This allows > any failures from cpu_exec_init() to be handled appropriately. >=20 > Also add cpu_exec_exit() call from unrealize. This still leaves all non-ppc archs not ever calling cpu_exec_exit(). >=20 > Signed-off-by: Bharata B Rao > --- > target-ppc/translate_init.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) >=20 > diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c > index 9f4f172..fccee82 100644 > --- a/target-ppc/translate_init.c > +++ b/target-ppc/translate_init.c > @@ -8928,6 +8928,11 @@ static void ppc_cpu_realizefn(DeviceState *dev, Er= ror **errp) > return; > } > =20 > + cpu_exec_init(&cpu->env, &local_err); > + if (local_err !=3D NULL) { > + error_propagate(errp, local_err); > + return; > + } > cpu->cpu_dt_id =3D (cs->cpu_index / smp_threads) * max_smt > + (cs->cpu_index % smp_threads); > #endif > @@ -9141,6 +9146,8 @@ static void ppc_cpu_unrealizefn(DeviceState *dev, E= rror **errp) > opc_handler_t **table; > int i, j; > =20 > + cpu_exec_exit(CPU(dev)); > + > for (i =3D 0; i < PPC_CPU_OPCODES_LEN; i++) { > if (env->opcodes[i] =3D=3D &invalid_handler) { > continue; > @@ -9679,8 +9686,6 @@ static void ppc_cpu_initfn(Object *obj) > CPUPPCState *env =3D &cpu->env; > =20 > cs->env_ptr =3D env; > - cpu_exec_init(env, NULL); > - cpu->cpu_dt_id =3D cs->cpu_index; > =20 > env->msr_mask =3D pcc->msr_mask; > env->mmu_model =3D pcc->mmu_model; --=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 --ui+0LsrIBWBNb/ay Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVEiqUAAoJEGw4ysog2bOSyDAP/RXdqTAwBUaCz5VZ0IurDsl2 YrK1Hap0hbh/XW4o88mWqzmpBl8zprJ88Am/SnfgXVKzySWf5xAukdyUn+J4HoJ4 cp3QwxPkV1/EOm3dmuRNstxz3XCQk5RqV5YK7zxwsxUYoE3YMSiFkC5oCRxluOn9 0kdc5IoN3MWWEo96oxJd5PEIDSfDK8Wu5x6apcDnjiHfwYjpJAIIEArqQRj/kCfZ sY/VXNiE11JdrXXghQqrZwDcJebj7xKcVyLsXVtn5m8kNVw0Nfma6RlG2Au6lTlV hgDqiGVpnAO+kaBZSsLsvAdTCzFHnCxFoFixGf5X+2yrnr0mTbbt3QPCbzx1YYi1 43R4lkZVlGq/IlknOC/M4xw+G/5y2z/JStMwD+81quukPePaEyXN+Q98+aTACwjU uNFhdUogHTKyGZoV/DXqxdty4YLsRQi9bkdHzbl9Q4nyvDO4fS31gcNYyJnty2HH W0Gcf18BglpZVPyYIZNeUwoIUETWOw1AiSGkOuFi7bTtzoAZ+mD3jTMr6UP94Ylt r6Qkc1798SLDUZhr8oEVjHBhzX472COKzR2dNjvPTZ37CPYWqwqavZcQRUZHkbA3 5jO4Q0xJCdqrAKU/EJK4BTQxyATK/EUYp4qvY49Dn7152GWSJHz5dwc73qLx1Ooi 81Z4cGJn6OCIQHXyiI2t =IFBZ -----END PGP SIGNATURE----- --ui+0LsrIBWBNb/ay--