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>
This commit is contained in:
Michael Ellerman 2017-08-23 23:56:21 +10:00
parent 72c0d9ee4a
commit 2e82ca3c39
1 changed files with 6 additions and 0 deletions

View File

@ -202,6 +202,12 @@ NOKPROBE_SYMBOL(oops_end);
static int __die(const char *str, struct pt_regs *regs, long err) static int __die(const char *str, struct pt_regs *regs, long err)
{ {
printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); 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 #ifdef CONFIG_PREEMPT
pr_cont("PREEMPT "); pr_cont("PREEMPT ");
#endif #endif