]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/powernv: Fix MCE handler to avoid trashing CR0/CR1 registers.
authorMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Fri, 5 Aug 2016 12:04:13 +0000 (17:34 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 9 Aug 2016 06:51:35 +0000 (16:51 +1000)
commit7e52ca49fd2e3bea40fcc05518f93b67b7a26d16
tree53ced165e0f3cbe23663fc2e3c8a9a2014e5b6b6
parent66425637d63e0446e364ca01522881d52de921b4
powerpc/powernv: Fix MCE handler to avoid trashing CR0/CR1 registers.

The current implementation of MCE early handling modifies CR0/1 registers
without saving its old values. Fix this by moving early check for
powersaving mode to machine_check_handle_early().

The power architecture 2.06 or later allows the possibility of getting
machine check while in nap/sleep/winkle. The last bit of HSPRG0 is set
to 1, if thread is woken up from winkle. Hence, clear the last bit of
HSPRG0 (r13) before MCE handler starts using it as paca pointer.

Also, the current code always puts the thread into nap state irrespective
of whatever idle state it woke up from. Fix that by looking at
paca->thread_idle_state and put the thread back into same state where it
came from.

Fixes: 305c6e94b7a2 ("powerpc/book3s: Return from interrupt if coming from evil context.")
Reported-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Reviewed-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/exceptions-64s.S