]> xenbits.xensource.com Git - xen.git/commitdiff
p2m_alloc_table: use p2m_alloc_ptp
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 4 May 2010 11:33:14 +0000 (12:33 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 4 May 2010 11:33:14 +0000 (12:33 +0100)
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
xen/arch/x86/mm/p2m.c

index 916fdc2de83e6f7f0eaa69feb5b54e11346c4b3f..df7d803811978551ec9d04e462427cc86a7fbea9 100644 (file)
@@ -1814,22 +1814,19 @@ int p2m_alloc_table(struct domain *d,
     p2m->alloc_page = alloc_page;
     p2m->free_page = free_page;
 
-    p2m_top = p2m->alloc_page(d);
-    if ( p2m_top == NULL )
-    {
-        p2m_unlock(p2m);
-        return -ENOMEM;
-    }
-    page_list_add_tail(p2m_top, &p2m->pages);
-
-    p2m_top->count_info = 1;
-    p2m_top->u.inuse.type_info =
+    p2m_top = p2m_alloc_ptp(d,
 #if CONFIG_PAGING_LEVELS == 4
         PGT_l4_page_table
 #else
         PGT_l3_page_table
 #endif
-        | 1 | PGT_validated;
+        );
+
+    if ( p2m_top == NULL )
+    {
+        p2m_unlock(p2m);
+        return -ENOMEM;
+    }
 
     d->arch.phys_table = pagetable_from_mfn(page_to_mfn(p2m_top));