qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org
Subject: Re: [PATCH 4/4] target/arm: Ignore SMCR_EL2.LEN and SVCR_EL2.LEN if EL2 is not enabled
Date: Mon, 22 Jul 2024 22:01:59 +0200	[thread overview]
Message-ID: <9a8c2997-b9be-43ed-8fb6-febd6b50024d@linaro.org> (raw)
In-Reply-To: <20240722172957.1041231-5-peter.maydell@linaro.org>

On 22/7/24 19:29, Peter Maydell wrote:
> When determining the current vector length, the SMCR_EL2.LEN and
> SVCR_EL2.LEN settings should only be considered if EL2 is enabled
> (compare the pseudocode CurrentSVL and CurrentNSVL which call
> EL2Enabled()).
> 
> We were checking against ARM_FEATURE_EL2 rather than calling
> arm_is_el2_enabled(), which meant that we would look at
> SMCR_EL2/SVCR_EL2 when in Secure EL1 or Secure EL0 even if Secure EL2
> was not enabled.

Just curious, how did you notice?

> Use the correct check in sve_vqm1_for_el_sm().
> 
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   target/arm/helper.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/arm/helper.c b/target/arm/helper.c
> index ce319572354..8fb4b474e83 100644
> --- a/target/arm/helper.c
> +++ b/target/arm/helper.c
> @@ -7232,7 +7232,7 @@ uint32_t sve_vqm1_for_el_sm(CPUARMState *env, int el, bool sm)
>       if (el <= 1 && !el_is_in_host(env, el)) {
>           len = MIN(len, 0xf & (uint32_t)cr[1]);
>       }
> -    if (el <= 2 && arm_feature(env, ARM_FEATURE_EL2)) {
> +    if (el <= 2 && arm_is_el2_enabled(env)) {
>           len = MIN(len, 0xf & (uint32_t)cr[2]);
>       }
>       if (arm_feature(env, ARM_FEATURE_EL3)) {



  reply	other threads:[~2024-07-22 20:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-22 17:29 [PATCH 0/4] target/arm: Various minor SME bugfixes Peter Maydell
2024-07-22 17:29 ` [PATCH 1/4] target/arm: Don't assert for 128-bit tile accesses when SVL is 128 Peter Maydell
2024-07-22 17:29 ` [PATCH 2/4] target/arm: Fix UMOPA/UMOPS of 16-bit values Peter Maydell
2024-07-22 17:29 ` [PATCH 3/4] target/arm: Avoid shifts by -1 in tszimm_shr() and tszimm_shl() Peter Maydell
2024-07-22 17:29 ` [PATCH 4/4] target/arm: Ignore SMCR_EL2.LEN and SVCR_EL2.LEN if EL2 is not enabled Peter Maydell
2024-07-22 20:01   ` Philippe Mathieu-Daudé [this message]
2024-07-22 22:14 ` [PATCH 0/4] target/arm: Various minor SME bugfixes 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=9a8c2997-b9be-43ed-8fb6-febd6b50024d@linaro.org \
    --to=philmd@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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).