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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 05 Sep 2017 14:59:21 +0200
From:   Mike Galbraith <efault@....de>
To:     Peter Zijlstra <peterz@...radead.org>, mingo@...nel.org,
        tglx@...utronix.de
Cc:     linux-kernel@...r.kernel.org,
        Byungchul Park <max.byungchul.park@...il.com>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Subject: Re: [PATCH 2/2] smp/hotplug,lockdep: Annotate cpuhp_state

Mm, wants a build bandaid for !CONFIG_LOCKDEP

kernel/cpu.c: In function ‘_cpu_down’:
kernel/cpu.c:720:43: error: ‘cpuhp_state_down_key’ undeclared (first use in this function)
  lockdep_init_map(&cpuhp_state_lock_map, "cpuhp_state-down",
                                           ^
kernel/cpu.c:720:43: note: each undeclared identifier is reported only once for each function it appears in
kernel/cpu.c: In function ‘_cpu_up’:
kernel/cpu.c:836:41: error: ‘cpuhp_state_up_key’ undeclared (first use in this function)
  lockdep_init_map(&cpuhp_state_lock_map, "cpuhp_state-up",
                                         ^
scripts/Makefile.build:311: recipe for target 'kernel/cpu.o' failed
make[1]: *** [kernel/cpu.o] Error 1
Makefile:1666: recipe for target 'kernel/cpu.o' failed
make: *** [kernel/cpu.o] Error 2

(mine below, fold or vaporize as you see fit)

---
 kernel/cpu.c |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -545,7 +545,7 @@ void __init cpuhp_threads_init(void)
  * Must be macro to ensure we have two different call sites.
  */
 #ifdef CONFIG_LOCKDEP
-#define lockdep_reinit_st_done()				\
+#define lockdep_reinit_st_done(up)				\
 do {								\
 	int __cpu;						\
 	for_each_possible_cpu(__cpu) {				\
@@ -553,9 +553,17 @@ do {								\
 			per_cpu_ptr(&cpuhp_state, __cpu);	\
 		init_completion(&st->done);			\
 	}							\
+	if (up)							\
+		lockdep_init_map(&cpuhp_state_lock_map,		\
+				 "cpuhp_state-up",		\
+				 &cpuhp_state_up_key, 0);	\
+	else							\
+		lockdep_init_map(&cpuhp_state_lock_map,		\
+				 "cpuhp_state-down",		\
+				 &cpuhp_state_down_key, 0);	\
 } while(0)
 #else
-#define lockdep_reinit_st_done()
+#define lockdep_reinit_st_done(up)
 #endif
 
 #ifdef CONFIG_HOTPLUG_CPU
@@ -716,9 +724,7 @@ static int __ref _cpu_down(unsigned int
 
 	cpus_write_lock();
 
-	lockdep_reinit_st_done();
-	lockdep_init_map(&cpuhp_state_lock_map, "cpuhp_state-down",
-			 &cpuhp_state_down_key, 0);
+	lockdep_reinit_st_done(0);
 
 	cpuhp_tasks_frozen = tasks_frozen;
 
@@ -832,9 +838,7 @@ static int _cpu_up(unsigned int cpu, int
 
 	cpus_write_lock();
 
-	lockdep_reinit_st_done();
-	lockdep_init_map(&cpuhp_state_lock_map, "cpuhp_state-up",
-			 &cpuhp_state_up_key, 0);
+	lockdep_reinit_st_done(1);
 
 	if (!cpu_present(cpu)) {
 		ret = -EINVAL;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ