kernel-ark/arch/i386/kernel
Eric W. Biederman 6e3fbee5f1 [PATCH] i386/x86-64: Don't IPI to offline cpus on shutdown
So why are we calling smp_send_stop from machine_halt?

We don't.

Looking more closely at the bug report the problem here
is that halt -p is called which triggers not a halt but
an attempt to power off.

machine_power_off calls machine_shutdown which calls smp_send_stop.

If pm_power_off is set we should never make it out machine_power_off
to the call of do_exit.  So pm_power_off must not be set in this case.
When pm_power_off is not set we expect machine_power_off to devolve
into machine_halt.

So how do we fix this?

Playing too much with smp_send_stop is dangerous because it
must also be safe to be called from panic.

It looks like the obviously correct fix is to only call
machine_shutdown when pm_power_off is defined.  Doing
that will make Andi's assumption about not scheduling
true and generally simplify what must be supported.

This turns machine_power_off into a noop like machine_halt
when pm_power_off is not defined.

If the expected behavior is that sys_reboot(LINUX_REBOOT_CMD_POWER_OFF)
becomes sys_reboot(LINUX_REBOOT_CMD_HALT) if pm_power_off is NULL
this is not quite a comprehensive fix as we pass a different parameter
to the reboot notifier and we set system_state to a different value
before calling device_shutdown().

Unfortunately any fix more comprehensive I can think of is not
obviously correct.  The core problem is that there is no architecture
independent way to detect if machine_power will become a noop, without
calling it.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-11 19:04:50 -08:00
..
acpi
cpu [PATCH] i386/x86-64: Update AMD CPUID flags 2006-01-11 19:01:12 -08:00
timers
apic.c
apm.c [PATCH] capable/capability.h (arch/) 2006-01-11 18:42:14 -08:00
asm-offsets.c
bootflag.c
cpuid.c
crash_dump.c [PATCH] kdump: read previous kernel's memory 2006-01-10 08:01:28 -08:00
crash.c [PATCH] kdump: save registers early (inline functions) 2006-01-10 08:01:27 -08:00
dmi_scan.c
doublefault.c
early_printk.c
efi_stub.S
efi.c
entry.S [PATCH] Make vm86 support optional 2006-01-08 20:14:11 -08:00
head.S
i386_ksyms.c
i387.c
i8237.c
i8259.c
init_task.c
io_apic.c
ioport.c [PATCH] capable/capability.h (arch/) 2006-01-11 18:42:14 -08:00
irq.c
kprobes.c [PATCH] kprobes: fix race in recovery of reentrant probe 2006-01-11 18:42:12 -08:00
ldt.c
machine_kexec.c
Makefile [PATCH] kdump: read previous kernel's memory 2006-01-10 08:01:28 -08:00
mca.c
microcode.c [PATCH] capable/capability.h (arch/) 2006-01-11 18:42:14 -08:00
module.c
mpparse.c
msr.c
nmi.c
numaq.c
pci-dma.c
process.c [PATCH] Make vm86 support optional 2006-01-08 20:14:11 -08:00
ptrace.c
quirks.c
reboot_fixups.c
reboot.c [PATCH] i386/x86-64: Don't IPI to offline cpus on shutdown 2006-01-11 19:04:50 -08:00
relocate_kernel.S
scx200.c [PATCH] arch: Replace pci_module_init() with pci_register_driver() 2006-01-09 12:13:21 -08:00
semaphore.c
setup.c [PATCH] kdump: x86_64: add elfcorehdr command line option 2006-01-10 08:01:27 -08:00
sigframe.h
signal.c
smp.c
smpboot.c
srat.c
summit.c
sys_i386.c
syscall_table.S
sysenter.c
time_hpet.c
time.c
trampoline.S
traps.c [PATCH] printk levels for i386 oops code. 2006-01-10 08:01:25 -08:00
vm86.c [PATCH] capable/capability.h (arch/) 2006-01-11 18:42:14 -08:00
vmlinux.lds.S
vsyscall-int80.S
vsyscall-note.S
vsyscall-sigreturn.S
vsyscall-sysenter.S
vsyscall.lds.S
vsyscall.S