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 02/14] target/arm: Don't skip MTE checks for LDRT/STRT at EL0
Date: Fri, 8 Sep 2023 12:53:12 -0700 [thread overview]
Message-ID: <efa7d7e7-1a64-45b3-d76e-1ce1508a3be4@linaro.org> (raw)
In-Reply-To: <20230907160340.260094-3-peter.maydell@linaro.org>
On 9/7/23 09:03, Peter Maydell wrote:
> The LDRT/STRT "unprivileged load/store" instructions behave like
> normal ones if executed at EL0. We handle this correctly for
> the load/store semantics, but get the MTE checking wrong.
>
> We always look at s->mte_active[is_unpriv] to see whether we should
> be doing MTE checks, but in hflags.c when we set the TB flags that
> will be used to fill the mte_active[] array we only set the
> MTE0_ACTIVE bit if UNPRIV is true (i.e. we are not at EL0).
>
> This means that a LDRT at EL0 will see s->mte_active[1] as 0,
> and will not do MTE checks even when MTE is enabled.
>
> To avoid the translate-time code having to do an explicit check on
> s->unpriv to see if it is OK to index into the mte_active[] array,
> duplicate MTE_ACTIVE into MTE0_ACTIVE when UNPRIV is false.
>
> (This isn't a very serious bug because generally nobody executes
> LDRT/STRT at EL0, because they have no use there.)
>
> Cc:qemu-stable@nongnu.org
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
> ---
> target/arm/tcg/hflags.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
next prev parent reply other threads:[~2023-09-08 19:54 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-07 16:03 [PATCH 00/14] target/arm: Implement FEAT_MOPS Peter Maydell
2023-09-07 16:03 ` [PATCH 01/14] target/arm: Remove unused allocation_tag_mem() argument Peter Maydell
2023-09-08 14:12 ` Philippe Mathieu-Daudé
2023-09-07 16:03 ` [PATCH 02/14] target/arm: Don't skip MTE checks for LDRT/STRT at EL0 Peter Maydell
2023-09-08 19:53 ` Richard Henderson [this message]
2023-09-07 16:03 ` [PATCH 03/14] target/arm: Add ID_AA64ISAR2_EL1 Peter Maydell
2023-09-08 14:14 ` Philippe Mathieu-Daudé
2023-09-07 16:03 ` [PATCH 04/14] target/arm: Implement FEAT_MOPS enable bits Peter Maydell
2023-09-08 20:56 ` Richard Henderson
2023-09-07 16:03 ` [PATCH 05/14] target/arm: Pass unpriv bool to get_a64_user_mem_index() Peter Maydell
2023-09-08 14:19 ` Philippe Mathieu-Daudé
2023-09-08 20:45 ` Richard Henderson
2023-09-07 16:03 ` [PATCH 06/14] target/arm: Define syndrome function for MOPS exceptions Peter Maydell
2023-09-08 20:45 ` Richard Henderson
2023-09-07 16:03 ` [PATCH 07/14] target/arm: New function allocation_tag_mem_probe() Peter Maydell
2023-09-08 20:51 ` Richard Henderson
2023-09-07 16:03 ` [PATCH 08/14] target/arm: Implement MTE tag-checking functions for FEAT_MOPS Peter Maydell
2023-09-08 20:52 ` Richard Henderson
2023-09-07 16:03 ` [PATCH 09/14] target/arm: Implement the SET* instructions Peter Maydell
2023-09-09 15:58 ` Richard Henderson
2023-09-07 16:03 ` [PATCH 10/14] target/arm: Define new TB flag for ATA0 Peter Maydell
2023-09-09 16:03 ` Richard Henderson
2023-09-07 16:03 ` [PATCH 11/14] target/arm: Implement the SETG* instructions Peter Maydell
2023-09-09 16:38 ` Richard Henderson
2023-09-11 14:17 ` Peter Maydell
2023-09-11 21:17 ` Richard Henderson
2023-09-07 16:03 ` [PATCH 12/14] target/arm: Implement MTE tag-checking functions for FEAT_MOPS copies Peter Maydell
2023-09-09 16:42 ` Richard Henderson
2023-09-07 16:03 ` [PATCH 13/14] target/arm: Implement the CPY* instructions Peter Maydell
2023-09-09 17:06 ` Richard Henderson
2023-09-12 12:27 ` Peter Maydell
2023-09-07 16:03 ` [PATCH 14/14] target/arm: Enable FEAT_MOPS for CPU 'max' Peter Maydell
2023-09-09 16:53 ` 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=efa7d7e7-1a64-45b3-d76e-1ce1508a3be4@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).