[PATCH] arm64/signal: Clean up SVE/SME feature checking inconsistency

Will Deacon will at kernel.org
Thu Jun 23 10:47:38 PDT 2022


On Mon, Jun 13, 2022 at 10:01:33PM +0100, Mark Brown wrote:
> Currently when restoring signal state we check to see if SVE is supported
> in restore_sigframe() but check to see if SVE is supported inside
> restore_sve_fpsimd_context(). This makes no real difference since SVE is
> always supported in systems with SME but looks a bit untidy and makes
> things slightly harder to follow, move the SVE check next to the SME one
> in restore_sve_fpsimd_context().
> 
> Signed-off-by: Mark Brown <broonie at kernel.org>
> ---
>  arch/arm64/kernel/signal.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
> index 23dd4c3bcfed..0d5a9eb43085 100644
> --- a/arch/arm64/kernel/signal.c
> +++ b/arch/arm64/kernel/signal.c
> @@ -281,6 +281,9 @@ static int restore_sve_fpsimd_context(struct user_ctxs *user)
>  
>  		vl = task_get_sme_vl(current);
>  	} else {
> +		if (!system_supports_sve())
> +			return -EINVAL;
> +
>  		vl = task_get_sve_vl(current);
>  	}
>  
> @@ -652,14 +655,10 @@ static int restore_sigframe(struct pt_regs *regs,
>  		if (!user.fpsimd)
>  			return -EINVAL;
>  
> -		if (user.sve) {
> -			if (!system_supports_sve())
> -				return -EINVAL;
> -
> +		if (user.sve)
>  			err = restore_sve_fpsimd_context(&user);

This breaks the allnoconfig build for me:

ld.lld: error: undefined symbol: restore_sve_fpsimd_context
>>> referenced by signal.c
>>>               kernel/signal.o:(__arm64_sys_rt_sigreturn) in archive arch/arm64/built-in.a
make: *** [Makefile:1164: vmlinux] Error 1

Will



More information about the linux-arm-kernel mailing list