[PATCH 07/12] arm64: Treat HCR_EL2.E2H as RES1 when ID_AA64MMFR4_EL1.E2H0 is non-zero

Oliver Upton oliver.upton at linux.dev
Fri Nov 17 10:01:20 PST 2023


On Fri, Nov 17, 2023 at 12:17:25PM +0000, Marc Zyngier wrote:
> On Fri, 17 Nov 2023 00:23:13 +0000, Oliver Upton <oliver.upton at linux.dev> wrote:
> > Wouldn't it be more consistent with the architectural definition of
> > signed feature fields to just test the sign bit in this case?
> > 
> > Maybe like:
> > 
> > 	ubfx	x0, x0, #ID_AA64MMFR4_EL1_E2H0_SHIFT, #ID_AA64MMFR4_EL1_E2H0_WIDTH
> > 	tbnz	x0, #3, 1f
> > 
> > You'll also save 8 measly bytes of text while you're at it :)
> 
> At this stage, why not try this:
> 
> tbnz x0, #(ID_AA64MMFR4_EL1_E2H0_SHIFT + ID_AA64MMFR4_EL1_E2H0_WIDTH - 1), 1f
> 
> and we save a total of 12 bytes!

Ship it :)

-- 
Thanks,
Oliver



More information about the linux-arm-kernel mailing list