Paging support for guest walk tables to page in l1-l3 page table pages.
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 17 Dec 2009 06:27:55 +0000 (06:27 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 17 Dec 2009 06:27:55 +0000 (06:27 +0000)
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@citrix.com>
xen/arch/x86/mm/guest_walk.c
xen/include/asm-x86/page.h

index 19f239314cb600e89e8401f3069aa6ad79408c9e..b0f42f328adfcf2ca6b1c884e7e32e5b2437053e 100644 (file)
@@ -125,6 +125,13 @@ guest_walk_tables(struct vcpu *v, unsigned long va, walk_t *gw,
 
     /* 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, unsigned long va, walk_t *gw,
 
     /* 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, unsigned long va, walk_t *gw,
     {
         /* 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;
index 1997863719d9305416d2da480e6ee58f0bbab19a..9802e2d4959e80e788a1d063ada6fff434fd6ff1 100644 (file)
@@ -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.