[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250924114545.GI1386988@noisy.programming.kicks-ass.net>
Date: Wed, 24 Sep 2025 13:45:45 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Alexandre Chartre <alexandre.chartre@...cle.com>
Cc: linux-kernel@...r.kernel.org, mingo@...nel.org, jpoimboe@...nel.org
Subject: Re: [RFC PATCH v2 00/17] objtool: Function validation tracing
On Wed, Sep 24, 2025 at 12:58:13PM +0200, Peter Zijlstra wrote:
> On Wed, Sep 24, 2025 at 12:52:35PM +0200, Alexandre Chartre wrote:
> >
> > On 9/24/25 12:10, Peter Zijlstra wrote:
> > > On Wed, Sep 24, 2025 at 12:08:47PM +0200, Peter Zijlstra wrote:
> > > > On Wed, Sep 24, 2025 at 09:42:06AM +0200, Peter Zijlstra wrote:
> > > >
> > > > > > > d051: perf_get_x86_pmu_capability+0x51 | xchg %ax,%ax
> > > >
> > > > That libopcode is 'funny', isn't that typically spelled "nop" ?
> > >
> > > Ooh, I see, it is "osp nop" and yeah binutils also seems to do that as
> > > "xchg %ax,%ax".
> >
> > Yes, "xchg %ax,%ax" is NOP2 (opcodes: 0x66 0x90), "nop" is NOP1 (0x90).
> >
> > That's one more improvement we can do: identify NOP instructions and
> > display them as NOP<n>
>
> Right, I have just the function for that. Let me do a patch for you.
Bah, I'm having trouble with the makefiles, but we sorta already detect
nops, and the below should sorta work. I'll improve decode.c a bit.
--- a/tools/objtool/disas.c
+++ b/tools/objtool/disas.c
@@ -273,6 +273,9 @@ static size_t disas_insn(struct disas_co
dctx->insn = insn;
dctx->result[0] = '\0';
+ if (insn->type == INSN_NOP)
+ return snprintf(dctx->result, DISAS_RESULT_SIZE, "NOP%d", insn->len);
+
/*
* Set the disassembler buffer to read data from the section
* containing the instruction to disassemble.
Powered by blists - more mailing lists