WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [PATCH 2 of 2] [PATCH] introduce io hole into dom0 p2m map

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [PATCH 2 of 2] [PATCH] introduce io hole into dom0 p2m map
From: Ryan Harper <ryanh@xxxxxxxxxx>
Date: Mon, 19 Mar 2007 17:38:28 -0500
Delivery-date: Mon, 19 Mar 2007 15:37:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1174343906@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
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 <ryanh@xxxxxxxxxx>
# 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 <ryanh@xxxxxxxxxx>

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 memory@IOHOLE_END */
         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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>