[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 32/41] linux-user/openrisc: Adjust signal for EXCP_RANGE, EXCP
From: |
Richard Henderson |
Subject: |
[PATCH v2 32/41] linux-user/openrisc: Adjust signal for EXCP_RANGE, EXCP_FPE |
Date: |
Sat, 18 Sep 2021 11:45:18 -0700 |
The kernel vectors both of these through unhandled_exception, which
results in force_sig(SIGSEGV). This isn't very useful for userland
when enabling overflow traps or fpu traps, but c'est la vie.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/openrisc/cpu_loop.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/linux-user/openrisc/cpu_loop.c b/linux-user/openrisc/cpu_loop.c
index b33fa77718..314e7fba1e 100644
--- a/linux-user/openrisc/cpu_loop.c
+++ b/linux-user/openrisc/cpu_loop.c
@@ -21,6 +21,7 @@
#include "qemu-common.h"
#include "qemu.h"
#include "cpu_loop-common.h"
+#include "signal-common.h"
void cpu_loop(CPUOpenRISCState *env)
{
@@ -54,13 +55,17 @@ void cpu_loop(CPUOpenRISCState *env)
break;
case EXCP_DPF:
case EXCP_IPF:
- case EXCP_RANGE:
info.si_signo = TARGET_SIGSEGV;
info.si_errno = 0;
info.si_code = TARGET_SEGV_MAPERR;
info._sifields._sigfault._addr = env->pc;
queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
break;
+ case EXCP_RANGE:
+ case EXCP_FPE:
+ /* ??? The kernel vectors both of these to unhandled_exception. */
+ force_sig(TARGET_SIGSEGV);
+ break;
case EXCP_ALIGN:
info.si_signo = TARGET_SIGBUS;
info.si_errno = 0;
@@ -75,13 +80,6 @@ void cpu_loop(CPUOpenRISCState *env)
info._sifields._sigfault._addr = env->pc;
queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
break;
- case EXCP_FPE:
- info.si_signo = TARGET_SIGFPE;
- info.si_errno = 0;
- info.si_code = 0;
- info._sifields._sigfault._addr = env->pc;
- queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
- break;
case EXCP_INTERRUPT:
/* We processed the pending cpu work above. */
break;
--
2.25.1
- [PATCH v2 35/41] target/riscv: Make riscv_cpu_tlb_fill sysemu only, (continued)
- [PATCH v2 35/41] target/riscv: Make riscv_cpu_tlb_fill sysemu only, Richard Henderson, 2021/09/18
- [PATCH v2 27/41] target/i386: Implement x86_cpu_record_sigsegv, Richard Henderson, 2021/09/18
- [PATCH v2 36/41] target/s390x: Use probe_access_flags in s390_probe_access, Richard Henderson, 2021/09/18
- [PATCH v2 39/41] target/sparc: Make sparc_cpu_tlb_fill sysemu only, Richard Henderson, 2021/09/18
- [PATCH v2 30/41] target/mips: Make mips_cpu_tlb_fill sysemu only, Richard Henderson, 2021/09/18
- [PATCH v2 28/41] target/m68k: Make m68k_cpu_tlb_fill sysemu only, Richard Henderson, 2021/09/18
- [PATCH v2 37/41] target/s390x: Implement s390_cpu_record_sigsegv, Richard Henderson, 2021/09/18
- [PATCH v2 38/41] target/sh4: Make sh4_cpu_tlb_fill sysemu only, Richard Henderson, 2021/09/18
- [PATCH v2 32/41] linux-user/openrisc: Adjust signal for EXCP_RANGE, EXCP_FPE,
Richard Henderson <=
- [PATCH v2 31/41] target/nios2: Make nios2_cpu_tlb_fill sysemu only, Richard Henderson, 2021/09/18
- [PATCH v2 25/41] target/hexagon: Remove hexagon_cpu_tlb_fill, Richard Henderson, 2021/09/18
- [PATCH v2 34/41] target/ppc: Implement ppc_cpu_record_sigsegv, Richard Henderson, 2021/09/18
- [PATCH v2 33/41] target/openrisc: Make openrisc_cpu_tlb_fill sysemu only, Richard Henderson, 2021/09/18
- [PATCH v2 40/41] target/xtensa: Make xtensa_cpu_tlb_fill sysemu only, Richard Henderson, 2021/09/18
- [PATCH v2 41/41] accel/tcg: Restrict TCGCPUOps::tlb_fill() to sysemu, Richard Henderson, 2021/09/18
- Re: [PATCH v2 00/41] linux-user: Streamline handling of SIGSEGV, Philippe Mathieu-Daudé, 2021/09/19