From: Ingo Molnar Date: Mon, 18 May 2020 10:00:36 +0000 (+0300) Subject: Merge tag 'v5.7-rc6' into objtool/core, to pick up fixes and resolve semantic conflict X-Git-Tag: v5.8-rc1~225^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c0577f4e609f7278ebd6d21e2de82b42f110944;p=thirdparty%2Flinux.git Merge tag 'v5.7-rc6' into objtool/core, to pick up fixes and resolve semantic conflict 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 --- 7c0577f4e609f7278ebd6d21e2de82b42f110944 diff --cc arch/x86/kernel/ftrace.c index 867c126ddabe3,b0e641793be4f..c84d28e90a584 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c @@@ -423,6 -416,32 +424,32 @@@ fail return 0; } + 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_epilogue; ++ 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; diff --cc tools/objtool/check.c index 6b2b458a5b0ea,3c6da70e60841..e36a818a2fed1 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@@ -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 */