Lines Matching refs:esr

36 #include <asm/esr.h>
155 unsigned int esr = tsk->thread.fault_code;
165 if (esr)
166 pr_cont("%s, ESR 0x%08x, ", esr_get_class_string(esr), esr);
362 void do_el0_undef(struct pt_regs *regs, unsigned long esr)
383 void do_el1_undef(struct pt_regs *regs, unsigned long esr)
394 die("Oops - Undefined instruction", regs, esr);
402 void do_el1_bti(struct pt_regs *regs, unsigned long esr)
404 die("Oops - BTI", regs, esr);
407 void do_el0_fpac(struct pt_regs *regs, unsigned long esr)
409 force_signal_inject(SIGILL, ILL_ILLOPN, regs->pc, esr);
412 void do_el1_fpac(struct pt_regs *regs, unsigned long esr)
418 die("Oops - FPAC", regs, esr);
441 static void user_cache_maint_handler(unsigned int esr, struct pt_regs *regs)
444 int rt = ESR_ELx_SYS64_ISS_RT(esr);
445 int crm = (esr & ESR_ELx_SYS64_ISS_CRM_MASK) >> ESR_ELx_SYS64_ISS_CRM_SHIFT;
480 static void ctr_read_handler(unsigned int esr, struct pt_regs *regs)
482 int rt = ESR_ELx_SYS64_ISS_RT(esr);
499 static void cntvct_read_handler(unsigned int esr, struct pt_regs *regs)
501 int rt = ESR_ELx_SYS64_ISS_RT(esr);
507 static void cntfrq_read_handler(unsigned int esr, struct pt_regs *regs)
509 int rt = ESR_ELx_SYS64_ISS_RT(esr);
515 static void mrs_handler(unsigned int esr, struct pt_regs *regs)
519 rt = ESR_ELx_SYS64_ISS_RT(esr);
520 sysreg = esr_sys64_to_sysreg(esr);
526 static void wfi_handler(unsigned int esr, struct pt_regs *regs)
534 void (*handler)(unsigned int esr, struct pt_regs *regs);
577 static bool cp15_cond_valid(unsigned int esr, struct pt_regs *regs)
582 if (!(esr & ESR_ELx_CV)) {
591 cond = (esr & ESR_ELx_COND_MASK) >> ESR_ELx_COND_SHIFT;
597 static void compat_cntfrq_read_handler(unsigned int esr, struct pt_regs *regs)
599 int reg = (esr & ESR_ELx_CP15_32_ISS_RT_MASK) >> ESR_ELx_CP15_32_ISS_RT_SHIFT;
614 static void compat_cntvct_read_handler(unsigned int esr, struct pt_regs *regs)
616 int rt = (esr & ESR_ELx_CP15_64_ISS_RT_MASK) >> ESR_ELx_CP15_64_ISS_RT_SHIFT;
617 int rt2 = (esr & ESR_ELx_CP15_64_ISS_RT2_MASK) >> ESR_ELx_CP15_64_ISS_RT2_SHIFT;
634 void do_el0_cp15(unsigned long esr, struct pt_regs *regs)
638 if (!cp15_cond_valid(esr, regs)) {
647 switch (ESR_ELx_EC(esr)) {
655 do_el0_undef(regs, esr);
660 if ((hook->esr_mask & esr) == hook->esr_val) {
661 hook->handler(esr, regs);
670 do_el0_undef(regs, esr);
674 void do_el0_sys(unsigned long esr, struct pt_regs *regs)
679 if ((hook->esr_mask & esr) == hook->esr_val) {
680 hook->handler(esr, regs);
689 do_el0_undef(regs, esr);
737 const char *esr_get_class_string(u32 esr)
739 return esr_class_str[ESR_ELx_EC(esr)];
746 asmlinkage void notrace bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
753 handler[reason], smp_processor_id(), esr,
754 esr_get_class_string(esr));
765 void bad_el0_sync(struct pt_regs *regs, int reason, unsigned int esr)
770 current->thread.fault_code = esr;
786 unsigned int esr = read_sysreg(esr_el1);
794 pr_emerg("ESR: 0x%08x -- %s\n", esr, esr_get_class_string(esr));
815 void __noreturn arm64_serror_panic(struct pt_regs *regs, u32 esr)
820 smp_processor_id(), esr, esr_get_class_string(esr));
830 bool arm64_is_fatal_ras_serror(struct pt_regs *regs, unsigned int esr)
832 u32 aet = arm64_ras_serror_get_severity(esr);
858 arm64_serror_panic(regs, esr);
862 asmlinkage void noinstr do_serror(struct pt_regs *regs, unsigned int esr)
867 if (!arm64_is_ras_serror(esr) || arm64_is_fatal_ras_serror(regs, esr))
868 arm64_serror_panic(regs, esr);
887 static int bug_handler(struct pt_regs *regs, unsigned int esr)
891 die("Oops - BUG", regs, esr);
912 static int reserved_fault_handler(struct pt_regs *regs, unsigned int esr)
932 #define KASAN_ESR_SIZE(esr) (1 << ((esr) & KASAN_ESR_SIZE_MASK))
934 static int kasan_handler(struct pt_regs *regs, unsigned int esr)
936 bool recover = esr & KASAN_ESR_RECOVER;
937 bool write = esr & KASAN_ESR_WRITE;
938 size_t size = KASAN_ESR_SIZE(esr);
959 die("Oops - KASAN", regs, esr);
977 int __init early_brk64(unsigned long addr, unsigned int esr,
981 unsigned int comment = esr & ESR_ELx_BRK64_ISS_COMMENT_MASK;
984 return kasan_handler(regs, esr) != DBG_HOOK_HANDLED;
986 return bug_handler(regs, esr) != DBG_HOOK_HANDLED;