kexec: migrate to reboot cpu
authorVivek Goyal <vgoyal@redhat.com>
Thu, 19 Dec 2013 01:08:31 +0000 (17:08 -0800)
committerBharat Nihalani <bnihalani@nvidia.com>
Fri, 28 Nov 2014 12:40:58 +0000 (04:40 -0800)
commit5947bc02a4c14e23515a406c8ab0b28aea59e7c7
treeedabf537a2157a3ca12844ebc9f981ba4d0b852d
parentc729260151d6838fee9467bbb80934c375367735
kexec: migrate to reboot cpu

Commit 1b3a5d02ee07 ("reboot: move arch/x86 reboot= handling to generic
kernel") moved reboot= handling to generic code.  In the process it also
removed the code in native_machine_shutdown() which are moving reboot
process to reboot_cpu/cpu0.

I guess that thought must have been that all reboot paths are calling
migrate_to_reboot_cpu(), so we don't need this special handling.  But
kexec reboot path (kernel_kexec()) is not calling
migrate_to_reboot_cpu() so above change broke kexec.  Now reboot can
happen on non-boot cpu and when INIT is sent in second kerneo to bring
up BP, it brings down the machine.

So start calling migrate_to_reboot_cpu() in kexec reboot path to avoid
this problem.

Bisected by WANG Chao.

Change-Id: Ic91cfd26731d488bbd5e387a823ff1c56124dbef
Reported-by: Matthew Whitehead <mwhitehe@redhat.com>
Reported-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Tested-by: Baoquan He <bhe@redhat.com>
Tested-by: WANG Chao <chaowang@redhat.com>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/603284
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
include/linux/reboot.h
kernel/kexec.c
kernel/reboot.c