]> Git Repo - linux.git/commit
x86/tsc: Check for sockets instead of CPUs to make code match comment
authorPaul E. McKenney <[email protected]>
Fri, 2 Aug 2024 15:46:18 +0000 (08:46 -0700)
committerThomas Gleixner <[email protected]>
Fri, 2 Aug 2024 16:38:07 +0000 (18:38 +0200)
commite7ff4ebffe3bedf55560ef861d80f6500ff0d76f
tree807a5e13592efa3aa1a5f66ec913dcaf89db2f50
parent531b2ca0a940ac9db03f246c8b77c4201de72b00
x86/tsc: Check for sockets instead of CPUs to make code match comment

The unsynchronized_tsc() eventually checks num_possible_cpus(), and if the
system is non-Intel and the number of possible CPUs is greater than one,
assumes that TSCs are unsynchronized.  This despite the comment saying
"assume multi socket systems are not synchronized", that is, socket rather
than CPU.  This behavior was preserved by commit 8fbbc4b45ce3 ("x86: merge
tsc_init and clocksource code") and by the previous relevant commit
7e69f2b1ead2 ("clocksource: Remove the update callback").

The clocksource drivers were added by commit 5d0cf410e94b ("Time: i386
Clocksource Drivers") back in 2006, and the comment still said "socket"
rather than "CPU".

Therefore, bravely (and perhaps foolishly) make the code match the
comment.

Note that it is possible to bypass both code and comment by booting
with tsc=reliable, but this also disables the clocksource watchdog,
which is undesirable when trust in the TSC is strictly limited.

Reported-by: Zhengxu Chen <[email protected]>
Reported-by: Danielle Costantino <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/all/[email protected]
arch/x86/kernel/tsc.c
This page took 0.061671 seconds and 4 git commands to generate.