All of lore.kernel.org
 help / color / mirror / Atom feed
* When to emulate writing page table page and when to do_update_va_mapping()?
@ 2008-07-03  6:33 Tom Creck
  2008-07-03  6:44 ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Creck @ 2008-07-03  6:33 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 542 bytes --]

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?

 

Best Wishes

Tom

 

 


[-- Attachment #1.2: Type: text/html, Size: 5258 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: When to emulate writing page table page and when to do_update_va_mapping()?
  2008-07-03  6:33 When to emulate writing page table page and when to do_update_va_mapping()? Tom Creck
@ 2008-07-03  6:44 ` Jeremy Fitzhardinge
  0 siblings, 0 replies; 2+ messages in thread
From: Jeremy Fitzhardinge @ 2008-07-03  6:44 UTC (permalink / raw)
  To: Tom Creck; +Cc: xen-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-03  6:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-03  6:33 When to emulate writing page table page and when to do_update_va_mapping()? Tom Creck
2008-07-03  6:44 ` Jeremy Fitzhardinge

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.