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

[Xen-changelog] [xen-unstable] [qemu] Fix qemu memory access beyond 3G @VTi side.



# HG changeset patch
# User chris@xxxxxxxxxxxxxxxxxxxxxxxx
# Node ID a0b3cf802d99df9fccf7612caea735ddad9a0e54
# Parent  7e914d9cd7e661c2abe47fb957f52f47ff570ad6
[qemu] Fix qemu memory access beyond 3G @VTi side.

Signed-off-by: Zhang xiantao <xiantao.zhang@xxxxxxxxx>
---
 tools/ioemu/vl.c |   38 +++++++++++++++++++++++++-------------
 1 files changed, 25 insertions(+), 13 deletions(-)

diff -r 7e914d9cd7e6 -r a0b3cf802d99 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Fri Aug 04 10:43:02 2006 +0100
+++ b/tools/ioemu/vl.c  Fri Aug 04 10:52:25 2006 +0100
@@ -5783,6 +5783,11 @@ int main(int argc, char **argv)
     /* init the memory */
     phys_ram_size = ram_size + vga_ram_size + bios_size;
 
+#if defined (__ia64__)
+    if (ram_size > MMIO_START)
+       ram_size += 1 * MEM_G; /* skip 3G-4G MMIO, LEGACY_IO_SPACE etc. */
+#endif
+
 #ifdef CONFIG_DM
 
     nr_pages = ram_size/PAGE_SIZE;
@@ -5816,10 +5821,30 @@ int main(int argc, char **argv)
             (uint64_t)(page_array[nr_pages - 1]));
 
 #elif defined(__ia64__)
+  
+    if (xc_ia64_get_pfn_list(xc_handle, domid, page_array,
+                             IO_PAGE_START >> PAGE_SHIFT, 1) != 1) {
+        fprintf(logfile, "xc_ia64_get_pfn_list returned error %d\n", errno);
+        exit(-1);
+    }
+
+    shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
+                                       PROT_READ|PROT_WRITE,
+                                       page_array[0]);
+
+    fprintf(logfile, "shared page at pfn:%lx, mfn: %016lx\n",
+            IO_PAGE_START >> PAGE_SHIFT, page_array[0]);
+
     if (xc_ia64_get_pfn_list(xc_handle, domid,
                              page_array, 0, nr_pages) != nr_pages) {
         fprintf(logfile, "xc_ia64_get_pfn_list returned error %d\n", errno);
         exit(-1);
+    }
+
+    if (ram_size > MMIO_START) {       
+       for (i = 0 ; i < MEM_G >> PAGE_SHIFT; i++)
+           page_array[MMIO_START >> PAGE_SHIFT + i] =
+               page_array[IO_PAGE_START >> PAGE_SHIFT + 1];
     }
 
     phys_ram_base = xc_map_foreign_batch(xc_handle, domid,
@@ -5829,19 +5854,6 @@ int main(int argc, char **argv)
         fprintf(logfile, "xc_map_foreign_batch returned error %d\n", errno);
         exit(-1);
     }
-
-    if (xc_ia64_get_pfn_list(xc_handle, domid, page_array,
-                             IO_PAGE_START >> PAGE_SHIFT, 1) != 1){
-        fprintf(logfile, "xc_ia64_get_pfn_list returned error %d\n", errno);
-        exit(-1);
-    }
-
-    shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
-                                       PROT_READ|PROT_WRITE,
-                                       page_array[0]);
-
-    fprintf(logfile, "shared page at pfn:%lx, mfn: %016lx\n",
-            IO_PAGE_START >> PAGE_SHIFT, page_array[0]);
 #endif
 #else  /* !CONFIG_DM */
 

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