[PATCH v11 20/40] arm64/sme: Implement streaming SVE signal handling

Catalin Marinas catalin.marinas at arm.com
Wed Feb 23 07:16:46 PST 2022


On Mon, Feb 07, 2022 at 03:20:49PM +0000, Mark Brown wrote:
> When in streaming mode we have the same set of SVE registers as we do in
> regular SVE mode with the exception of FFR and the use of the SME vector
> length. Provide signal handling for these registers by taking one of the
> reserved words in the SVE signal context as a flags field and defining a
> flag with a flag which is set for streaming mode. When the flag is set the

Too many "flag" words.

> @@ -593,11 +613,16 @@ static int setup_sigframe_layout(struct rt_sigframe_user_layout *user,
>  	if (system_supports_sve()) {
>  		unsigned int vq = 0;
>  
> -		if (add_all || test_thread_flag(TIF_SVE)) {
> -			int vl = sve_max_vl();
> +		if (add_all || test_thread_flag(TIF_SVE) ||
> +		    thread_sm_enabled(&current->thread)) {
> +			int vl = max(sve_max_vl(), sme_max_vl());
>  
> -			if (!add_all)
> -				vl = task_get_sve_vl(current);
> +			if (!add_all) {
> +				if (thread_sm_enabled(&current->thread))
> +					vl = task_get_sme_vl(current);
> +				else
> +					vl = task_get_sve_vl(current);
> +			}
>  
>  			vq = sve_vq_from_vl(vl);

Nitpick: this looks a bit too complicated, maybe split it in three
separate if/else blocks.

Either way,

Reviewed-by: Catalin Marinas <catalin.marinas at arm.com>



More information about the linux-arm-kernel mailing list