linux-uconsole/arch/s390
Heiko Carstens 228f49c2da s390/time: fix sched_clock() overflow
commit ed4f20943c upstream.

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().

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-21 11:44:58 -08:00
..
appldata [S390] mm: add ZONE_DMA to 31-bit config again 2011-05-26 09:48:25 +02:00
boot Merge branch 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2011-03-20 18:14:55 -07:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2011-05-20 17:24:14 -07:00
hypfs treewide: remove extra semicolons 2011-04-10 17:01:05 +02:00
include/asm s390/time: fix sched_clock() overflow 2013-01-21 11:44:58 -08:00
kernel s390/time: fix sched_clock() overflow 2013-01-21 11:44:58 -08:00
kvm s390/time: fix sched_clock() overflow 2013-01-21 11:44:58 -08:00
lib [S390] delay: implement ndelay 2011-05-26 09:48:25 +02:00
math-emu s390: change to new flag variable 2011-03-17 14:02:57 +01:00
mm s390/gup: add missing TASK_SIZE check to get_user_pages_fast() 2012-11-26 11:34:34 -08:00
oprofile oprofile: Fix uninitialized memory access when writing to writing to oprofilefs 2012-01-06 14:13:51 -08:00
defconfig [S390] Update default configuration 2011-01-12 09:55:24 +01:00
Kbuild [S390] standardize Kbuild rules 2010-10-25 16:10:14 +02:00
Kconfig S390: fix tlb flushing for page table pages 2012-04-22 16:21:45 -07:00
Kconfig.debug [S390] Write protect module text and RO data 2011-03-15 17:08:23 +01:00
Makefile [S390] remove redundant stack check option 2011-03-15 17:08:22 +01:00