From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoL7F-0003pp-D2 for qemu-devel@nongnu.org; Thu, 07 Apr 2016 21:21:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aoL7E-0004sL-EI for qemu-devel@nongnu.org; Thu, 07 Apr 2016 21:21:41 -0400 Date: Fri, 8 Apr 2016 11:20:51 +1000 From: David Gibson Message-ID: <20160408012051.GB3332@voom.fritz.box> References: <1459822643-4770-1-git-send-email-david@gibson.dropbear.id.au> <1459822643-4770-2-git-send-email-david@gibson.dropbear.id.au> <570624CF.6020703@redhat.com> <57063616.70109@fr.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cmJC7u66zC7hs+87" Content-Disposition: inline In-Reply-To: <57063616.70109@fr.ibm.com> Subject: Re: [Qemu-devel] [Qemu-ppc] [PULL 1/3] ppc: Rework POWER7 & POWER8 exception model List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?C=E9dric?= Le Goater Cc: Laurent Vivier , peter.maydell@linaro.org, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org, pbonzini@redhat.com --cmJC7u66zC7hs+87 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 07, 2016 at 12:27:34PM +0200, C=E9dric Le Goater wrote: > Hello Laurent, >=20 > On 04/07/2016 11:13 AM, Laurent Vivier wrote: > >=20 > >=20 > > On 05/04/2016 04:17, David Gibson wrote: > >> From: C=E9dric Le Goater > >> > >> From: Benjamin Herrenschmidt > >> > >> This patch fixes the current AIL implementation for POWER8. The > >> interrupt vector address can be calculated directly from LPCR when the > >> exception is handled. The excp_prefix update becomes useless and we > >> can cleanup the H_SET_MODE hcall. > >=20 > > I know it's a little bit late to comment this patch but: > >=20 > > what about the initialization of the NIP in ppc_cpu_reset()? > >=20 > > env->nip =3D env->hreset_vector | env->excp_prefix; > >=20 > > on POWER8 "env->excp_prefix" is always 0, but LPCR can have an AIL defi= ned? >=20 > yes. env->spr[SPR_LPCR] still has the previous value at that time and=20 > it is reseted right below in the same routine.=20 >=20 > The cpu should restart in a valid state after that and later on, use the= =20 > H_SET_MODE hcall from the guest kernel to set the AIL bits back in LPCR.= =20 > It looks fine to me but I might be missing something. Right.. it's kind of a case of two bugs cancelling each other out, but the end result is correct. The initial NIP should include the AIL =66rom the LPCR.. but the AIL should be cleared on reset, so it makes no practical difference. So in 2.7 it would certainly be good to clean this up for clarity if nothing else, but I don't see something that needs fixing in the 2.6 timeframe. --=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 --cmJC7u66zC7hs+87 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXBwdzAAoJEGw4ysog2bOSXZcP/3gNIrPzNB+LPeqMoeXUyh/U +zoKBeH7fQj/p++72PeY/wYzbY6WU3dVPuxyrdImYEgR3zqw9qD8n9/5lkzuvKyj CLcxS0DqVYA/wgOr8NsuHwT5ppdj7xCcJPtdcYfAA/yINkCt3pFZPEqwL0VVwh3S Vlxt5jeJagsQqoscnJ5R8OqL1IRf3zy8uARu35WjjfyDO+9N46VvnCOaAuACJ3dN oQyDVTNAbNRbSTAIf6WY73EBeYUKfIklY/usDRl+nf9oNTyr6ZOI8RIvmkclexIp ZJGknSHZw6QOQ2X5QZjnKrg9j+PiZ1CyH77lLYHNTRa9tbUof19ZKoF3/rJ/8Uus GGOBDtM9hV6VroUvQceqOWidJUL9bD/k9aKA121ygU61gywy40mBzG8KnDGWWFYD 1Xqxg9UpK/QhkL+WlfUEImgo7FIgwhTP3AWKLScKtQtEaHDRkvZY1MB2nYF7Z/V4 QFhZiM1pQrI2iFt7YZ2h9rtv297Muouom2cbyYrHTfkkLmREn/RKNRXpZyLMJKME ke9p+k+dgGdiThR7hU/UswY+v7X3FCvj5LI7wU3MInbRxAItnqZ4ryXhfKEzLUl6 TGo6Iy4IsCE4VD9QP83p60fcnPQALSt7ckHhHrc6vaxSEDsFWN/1GFmrKMemoMJJ TRx/5lyidXZSy6yBRd63 =pPWy -----END PGP SIGNATURE----- --cmJC7u66zC7hs+87--