blob: 78d6a8b6bbff25a909f2afc4deb2f885caef52bf [file] [log] [blame]
Joel Stanley3e6c3132015-11-19 23:50:22 +10301From a0fa3be3772983f7b96cc4133542a0eac25f6ed9 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 Stanley3e6c3132015-11-19 23:50:22 +10304Subject: [PATCH 03/15] powerpc/kexec: Reset secondary cpu endianess before
Joel Stanleye4aa6fb2015-09-29 13:31:58 +09305 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
Joel Stanley3e6c3132015-11-19 23:50:22 +103022index 4e314b90c75d..6e4168cf4698 100644
Joel Stanley3e323ab2015-09-11 14:48:21 +100023--- 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--
Joel Stanley3e6c3132015-11-19 23:50:22 +1030472.6.2
Joel Stanley3e323ab2015-09-11 14:48:21 +100048