Older GDB decodes F3 0F 1E FA ENDBR64
as repz nop edx
.
Single-stepping it on a Core 2 (Merom) in 64-bit mode produces no change in architectural state, and no faults / exceptions. (Tested in GDB 7.10 on an old Ubuntu 15.10 install).
According to https://gist.github.com/Quasilyte/b60c94b9cb608d5b1a359d54f1be8aca,
0f 1e /r
is a 2-byte opcode that takes a ModRM, NOP r/m32, r32
, the same as the standard multi-byte 0f 1f
NOP that Intel documents.
It says it was added with Pentium Pro, so any PII / PIII or later would be fine.
https://github.com/NationalSecurityAgency/ghidra/issues/197#issuecomment-472906147 says AMD documents these extra NOP opcodes; Intel lists them as "reserved".
rep
prefixes are usually silently ignored for opcodes they don't apply to. This gives Intel/AMD the flexibility to use REP as part of the mandatory prefixes for future instructions to create encodings that won't fault on old CPUs.
CPUs older than PPro, e.g. original Pentium, would probably fault on it. Just like for 0f 1f
long NOP.
BTW, your attempt at decoding it makes no sense. 0f
is the "escape" byte for 2-byte opcodes, so 1e push ds
is unrelated to how this will decode. That's how 1e
decodes by itself, without a 0f
escape byte. (Except in 64-bit mode where it's invalid.)
0F 1F
is listed asNOP /0 Ev
so that does have modrm. But0F 1E
is justNOP
. – Nainsook