From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvJ1t-0000P3-QU for qemu-devel@nongnu.org; Thu, 21 May 2015 01:28:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvJ1p-000598-Pj for qemu-devel@nongnu.org; Thu, 21 May 2015 01:28:25 -0400 Received: from cantor2.suse.de ([195.135.220.15]:40293 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvJ1p-000594-JN for qemu-devel@nongnu.org; Thu, 21 May 2015 01:28:21 -0400 Message-ID: <555D6CF0.9030001@suse.de> Date: Thu, 21 May 2015 07:28:16 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1432184528-31252-1-git-send-email-bharata@linux.vnet.ibm.com> <1432184528-31252-4-git-send-email-bharata@linux.vnet.ibm.com> In-Reply-To: <1432184528-31252-4-git-send-email-bharata@linux.vnet.ibm.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 3/3] 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 , qemu-devel@nongnu.org Cc: imammedo@redhat.com, zhugh.fnst@cn.fujitsu.com, ehabkost@redhat.com, agraf@suse.de, david@gibson.dropbear.id.au Am 21.05.2015 um 07:02 schrieb Bharata B Rao: > Move cpu_exec_init() call from instance_init to realize. This allows > any failures from cpu_exec_init() to be handled appropriately. > Also add corresponding cpu_exec_exit() call from unrealize. >=20 > Signed-off-by: Bharata B Rao > Reviewed-by: David Gibson > --- > 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 52d95ce..2b72f2d 100644 > --- a/target-ppc/translate_init.c > +++ b/target-ppc/translate_init.c > @@ -8928,6 +8928,11 @@ static void ppc_cpu_realizefn(DeviceState *dev, = Error **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,= Error **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; > @@ -9633,8 +9640,6 @@ static void ppc_cpu_initfn(Object *obj) > CPUPPCState *env =3D &cpu->env; > =20 > cs->env_ptr =3D env; > - cpu_exec_init(env, &error_abort); > - cpu->cpu_dt_id =3D cs->cpu_index; Commit message talks about movements, but not about dropping cpu_dt_id assignment - accidental or just missing an explanation? Regards, Andreas > =20 > env->msr_mask =3D pcc->msr_mask; > env->mmu_model =3D pcc->mmu_model; >=20 --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB 21284 (AG N=FCrnberg)