Skip to contentSkip to conversation

Fix x86_emulate instruction check

PATCH New Samuel Thibault 1 participant 1 message Feb 26, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix x86_emulate instruction check

FPU instruction check should be against modrm, not modrm_reg, which only contains a small part of it (and not the needed part...)

xen/arch/x86/x86_emulate.c +2 -2
diff -r 50bc54fc91dd xen/arch/x86/x86_emulate.c
@@ -2671,7 +2671,7 @@ x86_emulate(
         fail_if(ops->load_fpu_ctxt == NULL);
         ops->load_fpu_ctxt(ctxt);
         fail_if((modrm_reg & 7) != 7);
-        fail_if(modrm_reg >= 0xc0);
+        fail_if(modrm >= 0xc0);
         /* fnstcw m2byte */
         ea.bytes = 2;
         dst = ea;
@@ -2690,7 +2690,7 @@ x86_emulate(
         fail_if(ops->load_fpu_ctxt == NULL);
         ops->load_fpu_ctxt(ctxt);
         fail_if((modrm_reg & 7) != 7);
-        fail_if(modrm_reg >= 0xc0);
+        fail_if(modrm >= 0xc0);
         /* fnstsw m2byte */
         ea.bytes = 2;
         dst = ea;