diff options
author | Peter Zijlstra <peterz@infradead.org> | 2023-05-19 13:21:06 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2023-06-05 22:11:07 +0300 |
commit | 77750f78b0b3247c64b9821b49158cafe0506880 (patch) | |
tree | 0b3efda22d56270b3e3b34a072d0865f1ddc2249 /drivers/edac/pasemi_edac.c | |
parent | fc4a0db4149afcdae2527f0d8c376accca34adc9 (diff) | |
download | linux-77750f78b0b3247c64b9821b49158cafe0506880.tar.xz |
x86/vdso: Fix gettimeofday masking
Because of how the virtual clocks use U64_MAX as an exception value
instead of a valid time, the clocks can no longer be assumed to wrap
cleanly. This is then compounded by arch_vdso_cycles_ok() rejecting
everything with the MSB/Sign-bit set.
Therefore, the effective mask becomes S64_MAX, and the comment with
vdso_calc_delta() that states the mask is U64_MAX and isn't optimized
out is just plain silly.
Now, the code has a negative filter -- to deal with TSC wobbles:
if (cycles > last)
which is just plain wrong, because it should've been written as:
if ((s64)(cycles - last) > 0)
to take wrapping into account, but per all the above, we don't
actually wrap on u64 anymore.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michael Kelley <mikelley@microsoft.com> # Hyper-V
Link: https://lore.kernel.org/r/20230519102715.704767397@infradead.org
Diffstat (limited to 'drivers/edac/pasemi_edac.c')
0 files changed, 0 insertions, 0 deletions