From: Stefan Weil <sw@weilnetz.de>
To: qemu-devel <qemu-devel@nongnu.org>,
qemu-trivial <qemu-trivial@nongnu.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Paul Brook <paul@codesourcery.com>, Stefan Weil <sw@weilnetz.de>
Subject: [Qemu-devel] [PATCH] target-arm: Report unimplemented opcodes (LOG_UNIMP)
Date: Wed, 28 Aug 2013 06:39:56 +0200 [thread overview]
Message-ID: <1377664796-11698-1-git-send-email-sw@weilnetz.de> (raw)
These unimplemented opcodes are handled like illegal opcodes, but
they are used in existing code. We should at least report when they
are executed.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
When running a QEMU system emulation of an ARM system
(Raspberry PI), Linux booted, but when I tried to run a
user session, it terminated without error message.
It took me some time to see that bash got an illegal
instruction exception. It was caused by ARM opcode 'setend'
which is not implemented in QEMU's ARM emulation.
The patch should help detecting similar scenarios in
the future.
Raspberry PI uses 'setend' in an optimized version of
memcmp, so lots of other executables also fail with QEMU.
As a workaround, the preloading of that optimized code
can be removed. Of course an improved QEMU emulation
would be better.
Regards,
Stefan
target-arm/translate.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/target-arm/translate.c b/target-arm/translate.c
index d1e8538..92d9f16 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -6715,6 +6715,7 @@ static void disas_arm_insn(CPUARMState * env, DisasContext *s)
/* setend */
if (((insn >> 9) & 1) != s->bswap_code) {
/* Dynamic endianness switching not implemented. */
+ qemu_log_mask(LOG_UNIMP, "arm: unimplemented setend\n");
goto illegal_op;
}
return;
@@ -8740,6 +8741,8 @@ static int disas_thumb2_insn(CPUARMState *env, DisasContext *s, uint16_t insn_hw
if (insn & (1 << 26)) {
/* Secure monitor call (v6Z) */
+ qemu_log_mask(LOG_UNIMP,
+ "arm: unimplemented secure monitor call\n");
goto illegal_op; /* not implemented. */
} else {
op = (insn >> 20) & 7;
@@ -9779,6 +9782,7 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s)
ARCH(6);
if (((insn >> 3) & 1) != s->bswap_code) {
/* Dynamic endianness switching not implemented. */
+ qemu_log_mask(LOG_UNIMP, "arm: unimplemented setend\n");
goto illegal_op;
}
break;
--
1.7.10.4
next reply other threads:[~2013-08-28 4:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-28 4:39 Stefan Weil [this message]
2013-08-28 8:15 ` [Qemu-devel] [PATCH] target-arm: Report unimplemented opcodes (LOG_UNIMP) Peter Maydell
2013-08-28 14:31 ` Richard Henderson
2013-08-28 14:34 ` Peter Maydell
2013-08-28 15:26 ` [Qemu-devel] [RFC] Streamlining endian handling in TCG Richard Henderson
2013-08-28 16:38 ` Peter Maydell
2013-08-28 17:16 ` Richard Henderson
2013-08-28 17:28 ` Peter Maydell
2013-08-28 17:45 ` Richard Henderson
2013-08-28 17:41 ` Stefan Weil
2013-08-28 20:42 ` Edgar E. Iglesias
2013-08-28 21:06 ` Peter Maydell
2013-08-28 21:23 ` Richard Henderson
2013-09-02 23:42 ` Aurelien Jarno
2013-09-03 15:11 ` Richard Henderson
2013-09-01 15:35 ` [Qemu-devel] [Qemu-trivial] [PATCH] target-arm: Report unimplemented opcodes (LOG_UNIMP) Michael Tokarev
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=1377664796-11698-1-git-send-email-sw@weilnetz.de \
--to=sw@weilnetz.de \
--cc=paul@codesourcery.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).