xref: /linux/arch/arm64/mm/extable.c (revision e8c328d7de03bf4d7a18e38ff87a7c12fdf8afb1)
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 
9*e8c328d7SMark Rutland bool fixup_exception(struct pt_regs *regs)
101d18c47cSCatalin Marinas {
111d18c47cSCatalin Marinas 	const struct exception_table_entry *fixup;
121d18c47cSCatalin Marinas 
131d18c47cSCatalin Marinas 	fixup = search_exception_tables(instruction_pointer(regs));
1480083428SJean-Philippe Brucker 	if (!fixup)
15*e8c328d7SMark Rutland 		return false;
161d18c47cSCatalin Marinas 
170fdb64c2SWill Deacon 	if (in_bpf_jit(regs))
1880083428SJean-Philippe Brucker 		return arm64_bpf_fixup_exception(fixup, regs);
1980083428SJean-Philippe Brucker 
2080083428SJean-Philippe Brucker 	regs->pc = (unsigned long)&fixup->fixup + fixup->fixup;
21*e8c328d7SMark Rutland 	return true;
221d18c47cSCatalin Marinas }
23