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] When to emulate writing page table page and when to do_u

To: Tom Creck <tom-xen@xxxxxxxxxxx>
Subject: Re: [Xen-devel] When to emulate writing page table page and when to do_update_va_mapping()?
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Wed, 02 Jul 2008 23:44:03 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 02 Jul 2008 23:44:29 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <BAY121-DS15A52350AF0C61628CFC8E7980@xxxxxxx>
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: <BAY121-DS15A52350AF0C61628CFC8E7980@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080501)
Tom Creck wrote:

Hello, everyone:

I know that x86_emulate_memop() is used to emulate writing to page table pages as Xen intentionally write protect page table pages.

Also, the hypercall Hypervisor_update_va_mapping() -> mod_l2/l1_entry() is also used to modify page table pages.

         So I get confused about their difference. My questions are:

(1) When are the above two routines of modifying page table pages invoked respectively?

(2)     What’s the difference in functionality among the two?


Writing directly to pagetables is a good idea if you think it's likely that the pagetable is unpinned. That is, when it's still just an ordinary RW page while the pagetable is under construction (fork/exec) or destruction (exit). In this case, a simple memory-write is much more efficient than doing a hypercall.

On the other hand, if you're likely to be updating an active pinned pagetable, a hypercall is more efficient than trapping and emulating a write (especially if you can batch multiple updates together with a multicall).

   J


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

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