]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
powerpc/oops: Print the kernel's endian in the oops
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 23 Aug 2017 13:56:21 +0000 (23:56 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 28 Aug 2017 12:09:58 +0000 (22:09 +1000)
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>
arch/powerpc/kernel/traps.c

index 82d0ce236f9dbd862079ce5d1d68c5aaa78d8a67..5a54a6f54f7009ac0a7303c84194de24046ef984 100644 (file)
@@ -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