[PATCH] arm64/fpsimd: Only provide the length to cpufeature for xCR registers
Mark Brown
broonie at kernel.org
Fri Jul 28 04:54:51 PDT 2023
On Fri, Jul 28, 2023 at 11:27:20AM +0100, Jonathan Cameron wrote:
> Mark Brown <broonie at kernel.org> wrote:
> > zcr = read_sysreg_s(SYS_ZCR_EL1);
> > - zcr &= ~(u64)ZCR_ELx_LEN_MASK; /* find sticky 1s outside LEN field */
> > + zcr &= ~(u64)ZCR_ELx_LEN_MASK;
> > vq_max = sve_vq_from_vl(sve_get_vl());
> > zcr |= vq_max - 1; /* set LEN field to maximum effective value */
> > - return zcr;
> > + return SYS_FIELD_GET(ZCR_ELx, LEN, zcr);
> Isn't that overly complex if we only end up with the length? (if I'm reading this right)
> Perhaps it is more logical to build the register then pull the
> field out of it, but it would be simpler as something like...
> return sve_vq_from_vl(sve_get_vl()) - 1;
We could, yes - I did prefer to keep it clear that this is an actual
if modified register value we're returning, though that could've been a
comment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20230728/481bafc6/attachment.sig>
More information about the linux-arm-kernel
mailing list