<snip>
@@ -589,6 +591,110 @@ static void bug_handler(struct pt_regs *regs)
}
}
+asmlinkage void noinstr do_bce(struct pt_regs *regs)
+{
+ irqentry_state_t state = irqentry_enter(regs);
+ bool user = user_mode(regs);
+ unsigned long era = exception_era(regs);
+ union loongarch_instruction insn;
+ u64 badv = 0, lower = 0, upper = ULONG_MAX;
+
+ if (regs->csr_prmd & CSR_PRMD_PIE)
+ local_irq_enable();
+
+ current->thread.trap_nr = read_csr_excode();
+
+ /*
+ * notify the kprobe handlers, if instruction is likely to
+ * pertain to them.
+ */
+ if (notify_die(DIE_BOUNDS_CHECK, "Bounds check error", regs, 0,
+ current->thread.trap_nr, SIGSEGV) == NOTIFY_STOP)
+ goto out;
+
+ __show_regs(regs);