All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][QEMU][IA64] Fix qemu memory access on IA64
@ 2008-02-21 10:35 Kouya Shimura
  2008-02-21 10:40 ` Keir Fraser
  2008-02-22 17:04 ` [Xen-ia64-devel] " Alex Williamson
  0 siblings, 2 replies; 3+ messages in thread
From: Kouya Shimura @ 2008-02-21 10:35 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel, xen-ia64-devel

[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 236 bytes --]

Hi Keir,

This patch is for IA64:
- correct a parameter to xc_map_foreign_batch(). skipping vga hole.
- sync_icache() might overrun a page boundary. qemu-dm will die.

Thanks,
Kouya

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>


[-- Attachment #2: qemu-ia64.patch --]
[-- Type: text/plain, Size: 1764 bytes --]

diff -r f853c0497095 tools/ioemu/hw/xen_machine_fv.c
--- a/tools/ioemu/hw/xen_machine_fv.c	Tue Feb 19 11:14:40 2008 -0700
+++ b/tools/ioemu/hw/xen_machine_fv.c	Thu Feb 21 17:52:55 2008 +0900
@@ -246,12 +246,18 @@ static void xen_init_fv(uint64_t ram_siz
 
     for (i = 0; i < nr_pages; i++)
         page_array[i] = i;
-	
+
     /* VTI will not use memory between 3G~4G, so we just pass a legal pfn
        to make QEMU map continuous virtual memory space */
-    if (ram_size > MMIO_START) {	
+    if (ram_size > MMIO_START) {
         for (i = 0 ; i < (MEM_G >> XC_PAGE_SHIFT); i++)
             page_array[(MMIO_START >> XC_PAGE_SHIFT) + i] =
+                (STORE_PAGE_START >> XC_PAGE_SHIFT); 
+    }
+    /* skipping VGA hole, same as above */
+    if (ram_size > VGA_IO_START) {
+        for (i = 0 ; i < (VGA_IO_SIZE >> XC_PAGE_SHIFT); i++)
+            page_array[(VGA_IO_START >> XC_PAGE_SHIFT) + i] =
                 (STORE_PAGE_START >> XC_PAGE_SHIFT); 
     }
 
diff -r f853c0497095 tools/ioemu/target-i386-dm/exec-dm.c
--- a/tools/ioemu/target-i386-dm/exec-dm.c	Tue Feb 19 11:14:40 2008 -0700
+++ b/tools/ioemu/target-i386-dm/exec-dm.c	Thu Feb 21 19:36:20 2008 +0900
@@ -350,12 +350,13 @@ CPUReadMemoryFunc **cpu_get_io_memory_re
  * So to emulate right behavior that guest OS is assumed, we need to flush
  * I/D cache here.
  */
-static void sync_icache(unsigned long address, int len)
-{
-    int l;
-
-    for(l = 0; l < (len + 32); l += 32)
-        __ia64_fc(address + l);
+static void sync_icache(uint8_t *address, int len)
+{
+    unsigned long addr = (unsigned long)address;
+    unsigned long end = addr + len;
+
+    for (addr &= ~(32UL-1); addr < end; addr += 32UL)
+        __ia64_fc(addr);
 
     ia64_sync_i();
     ia64_srlz_i();

[-- Attachment #3: Type: text/plain, Size: 152 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-22 17:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-21 10:35 [PATCH][QEMU][IA64] Fix qemu memory access on IA64 Kouya Shimura
2008-02-21 10:40 ` Keir Fraser
2008-02-22 17:04 ` [Xen-ia64-devel] " Alex Williamson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.