WSL2-Linux-Kernel/virt/kvm
Marc Zyngier 1c5631c73f KVM: arm/arm64: Handle forward time correction gracefully
On a host that runs NTP, corrections can have a direct impact on
the background timer that we program on the behalf of a vcpu.

In particular, NTP performing a forward correction will result in
a timer expiring sooner than expected from a guest point of view.
Not a big deal, we kick the vcpu anyway.

But on wake-up, the vcpu thread is going to perform a check to
find out whether or not it should block. And at that point, the
timer check is going to say "timer has not expired yet, go back
to sleep". This results in the timer event being lost forever.

There are multiple ways to handle this. One would be record that
the timer has expired and let kvm_cpu_has_pending_timer return
true in that case, but that would be fairly invasive. Another is
to check for the "short sleep" condition in the hrtimer callback,
and restart the timer for the remaining time when the condition
is detected.

This patch implements the latter, with a bit of refactoring in
order to avoid too much code duplication.

Cc: <stable@vger.kernel.org>
Reported-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
2016-04-06 13:17:54 +02:00
..
arm KVM: arm/arm64: Handle forward time correction gracefully 2016-04-06 13:17:54 +02:00
Kconfig KVM: don't pointlessly leave KVM_COMPAT=y in non-KVM configs 2015-11-04 16:24:30 +01:00
async_pf.c Merge branch 'mm-pkeys-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-20 19:08:56 -07:00
async_pf.h KVM: fix checkpatch.pl errors in kvm/async_pf.h 2015-06-19 17:16:25 +02:00
coalesced_mmio.c KVM: move iodev.h from virt/kvm/ to include/kvm 2015-03-26 21:43:12 +00:00
coalesced_mmio.h KVM: make the declaration of functions within 80 characters 2015-09-14 18:43:19 +02:00
eventfd.c KVM: x86: merge kvm_arch_set_irq with kvm_set_msi_inatomic 2015-11-04 16:24:35 +01:00
irqchip.c kvm/irqchip: kvm_arch_irq_routing_update renaming split 2015-11-25 17:24:21 +01:00
kvm_main.c KVM: Replace smp_mb() with smp_load_acquire() in the kvm_flush_remote_tlbs() 2016-03-22 16:38:33 +01:00
vfio.c KVM: count number of assigned devices 2015-07-10 13:25:26 +02:00
vfio.h kvm: vfio: fix unregister kvm_device_ops of vfio 2014-10-24 13:30:47 +02:00