powerpc/kdump: Ignore failure in enabling big endian exception during crash

In LE kernel, we currently have a hack for kexec that resets the exception
endian before starting a new kernel as the kernel that is loaded could be a
big endian or a little endian kernel. In kdump case, resetting exception
endian fails when one or more cpus is disabled. But we can ignore the failure
and still go ahead, as in most cases crashkernel will be of same endianess
as primary kernel and reseting endianess is not even needed in those cases.
This patch adds a new inline function to say if this is kdump path. This
function is used at places where such a check is needed.

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
[mpe: Rename to kdump_in_progress(), use bool, and edit comment]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by Hari Bathini and committed by Michael Ellerman c1caae3d 1e5d0fdb

Changed files
+18 -2
arch
powerpc
include
asm
kernel
platforms
pseries
+10
arch/powerpc/include/asm/kexec.h
··· 86 extern void reserve_crashkernel(void); 87 extern void machine_kexec_mask_interrupts(void); 88 89 #else /* !CONFIG_KEXEC */ 90 static inline void crash_kexec_secondary(struct pt_regs *regs) { } 91 ··· 109 static inline int crash_shutdown_unregister(crash_shutdown_t handler) 110 { 111 return 0; 112 } 113 114 #endif /* CONFIG_KEXEC */
··· 86 extern void reserve_crashkernel(void); 87 extern void machine_kexec_mask_interrupts(void); 88 89 + static inline bool kdump_in_progress(void) 90 + { 91 + return crashing_cpu >= 0; 92 + } 93 + 94 #else /* !CONFIG_KEXEC */ 95 static inline void crash_kexec_secondary(struct pt_regs *regs) { } 96 ··· 104 static inline int crash_shutdown_unregister(crash_shutdown_t handler) 105 { 106 return 0; 107 + } 108 + 109 + static inline bool kdump_in_progress(void) 110 + { 111 + return false; 112 } 113 114 #endif /* CONFIG_KEXEC */
+1 -1
arch/powerpc/kernel/machine_kexec_64.c
··· 330 * using debugger IPI. 331 */ 332 333 - if (crashing_cpu == -1) 334 kexec_prepare_cpus(); 335 336 pr_debug("kexec: Starting switchover sequence.\n");
··· 330 * using debugger IPI. 331 */ 332 333 + if (!kdump_in_progress()) 334 kexec_prepare_cpus(); 335 336 pr_debug("kexec: Starting switchover sequence.\n");
+7 -1
arch/powerpc/platforms/pseries/lpar.c
··· 43 #include <asm/trace.h> 44 #include <asm/firmware.h> 45 #include <asm/plpar_wrappers.h> 46 #include <asm/fadump.h> 47 48 #include "pseries.h" ··· 268 * out to the user, but at least this will stop us from 269 * continuing on further and creating an even more 270 * difficult to debug situation. 271 */ 272 - if (rc) 273 panic("Could not enable big endian exceptions"); 274 } 275 #endif
··· 43 #include <asm/trace.h> 44 #include <asm/firmware.h> 45 #include <asm/plpar_wrappers.h> 46 + #include <asm/kexec.h> 47 #include <asm/fadump.h> 48 49 #include "pseries.h" ··· 267 * out to the user, but at least this will stop us from 268 * continuing on further and creating an even more 269 * difficult to debug situation. 270 + * 271 + * There is a known problem when kdump'ing, if cpus are offline 272 + * the above call will fail. Rather than panicking again, keep 273 + * going and hope the kdump kernel is also little endian, which 274 + * it usually is. 275 */ 276 + if (rc && !kdump_in_progress()) 277 panic("Could not enable big endian exceptions"); 278 } 279 #endif