Return-Path: Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3s7sRt3KqJzDqQ5 for ; Tue, 9 Aug 2016 21:26:34 +1000 (AEST) In-Reply-To: <147039865296.4007.7482355227065137884.stgit@jupiter.in.ibm.com> To: Mahesh Salgaonkar , linuxppc-dev , Benjamin Herrenschmidt , Paul Mackerras From: Michael Ellerman Cc: Stewart Smith , "Shreyas B. Prabhu" Subject: Re: [v3, 2/2] powernv: Fix MCE handler to avoid trashing CR0/CR1 registers. Message-Id: <3s7sRt1mFFz9t1Q@ozlabs.org> Date: Tue, 9 Aug 2016 21:26:34 +1000 (AEST) List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, 2016-05-08 at 12:04:13 UTC, Mahesh Salgaonkar wrote: > From: Mahesh Salgaonkar > > 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. > > Reported-by: Paul Mackerras > Signed-off-by: Mahesh Salgaonkar > Reviewed-by: Shreyas B. Prabhu Applied to powerpc fixes, thanks. https://git.kernel.org/powerpc/c/bc14c49195e49b3231c01e4c44 cheers