Merge tag 'v5.7-rc6' into objtool/core, to pick up fixes and resolve semantic conflict
authorIngo Molnar <mingo@kernel.org>
Mon, 18 May 2020 10:00:36 +0000 (13:00 +0300)
committerIngo Molnar <mingo@kernel.org>
Mon, 18 May 2020 10:09:37 +0000 (13:09 +0300)
Resolve structural conflict between:

  59566b0b622e: ("x86/ftrace: Have ftrace trampolines turn read-only at the end of system boot up")

which introduced a new reference to 'ftrace_epilogue', and:

  0298739b7983: ("x86,ftrace: Fix ftrace_regs_caller() unwind")

Which renamed it to 'ftrace_caller_end'. Rename the new usage site in the merge commit.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
1  2 
arch/x86/entry/entry_64.S
arch/x86/kernel/ftrace.c
tools/objtool/check.c
tools/objtool/elf.h

Simple merge
index 867c126ddabe39abb1c8eea0f318fcf3435c8f54,b0e641793be4fb280cec2e83d8c99ea7bd922ae3..c84d28e90a584b3ec07594041f3b981b1117187e
@@@ -423,6 -416,32 +424,32 @@@ fail
        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;
index 6b2b458a5b0eaaa6c77dcf19d9b6532c80f150d8,3c6da70e6084144505fd7016b3568d2d951f615d..e36a818a2fed18bd3c4e17b76070eff3c5c416dc
@@@ -1607,13 -1455,12 +1618,13 @@@ static bool has_valid_stack_frame(struc
        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 */
Simple merge