[bootwrapper PATCH v3 01/15] aarch64: correct ZCR_EL3.LEN initialization

Mark Rutland mark.rutland at arm.com
Tue Jan 25 08:33:39 PST 2022


On Tue, Jan 25, 2022 at 03:59:38PM +0000, Mark Brown wrote:
> On Tue, Jan 25, 2022 at 03:00:43PM +0000, Mark Rutland wrote:
> 
> > As the same time, rename ZCR_EL3_LEN_MASK to ZCR_EL3_LEN_MAX, as it is
> > used as a value rather than as a bit mask.
> 
> Well, it's both and we do call it a mask in both the kernel and TF-A
> too...

Here specifically in the boot-wrapper I'm just using it as a value, so I don't
see that those are relevant?

The idea was to be consistent with the <register>_<field>_<valuename> naming,
and avoiding the "why are you programming a mask as the value" questions from
last time around, where the unambiguous options are:

a) Use <register>_<field>_<valuename> definition, as here.

b) Use <register>_<field>_MASK, and add comments at each usage as to why we use
   a mask as a value, to explain why that isn't a bug.

c) Have both <register>_<field>_MASK and some value definition, and use some
   insertion helper to insert the value.

... and I went with (a) because it was the simplest.

Is there a problem with this?

Thanks,
Mark.



More information about the linux-arm-kernel mailing list