[PATCH] KVM: arm64: nv: Return correct RES0 bits for FGT registers

Marc Zyngier maz at kernel.org
Thu Jan 22 01:07:47 PST 2026


On Wed, 21 Jan 2026 10:16:31 +0000,
Zenghui Yu <zenghui.yu at linux.dev> wrote:
> 
> From: "Zenghui Yu (Huawei)" <zenghui.yu at linux.dev>
> 
> We had extended the sysreg masking infrastructure to more general
> registers, instead of restricting it to VNCR-backed registers, since
> commit a0162020095e ("KVM: arm64: Extend masking facility to arbitrary
> registers"). Fix kvm_get_sysreg_res0() to reflect this fact.

Huh, what a howler! Thanks a lot for spotting this!

> 
> Note that we're sure that we only deal with FGT registers in
> kvm_get_sysreg_res0(), the
> 
> 	if (sr < __VNCR_START__)
> 
> is actually a never false, which should probably be removed later.

I think the biggest mistake is to have several places where we perform
sysreg index to array index conversions. We should try to unify that.

> 
> Fixes: 69c19e047dfe ("KVM: arm64: Add TCR2_EL2 to the sysreg arrays")
> Signed-off-by: Zenghui Yu (Huawei) <zenghui.yu at linux.dev>

Cc: stable at vger.kernel.org

Thanks again,

	M.

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



More information about the linux-arm-kernel mailing list