xref: /openbmc/linux/arch/arm64/mm/extable.c (revision 4bb1eb3c)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Based on arch/arm/mm/extable.c
4  */
5 
6 #include <linux/extable.h>
7 #include <linux/uaccess.h>
8 
9 int fixup_exception(struct pt_regs *regs)
10 {
11 	const struct exception_table_entry *fixup;
12 
13 	fixup = search_exception_tables(instruction_pointer(regs));
14 	if (!fixup)
15 		return 0;
16 
17 	if (IS_ENABLED(CONFIG_BPF_JIT) &&
18 	    regs->pc >= BPF_JIT_REGION_START &&
19 	    regs->pc < BPF_JIT_REGION_END)
20 		return arm64_bpf_fixup_exception(fixup, regs);
21 
22 	regs->pc = (unsigned long)&fixup->fixup + fixup->fixup;
23 	return 1;
24 }
25