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: "Zhengwang Ruan (Royo)" <zhengwang.ruan@xxxxxxxxx>
Subject: Re: [Xen-devel] why xen use x86_emulation() in page_fault
From: cc Luit <universalbillow@xxxxxxxxx>
Date: Tue, 11 Oct 2011 21:46:04 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Tim Deegan <tim@xxxxxxx>
Delivery-date: Tue, 11 Oct 2011 06:46:45 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ljjxo3ltxruUZMX+ygZI+nH7SJpGLjEOvtxDnexferM=; b=eY/7Y5sya7G2ZoXSeiSJ6hpTlO1x2FCb5RyfTf8d9tjjA+/1/7qa7Z6vNcSLX2JCeD /wpTyYJTB/HaBpE34UxQtO00jIM8INNiKL3q6bmCYhqwNthAKsDLscsBUO2jUJ2l3yo3 QsQfSctc4ESkvIUpKcyW4bTZknq8kz8WWQmlY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E9430B5.70608@xxxxxxxxx>
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> <20111011081829.GB88076@xxxxxxxxxxxxxxxxxxxxx> <4E9430B5.70608@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx


On Tue, Oct 11, 2011 at 8:04 PM, Zhengwang Ruan (Royo) <zhengwang.ruan@xxxxxxxxx> wrote:
Hi Tim,

I am a freshman to this member-list and interested in some contents in your reply, looking forward to your answer. :)



At 2011-10-11 16:18, Tim Deegan wrote:
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.

1, Does this emulator set up a emulation environment to execute instructions for a VM(guest OS)?
there is a x86_emulate() in xen/arch/x86/x86_emulate/x86_emulate.c(my version is xen-4.0.1), and it will emulate some instructions (I think both guest OS and Domain-0) in some conditions(like what Tim said)
 
2, Real-mode code you talked above is used to execute the first 16-bit initial code of a guest OS? Does it have other usages in current Xen implementation?
I'm also curious about the real-mode, looking forward to the replay~

Thanks,
Royo (Zhengwang)

Cheers,

Tim.


_______________________________________________
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



--
- Luit @ Parallel Processing Institute, Fudan University 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel