From: Lucien Murray-Pitts <lucienmp.qemu@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Lucien Anti-Spam <lucienmp_antispam@yahoo.com>,
Richard Henderson <richard.henderson@linaro.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Laurent Vivier <laurent@vivier.eu>
Subject: Re: [Qemu-devel] RFC: Why does target/m68k RTE insn. use gen_exception
Date: Wed, 10 Jul 2019 01:58:40 +0900 [thread overview]
Message-ID: <CALvKS=GvAkNr3OKZzjGoTGG_Eys76zjcjodiN4hKXjFM5B0a4A@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA-0vGg_1nfkbq+o6JwoDsRyP=6mnv6ADi-atV0ROX269Q@mail.gmail.com>
On Mon, Jul 1, 2019 at 9:11 PM Peter Maydell <peter.maydell@linaro.org>
wrote:
> > On Mon, 1 Jul 2019 at 13:04, Lucien Anti-Spam
> > <lucienmp_antispam@yahoo.com> wrote:
> > > Further to my initial problem I noticed that TRAP #0 also jumps to the
> handlers +1 instruction.
> > > Same behavior can also be seen with ARM "SWI #0". (PC shows 0x0C vs
> the expected 0x08)
> >
> > Yes, that's a known bug for arm -- we treat "single step" as
> > "execute one instruction", whereas I think most debuggers will
> > treat "we took an exception" as a reason to stop the single step
> > and return control to the user, rather than executing the insn at
> > the exception entry point as the one instruction of the step.
> > (You can see similar odd behaviour if you try to single step a
> > load instruction which causes a data abort, for instance -- on
> > arm at least we will execute the first insn of the data abort
> > handler before completing the step.)
> > thanks
> > -- PMM
>
As recommended in the previous email this is fixable with a call to handle
debug
when were in single step - I will submit that patch if nobody else it
working on this?
I also then found the m68k stack frame is fouled for 68010/68020 (wrong
frame type,
and it does not honor the special status word aka SSW).
In real hardware the handler code should alter the stack frame chaning the
SSW.
RTE should then start/or-not-start the "pipeline" again from the setting in
the SSW.
This allows for stage B/C stage re-runs, thus a retry on the read
instruction.
I suspect it will keep looping, and retrying until the exception handler
decides to turn
off the rerun.
I am thinking the easiest method would be to check the re-run bits in the
SSW and
jump back to next_pc instead of pc inside the RTE instruction handler.
Any suggestions on how to obtain pc_next from the "m68k_cpu_do_interrupt(
CPUState *cs)" ?
What do we think of this approach?
Cheers,
Luc
next prev parent reply other threads:[~2019-07-09 17:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2136180936.260219.1561641583358.ref@mail.yahoo.com>
2019-06-27 13:19 ` [Qemu-devel] RFC: Why does target/m68k RTE insn. use gen_exception Lucien Anti-Spam via Qemu-devel
2019-06-27 13:22 ` Lucien Anti-Spam via Qemu-devel
2019-06-27 17:09 ` Richard Henderson
2019-06-28 0:27 ` Lucien Murray-Pitts
2019-06-28 9:35 ` Richard Henderson
2019-06-28 15:50 ` Lucien Murray-Pitts
2019-06-29 10:15 ` Richard Henderson
2019-06-29 16:36 ` Lucien Murray-Pitts
2019-06-30 8:20 ` Richard Henderson
2019-07-01 9:10 ` Peter Maydell
2019-07-01 12:04 ` Lucien Anti-Spam via Qemu-devel
2019-07-01 12:11 ` Peter Maydell
2019-07-09 16:58 ` Lucien Murray-Pitts [this message]
2019-07-09 17:06 ` Peter Maydell
2019-07-09 19:04 ` Richard Henderson
2019-07-10 13:35 ` Lucien Murray-Pitts
2019-07-10 17:50 ` Lucien Murray-Pitts
2019-07-10 18:15 ` Alex Bennée
2019-07-11 9:00 ` Peter Maydell
2019-07-11 9:18 ` Richard Henderson
2019-07-12 20:55 ` Lucien Murray-Pitts
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='CALvKS=GvAkNr3OKZzjGoTGG_Eys76zjcjodiN4hKXjFM5B0a4A@mail.gmail.com' \
--to=lucienmp.qemu@gmail.com \
--cc=laurent@vivier.eu \
--cc=lucienmp_antispam@yahoo.com \
--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).