mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
x86/alternative: PAUSE is not a NOP
While chasing ghosts, I did notice that optimize_nops() was replacing
'REP NOP' aka 'PAUSE' with NOP2. This is clearly not right.
Fixes: 6c480f2221
("x86/alternative: Rewrite optimize_nops() some")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/linux-next/20230524130104.GR83892@hirez.programming.kicks-ass.net/
This commit is contained in:
committed by
Borislav Petkov (AMD)
parent
9350a629e8
commit
2bd4aa9325
@@ -169,9 +169,12 @@ void text_poke_early(void *addr, const void *opcode, size_t len);
|
||||
*/
|
||||
static bool insn_is_nop(struct insn *insn)
|
||||
{
|
||||
if (insn->opcode.bytes[0] == 0x90)
|
||||
/* Anything NOP, but no REP NOP */
|
||||
if (insn->opcode.bytes[0] == 0x90 &&
|
||||
(!insn->prefixes.nbytes || insn->prefixes.bytes[0] != 0xF3))
|
||||
return true;
|
||||
|
||||
/* NOPL */
|
||||
if (insn->opcode.bytes[0] == 0x0F && insn->opcode.bytes[1] == 0x1F)
|
||||
return true;
|
||||
|
||||
|
Reference in New Issue
Block a user