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