qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	"patches@linaro.org" <patches@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [PATCH] cputlb: Don't assume do_unassigned_access() never returns
Date: Fri, 10 Feb 2017 09:32:47 +1000	[thread overview]
Message-ID: <97ded09a-b55f-778f-f7da-ed1498d42931@twiddle.net> (raw)
In-Reply-To: <CAFEAcA9VxHUo42n5wojx0yBL_Fj7oz0i_xA-MfYTF9D2ab7nnA@mail.gmail.com>

On 02/10/2017 07:58 AM, Peter Maydell wrote:
> On 9 February 2017 at 20:03, Richard Henderson <rth@twiddle.net> wrote:
>> On 02/09/2017 11:31 AM, Peter Maydell wrote:
>>> Review from somebody who understands how the unassigned_access
>>> hooks are supposed to work appreciated.
>
>> The unassigned_access hook was (unfortunately) designed after the
>> unaligned_access hook.  The later *can* usefully return to indicate that the
>> cpu bit that enforces alignment traps is off.
>>
>> Any unassigned_access hook that doesn't longjmp could be
>> considered buggy.
>
> I use the M profile unassigned_access hook to implement
> the "high addresses are magic, but only if you're in
> Handler mode" behaviour. So for Thread mode I want the
> default handling. You could argue that this is kind
> of abusing the hook, though.

I'm surprised you don't assign those high addresses to a magic device to handle 
that sort of magic.  Then they wouldn't be "unassigned".

> Microblaze returns from the hook in the case where the
> processor version register bit says "this CPU doesn't
> generate exceptions for instruction/data aborts".
> Since it looks like you can have a CPU config that
> chooses to generate an exception for insn abort
> but not data abort (or vice-versa), this looks like
> a valid case for allowing the hook to return (you
> need the hook for the case which you want to have
> throw exceptions, but it gets called for the other
> case too and needs to be able to say "nope" there).

If the cpu doesn't implement aborts, then the processor must provide some 
default value for the memory return.  But the code path along which a return 
happens does not allow for data to be read.  We would need to expand the hook 
definition for this.

> The sparc code is too complicated for me to be able
> to judge whether its non-longjmping codepaths are
> valid or bugs.

I argued with Artyom that (at least) the sparc64 return code path is wrong. 
But I have no idea what the real cpu does for that case.


r~

  reply	other threads:[~2017-02-09 23:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09 19:31 [Qemu-devel] [PATCH] cputlb: Don't assume do_unassigned_access() never returns Peter Maydell
2017-02-09 20:03 ` Richard Henderson
2017-02-09 21:58   ` Peter Maydell
2017-02-09 23:32     ` Richard Henderson [this message]
2017-02-10  9:00       ` 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=97ded09a-b55f-778f-f7da-ed1498d42931@twiddle.net \
    --to=rth@twiddle.net \
    --cc=crosthwaite.peter@gmail.com \
    --cc=patches@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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).