[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 62/68] linux-user/nios2: Handle various SIGILL exceptions
From: |
Richard Henderson |
Subject: |
[PATCH v8 62/68] linux-user/nios2: Handle various SIGILL exceptions |
Date: |
Fri, 22 Apr 2022 09:52:32 -0700 |
We missed out on a couple of exception types that may
legitimately be raised by a userland program.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220421151735.31996-59-richard.henderson@linaro.org>
---
linux-user/nios2/cpu_loop.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c
index a5e86990e2..da77ede76b 100644
--- a/linux-user/nios2/cpu_loop.c
+++ b/linux-user/nios2/cpu_loop.c
@@ -50,6 +50,18 @@ void cpu_loop(CPUNios2State *env)
env->ctrl[CR_BADADDR]);
break;
+ case EXCP_ILLEGAL:
+ case EXCP_UNIMPL:
+ /* Match kernel's handle_illegal_c(). */
+ env->pc -= 4;
+ force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->pc);
+ break;
+ case EXCP_SUPERI:
+ /* Match kernel's handle_supervisor_instr(). */
+ env->pc -= 4;
+ force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVOPC, env->pc);
+ break;
+
case EXCP_TRAP:
switch (env->error_code) {
case 0:
--
2.34.1
- [PATCH v8 50/68] target/nios2: Drop CR_STATUS_EH from tb->flags, (continued)
- [PATCH v8 50/68] target/nios2: Drop CR_STATUS_EH from tb->flags, Richard Henderson, 2022/04/22
- [PATCH v8 54/68] target/nios2: Use gen_goto_tb for DISAS_TOO_MANY, Richard Henderson, 2022/04/22
- [PATCH v8 53/68] target/nios2: Hoist set of is_jmp into gen_goto_tb, Richard Henderson, 2022/04/22
- [PATCH v8 56/68] target/nios2: Implement Misaligned destination exception, Richard Henderson, 2022/04/22
- [PATCH v8 55/68] target/nios2: Use tcg_gen_lookup_and_goto_ptr, Richard Henderson, 2022/04/22
- [PATCH v8 57/68] target/nios2: Introduce shadow register sets, Richard Henderson, 2022/04/22
- [PATCH v8 59/68] target/nios2: Update helper_eret for shadow registers, Richard Henderson, 2022/04/22
- [PATCH v8 58/68] target/nios2: Implement rdprs, wrprs, Richard Henderson, 2022/04/22
- [PATCH v8 60/68] target/nios2: Implement EIC interrupt processing, Richard Henderson, 2022/04/22
- [PATCH v8 61/68] target/nios2: Advance pc when raising exceptions, Richard Henderson, 2022/04/22
- [PATCH v8 62/68] linux-user/nios2: Handle various SIGILL exceptions,
Richard Henderson <=
- [PATCH v8 63/68] hw/intc: Vectored Interrupt Controller (VIC), Richard Henderson, 2022/04/22
- [PATCH v8 64/68] hw/nios2: Introduce Nios2MachineState, Richard Henderson, 2022/04/22
- [PATCH v8 66/68] hw/nios2: Machine with a Vectored Interrupt Controller, Richard Henderson, 2022/04/22
- [PATCH v8 65/68] hw/nios2: Move memory regions into Nios2Machine, Richard Henderson, 2022/04/22
- [PATCH v8 67/68] tests/tcg/nios2: Add semihosting multiarch tests, Richard Henderson, 2022/04/22
- [PATCH v8 68/68] tests/tcg/nios2: Add test-shadow-1, Richard Henderson, 2022/04/22