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] why xen use x86_emulation() in page_fault

To: cc Luit <universalbillow@xxxxxxxxx>
Subject: Re: [Xen-devel] why xen use x86_emulation() in page_fault
From: Tim Deegan <tim@xxxxxxx>
Date: Tue, 11 Oct 2011 09:18:29 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 11 Oct 2011 01:19:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CADWh-PE3tdCP5UshkwH0VX9J0aJaxBLfQdiN1u9WF+Q--x4ejA@xxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <CADWh-PE3tdCP5UshkwH0VX9J0aJaxBLfQdiN1u9WF+Q--x4ejA@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
At 09:39 +0800 on 11 Oct (1318325957), cc Luit wrote:
> Hi, everyone, I have a question,
> in the shadow_page_fault or ept mechanism, xen will use the x86_emulation
> for some instructions, I'm wondering why it must use it, if after we fix the
> SPT or EPT table, just VMEntry to HVM to re-excute this instruction  but not
> emulate in xen, is there some problems?

In the shadow pagetable code, we keep the shadows up-to-date by:
 1 - making all shadowed pagetables read-only;
 2 - intercepting the page faults when the guest writes to them; and
 3 - updating the guest pagetable and the shadow at the same time, 
     with whatever change the guest was making. 

For step 3 we need to emulate the instruction that caused the pagefault
so that we can tell what was being written. 

There are other reasons for the emulator to be called (emulating MMIO
instructions, emulating real-mode &c) but that's why the shadow
pagetable code uses it. 

Cheers,

Tim.

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