]> xenbits.xensource.com Git - xen.git/commitdiff
x86: Fix emulation of DIV instruction. Never actually used currently,
authorKeir Fraser <keir@xensource.com>
Thu, 11 Oct 2007 18:18:12 +0000 (19:18 +0100)
committerKeir Fraser <keir@xensource.com>
Thu, 11 Oct 2007 18:18:12 +0000 (19:18 +0100)
but this will avoid a #DE in Xen.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/x86_emulate.c

index 321187acf21de4fae2298b81045621267e58e5dc..3a319ce1dd87e362dd817ccc0f97b021aadd2df7 100644 (file)
@@ -586,7 +586,7 @@ static int imul_dbl(unsigned long m[2])
  */
 static int div_dbl(unsigned long u[2], unsigned long v)
 {
-    if ( (v == 0) || (u[1] > v) || ((u[1] == v) && (u[0] != 0)) )
+    if ( (v == 0) || (u[1] >= v) )
         return 1;
     asm ( "div %4"
           : "=a" (u[0]), "=d" (u[1])