Lines Matching refs:esr

39 #include <asm/esr.h>
239 unsigned long esr = tsk->thread.fault_code;
249 if (esr)
250 pr_cont("%s, ESR 0x%016lx, ", esr_get_class_string(esr), esr);
452 void do_el0_undef(struct pt_regs *regs, unsigned long esr)
473 void do_el1_undef(struct pt_regs *regs, unsigned long esr)
484 die("Oops - Undefined instruction", regs, esr);
492 void do_el1_bti(struct pt_regs *regs, unsigned long esr)
498 die("Oops - BTI", regs, esr);
501 void do_el0_gcs(struct pt_regs *regs, unsigned long esr)
506 void do_el1_gcs(struct pt_regs *regs, unsigned long esr)
508 die("Oops - GCS", regs, esr);
511 void do_el0_fpac(struct pt_regs *regs, unsigned long esr)
513 force_signal_inject(SIGILL, ILL_ILLOPN, regs->pc, esr);
516 void do_el1_fpac(struct pt_regs *regs, unsigned long esr)
522 die("Oops - FPAC", regs, esr);
525 void do_el0_mops(struct pt_regs *regs, unsigned long esr)
527 arm64_mops_reset_regs(&regs->user_regs, esr);
536 void do_el1_mops(struct pt_regs *regs, unsigned long esr)
538 arm64_mops_reset_regs(&regs->user_regs, esr);
558 static void user_cache_maint_handler(unsigned long esr, struct pt_regs *regs)
561 int rt = ESR_ELx_SYS64_ISS_RT(esr);
562 int crm = (esr & ESR_ELx_SYS64_ISS_CRM_MASK) >> ESR_ELx_SYS64_ISS_CRM_SHIFT;
598 static void ctr_read_handler(unsigned long esr, struct pt_regs *regs)
600 int rt = ESR_ELx_SYS64_ISS_RT(esr);
617 static void cntvct_read_handler(unsigned long esr, struct pt_regs *regs)
622 int rt = ESR_ELx_SYS64_ISS_RT(esr);
629 static void cntfrq_read_handler(unsigned long esr, struct pt_regs *regs)
634 int rt = ESR_ELx_SYS64_ISS_RT(esr);
641 static void mrs_handler(unsigned long esr, struct pt_regs *regs)
645 rt = ESR_ELx_SYS64_ISS_RT(esr);
646 sysreg = esr_sys64_to_sysreg(esr);
652 static void wfi_handler(unsigned long esr, struct pt_regs *regs)
660 void (*handler)(unsigned long esr, struct pt_regs *regs);
709 static bool cp15_cond_valid(unsigned long esr, struct pt_regs *regs)
714 if (!(esr & ESR_ELx_CV)) {
723 cond = (esr & ESR_ELx_COND_MASK) >> ESR_ELx_COND_SHIFT;
729 static void compat_cntfrq_read_handler(unsigned long esr, struct pt_regs *regs)
731 int reg = (esr & ESR_ELx_CP15_32_ISS_RT_MASK) >> ESR_ELx_CP15_32_ISS_RT_SHIFT;
746 static void compat_cntvct_read_handler(unsigned long esr, struct pt_regs *regs)
748 int rt = (esr & ESR_ELx_CP15_64_ISS_RT_MASK) >> ESR_ELx_CP15_64_ISS_RT_SHIFT;
749 int rt2 = (esr & ESR_ELx_CP15_64_ISS_RT2_MASK) >> ESR_ELx_CP15_64_ISS_RT2_SHIFT;
771 void do_el0_cp15(unsigned long esr, struct pt_regs *regs)
775 if (!cp15_cond_valid(esr, regs)) {
784 switch (ESR_ELx_EC(esr)) {
792 do_el0_undef(regs, esr);
797 if ((hook->esr_mask & esr) == hook->esr_val) {
798 hook->handler(esr, regs);
807 do_el0_undef(regs, esr);
811 void do_el0_sys(unsigned long esr, struct pt_regs *regs)
816 if ((hook->esr_mask & esr) == hook->esr_val) {
817 hook->handler(esr, regs);
826 do_el0_undef(regs, esr);
877 const char *esr_get_class_string(unsigned long esr)
879 return esr_class_str[ESR_ELx_EC(esr)];
886 void bad_el0_sync(struct pt_regs *regs, int reason, unsigned long esr)
891 current->thread.fault_code = esr;
900 void __noreturn panic_bad_stack(struct pt_regs *regs, unsigned long esr, unsigned long far)
909 pr_emerg("ESR: 0x%016lx -- %s\n", esr, esr_get_class_string(esr));
929 void __noreturn arm64_serror_panic(struct pt_regs *regs, unsigned long esr)
935 smp_processor_id(), esr, esr_get_class_string(esr));
944 bool arm64_is_fatal_ras_serror(struct pt_regs *regs, unsigned long esr)
946 unsigned long aet = arm64_ras_serror_get_severity(esr);
972 arm64_serror_panic(regs, esr);
976 void do_serror(struct pt_regs *regs, unsigned long esr)
979 if (!arm64_is_ras_serror(esr) || arm64_is_fatal_ras_serror(regs, esr))
980 arm64_serror_panic(regs, esr);
998 int bug_brk_handler(struct pt_regs *regs, unsigned long esr)
1002 die("Oops - BUG", regs, esr);
1019 int cfi_brk_handler(struct pt_regs *regs, unsigned long esr)
1024 target = pt_regs_read_reg(regs, FIELD_GET(CFI_BRK_IMM_TARGET, esr));
1025 type = (u32)pt_regs_read_reg(regs, FIELD_GET(CFI_BRK_IMM_TYPE, esr));
1029 die("Oops - CFI", regs, esr);
1044 int reserved_fault_brk_handler(struct pt_regs *regs, unsigned long esr)
1059 #define KASAN_ESR_SIZE(esr) (1 << ((esr) & KASAN_ESR_SIZE_MASK))
1061 int kasan_brk_handler(struct pt_regs *regs, unsigned long esr)
1063 bool recover = esr & KASAN_ESR_RECOVER;
1064 bool write = esr & KASAN_ESR_WRITE;
1065 size_t size = KASAN_ESR_SIZE(esr);
1086 die("Oops - KASAN", regs, esr);
1095 int ubsan_brk_handler(struct pt_regs *regs, unsigned long esr)
1097 die(report_ubsan_failure(esr & UBSAN_BRK_MASK), regs, esr);