Skip to content

Commit 2eb80a2

Browse files
Zenghui Yu (Huawei)Marc Zyngier
authored andcommitted
KVM: arm64: nv: Return correct RES0 bits for FGT registers
We had extended the sysreg masking infrastructure to more general registers, instead of restricting it to VNCR-backed registers, since commit a016202 ("KVM: arm64: Extend masking facility to arbitrary registers"). Fix kvm_get_sysreg_res0() to reflect this fact. 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. Fixes: 69c19e0 ("KVM: arm64: Add TCR2_EL2 to the sysreg arrays") Signed-off-by: Zenghui Yu (Huawei) <zenghui.yu@linux.dev> Link: https://patch.msgid.link/20260121101631.41037-1-zenghui.yu@linux.dev Signed-off-by: Marc Zyngier <maz@kernel.org> Cc: stable@vger.kernel.org
1 parent 54adbfe commit 2eb80a2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/arm64/kvm/emulate-nested.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2435,7 +2435,7 @@ static u64 kvm_get_sysreg_res0(struct kvm *kvm, enum vcpu_sysreg sr)
24352435

24362436
masks = kvm->arch.sysreg_masks;
24372437

2438-
return masks->mask[sr - __VNCR_START__].res0;
2438+
return masks->mask[sr - __SANITISED_REG_START__].res0;
24392439
}
24402440

24412441
static bool check_fgt_bit(struct kvm_vcpu *vcpu, enum vcpu_sysreg sr,

0 commit comments

Comments
 (0)