From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753116AbbCaXVZ (ORCPT ); Tue, 31 Mar 2015 19:21:25 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:35753 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752860AbbCaXUv (ORCPT ); Tue, 31 Mar 2015 19:20:51 -0400 From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , "Paul E . McKenney" Subject: [PATCH 4/5] init: Support negative CPUs boot and halt code Date: Wed, 1 Apr 2015 01:20:35 +0200 Message-Id: <1427844036-1325-5-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1427844036-1325-1-git-send-email-fweisbec@gmail.com> References: <1427844036-1325-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only x86 is supported for now. Not-Yet-Signed-off-by: Frederic Weisbecker --- 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