[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250821135947.GR4067720@noisy.programming.kicks-ass.net>
Date: Thu, 21 Aug 2025 15:59:47 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Marcos Del Sol Vives <marcos@...a.pet>
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, Brian Gerst <brgerst@...il.com>,
Uros Bizjak <ubizjak@...il.com>, Ard Biesheuvel <ardb@...nel.org>,
David Kaplan <david.kaplan@....com>,
"Ahmed S. Darwish" <darwi@...utronix.de>,
Kees Cook <kees@...nel.org>,
Andrew Cooper <andrew.cooper3@...rix.com>,
Oleg Nesterov <oleg@...hat.com>, "Xin Li (Intel)" <xin@...or.com>,
Sabyrzhan Tasbolatov <snovitoll@...il.com>
Subject: Re: [PATCH] x86: add hintable NOPs emulation
On Thu, Aug 21, 2025 at 03:45:29PM +0200, Marcos Del Sol Vives wrote:
> El 21/08/2025 a las 14:48, Peter Zijlstra escribió:
> > On Wed, Aug 20, 2025 at 03:34:46AM +0200, Marcos Del Sol Vives wrote:
> >> + /* Hintable NOPs cover 0F 18 to 0F 1F */
> >> + if (insn.opcode.bytes[0] != 0x0F ||
> >> + insn.opcode.bytes[1] < 0x18 || insn.opcode.bytes[1] > 0x1F)
> >> + return false;
> >
> > FWIW, you need to check for insn.opcode.nbytes == 2.
> >
>
> I can add it no problem for clarity, but would it be really necessary?
>
> All opcodes in that range will have that length by the Intel SDM, so it seems
> somewhat redundant, and if the opcode couldn't be read in full the decode
> would've failed earlier.
>
> insn_decode_mmio for example which I used as an example of software parsing
> of instructions does not check any length if the prefix was 0x0f.
Yeah, I suppose you're right.
Powered by blists - more mailing lists