[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <161728973737.29796.8108336872337258798.tip-bot2@tip-bot2>
Date: Thu, 01 Apr 2021 15:08:57 -0000
From: "tip-bot2 for Peter Zijlstra" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Peter Zijlstra (Intel)" <peterz@...radead.org>,
Borislav Petkov <bp@...e.de>, Miroslav Benes <mbenes@...e.cz>,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: x86/core] objtool: Fix static_call list generation
The following commit has been merged into the x86/core branch of tip:
Commit-ID: b62b63571e4be0ce31984ce83b04853f2cba678b
Gitweb: https://git.kernel.org/tip/b62b63571e4be0ce31984ce83b04853f2cba678b
Author: Peter Zijlstra <peterz@...radead.org>
AuthorDate: Fri, 26 Mar 2021 16:12:05 +01:00
Committer: Borislav Petkov <bp@...e.de>
CommitterDate: Thu, 01 Apr 2021 11:43:16 +02:00
objtool: Fix static_call list generation
Currently, objtool generates tail call entries in add_jump_destination()
but waits until validate_branch() to generate the regular call entries.
Move these to add_call_destination() for consistency.
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Signed-off-by: Borislav Petkov <bp@...e.de>
Reviewed-by: Miroslav Benes <mbenes@...e.cz>
Link: https://lkml.kernel.org/r/20210326151259.691529901@infradead.org
---
tools/objtool/check.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 6fbc001..8618d03 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -1045,6 +1045,11 @@ static int add_call_destinations(struct objtool_file *file)
} else
insn->call_dest = reloc->sym;
+ if (insn->call_dest && insn->call_dest->static_call_tramp) {
+ list_add_tail(&insn->static_call_node,
+ &file->static_call_list);
+ }
+
/*
* Many compilers cannot disable KCOV with a function attribute
* so they need a little help, NOP out any KCOV calls from noinstr
@@ -1788,6 +1793,9 @@ static int decode_sections(struct objtool_file *file)
if (ret)
return ret;
+ /*
+ * Must be before add_{jump_call}_destination.
+ */
ret = read_static_call_tramps(file);
if (ret)
return ret;
@@ -1800,6 +1808,10 @@ static int decode_sections(struct objtool_file *file)
if (ret)
return ret;
+ /*
+ * Must be before add_call_destination(); it changes INSN_CALL to
+ * INSN_JUMP.
+ */
ret = read_intra_function_calls(file);
if (ret)
return ret;
@@ -2762,11 +2774,6 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
if (dead_end_function(file, insn->call_dest))
return 0;
- if (insn->type == INSN_CALL && insn->call_dest->static_call_tramp) {
- list_add_tail(&insn->static_call_node,
- &file->static_call_list);
- }
-
break;
case INSN_JUMP_CONDITIONAL:
Powered by blists - more mailing lists