blob: 038130595f026ddda0d7427388ee6fc2a477e5d7 [file] [log] [blame]
Joel Stanley3e323ab2015-09-11 14:48:21 +10001From 301de197bdeefada57511b991f67a584e3ab2c43 Mon Sep 17 00:00:00 2001
2From: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
3Date: Mon, 29 Jun 2015 13:43:51 +1000
4Subject: [PATCH 6/9] powerpc/kexec: Reset secondary cpu endianess before kexec
5
6If the target kernel does not inlcude the FIXUP_ENDIAN check, coming
7from a different-endian kernel will cause the target kernel to panic.
8All ppc64 kernels can handle starting in big-endian mode, so return to
9big-endian before branching into the target kernel.
10
11This mainly affects pseries as secondaries on powernv are returned to
12OPAL.
13
14Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
15Signed-off-by: Joel Stanley <joel@jms.id.au>
16---
17 arch/powerpc/kernel/misc_64.S | 13 +++++++++++--
18 1 file changed, 11 insertions(+), 2 deletions(-)
19
20diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
21index 4e314b9..6e4168c 100644
22--- a/arch/powerpc/kernel/misc_64.S
23+++ b/arch/powerpc/kernel/misc_64.S
24@@ -475,9 +475,18 @@ _GLOBAL(kexec_wait)
25 #ifdef CONFIG_KEXEC /* use no memory without kexec */
26 lwz r4,0(r5)
27 cmpwi 0,r4,0
28- bnea 0x60
29+ beq 99b
30+#ifdef CONFIG_PPC_BOOK3S_64
31+ li r10,0x60
32+ mfmsr r11
33+ clrrdi r11,r11,1 /* Clear MSR_LE */
34+ mtsrr0 r10
35+ mtsrr1 r11
36+ rfid
37+#else
38+ ba 0x60
39+#endif
40 #endif
41- b 99b
42
43 /* this can be in text because we won't change it until we are
44 * running in real anyways
45--
462.5.0
47