On Fri, 27 May 2022 at 19:07, Richard Henderson
<[email protected]> wrote:
>
> Use the digested vector length rather than the raw zcr_el[1] value.
>
> This fixes an incorrect return from do_prctl_set_vl where we didn't
> take into account the set of vector lengths supported by the cpu.
> It also prepares us for Streaming SVE mode, where the vector length
> comes from a different cpreg.
>
> Signed-off-by: Richard Henderson <[email protected]>
> ---
> diff --git a/linux-user/aarch64/target_prctl.h
> b/linux-user/aarch64/target_prctl.h
> index 3f5a5d3933..fcbb90e881 100644
> --- a/linux-user/aarch64/target_prctl.h
> +++ b/linux-user/aarch64/target_prctl.h
> @@ -10,7 +10,7 @@ static abi_long do_prctl_get_vl(CPUArchState *env)
> {
> ARMCPU *cpu = env_archcpu(env);
> if (cpu_isar_feature(aa64_sve, cpu)) {
> - return ((cpu->env.vfp.zcr_el[1] & 0xf) + 1) * 16;
> + return (EX_TBFLAG_A64(env->hflags, SVE_LEN) + 1) * 16;
I think env->hflags should be a private implementation detail
to target/arm and it's a bit odd to see linux-user fishing
around in it directly. Can we hide this behind a suitably
named function, please ?
thanks
-- PMM