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: <20120601091403.31979.12717.stgit@srivatsabhat.in.ibm.com>
Date:	Fri, 01 Jun 2012 14:44:08 +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,
	"Nikunj A. Dadhania" <nikunj@...ux.vnet.ibm.com>,
	David Howells <dhowells@...hat.com>,
	Koichi Yasutake <yasutake.koichi@...panasonic.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Yong Zhang <yong.zhang0@...il.com>, linux-am33-list@...hat.com
Subject: [PATCH 17/27] mn10300, smpboot: Use generic SMP booting infrastructure

From: Nikunj A. Dadhania <nikunj@...ux.vnet.ibm.com>

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

Notes:
1. In order to avoid enabling interrupts very early during secondary CPU
bringup (in smp_cpu_init()), use arch_local_save_flags() instead of
arch_local_cli_save().

Signed-off-by: Nikunj A. Dadhania <nikunj@...ux.vnet.ibm.com>
Cc: David Howells <dhowells@...hat.com>
Cc: Koichi Yasutake <yasutake.koichi@...panasonic.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Yong Zhang <yong.zhang0@...il.com>
Cc: linux-am33-list@...hat.com
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>
---

 arch/mn10300/kernel/smp.c |   32 +++++++++++---------------------
 1 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/arch/mn10300/kernel/smp.c b/arch/mn10300/kernel/smp.c
index b19e75d2..9c4e35e 100644
--- a/arch/mn10300/kernel/smp.c
+++ b/arch/mn10300/kernel/smp.c
@@ -25,6 +25,7 @@
 #include <linux/profile.h>
 #include <linux/smp.h>
 #include <linux/cpu.h>
+#include <linux/smpboot.h>
 #include <asm/tlbflush.h>
 #include <asm/bitops.h>
 #include <asm/processor.h>
@@ -100,7 +101,6 @@ cpumask_t cpu_initialized __initdata = CPU_MASK_NONE;
 static int do_boot_cpu(int);
 static void smp_show_cpu_info(int cpu_id);
 static void smp_callin(void);
-static void smp_online(void);
 static void smp_store_cpu_info(int);
 static void smp_cpu_init(void);
 static void smp_tune_scheduling(void);
@@ -607,7 +607,7 @@ static void __init smp_cpu_init(void)
 	mn10300_ipi_shutdown(SMP_BOOT_IRQ);
 
 	/* Set up the non-maskable call function IPI */
-	flags = arch_local_cli_save();
+	flags = arch_local_save_flags();
 	GxICR(CALL_FUNCTION_NMI_IPI) = GxICR_NMI | GxICR_ENABLE | GxICR_DETECT;
 	tmp16 = GxICR(CALL_FUNCTION_NMI_IPI);
 	arch_local_irq_restore(flags);
@@ -655,20 +655,25 @@ void smp_prepare_cpu_init(void)
  */
 int __init start_secondary(void *unused)
 {
+	smpboot_start_secondary(unused);
+	return 0;
+}
+
+void __cpuinit __cpu_pre_starting(void *unused)
+{
 	smp_cpu_init();
 	smp_callin();
 	while (!cpumask_test_cpu(smp_processor_id(), &smp_commenced_mask))
 		cpu_relax();
 
 	local_flush_tlb();
-	preempt_disable();
-	smp_online();
+}
 
+void __cpuinit __cpu_post_online(void *unused)
+{
 #ifdef CONFIG_GENERIC_CLOCKEVENTS
 	init_clockevents();
 #endif
-	cpu_idle();
-	return 0;
 }
 
 /**
@@ -865,21 +870,6 @@ static void __init smp_callin(void)
 	cpumask_set_cpu(cpu, &cpu_callin_map);
 }
 
-/**
- * smp_online - Set cpu_online_mask
- */
-static void __init smp_online(void)
-{
-	int cpu;
-
-	cpu = smp_processor_id();
-
-	notify_cpu_starting(cpu);
-
-	set_cpu_online(cpu, true);
-
-	local_irq_enable();
-}
 
 /**
  * smp_cpus_done -

--
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