Received: from eggs.gnu.org ([208.118.235.92]:50543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKqu9-0001X2-NB for qemu-devel@nongnu.org; Wed, 27 Mar 2013 10:00:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKqu8-00077m-Dj for qemu-devel@nongnu.org; Wed, 27 Mar 2013 10:00:41 -0400 Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: Date: Wed, 27 Mar 2013 15:00:37 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <4427FBE0-BA0D-4BFD-9D7C-F1406DF5239A@suse.de> References: <1364392235-6193-1-git-send-email-chouteau@adacore.com> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] PPC: init_excp_7x0: fix hreset entry point. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 27.03.2013, at 14:54, Alexander Graf wrote: >=20 > On 27.03.2013, at 14:50, Fabien Chouteau wrote: >=20 >> According to the PowePC 750 user's manual, the vector offset for = system >=20 > PowerPC? >=20 >> reset (both /HRESET and /SRESET) is 0x00100. >>=20 >> Signed-off-by: Fabien Chouteau >> --- >> target-ppc/translate_init.c | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) >>=20 >> diff --git a/target-ppc/translate_init.c = b/target-ppc/translate_init.c >> index 781170f..a5bae1e 100644 >> --- a/target-ppc/translate_init.c >> +++ b/target-ppc/translate_init.c >> @@ -2885,7 +2885,7 @@ static void init_excp_7x0 (CPUPPCState *env) >> env->excp_vectors[POWERPC_EXCP_THERM] =3D 0x00001700; >> env->hreset_excp_prefix =3D 0x00000000UL; >> /* Hardware reset vector */ >> - env->hreset_vector =3D 0xFFFFFFFCUL; >> + env->hreset_vector =3D 0xFFF00100UL; >=20 > As you properly explained above, the reset vector is 0x100 according = to the spec. However, hreset_excp_prefix is 0x0. How do we end up = getting to 0xfff00100 here? According to 7xx_um.pdf (740 / 750 User manual), the IP bit in MSR (bit = 25 in ppc notion) controls whether excp_prefix is 0xfff00000 or = 0x00000000. The spec also says: When either HRESET is negated or SRESET transitions to asserted, the = processor attempts to fetch code from the system reset exception vector. = The vector is located at offset 0x00100 from the exception prefix (all = zeros or ones, depending on the setting of the exception prefix bit in = the machine state register (MSR[IP]). The MSR[IP] bit is set for HRESET. So on reset, MSR[IP] =3D 1. That means that hreset_excp_prefix is also = wrong here. Please add the respective logic that sets hreset_excp_prefix according = to MSR[IP] on 740 / 750, otherwise whatever you're trying to execute = will break as soon as it gets its first real exception :). Alex