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

[Xen-changelog] [xen-unstable] p2m: Support page orders other than 0 (4kB) and 9 (2MB)



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1215597858 -3600
# Node ID f3afb8625a9236c404cd7190bf5725e691dd1fe2
# Parent  06bcd8f622c846314e46b233b87b8264c358aaf4
p2m: Support page orders other than 0 (4kB) and 9 (2MB)
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/mm/p2m.c |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff -r 06bcd8f622c8 -r f3afb8625a92 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Wed Jul 09 11:02:37 2008 +0100
+++ b/xen/arch/x86/mm/p2m.c     Wed Jul 09 11:04:18 2008 +0100
@@ -530,11 +530,25 @@ void p2m_change_entry_type_global(struct
     p2m_unlock(p2m);
 }
 
-static inline
+static
 int set_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn, 
-                  unsigned int page_order, p2m_type_t p2mt)
-{
-    return d->arch.p2m->set_entry(d, gfn, mfn, page_order, p2mt);
+                    unsigned int page_order, p2m_type_t p2mt)
+{
+    unsigned long todo = 1ul << page_order;
+    unsigned int order;
+    int rc = 0;
+
+    while ( todo )
+    {
+        order = (((gfn | mfn_x(mfn) | todo) & ((1ul << 9) - 1)) == 0) ? 9 : 0;
+        rc = d->arch.p2m->set_entry(d, gfn, mfn, order, p2mt);
+        gfn += 1ul << order;
+        if ( mfn_x(mfn) != INVALID_MFN )
+            mfn = _mfn(mfn_x(mfn) + (1ul << order));
+        todo -= 1ul << order;
+    }
+
+    return rc;
 }
 
 // Allocate a new p2m table for a domain.

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