WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] x86_emulate(): forgot to generate_exception_if() for 0xf

To: "Liu, Eric E" <eric.e.liu@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] x86_emulate(): forgot to generate_exception_if() for 0xff?
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Wed, 19 Dec 2007 10:51:28 +0000
Delivery-date: Wed, 19 Dec 2007 02:52:22 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <9D7649D18729DE4BB2BD7B494F7FEDC2C14112@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AchCIkspvq503+fcSaGc/QzK2IvTbAACtAyH
Thread-topic: [Xen-devel] x86_emulate(): forgot to generate_exception_if() for 0xff?
User-agent: Microsoft-Entourage/11.3.6.070618
Why do you think that? Grp4 only defines valid opcodes for reg==000b and
001b. Grp5 defines valid opcodes for all except reg=111b. So the current
code seems correct.

 -- Keir

On 19/12/07 09:34, "Liu, Eric E" <eric.e.liu@xxxxxxxxx> wrote:

> Hi all,
> In arch/x86/x86_emulate.c: x86_emulate():
>    1716     case 0xfe: /* Grp4 */
>    1717         generate_exception_if((m odrm_reg & 7) >= 2, EXC_UD);
>    1718     case 0xff: /* Grp5 */
>    1719         switch ( modrm_reg & 7 )
>    1720         {
>    1721         case 0: /* inc */
>    1722             emulate_1op("inc", dst, _regs.eflags);
>    1723             break;
>    1724         case 1: /* dec */
>    1725             emulate_1op("dec", dst, _regs.eflags);
>    1726             break;
> 
> Here we only check 0xfe for "reg >= 2"? I think we should also check
> 0xff -- we should swap line 1717 and 1718?
> 
> Thanks!
> --Eric (Liu, Feng)
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel