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-changelog

[Xen-changelog] Dynamically allocate mmu_update array in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Dynamically allocate mmu_update array in
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 03 Oct 2005 09:32:11 +0000
Delivery-date: Mon, 03 Oct 2005 09:29:44 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID f22fba6731968547f2826e78005c8466e4f14847
# Parent  bb03b43404bb3ae7ac3173306ff403b1434e10ef
Dynamically allocate mmu_update array in
direct_remap_pfn_range(). This allows larger batches and
avoids stack overflow.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r bb03b43404bb -r f22fba673196 
linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c   Sun Oct  2 22:56:13 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c   Mon Oct  3 09:26:29 2005
@@ -52,24 +52,30 @@
                                    pgprot_t prot,
                                    domid_t  domid)
 {
-       int i;
+       int i, rc;
        unsigned long start_address;
-#define MAX_DIRECTMAP_MMU_QUEUE 130
-       mmu_update_t u[MAX_DIRECTMAP_MMU_QUEUE], *v = u, *w = u;
+       mmu_update_t *u, *v, *w;
+
+       u = v = w = (mmu_update_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
+       if (u == NULL)
+               return -ENOMEM;
 
        start_address = address;
 
        flush_cache_all();
 
        for (i = 0; i < size; i += PAGE_SIZE) {
-               if ((v - u) == MAX_DIRECTMAP_MMU_QUEUE) {
+               if ((v - u) == (PAGE_SIZE / sizeof(mmu_update_t))) {
                        /* Fill in the PTE pointers. */
-                       generic_page_range(mm, start_address, 
-                                          address - start_address,
-                                          direct_remap_area_pte_fn, &w);
+                       rc = generic_page_range(mm, start_address, 
+                                               address - start_address,
+                                               direct_remap_area_pte_fn, &w);
+                       if (rc)
+                               goto out;
                        w = u;
+                       rc = -EFAULT;
                        if (HYPERVISOR_mmu_update(u, v - u, NULL, domid) < 0)
-                               return -EFAULT;
+                               goto out;
                        v = u;
                        start_address = address;
                }
@@ -89,13 +95,19 @@
                /* get the ptep's filled in */
                generic_page_range(mm, start_address, address - start_address,
                                   direct_remap_area_pte_fn, &w);
+               rc = -EFAULT;
                if (unlikely(HYPERVISOR_mmu_update(u, v - u, NULL, domid) < 0))
-                       return -EFAULT;
-       }
-
+                       goto out;
+       }
+
+       rc = 0;
+
+ out:
        flush_tlb_all();
 
-       return 0;
+       free_page((unsigned long)u);
+
+       return rc;
 }
 
 int direct_remap_pfn_range(struct vm_area_struct *vma,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Dynamically allocate mmu_update array in, Xen patchbot -unstable <=