aboutsummaryrefslogtreecommitdiff
path: root/linux-user/nios2
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-04-21 08:17:29 -0700
committerRichard Henderson <richard.henderson@linaro.org>2022-04-26 08:17:05 -0700
commit3747727aad1841bd07b7c9588b6d9b32182b1121 (patch)
tree4588139db3b5b5b3afd8ef311b9da8710cdffad6 /linux-user/nios2
parente84f1768449330a5b4c62a8aaa68f102ba6ec573 (diff)
downloadqemu-3747727aad1841bd07b7c9588b6d9b32182b1121.zip
qemu-3747727aad1841bd07b7c9588b6d9b32182b1121.tar.gz
qemu-3747727aad1841bd07b7c9588b6d9b32182b1121.tar.bz2
linux-user/nios2: Handle various SIGILL exceptions
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>
Diffstat (limited to 'linux-user/nios2')
-rw-r--r--linux-user/nios2/cpu_loop.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c
index a5e8699..da77ede7 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: