diff options
-rw-r--r-- | arch/x86/kernel/alternative.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index bbfbf7ad17ca..a7e1ec50ad29 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -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; |