blob: 66f59b4191a9d65e945b761a593cc5e62b0e9fc3 [file] [log] [blame]
Joel Stanleye4aa6fb2015-09-29 13:31:58 +09301From b7d553c5fce6888aa29a19627b20d9f34d0aee57 Mon Sep 17 00:00:00 2001
Joel Stanley3e323ab2015-09-11 14:48:21 +10002From: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
3Date: Wed, 22 Jul 2015 11:09:15 +1000
Joel Stanleye4aa6fb2015-09-29 13:31:58 +09304Subject: [PATCH 07/18] powerpc/kexec: Reset HILE before kexec_sequence
Joel Stanley3e323ab2015-09-11 14:48:21 +10005
6On powernv secondary cpus are returned to OPAL, and will then enter
7the target kernel in big-endian. However if it is set the HILE bit
8will persist, causing the first exception in the target kernel to be
9delivered in litte-endian regardless of the current endianess.
10
11If running on top of OPAL make sure the HILE bit is reset once we've
12finished waiting for all of the secondaries to be returned to OPAL.
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/platforms/powernv/setup.c | 7 +++++++
18 1 file changed, 7 insertions(+)
19
20diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
21index 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--
392.5.0
40