linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH 4/5] init: Support negative CPUs boot and halt code
Date: Wed,  1 Apr 2015 01:20:35 +0200	[thread overview]
Message-ID: <1427844036-1325-5-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1427844036-1325-1-git-send-email-fweisbec@gmail.com>

Only x86 is supported for now.

Not-Yet-Signed-off-by: Frederic Weisbecker <fweisbec@gmail.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


  parent reply	other threads:[~2015-03-31 23:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31 23:20 [PATCH 0/5] Support negative number of CPUs Frederic Weisbecker
2015-03-31 23:20 ` [PATCH 1/5] cpu: Infrastructure for negative cpu handling Frederic Weisbecker
2015-03-31 23:20 ` [PATCH 2/5] smp: IPI handling for negative CPU Frederic Weisbecker
2015-03-31 23:20 ` [PATCH 3/5] cpumask: Basic negative number of CPUs handling Frederic Weisbecker
2015-03-31 23:20 ` Frederic Weisbecker [this message]
2015-03-31 23:20 ` [PATCH 5/5] x86: Support reverse execution Frederic Weisbecker
2015-04-01  7:35 ` [PATCH 0/5] Support negative number of CPUs Paul E. McKenney
2015-04-01  9:37 ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427844036-1325-5-git-send-email-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).