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] [PATCH] Calculate correct instruction length for data-fa

To: Khoa Huynh <khoa@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Calculate correct instruction length for data-fault VM exits on VT-x systems
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Fri, 28 Apr 2006 07:03:02 +0100
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 27 Apr 2006 23:07:08 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <OF6D39649D.9B84AE2D-ON8525715E.00058331-8625715E.000A4873@xxxxxxxxxx>
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: <OF6D39649D.9B84AE2D-ON8525715E.00058331-8625715E.000A4873@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

On 28 Apr 2006, at 02:52, Khoa Huynh wrote:

It should be noted that VMX only uses this instrlen
function when the hypervisor needs the instruction-length
info and that info is undefined in VMCS, e.g., for MMIO
instructions.  In other cases where the instruction-length
field is valid in VMCS, the hypervisor continues to get
that info from VMCS (via vmread operation).

I don't believe we need the instruction-length at all, and I suspect that the decoder could be removed from hvm/svm entirely. There are two broad categories of instruction I'm thinking of: 1. Instructions with their own VMEXIT reason code tend to be really simple so we know their length anyway and, if not, the instr-length field should be valid 2. For mmio instructions, the emulator can work out the length for itself and increment eip appropriately. There's no need to know the instruction length in advance of invoking the emulator.

I guess there may be one or two instructions, particularly on AMD, where we aren't feeding the instruction to the mmio emulator and the instruction isn't fixed length, so perhaps we'll need a small decoder in hvm/svm for those. But even if so, it could be much simpler than what is there right now.

 -- Keir


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