[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210219210535.193010348@infradead.org>
Date: Fri, 19 Feb 2021 21:43:01 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: jpoimboe@...hat.com, x86@...nel.org, pjt@...gle.com,
mbenes@...e.cz, jgross@...e.com
Cc: linux-kernel@...r.kernel.org, peterz@...radead.org
Subject: [RFC][PATCH 1/6] objtool: Correctly handle retpoline thunk calls
Just like JMP handling, convert a direct CALL to a retpoline thunk
into a retpoline safe indirect CALL.
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
tools/objtool/check.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -953,6 +953,18 @@ static int add_call_destinations(struct
dest_off);
return -1;
}
+
+ } else if (!strncmp(reloc->sym->name, "__x86_indirect_thunk_", 21)) {
+ /*
+ * Retpoline calls are really dynamic calls in
+ * disguise, so convert them accodingly.
+ */
+ insn->type = INSN_CALL_DYNAMIC;
+ insn->retpoline_safe = true;
+
+ remove_insn_ops(insn);
+ continue;
+
} else
insn->call_dest = reloc->sym;
Powered by blists - more mailing lists