[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/18] target-alpha: Set PC correctly for floating-po
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 02/18] target-alpha: Set PC correctly for floating-point exceptions |
Date: |
Wed, 9 Jul 2014 09:20:18 -0700 |
PC should be one past the faulting insn. Add better commentary
for the machine-check exception path.
Reported-by: Al Viro <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
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 7c053a3..8d1df2d 100644
--- a/target-alpha/helper.c
+++ b/target-alpha/helper.c
@@ -527,6 +527,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
--
1.9.3
- [Qemu-devel] [PULL for-2.1 00/18] target-alpha patch queue, Richard Henderson, 2014/07/10
- [Qemu-devel] [PULL 07/18] target-alpha: Fix cvttq vs large integers, Richard Henderson, 2014/07/09
- [Qemu-devel] [PULL 06/18] target-alpha: Raise IOV from CVTTQ, Richard Henderson, 2014/07/09
- [Qemu-devel] [PULL 08/18] target-alpha: Fix cvttq vs inf, Richard Henderson, 2014/07/09
- Message not available
- Re: [Qemu-devel] [PULL for-2.1 00/18] target-alpha patch queue, Peter Maydell, 2014/07/09
- [Qemu-devel] [PULL 10/18] target-alpha: Implement WH64EN, Richard Henderson, 2014/07/09
- [Qemu-devel] [PULL 04/18] target-alpha: Set fpcr_exc_status even for disabled exceptions, Richard Henderson, 2014/07/09
- [Qemu-devel] [PULL 02/18] target-alpha: Set PC correctly for floating-point exceptions,
Richard Henderson <=
- [Qemu-devel] [PULL 16/18] target-alpha: Rename fcvtql, Richard Henderson, 2014/07/09
- [Qemu-devel] [PULL 15/18] target-alpha: Raise IOV from CVTQL, Richard Henderson, 2014/07/09
- [Qemu-devel] [PULL 11/18] target-alpha: Disallow literal operand to 1C.30 to 1C.37, Richard Henderson, 2014/07/09
- [Qemu-devel] [PULL 17/18] target-alpha: Fix fpcr_flush_to_zero initialization, Richard Henderson, 2014/07/09
- [Qemu-devel] [PULL 18/18] target-alpha: Remove DNOD bit from FPCR, Richard Henderson, 2014/07/09
- [Qemu-devel] [PULL 09/18] target-alpha: Fix integer overflow checking insns, Richard Henderson, 2014/07/10
- [Qemu-devel] [PULL 05/18] target-alpha: Set EXC_M_SWC for exceptions from /S insns, Richard Henderson, 2014/07/10
- [Qemu-devel] [PULL 14/18] target-alpha: Suppress underflow from CVTTQ if DNZ, Richard Henderson, 2014/07/10
- [Qemu-devel] [PULL 13/18] target-alpha: Raise EXC_M_INV properly for fp inputs, Richard Henderson, 2014/07/10
- [Qemu-devel] [PULL 01/18] target-alpha: Forget installed round mode after MT_FPCR, Richard Henderson, 2014/07/10