linux/arch/s390/kvm
Heiko Carstens ed4f20943c s390/time: fix sched_clock() overflow
Converting a 64 Bit TOD format value to nanoseconds means that the value
must be divided by 4.096. In order to achieve that we multiply with 125
and divide by 512.
When used within sched_clock() this triggers an overflow after appr.
417 days. Resulting in a sched_clock() return value that is much smaller
than previously and therefore may cause all sort of weird things in
subsystems that rely on a monotonic sched_clock() behaviour.

To fix this implement a tod_to_ns() helper function which converts TOD
values without overflow and call this function from both places that
open coded the conversion: sched_clock() and kvm_s390_handle_wait().

Cc: stable@kernel.org
Reviewed-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2013-01-16 15:57:52 +01:00
..
diag.c KVM: s390: Add implementation-specific trace events 2012-07-26 14:04:35 +03:00
gaccess.h s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
intercept.c KVM: s390: Add implementation-specific trace events 2012-07-26 14:04:35 +03:00
interrupt.c s390/time: fix sched_clock() overflow 2013-01-16 15:57:52 +01:00
Kconfig KVM updates for the 3.7 merge window 2012-10-04 09:30:33 -07:00
kvm-s390.c Merge tag 'kvm-3.8-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2012-12-13 15:31:08 -08:00
kvm-s390.h s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
Makefile [S390] move sie code to entry.S 2011-07-24 10:48:21 +02:00
priv.c KVM updates for the 3.7 merge window 2012-10-04 09:30:33 -07:00
sigp.c KVM: s390: Add architectural trace events 2012-07-26 14:04:34 +03:00
trace-s390.h KVM: s390: Add implementation-specific trace events 2012-07-26 14:04:35 +03:00
trace.h KVM: s390: Add architectural trace events 2012-07-26 14:04:34 +03:00