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/
Home Products Support Community News


Re: [Xen-devel] [PATCH] Add instruction fetching function to x86_emulate

To: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Add instruction fetching function to x86_emulate_ops.
From: Muli Ben-Yehuda <muli@xxxxxxxxxx>
Date: Fri, 26 May 2006 14:32:45 -0400
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 26 May 2006 11:33:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <907625E08839C4409CE5768403633E0BA7FCB3@xxxxxxxxxxxxxxxxx>
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>
References: <907625E08839C4409CE5768403633E0BA7FCB3@xxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.11
On Fri, May 26, 2006 at 08:23:45PM +0200, Petersson, Mats wrote:
> Attached patch introduces a separate function to fetch instruction
> bytes, comapared to the read_std. It has the same parameters as the
> read_std call, so there's actually no change to the behaviour in the
> existing code, but when we introduce x86_emulate.c into QEMU, we will
> benefit from knowing that it's instruction bytes being fetched, compared
> to regular byte(s)-from-memory fetching. 
> Signed off by: Mats Petersson <mats.petersson@xxxxxxx>


> +#define insn_fetch(_type, _size, _eip)                                    \
> +({ unsigned long _x;                                                      \
> +   rc = ops->fetch_insn_bytes((unsigned long)(_eip), &_x, (_size), ctxt); \
> +   if ( rc != 0 )                                                         \
> +       goto done;                                                         \
> +   (_eip) += (_size);                                                     \
> +   (_type)_x;

I realized you only changed the op call here, but using goto from
inside a macro is EVIL. Can this be done more sanely?


Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>