From: Keir Fraser Date: Thu, 11 Oct 2007 18:18:12 +0000 (+0100) Subject: x86: Fix emulation of DIV instruction. Never actually used currently, X-Git-Tag: 3.1.2-rc1~15 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1dcf44dd9377b2057403fbb418c34311fb00a0e5;p=people%2Fvhanquez%2Fxen.git x86: Fix emulation of DIV instruction. Never actually used currently, but this will avoid a #DE in Xen. Signed-off-by: Keir Fraser xen-unstable changeset: 16097:d5531095d06b5e4513e891b89fd3085311490304 xen-unstable date: Thu Oct 11 19:18:12 2007 +0100 --- diff --git a/xen/arch/x86/x86_emulate.c b/xen/arch/x86/x86_emulate.c index 213da19f5..d6f1dbf8a 100644 --- a/xen/arch/x86/x86_emulate.c +++ b/xen/arch/x86/x86_emulate.c @@ -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])