summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSascha Bischoff <Sascha.Bischoff@arm.com>2026-01-06 19:52:10 +0300
committerOliver Upton <oupton@kernel.org>2026-01-08 23:49:21 +0300
commit5e8b511c39f35dcbf2e548a75d49782778c2df48 (patch)
tree09a00ce85cbca314eefbd38d8e4d45d78ee45c3a /arch
parentf8f9c1f4d0c7a64600e2ca312dec824a0bc2f1da (diff)
downloadlinux-5e8b511c39f35dcbf2e548a75d49782778c2df48.tar.xz
KVM: arm64: gic: Check for vGICv3 when clearing TWI
Explicitly check for the vgic being v3 when disabling TWI. Failure to check this can result in using the wrong view of the vgic CPU IF union causing undesirable/unexpected behaviour. Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com> Reviewed-by: Marc Zyngier <maz@kernel.org> Link: https://msgid.link/20260106165154.3321753-1-sascha.bischoff@arm.com Signed-off-by: Oliver Upton <oupton@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/kvm/arm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index 4f80da0c0d1d..620a465248d1 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -569,6 +569,7 @@ static bool kvm_vcpu_should_clear_twi(struct kvm_vcpu *vcpu)
return kvm_wfi_trap_policy == KVM_WFX_NOTRAP;
return single_task_running() &&
+ vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3 &&
(atomic_read(&vcpu->arch.vgic_cpu.vgic_v3.its_vpe.vlpi_count) ||
vcpu->kvm->arch.vgic.nassgireq);
}