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.2.0-rc1~252 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e8688e2ff2eb57a01791fb66f320c260042fc653;p=xen.git x86: Fix emulation of DIV instruction. Never actually used currently, but this will avoid a #DE in Xen. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/x86_emulate.c b/xen/arch/x86/x86_emulate.c index 321187acf2..3a319ce1dd 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])