[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20e0e2662239a042a10196e8f240ce596b250ae8.1725334260.git.jpoimboe@kernel.org>
Date: Mon, 2 Sep 2024 21:00:03 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: live-patching@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
x86@...nel.org,
Miroslav Benes <mbenes@...e.cz>,
Petr Mladek <pmladek@...e.com>,
Joe Lawrence <joe.lawrence@...hat.com>,
Jiri Kosina <jikos@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Marcos Paulo de Souza <mpdesouza@...e.com>,
Song Liu <song@...nel.org>
Subject: [RFC 20/31] objtool: Add UD1 detection
A UD1 isn't a BUG and shouldn't be treated like one.
Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
---
tools/objtool/arch/x86/decode.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
index 6b34b058a821..72d55dcd3d7f 100644
--- a/tools/objtool/arch/x86/decode.c
+++ b/tools/objtool/arch/x86/decode.c
@@ -528,11 +528,19 @@ int arch_decode_instruction(struct objtool_file *file, const struct section *sec
/* sysenter, sysret */
insn->type = INSN_CONTEXT_SWITCH;
- } else if (op2 == 0x0b || op2 == 0xb9) {
+ } else if (op2 == 0x0b) {
/* ud2 */
insn->type = INSN_BUG;
+ } else if (op2 == 0xb9) {
+
+ /*
+ * ud1 - only used for the static call trampoline to
+ * stop speculation. Basically used like an int3.
+ */
+ insn->type = INSN_TRAP;
+
} else if (op2 == 0x0d || op2 == 0x1f) {
/* nopl/nopw */
--
2.45.2
Powered by blists - more mailing lists