From: Max Filippov <jcmvbkbc@gmail.com>
To: qemu-devel@nongnu.org
Cc: Max Filippov <jcmvbkbc@gmail.com>
Subject: [PATCH 2/2] target/xtensa: fix simcall for newer hardware
Date: Sun, 17 May 2020 14:58:14 -0700 [thread overview]
Message-ID: <20200517215814.19623-3-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <20200517215814.19623-1-jcmvbkbc@gmail.com>
After Xtensa release RE.2 simcall opcode has become nop for the
hardware instead of illegal instruction.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
target/xtensa/translate.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 546d2fa2facf..4bc15252c8a5 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -2367,9 +2367,10 @@ static bool test_ill_simcall(DisasContext *dc, const OpcodeArg arg[],
#ifdef CONFIG_USER_ONLY
bool ill = true;
#else
- bool ill = !semihosting_enabled();
+ /* Between RE.2 and RE.3 simcall opcode's become nop for the hardware. */
+ bool ill = dc->config->hw_version <= 250002 && !semihosting_enabled();
#endif
- if (ill) {
+ if (ill || !semihosting_enabled()) {
qemu_log_mask(LOG_GUEST_ERROR, "SIMCALL but semihosting is disabled\n");
}
return ill;
@@ -2379,7 +2380,9 @@ static void translate_simcall(DisasContext *dc, const OpcodeArg arg[],
const uint32_t par[])
{
#ifndef CONFIG_USER_ONLY
- gen_helper_simcall(cpu_env);
+ if (semihosting_enabled()) {
+ gen_helper_simcall(cpu_env);
+ }
#endif
}
--
2.20.1
prev parent reply other threads:[~2020-05-17 22:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-17 21:58 [PATCH 0/2] target/xtensa: fix simcall for newer hardware Max Filippov
2020-05-17 21:58 ` [PATCH 1/2] target/xtensa: fetch HW version from configuration overlay Max Filippov
2020-05-17 21:58 ` Max Filippov [this message]
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=20200517215814.19623-3-jcmvbkbc@gmail.com \
--to=jcmvbkbc@gmail.com \
--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).