return 0;
  }
  
 -                      end_offset = (unsigned long)ftrace_epilogue;
+ void set_ftrace_ops_ro(void)
+ {
+       struct ftrace_ops *ops;
+       unsigned long start_offset;
+       unsigned long end_offset;
+       unsigned long npages;
+       unsigned long size;
+ 
+       do_for_each_ftrace_op(ops, ftrace_ops_list) {
+               if (!(ops->flags & FTRACE_OPS_FL_ALLOC_TRAMP))
+                       continue;
+ 
+               if (ops->flags & FTRACE_OPS_FL_SAVE_REGS) {
+                       start_offset = (unsigned long)ftrace_regs_caller;
+                       end_offset = (unsigned long)ftrace_regs_caller_end;
+               } else {
+                       start_offset = (unsigned long)ftrace_caller;
++                      end_offset = (unsigned long)ftrace_caller_end;
+               }
+               size = end_offset - start_offset;
+               size = size + RET_SIZE + sizeof(void *);
+               npages = DIV_ROUND_UP(size, PAGE_SIZE);
+               set_memory_ro((unsigned long)ops->trampoline, npages);
+       } while_for_each_ftrace_op(ops);
+ }
+ 
  static unsigned long calc_trampoline_call_offset(bool save_regs)
  {
        unsigned long start_offset;
 
        return false;
  }
  
 -static int update_insn_state_regs(struct instruction *insn, struct insn_state *state)
 +static int update_cfi_state_regs(struct instruction *insn,
 +                                struct cfi_state *cfi,
 +                                struct stack_op *op)
  {
 -      struct cfi_reg *cfa = &state->cfa;
 -      struct stack_op *op = &insn->stack_op;
 +      struct cfi_reg *cfa = &cfi->cfa;
  
-       if (cfa->base != CFI_SP)
+       if (cfa->base != CFI_SP && cfa->base != CFI_SP_INDIRECT)
                return 0;
  
        /* push */