[PATCH 2/4] arm64/fpsimd: Discover maximum vector length implemented by any CPU

Mark Brown broonie at kernel.org
Wed Jun 5 05:56:19 PDT 2024


On Wed, Jun 05, 2024 at 01:03:16PM +0100, Fuad Tabba wrote:

> Actually, I was working on fixing it and was about to send this, which
> I think might be a bit simpler than what you have. Let me know what
> you think and I'll send it as a proper patch if you agree:

> +
> +               if (!max_vl)
> +                       max_vl = vl;
>         }
> +
> +       info->max_system_vl = max((int) max_vl, info->max_system_vl);

Yeah, I originally had written something like this (just doing the max
in the original assignment rather than staging in a local variable) but
it didn't feel great and like it was more vulnerable to getting missed
if we do more parallel bringup so I switched to keeping the split
between enumeration and integration.

I do also prefer the _cpu_ naming since _system_ could be read as the
maximum that we're actually using in the system, as with any naming
thing it's all a bit bikesheddy.

>         if (system_supports_sve()) {
>                 kvm_sve_max_vl = sve_max_virtualisable_vl();
> -               kvm_host_sve_max_vl = sve_max_vl();
> +               kvm_host_sve_max_vl = vl_info[ARM64_VEC_SVE].max_system_vl;

We should keep the accessor functions, it's more consistent and supports
refactoring.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20240605/e5d05ad0/attachment.sig>


More information about the linux-arm-kernel mailing list