linux-stable-rt/arch/powerpc/kernel
Nathan Lynch 8f5c7579ca [POWERPC] Fix multiple bugs in rtas_ibm_suspend_me code
There are several issues with the rtas_ibm_suspend_me code, which
enables platform-assisted suspension of an LPAR as covered in PAPR
2.2.

1.) rtas_ibm_suspend_me uses on_each_cpu() to invoke
rtas_percpu_suspend_me on all cpus via IPI:

if (on_each_cpu(rtas_percpu_suspend_me, &data, 1, 0))
...

'data' is on the calling task's stack, but rtas_ibm_suspend_me takes
no measures to ensure that all instances of rtas_percpu_suspend_me are
finished accessing 'data' before returning.  This can result in the
IPI'd cpus accessing random stack data and getting stuck in H_JOIN.

This is addressed by using an atomic count of workers and a completion
on the stack.

2.) rtas_percpu_suspend_me is needlessly calling H_JOIN in a loop.
The only event that can cause a cpu to return from H_JOIN is an H_PROD
from another cpu or a NMI/system reset.  Each cpu need call H_JOIN
only once per suspend operation.

Remove the loop and the now unnecessary 'waiting' state variable.

3.) H_JOIN must be called with MSR[EE] off, but lazy interrupt
disabling may cause the caller of rtas_ibm_suspend_me to call H_JOIN
with it on; the local_irq_disable() in on_each_cpu() is not
sufficient.

Fix this by explicitly saving the MSR and clearing the EE bit before
calling H_JOIN.

4.) H_PROD is being called with the Linux logical cpu number as the
parameter, not the platform interrupt server value.  (It's also being
called for all possible cpus, which is harmless, but unnecessary.)

This is fixed by calling H_PROD for each online cpu using
get_hard_smp_processor_id(cpu) for the argument.

Signed-off-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-11-19 15:11:30 +11:00
..
vdso32 powerpc32 vDSO: linker script indentation 2007-10-16 10:01:50 -07:00
vdso64 [POWERPC] Fix 64 bits vDSO DWARF info for CR register 2007-10-17 22:30:09 +10:00
Makefile
align.c
asm-offsets.c powerpc: add scaled time accounting 2007-10-18 14:37:28 -07:00
audit.c
binfmt_elf32.c powerpc: Use linux/elfcore-compat.h 2007-10-17 08:42:51 -07:00
btext.c [POWERPC] Fix early btext debug on PowerMac 2007-11-13 16:22:44 +11:00
clock.c
compat_audit.c
cpu_setup_6xx.S Spelling fix: explicitly 2007-10-19 23:22:55 +02:00
cpu_setup_44x.S
cpu_setup_pa6t.S
cpu_setup_ppc970.S
cputable.c [POWERPC] 4xx: Workaround for the 440EP(x)/GR(x) processors identical PVR issue. 2007-11-01 07:13:43 -05:00
crash.c
crash_dump.c
dma_64.c Update arch/ to use sg helpers 2007-10-22 21:19:59 +02:00
entry_32.S [POWERPC] Avoid unpaired stwcx. on some processors 2007-11-13 16:22:43 +11:00
entry_64.S [POWERPC] Add 1TB workaround for PA6T 2007-10-17 22:30:09 +10:00
firmware.c
fpu.S
head_8xx.S
head_32.S
head_40x.S
head_44x.S
head_64.S [POWERPC] Fix si_addr value on low level hash failures 2007-11-08 14:15:34 +11:00
head_booke.h
head_fsl_booke.S
ibmebus.c Update arch/ to use sg helpers 2007-10-22 21:19:59 +02:00
idle.c [POWERPC] Fix sysctl table check failure on PowerMac 2007-11-08 14:15:30 +11:00
idle_6xx.S
idle_power4.S
init_task.c
io.c
iomap.c
iommu.c Update arch/ to use sg helpers 2007-10-22 21:19:59 +02:00
irq.c Spelling fix: explicitly 2007-10-19 23:22:55 +02:00
isa-bridge.c
kprobes.c kprobes: support kretprobe blacklist 2007-10-16 09:43:10 -07:00
l2cr_6xx.S Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
legacy_serial.c
lparcfg.c
machine_kexec.c Use extended crashkernel command line on ppc64 2007-10-19 11:53:51 -07:00
machine_kexec_32.c
machine_kexec_64.c
misc.S
misc_32.S [POWERPC] 4xx: Deal with 44x virtually tagged icache 2007-11-01 07:15:30 -05:00
misc_64.S
module_32.c
module_64.c
msi.c
nvram_64.c
of_device.c [POWERPC] Move of_device allocation into of_device.[ch] 2007-10-17 22:30:07 +10:00
of_platform.c [POWERPC] Move of_device allocation into of_device.[ch] 2007-10-17 22:30:07 +10:00
paca.c
pci-common.c
pci_32.c
pci_64.c
pci_dn.c
pmc.c
ppc32.h
ppc_ksyms.c
proc_ppc64.c
process.c sched: restore deterministic CPU accounting on powerpc 2007-11-09 22:39:38 +01:00
prom.c [POWERPC] 4xx: Workaround for the 440EP(x)/GR(x) processors identical PVR issue. 2007-11-01 07:13:43 -05:00
prom_init.c [POWERPC] ] Fix memset size error 2007-11-08 14:15:33 +11:00
prom_parse.c
ptrace.c Consolidate PTRACE_DETACH 2007-10-16 09:42:49 -07:00
ptrace32.c
rtas-proc.c
rtas-rtc.c
rtas.c [POWERPC] Fix multiple bugs in rtas_ibm_suspend_me code 2007-11-19 15:11:30 +11:00
rtas_flash.c Slab API: remove useless ctor parameter and reorder parameters 2007-10-17 08:42:45 -07:00
rtas_pci.c
semaphore.c
setup-common.c Convert cpu_sibling_map to be a per cpu variable 2007-10-16 09:42:50 -07:00
setup.h
setup_32.c
setup_64.c [POWERPC] Fix cache line vs. block size confusion 2007-11-08 14:15:30 +11:00
signal.c
signal.h
signal_32.c
signal_64.c
smp-tbsync.c
smp.c Convert cpu_sibling_map to be a per cpu variable 2007-10-16 09:42:50 -07:00
softemu8xx.c
suspend.c
swsusp.c
swsusp_32.S [POWERPC] Make altivec code in swsusp_32.S depend on CONFIG_ALTIVEC 2007-11-08 14:15:34 +11:00
swsusp_64.c
swsusp_asm64.S
sys_ppc32.c remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
syscalls.c remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
sysfs.c
systbl.S
tau_6xx.c
time.c [POWERPC] Demote clockevent printk to KERN_DEBUG 2007-11-13 16:22:44 +11:00
traps.c Use helpers to obtain task pid in printks (arch code) 2007-10-19 11:53:43 -07:00
udbg.c
udbg_16550.c
vdso.c
vecemu.c
vector.S
vio.c Driver core: change add_uevent_var to use a struct 2007-10-12 14:51:01 -07:00
vmlinux.lds.S [POWERPC] Fix link errors for allyesconfig 2007-11-08 14:15:33 +11:00