[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240904022508.lcn36ouu5ka6eken@treble>
Date: Tue, 3 Sep 2024 19:25:08 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: live-patching@...r.kernel.org, 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>,
Marcos Paulo de Souza <mpdesouza@...e.com>,
Song Liu <song@...nel.org>
Subject: Re: [RFC 20/31] objtool: Add UD1 detection
On Tue, Sep 03, 2024 at 10:17:48AM +0200, Peter Zijlstra wrote:
> On Mon, Sep 02, 2024 at 09:00:03PM -0700, Josh Poimboeuf wrote:
> > 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 */
>
> We recently grew more UD1 usage...
>
> ---
> commit 7424fc6b86c8980a87169e005f5cd4438d18efe6
> Author: Gatlin Newhouse <gatlin.newhouse@...il.com>
> Date: Wed Jul 24 00:01:55 2024 +0000
Interesting, thanks. I'm having a senior moment as I can't remember why
this patch exists -- maybe it was code inspection? My patch desciption
is awful. I'll just drop it for now.
--
Josh
Powered by blists - more mailing lists