summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2017-08-23 23:56:21 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2017-08-28 22:09:58 +1000
commit2e82ca3c3978d441ab272a7a964d03c6d2ee2bf3 (patch)
treed48181634297d784d34720235fdaa9157170a58e /arch
parent72c0d9ee4abc44c82a00eadebe08a740645ad8a0 (diff)
downloadlinux-2e82ca3c3978d441ab272a7a964d03c6d2ee2bf3.tar.bz2
powerpc/oops: Print the kernel's endian in the oops
Although the MSR tells you what endian you're in it's possible that isn't the same endian the kernel was built for, and if that happens you're usually having a very bad day. So print a marker to make it 100% clear which endian the kernel was built for. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/traps.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 82d0ce236f9d..5a54a6f54f70 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -202,6 +202,12 @@ NOKPROBE_SYMBOL(oops_end);
static int __die(const char *str, struct pt_regs *regs, long err)
{
printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
+
+ if (IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN))
+ printk("LE ");
+ else
+ printk("BE ");
+
#ifdef CONFIG_PREEMPT
pr_cont("PREEMPT ");
#endif