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] Fetching instructions after page-fault, near page bounda

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>
Subject: RE: [Xen-devel] Fetching instructions after page-fault, near page boundary?
From: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
Date: Fri, 2 Jun 2006 19:20:25 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 02 Jun 2006 10:21:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <86f716ee60dd9b82f46ad8946178778f@xxxxxxxxxxxx>
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: AcaGZ9K21drK8UFMRKmgPSH2VWs57QAABi/g
Thread-topic: [Xen-devel] Fetching instructions after page-fault, near page boundary?
 

> -----Original Message-----
> From: Keir Fraser [mailto:Keir.Fraser@xxxxxxxxxxxx] 
> Sent: 02 June 2006 18:13
> To: Petersson, Mats
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [Xen-devel] Fetching instructions after 
> page-fault, near page boundary?
> 
> 
> On 2 Jun 2006, at 18:07, Petersson, Mats wrote:
> 
> >> I wouldn't trust it. What if you have code running in paged memory 
> >> (e.g., random privileged userspace process)? Pages can disappear 
> >> under your feet. I think you need to remember how many bytes you 
> >> managed to read and do the job thoroughly.
> >> It's not that much extra code.
> >
> > But that means that we'd have to parse the instruction bytes in Xen 
> > (since we can't read them as trivially in QEMU) and figure out how 
> > many bytes the instruction is. Since both AMD and Intel 
> have problems 
> > with getting the correct number of bytes from the processor 
> during a 
> > page-fault intercept, it's no help that Intel SOMETIMES 
> have a correct 
> > number of bytes in a VMCS entry...
> 
> Read as many as you can, up to 15. Tell QEMU how many you 
> actually managed to read.

That was my original plan [telling how many I got, that is]. 
> 
> > How do we do it properly, if there's non-present page, 
> re-inject the 
> > page-fault, I guess?
> 
> Just try re-executing the instruction (i.e. directly return 
> to the guest). If the page has become unmapped then the 
> processor should handle the fault on instruction fetch.

Ok, that approach makes more sense than my silly ideas of counting
instruction bytes... And hopefully the code that removed our very much
needed page will eventually let us actually emulate the instruction at
some point, without too many re-executions... ;-)

--
Mats
> 
>   -- Keir
> 
> 
> 


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