Re: [PATCH v12 23/40] arm64/sme: Add ptrace support for ZA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Just one trivial comment:

Mark Brown <broonie@xxxxxxxxxx> writes:

> +static int za_get(struct task_struct *target,
> +		  const struct user_regset *regset,
> +		  struct membuf to)
> +{
> +	struct user_za_header header;
> +	unsigned int vq;
> +	unsigned long start, end;
> +
> +	if (!system_supports_sme())
> +		return -EINVAL;
> +
> +	/* Header */
> +	memset(&header, 0, sizeof(header));
> +
> +	if (test_tsk_thread_flag(target, TIF_SME_VL_INHERIT))
> +		header.flags |= ZA_PT_VL_INHERIT;
> +
> +	header.vl = task_get_sme_vl(target);
> +	vq = sve_vq_from_vl(header.vl);
> +	header.max_vl = sme_max_vl();
> +	header.max_size = ZA_PT_SIZE(vq);
> +
> +	/* If ZA is not active there is only the header */
> +	if (thread_za_enabled(&target->thread))
> +		header.size = ZA_PT_SIZE(vq);
> +	else
> +		header.size = ZA_PT_ZA_OFFSET;
> +
> +	membuf_write(&to, &header, sizeof(header));
> +
> +	BUILD_BUG_ON(ZA_PT_ZA_OFFSET != sizeof(header));
> +	end = ZA_PT_ZA_OFFSET;
> +;

Stray semicolon.

> +	if (target == current)
> +		fpsimd_preserve_current_state();
> +
> +	/* Any register data to include? */
> +	if (thread_za_enabled(&target->thread)) {
> +		start = end;
> +		end = ZA_PT_SIZE(vq);
> +		membuf_write(&to, target->thread.za_state, end - start);
> +	}
> +
> +	/* Zero any trailing padding */
> +	start = end;
> +	end = ALIGN(header.size, SVE_VQ_BYTES);
> +	return membuf_zero(&to, end - start);
> +}

-- 
Thanks,
Thiago



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux