summaryrefslogtreecommitdiff
path: root/purgatory/arch
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-08-21 12:51:16 +1000
committerSimon Horman <horms@verge.net.au>2015-09-04 18:46:15 +0900
commita304e2d82a8c3e4f66d0707118bc53704b5d9c59 (patch)
tree34756c31ed7358edecca3612adfc7b5682b843d2 /purgatory/arch
parent97a07e2775efb06c5c49f954ce6a0fe32bddb398 (diff)
ppc64: purgatory: Reset primary cpu endian to big-endian
Older big-endian ppc64 kernels don't include the FIXUP_ENDIAN check, meaning if we kexec from a little-endian kernel the target kernel will fail to boot. Returning to big-endian before we enter the target kernel ensures that the target kernel can boot whether or not it includes FIXUP_ENDIAN. This mirrors commit 150b14e7 in kexec-lite. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Acked-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'purgatory/arch')
-rw-r--r--purgatory/arch/ppc64/v2wrap.S12
1 files changed, 9 insertions, 3 deletions
diff --git a/purgatory/arch/ppc64/v2wrap.S b/purgatory/arch/ppc64/v2wrap.S
index dc5034f..179ade9 100644
--- a/purgatory/arch/ppc64/v2wrap.S
+++ b/purgatory/arch/ppc64/v2wrap.S
@@ -114,10 +114,16 @@ master:
LOADADDR(6,run_at_load) # the load flag
lwz 7,0(6) # possibly patched by kexec-elf-ppc64
stw 7,0x5c(4) # and patch it into the kernel
- li 5,0 # r5 will be 0 for kernel
- mtctr 4 # prepare branch too
mr 3,16 # restore dt address
+ mtsrr0 4 # prepare branch to
+
+ mfmsr 5
+ clrrdi 5,5,1 # clear MSR_LE
+ mtsrr1 5
+
+ li 5,0 # r5 will be 0 for kernel
+
# skip cache flush, do we care?
- bctr # start kernel
+ rfid # update MSR and start kernel