x86/extable: Rework the exception table mechanics
[platform/kernel/linux-rpi.git] / arch / x86 / net / bpf_jit_comp.c
index 131f7ce..4f3a600 100644 (file)
@@ -832,9 +832,7 @@ static int emit_atomic(u8 **pprog, u8 atomic_op,
        return 0;
 }
 
-static bool ex_handler_bpf(const struct exception_table_entry *x,
-                          struct pt_regs *regs, int trapnr,
-                          unsigned long error_code, unsigned long fault_addr)
+bool ex_handler_bpf(const struct exception_table_entry *x, struct pt_regs *regs)
 {
        u32 reg = x->fixup >> 8;
 
@@ -1344,12 +1342,7 @@ st:                      if (is_imm8(insn->off))
                                }
                                ex->insn = delta;
 
-                               delta = (u8 *)ex_handler_bpf - (u8 *)&ex->handler;
-                               if (!is_simm32(delta)) {
-                                       pr_err("extable->handler doesn't fit into 32-bit\n");
-                                       return -EFAULT;
-                               }
-                               ex->handler = delta;
+                               ex->type = EX_TYPE_BPF;
 
                                if (dst_reg > BPF_REG_9) {
                                        pr_err("verifier error\n");