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

[Xen-changelog] [xen-unstable] x86: put_superpage() must also work for !opt_allow_superpage



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1276604443 -3600
# Node ID 972b7e305138759d4ef42b75d5fe5c6fd2d2e30c
# Parent  98c118970b4db0f03a7b54c41d098ce518ad9560
x86: put_superpage() must also work for !opt_allow_superpage

This is because the P2M table, when placed at a kernel specified
location, gets populated with large pages, which the domain must have
a way to unmap/recycle.

Additionally when allowing Dom0 to use superpages, they ought to be
tracked accordingly in the superpage frame table.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 xen/arch/x86/domain_build.c |    2 ++
 xen/arch/x86/mm.c           |   10 ++++++++--
 xen/include/asm-x86/mm.h    |    1 +
 3 files changed, 11 insertions(+), 2 deletions(-)

diff -r 98c118970b4d -r 972b7e305138 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c       Tue Jun 15 13:20:11 2010 +0100
+++ b/xen/arch/x86/domain_build.c       Tue Jun 15 13:20:43 2010 +0100
@@ -914,6 +914,8 @@ int __init construct_dom0(
                 {
                     *l2tab = l2e_from_page(page,
                                            L1_PROT|_PAGE_DIRTY|_PAGE_PSE);
+                    if ( opt_allow_superpage )
+                        get_superpage(page_to_mfn(page), d);
                     va += 1UL << L2_PAGETABLE_SHIFT;
                     continue;
                 }
diff -r 98c118970b4d -r 972b7e305138 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Tue Jun 15 13:20:11 2010 +0100
+++ b/xen/arch/x86/mm.c Tue Jun 15 13:20:43 2010 +0100
@@ -155,7 +155,9 @@ int opt_allow_superpage;
 int opt_allow_superpage;
 boolean_param("allowsuperpage", opt_allow_superpage);
 
+#ifdef __i386__
 static int get_superpage(unsigned long mfn, struct domain *d);
+#endif
 static void put_superpage(unsigned long mfn);
 
 #define l1_disallow_mask(d)                                     \
@@ -2568,7 +2570,7 @@ void clear_superpage_mark(struct page_in
 
 }
 
-static int get_superpage(unsigned long mfn, struct domain *d)
+int get_superpage(unsigned long mfn, struct domain *d)
 {
     struct spage_info *spage;
     unsigned long x, nx, y;
@@ -2611,7 +2613,11 @@ static void put_superpage(unsigned long 
     unsigned long x, nx, y;
     unsigned long do_pages = 0;
 
-    ASSERT(opt_allow_superpage);
+    if ( !opt_allow_superpage )
+    {
+        put_spage_pages(mfn_to_page(mfn));
+        return;
+    }
 
     spage = mfn_to_spage(mfn);
     y = spage->type_info;
diff -r 98c118970b4d -r 972b7e305138 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h  Tue Jun 15 13:20:11 2010 +0100
+++ b/xen/include/asm-x86/mm.h  Tue Jun 15 13:20:43 2010 +0100
@@ -281,6 +281,7 @@ extern void share_xen_page_with_privileg
 #define frame_table ((struct page_info *)FRAMETABLE_VIRT_START)
 #ifdef __x86_64__
 #define spage_table ((struct spage_info *)SPAGETABLE_VIRT_START)
+int get_superpage(unsigned long mfn, struct domain *d);
 #endif
 extern unsigned long max_page;
 extern unsigned long total_pages;

_______________________________________________
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®.