linux/arch/s390
David Hildenbrand 2d00f75942 KVM: s390: forward hrtimer if guest ckc not pending yet
Patch 0759d0681c ("KVM: s390: cleanup handle_wait by reusing
kvm_vcpu_block") changed the way pending guest clock comparator
interrupts are detected. It was assumed that as soon as the hrtimer
wakes up, the condition for the guest ckc is satisfied.

This is however only true as long as adjclock() doesn't speed
up the monotonic clock. Reason is that the hrtimer is based on
CLOCK_MONOTONIC, the guest clock comparator detection is based
on the raw TOD clock. If CLOCK_MONOTONIC runs faster than the
TOD clock, the hrtimer wakes the target VCPU up too early and
the target VCPU will not detect any pending interrupts, therefore
going back to sleep. It will never be woken up again because the
hrtimer has finished. The VCPU is stuck.

As a quick fix, we have to forward the hrtimer until the guest
clock comparator is really due, to guarantee properly timed wake
ups.

As the hrtimer callback might be triggered on another cpu, we
have to make sure that the timer is really stopped and not currently
executing the callback on another cpu. This can happen if the vcpu
thread is scheduled onto another physical cpu, but the timer base
is not migrated. So lets use hrtimer_cancel instead of try_to_cancel.

A proper fix might be to introduce a RAW based hrtimer.

Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
2015-01-23 13:25:32 +01:00
..
appldata s390: appldata: drop owner assignment from platform_drivers 2014-10-20 16:20:13 +02:00
boot s390/boot: fix boot of compressed kernel built with gcc 4.9 2014-05-27 10:26:04 +02:00
configs s390: update default configuration 2014-10-27 13:27:03 +01:00
crypto crypto: prefix module autoloading with "crypto-" 2014-11-24 22:43:57 +08:00
hypfs assorted conversions to %p[dD] 2014-11-19 13:01:20 -05:00
include KVM: s390: Allow userspace to limit guest memory size 2015-01-23 13:25:30 +01:00
kernel Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2014-12-17 12:31:40 -08:00
kvm KVM: s390: forward hrtimer if guest ckc not pending yet 2015-01-23 13:25:32 +01:00
lib s390/uprobes: fix kprobes dependency 2014-10-17 14:45:51 +02:00
math-emu s390: fix save and restore of the floating-point-control register 2013-10-24 17:17:11 +02:00
mm 3.19 changes for KVM: 2014-12-18 16:05:28 -08:00
net net: filter: constify detection of pkt_type_offset 2014-09-13 17:07:21 -04:00
oprofile s390: Replace __get_cpu_var uses 2014-08-26 13:45:52 -04:00
pci Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2014-12-11 17:30:55 -08:00
defconfig s390: update default configuration 2014-10-27 13:27:03 +01:00
Kbuild s390/pci: base support 2012-11-30 15:40:45 +01:00
Kconfig gcov: enable GCOV_PROFILE_ALL from ARCH Kconfigs 2014-12-13 12:42:51 -08:00
Kconfig.debug Kconfig: consolidate CONFIG_DEBUG_STRICT_USER_COPY_CHECKS 2013-04-30 17:04:09 -07:00
Makefile s390: pass march flag to assembly files as well 2014-09-09 08:53:28 +02:00