Re: [RFC PATCH] x86/kvm: do not touch watchdogs in pvclock

From: Sergey Senozhatsky
Date: Fri Jul 16 2021 - 20:24:53 EST


On (21/07/16 14:34), Sergey Senozhatsky wrote:
>
> <IRQ>
> apic_timer_interrupt()
> smp_apic_timer_interrupt()
> hrtimer_interrupt()
> _raw_spin_lock_irqsave()
> lock_acquire()
> __lock_acquire()
> sched_clock_cpu()
> sched_clock()
> kvm_sched_clock_read()
> kvm_clock_read()
> pvclock_clocksource_read()
> pvclock_touch_watchdogs()
>
> Since this is VM and VCPU resume path, jiffies still maybe
> be outdated here, which is often the case on my device.
> pvclock_clocksource_read() clears PVCLOCK_GUEST_STOPPED,
> touches watchdogs, but it uses stale jiffies: 4294740764
> (for example).

Hmm, on the other hand, there is probably nothing that guarantees
that the first watchdog hard IRQ we execute on a resuming VCPU is
going to see updated jiffies, it still can use stale jiffies.