From: "tip-bot2 for Paul E. McKenney" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Zhengxu Chen <zhxchen17@meta.com>,
Danielle Costantino <dcostantino@meta.com>,
"Paul E. McKenney" <paulmck@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/timers] x86/tsc: Check for sockets instead of CPUs to make code match comment
Date: Fri, 02 Aug 2024 16:43:58 -0000 [thread overview]
Message-ID: <172261703803.2215.17943747116347203203.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20240802154618.4149953-5-paulmck@kernel.org>
The following commit has been merged into the x86/timers branch of tip:
Commit-ID: e7ff4ebffe3bedf55560ef861d80f6500ff0d76f
Gitweb: https://git.kernel.org/tip/e7ff4ebffe3bedf55560ef861d80f6500ff0d76f
Author: Paul E. McKenney <paulmck@kernel.org>
AuthorDate: Fri, 02 Aug 2024 08:46:18 -07:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 02 Aug 2024 18:38:07 +02:00
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 <zhxchen17@meta.com>
Reported-by: Danielle Costantino <dcostantino@meta.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20240802154618.4149953-5-paulmck@kernel.org
---
arch/x86/kernel/tsc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 0ced187..dfe6847 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1288,7 +1288,7 @@ int unsynchronized_tsc(void)
*/
if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) {
/* assume multi socket systems are not synchronized: */
- if (num_possible_cpus() > 1)
+ if (topology_max_packages() > 1)
return 1;
}
prev parent reply other threads:[~2024-08-02 16:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <463c0174-356b-4918-8759-c36b1b30ba55@paulmck-laptop>
2024-08-02 15:45 ` [PATCH v2 clocksource 0/5] TSC and clocksource-watchdog updates for v6.12 Paul E. McKenney
2024-08-02 15:46 ` [PATCH v2 TSC and clocksource-watchdog updates for v6.12 1/5] clocksource: Improve comments for watchdog skew bounds Paul E. McKenney
2024-08-02 16:43 ` [tip: timers/clocksource] " tip-bot2 for Borislav Petkov
2024-08-02 15:46 ` [PATCH v2 TSC and clocksource-watchdog updates for v6.12 2/5] clocksource: Fix brown-bag boolean thinko in cs_watchdog_read() Paul E. McKenney
2024-08-02 16:34 ` [tip: timers/urgent] " tip-bot2 for Paul E. McKenney
2024-08-02 15:46 ` [PATCH v2 TSC and clocksource-watchdog updates for v6.12 3/5] clocksource: Fix comments on WATCHDOG_THRESHOLD & WATCHDOG_MAX_SKEW Paul E. McKenney
2024-08-02 16:43 ` [tip: timers/clocksource] " tip-bot2 for Paul E. McKenney
2024-08-02 15:46 ` [PATCH v2 TSC and clocksource-watchdog updates for v6.12 4/5] clocksource: Set cs_watchdog_read() checks based on .uncertainty_margin Paul E. McKenney
2024-08-02 16:43 ` [tip: timers/clocksource] " tip-bot2 for Paul E. McKenney
2024-08-02 15:46 ` [PATCH v2 TSC and clocksource-watchdog updates for v6.12 5/5] tsc: Check for sockets instead of CPUs to make code match comment Paul E. McKenney
2024-08-02 16:43 ` tip-bot2 for Paul E. McKenney [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=172261703803.2215.17943747116347203203.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=dcostantino@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=zhxchen17@meta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®