From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoL6w-0003Hh-M1 for qemu-devel@nongnu.org; Thu, 07 Apr 2016 21:21:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aoL6t-0004fG-FM for qemu-devel@nongnu.org; Thu, 07 Apr 2016 21:21:22 -0400 Date: Fri, 8 Apr 2016 11:22:28 +1000 From: David Gibson Message-ID: <20160408012228.GC3332@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> <57063A55.7000606@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UFHRwCdBEJvubb2X" Content-Disposition: inline In-Reply-To: <57063A55.7000606@redhat.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: Laurent Vivier Cc: =?iso-8859-1?Q?C=E9dric?= Le Goater , peter.maydell@linaro.org, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org, pbonzini@redhat.com --UFHRwCdBEJvubb2X Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 07, 2016 at 12:45:41PM +0200, Laurent Vivier wrote: >=20 >=20 > On 07/04/2016 12:27, C=E9dric Le Goater wrote: > > Hello Laurent, > >=20 > > On 04/07/2016 11:13 AM, Laurent Vivier wrote: > >> > >> > >> 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. > >> > >> I know it's a little bit late to comment this patch but: > >> > >> what about the initialization of the NIP in ppc_cpu_reset()? > >> > >> env->nip =3D env->hreset_vector | env->excp_prefix; > >> > >> on POWER8 "env->excp_prefix" is always 0, but LPCR can have an AIL def= ined? > >=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 th= e=20 > > H_SET_MODE hcall from the guest kernel to set the AIL bits back in LPCR= =2E=20 > > It looks fine to me but I might be missing something.=20 >=20 > What I mean is if we want to keep the previous behavior we should have > something like: >=20 > env->nip =3D env->hreset_vector | env->excp_prefix; > #if defined(TARGET_PPC64) > switch((env->spr[SPR_LPCR] & LPCR_AIL) >> LPCR_AIL_SHIFT) { > case AIL_0001_8000: > env->nip |=3D 0x18000; > break; > case AIL_C000_0000_0000_4000: > env->nip |=3D 0xc000000000004000ull; > break; > } > #endif >=20 > But I don't know how behaves really a POWER8. I'm pretty certain the previous behaviour was wrong. The LPCR AIL bits shouldn't survive a reset, so the new NIP after the reset should be based on a cleared AIL. --=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 --UFHRwCdBEJvubb2X Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXBwfTAAoJEGw4ysog2bOS3K0P/2N23ThF/MfhZs6Aoymd73es VpQgD9UySHhZxawPO7x/Psd6CSDlOGKdM/27xXdrMfwQjK5BOdDoCrDq8YuQTCpq GHZmnQjftGNm/+JJ2gmnE6YgZqn83NZlV61eiZigVATaKfL3g+qr+7lUIWWgVe22 DFOw9EqCb2BAqxIiUu7qHTm/lYhPoTPQqmASH6iVRmCdwmcZT8mXvmOiiMscpYmn bmExU6aRx9dRX6NM2Su7rONThsBUabOUKA3cnVCcT3ajzmKRMrMj4UpeJOZ7wLTC M4PqYzojTuepZoeXeXBCHzLDUVHZiyqAavJHvVxGVkil/Ph5iNmb9mVxZKfbCNzZ 0JlgEUmtI1+deDte4T2ODiQULxXVT+pl3IhAvsqRFSFIj2T2FKKHiwOg5FQvg3M8 9ik4As2F9Xa1LYc9aY9RddHv21807IykhLy0KmG6taiFqpwGBbdlIIpuPcHN3KSx /aGu1+4J7eD0Ouh5MFyn+vDZs9WyF/wxtOr8lkOJDq0zMO1g0uv2P59kxS+cTHt/ vQO3cGD3qFlDcpkW+NznqEYgl7G5ZXJLpVhqmT9zQPN4gkzTQeZerCe/TQqBUKyR RpyvcTxva5VzC1MYz+mvhHMjnaAdgCEP+/wMNR/anYDTuPK3l+QBbgt9NKo8Uc4c OHN8kzWmqiJMlAikJWSL =GyXq -----END PGP SIGNATURE----- --UFHRwCdBEJvubb2X--