]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
objtool: Treat .text.__x86.* as noinstr
authorPeter Zijlstra <peterz@infradead.org>
Tue, 14 Jun 2022 21:15:47 +0000 (23:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Jul 2022 09:26:39 +0000 (11:26 +0200)
commit 951ddecf435659553ed15a9214e153a3af43a9a1 upstream.

Needed because zen_untrain_ret() will be called from noinstr code.

Also makes sense since the thunks MUST NOT contain instrumentation nor
be poked with dynamic instrumentation.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/objtool/check.c

index 95c2fd945a1b42bd9ded817cbbeca079cbb971a3..f3cc59714ed4a05a7a5f2df202b4a6a8bd6d441d 100644 (file)
@@ -366,7 +366,8 @@ static int decode_instructions(struct objtool_file *file)
                        sec->text = true;
 
                if (!strcmp(sec->name, ".noinstr.text") ||
-                   !strcmp(sec->name, ".entry.text"))
+                   !strcmp(sec->name, ".entry.text") ||
+                   !strncmp(sec->name, ".text.__x86.", 12))
                        sec->noinstr = true;
 
                for (offset = 0; offset < sec->len; offset += insn->len) {