From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsEAS-0007Y5-AG for qemu-devel@nongnu.org; Tue, 12 May 2015 13:40:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsEAR-0007fi-2x for qemu-devel@nongnu.org; Tue, 12 May 2015 13:40:32 -0400 Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]:32985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsEAQ-0007fT-RS for qemu-devel@nongnu.org; Tue, 12 May 2015 13:40:30 -0400 Received: by qkx62 with SMTP id 62so10942179qkx.0 for ; Tue, 12 May 2015 10:40:30 -0700 (PDT) Received: from anchor.com (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPSA id f4sm13701736qhe.9.2015.05.12.10.40.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2015 10:40:29 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Tue, 12 May 2015 10:39:34 -0700 Message-Id: <1431452387-20280-5-git-send-email-rth@twiddle.net> In-Reply-To: <1431452387-20280-1-git-send-email-rth@twiddle.net> References: <1431452387-20280-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH v2 04/17] target-alpha: Set PC correctly for floating-point exceptions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org PC should be one past the faulting insn. Add better commentary for the machine-check exception path. Reported-by: Al Viro Signed-off-by: Richard Henderson --- target-alpha/helper.c | 2 ++ target-alpha/mem_helper.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/target-alpha/helper.c b/target-alpha/helper.c index a8aa782..e202fee 100644 --- a/target-alpha/helper.c +++ b/target-alpha/helper.c @@ -571,6 +571,8 @@ void QEMU_NORETURN dynamic_excp(CPUAlphaState *env, uintptr_t retaddr, env->error_code = error; if (retaddr) { cpu_restore_state(cs, retaddr); + /* Floating-point exceptions (our only users) point to the next PC. */ + env->pc += 4; } cpu_loop_exit(cs); } diff --git a/target-alpha/mem_helper.c b/target-alpha/mem_helper.c index fc4f57a..7b5e30d 100644 --- a/target-alpha/mem_helper.c +++ b/target-alpha/mem_helper.c @@ -128,7 +128,14 @@ void alpha_cpu_unassigned_access(CPUState *cs, hwaddr addr, env->trap_arg0 = addr; env->trap_arg1 = is_write ? 1 : 0; - dynamic_excp(env, 0, EXCP_MCHK, 0); + cs->exception_index = EXCP_MCHK; + env->error_code = 0; + + /* ??? We should cpu_restore_state to the faulting insn, but this hook + does not have access to the retaddr value from the orignal helper. + It's all moot until the QEMU PALcode grows an MCHK handler. */ + + cpu_loop_exit(cs); } /* try to fill the TLB and return an exception if error. If retaddr is -- 2.1.0