[PATCH v2 06/25] KVM: arm64: nv: Add sanitising to VNCR-backed HCRX_EL2

Marc Zyngier maz at kernel.org
Fri Feb 2 12:14:37 PST 2024


On Fri, 02 Feb 2024 19:17:37 +0000,
Oliver Upton <oliver.upton at linux.dev> wrote:
> 
> On Fri, Feb 02, 2024 at 05:15:51PM +0000, Oliver Upton wrote:
> > On Fri, Feb 02, 2024 at 02:56:50PM +0000, Marc Zyngier wrote:
> > > No amount of warnings will do, because people don't give a damn.
> > > 
> > > I'm actually in favour of something far more radical: we snapshot the
> > > raw value of all the used RES0/1, and put BUILD_BUG_ON()s that fire if
> > > any value has changed. They will have to touch the KVM code to fix
> > > that, and we catch them red-handed.
> > 
> > Oh I like that a lot more.
> 
> Unsure which registers you planned to give this treatment, but all of
> the ID registers we know about should probably go in this bucket too.

Yup. My current plan is to simply extract all RES0/RES1 values from
arch/arm64/include/generated/asm/sysreg-defs.h (currently 232
definitions), and assert on that. We can relax it for registers that
don't have any RES0 or RES1 bits, but that's about it.

	M.

-- 
Without deviation from the norm, progress is not possible.



More information about the linux-arm-kernel mailing list