blob: 89e25f202fdc2189d102d2a68b9e2461c1fdfc8b [file] [log] [blame]
Joel Stanley3e6c3132015-11-19 23:50:22 +10301From 3ac7b2ce48a25617a838b58dce149244c5f216ef 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 Stanley3e6c3132015-11-19 23:50:22 +10304Subject: [PATCH 04/15] 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
Joel Stanley3e6c3132015-11-19 23:50:22 +103021index 53737e019ae3..59076db194c0 100644
Joel Stanley3e323ab2015-09-11 14:48:21 +100022--- 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--
Joel Stanley3e6c3132015-11-19 23:50:22 +1030392.6.2
Joel Stanley3e323ab2015-09-11 14:48:21 +100040