From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: marex@denx.de, crwulff@gmail.com
Subject: [PATCH 6/7] target/nios2: Remove assignment to env in handle_instruction
Date: Sat, 19 Jun 2021 22:25:42 -0700 [thread overview]
Message-ID: <20210620052543.1315091-7-richard.henderson@linaro.org> (raw)
In-Reply-To: <20210620052543.1315091-1-richard.henderson@linaro.org>
Direct assignments to env during translation do not work.
As it happens, the only way we can get here is if env->pc
is already set to dc->pc. We will trap on the first insn
we execute anywhere on the page.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/nios2/translate.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index e2c8151193..ce4a4c40aa 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -740,14 +740,15 @@ static void handle_instruction(DisasContext *dc, CPUNios2State *env)
uint32_t code;
uint8_t op;
const Nios2Instruction *instr;
+
#if defined(CONFIG_USER_ONLY)
/* FIXME: Is this needed ? */
if (dc->pc >= 0x1000 && dc->pc < 0x2000) {
- env->regs[R_PC] = dc->pc;
t_gen_helper_raise_exception(dc, 0xaa);
return;
}
#endif
+
code = cpu_ldl_code(env, dc->pc);
op = get_opcode(code);
--
2.25.1
next prev parent reply other threads:[~2021-06-20 5:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-20 5:25 [PATCH 0/7] target/nios2: Convert to TranslatorOps Richard Henderson
2021-06-20 5:25 ` [PATCH 1/7] target/nios2: Replace DISAS_TB_JUMP with DISAS_NORETURN Richard Henderson
2021-06-20 5:25 ` [PATCH 2/7] target/nios2: Use global cpu_env Richard Henderson
2021-06-28 15:14 ` Peter Maydell
2021-06-20 5:25 ` [PATCH 3/7] target/nios2: Use global cpu_R Richard Henderson
2021-06-20 5:25 ` [PATCH 4/7] target/nios2: Add DisasContextBase to DisasContext Richard Henderson
2021-06-28 15:27 ` Peter Maydell
2021-06-20 5:25 ` [PATCH 5/7] target/nios2: Convert to TranslatorOps Richard Henderson
2021-06-20 5:25 ` Richard Henderson [this message]
2021-06-20 5:25 ` [PATCH 7/7] target/nios2: Clean up goto in handle_instruction Richard Henderson
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=20210620052543.1315091-7-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=crwulff@gmail.com \
--cc=marex@denx.de \
--cc=qemu-devel@nongnu.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).