From: Sascha Bischoff Date: Thu, 19 Mar 2026 15:55:26 +0000 (+0000) Subject: KVM: arm64: gic-v5: Clear TWI if single task running X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f20554ad3ccd42397f863f6c41b43b831cf9b328;p=thirdparty%2Fkernel%2Flinux.git KVM: arm64: gic-v5: Clear TWI if single task running Handle GICv5 in kvm_vcpu_should_clear_twi(). Clear TWI if there is a single task running, and enable it otherwise. This is a sane default for GICv5 given the current level of support. Signed-off-by: Sascha Bischoff Link: https://patch.msgid.link/20260319154937.3619520-23-sascha.bischoff@arm.com Signed-off-by: Marc Zyngier --- diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 5bbc1adb705e2..f68c4036afebd 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -613,6 +613,9 @@ static bool kvm_vcpu_should_clear_twi(struct kvm_vcpu *vcpu) if (unlikely(kvm_wfi_trap_policy != KVM_WFX_NOTRAP_SINGLE_TASK)) return kvm_wfi_trap_policy == KVM_WFX_NOTRAP; + if (vgic_is_v5(vcpu->kvm)) + return single_task_running(); + 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) ||