[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/68] target/nios2: Check supervisor on eret
From: |
Richard Henderson |
Subject: |
[PULL 13/68] target/nios2: Check supervisor on eret |
Date: |
Tue, 26 Apr 2022 11:18:12 -0700 |
From: Amir Gonnen <amir.gonnen@neuroblade.ai>
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>
---
target/nios2/translate.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index 89b97ef520..eb97e13feb 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]);
--
2.34.1
- [PULL 26/68] target/nios2: Use hw/registerfields.h for CR_TLBADDR fields, (continued)
- [PULL 26/68] target/nios2: Use hw/registerfields.h for CR_TLBADDR fields, Richard Henderson, 2022/04/26
- [PULL 22/68] target/nios2: Split control registers away from general registers, Richard Henderson, 2022/04/26
- [PULL 04/68] linux-user/nios2: Adjust error return, Richard Henderson, 2022/04/26
- [PULL 08/68] tests/tcg/nios2: Re-enable linux-user tests, Richard Henderson, 2022/04/26
- [PULL 11/68] target/nios2: Build helper.c for system only, Richard Henderson, 2022/04/26
- [PULL 17/68] target/nios2: Split out helper for eret instruction, Richard Henderson, 2022/04/26
- [PULL 03/68] linux-user/nios2: Drop syscall 0 "workaround", Richard Henderson, 2022/04/26
- [PULL 02/68] linux-user/nios2: Fix clone child return, Richard Henderson, 2022/04/26
- [PULL 06/68] linux-user/nios2: Remove do_sigreturn, Richard Henderson, 2022/04/26
- [PULL 10/68] target/nios2: Remove nios2_cpu_record_sigsegv, Richard Henderson, 2022/04/26
- [PULL 13/68] target/nios2: Check supervisor on eret,
Richard Henderson <=
- [PULL 14/68] target/nios2: Stop generating code if gen_check_supervisor fails, Richard Henderson, 2022/04/26
- [PULL 18/68] target/nios2: Fix BRET instruction, Richard Henderson, 2022/04/26
- [PULL 20/68] linux-user/nios2: Only initialize SP and PC in target_cpu_copy_regs, Richard Henderson, 2022/04/26
- [PULL 21/68] target/nios2: Remove cpu_interrupts_enabled, Richard Henderson, 2022/04/26
- [PULL 23/68] target/nios2: Clean up nios2_cpu_dump_state, Richard Henderson, 2022/04/26
- [PULL 25/68] target/nios2: Use hw/registerfields.h for CR_EXCEPTION fields, Richard Henderson, 2022/04/26
- [PULL 28/68] target/nios2: Rename CR_TLBMISC_WR to CR_TLBMISC_WE, Richard Henderson, 2022/04/26
- [PULL 29/68] target/nios2: Use hw/registerfields.h for CR_TLBMISC fields, Richard Henderson, 2022/04/26
- [PULL 38/68] target/nios2: Implement cpuid, Richard Henderson, 2022/04/26
- [PULL 32/68] target/nios2: Clean up nios2_cpu_do_interrupt, Richard Henderson, 2022/04/26