[PATCH] KVM: arm64: Disable OS double lock visibility by default and ignore VMM writes

Oliver Upton oliver.upton at linux.dev
Thu Aug 8 10:39:48 PDT 2024


Hi Shameer,

I find myself asking *why* we need this, could you share some details
on the issue you're encountering?

Indeed, RAZ/WI is not a faithful implementation of FEAT_DoubleLock, but
I wouldn't expect it to be used in a VM in the first place.

On Thu, Aug 08, 2024 at 01:57:11PM +0100, Shameer Kolothum wrote:
> KVM exposes the OS double lock feature bit to Guests but returns
> RAZ/WI on Guest OSDLR_EL1 access. Make sure we are hiding OS double
> lock from Guests now. However we can't hide DoubleLock if the reported
> DebugVer is < 8.2. So report a minimum DebugVer of 8.2 to Guests.

What if a user wanted to virtualize an exact CPU model that only
implemented v8.0?

> All this may break migration from the older kernels. Take care of
> that by ignoring VMM writes for these values.

Ignoring userspace writes is a pretty big hammer. In situations where
KVM had advertised a feature that was outright not supported (e.g. IMP DEF
PMUs) it _might_ make sense. But with this change we're messing with a
CPU feature we *do* support.

Would allowing userspace to downgrade ID_AA664DFR0_EL1.DoubleLock to
0b1111 be enough?

-- 
Thanks,
Oliver



More information about the linux-arm-kernel mailing list