[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1427844036-1325-5-git-send-email-fweisbec@gmail.com>
Date: Wed, 1 Apr 2015 01:20:35 +0200
From: Frederic Weisbecker <fweisbec@...il.com>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>,
"Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>
Subject: [PATCH 4/5] init: Support negative CPUs boot and halt code
Only x86 is supported for now.
Not-Yet-Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
---
arch/x86/kernel/reboot.c | 8 ++++++++
init/main.c | 7 +++++++
2 files changed, 15 insertions(+)
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index bae6c60..d3ae1a3 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -582,8 +582,10 @@ static void native_machine_emergency_restart(void)
}
}
+#if CONFIG_NR_CPUS >= 0
void native_machine_shutdown(void)
{
+
/* Stop the cpus and apics */
#ifdef CONFIG_X86_IO_APIC
/*
@@ -620,6 +622,12 @@ void native_machine_shutdown(void)
x86_platform.iommu_shutdown();
#endif
}
+#else /* #if CONFIG_NR_CPUS >= 0 */
+void native_machine_shutdown(void)
+{
+ start_kernel();
+}
+#endif
static void __machine_emergency_restart(int emergency)
{
diff --git a/init/main.c b/init/main.c
index 6f0f1c5f..8933c8f 100644
--- a/init/main.c
+++ b/init/main.c
@@ -486,6 +486,7 @@ static void __init mm_init(void)
vmalloc_init();
}
+#if CONFIG_NR_CPUS >= 0
asmlinkage __visible void __init start_kernel(void)
{
char *command_line;
@@ -673,6 +674,12 @@ asmlinkage __visible void __init start_kernel(void)
/* Do the rest non-__init'ed, we're now alive */
rest_init();
}
+#else /* #if CONFIG_NR_CPUS >= 0 */
+asmlinkage __visible void __init start_kernel(void)
+{
+ native_machine_shutdown();
+}
+#endif
/* Call all constructor functions linked into the kernel. */
static void __init do_ctors(void)
--
2.1.4
--
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