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

From: Mark Brown
Date: Wed Jun 05 2024 - 09:30:57 EST


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.

Attachment: signature.asc
Description: PGP signature