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] [xen-unstable] stubdom: make xc_map_foreign_ranges use m

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] stubdom: make xc_map_foreign_ranges use malloc instead of stack space
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 29 Aug 2008 08:30:10 -0700
Delivery-date: Fri, 29 Aug 2008 08:30:34 -0700
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1219912810 -3600
# Node ID ab50f558a6f344d0aa0277823fce39b6b20b5784
# Parent  b4bde79b7ba042b9bcaf2382e54ef1144f120e47
stubdom: make xc_map_foreign_ranges use malloc instead of stack space

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
---
 tools/libxc/xc_minios.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff -r b4bde79b7ba0 -r ab50f558a6f3 tools/libxc/xc_minios.c
--- a/tools/libxc/xc_minios.c   Wed Aug 27 16:23:10 2008 +0100
+++ b/tools/libxc/xc_minios.c   Thu Aug 28 09:40:10 2008 +0100
@@ -80,9 +80,10 @@ void *xc_map_foreign_ranges(int xc_handl
                             size_t size, int prot, size_t chunksize,
                             privcmd_mmap_entry_t entries[], int nentries)
 {
-    unsigned long mfns[size / PAGE_SIZE];
+    unsigned long *mfns;
     int i, j, n;
     unsigned long pt_prot = 0;
+    void *ret;
 #ifdef __ia64__
     /* TODO */
 #else
@@ -92,12 +93,16 @@ void *xc_map_foreign_ranges(int xc_handl
        pt_prot = L1_PROT;
 #endif
 
+    mfns = malloc((size / PAGE_SIZE) * sizeof(*mfns));
+
     n = 0;
     for (i = 0; i < nentries; i++)
         for (j = 0; j < chunksize / PAGE_SIZE; j++)
             mfns[n++] = entries[i].mfn + j;
 
-    return map_frames_ex(mfns, n, 1, 0, 1, dom, 0, pt_prot);
+    ret = map_frames_ex(mfns, n, 1, 0, 1, dom, 0, pt_prot);
+    free(mfns);
+    return ret;
 }
 
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] stubdom: make xc_map_foreign_ranges use malloc instead of stack space, Xen patchbot-unstable <=