FAILED: patch "[PATCH] powerpc/64s: relocation, register save fixes for system reset" failed to apply to 4.4-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
fb479e44a9e240a23c2d208c2ace23542a47f41cMon Sep 17 00:00:00 2001
From: Nicholas Piggin <[email protected]>
Date: Thu, 13 Oct 2016 13:17:14 +1100
Subject: [PATCH] powerpc/64s: relocation, register save fixes for system reset
interrupt
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.
arch/powerpc/include/asm/exception-64s.h +16 -0
@@ -93,6 +93,10 @@ld reg,PACAKBASE (r13 );/* get high part of &label */ \ ori reg,reg,(FIXED_SYMBOL_ABS_ADDR(label))@l; +#define __LOAD_HANDLER (reg, label) \ + ld reg,PACAKBASE(r13); \ + ori reg,reg,(ABS_ADDR(label))@l; +/* Exception register prefixes */ #define EXC_HV H#define EXC_STD
@@ -208,6 +212,18 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)#define kvmppc_interrupt kvmppc_interrupt_pr#endif +#ifdef CONFIG_RELOCATABLE +#define BRANCH_TO_COMMON (reg, label) \ + __LOAD_HANDLER(reg, label); \ + mtctr reg; \ + bctr + +#else +#define BRANCH_TO_COMMON (reg, label) \ + b label + +#endif +#define __KVM_HANDLER_PROLOG (area, n) \ BEGIN_FTR_SECTION_NESTED(947) \ ld r10,area+EX_CFAR(r13); \
arch/powerpc/kernel/exceptions-64s.S +29 -21
72 lines not on this page · raw message