blob: 3fc25ca1c9f00ce31c1cd3306c24b3286455ff2c [file] [log] [blame]
Joel Stanley3e323ab2015-09-11 14:48:21 +10001From a198d8086077cb97afdb24658ef549717e6bdec7 Mon Sep 17 00:00:00 2001
2From: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
3Date: Wed, 22 Jul 2015 11:09:15 +1000
4Subject: [PATCH 7/9] powerpc/kexec: Reset HILE before kexec_sequence
5
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