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:	Fri, 01 Jun 2012 14:45:54 +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,
	"James E.J. Bottomley" <jejb@...isc-linux.org>,
	Helge Deller <deller@....de>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Mike Frysinger <vapier@...too.org>,
	David Howells <dhowells@...hat.com>,
	linux-parisc@...r.kernel.org
Subject: [PATCH 24/27] parisc, smpboot: Use generic SMP booting infrastructure

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

Notes:
1. The secondary cpu was being set in the cpu_online_mask way too early
when things aren't initialized fully yet. Postpone that.

Cc: "James E.J. Bottomley" <jejb@...isc-linux.org>
Cc: Helge Deller <deller@....de>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Rusty Russell <rusty@...tcorp.com.au>
Cc: Mike Frysinger <vapier@...too.org>
Cc: David Howells <dhowells@...hat.com>
Cc: linux-parisc@...r.kernel.org
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>
---

 arch/parisc/kernel/smp.c |   30 ++++++++++++++----------------
 1 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 6266730..a6199e2 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -32,6 +32,7 @@
 #include <linux/bitops.h>
 #include <linux/ftrace.h>
 #include <linux/cpu.h>
+#include <linux/smpboot.h>
 
 #include <linux/atomic.h>
 #include <asm/current.h>
@@ -280,8 +281,6 @@ static void __init
 smp_cpu_init(int cpunum)
 {
 	extern int init_per_cpu(int);  /* arch/parisc/kernel/processor.c */
-	extern void init_IRQ(void);    /* arch/parisc/kernel/irq.c */
-	extern void start_cpu_itimer(void); /* arch/parisc/kernel/time.c */
 
 	/* Set modes and Enable floating point coprocessor */
 	(void) init_per_cpu(cpunum);
@@ -297,10 +296,12 @@ smp_cpu_init(int cpunum)
 		printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum);
 		machine_halt();
 	}
+}
 
-	notify_cpu_starting(cpunum);
-
-	set_cpu_online(cpunum, true);
+void __cpuinit __cpu_pre_online(void *unused)
+{
+	extern void init_IRQ(void);    /* arch/parisc/kernel/irq.c */
+	extern void start_cpu_itimer(void); /* arch/parisc/kernel/time.c */
 
 	/* Initialise the idle task for this CPU */
 	atomic_inc(&init_mm.mm_count);
@@ -310,6 +311,9 @@ smp_cpu_init(int cpunum)
 
 	init_IRQ();   /* make sure no IRQs are enabled or pending */
 	start_cpu_itimer();
+
+	flush_cache_all_local(); /* start with known state */
+	flush_tlb_all_local(NULL);
 }
 
 
@@ -319,20 +323,14 @@ smp_cpu_init(int cpunum)
  */
 void __init smp_callin(void)
 {
+	smpboot_start_secondary(NULL);
+}
+
+void __cpuinit __cpu_pre_starting(void *unused)
+{
 	int slave_id = cpu_now_booting;
 
 	smp_cpu_init(slave_id);
-	preempt_disable();
-
-	flush_cache_all_local(); /* start with known state */
-	flush_tlb_all_local(NULL);
-
-	local_irq_enable();  /* Interrupts have been off until now */
-
-	cpu_idle();      /* Wait for timer to schedule some work */
-
-	/* NOTREACHED */
-	panic("smp_callin() AAAAaaaaahhhh....\n");
 }
 
 /*

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