3 files changed, 14 insertions(+), 11 deletions(-)
xen/arch/powerpc/domain_build.c     |   15 ++++++++-------
xen/arch/powerpc/mm.c               |    6 ++++++
xen/arch/powerpc/ofd_fixup_memory.c |    4 ----


# HG changeset patch
# User Ryan Harper <[EMAIL PROTECTED]>
# Date 1174331762 18000
# Node ID ffc0f57d6f6b16edb1587bc7aeda48d21e323f8f
# Parent  155c212fda16103d2f58ea3a321f61a68b044846
[PATCH] introduce io hole into dom0 p2m map

This patch adds in space in dom0's p2m map if dom0's memory footprint would run
into the io hole.  We check the request memory, if exceeds the size of the io
hole, we add in the size of the iohole t othe p2m map.  During extent
allocation, when we are initializing pfns that would normally fall within the io
hole, we shift those up past the end of the io hole.  Dom0 devtree has to be
aware of how its memory is laid out.

Signed-off-by: Ryan Harper <[EMAIL PROTECTED]>

diff -r 155c212fda16 -r ffc0f57d6f6b xen/arch/powerpc/domain_build.c
--- a/xen/arch/powerpc/domain_build.c   Mon Mar 19 14:16:01 2007 -0500
+++ b/xen/arch/powerpc/domain_build.c   Mon Mar 19 14:16:02 2007 -0500
@@ -74,6 +74,7 @@ int construct_dom0(struct domain *d,
     ulong eomem;
     int preempt = 0;
     int vcpu;
+    uint p2m_size;
     ulong mod_start = 0;
     ulong mod_len = 0;
     ulong shared_info_addr;
@@ -130,16 +131,16 @@ int construct_dom0(struct domain *d,
                 ((dom0_nrpages << PAGE_SHIFT) >> 20));
     }
 
-    /* XXX Dom0 currently can't extend past the IO hole. */
-    if (dom0_nrpages > (platform_iohole_base() >> PAGE_SHIFT)) {
-        dom0_nrpages = (platform_iohole_base() >> PAGE_SHIFT);
-        printk("Limiting DOM0 memory size to %u MiB to avoid IO hole.\n", 
-                ((dom0_nrpages << PAGE_SHIFT) >> 20));
-    }
+    /* if we extend into IO range, add in IO range */
+    p2m_size = dom0_nrpages;
+    if (p2m_size > (platform_iohole_size() >> PAGE_SHIFT))
+        p2m_size += (platform_iohole_size() >> PAGE_SHIFT);
 
     /* Set Dom0 max mem, triggering p2m table creation. */
-    if ((guest_physmap_max_mem_pages(d, dom0_nrpages)) != 0)
+    spin_lock(&d->page_alloc_lock);
+    if ((guest_physmap_max_mem_pages(d, (ulong)p2m_size)) != 0)
         panic("Failed to set DOM0 max mem pages value\n");
+    spin_unlock(&d->page_alloc_lock);
 
     d->max_pages = dom0_nrpages;
     if (0 > allocate_rma(d, cpu_default_rma_order_pages()))
diff -r 155c212fda16 -r ffc0f57d6f6b xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c     Mon Mar 19 14:16:01 2007 -0500
+++ b/xen/arch/powerpc/mm.c     Mon Mar 19 14:16:02 2007 -0500
@@ -316,6 +316,8 @@ uint allocate_extents(struct domain *d, 
     struct page_info *pg;
     ulong mfn;
     ulong gpfn = rma_nrpages; /* starting PFN at end of RMA */
+    ulong iobase_page = platform_iohole_base() >> PAGE_SHIFT;
+    ulong iobase_sz = platform_iohole_size() >> PAGE_SHIFT;
     uint ext_order;
     uint ext_nrpages;
     uint total_nrpages;
@@ -342,6 +344,10 @@ uint allocate_extents(struct domain *d, 
         gpfn += ext_nrpages;
 
         total_nrpages += ext_nrpages;
+
+        /* if the current gpfn falls within the iohole, offset it */
+        if ((gpfn >= iobase_page) && (gpfn < (iobase_page + iobase_sz)))
+            gpfn += iobase_sz;
     }
 
     return total_nrpages;
diff -r 155c212fda16 -r ffc0f57d6f6b xen/arch/powerpc/ofd_fixup_memory.c
--- a/xen/arch/powerpc/ofd_fixup_memory.c       Mon Mar 19 14:16:01 2007 -0500
+++ b/xen/arch/powerpc/ofd_fixup_memory.c       Mon Mar 19 14:16:02 2007 -0500
@@ -101,15 +101,11 @@ static void ofd_memory_extent_nodes(void
 
         BUG_ON(n <= 0);
 
-        /* XXX Our p2m translation currnetly doesn't allow dom0 memory above
-         * the IO hole. */
-#if 0
         /* remaining memory shifted up to [EMAIL PROTECTED] */
         start = platform_iohole_base()+platform_iohole_size();
         size = (d->tot_pages << PAGE_SHIFT) - platform_iohole_base();
         n = ofd_memory_node_create(m, OFD_ROOT, "", memory, memory,
                                    start, size);
-#endif
     } else {
         /* we fit beneath the IO hole as one chunk */
         start = cur_pfn << PAGE_SHIFT;

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel

Reply via email to