Skip to contentSkip to conversation

x86 emulation: suppress rep prefix handling on non-repeatable instructions

PATCH New Jan Beulich 1 participant 1 message Feb 15, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86 emulation: suppress rep prefix handling on non-repeatable instructions

Otherwise, pause or the recommended one-byte ret workaround on AMD processors may have ill side effects.

xen/arch/x86/x86_emulate.c +3 -1
Index: 2007-02-07/xen/arch/x86/x86_emulate.c
===================================================================
@@ -1579,7 +1579,9 @@ x86_emulate(
     if ( twobyte )
         goto twobyte_special_insn;
 
-    if ( rep_prefix )
+    if ( rep_prefix &&
+         (((b & ~0xf) == 0xa0 && ((0xfcf0 >> (b & 0xf)) & 1)) ||
+          (b & ~3) == 0x6c) )
     {
         if ( _regs.ecx == 0 )
         {