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 86 extern void reserve_crashkernel(void); 87 87 extern void machine_kexec_mask_interrupts(void); 88 88 89 + static inline bool kdump_in_progress(void) 90 + { 91 + return crashing_cpu >= 0; 92 + } 93 + 89 94 #else /* !CONFIG_KEXEC */ 90 95 static inline void crash_kexec_secondary(struct pt_regs *regs) { } 91 96 ··· 109 104 static inline int crash_shutdown_unregister(crash_shutdown_t handler) 110 105 { 111 106 return 0; 107 + } 108 + 109 + static inline bool kdump_in_progress(void) 110 + { 111 + return false; 112 112 } 113 113 114 114 #endif /* CONFIG_KEXEC */
+1 -1
arch/powerpc/kernel/machine_kexec_64.c
··· 330 330 * using debugger IPI. 331 331 */ 332 332 333 - if (crashing_cpu == -1) 333 + if (!kdump_in_progress()) 334 334 kexec_prepare_cpus(); 335 335 336 336 pr_debug("kexec: Starting switchover sequence.\n");
+7 -1
arch/powerpc/platforms/pseries/lpar.c
··· 43 43 #include <asm/trace.h> 44 44 #include <asm/firmware.h> 45 45 #include <asm/plpar_wrappers.h> 46 + #include <asm/kexec.h> 46 47 #include <asm/fadump.h> 47 48 48 49 #include "pseries.h" ··· 268 267 * out to the user, but at least this will stop us from 269 268 * continuing on further and creating an even more 270 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. 271 275 */ 272 - if (rc) 276 + if (rc && !kdump_in_progress()) 273 277 panic("Could not enable big endian exceptions"); 274 278 } 275 279 #endif