Skip to content

Commit 5e8b511

Browse files
Sticklyman1936Oliver Upton
authored andcommitted
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>
1 parent f8f9c1f commit 5e8b511

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

arch/arm64/kvm/arm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ static bool kvm_vcpu_should_clear_twi(struct kvm_vcpu *vcpu)
569569
return kvm_wfi_trap_policy == KVM_WFX_NOTRAP;
570570

571571
return single_task_running() &&
572+
vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3 &&
572573
(atomic_read(&vcpu->arch.vgic_cpu.vgic_v3.its_vpe.vlpi_count) ||
573574
vcpu->kvm->arch.vgic.nassgireq);
574575
}

0 commit comments

Comments
 (0)