Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] x86_64: Implemenent machine_emergency_restart

It is not safe to call set_cpus_allowed() in interrupt
context and disabling the apics is complicated code.
So unconditionally skip machine_shutdown in machine_emergency_reboot
on x86_64.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Eric W. Biederman and committed by
Linus Torvalds
62b3a04d 7c9a9007

+12 -8
+11 -7
arch/x86_64/kernel/reboot.c
··· 109 109 local_irq_enable(); 110 110 } 111 111 112 - void machine_restart(char * __unused) 112 + void machine_emergency_restart(void) 113 113 { 114 114 int i; 115 115 116 - printk("machine restart\n"); 117 - 118 - if (!reboot_force) { 119 - machine_shutdown(); 120 - } 121 - 122 116 /* Tell the BIOS if we want cold or warm reboot */ 123 117 *((unsigned short *)__va(0x472)) = reboot_mode; 124 118 ··· 135 141 break; 136 142 } 137 143 } 144 + } 145 + 146 + void machine_restart(char * __unused) 147 + { 148 + printk("machine restart\n"); 149 + 150 + if (!reboot_force) { 151 + machine_shutdown(); 152 + } 153 + machine_emergency_restart(); 138 154 } 139 155 140 156 void machine_halt(void)
+1 -1
include/asm-x86_64/emergency-restart.h
··· 1 1 #ifndef _ASM_EMERGENCY_RESTART_H 2 2 #define _ASM_EMERGENCY_RESTART_H 3 3 4 - #include <asm-generic/emergency-restart.h> 4 + extern void machine_emergency_restart(void); 5 5 6 6 #endif /* _ASM_EMERGENCY_RESTART_H */