qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amir Gonnen <amir.gonnen@neuroblade.ai>
To: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
	Chris Wulff <crwulff@gmail.com>, Marek Vasut <marex@denx.de>,
	Richard Henderson <richard.henderson@linaro.org>
Cc: Amir Gonnen <amir.gonnen@neuroblade.ai>
Subject: [PATCH v3 1/5] target/nios2: Check supervisor on eret
Date: Thu,  3 Mar 2022 17:39:02 +0200	[thread overview]
Message-ID: <20220303153906.2024748-2-amir.gonnen@neuroblade.ai> (raw)
In-Reply-To: <20220303153906.2024748-1-amir.gonnen@neuroblade.ai>

eret instruction is only allowed in supervisor mode.

Signed-off-by: Amir Gonnen <amir.gonnen@neuroblade.ai>
---
 target/nios2/translate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index ce3aacf59d..007c17e6e9 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.25.1



  reply	other threads:[~2022-03-03 15:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03 15:39 [PATCH v3 0/5] target/nios2: Shadow register set, EIC and VIC Amir Gonnen
2022-03-03 15:39 ` Amir Gonnen [this message]
2022-03-04 12:57   ` [PATCH v3 1/5] target/nios2: Check supervisor on eret Peter Maydell
2022-03-04 20:58   ` Richard Henderson
2022-03-03 15:39 ` [PATCH v3 2/5] target/nios2: Shadow register set Amir Gonnen
2022-03-04 21:45   ` Richard Henderson
2022-03-03 15:39 ` [PATCH v3 3/5] target/nios2: Exteral Interrupt Controller (EIC) Amir Gonnen
2022-03-04 22:25   ` Richard Henderson
2022-03-03 15:39 ` [PATCH v3 4/5] hw/intc: Vectored Interrupt Controller (VIC) Amir Gonnen
2022-03-04 12:55   ` Peter Maydell
2022-03-03 15:39 ` [PATCH v3 5/5] hw/nios2: Machine with a Vectored Interrupt Controller Amir Gonnen
2022-03-04 12:58   ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220303153906.2024748-2-amir.gonnen@neuroblade.ai \
    --to=amir.gonnen@neuroblade.ai \
    --cc=crwulff@gmail.com \
    --cc=marex@denx.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).