Joel Stanley | e4aa6fb | 2015-09-29 13:31:58 +0930 | [diff] [blame^] | 1 | From 2d2ab23cbdbbb1907f1f34085c3904efe1979df0 Mon Sep 17 00:00:00 2001 |
Joel Stanley | 3e323ab | 2015-09-11 14:48:21 +1000 | [diff] [blame] | 2 | From: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> |
| 3 | Date: Mon, 29 Jun 2015 13:43:51 +1000 |
Joel Stanley | e4aa6fb | 2015-09-29 13:31:58 +0930 | [diff] [blame^] | 4 | Subject: [PATCH 06/18] powerpc/kexec: Reset secondary cpu endianess before |
| 5 | kexec |
Joel Stanley | 3e323ab | 2015-09-11 14:48:21 +1000 | [diff] [blame] | 6 | |
| 7 | If the target kernel does not inlcude the FIXUP_ENDIAN check, coming |
| 8 | from a different-endian kernel will cause the target kernel to panic. |
| 9 | All ppc64 kernels can handle starting in big-endian mode, so return to |
| 10 | big-endian before branching into the target kernel. |
| 11 | |
| 12 | This mainly affects pseries as secondaries on powernv are returned to |
| 13 | OPAL. |
| 14 | |
| 15 | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> |
| 16 | Signed-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 | |
| 21 | diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S |
| 22 | index 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 | -- |
| 47 | 2.5.0 |
| 48 | |