Skip to contentSkip to conversation

x86/extable: Adjust UD1 encoding in stub_selftest()

PATCH In review Andrew Cooper 2 participants 2 messages Apr 9

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/extable: Adjust UD1 encoding in stub_selftest()

The 0x90 is a ModRM byte and technically needs following by an imm32.

Switch to 0xc0 which encodes two %eax operands, and is a complete instruction.

No practical change.

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Teddy Astie <[email protected]>

---
 xen/arch/x86/extable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/extable.c +1 -1
index a9b6c6b904f5..e1c8c9fab811 100644
@@ -157,7 +157,7 @@ int __init cf_check stub_selftest(void)
         union stub_exception_token res;
     } tests[] __initconst = {
 #define endbr64 0xf3, 0x0f, 0x1e, 0xfa
-        { .opc = { endbr64, 0x0f, 0xb9, 0x90 }, /* ud1 */
+        { .opc = { endbr64, 0x0f, 0xb9, 0xc0 }, /* ud1 %eax,%eax */
           .res.fields.trapnr = X86_EXC_UD },
         { .opc = { endbr64, 0x90, 0x02, 0x00 }, /* nop; add (%rax),%al */
           .rax = 0x0123456789abcdef,
Signature · 1 line
2.39.5