From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: [PATCH] Fix x86_emulate instruction check Date: Tue, 26 Feb 2008 11:32:52 +0000 Message-ID: <20080226113252.GA5886@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org FPU instruction check should be against modrm, not modrm_reg, which only contains a small part of it (and not the needed part...) Signed-off-by: Samuel Thibault diff -r 50bc54fc91dd xen/arch/x86/x86_emulate.c --- a/xen/arch/x86/x86_emulate.c Mon Feb 25 12:08:05 2008 +0000 +++ b/xen/arch/x86/x86_emulate.c Tue Feb 26 11:30:27 2008 +0000 @@ -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;