[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 2/8] linux-user/sparc: Raise SIGILL for all unhandled software
From: |
Richard Henderson |
Subject: |
[PULL v2 2/8] linux-user/sparc: Raise SIGILL for all unhandled software traps |
Date: |
Tue, 21 Feb 2023 16:00:17 -1000 |
The linux kernel's trap tables vector all unassigned trap
numbers to BAD_TRAP, which then raises SIGILL.
Tested-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reported-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/sparc/cpu_loop.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c
index 434c90a55f..c120c42278 100644
--- a/linux-user/sparc/cpu_loop.c
+++ b/linux-user/sparc/cpu_loop.c
@@ -248,6 +248,14 @@ void cpu_loop (CPUSPARCState *env)
cpu_exec_step_atomic(cs);
break;
default:
+ /*
+ * Most software trap numbers vector to BAD_TRAP.
+ * Handle anything not explicitly matched above.
+ */
+ if (trapnr >= TT_TRAP && trapnr <= TT_TRAP + 0x7f) {
+ force_sig_fault(TARGET_SIGILL, ILL_ILLTRP, env->pc);
+ break;
+ }
fprintf(stderr, "Unhandled trap: 0x%x\n", trapnr);
cpu_dump_state(cs, stderr, 0);
exit(EXIT_FAILURE);
--
2.34.1
- [PULL v2 0/8] tcg patch queue, Richard Henderson, 2023/02/21
- [PULL v2 1/8] accel/tcg: Allow the second page of an instruction to be MMIO, Richard Henderson, 2023/02/21
- [PULL v2 2/8] linux-user/sparc: Raise SIGILL for all unhandled software traps,
Richard Henderson <=
- [PULL v2 3/8] linux-user: Always exit from exclusive state in fork_end(), Richard Henderson, 2023/02/21
- [PULL v2 5/8] linux-user/microblaze: Handle privileged exception, Richard Henderson, 2023/02/21
- [PULL v2 4/8] cpus: Make {start,end}_exclusive() recursive, Richard Henderson, 2023/02/21
- [PULL v2 6/8] target/microblaze: Add gdbstub xml, Richard Henderson, 2023/02/21
- [PULL v2 7/8] util/cacheflush: fix cache on windows-arm64, Richard Henderson, 2023/02/21
- [PULL v2 8/8] sysemu/os-win32: fix setjmp/longjmp on windows-arm64, Richard Henderson, 2023/02/21
- Re: [PULL v2 0/8] tcg patch queue, Peter Maydell, 2023/02/24