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 v2 06/23] target/arm: Make HSTR_EL2 traps take priority over UNDEF-at-EL1
Date: Mon, 30 Jan 2023 09:36:54 -1000	[thread overview]
Message-ID: <7afb4a86-0c01-4b5c-13bb-ea19a555c680@linaro.org> (raw)
In-Reply-To: <20230130182459.3309057-7-peter.maydell@linaro.org>

On 1/30/23 08:24, Peter Maydell wrote:
> The semantics of HSTR_EL2 require that it traps cpreg accesses
> to EL2 for:
>   * EL1 accesses
>   * EL0 accesses, if the access is not UNDEFINED when the
>     trap bit is 0
> 
> (You can see this in the I_ZFGJP priority ordering, where HSTR_EL2
> traps from EL1 to EL2 are priority 12, UNDEFs are priority 13, and
> HSTR_EL2 traps from EL0 are priority 15.)
> 
> However, we don't get this right for EL1 accesses which UNDEF because
> the register doesn't exist at all or because its ri->access bits
> non-configurably forbid the access.  At EL1, check for the HSTR_EL2
> trap early, before either of these UNDEF reasons.
> 
> We have to retain the HSTR_EL2 check in access_check_cp_reg(),
> because at EL0 any kind of UNDEF-to-EL1 (including "no such
> register", "bad ri->access" and "ri->accessfn returns 'trap to EL1'")
> takes precedence over the trap to EL2.  But we only need to do that
> check for EL0 now.
> 
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
> Message-id:20230127175507.2895013-7-peter.maydell@linaro.org
> ---
>   target/arm/op_helper.c |  6 +++++-
>   target/arm/translate.c | 28 +++++++++++++++++++++++++++-
>   2 files changed, 32 insertions(+), 2 deletions(-)

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

r~


  reply	other threads:[~2023-01-30 19:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30 18:24 [PATCH v2 00/23] target/arm: Implement FEAT_FGT fine-grained traps Peter Maydell
2023-01-30 18:24 ` [PATCH v2 01/23] target/arm: Name AT_S1E1RP and AT_S1E1WP cpregs correctly Peter Maydell
2023-01-30 18:24 ` [PATCH v2 02/23] target/arm: Correct syndrome for ATS12NSO* at Secure EL1 Peter Maydell
2023-01-30 18:24 ` [PATCH v2 03/23] target/arm: Remove CP_ACCESS_TRAP_UNCATEGORIZED_{EL2, EL3} Peter Maydell
2023-01-30 18:24 ` [PATCH v2 04/23] target/arm: Move do_coproc_insn() syndrome calculation earlier Peter Maydell
2023-01-30 18:24 ` [PATCH v2 05/23] target/arm: All UNDEF-at-EL0 traps take priority over HSTR_EL2 traps Peter Maydell
2023-01-30 18:24 ` [PATCH v2 06/23] target/arm: Make HSTR_EL2 traps take priority over UNDEF-at-EL1 Peter Maydell
2023-01-30 19:36   ` Richard Henderson [this message]
2023-01-30 18:24 ` [PATCH v2 07/23] target/arm: Disable HSTR_EL2 traps if EL2 is not enabled Peter Maydell
2023-01-30 18:24 ` [PATCH v2 08/23] target/arm: Define the FEAT_FGT registers Peter Maydell
2023-01-30 18:24 ` [PATCH v2 09/23] target/arm: Implement FGT trapping infrastructure Peter Maydell
2023-01-30 18:24 ` [PATCH v2 10/23] target/arm: Mark up sysregs for HFGRTR bits 0..11 Peter Maydell
2023-01-30 18:24 ` [PATCH v2 11/23] target/arm: Mark up sysregs for HFGRTR bits 12..23 Peter Maydell
2023-01-30 18:24 ` [PATCH v2 12/23] target/arm: Mark up sysregs for HFGRTR bits 24..35 Peter Maydell
2023-01-30 18:24 ` [PATCH v2 13/23] target/arm: Mark up sysregs for HFGRTR bits 36..63 Peter Maydell
2023-01-30 18:24 ` [PATCH v2 14/23] target/arm: Mark up sysregs for HDFGRTR bits 0..11 Peter Maydell
2023-01-30 18:24 ` [PATCH v2 15/23] target/arm: Mark up sysregs for HDFGRTR bits 12..63 Peter Maydell
2023-01-30 18:24 ` [PATCH v2 16/23] target/arm: Mark up sysregs for HFGITR bits 0..11 Peter Maydell
2023-01-30 18:24 ` [PATCH v2 17/23] target/arm: Mark up sysregs for HFGITR bits 12..17 Peter Maydell
2023-01-30 18:24 ` [PATCH v2 18/23] target/arm: Mark up sysregs for HFGITR bits 18..47 Peter Maydell
2023-01-30 18:24 ` [PATCH v2 19/23] target/arm: Mark up sysregs for HFGITR bits 48..63 Peter Maydell
2023-01-30 18:24 ` [PATCH v2 20/23] target/arm: Implement the HFGITR_EL2.ERET trap Peter Maydell
2023-01-30 18:24 ` [PATCH v2 21/23] target/arm: Implement the HFGITR_EL2.SVC_EL0 and SVC_EL1 traps Peter Maydell
2023-01-30 18:24 ` [PATCH v2 22/23] target/arm: Implement MDCR_EL2.TDCC and MDCR_EL3.TDCC traps Peter Maydell
2023-01-30 18:24 ` [PATCH v2 23/23] target/arm: Enable FEAT_FGT on '-cpu max' Peter Maydell
2023-01-30 19:47 ` [PATCH v2 00/23] target/arm: Implement FEAT_FGT fine-grained traps Fuad Tabba

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=7afb4a86-0c01-4b5c-13bb-ea19a555c680@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).