Subject: Re: powerpc/64s: relocation, register save fixes for system reset interrupt

From: Michael Ellerman <[email-masked]>
Date: Thu, 27 Oct 2016 22:38:54 +1100 (AEDT)

On Thu, 2016-13-10 at 02:17:14 UTC, Nicholas Piggin wrote:
> This patch does a couple of things. First of all, powernv immediately
> explodes when running a relocated kernel, because the system reset
> exception for handling sleeps does not do correct relocated branches.
> 
> Secondly, the sleep handling code trashes the condition and cfar
> registers, which we would like to preserve for debugging purposes (for
> non-sleep case exception).
> 
> This patch changes the exception to use the standard format that saves
> registers before any tests or branches are made. It adds the test for
> idle-wakeup as an "extra" to break out of the normal exception path.
> Then it branches to a relocated idle handler that calls the various
> idle handling functions.
> 
> After this patch, POWER8 CPU simulator now boots powernv kernel that is
> running at non-zero.
> 
> Cc: Balbir Singh <[email-masked]>
> Cc: Shreyas B. Prabhu <[email-masked]>
> Cc: Gautham R. Shenoy <[email-masked]>
> Signed-off-by: Nicholas Piggin <[email-masked]>
> Acked-by: Gautham R. Shenoy <[email-masked]>
> Acked-by: Balbir Singh <[email-masked]>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/fb479e44a9e240a23c2d208c2ace23

cheers