qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 3/4] target/arm: Recalculate hflags correctly after writes to CONTROL
Date: Tue, 3 Mar 2020 10:37:43 -0800	[thread overview]
Message-ID: <b4d0700a-8a51-41cd-6e5a-486e30c1e5de@linaro.org> (raw)
In-Reply-To: <20200303174950.3298-4-peter.maydell@linaro.org>

On 3/3/20 9:49 AM, Peter Maydell wrote:
> A write to the CONTROL register can change our current EL (by
> writing to the nPRIV bit). That means that we can't assume
> that s->current_el is still valid in trans_MSR_v7m() when
> we try to rebuild the hflags.
> 
> Add a new helper rebuild_hflags_m32_newel() which, like the
> existing rebuild_hflags_a32_newel(), recalculates the current
> EL from scratch, and use it in trans_MSR_v7m().
> 
> This fixes an assertion about an hflags mismatch when the
> guest changes privilege by writing to CONTROL.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  target/arm/helper.h    |  1 +
>  target/arm/helper.c    | 12 ++++++++++++
>  target/arm/translate.c |  7 +++----
>  3 files changed, 16 insertions(+), 4 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


  reply	other threads:[~2020-03-03 18:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 17:49 [PATCH 0/4] target/arm: Fix hflags mismatches for M-profile Peter Maydell
2020-03-03 17:49 ` [PATCH 1/4] hw/intc/armv7m_nvic: Rebuild hflags on reset Peter Maydell
2020-03-03 18:35   ` Richard Henderson
2020-03-03 17:49 ` [PATCH 2/4] target/arm: Update hflags in trans_CPS_v7m() Peter Maydell
2020-03-03 18:36   ` Richard Henderson
2020-03-03 17:49 ` [PATCH 3/4] target/arm: Recalculate hflags correctly after writes to CONTROL Peter Maydell
2020-03-03 18:37   ` Richard Henderson [this message]
2020-03-03 17:49 ` [PATCH 4/4] target/arm: Fix some comment typos Peter Maydell
2020-03-03 18:38   ` 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=b4d0700a-8a51-41cd-6e5a-486e30c1e5de@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.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).