Re: [RFC PATCH] arm64/sve,sme: Refine scalable regset sizes at boot

From: Mark Brown
Date: Wed Feb 07 2024 - 05:05:06 EST


On Mon, Feb 05, 2024 at 05:27:20PM +0000, Dave Martin wrote:

> index a5dc6f764195..5c2f91f84c31 100644
> --- a/arch/arm64/kernel/fpsimd.c
> +++ b/arch/arm64/kernel/fpsimd.c
> @@ -1189,6 +1189,7 @@ void __init sve_setup(void)
> pr_warn("%s: unvirtualisable vector lengths present\n",
> info->name);
>
> + arch_ptrace_sve_init(sve_vq_from_vl(info->max_vl));
> sve_efi_setup();
> }

This will only get run if the system actually supports SVE since the
first thing that sve_setup() does is to exit if the system does not
support SVE. That means that the size limiting will only be done on
systems that have SVE, but since we unconditionally register all our
regsets if the system doesn't have SVE it will end up with a maximally
sized SVE regset registered which doesn't seem ideal. As I mentioned in
the other thread we should probably just not be registering unsupported
regsets with the core, that would avoid the issue without a change to
this patch.

A similar issue applies for SME.

Attachment: signature.asc
Description: PGP signature