Skip to content

Commit 944d76f

Browse files
Marc Zyngiergregkh
authored andcommitted
KVM: arm64: Wake-up from WFI when iqrchip is in userspace
commit 4ce98bf upstream It appears that there is nothing in the wake-up path that evaluates whether the in-kernel interrupts are pending unless we have a vgic. This means that the userspace irqchip support has been broken for about four years, and nobody noticed. It was also broken before as we wouldn't wake-up on a PMU interrupt, but hey, who cares... It is probably time to remove the feature altogether, because it was a terrible idea 10 years ago, and it still is. Fixes: b57de4f ("KVM: arm64: Simplify kvm_cpu_has_pending_timer()") Link: https://patch.msgid.link/20260423163607.486345-1-maz@kernel.org Signed-off-by: Marc Zyngier <maz@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 83ce43a commit 944d76f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

arch/arm64/kvm/arm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,11 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,
557557
int kvm_arch_vcpu_runnable(struct kvm_vcpu *v)
558558
{
559559
bool irq_lines = *vcpu_hcr(v) & (HCR_VI | HCR_VF);
560+
561+
irq_lines |= (!irqchip_in_kernel(v->kvm) &&
562+
(kvm_timer_should_notify_user(v) ||
563+
kvm_pmu_should_notify_user(v)));
564+
560565
return ((irq_lines || kvm_vgic_vcpu_pending_irq(v))
561566
&& !kvm_arm_vcpu_stopped(v) && !v->arch.pause);
562567
}

0 commit comments

Comments
 (0)