Joel Stanley | 3e323ab | 2015-09-11 14:48:21 +1000 | [diff] [blame^] | 1 | From a198d8086077cb97afdb24658ef549717e6bdec7 Mon Sep 17 00:00:00 2001 |
| 2 | From: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> |
| 3 | Date: Wed, 22 Jul 2015 11:09:15 +1000 |
| 4 | Subject: [PATCH 7/9] powerpc/kexec: Reset HILE before kexec_sequence |
| 5 | |
| 6 | On powernv secondary cpus are returned to OPAL, and will then enter |
| 7 | the target kernel in big-endian. However if it is set the HILE bit |
| 8 | will persist, causing the first exception in the target kernel to be |
| 9 | delivered in litte-endian regardless of the current endianess. |
| 10 | |
| 11 | If running on top of OPAL make sure the HILE bit is reset once we've |
| 12 | finished waiting for all of the secondaries to be returned to OPAL. |
| 13 | |
| 14 | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> |
| 15 | Signed-off-by: Joel Stanley <joel@jms.id.au> |
| 16 | --- |
| 17 | arch/powerpc/platforms/powernv/setup.c | 7 +++++++ |
| 18 | 1 file changed, 7 insertions(+) |
| 19 | |
| 20 | diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c |
| 21 | index 53737e0..59076db 100644 |
| 22 | --- a/arch/powerpc/platforms/powernv/setup.c |
| 23 | +++ b/arch/powerpc/platforms/powernv/setup.c |
| 24 | @@ -243,6 +243,13 @@ static void pnv_kexec_cpu_down(int crash_shutdown, int secondary) |
| 25 | } else { |
| 26 | /* Primary waits for the secondaries to have reached OPAL */ |
| 27 | pnv_kexec_wait_secondaries_down(); |
| 28 | + |
| 29 | + /* |
| 30 | + * We might be running as little-endian - now that interrupts |
| 31 | + * are disabled, reset the HILE bit to big-endian so we don't |
| 32 | + * take interrupts in the wrong endian later |
| 33 | + */ |
| 34 | + opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_BE); |
| 35 | } |
| 36 | } |
| 37 | #endif /* CONFIG_KEXEC */ |
| 38 | -- |
| 39 | 2.5.0 |
| 40 | |