From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPu9e-00049H-3K for qemu-devel@nongnu.org; Fri, 05 Sep 2014 10:06:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPu9T-0004Tb-T4 for qemu-devel@nongnu.org; Fri, 05 Sep 2014 10:06:22 -0400 From: Pierre Mallard Date: Fri, 5 Sep 2014 15:45:17 +0200 Message-Id: <1409924717-9133-1-git-send-email-mallard.pierre@gmail.com> Subject: [Qemu-devel] [PATCH] target-ppc : Make hreg_store_msr returns exception List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Pierre Mallard , tommusta@gmail.com hreg_store_msr was both returning 0 or an exception number which could be POWERPC_EXCP_NONE. In case POWERPC_EXCP_NONE was returned, helper_store_msr was handling uncorrectly this return value and raise an exception. This patch correct this behavior by making hreg_store_msr always return an exception number, and helper_store_msr test for POWERPC_EXCP_NONE. Signed-off-by: Pierre Mallard --- target-ppc/excp_helper.c | 2 +- target-ppc/helper_regs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c index 922e86d..f76942b 100644 --- a/target-ppc/excp_helper.c +++ b/target-ppc/excp_helper.c @@ -855,7 +855,7 @@ void helper_store_msr(CPUPPCState *env, target_ulong val) CPUState *cs; val = hreg_store_msr(env, val, 0); - if (val != 0) { + if (val != POWERPC_EXCP_NONE) { cs = CPU(ppc_env_get_cpu(env)); cs->interrupt_request |= CPU_INTERRUPT_EXITTB; helper_raise_exception(env, val); diff --git a/target-ppc/helper_regs.h b/target-ppc/helper_regs.h index 271fddf..36a522a 100644 --- a/target-ppc/helper_regs.h +++ b/target-ppc/helper_regs.h @@ -72,7 +72,7 @@ static inline int hreg_store_msr(CPUPPCState *env, target_ulong value, CPUState *cs = CPU(ppc_env_get_cpu(env)); #endif - excp = 0; + excp = POWERPC_EXCP_NONE; value &= env->msr_mask; #if !defined(CONFIG_USER_ONLY) if (!alter_hv) { -- 1.7.10.4