From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Date: Thu, 20 Dec 2012 10:49:45 +0000 From: Will Deacon Subject: Re: [PATCH] kexec: disable non-boot CPUs Message-ID: <20121220104945.GC16887@mudshark.cambridge.arm.com> References: <1355960681-32015-1-git-send-email-swarren@wwwdotorg.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1355960681-32015-1-git-send-email-swarren@wwwdotorg.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: kexec-bounces@lists.infradead.org Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Stephen Warren Cc: "linux-tegra@vger.kernel.org" , Stephen Warren , "kexec@lists.infradead.org" , Eric Biederman , "linux-arm-kernel@lists.infradead.org" Hi Stephen, On Wed, Dec 19, 2012 at 11:44:41PM +0000, Stephen Warren wrote: > From: Stephen Warren > > Both the regular reboot and shutdown paths do this. It seems reasonable > for kexec to work the same way. > > On the Tegra ARM SoC at least, this change allows kexec to work with SMP > enabled. ARM's machine_shutdown() simply puts all CPUs into a loop. If > the code of that loop is over-written, the CPUs may crash, and cause the > kexec'd kernel not to be able to initialize them. In practice, this > causes the kexec'd kernel to hang and/or crash. The intended way to > solve this is for ARM machines to provide a cpu_kill SMP operation to > e.g. power down the CPUs, or place them in reset. However, at least on > Tegra, the implementation of that function would simply be duplicating > the hotplug code that already exists, so it seems simpler to just call > disable_nonboot_cpus() for the kexec path, just like reboot/shutdown. If you do manage to get this merged, please can you follow up with a patch to remove the smp_kill_cpus bits from arch/arm/kernel/smp.c please? It only exists as a hook to do exactly this and currently nobody is using it afaict. Cheers, Will _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH] kexec: disable non-boot CPUs Date: Thu, 20 Dec 2012 10:49:45 +0000 Message-ID: <20121220104945.GC16887@mudshark.cambridge.arm.com> References: <1355960681-32015-1-git-send-email-swarren@wwwdotorg.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1355960681-32015-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kexec-bounces-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Errors-To: kexec-bounces+glkk-kexec=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Stephen Warren Cc: "linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Stephen Warren , "kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" , Eric Biederman , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" List-Id: linux-tegra@vger.kernel.org Hi Stephen, On Wed, Dec 19, 2012 at 11:44:41PM +0000, Stephen Warren wrote: > From: Stephen Warren > > Both the regular reboot and shutdown paths do this. It seems reasonable > for kexec to work the same way. > > On the Tegra ARM SoC at least, this change allows kexec to work with SMP > enabled. ARM's machine_shutdown() simply puts all CPUs into a loop. If > the code of that loop is over-written, the CPUs may crash, and cause the > kexec'd kernel not to be able to initialize them. In practice, this > causes the kexec'd kernel to hang and/or crash. The intended way to > solve this is for ARM machines to provide a cpu_kill SMP operation to > e.g. power down the CPUs, or place them in reset. However, at least on > Tegra, the implementation of that function would simply be duplicating > the hotplug code that already exists, so it seems simpler to just call > disable_nonboot_cpus() for the kexec path, just like reboot/shutdown. If you do manage to get this merged, please can you follow up with a patch to remove the smp_kill_cpus bits from arch/arm/kernel/smp.c please? It only exists as a hook to do exactly this and currently nobody is using it afaict. Cheers, Will From mboxrd@z Thu Jan 1 00:00:00 1970 From: will.deacon@arm.com (Will Deacon) Date: Thu, 20 Dec 2012 10:49:45 +0000 Subject: [PATCH] kexec: disable non-boot CPUs In-Reply-To: <1355960681-32015-1-git-send-email-swarren@wwwdotorg.org> References: <1355960681-32015-1-git-send-email-swarren@wwwdotorg.org> Message-ID: <20121220104945.GC16887@mudshark.cambridge.arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Stephen, On Wed, Dec 19, 2012 at 11:44:41PM +0000, Stephen Warren wrote: > From: Stephen Warren > > Both the regular reboot and shutdown paths do this. It seems reasonable > for kexec to work the same way. > > On the Tegra ARM SoC at least, this change allows kexec to work with SMP > enabled. ARM's machine_shutdown() simply puts all CPUs into a loop. If > the code of that loop is over-written, the CPUs may crash, and cause the > kexec'd kernel not to be able to initialize them. In practice, this > causes the kexec'd kernel to hang and/or crash. The intended way to > solve this is for ARM machines to provide a cpu_kill SMP operation to > e.g. power down the CPUs, or place them in reset. However, at least on > Tegra, the implementation of that function would simply be duplicating > the hotplug code that already exists, so it seems simpler to just call > disable_nonboot_cpus() for the kexec path, just like reboot/shutdown. If you do manage to get this merged, please can you follow up with a patch to remove the smp_kill_cpus bits from arch/arm/kernel/smp.c please? It only exists as a hook to do exactly this and currently nobody is using it afaict. Cheers, Will