1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0 21d18c47cSCatalin Marinas /* 31d18c47cSCatalin Marinas * Based on arch/arm/mm/extable.c 41d18c47cSCatalin Marinas */ 51d18c47cSCatalin Marinas 60edfa839SPaul Gortmaker #include <linux/extable.h> 71d18c47cSCatalin Marinas #include <linux/uaccess.h> 81d18c47cSCatalin Marinas 9e8c328d7SMark Rutland bool fixup_exception(struct pt_regs *regs) 101d18c47cSCatalin Marinas { 11*5d0e7905SMark Rutland const struct exception_table_entry *ex; 121d18c47cSCatalin Marinas 13*5d0e7905SMark Rutland ex = search_exception_tables(instruction_pointer(regs)); 14*5d0e7905SMark Rutland if (!ex) 15e8c328d7SMark Rutland return false; 161d18c47cSCatalin Marinas 170fdb64c2SWill Deacon if (in_bpf_jit(regs)) 18*5d0e7905SMark Rutland return arm64_bpf_fixup_exception(ex, regs); 1980083428SJean-Philippe Brucker 20*5d0e7905SMark Rutland regs->pc = (unsigned long)&ex->fixup + ex->fixup; 21e8c328d7SMark Rutland return true; 221d18c47cSCatalin Marinas } 23