From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sx7g5-0003F3-GZ for qemu-devel@nongnu.org; Thu, 02 Aug 2012 22:31:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sx7g3-0005zJ-KK for qemu-devel@nongnu.org; Thu, 02 Aug 2012 22:31:49 -0400 Received: from ozlabs.org ([203.10.76.45]:51701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sx7g3-0005uZ-88 for qemu-devel@nongnu.org; Thu, 02 Aug 2012 22:31:47 -0400 Date: Fri, 3 Aug 2012 12:31:39 +1000 From: David Gibson Message-ID: <20120803023139.GG12733@truffala.fritz.box> References: <1343873409-8571-1-git-send-email-david@gibson.dropbear.id.au> <1343873409-8571-3-git-send-email-david@gibson.dropbear.id.au> <501AA071.3030406@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <501AA071.3030406@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/2] pseries: Use new hook to correct reset sequence List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: Igor Mammedov , qemu-devel@nongnu.org, anthony@codemonkey.ws, agraf@suse.de On Thu, Aug 02, 2012 at 05:44:49PM +0200, Andreas F=E4rber wrote: > Am 02.08.2012 04:10, schrieb David Gibson: > > A number of things need to occur during reset of the PAPR paravirtual= ized > > platform in a specific order. For example, the hash table needs to b= e > > cleared before the CPUs are reset, so that they initialize their regi= ster > > state correctly, and the CPUs need to have their main reset called be= fore > > we set up the entry point state on the boot cpu. We also need to hav= e > > the main qdev reset happen before the creation and installation of th= e > > device tree for the new boot, because we need the state of the device= s > > settled to correctly construct the device tree. > >=20 > > Currently reset of pseries is broken in a number of ways, and in othe= r > > cases works largely by accident. This patch uses the new QEMUMachine = reset > > hook to correct these problems, by replacing the several existing spa= pr > > reset hooks with one new machine hook which ensures that the various = stages > > happen in the correct order. > >=20 > > Signed-off-by: David Gibson > > --- > > hw/spapr.c | 66 +++++++++++++++++++++++++++++++++-----------------= ---------- > > 1 file changed, 36 insertions(+), 30 deletions(-) > >=20 > > diff --git a/hw/spapr.c b/hw/spapr.c > > index 2453bae..1e60ec1 100644 > > --- a/hw/spapr.c > > +++ b/hw/spapr.c > > @@ -582,29 +582,22 @@ static void spapr_reset_htab(sPAPREnvironment *= spapr) > > } > > } > > =20 > > -static void spapr_reset(void *opaque) > > +static void spapr_reset_cpu(CPUPPCState *env) > > { > > - sPAPREnvironment *spapr =3D (sPAPREnvironment *)opaque; > > - > > - /* Reset the hash table & recalc the RMA */ > > - spapr_reset_htab(spapr); > > - > > - /* Load the fdt */ > > - spapr_finalize_fdt(spapr, spapr->fdt_addr, spapr->rtas_addr, > > - spapr->rtas_size); > > -} > > - > > -static void spapr_cpu_reset(void *opaque) > > -{ > > - PowerPCCPU *cpu =3D opaque; > > - CPUPPCState *env =3D &cpu->env; > > + PowerPCCPU *cpu =3D container_of(env, PowerPCCPU, env); >=20 > NACK. Please don't undo the cleanups I have applied! Functions should > take a QOM PowerPCCPU, not its internal CPUPPCState. Fields are > gradually being moved from CPUxxxState into CPUState. Um, ok. So how do I iterate the PowerPCCPUs instead of the CPUPPCStates? --=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