Re: randomly firing kvm_arch_timer_handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 4, 2020 at 3:37 PM Marc Zyngier <maz@xxxxxxxxxx> wrote:

> > I have an issue on one particular hardware with gicv3 and the old
> > stable (4.9.22x) kernel where the timer interrupt randomly leaks to
> > the host after the guest exit and the kvm_arch_timer_handler gets
> > triggered. The guest does run, but the whine (unexpected interrupt) is
> > annoying and it seems to be hindering the performance drastically - of
> > both the host and the guest. This behavior can even lead to the host
> > watchdog biting as the firing timer prevents the progress, especially
> > during the very early boot when the guest is doing heavy paging
> > anyway.
>
> The only system I witnessed this was a Cavium TX1. It seems incredibly
> bad at retiring an interrupt that has been masked at the source.

Looks like something like this works as a workaround. On guest exit
lift the timer value prior to turning it off (setting happens
atomically even if the timer retire does not) and then backport the
irq disable logic from the newer kernels into the host irq handler:

+       if (kvm_timer_should_fire(vcpu))
+               kvm_timer_update_irq(vcpu, true);
+
+       timer = &vcpu->arch.timer_cpu;
+       if (timer->irq.level)
+               disable_percpu_irq(irq);
+       else
+               enable_percpu_irq(irq, 0);

Now the hits are still happening, but very, very rarely.


--
Janne
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm



[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux