[PATCH] arm64/sve: Better handle failure to allocate SVE register storage

Catalin Marinas catalin.marinas at arm.com
Tue Aug 24 03:32:14 PDT 2021


On Tue, Aug 17, 2021 at 06:13:30PM +0100, Mark Brown wrote:
> diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
> index eb8d972ad3d2..5a294f20e9de 100644
> --- a/arch/arm64/kernel/fpsimd.c
> +++ b/arch/arm64/kernel/fpsimd.c
> @@ -520,12 +520,6 @@ void sve_alloc(struct task_struct *task)
>  	/* This is a small allocation (maximum ~8KB) and Should Not Fail. */
>  	task->thread.sve_state =
>  		kzalloc(sve_state_size(task), GFP_KERNEL);
> -
> -	/*
> -	 * If future SVE revisions can have larger vectors though,
> -	 * this may cease to be true:
> -	 */
> -	BUG_ON(!task->thread.sve_state);
>  }

I think we should keep a WARN_ON_ONCE here in case one wonders why the
app was suddenly killed.

-- 
Catalin



More information about the linux-arm-kernel mailing list