From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qvj1h-0000T4-5F for qemu-devel@nongnu.org; Tue, 23 Aug 2011 00:55:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qvj1g-0003p2-5K for qemu-devel@nongnu.org; Tue, 23 Aug 2011 00:55:49 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44832 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qvj1f-0003ot-NZ for qemu-devel@nongnu.org; Tue, 23 Aug 2011 00:55:48 -0400 From: Alexander Graf Date: Tue, 23 Aug 2011 06:55:44 +0200 Message-Id: <1314075344-20839-4-git-send-email-agraf@suse.de> In-Reply-To: <1314075344-20839-3-git-send-email-agraf@suse.de> References: <1314075344-20839-1-git-send-email-agraf@suse.de> <1314075344-20839-2-git-send-email-agraf@suse.de> <1314075344-20839-3-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 3/3] PPC: E500: Set ESR values List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: scottwood@freescale.com When an exception occurs on BookE, we need to set ESR bits to expose to the guest information on what exactly happened. Add the obvious ones. Reported-by: Jason Wessel Signed-off-by: Alexander Graf --- target-ppc/helper.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/target-ppc/helper.c b/target-ppc/helper.c index c23d4a4..5ec83f2 100644 --- a/target-ppc/helper.c +++ b/target-ppc/helper.c @@ -2484,16 +2484,19 @@ static inline void powerpc_excp(CPUState *env, int excp_model, int excp) if (lpes1 == 0) new_msr |= (target_ulong)MSR_HVB; msr |= 0x00080000; + env->spr[SPR_BOOKE_ESR] = ESR_PIL; break; case POWERPC_EXCP_PRIV: if (lpes1 == 0) new_msr |= (target_ulong)MSR_HVB; msr |= 0x00040000; + env->spr[SPR_BOOKE_ESR] = ESR_PPR; break; case POWERPC_EXCP_TRAP: if (lpes1 == 0) new_msr |= (target_ulong)MSR_HVB; msr |= 0x00020000; + env->spr[SPR_BOOKE_ESR] = ESR_PTR; break; default: /* Should never occur */ @@ -2556,16 +2559,19 @@ static inline void powerpc_excp(CPUState *env, int excp_model, int excp) cpu_abort(env, "Debug exception is not implemented yet !\n"); goto store_next; case POWERPC_EXCP_SPEU: /* SPE/embedded floating-point unavailable */ + env->spr[SPR_BOOKE_ESR] = ESR_SPV; goto store_current; case POWERPC_EXCP_EFPDI: /* Embedded floating-point data interrupt */ /* XXX: TODO */ cpu_abort(env, "Embedded floating point data exception " "is not implemented yet !\n"); + env->spr[SPR_BOOKE_ESR] = ESR_SPV; goto store_next; case POWERPC_EXCP_EFPRI: /* Embedded floating-point round interrupt */ /* XXX: TODO */ cpu_abort(env, "Embedded floating point round exception " "is not implemented yet !\n"); + env->spr[SPR_BOOKE_ESR] = ESR_SPV; goto store_next; case POWERPC_EXCP_EPERFM: /* Embedded performance monitor interrupt */ /* XXX: TODO */ -- 1.6.0.2