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]
Message-ID: <20120601091216.31979.43892.stgit@srivatsabhat.in.ibm.com>
Date:	Fri, 01 Jun 2012 14:42:21 +0530
From:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To:	tglx@...utronix.de, peterz@...radead.org,
	paulmck@...ux.vnet.ibm.com
Cc:	rusty@...tcorp.com.au, mingo@...nel.org, yong.zhang0@...il.com,
	akpm@...ux-foundation.org, vatsa@...ux.vnet.ibm.com, rjw@...k.pl,
	linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
	srivatsa.bhat@...ux.vnet.ibm.com, nikunj@...ux.vnet.ibm.com,
	Hirokazu Takata <takata@...ux-m32r.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	linux-m32r@...linux-m32r.org, linux-m32r-ja@...linux-m32r.org
Subject: [PATCH 09/27] m32r, smpboot: Use generic SMP booting infrastructure

Convert m32r to use the generic framework to boot secondary CPUs.

Notes:
Postpone enabling interrupts to after booting the secondary CPU fully.

Cc: Hirokazu Takata <takata@...ux-m32r.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-m32r@...linux-m32r.org
Cc: linux-m32r-ja@...linux-m32r.org
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>
---

 arch/m32r/kernel/smpboot.c |   46 ++++++++++++++++++++++----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c
index 6ddc51a..cf3fc0c 100644
--- a/arch/m32r/kernel/smpboot.c
+++ b/arch/m32r/kernel/smpboot.c
@@ -49,6 +49,7 @@
 #include <linux/irq.h>
 #include <linux/bootmem.h>
 #include <linux/delay.h>
+#include <linux/smpboot.h>
 
 #include <asm/io.h>
 #include <asm/pgalloc.h>
@@ -114,7 +115,6 @@ static void do_boot_cpu(int);
 
 int start_secondary(void *);
 static void smp_callin(void);
-static void smp_online(void);
 
 static void show_mp_info(int);
 static void smp_store_cpu_info(int);
@@ -418,22 +418,38 @@ void __init smp_cpus_done(unsigned int max_cpus)
  *==========================================================================*/
 int __init start_secondary(void *unused)
 {
+	smpboot_start_secondary(unused);
+	return 0;
+}
+
+void __cpuinit __cpu_pre_starting(void *unused)
+{
+	unsigned int cpu;
+
 	cpu_init();
-	preempt_disable();
 	smp_callin();
-	while (!cpumask_test_cpu(smp_processor_id(), &smp_commenced_mask))
+
+	cpu = smp_processor_id();
+	while (!cpumask_test_cpu(cpu, &smp_commenced_mask))
 		cpu_relax();
+}
 
-	smp_online();
+void __cpuinit __cpu_pre_online(void *unused)
+{
+	/* Get our bogomips. */
+	calibrate_delay();
 
+	/* Save our processor parameters */
+	smp_store_cpu_info(smp_processor_id());
+}
+
+void __cpuinit __cpu_post_online(void *unused)
+{
 	/*
 	 * low-memory mappings have been cleared, flush them from
 	 * the local TLBs too.
 	 */
 	local_flush_tlb_all();
-
-	cpu_idle();
-	return 0;
 }
 
 /*==========================================================================*
@@ -485,22 +501,6 @@ static void __init smp_callin(void)
 	cpumask_set_cpu(cpu_id, &cpu_callin_map);
 }
 
-static void __init smp_online(void)
-{
-	int cpu_id = smp_processor_id();
-
-	notify_cpu_starting(cpu_id);
-
-	local_irq_enable();
-
-	/* Get our bogomips. */
-	calibrate_delay();
-
-	/* Save our processor parameters */
- 	smp_store_cpu_info(cpu_id);
-
-	set_cpu_online(cpu_id, true);
-}
 
 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
 /* Boot up CPUs common Routines                                              */

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ