qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Lucien Murray-Pitts <lucienmp.qemu@gmail.com>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: Lucien Anti-Spam <lucienmp_antispam@yahoo.com>,
	qemu-devel@nongnu.org, Laurent Vivier <laurent@vivier.eu>
Subject: Re: [Qemu-devel] RFC: Why does target/m68k RTE insn. use gen_exception
Date: Fri, 28 Jun 2019 09:27:13 +0900	[thread overview]
Message-ID: <20190628002713.GA19257@localhost.localdomain> (raw)
In-Reply-To: <e4c1fbc4-3e43-5df4-a17c-527d98d9763c@linaro.org>

On Thu, Jun 27, 2019 at 07:09:39PM +0200, Richard Henderson wrote:
> On 6/27/19 3:22 PM, Lucien Anti-Spam wrote:
> > Hi Laurent / Richard,
> > (resent email )
> > 
> > Does anyone have any knowledge why
> >     gen_exception(s, s->base.pc_next, EXCP_RTE);
> > 
> > is generated for "RTE" instruction, where as the "RTS" goes a gen_jmp?
> > ( note see target/m68k/translate.c in functions DISAS_INSN(rte) and DISAS_INSN(rts)
> 
> History, it would seem.  Paul Brook implemented it that way in 2007.

Ok, thank you I wanted to make sure RTE wasnt being one like this as a special case.

> 
> I think that it should not be implemented as an exception.  It should be a call
> to one of two different helpers (cf and m68k), followed by either a normal exit
> to main loop (to recognize the new interrupt state) or a debug exception.
> 
> This sort of modification should be fairly easy to perform, if you have the time.
> 

The original way of handling it was causing single step to malfunction, I dont
rightly know why but the effect was that step would step twice and end up
inside the ISR function again OR just stepping past the RTE as if it didnt
exist.

I have made a quick hack to implement it the way you suggest and confirm that
works better.

HOWEVER, the "return" address is the instruction that causes the exception.
So it immediately does return to the ISR.

This is a different issue, but I think interrelated to the original problem.

Further single stepping INTO the failing instruction results in ending up
at the ISR +1 instruction

I will look at these but so far a little lost on the why for of them.

Cheers,
Luc

> 
> r~


  reply	other threads:[~2019-06-28  0:27 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 [this message]
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
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=20190628002713.GA19257@localhost.localdomain \
    --to=lucienmp.qemu@gmail.com \
    --cc=laurent@vivier.eu \
    --cc=lucienmp_antispam@yahoo.com \
    --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).