qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: Riku Voipio <riku.voipio@iki.fi>, qemu-arm <qemu-arm@nongnu.org>,
	Amanieu d'Antras <amanieu@gmail.com>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH] linux-user/arm: Reset CPSR_E when entering a signal handler
Date: Sat, 16 May 2020 13:58:51 +0100	[thread overview]
Message-ID: <CAFEAcA_5_98BZfTbdLTR75w=qdOVVKra3eCM0YKX_gUEJSfkkw@mail.gmail.com> (raw)
In-Reply-To: <47fd7f16-a7ed-e3ee-9a97-b2b21f43e7b7@linaro.org>

On Sat, 16 May 2020 at 05:12, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 5/15/20 2:25 PM, Peter Maydell wrote:
> >> You also need to call arm_rebuild_hflags() after modifying CPSR_E
> >> otherwise the change doesn't take effect.
> >
> > Hmm. I was expecting cpsr_write() to take care of that if we
> > updated a cpsr flag that was in the hflags, but it looks like
> > the rebuild_hflags() is in the HELPER() wrapper but not in
> > cpsr_write() itself. Richard, does anything go wrong if
> > cpsr_write() proper does the hflags rebuild ?
>
> We wind up rebuilding hflags multiple times, is all.
>
> Most of the time we call cpsr_write we also do something else that also
> requires a rebuild.  So we do it once after all updates.

The downside is that it leaves a trap which makes it really
easy to introduce bugs where hflags aren't rebuilt: as
a caller of cpsr_write() I don't really want to have to
care which cpsr flags happen to be in the hflags or not,
and it's particularly awkward that simply fixing which
flags belong in CPSR_USER suddenly means that a call
that happened to be OK before is now buggy.

thanks
-- PMM


  reply	other threads:[~2020-05-16 13:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 20:24 [PATCH] linux-user/arm: Reset CPSR_E when entering a signal handler Amanieu d'Antras
2020-05-11 11:13 ` Peter Maydell
2020-05-15 18:33 ` Peter Maydell
2020-05-15 20:41   ` Amanieu d'Antras
2020-05-15 21:25     ` Peter Maydell
2020-05-16  4:12       ` Richard Henderson
2020-05-16 12:58         ` Peter Maydell [this message]
2020-05-16 17:25           ` Richard Henderson

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='CAFEAcA_5_98BZfTbdLTR75w=qdOVVKra3eCM0YKX_gUEJSfkkw@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=amanieu@gmail.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=riku.voipio@iki.fi \
    /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).