[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 62/68] linux-user/nios2: Handle various SIGILL exceptions
From: |
Richard Henderson |
Subject: |
[PULL 62/68] linux-user/nios2: Handle various SIGILL exceptions |
Date: |
Tue, 26 Apr 2022 11:19:01 -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
- [PULL 54/68] target/nios2: Use gen_goto_tb for DISAS_TOO_MANY, (continued)
- [PULL 54/68] target/nios2: Use gen_goto_tb for DISAS_TOO_MANY, Richard Henderson, 2022/04/26
- [PULL 64/68] hw/nios2: Introduce Nios2MachineState, Richard Henderson, 2022/04/26
- [PULL 45/68] target/nios2: Split out helpers for gen_i_math_logic, Richard Henderson, 2022/04/26
- [PULL 50/68] target/nios2: Drop CR_STATUS_EH from tb->flags, Richard Henderson, 2022/04/26
- [PULL 52/68] target/nios2: Create gen_jumpr, Richard Henderson, 2022/04/26
- [PULL 57/68] target/nios2: Introduce shadow register sets, Richard Henderson, 2022/04/26
- [PULL 55/68] target/nios2: Use tcg_gen_lookup_and_goto_ptr, Richard Henderson, 2022/04/26
- [PULL 59/68] target/nios2: Update helper_eret for shadow registers, Richard Henderson, 2022/04/26
- [PULL 60/68] target/nios2: Implement EIC interrupt processing, Richard Henderson, 2022/04/26
- [PULL 61/68] target/nios2: Advance pc when raising exceptions, Richard Henderson, 2022/04/26
- [PULL 62/68] linux-user/nios2: Handle various SIGILL exceptions,
Richard Henderson <=
- [PULL 65/68] hw/nios2: Move memory regions into Nios2Machine, Richard Henderson, 2022/04/26
- [PULL 68/68] tests/tcg/nios2: Add test-shadow-1, Richard Henderson, 2022/04/26
- [PULL 48/68] target/nios2: Split out helpers for gen_rr_shift, Richard Henderson, 2022/04/26
- [PULL 67/68] tests/tcg/nios2: Add semihosting multiarch tests, Richard Henderson, 2022/04/26
- [PULL 47/68] target/nios2: Split out helpers for gen_rr_mul_high, Richard Henderson, 2022/04/26
- [PULL 58/68] target/nios2: Implement rdprs, wrprs, Richard Henderson, 2022/04/26
- [PULL 63/68] hw/intc: Vectored Interrupt Controller (VIC), Richard Henderson, 2022/04/26
- [PULL 66/68] hw/nios2: Machine with a Vectored Interrupt Controller, Richard Henderson, 2022/04/26
- Re: [PULL 00/68] nios2 patch queue, Richard Henderson, 2022/04/26