[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Paging support for guest walk tables to page in l1-l3 page table pages.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1261031275 0
# Node ID b0bef85100ec4cb91f78b290042bd9dbf018eb33
# Parent  f24609ab0b95d3116e57142ff7cf339f1cfb034d
Paging support for guest walk tables to page in l1-l3 page table pages.

A new page flag has been added to indicate that a paged out page was found
while walking the page tables. The paging in code is automatically called,
so the flag is only an indicator that the operation should be retried, not
that the page should be paged in.

Signed-off-by: Patrick Colp <Patrick.Colp@xxxxxxxxxx>
---
 xen/arch/x86/mm/guest_walk.c |   21 +++++++++++++++++++++
 xen/include/asm-x86/page.h   |    1 +
 2 files changed, 22 insertions(+)

diff -r f24609ab0b95 -r b0bef85100ec xen/arch/x86/mm/guest_walk.c
--- a/xen/arch/x86/mm/guest_walk.c      Thu Dec 17 06:27:55 2009 +0000
+++ b/xen/arch/x86/mm/guest_walk.c      Thu Dec 17 06:27:55 2009 +0000
@@ -125,6 +125,13 @@ guest_walk_tables(struct vcpu *v, unsign
 
     /* Map the l3 table */
     gw->l3mfn = gfn_to_mfn(d, guest_l4e_get_gfn(gw->l4e), &p2mt);
+    if ( p2m_is_paging(p2mt) )
+    {
+        p2m_mem_paging_populate(d, gfn_x(guest_l4e_get_gfn(gw->l4e)));
+
+        rc = _PAGE_PAGED;
+        goto out;
+    }
     if ( !p2m_is_ram(p2mt) ) 
     {
         rc |= _PAGE_PRESENT;
@@ -154,6 +161,13 @@ guest_walk_tables(struct vcpu *v, unsign
 
     /* Map the l2 table */
     gw->l2mfn = gfn_to_mfn(d, guest_l3e_get_gfn(gw->l3e), &p2mt);
+    if ( p2m_is_paging(p2mt) )
+    {
+        p2m_mem_paging_populate(d, gfn_x(guest_l3e_get_gfn(gw->l3e)));
+
+        rc = _PAGE_PAGED;
+        goto out;
+    }
     if ( !p2m_is_ram(p2mt) )
     {
         rc |= _PAGE_PRESENT;
@@ -212,6 +226,13 @@ guest_walk_tables(struct vcpu *v, unsign
     {
         /* Not a superpage: carry on and find the l1e. */
         gw->l1mfn = gfn_to_mfn(d, guest_l2e_get_gfn(gw->l2e), &p2mt);
+        if ( p2m_is_paging(p2mt) )
+        {
+            p2m_mem_paging_populate(d, gfn_x(guest_l2e_get_gfn(gw->l2e)));
+
+            rc = _PAGE_PAGED;
+            goto out;
+        }
         if ( !p2m_is_ram(p2mt) )
         {
             rc |= _PAGE_PRESENT;
diff -r f24609ab0b95 -r b0bef85100ec xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h        Thu Dec 17 06:27:55 2009 +0000
+++ b/xen/include/asm-x86/page.h        Thu Dec 17 06:27:55 2009 +0000
@@ -311,6 +311,7 @@ void setup_idle_pagetable(void);
 #define _PAGE_AVAIL2   0x800U
 #define _PAGE_AVAIL    0xE00U
 #define _PAGE_PSE_PAT 0x1000U
+#define _PAGE_PAGED   0x2000U
 
 /*
  * Debug option: Ensure that granted mappings are not implicitly unmapped.

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.