lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250806155535.34338-1-wangfushuai@baidu.com>
Date: Wed, 6 Aug 2025 23:55:35 +0800
From: Fushuai Wang <wangfushuai@...du.com>
To: <linux-kernel@...r.kernel.org>
CC: <tglx@...utronix.de>, <mingo@...hat.com>, <bp@...en8.de>,
	<dave.hansen@...ux.intel.com>, <x86@...nel.org>, <hpa@...or.com>,
	<peterz@...radead.org>, <xin@...or.com>, Fushuai Wang <wangfushuai@...du.com>
Subject: [PATCH] x86/tsc: Use cpumask_next_wrap() in tsc_sync_check_timer_fn()

Replace the manual sequence of cpumask_next() and cpumask_first()
with a single call to cpumask_next_wrap() in tsc_sync_check_timer_fn().

Signed-off-by: Fushuai Wang <wangfushuai@...du.com>
---
 arch/x86/kernel/tsc_sync.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c
index ec3aa340d351..ef6ebf2bf7aa 100644
--- a/arch/x86/kernel/tsc_sync.c
+++ b/arch/x86/kernel/tsc_sync.c
@@ -99,9 +99,7 @@ static void tsc_sync_check_timer_fn(struct timer_list *unused)
 	tsc_verify_tsc_adjust(false);
 
 	/* Run the check for all onlined CPUs in turn */
-	next_cpu = cpumask_next(raw_smp_processor_id(), cpu_online_mask);
-	if (next_cpu >= nr_cpu_ids)
-		next_cpu = cpumask_first(cpu_online_mask);
+	next_cpu = cpumask_next_wrap(raw_smp_processor_id(), cpu_online_mask);
 
 	tsc_sync_check_timer.expires += SYNC_CHECK_INTERVAL;
 	add_timer_on(&tsc_sync_check_timer, next_cpu);
-- 
2.36.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ