[PATCH v11 22/40] arm64/sme: Implement ptrace support for streaming mode SVE registers
Catalin Marinas
catalin.marinas at arm.com
Wed Feb 23 07:22:40 PST 2022
On Mon, Feb 07, 2022 at 03:20:51PM +0000, Mark Brown wrote:
> diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
> index 2242c14a5a05..8b111b7f2006 100644
> --- a/arch/arm64/kernel/fpsimd.c
> +++ b/arch/arm64/kernel/fpsimd.c
> @@ -645,14 +645,19 @@ static void __fpsimd_to_sve(void *sst, struct user_fpsimd_state const *fst,
> */
> static void fpsimd_to_sve(struct task_struct *task)
> {
> - unsigned int vq;
> + unsigned int vq, vl;
> void *sst = task->thread.sve_state;
> struct user_fpsimd_state const *fst = &task->thread.uw.fpsimd_state;
>
> if (!system_supports_sve())
> return;
>
> - vq = sve_vq_from_vl(task_get_sve_vl(task));
> + if (thread_sm_enabled(&task->thread))
> + vl = task_get_sme_vl(task);
> + else
> + vl = task_get_sve_vl(task);
I saw this construct in the signal patches as well. Can we have a
function/macro that checks the SM enabled and returns the proper vl?
Otherwise,
Reviewed-by: Catalin Marinas <catalin.marinas at arm.com>
More information about the linux-arm-kernel
mailing list