lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <89a8e191-63e0-4237-879e-03130fb07f88@sirena.org.uk>
Date:   Fri, 28 Jul 2023 12:54:51 +0100
From:   Mark Brown <broonie@...nel.org>
To:     Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc:     Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        Dave Martin <Dave.Martin@....com>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm64/fpsimd: Only provide the length to cpufeature for
 xCR registers

On Fri, Jul 28, 2023 at 11:27:20AM +0100, Jonathan Cameron wrote:
> Mark Brown <broonie@...nel.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.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ