diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2016-04-06 09:37:22 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-04 14:48:40 -0700 |
commit | 5716a93fef70b4d305e9b3afea50c3027d22cc3c (patch) | |
tree | c61f28895e558bd60b1436cf2adf709ab4b9f147 /Kbuild | |
parent | 1c8497d2035d95e4e26bdf6cec34150bfb972776 (diff) | |
download | linux-stable-5716a93fef70b4d305e9b3afea50c3027d22cc3c.tar.gz linux-stable-5716a93fef70b4d305e9b3afea50c3027d22cc3c.tar.bz2 linux-stable-5716a93fef70b4d305e9b3afea50c3027d22cc3c.zip |
KVM: arm/arm64: Handle forward time correction gracefully
commit 1c5631c73fc2261a5df64a72c155cb53dcdc0c45 upstream.
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.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Kbuild')
0 files changed, 0 insertions, 0 deletions