From: "Libo Zhou" <zhlb29@foxmail.com>
To: "Peter Maydell" <peter.maydell@linaro.org>,
"Philippe&nbsp;Mathieu-Daud" <philmd@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
"Aleksandar Markovic" <aleksandar.m.mail@gmail.com>
Subject: Re: illegal hardware instruction during MIPS-I ELF linux useremulation
Date: Tue, 24 Sep 2019 10:23:47 +0800 [thread overview]
Message-ID: <tencent_47F32438770E30027BF2F5D1@qq.com> (raw)
In-Reply-To: <tencent_3BE0CBCB7BA7249A0F92A863@qq.com>
[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]
> I would start by using the QEMU gdbstub to connect a
> MIPS-aware gdb. Then when the SIGILL arrives you can see
> what instruction the guest program was trying to execute.
Just tried it and found something interesting.
I connected gdb-multiarch to QEMU gdbstub. gdb-multiarch's architecture was set to mips:3000 automatically (and Wikipedia says r3k uses MIPS-I).
When I did 'layout asm', and compared the instructions displayed against test.s generated by my mipsel-linux-unknown-gcc, they appeared to be a little bit different.
The 'store word' instruction in test.s is shown as a hex '0x7f......(don't remember the rest)';
'load word' is shown as '0x5f......';
'load immediate' is seen as 'addi';
'j' as 'jr';
When I single-stepped the instructions, the SIGILL was thrown immediately after the first unrecognized 0x7f......, which is supposed to be a store word (sw).
Hence, can I conclude that MIPS-I is not implemented in QEMU out of the box?
EDIT: Or my compiler isn't implementing MIPS-I correctly because gdb-multiarch's r3k doesn't recognize some hexes?
[-- Attachment #2: Type: text/html, Size: 1166 bytes --]
next prev parent reply other threads:[~2019-09-24 2:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-23 8:15 illegal hardware instruction during MIPS-I ELF linux user emulation Libo Zhou
2019-09-23 12:04 ` Libo Zhou
2019-09-23 12:19 ` illegal " Peter Maydell
2019-09-24 2:10 ` illegal hardware instruction during MIPS-I ELF linux useremulation Libo Zhou
2019-09-24 2:23 ` Libo Zhou [this message]
2019-09-23 14:38 ` illegal hardware instruction during MIPS-I ELF linux user emulation Philippe Mathieu-Daudé
2019-09-23 14:42 ` Peter Maydell
2019-09-23 14:50 ` Philippe Mathieu-Daudé
2019-09-26 14:31 ` illegal hardware instruction during MIPS-I ELF linux useremulation Libo Zhou
2019-09-26 15:46 ` Philippe Mathieu-Daudé
2019-09-27 8:59 ` Libo Zhou
-- strict thread matches above, loose matches on Subject: below --
2019-09-23 16:25 Libo Zhou
2019-09-23 16:41 ` Peter Maydell
2019-09-24 1:05 ` Libo Zhou
2019-09-24 2:32 ` Libo Zhou
2019-09-24 13:31 ` Libo Zhou
2019-09-24 13:42 ` Philippe Mathieu-Daudé
2019-09-24 9:36 ` 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=tencent_47F32438770E30027BF2F5D1@qq.com \
--to=zhlb29@foxmail.com \
--cc=aleksandar.m.mail@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.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).