[PATCH v3 14/97] target/arm: Introduce ARMCPU.sme_max_vq

Richard Henderson posted 97 patches 2 months, 1 week ago
Maintainers: Laurent Vivier <laurent@vivier.eu>, Peter Maydell <peter.maydell@linaro.org>
There is a newer version of this series
[PATCH v3 14/97] target/arm: Introduce ARMCPU.sme_max_vq
Posted by Richard Henderson 2 months, 1 week ago
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/cpu.h   | 1 +
 target/arm/cpu64.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 2f2c131613..b5c4fa1e80 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -1118,6 +1118,7 @@ struct ArchCPU {
 
     /* Used to set the maximum vector length the cpu will support.  */
     uint32_t sve_max_vq;
+    uint32_t sme_max_vq;
 
 #ifdef CONFIG_USER_ONLY
     /* Used to set the default vector length at process start. */
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index c5c289eadf..8400c7b567 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -343,6 +343,7 @@ void arm_cpu_sme_finalize(ARMCPU *cpu, Error **errp)
     }
 
     cpu->sme_vq.map = vq_map;
+    cpu->sme_max_vq = 32 - clz32(vq_map);
 }
 
 static bool cpu_arm_get_sme(Object *obj, Error **errp)
-- 
2.43.0
Re: [PATCH v3 14/97] target/arm: Introduce ARMCPU.sme_max_vq
Posted by Peter Maydell 2 months, 1 week ago
On Wed, 2 Jul 2025 at 13:34, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/cpu.h   | 1 +
>  target/arm/cpu64.c | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/target/arm/cpu.h b/target/arm/cpu.h
> index 2f2c131613..b5c4fa1e80 100644
> --- a/target/arm/cpu.h
> +++ b/target/arm/cpu.h
> @@ -1118,6 +1118,7 @@ struct ArchCPU {
>
>      /* Used to set the maximum vector length the cpu will support.  */
>      uint32_t sve_max_vq;
> +    uint32_t sme_max_vq;
>
>  #ifdef CONFIG_USER_ONLY
>      /* Used to set the default vector length at process start. */
> diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
> index c5c289eadf..8400c7b567 100644
> --- a/target/arm/cpu64.c
> +++ b/target/arm/cpu64.c
> @@ -343,6 +343,7 @@ void arm_cpu_sme_finalize(ARMCPU *cpu, Error **errp)
>      }
>
>      cpu->sme_vq.map = vq_map;
> +    cpu->sme_max_vq = 32 - clz32(vq_map);
>  }
>
>  static bool cpu_arm_get_sme(Object *obj, Error **errp)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM