linux/arch/powerpc
Daniel Axtens ffb2d78eca powerpc/mce: fix off by one errors in mce event handling
Before 69111bac42 ("powerpc: Replace __get_cpu_var uses"), in
save_mce_event, index got the value of mce_nest_count, and
mce_nest_count was incremented *after* index was set.

However, that patch changed the behaviour so that mce_nest count was
incremented *before* setting index.

This causes an off-by-one error, as get_mce_event sets index as
mce_nest_count - 1 before reading mce_event.  Thus get_mce_event reads
bogus data, causing warnings like
"Machine Check Exception, Unknown event version 0 !"
and breaking MCEs handling.

Restore the old behaviour and unbreak MCE handling by subtracting one
from the newly incremented value.

The same broken change occured in machine_check_queue_event (which set
a queue read by machine_check_process_queued_event).  Fix that too,
unbreaking printing of MCE information.

Fixes: 69111bac42 ("powerpc: Replace __get_cpu_var uses")
CC: stable@vger.kernel.org
CC: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
CC: Christoph Lameter <cl@linux.com>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2015-05-12 19:44:01 +10:00
..
boot powerpc: Remove the celleb support 2015-04-07 17:15:13 +10:00
configs powerpc: Remove the celleb support 2015-04-07 17:15:13 +10:00
crypto crypto: powerpc - move files to fix build error 2015-03-09 21:06:19 +11:00
include Revert "powerpc/tm: Abort syscalls in active transactions" 2015-04-30 15:24:58 +10:00
kernel powerpc/mce: fix off by one errors in mce event handling 2015-05-12 19:44:01 +10:00
kvm powerpc/kvm: Fix SMP=n build error in book3s_xics.c 2015-04-29 08:06:32 +10:00
lib powerpc: Export __spin_yield 2015-04-21 15:21:28 +02:00
math-emu powerpc: Correct emulated mtfsf instruction 2014-04-07 10:33:11 +10:00
mm powerpc/mm: Return NULL for not present hugetlb page 2015-05-12 11:04:29 +10:00
net ppc: bpf: Add SKF_AD_CPU for ppc32 2015-02-20 15:19:43 -05:00
oprofile powerpc/oprofile: reduce mmap_sem hold for exe_file 2015-04-17 09:04:11 -04:00
perf powerpc/mm/thp: Make page table walk safe against thp split/collapse 2015-04-17 11:23:39 +10:00
platforms powerpc/pseries: Correct cpu affinity for dlpar added cpus 2015-05-01 13:47:24 +10:00
sysdev powerpc: dart_iommu: Remove check for controller_ops == NULL case 2015-04-11 20:49:19 +10:00
xmon powerpc updates for 3.20 2015-02-11 18:15:38 -08:00
Kconfig powerpc updates for 4.1 2015-04-16 13:53:32 -05:00
Kconfig.debug powerpc: Remove the celleb support 2015-04-07 17:15:13 +10:00
Makefile powerpc: Convert relocs_check to a shell script using grep 2015-03-23 14:47:39 +11:00
relocs_check.sh powerpc: Convert relocs_check to a shell script using grep 2015-03-23 14:47:39 +11:00