KVM: arm64: GICv3: Check the implementation before accessing ICH_VTR_EL2
Marc Zyngier
maintainerPATCH 1/1 KVM: arm64: GICv3: Check the implementation before accessing ICH_VTR_EL2
The ICH_HCR_EL2 patching code is generally GIC implementation agnostic, except when checking for broken Apple HW, which imposes to read ICH_VTR_EL2.
It is therefore important to check whether we are running on such HW before reading this register, as it will otherwise UNDEF when run on HW that doesn't have GICv3.
--- arch/arm64/kvm/vgic/vgic-v3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/kvm/vgic/vgic-v3.c +2 -2
@@ -829,8 +829,8 @@ static const struct midr_range broken_seis[] = {static bool vgic_v3_broken_seis (void ) {return (is_kernel_in_hyp_mode () && - (read_sysreg_s (SYS_ICH_VTR_EL2 ) &ICH_VTR_EL2_SEIS ) && -is_midr_in_range_list (broken_seis)); +is_midr_in_range_list (broken_seis) && + (read_sysreg_s (SYS_ICH_VTR_EL2 ) &ICH_VTR_EL2_SEIS )); } void noinstr kvm_compute_ich_hcr_trap_bits(struct alt_instr *alt,
Signature · 1 line
2.47.3
Quoted 9 lines · Marc Zyngier
The
ICH_HCR_EL2patching code is generally GIC implementation agnostic, except when checking for broken Apple HW, which imposes to readICH_VTR_EL2.It is therefore important to check whether we are running on such HW before reading this register, as it will otherwise UNDEF when run on HW that doesn't have GICv3.
[...]
Applied to next, thanks!
[1/1] KVM: arm64: GICv3: Check the implementation before accessing ICH_VTR_EL2
https://git.kernel.org/kvmarm/kvmarm/c/8ed2ae76f20c
--
Best,
Oliver