From e8688e2ff2eb57a01791fb66f320c260042fc653 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 11 Oct 2007 19:18:12 +0100 Subject: [PATCH] x86: Fix emulation of DIV instruction. Never actually used currently, but this will avoid a #DE in Xen. Signed-off-by: Keir Fraser --- xen/arch/x86/x86_emulate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]) -- 2.39.5