#include <asm/processor.h>
 #include <asm/stacktrace.h>
 #include <asm/sysreg.h>
+#include <asm/system_misc.h>
 
 /*
  * This is intended to match the logic in irqentry_enter(), handling the kernel
 extern void (*handle_arch_irq)(struct pt_regs *);
 extern void (*handle_arch_fiq)(struct pt_regs *);
 
+/*
+ * bad_mode handles the impossible case in the exception vector. This is always
+ * fatal.
+ */
+asmlinkage void noinstr bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
+{
+       const char *handler[] = {
+               "Synchronous Abort",
+               "IRQ",
+               "FIQ",
+               "Error"
+       };
+
+       arm64_enter_nmi(regs);
+
+       console_verbose();
+
+       pr_crit("Bad mode in %s handler detected on CPU%d, code 0x%08x -- %s\n",
+               handler[reason], smp_processor_id(), esr,
+               esr_get_class_string(esr));
+
+       __show_regs(regs);
+       panic("bad mode");
+}
+
+
 #ifdef CONFIG_ARM64_ERRATUM_1463225
 static DEFINE_PER_CPU(int, __in_cortex_a76_erratum_1463225_wa);
 
 
 #include <asm/system_misc.h>
 #include <asm/sysreg.h>
 
-static const char *handler[] = {
-       "Synchronous Abort",
-       "IRQ",
-       "FIQ",
-       "Error"
-};
-
 int show_unhandled_signals = 0;
 
 static void dump_kernel_instr(const char *lvl, struct pt_regs *regs)
        return esr_class_str[ESR_ELx_EC(esr)];
 }
 
-/*
- * bad_mode handles the impossible case in the exception vector. This is always
- * fatal.
- */
-asmlinkage void notrace bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
-{
-       arm64_enter_nmi(regs);
-
-       console_verbose();
-
-       pr_crit("Bad mode in %s handler detected on CPU%d, code 0x%08x -- %s\n",
-               handler[reason], smp_processor_id(), esr,
-               esr_get_class_string(esr));
-
-       __show_regs(regs);
-       panic("bad mode");
-}
-
 /*
  * bad_el0_sync handles unexpected, but potentially recoverable synchronous
  * exceptions taken from EL0. Unlike bad_mode, this returns.