aboutsummaryrefslogtreecommitdiff
path: root/target/nios2
diff options
context:
space:
mode:
authorAmir Gonnen <amir.gonnen@neuroblade.ai>2022-04-21 08:16:44 -0700
committerRichard Henderson <richard.henderson@linaro.org>2022-04-26 08:16:40 -0700
commitb106e7b7e48e5b1ab8e13165f28451f6ebf1fe3b (patch)
treee8346b77cf0f04234ec223d88583cb5786dc776a /target/nios2
parent3a0a43ec3c9c4c26f5a1a948e78311468e2930d6 (diff)
downloadqemu-b106e7b7e48e5b1ab8e13165f28451f6ebf1fe3b.zip
qemu-b106e7b7e48e5b1ab8e13165f28451f6ebf1fe3b.tar.gz
qemu-b106e7b7e48e5b1ab8e13165f28451f6ebf1fe3b.tar.bz2
target/nios2: Check supervisor on eret
eret instruction is only allowed in supervisor mode. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Amir Gonnen <amir.gonnen@neuroblade.ai> Message-Id: <20220303153906.2024748-2-amir.gonnen@neuroblade.ai> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220421151735.31996-14-richard.henderson@linaro.org>
Diffstat (limited to 'target/nios2')
-rw-r--r--target/nios2/translate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index 89b97ef..eb97e13 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -384,6 +384,8 @@ static const Nios2Instruction i_type_instructions[] = {
*/
static void eret(DisasContext *dc, uint32_t code, uint32_t flags)
{
+ gen_check_supervisor(dc);
+
tcg_gen_mov_tl(cpu_R[CR_STATUS], cpu_R[CR_ESTATUS]);
tcg_gen_mov_tl(cpu_R[R_PC], cpu_R[R_EA]);