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: <20240425121443.1009824-1-maobibo@loongson.cn>
Date: Thu, 25 Apr 2024 20:14:43 +0800
From: Bibo Mao <maobibo@...ngson.cn>
To: Huacai Chen <chenhuacai@...nel.org>
Cc: Mark Rutland <mark.rutland@....com>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Jiri Olsa <jolsa@...nel.org>,
	Ian Rogers <irogers@...gle.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	WANG Xuerui <kernel@...0n.name>,
	linux-perf-users@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	loongarch@...ts.linux.dev
Subject: [PATCH] LoongArch: Lately init pmu after smp is online

There is smp function call named reset_counters() to init PMU registers of
every CPU in PMU initialization state. It requires that all CPUs are
online. However there is early_initcall prefix with PMU init funciton
init_hw_perf_events(), so that pmu init funciton is called in
do_pre_smp_initcalls() and before function smp_init(). Function
reset_counters() cannot work on other CPUs since they do not boot up
still.

Here replace prefix early_initcall with pure_initcall, so that PMU
init function is called after every cpu is online.

Signed-off-by: Bibo Mao <maobibo@...ngson.cn>
---
 arch/loongarch/kernel/perf_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/loongarch/kernel/perf_event.c b/arch/loongarch/kernel/perf_event.c
index 3265c8f33223..f86a4b838dd7 100644
--- a/arch/loongarch/kernel/perf_event.c
+++ b/arch/loongarch/kernel/perf_event.c
@@ -874,4 +874,4 @@ static int __init init_hw_perf_events(void)
 
 	return 0;
 }
-early_initcall(init_hw_perf_events);
+pure_initcall(init_hw_perf_events);

base-commit: e88c4cfcb7b888ac374916806f86c17d8ecaeb67


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ