Files
kernel/include/linux
Salman Qazi ee9c2e08d3 sched/x86: Fix overflow in cyc2ns_offset
commit 9993bc635d upstream.

When a machine boots up, the TSC generally gets reset.  However,
when kexec is used to boot into a kernel, the TSC value would be
carried over from the previous kernel.  The computation of
cycns_offset in set_cyc2ns_scale is prone to an overflow, if the
machine has been up more than 208 days prior to the kexec.  The
overflow happens when we multiply *scale, even though there is
enough room to store the final answer.

We fix this issue by decomposing tsc_now into the quotient and
remainder of division by CYC2NS_SCALE_FACTOR and then performing
the multiplication separately on the two components.

Refactor code to share the calculation with the previous
fix in __cycles_2_ns().

Signed-off-by: Salman Qazi <sqazi@google.com>
Acked-by: John Stultz <john.stultz@linaro.org>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Turner <pjt@google.com>
Cc: john stultz <johnstul@us.ibm.com>
Link: http://lkml.kernel.org/r/20120310004027.19291.88460.stgit@dungbeetle.mtv.corp.google.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-13 08:14:08 -07:00
..
2011-06-01 11:36:49 +01:00
2011-05-28 17:41:46 +02:00
2012-02-20 12:48:14 -08:00
2011-05-26 17:12:34 -07:00
2011-05-26 17:12:34 -07:00
2012-01-25 17:24:51 -08:00
2011-06-27 16:06:19 -07:00
2011-05-23 10:47:06 -05:00
2011-05-29 13:03:09 +01:00
2011-05-24 10:21:29 +02:00
2011-05-24 10:21:29 +02:00
2011-06-09 15:05:48 -07:00
2012-02-29 16:34:35 -08:00
2012-02-29 16:34:35 -08:00
2011-06-27 16:06:19 -07:00
2011-05-26 12:03:50 -07:00
2011-05-25 20:43:32 +02:00
2011-05-26 17:12:37 -07:00
2011-05-24 14:33:35 +02:00
2012-04-02 09:27:09 -07:00
2011-11-11 09:36:29 -08:00
2011-11-11 09:36:48 -08:00
2011-05-26 17:12:34 -07:00
2012-01-25 17:24:38 -08:00
2012-02-06 09:24:01 -08:00
2011-05-26 17:12:37 -07:00
2011-05-24 12:10:51 +02:00
2011-05-25 08:39:19 -07:00
2011-10-03 11:40:08 -07:00
2011-10-16 14:14:51 -07:00
2011-12-09 08:52:39 -08:00
2011-06-27 18:00:12 -07:00
2011-06-15 20:03:59 -07:00
2011-10-03 11:39:49 -07:00
2011-11-11 09:35:12 -08:00
2011-06-07 09:05:42 -07:00
2012-01-12 11:35:25 -08:00
2011-05-30 11:14:16 +09:30