linux-user/sparc: Handle priviledged opcode trap

For the most part priviledged opcodes are ifdefed out of the
user-only sparc translator, which will then incorrectly produce
illegal opcode traps.  But there are some code paths that
properly raise TT_PRIV_INSN, so we must handle it.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230216054516.1267305-11-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
Richard Henderson 2023-02-15 19:45:11 -10:00 committed by Laurent Vivier
parent 6abc58eb97
commit 97ff1478d2

View File

@ -303,6 +303,9 @@ void cpu_loop (CPUSPARCState *env)
case TT_ILL_INSN: case TT_ILL_INSN:
force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->pc); force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->pc);
break; break;
case TT_PRIV_INSN:
force_sig_fault(TARGET_SIGILL, TARGET_ILL_PRVOPC, env->pc);
break;
case EXCP_ATOMIC: case EXCP_ATOMIC:
cpu_exec_step_atomic(cs); cpu_exec_step_atomic(cs);
break; break;