ia64/xen-unstable

changeset 13146:f58b0c778b90

[qemu patches] Update patches upto changeset 13108:ed815cbdc90e.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author Christian Limpach <Christian.Limpach@xensource.com>
date Wed Dec 20 15:22:46 2006 +0000 (2006-12-20)
parents 4fb80f21c77d
children bb622907eb89
files tools/ioemu/patches/domain-timeoffset tools/ioemu/patches/fix-interrupt-routing tools/ioemu/patches/ioemu-ia64 tools/ioemu/patches/qemu-bootorder tools/ioemu/patches/series tools/ioemu/patches/tpm-tis-device tools/ioemu/patches/vnc-display-find-unused tools/ioemu/patches/vnc-fixes tools/ioemu/patches/vnc-listen-specific-interface tools/ioemu/patches/vnc-password tools/ioemu/patches/vnc-start-vncviewer tools/ioemu/patches/xen-mapcache tools/ioemu/patches/xen-support-buffered-ioreqs tools/ioemu/patches/xenstore-block-device-config tools/ioemu/patches/xenstore-write-vnc-port
line diff
     1.1 --- a/tools/ioemu/patches/domain-timeoffset	Wed Dec 20 15:16:13 2006 +0000
     1.2 +++ b/tools/ioemu/patches/domain-timeoffset	Wed Dec 20 15:22:46 2006 +0000
     1.3 @@ -1,7 +1,7 @@
     1.4  Index: ioemu/hw/mc146818rtc.c
     1.5  ===================================================================
     1.6 ---- ioemu.orig/hw/mc146818rtc.c	2006-12-08 18:36:31.000000000 +0000
     1.7 -+++ ioemu/hw/mc146818rtc.c	2006-12-08 18:36:36.000000000 +0000
     1.8 +--- ioemu.orig/hw/mc146818rtc.c	2006-12-20 15:21:33.000000000 +0000
     1.9 ++++ ioemu/hw/mc146818rtc.c	2006-12-20 15:21:50.000000000 +0000
    1.10  @@ -178,10 +178,27 @@
    1.11       }
    1.12   }
    1.13 @@ -46,8 +46,8 @@ Index: ioemu/hw/mc146818rtc.c
    1.14   static void rtc_copy_date(RTCState *s)
    1.15  Index: ioemu/hw/pc.c
    1.16  ===================================================================
    1.17 ---- ioemu.orig/hw/pc.c	2006-12-08 18:36:35.000000000 +0000
    1.18 -+++ ioemu/hw/pc.c	2006-12-08 18:36:36.000000000 +0000
    1.19 +--- ioemu.orig/hw/pc.c	2006-12-20 15:21:49.000000000 +0000
    1.20 ++++ ioemu/hw/pc.c	2006-12-20 15:21:50.000000000 +0000
    1.21  @@ -159,7 +159,7 @@
    1.22   }
    1.23   
    1.24 @@ -117,8 +117,8 @@ Index: ioemu/hw/pc.c
    1.25   QEMUMachine pc_machine = {
    1.26  Index: ioemu/vl.c
    1.27  ===================================================================
    1.28 ---- ioemu.orig/vl.c	2006-12-08 18:36:35.000000000 +0000
    1.29 -+++ ioemu/vl.c	2006-12-08 18:36:36.000000000 +0000
    1.30 +--- ioemu.orig/vl.c	2006-12-20 15:21:49.000000000 +0000
    1.31 ++++ ioemu/vl.c	2006-12-20 15:21:50.000000000 +0000
    1.32  @@ -163,6 +163,8 @@
    1.33   
    1.34   int xc_handle;
    1.35 @@ -162,7 +162,7 @@ Index: ioemu/vl.c
    1.36               }
    1.37           }
    1.38       }
    1.39 -@@ -6492,7 +6500,8 @@
    1.40 +@@ -6484,7 +6492,8 @@
    1.41   
    1.42       machine->init(ram_size, vga_ram_size, boot_device,
    1.43                     ds, fd_filename, snapshot,
    1.44 @@ -174,8 +174,8 @@ Index: ioemu/vl.c
    1.45       if (usb_enabled) {
    1.46  Index: ioemu/vl.h
    1.47  ===================================================================
    1.48 ---- ioemu.orig/vl.h	2006-12-08 18:36:35.000000000 +0000
    1.49 -+++ ioemu/vl.h	2006-12-08 18:36:36.000000000 +0000
    1.50 +--- ioemu.orig/vl.h	2006-12-20 15:21:49.000000000 +0000
    1.51 ++++ ioemu/vl.h	2006-12-20 15:21:50.000000000 +0000
    1.52  @@ -576,7 +576,7 @@
    1.53                                    int boot_device,
    1.54                DisplayState *ds, const char **fd_filename, int snapshot,
     2.1 --- a/tools/ioemu/patches/fix-interrupt-routing	Wed Dec 20 15:16:13 2006 +0000
     2.2 +++ b/tools/ioemu/patches/fix-interrupt-routing	Wed Dec 20 15:22:46 2006 +0000
     2.3 @@ -17,23 +17,21 @@ Signed-off-by: Keir Fraser <keir@xensour
     2.4  
     2.5  Index: ioemu/Makefile.target
     2.6  ===================================================================
     2.7 ---- ioemu.orig/Makefile.target	2006-12-08 18:21:56.000000000 +0000
     2.8 -+++ ioemu/Makefile.target	2006-12-08 18:22:35.000000000 +0000
     2.9 -@@ -298,7 +298,7 @@
    2.10 +--- ioemu.orig/Makefile.target	2006-12-20 15:04:55.000000000 +0000
    2.11 ++++ ioemu/Makefile.target	2006-12-20 15:08:16.000000000 +0000
    2.12 +@@ -296,9 +296,9 @@
    2.13 + 
    2.14 + # qemu-dm objects
    2.15   ifeq ($(ARCH),ia64)
    2.16 - LIBOBJS=helper2.o exec-dm.o i8259-dm.o
    2.17 +-LIBOBJS=helper2.o exec-dm.o i8259-dm.o
    2.18 ++LIBOBJS=helper2.o exec-dm.o i8259-dm.o piix_pci-dm.o
    2.19   else
    2.20  -LIBOBJS=helper2.o exec-dm.o i8259-dm.o rtc-dm.o
    2.21  +LIBOBJS=helper2.o exec-dm.o i8259-dm.o rtc-dm.o piix_pci-dm.o
    2.22   endif
    2.23   
    2.24   all: $(PROGS)
    2.25 -@@ -360,11 +360,11 @@
    2.26 - # Hardware support
    2.27 - VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
    2.28 - ifeq ($(ARCH),ia64)
    2.29 --VL_OBJS+= fdc.o mc146818rtc.o serial.o pc.o
    2.30 -+VL_OBJS+= fdc.o mc146818rtc.o serial.o pc.o piix_pci.o
    2.31 +@@ -364,7 +364,7 @@
    2.32   else
    2.33   VL_OBJS+= fdc.o serial.o pc.o
    2.34   endif
    2.35 @@ -44,8 +42,8 @@ Index: ioemu/Makefile.target
    2.36   VL_OBJS+= xenstore.o
    2.37  Index: ioemu/target-i386-dm/i8259-dm.c
    2.38  ===================================================================
    2.39 ---- ioemu.orig/target-i386-dm/i8259-dm.c	2006-12-08 18:21:36.000000000 +0000
    2.40 -+++ ioemu/target-i386-dm/i8259-dm.c	2006-12-08 18:22:35.000000000 +0000
    2.41 +--- ioemu.orig/target-i386-dm/i8259-dm.c	2006-12-20 15:04:54.000000000 +0000
    2.42 ++++ ioemu/target-i386-dm/i8259-dm.c	2006-12-20 15:04:55.000000000 +0000
    2.43  @@ -33,7 +33,7 @@
    2.44   
    2.45   void pic_set_irq_new(void *opaque, int irq, int level)
    2.46 @@ -58,7 +56,7 @@ Index: ioemu/target-i386-dm/i8259-dm.c
    2.47  Index: ioemu/target-i386-dm/piix_pci-dm.c
    2.48  ===================================================================
    2.49  --- /dev/null	1970-01-01 00:00:00.000000000 +0000
    2.50 -+++ ioemu/target-i386-dm/piix_pci-dm.c	2006-12-08 18:22:35.000000000 +0000
    2.51 ++++ ioemu/target-i386-dm/piix_pci-dm.c	2006-12-20 15:08:13.000000000 +0000
    2.52  @@ -0,0 +1,397 @@
    2.53  +/*
    2.54  + * QEMU i440FX/PIIX3 PCI Bridge Emulation
     3.1 --- a/tools/ioemu/patches/ioemu-ia64	Wed Dec 20 15:16:13 2006 +0000
     3.2 +++ b/tools/ioemu/patches/ioemu-ia64	Wed Dec 20 15:22:46 2006 +0000
     3.3 @@ -1,7 +1,7 @@
     3.4  Index: ioemu/hw/iommu.c
     3.5  ===================================================================
     3.6 ---- ioemu.orig/hw/iommu.c	2006-12-08 02:02:07.000000000 +0000
     3.7 -+++ ioemu/hw/iommu.c	2006-12-08 02:02:34.000000000 +0000
     3.8 +--- ioemu.orig/hw/iommu.c	2006-12-20 15:04:54.000000000 +0000
     3.9 ++++ ioemu/hw/iommu.c	2006-12-20 15:04:54.000000000 +0000
    3.10  @@ -82,7 +82,11 @@
    3.11   #define IOPTE_VALID         0x00000002 /* IOPTE is valid */
    3.12   #define IOPTE_WAZ           0x00000001 /* Write as zeros */
    3.13 @@ -16,8 +16,8 @@ Index: ioemu/hw/iommu.c
    3.14   
    3.15  Index: ioemu/cpu-all.h
    3.16  ===================================================================
    3.17 ---- ioemu.orig/cpu-all.h	2006-12-08 02:02:07.000000000 +0000
    3.18 -+++ ioemu/cpu-all.h	2006-12-08 02:02:34.000000000 +0000
    3.19 +--- ioemu.orig/cpu-all.h	2006-12-20 15:04:54.000000000 +0000
    3.20 ++++ ioemu/cpu-all.h	2006-12-20 15:04:54.000000000 +0000
    3.21  @@ -835,6 +835,31 @@
    3.22                   :"=m" (*(volatile long *)addr)
    3.23                   :"dIr" (nr));
    3.24 @@ -52,13 +52,17 @@ Index: ioemu/cpu-all.h
    3.25   /* memory API */
    3.26  Index: ioemu/vl.c
    3.27  ===================================================================
    3.28 ---- ioemu.orig/vl.c	2006-12-08 02:02:28.000000000 +0000
    3.29 -+++ ioemu/vl.c	2006-12-08 02:02:34.000000000 +0000
    3.30 -@@ -6137,6 +6137,11 @@
    3.31 +--- ioemu.orig/vl.c	2006-12-20 15:04:54.000000000 +0000
    3.32 ++++ ioemu/vl.c	2006-12-20 15:12:00.000000000 +0000
    3.33 +@@ -6137,6 +6137,15 @@
    3.34               exit(1);
    3.35       }
    3.36   
    3.37  +#if defined (__ia64__)
    3.38 ++    /* ram_size passed from xend has added on GFW memory,
    3.39 ++       so we must subtract it here */
    3.40 ++    ram_size -= 16 * MEM_M;
    3.41 ++
    3.42  +    if (ram_size > MMIO_START)
    3.43  +        ram_size += 1 * MEM_G; /* skip 3G-4G MMIO, LEGACY_IO_SPACE etc. */
    3.44  +#endif
    3.45 @@ -66,7 +70,7 @@ Index: ioemu/vl.c
    3.46       /* init the memory */
    3.47       phys_ram_size = ram_size + vga_ram_size + bios_size;
    3.48   
    3.49 -@@ -6161,6 +6166,7 @@
    3.50 +@@ -6161,6 +6170,7 @@
    3.51           exit(-1);
    3.52       }
    3.53   
    3.54 @@ -74,41 +78,29 @@ Index: ioemu/vl.c
    3.55       for ( i = 0; i < tmp_nr_pages; i++)
    3.56           page_array[i] = i;
    3.57   
    3.58 -@@ -6185,6 +6191,48 @@
    3.59 +@@ -6185,6 +6195,36 @@
    3.60   
    3.61       free(page_array);
    3.62   
    3.63  +#elif defined(__ia64__)
    3.64  +  
    3.65 -+    if (xc_ia64_get_pfn_list(xc_handle, domid, page_array,
    3.66 -+                             IO_PAGE_START >> PAGE_SHIFT, 3) != 3) {
    3.67 -+        fprintf(logfile, "xc_ia64_get_pfn_list returned error %d\n", errno);
    3.68 -+        exit(-1);
    3.69 -+    }
    3.70 -+
    3.71  +    shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
    3.72  +                                       PROT_READ|PROT_WRITE,
    3.73 -+                                       page_array[0]);
    3.74 -+
    3.75 -+    fprintf(logfile, "shared page at pfn:%lx, mfn: %016lx\n",
    3.76 -+            IO_PAGE_START >> PAGE_SHIFT, page_array[0]);
    3.77 ++                                       IO_PAGE_START >> PAGE_SHIFT);
    3.78  +
    3.79  +    buffered_io_page =xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
    3.80  +                                       PROT_READ|PROT_WRITE,
    3.81 -+                                       page_array[2]);
    3.82 -+    fprintf(logfile, "Buffered IO page at pfn:%lx, mfn: %016lx\n",
    3.83 -+            BUFFER_IO_PAGE_START >> PAGE_SHIFT, page_array[2]);
    3.84 ++                                       BUFFER_IO_PAGE_START >> PAGE_SHIFT);
    3.85  +
    3.86 -+    if (xc_ia64_get_pfn_list(xc_handle, domid,
    3.87 -+                             page_array, 0, nr_pages) != nr_pages) {
    3.88 -+        fprintf(logfile, "xc_ia64_get_pfn_list returned error %d\n", errno);
    3.89 -+        exit(-1);
    3.90 -+    }
    3.91 -+
    3.92 ++    for (i = 0; i < tmp_nr_pages; i++)
    3.93 ++        page_array[i] = i;
    3.94 ++	
    3.95 ++    /* VTI will not use memory between 3G~4G, so we just pass a legal pfn
    3.96 ++       to make QEMU map continuous virtual memory space */
    3.97  +    if (ram_size > MMIO_START) {	
    3.98  +        for (i = 0 ; i < (MEM_G >> PAGE_SHIFT); i++)
    3.99  +            page_array[(MMIO_START >> PAGE_SHIFT) + i] =
   3.100 -+                page_array[(IO_PAGE_START >> PAGE_SHIFT) + 1];
   3.101 ++                (STORE_PAGE_START >> PAGE_SHIFT); 
   3.102  +    }
   3.103  +
   3.104  +    phys_ram_base = xc_map_foreign_batch(xc_handle, domid,
   3.105 @@ -125,8 +117,8 @@ Index: ioemu/vl.c
   3.106       phys_ram_base = qemu_vmalloc(phys_ram_size);
   3.107  Index: ioemu/exec-all.h
   3.108  ===================================================================
   3.109 ---- ioemu.orig/exec-all.h	2006-12-08 02:02:07.000000000 +0000
   3.110 -+++ ioemu/exec-all.h	2006-12-08 02:02:34.000000000 +0000
   3.111 +--- ioemu.orig/exec-all.h	2006-12-20 15:04:54.000000000 +0000
   3.112 ++++ ioemu/exec-all.h	2006-12-20 15:04:54.000000000 +0000
   3.113  @@ -462,12 +462,13 @@
   3.114   }
   3.115   #endif
   3.116 @@ -146,8 +138,8 @@ Index: ioemu/exec-all.h
   3.117   
   3.118  Index: ioemu/target-i386-dm/cpu.h
   3.119  ===================================================================
   3.120 ---- ioemu.orig/target-i386-dm/cpu.h	2006-12-08 02:02:07.000000000 +0000
   3.121 -+++ ioemu/target-i386-dm/cpu.h	2006-12-08 02:02:34.000000000 +0000
   3.122 +--- ioemu.orig/target-i386-dm/cpu.h	2006-12-20 15:04:54.000000000 +0000
   3.123 ++++ ioemu/target-i386-dm/cpu.h	2006-12-20 15:10:13.000000000 +0000
   3.124  @@ -78,7 +78,11 @@
   3.125   /* helper2.c */
   3.126   int main_loop(void);
   3.127 @@ -163,7 +155,7 @@ Index: ioemu/target-i386-dm/cpu.h
   3.128  Index: ioemu/ia64_intrinsic.h
   3.129  ===================================================================
   3.130  --- /dev/null	1970-01-01 00:00:00.000000000 +0000
   3.131 -+++ ioemu/ia64_intrinsic.h	2006-12-08 02:02:34.000000000 +0000
   3.132 ++++ ioemu/ia64_intrinsic.h	2006-12-20 15:04:54.000000000 +0000
   3.133  @@ -0,0 +1,276 @@
   3.134  +#ifndef IA64_INTRINSIC_H
   3.135  +#define IA64_INTRINSIC_H
     4.1 --- a/tools/ioemu/patches/qemu-bootorder	Wed Dec 20 15:16:13 2006 +0000
     4.2 +++ b/tools/ioemu/patches/qemu-bootorder	Wed Dec 20 15:22:46 2006 +0000
     4.3 @@ -1,7 +1,7 @@
     4.4  Index: ioemu/vl.c
     4.5  ===================================================================
     4.6 ---- ioemu.orig/vl.c	2006-12-08 02:02:38.000000000 +0000
     4.7 -+++ ioemu/vl.c	2006-12-08 02:02:38.000000000 +0000
     4.8 +--- ioemu.orig/vl.c	2006-12-20 15:12:08.000000000 +0000
     4.9 ++++ ioemu/vl.c	2006-12-20 15:21:19.000000000 +0000
    4.10  @@ -125,7 +125,7 @@
    4.11   struct sockaddr_in vnclisten_addr;
    4.12   const char* keyboard_layout = NULL;
    4.13 @@ -17,15 +17,17 @@ Index: ioemu/vl.c
    4.14               case QEMU_OPTION_boot:
    4.15  -                boot_device = optarg[0];
    4.16  -                if (boot_device != 'a' && 
    4.17 -+                boot_device = strdup(optarg);
    4.18 -+                if (strspn(boot_device, "acd"
    4.19 - #ifdef TARGET_SPARC
    4.20 +-#ifdef TARGET_SPARC
    4.21  -		    // Network boot
    4.22  -		    boot_device != 'n' &&
    4.23 -+                           "n"
    4.24 - #endif
    4.25 +-#endif
    4.26  -                    boot_device != 'c' && boot_device != 'd') {
    4.27  -                    fprintf(stderr, "qemu: invalid boot device '%c'\n", boot_device);
    4.28 ++                boot_device = strdup(optarg);
    4.29 ++                if (strspn(boot_device, "acd"
    4.30 ++#if defined(TARGET_SPARC) || defined(TARGET_I386)
    4.31 ++                           "n"
    4.32 ++#endif
    4.33  +                        ) != strlen(boot_device)) {
    4.34  +                    fprintf(stderr, "qemu: invalid boot device in '%s'\n",
    4.35  +                            boot_device);
    4.36 @@ -48,7 +50,7 @@ Index: ioemu/vl.c
    4.37   #endif /* !CONFIG_DM */
    4.38   
    4.39       setvbuf(stdout, NULL, _IOLBF, 0);
    4.40 -@@ -6598,6 +6600,7 @@
    4.41 +@@ -6590,6 +6592,7 @@
    4.42                     ds, fd_filename, snapshot,
    4.43                     kernel_filename, kernel_cmdline, initrd_filename,
    4.44                     timeoffset);
    4.45 @@ -58,8 +60,8 @@ Index: ioemu/vl.c
    4.46       if (usb_enabled) {
    4.47  Index: ioemu/vl.h
    4.48  ===================================================================
    4.49 ---- ioemu.orig/vl.h	2006-12-08 02:02:38.000000000 +0000
    4.50 -+++ ioemu/vl.h	2006-12-08 02:02:38.000000000 +0000
    4.51 +--- ioemu.orig/vl.h	2006-12-20 15:12:08.000000000 +0000
    4.52 ++++ ioemu/vl.h	2006-12-20 15:21:14.000000000 +0000
    4.53  @@ -578,7 +578,7 @@
    4.54   #ifndef QEMU_TOOL
    4.55   
    4.56 @@ -80,9 +82,9 @@ Index: ioemu/vl.h
    4.57                             uint32_t initrd_image, uint32_t initrd_size,
    4.58  Index: ioemu/hw/pc.c
    4.59  ===================================================================
    4.60 ---- ioemu.orig/hw/pc.c	2006-12-08 02:02:38.000000000 +0000
    4.61 -+++ ioemu/hw/pc.c	2006-12-08 02:02:38.000000000 +0000
    4.62 -@@ -158,8 +158,23 @@
    4.63 +--- ioemu.orig/hw/pc.c	2006-12-20 15:12:08.000000000 +0000
    4.64 ++++ ioemu/hw/pc.c	2006-12-20 15:21:19.000000000 +0000
    4.65 +@@ -158,8 +158,25 @@
    4.66       rtc_set_memory(s, info_ofs + 8, sectors);
    4.67   }
    4.68   
    4.69 @@ -96,6 +98,8 @@ Index: ioemu/hw/pc.c
    4.70  +            return 0x02;            /* hard drive */
    4.71  +        case 'd':
    4.72  +            return 0x03;            /* cdrom */
    4.73 ++        case 'n':
    4.74 ++            return 0x04;            /* network */
    4.75  +        }
    4.76  +    }
    4.77  +    return 0x00;                /* no device */
    4.78 @@ -107,7 +111,7 @@ Index: ioemu/hw/pc.c
    4.79   {
    4.80       RTCState *s = rtc_state;
    4.81       int val;
    4.82 -@@ -205,21 +220,14 @@
    4.83 +@@ -205,21 +222,14 @@
    4.84       rtc_set_memory(s, 0x34, val);
    4.85       rtc_set_memory(s, 0x35, val >> 8);
    4.86       
    4.87 @@ -137,7 +141,7 @@ Index: ioemu/hw/pc.c
    4.88   
    4.89       /* floppy type */
    4.90   
    4.91 -@@ -617,7 +625,7 @@
    4.92 +@@ -617,7 +627,7 @@
    4.93   #define NOBIOS 1
    4.94   
    4.95   /* PC hardware initialisation */
    4.96 @@ -146,7 +150,7 @@ Index: ioemu/hw/pc.c
    4.97                        DisplayState *ds, const char **fd_filename, int snapshot,
    4.98                        const char *kernel_filename, const char *kernel_cmdline,
    4.99                        const char *initrd_filename, time_t timeoffset,
   4.100 -@@ -919,7 +927,7 @@
   4.101 +@@ -919,7 +929,7 @@
   4.102       }
   4.103   }
   4.104   
   4.105 @@ -155,7 +159,7 @@ Index: ioemu/hw/pc.c
   4.106                           DisplayState *ds, const char **fd_filename, 
   4.107                           int snapshot, 
   4.108                           const char *kernel_filename, 
   4.109 -@@ -933,7 +941,7 @@
   4.110 +@@ -933,7 +943,7 @@
   4.111                initrd_filename, timeoffset, 1);
   4.112   }
   4.113   
     5.1 --- a/tools/ioemu/patches/series	Wed Dec 20 15:16:13 2006 +0000
     5.2 +++ b/tools/ioemu/patches/series	Wed Dec 20 15:22:46 2006 +0000
     5.3 @@ -67,5 +67,5 @@ usb-uhci-buffer-size
     5.4  vnc-monitor-shift-key-processing
     5.5  ide-error-reporting
     5.6  vnc-numpad-handling
     5.7 -xen-mapcache -p3
     5.8 +xen-mapcache
     5.9  usb-mouse-tablet-status-check -p3
     6.1 --- a/tools/ioemu/patches/tpm-tis-device	Wed Dec 20 15:16:13 2006 +0000
     6.2 +++ b/tools/ioemu/patches/tpm-tis-device	Wed Dec 20 15:22:46 2006 +0000
     6.3 @@ -22,8 +22,8 @@ Signed-off-by: Stefan Berger <stefanb@us
     6.4  
     6.5  Index: ioemu/Makefile.target
     6.6  ===================================================================
     6.7 ---- ioemu.orig/Makefile.target	2006-12-08 18:33:48.000000000 +0000
     6.8 -+++ ioemu/Makefile.target	2006-12-08 18:35:14.000000000 +0000
     6.9 +--- ioemu.orig/Makefile.target	2006-12-20 15:21:55.000000000 +0000
    6.10 ++++ ioemu/Makefile.target	2006-12-20 15:21:55.000000000 +0000
    6.11  @@ -369,6 +369,7 @@
    6.12   VL_OBJS+= piix4acpi.o
    6.13   VL_OBJS+= xenstore.o
    6.14 @@ -34,9 +34,9 @@ Index: ioemu/Makefile.target
    6.15   ifeq ($(TARGET_BASE_ARCH), ppc)
    6.16  Index: ioemu/hw/pc.c
    6.17  ===================================================================
    6.18 ---- ioemu.orig/hw/pc.c	2006-12-08 18:33:47.000000000 +0000
    6.19 -+++ ioemu/hw/pc.c	2006-12-08 18:33:48.000000000 +0000
    6.20 -@@ -875,6 +875,9 @@
    6.21 +--- ioemu.orig/hw/pc.c	2006-12-20 15:21:54.000000000 +0000
    6.22 ++++ ioemu/hw/pc.c	2006-12-20 15:21:55.000000000 +0000
    6.23 +@@ -877,6 +877,9 @@
    6.24           }
    6.25       }
    6.26   
    6.27 @@ -49,7 +49,7 @@ Index: ioemu/hw/pc.c
    6.28  Index: ioemu/hw/tpm_tis.c
    6.29  ===================================================================
    6.30  --- /dev/null	1970-01-01 00:00:00.000000000 +0000
    6.31 -+++ ioemu/hw/tpm_tis.c	2006-12-08 18:35:25.000000000 +0000
    6.32 ++++ ioemu/hw/tpm_tis.c	2006-12-20 15:21:55.000000000 +0000
    6.33  @@ -0,0 +1,1120 @@
    6.34  +/*
    6.35  + * tpm_tis.c - QEMU emulator for a 1.2 TPM with TIS interface
    6.36 @@ -1173,8 +1173,8 @@ Index: ioemu/hw/tpm_tis.c
    6.37  +}
    6.38  Index: ioemu/vl.h
    6.39  ===================================================================
    6.40 ---- ioemu.orig/vl.h	2006-12-08 18:33:48.000000000 +0000
    6.41 -+++ ioemu/vl.h	2006-12-08 18:35:14.000000000 +0000
    6.42 +--- ioemu.orig/vl.h	2006-12-20 15:21:55.000000000 +0000
    6.43 ++++ ioemu/vl.h	2006-12-20 15:21:55.000000000 +0000
    6.44  @@ -932,6 +932,10 @@
    6.45   void piix4_pm_init(PCIBus *bus, int devfn);
    6.46   void acpi_bios_init(void);
     7.1 --- a/tools/ioemu/patches/vnc-display-find-unused	Wed Dec 20 15:16:13 2006 +0000
     7.2 +++ b/tools/ioemu/patches/vnc-display-find-unused	Wed Dec 20 15:22:46 2006 +0000
     7.3 @@ -1,7 +1,7 @@
     7.4  Index: ioemu/vnc.c
     7.5  ===================================================================
     7.6 ---- ioemu.orig/vnc.c	2006-12-08 02:02:36.000000000 +0000
     7.7 -+++ ioemu/vnc.c	2006-12-08 02:02:37.000000000 +0000
     7.8 +--- ioemu.orig/vnc.c	2006-12-20 15:21:52.000000000 +0000
     7.9 ++++ ioemu/vnc.c	2006-12-20 15:21:52.000000000 +0000
    7.10  @@ -1197,7 +1197,7 @@
    7.11       }
    7.12   }
    7.13 @@ -50,8 +50,8 @@ Index: ioemu/vnc.c
    7.14   int vnc_start_viewer(int port)
    7.15  Index: ioemu/vl.c
    7.16  ===================================================================
    7.17 ---- ioemu.orig/vl.c	2006-12-08 02:02:36.000000000 +0000
    7.18 -+++ ioemu/vl.c	2006-12-08 02:02:37.000000000 +0000
    7.19 +--- ioemu.orig/vl.c	2006-12-20 15:21:51.000000000 +0000
    7.20 ++++ ioemu/vl.c	2006-12-20 15:21:52.000000000 +0000
    7.21  @@ -121,6 +121,7 @@
    7.22   static DisplayState display_state;
    7.23   int nographic;
    7.24 @@ -104,7 +104,7 @@ Index: ioemu/vl.c
    7.25               }
    7.26           }
    7.27       }
    7.28 -@@ -6468,7 +6478,7 @@
    7.29 +@@ -6460,7 +6470,7 @@
    7.30       if (nographic) {
    7.31           dumb_display_init(ds);
    7.32       } else if (vnc_display != -1) {
    7.33 @@ -115,8 +115,8 @@ Index: ioemu/vl.c
    7.34       } else {
    7.35  Index: ioemu/vl.h
    7.36  ===================================================================
    7.37 ---- ioemu.orig/vl.h	2006-12-08 02:02:36.000000000 +0000
    7.38 -+++ ioemu/vl.h	2006-12-08 02:02:37.000000000 +0000
    7.39 +--- ioemu.orig/vl.h	2006-12-20 15:21:51.000000000 +0000
    7.40 ++++ ioemu/vl.h	2006-12-20 15:21:52.000000000 +0000
    7.41  @@ -785,7 +785,7 @@
    7.42   void cocoa_display_init(DisplayState *ds, int full_screen);
    7.43   
     8.1 --- a/tools/ioemu/patches/vnc-fixes	Wed Dec 20 15:16:13 2006 +0000
     8.2 +++ b/tools/ioemu/patches/vnc-fixes	Wed Dec 20 15:22:46 2006 +0000
     8.3 @@ -1,8 +1,8 @@
     8.4  Index: ioemu/vl.c
     8.5  ===================================================================
     8.6 ---- ioemu.orig/vl.c	2006-12-08 02:02:36.000000000 +0000
     8.7 -+++ ioemu/vl.c	2006-12-08 02:02:36.000000000 +0000
     8.8 -@@ -6519,8 +6519,10 @@
     8.9 +--- ioemu.orig/vl.c	2006-12-20 15:21:51.000000000 +0000
    8.10 ++++ ioemu/vl.c	2006-12-20 15:21:51.000000000 +0000
    8.11 +@@ -6511,8 +6511,10 @@
    8.12           }
    8.13       }
    8.14   
    8.15 @@ -17,8 +17,8 @@ Index: ioemu/vl.c
    8.16       if (use_gdbstub) {
    8.17  Index: ioemu/vnc.c
    8.18  ===================================================================
    8.19 ---- ioemu.orig/vnc.c	2006-12-08 02:02:36.000000000 +0000
    8.20 -+++ ioemu/vnc.c	2006-12-08 02:02:36.000000000 +0000
    8.21 +--- ioemu.orig/vnc.c	2006-12-20 15:21:51.000000000 +0000
    8.22 ++++ ioemu/vnc.c	2006-12-20 15:21:51.000000000 +0000
    8.23  @@ -3,6 +3,7 @@
    8.24    * 
    8.25    * Copyright (C) 2006 Anthony Liguori <anthony@codemonkey.ws>
    8.26 @@ -531,8 +531,8 @@ Index: ioemu/vnc.c
    8.27   }
    8.28  Index: ioemu/vl.h
    8.29  ===================================================================
    8.30 ---- ioemu.orig/vl.h	2006-12-08 02:02:36.000000000 +0000
    8.31 -+++ ioemu/vl.h	2006-12-08 02:02:36.000000000 +0000
    8.32 +--- ioemu.orig/vl.h	2006-12-20 15:21:51.000000000 +0000
    8.33 ++++ ioemu/vl.h	2006-12-20 15:21:51.000000000 +0000
    8.34  @@ -319,6 +319,7 @@
    8.35   int is_graphic_console(void);
    8.36   CharDriverState *text_console_init(DisplayState *ds);
     9.1 --- a/tools/ioemu/patches/vnc-listen-specific-interface	Wed Dec 20 15:16:13 2006 +0000
     9.2 +++ b/tools/ioemu/patches/vnc-listen-specific-interface	Wed Dec 20 15:22:46 2006 +0000
     9.3 @@ -20,8 +20,8 @@ Signed-off-by:  Daniel P. Berrange <berr
     9.4  
     9.5  Index: ioemu/vl.c
     9.6  ===================================================================
     9.7 ---- ioemu.orig/vl.c	2006-12-08 02:02:37.000000000 +0000
     9.8 -+++ ioemu/vl.c	2006-12-08 02:02:37.000000000 +0000
     9.9 +--- ioemu.orig/vl.c	2006-12-20 15:21:52.000000000 +0000
    9.10 ++++ ioemu/vl.c	2006-12-20 15:21:52.000000000 +0000
    9.11  @@ -122,6 +122,7 @@
    9.12   int nographic;
    9.13   int vncviewer;
    9.14 @@ -114,7 +114,7 @@ Index: ioemu/vl.c
    9.15               }
    9.16           }
    9.17       }
    9.18 -@@ -6478,7 +6493,7 @@
    9.19 +@@ -6470,7 +6485,7 @@
    9.20       if (nographic) {
    9.21           dumb_display_init(ds);
    9.22       } else if (vnc_display != -1) {
    9.23 @@ -125,8 +125,8 @@ Index: ioemu/vl.c
    9.24       } else {
    9.25  Index: ioemu/vl.h
    9.26  ===================================================================
    9.27 ---- ioemu.orig/vl.h	2006-12-08 02:02:37.000000000 +0000
    9.28 -+++ ioemu/vl.h	2006-12-08 02:02:37.000000000 +0000
    9.29 +--- ioemu.orig/vl.h	2006-12-20 15:21:52.000000000 +0000
    9.30 ++++ ioemu/vl.h	2006-12-20 15:21:52.000000000 +0000
    9.31  @@ -37,6 +37,8 @@
    9.32   #include <unistd.h>
    9.33   #include <fcntl.h>
    9.34 @@ -147,8 +147,8 @@ Index: ioemu/vl.h
    9.35   /* ide.c */
    9.36  Index: ioemu/vnc.c
    9.37  ===================================================================
    9.38 ---- ioemu.orig/vnc.c	2006-12-08 02:02:37.000000000 +0000
    9.39 -+++ ioemu/vnc.c	2006-12-08 02:02:37.000000000 +0000
    9.40 +--- ioemu.orig/vnc.c	2006-12-20 15:21:52.000000000 +0000
    9.41 ++++ ioemu/vnc.c	2006-12-20 15:21:52.000000000 +0000
    9.42  @@ -1197,9 +1197,8 @@
    9.43       }
    9.44   }
    10.1 --- a/tools/ioemu/patches/vnc-password	Wed Dec 20 15:16:13 2006 +0000
    10.2 +++ b/tools/ioemu/patches/vnc-password	Wed Dec 20 15:22:46 2006 +0000
    10.3 @@ -17,8 +17,8 @@ Signed-off-by: Masami Watanabe <masami.w
    10.4  
    10.5  Index: ioemu/Makefile.target
    10.6  ===================================================================
    10.7 ---- ioemu.orig/Makefile.target	2006-12-08 18:20:53.000000000 +0000
    10.8 -+++ ioemu/Makefile.target	2006-12-08 18:20:53.000000000 +0000
    10.9 +--- ioemu.orig/Makefile.target	2006-12-20 15:21:55.000000000 +0000
   10.10 ++++ ioemu/Makefile.target	2006-12-20 15:21:55.000000000 +0000
   10.11  @@ -407,6 +407,7 @@
   10.12   VL_OBJS+=sdl.o
   10.13   endif
   10.14 @@ -39,8 +39,8 @@ Index: ioemu/Makefile.target
   10.15   
   10.16  Index: ioemu/vl.c
   10.17  ===================================================================
   10.18 ---- ioemu.orig/vl.c	2006-12-08 18:20:52.000000000 +0000
   10.19 -+++ ioemu/vl.c	2006-12-08 18:20:53.000000000 +0000
   10.20 +--- ioemu.orig/vl.c	2006-12-20 15:21:54.000000000 +0000
   10.21 ++++ ioemu/vl.c	2006-12-20 15:21:55.000000000 +0000
   10.22  @@ -171,6 +171,9 @@
   10.23   char domain_name[1024] = { 'H','V', 'M', 'X', 'E', 'N', '-'};
   10.24   extern int domid;
   10.25 @@ -59,7 +59,7 @@ Index: ioemu/vl.c
   10.26   #ifndef CONFIG_DM
   10.27   #ifdef TARGET_PPC
   10.28       cdrom_index = 1;
   10.29 -@@ -6543,6 +6547,10 @@
   10.30 +@@ -6535,6 +6539,10 @@
   10.31   
   10.32       init_ioports();
   10.33   
   10.34 @@ -72,8 +72,8 @@ Index: ioemu/vl.c
   10.35           dumb_display_init(ds);
   10.36  Index: ioemu/vl.h
   10.37  ===================================================================
   10.38 ---- ioemu.orig/vl.h	2006-12-08 18:20:52.000000000 +0000
   10.39 -+++ ioemu/vl.h	2006-12-08 18:20:53.000000000 +0000
   10.40 +--- ioemu.orig/vl.h	2006-12-20 15:21:54.000000000 +0000
   10.41 ++++ ioemu/vl.h	2006-12-20 15:21:55.000000000 +0000
   10.42  @@ -1214,6 +1214,7 @@
   10.43   void xenstore_process_event(void *opaque);
   10.44   void xenstore_check_new_media_present(int timeout);
   10.45 @@ -92,8 +92,8 @@ Index: ioemu/vl.h
   10.46   #endif /* VL_H */
   10.47  Index: ioemu/vnc.c
   10.48  ===================================================================
   10.49 ---- ioemu.orig/vnc.c	2006-12-08 18:20:52.000000000 +0000
   10.50 -+++ ioemu/vnc.c	2006-12-08 18:20:53.000000000 +0000
   10.51 +--- ioemu.orig/vnc.c	2006-12-20 15:21:52.000000000 +0000
   10.52 ++++ ioemu/vnc.c	2006-12-20 15:21:55.000000000 +0000
   10.53  @@ -44,6 +44,7 @@
   10.54   
   10.55   #include "vnc_keysym.h"
   10.56 @@ -244,8 +244,8 @@ Index: ioemu/vnc.c
   10.57  +}
   10.58  Index: ioemu/xenstore.c
   10.59  ===================================================================
   10.60 ---- ioemu.orig/xenstore.c	2006-12-08 18:20:52.000000000 +0000
   10.61 -+++ ioemu/xenstore.c	2006-12-08 18:20:53.000000000 +0000
   10.62 +--- ioemu.orig/xenstore.c	2006-12-20 15:21:54.000000000 +0000
   10.63 ++++ ioemu/xenstore.c	2006-12-20 15:21:55.000000000 +0000
   10.64  @@ -213,3 +213,54 @@
   10.65       free(portstr);
   10.66       free(buf);
   10.67 @@ -304,7 +304,7 @@ Index: ioemu/xenstore.c
   10.68  Index: ioemu/d3des.c
   10.69  ===================================================================
   10.70  --- /dev/null	1970-01-01 00:00:00.000000000 +0000
   10.71 -+++ ioemu/d3des.c	2006-12-08 18:20:53.000000000 +0000
   10.72 ++++ ioemu/d3des.c	2006-12-20 15:21:55.000000000 +0000
   10.73  @@ -0,0 +1,434 @@
   10.74  +/*
   10.75  + * This is D3DES (V5.09) by Richard Outerbridge with the double and
   10.76 @@ -743,7 +743,7 @@ Index: ioemu/d3des.c
   10.77  Index: ioemu/d3des.h
   10.78  ===================================================================
   10.79  --- /dev/null	1970-01-01 00:00:00.000000000 +0000
   10.80 -+++ ioemu/d3des.h	2006-12-08 18:20:53.000000000 +0000
   10.81 ++++ ioemu/d3des.h	2006-12-20 15:21:55.000000000 +0000
   10.82  @@ -0,0 +1,51 @@
   10.83  +/*
   10.84  + * This is D3DES (V5.09) by Richard Outerbridge with the double and
    11.1 --- a/tools/ioemu/patches/vnc-start-vncviewer	Wed Dec 20 15:16:13 2006 +0000
    11.2 +++ b/tools/ioemu/patches/vnc-start-vncviewer	Wed Dec 20 15:22:46 2006 +0000
    11.3 @@ -1,7 +1,7 @@
    11.4  Index: ioemu/vnc.c
    11.5  ===================================================================
    11.6 ---- ioemu.orig/vnc.c	2006-12-08 02:02:36.000000000 +0000
    11.7 -+++ ioemu/vnc.c	2006-12-08 02:02:36.000000000 +0000
    11.8 +--- ioemu.orig/vnc.c	2006-12-20 15:21:51.000000000 +0000
    11.9 ++++ ioemu/vnc.c	2006-12-20 15:21:51.000000000 +0000
   11.10  @@ -1189,3 +1189,25 @@
   11.11   
   11.12       vnc_dpy_resize(vs->ds, 640, 400);
   11.13 @@ -30,8 +30,8 @@ Index: ioemu/vnc.c
   11.14  +}
   11.15  Index: ioemu/vl.c
   11.16  ===================================================================
   11.17 ---- ioemu.orig/vl.c	2006-12-08 02:02:36.000000000 +0000
   11.18 -+++ ioemu/vl.c	2006-12-08 02:02:36.000000000 +0000
   11.19 +--- ioemu.orig/vl.c	2006-12-20 15:21:51.000000000 +0000
   11.20 ++++ ioemu/vl.c	2006-12-20 15:21:51.000000000 +0000
   11.21  @@ -120,6 +120,7 @@
   11.22   int bios_size;
   11.23   static DisplayState display_state;
   11.24 @@ -82,7 +82,7 @@ Index: ioemu/vl.c
   11.25               }
   11.26           }
   11.27       }
   11.28 -@@ -6461,6 +6469,8 @@
   11.29 +@@ -6453,6 +6461,8 @@
   11.30           dumb_display_init(ds);
   11.31       } else if (vnc_display != -1) {
   11.32   	vnc_display_init(ds, vnc_display);
   11.33 @@ -93,8 +93,8 @@ Index: ioemu/vl.c
   11.34           sdl_display_init(ds, full_screen);
   11.35  Index: ioemu/vl.h
   11.36  ===================================================================
   11.37 ---- ioemu.orig/vl.h	2006-12-08 02:02:36.000000000 +0000
   11.38 -+++ ioemu/vl.h	2006-12-08 02:02:36.000000000 +0000
   11.39 +--- ioemu.orig/vl.h	2006-12-20 15:21:51.000000000 +0000
   11.40 ++++ ioemu/vl.h	2006-12-20 15:21:51.000000000 +0000
   11.41  @@ -786,6 +786,7 @@
   11.42   
   11.43   /* vnc.c */
    12.1 --- a/tools/ioemu/patches/xen-mapcache	Wed Dec 20 15:16:13 2006 +0000
    12.2 +++ b/tools/ioemu/patches/xen-mapcache	Wed Dec 20 15:22:46 2006 +0000
    12.3 @@ -15,84 +15,15 @@ Signed-off-by: Jun Nakajima <jun.nakajim
    12.4  Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
    12.5  Signed-off-by: Keir Fraser <keir@xensource.com>
    12.6  
    12.7 -diff -r 3f0ca90351e2 -r 67a06a9b7b1d tools/ioemu/target-i386-dm/cpu.h
    12.8 ---- a/tools/ioemu/target-i386-dm/cpu.h	Thu Dec 07 10:54:43 2006 +0000
    12.9 -+++ b/tools/ioemu/target-i386-dm/cpu.h	Thu Dec 07 11:12:52 2006 +0000
   12.10 -@@ -25,7 +25,8 @@
   12.11 - #ifdef TARGET_X86_64
   12.12 - #define TARGET_LONG_BITS 64
   12.13 - #else
   12.14 --#define TARGET_LONG_BITS 32
   12.15 -+/* #define TARGET_LONG_BITS 32 */
   12.16 -+#define TARGET_LONG_BITS 64 /* for Qemu map cache */
   12.17 - #endif
   12.18 - 
   12.19 - /* target supports implicit self modifying code */
   12.20 -diff -r 3f0ca90351e2 -r 67a06a9b7b1d tools/ioemu/target-i386-dm/exec-dm.c
   12.21 ---- a/tools/ioemu/target-i386-dm/exec-dm.c	Thu Dec 07 10:54:43 2006 +0000
   12.22 -+++ b/tools/ioemu/target-i386-dm/exec-dm.c	Thu Dec 07 11:12:52 2006 +0000
   12.23 -@@ -36,6 +36,7 @@
   12.24 - 
   12.25 - #include "cpu.h"
   12.26 - #include "exec-all.h"
   12.27 -+#include "vl.h"
   12.28 - 
   12.29 - //#define DEBUG_TB_INVALIDATE
   12.30 - //#define DEBUG_FLUSH
   12.31 -@@ -426,6 +427,12 @@ static inline int paddr_is_ram(target_ph
   12.32 - #endif
   12.33 +Index: ioemu/vl.c
   12.34 +===================================================================
   12.35 +--- ioemu.orig/vl.c	2006-12-20 15:12:08.000000000 +0000
   12.36 ++++ ioemu/vl.c	2006-12-20 15:13:00.000000000 +0000
   12.37 +@@ -5808,6 +5808,91 @@
   12.38 +     return 0;
   12.39   }
   12.40   
   12.41  +#if defined(__i386__) || defined(__x86_64__)
   12.42 -+#define phys_ram_addr(x) (qemu_map_cache(x))
   12.43 -+#elif defined(__ia64__)
   12.44 -+#define phys_ram_addr(x) (phys_ram_base + (x))
   12.45 -+#endif
   12.46 -+
   12.47 - void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, 
   12.48 -                             int len, int is_write)
   12.49 - {
   12.50 -@@ -438,7 +445,7 @@ void cpu_physical_memory_rw(target_phys_
   12.51 -         l = TARGET_PAGE_SIZE - (addr & ~TARGET_PAGE_MASK); 
   12.52 -         if (l > len)
   12.53 -             l = len;
   12.54 --	
   12.55 -+
   12.56 -         io_index = iomem_index(addr);
   12.57 -         if (is_write) {
   12.58 -             if (io_index) {
   12.59 -@@ -460,9 +467,10 @@ void cpu_physical_memory_rw(target_phys_
   12.60 -                 }
   12.61 -             } else if (paddr_is_ram(addr)) {
   12.62 -                 /* Reading from RAM */
   12.63 --                memcpy(phys_ram_base + addr, buf, l);
   12.64 -+                ptr = phys_ram_addr(addr);
   12.65 -+                memcpy(ptr, buf, l);
   12.66 - #ifdef __ia64__
   12.67 --                sync_icache((unsigned long)(phys_ram_base + addr), l);
   12.68 -+                sync_icache(ptr, l);
   12.69 - #endif 
   12.70 -             }
   12.71 -         } else {
   12.72 -@@ -485,7 +493,8 @@ void cpu_physical_memory_rw(target_phys_
   12.73 -                 }
   12.74 -             } else if (paddr_is_ram(addr)) {
   12.75 -                 /* Reading from RAM */
   12.76 --                memcpy(buf, phys_ram_base + addr, l);
   12.77 -+                ptr = phys_ram_addr(addr);
   12.78 -+                memcpy(buf, ptr, l);
   12.79 -             } else {
   12.80 -                 /* Neither RAM nor known MMIO space */
   12.81 -                 memset(buf, 0xff, len); 
   12.82 -diff -r 3f0ca90351e2 -r 67a06a9b7b1d tools/ioemu/vl.c
   12.83 ---- a/tools/ioemu/vl.c	Thu Dec 07 10:54:43 2006 +0000
   12.84 -+++ b/tools/ioemu/vl.c	Thu Dec 07 11:12:52 2006 +0000
   12.85 -@@ -5807,6 +5807,92 @@ int set_mm_mapping(int xc_handle, uint32
   12.86 - 
   12.87 -     return 0;
   12.88 - }
   12.89 -+
   12.90 -+#if defined(__i386__) || defined(__x86_64__)
   12.91  +static struct map_cache *mapcache_entry;
   12.92  +static unsigned long nr_buckets;
   12.93  +
   12.94 @@ -104,8 +35,8 @@ diff -r 3f0ca90351e2 -r 67a06a9b7b1d too
   12.95  +    if (nr_pages < max_pages)
   12.96  +        max_pages = nr_pages;
   12.97  +
   12.98 -+    nr_buckets = (max_pages << PAGE_SHIFT) >> MCACHE_BUCKET_SHIFT;
   12.99 -+
  12.100 ++    nr_buckets   = max_pages + (1UL << (MCACHE_BUCKET_SHIFT - PAGE_SHIFT)) - 1;
  12.101 ++    nr_buckets >>= (MCACHE_BUCKET_SHIFT - PAGE_SHIFT);
  12.102  +    fprintf(logfile, "qemu_map_cache_init nr_buckets = %lx\n", nr_buckets);
  12.103  +
  12.104  +    mapcache_entry = malloc(nr_buckets * sizeof(struct map_cache));
  12.105 @@ -141,8 +72,7 @@ diff -r 3f0ca90351e2 -r 67a06a9b7b1d too
  12.106  +
  12.107  +    entry = &mapcache_entry[address_index % nr_buckets];
  12.108  +
  12.109 -+    if (entry->vaddr_base == NULL || entry->paddr_index != address_index)
  12.110 -+    { 
  12.111 ++    if (entry->vaddr_base == NULL || entry->paddr_index != address_index) {
  12.112  +        /* We need to remap a bucket. */
  12.113  +        uint8_t *vaddr_base;
  12.114  +        unsigned long pfns[MCACHE_BUCKET_SIZE >> PAGE_SHIFT];
  12.115 @@ -177,10 +107,11 @@ diff -r 3f0ca90351e2 -r 67a06a9b7b1d too
  12.116  +    return last_address_vaddr + address_offset;
  12.117  +}
  12.118  +#endif
  12.119 - 
  12.120 ++
  12.121   int main(int argc, char **argv)
  12.122   {
  12.123 -@@ -6130,6 +6216,7 @@ int main(int argc, char **argv)
  12.124 + #ifdef CONFIG_GDBSTUB
  12.125 +@@ -6130,6 +6215,7 @@
  12.126                   break;
  12.127               case QEMU_OPTION_m:
  12.128                   ram_size = atol(optarg) * 1024 * 1024;
  12.129 @@ -188,90 +119,194 @@ diff -r 3f0ca90351e2 -r 67a06a9b7b1d too
  12.130                   if (ram_size <= 0)
  12.131                       help();
  12.132   #ifndef CONFIG_DM
  12.133 -@@ -6400,50 +6487,41 @@ int main(int argc, char **argv)
  12.134 +@@ -6404,50 +6490,41 @@
  12.135           shared_page_nr = nr_pages - 1;
  12.136   #endif
  12.137   
  12.138 -+#if defined(__i386__) || defined(__x86_64__)
  12.139 -+
  12.140 -+    if ( qemu_map_cache_init(tmp_nr_pages) )
  12.141 -+    {
  12.142 -+        fprintf(logfile, "qemu_map_cache_init returned: error %d\n", errno);
  12.143 -+        exit(-1);
  12.144 -+    }
  12.145 -+
  12.146 -+    shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
  12.147 -+                                       PROT_READ|PROT_WRITE, shared_page_nr);
  12.148 -+    if (shared_page == NULL) {
  12.149 -+        fprintf(logfile, "map shared IO page returned error %d\n", errno);
  12.150 -+        exit(-1);
  12.151 -+    }
  12.152 -+
  12.153 -+    fprintf(logfile, "shared page at pfn:%lx\n", shared_page_nr);
  12.154 -+
  12.155 -+    buffered_io_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
  12.156 -+                                            PROT_READ|PROT_WRITE,
  12.157 -+                                            shared_page_nr - 2);
  12.158 -+    if (buffered_io_page == NULL) {
  12.159 -+        fprintf(logfile, "map buffered IO page returned error %d\n", errno);
  12.160 -+        exit(-1);
  12.161 -+    }
  12.162 -+
  12.163 -+    fprintf(logfile, "buffered io page at pfn:%lx\n", shared_page_nr - 2);
  12.164 -+
  12.165 -+#elif defined(__ia64__)
  12.166 -+
  12.167 -     page_array = (xen_pfn_t *)malloc(tmp_nr_pages * sizeof(xen_pfn_t));
  12.168 -     if (page_array == NULL) {
  12.169 -         fprintf(logfile, "malloc returned error %d\n", errno);
  12.170 -         exit(-1);
  12.171 -     }
  12.172 - 
  12.173 --#if defined(__i386__) || defined(__x86_64__)
  12.174 +-    page_array = (xen_pfn_t *)malloc(tmp_nr_pages * sizeof(xen_pfn_t));
  12.175 +-    if (page_array == NULL) {
  12.176 +-        fprintf(logfile, "malloc returned error %d\n", errno);
  12.177 +-        exit(-1);
  12.178 +-    }
  12.179 +-
  12.180 + #if defined(__i386__) || defined(__x86_64__)
  12.181  -    for ( i = 0; i < tmp_nr_pages; i++)
  12.182  -        page_array[i] = i;
  12.183 --
  12.184 + 
  12.185  -    phys_ram_base = xc_map_foreign_batch(xc_handle, domid,
  12.186  -                                         PROT_READ|PROT_WRITE, page_array,
  12.187  -                                         tmp_nr_pages);
  12.188  -    if (phys_ram_base == NULL) {
  12.189  -        fprintf(logfile, "batch map guest memory returned error %d\n", errno);
  12.190 --        exit(-1);
  12.191 --    }
  12.192 --
  12.193 --    shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
  12.194 ++    if ( qemu_map_cache_init(tmp_nr_pages) )
  12.195 ++    {
  12.196 ++        fprintf(logfile, "qemu_map_cache_init returned: error %d\n", errno);
  12.197 +         exit(-1);
  12.198 +     }
  12.199 + 
  12.200 +     shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
  12.201  -                                       PROT_READ|PROT_WRITE,
  12.202  -                                       page_array[shared_page_nr]);
  12.203 --    if (shared_page == NULL) {
  12.204 --        fprintf(logfile, "map shared IO page returned error %d\n", errno);
  12.205 --        exit(-1);
  12.206 --    }
  12.207 --
  12.208 ++                                       PROT_READ|PROT_WRITE, shared_page_nr);
  12.209 +     if (shared_page == NULL) {
  12.210 +         fprintf(logfile, "map shared IO page returned error %d\n", errno);
  12.211 +         exit(-1);
  12.212 +     }
  12.213 + 
  12.214  -    fprintf(logfile, "shared page at pfn:%lx, mfn: %"PRIx64"\n",
  12.215  -            shared_page_nr, (uint64_t)(page_array[shared_page_nr]));
  12.216 --
  12.217 --    buffered_io_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
  12.218 --                                            PROT_READ|PROT_WRITE,
  12.219 ++    fprintf(logfile, "shared page at pfn:%lx\n", shared_page_nr);
  12.220 + 
  12.221 +     buffered_io_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
  12.222 +                                             PROT_READ|PROT_WRITE,
  12.223  -                                            page_array[shared_page_nr - 2]);
  12.224 --    if (buffered_io_page == NULL) {
  12.225 --        fprintf(logfile, "map buffered IO page returned error %d\n", errno);
  12.226 --        exit(-1);
  12.227 --    }
  12.228 --
  12.229 ++                                            shared_page_nr - 2);
  12.230 +     if (buffered_io_page == NULL) {
  12.231 +         fprintf(logfile, "map buffered IO page returned error %d\n", errno);
  12.232 +         exit(-1);
  12.233 +     }
  12.234 + 
  12.235  -    fprintf(logfile, "buffered io page at pfn:%lx, mfn: %"PRIx64"\n",
  12.236  -            shared_page_nr - 2, (uint64_t)(page_array[shared_page_nr - 2]));
  12.237  -
  12.238  -    free(page_array);
  12.239 --
  12.240 --#elif defined(__ia64__)
  12.241 ++    fprintf(logfile, "buffered io page at pfn:%lx\n", shared_page_nr - 2);
  12.242 + 
  12.243 + #elif defined(__ia64__)
  12.244  -  
  12.245 -     if (xc_ia64_get_pfn_list(xc_handle, domid, page_array,
  12.246 -                              IO_PAGE_START >> PAGE_SHIFT, 3) != 3) {
  12.247 -         fprintf(logfile, "xc_ia64_get_pfn_list returned error %d\n", errno);
  12.248 -diff -r 3f0ca90351e2 -r 67a06a9b7b1d tools/ioemu/vl.h
  12.249 ---- a/tools/ioemu/vl.h	Thu Dec 07 10:54:43 2006 +0000
  12.250 -+++ b/tools/ioemu/vl.h	Thu Dec 07 11:12:52 2006 +0000
  12.251 -@@ -156,6 +156,26 @@ extern void *shared_vram;
  12.252 ++
  12.253 ++    page_array = (xen_pfn_t *)malloc(tmp_nr_pages * sizeof(xen_pfn_t));
  12.254 ++    if (page_array == NULL) {
  12.255 ++        fprintf(logfile, "malloc returned error %d\n", errno);
  12.256 ++        exit(-1);
  12.257 ++    }
  12.258 ++
  12.259 +     shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
  12.260 +                                        PROT_READ|PROT_WRITE,
  12.261 +                                        IO_PAGE_START >> PAGE_SHIFT);
  12.262 +Index: ioemu/target-i386-dm/exec-dm.c
  12.263 +===================================================================
  12.264 +--- ioemu.orig/target-i386-dm/exec-dm.c	2006-12-20 15:10:13.000000000 +0000
  12.265 ++++ ioemu/target-i386-dm/exec-dm.c	2006-12-20 15:12:13.000000000 +0000
  12.266 +@@ -36,6 +36,7 @@
  12.267 + 
  12.268 + #include "cpu.h"
  12.269 + #include "exec-all.h"
  12.270 ++#include "vl.h"
  12.271 + 
  12.272 + //#define DEBUG_TB_INVALIDATE
  12.273 + //#define DEBUG_FLUSH
  12.274 +@@ -127,10 +128,28 @@
  12.275 + FILE *logfile;
  12.276 + int loglevel;
  12.277 + 
  12.278 ++
  12.279 ++#if defined(__i386__) || defined(__x86_64__)
  12.280 ++#define MAPCACHE
  12.281 ++#endif
  12.282 ++
  12.283 ++#ifdef MAPCACHE
  12.284 ++static pthread_mutex_t mapcache_mutex;
  12.285 ++#define mapcache_lock() pthread_mutex_lock(&mapcache_mutex)
  12.286 ++#define mapcache_unlock() pthread_mutex_unlock(&mapcache_mutex)
  12.287 ++#else 
  12.288 ++#define mapcache_lock() ( (void)0 )
  12.289 ++#define mapcache_unlock() ( (void)0 )
  12.290 ++#endif
  12.291 ++
  12.292 ++
  12.293 + void cpu_exec_init(CPUState *env)
  12.294 + {
  12.295 +     CPUState **penv;
  12.296 +     int cpu_index;
  12.297 ++#ifdef MAPCACHE
  12.298 ++    pthread_mutexattr_t mxattr; 
  12.299 ++#endif
  12.300 + 
  12.301 +     env->next_cpu = NULL;
  12.302 +     penv = &first_cpu;
  12.303 +@@ -144,6 +163,14 @@
  12.304 + 
  12.305 +     /* alloc dirty bits array */
  12.306 +     phys_ram_dirty = qemu_malloc(phys_ram_size >> TARGET_PAGE_BITS);
  12.307 ++
  12.308 ++#ifdef MAPCACHE
  12.309 ++    /* setup memory access mutex to protect mapcache */
  12.310 ++    pthread_mutexattr_init(&mxattr); 
  12.311 ++    pthread_mutexattr_settype(&mxattr, PTHREAD_MUTEX_RECURSIVE);
  12.312 ++    pthread_mutex_init(&mapcache_mutex, &mxattr); 
  12.313 ++    pthread_mutexattr_destroy(&mxattr); 
  12.314 ++#endif
  12.315 + }
  12.316 + 
  12.317 + /* enable or disable low levels log */
  12.318 +@@ -426,19 +453,27 @@
  12.319 + #endif
  12.320 + }
  12.321 + 
  12.322 ++#if defined(__i386__) || defined(__x86_64__)
  12.323 ++#define phys_ram_addr(x) (qemu_map_cache(x))
  12.324 ++#elif defined(__ia64__)
  12.325 ++#define phys_ram_addr(x) (phys_ram_base + (x))
  12.326 ++#endif
  12.327 ++
  12.328 + void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, 
  12.329 +                             int len, int is_write)
  12.330 + {
  12.331 +     int l, io_index;
  12.332 +     uint8_t *ptr;
  12.333 +     uint32_t val;
  12.334 +-    
  12.335 ++
  12.336 ++    mapcache_lock();
  12.337 ++
  12.338 +     while (len > 0) {
  12.339 +         /* How much can we copy before the next page boundary? */
  12.340 +         l = TARGET_PAGE_SIZE - (addr & ~TARGET_PAGE_MASK); 
  12.341 +         if (l > len)
  12.342 +             l = len;
  12.343 +-	
  12.344 ++
  12.345 +         io_index = iomem_index(addr);
  12.346 +         if (is_write) {
  12.347 +             if (io_index) {
  12.348 +@@ -460,9 +495,10 @@
  12.349 +                 }
  12.350 +             } else if (paddr_is_ram(addr)) {
  12.351 +                 /* Reading from RAM */
  12.352 +-                memcpy(phys_ram_base + addr, buf, l);
  12.353 ++                ptr = phys_ram_addr(addr);
  12.354 ++                memcpy(ptr, buf, l);
  12.355 + #ifdef __ia64__
  12.356 +-                sync_icache((unsigned long)(phys_ram_base + addr), l);
  12.357 ++                sync_icache(ptr, l);
  12.358 + #endif 
  12.359 +             }
  12.360 +         } else {
  12.361 +@@ -485,7 +521,8 @@
  12.362 +                 }
  12.363 +             } else if (paddr_is_ram(addr)) {
  12.364 +                 /* Reading from RAM */
  12.365 +-                memcpy(buf, phys_ram_base + addr, l);
  12.366 ++                ptr = phys_ram_addr(addr);
  12.367 ++                memcpy(buf, ptr, l);
  12.368 +             } else {
  12.369 +                 /* Neither RAM nor known MMIO space */
  12.370 +                 memset(buf, 0xff, len); 
  12.371 +@@ -495,6 +532,8 @@
  12.372 +         buf += l;
  12.373 +         addr += l;
  12.374 +     }
  12.375 ++
  12.376 ++    mapcache_unlock();
  12.377 + }
  12.378 + #endif
  12.379 + 
  12.380 +Index: ioemu/vl.h
  12.381 +===================================================================
  12.382 +--- ioemu.orig/vl.h	2006-12-20 15:12:08.000000000 +0000
  12.383 ++++ ioemu/vl.h	2006-12-20 15:12:13.000000000 +0000
  12.384 +@@ -156,6 +156,26 @@
  12.385   
  12.386   extern FILE *logfile;
  12.387   
  12.388 @@ -298,3 +333,17 @@ diff -r 3f0ca90351e2 -r 67a06a9b7b1d too
  12.389   extern int xc_handle;
  12.390   extern int domid;
  12.391   
  12.392 +Index: ioemu/target-i386-dm/cpu.h
  12.393 +===================================================================
  12.394 +--- ioemu.orig/target-i386-dm/cpu.h	2006-12-20 15:10:13.000000000 +0000
  12.395 ++++ ioemu/target-i386-dm/cpu.h	2006-12-20 15:12:13.000000000 +0000
  12.396 +@@ -25,7 +25,8 @@
  12.397 + #ifdef TARGET_X86_64
  12.398 + #define TARGET_LONG_BITS 64
  12.399 + #else
  12.400 +-#define TARGET_LONG_BITS 32
  12.401 ++/* #define TARGET_LONG_BITS 32 */
  12.402 ++#define TARGET_LONG_BITS 64 /* for Qemu map cache */
  12.403 + #endif
  12.404 + 
  12.405 + /* target supports implicit self modifying code */
    13.1 --- a/tools/ioemu/patches/xen-support-buffered-ioreqs	Wed Dec 20 15:16:13 2006 +0000
    13.2 +++ b/tools/ioemu/patches/xen-support-buffered-ioreqs	Wed Dec 20 15:22:46 2006 +0000
    13.3 @@ -1,7 +1,7 @@
    13.4  Index: ioemu/vl.c
    13.5  ===================================================================
    13.6 ---- ioemu.orig/vl.c	2006-12-08 02:02:37.000000000 +0000
    13.7 -+++ ioemu/vl.c	2006-12-08 02:02:37.000000000 +0000
    13.8 +--- ioemu.orig/vl.c	2006-12-20 15:21:54.000000000 +0000
    13.9 ++++ ioemu/vl.c	2006-12-20 15:21:54.000000000 +0000
   13.10  @@ -5838,6 +5838,7 @@
   13.11       unsigned long nr_pages, tmp_nr_pages, shared_page_nr;
   13.12       xen_pfn_t *page_array;
   13.13 @@ -10,7 +10,7 @@ Index: ioemu/vl.c
   13.14   
   13.15       char qemu_dm_logfilename[64];
   13.16   
   13.17 -@@ -6418,6 +6419,17 @@
   13.18 +@@ -6422,6 +6423,17 @@
   13.19       fprintf(logfile, "shared page at pfn:%lx, mfn: %"PRIx64"\n",
   13.20               shared_page_nr, (uint64_t)(page_array[shared_page_nr]));
   13.21   
   13.22 @@ -30,8 +30,8 @@ Index: ioemu/vl.c
   13.23   #elif defined(__ia64__)
   13.24  Index: ioemu/target-i386-dm/helper2.c
   13.25  ===================================================================
   13.26 ---- ioemu.orig/target-i386-dm/helper2.c	2006-12-08 02:02:35.000000000 +0000
   13.27 -+++ ioemu/target-i386-dm/helper2.c	2006-12-08 02:02:37.000000000 +0000
   13.28 +--- ioemu.orig/target-i386-dm/helper2.c	2006-12-20 15:21:47.000000000 +0000
   13.29 ++++ ioemu/target-i386-dm/helper2.c	2006-12-20 15:21:54.000000000 +0000
   13.30  @@ -76,6 +76,10 @@
   13.31   
   13.32   shared_iopage_t *shared_page = NULL;
    14.1 --- a/tools/ioemu/patches/xenstore-block-device-config	Wed Dec 20 15:16:13 2006 +0000
    14.2 +++ b/tools/ioemu/patches/xenstore-block-device-config	Wed Dec 20 15:22:46 2006 +0000
    14.3 @@ -1,7 +1,7 @@
    14.4  Index: ioemu/Makefile.target
    14.5  ===================================================================
    14.6 ---- ioemu.orig/Makefile.target	2006-12-08 02:02:36.000000000 +0000
    14.7 -+++ ioemu/Makefile.target	2006-12-08 02:02:37.000000000 +0000
    14.8 +--- ioemu.orig/Makefile.target	2006-12-20 15:21:51.000000000 +0000
    14.9 ++++ ioemu/Makefile.target	2006-12-20 15:21:53.000000000 +0000
   14.10  @@ -359,6 +359,7 @@
   14.11   VL_OBJS+= cirrus_vga.o mixeng.o parallel.o acpi.o piix_pci.o
   14.12   VL_OBJS+= usb-uhci.o
   14.13 @@ -13,7 +13,7 @@ Index: ioemu/Makefile.target
   14.14  Index: ioemu/xenstore.c
   14.15  ===================================================================
   14.16  --- /dev/null	1970-01-01 00:00:00.000000000 +0000
   14.17 -+++ ioemu/xenstore.c	2006-12-08 02:02:37.000000000 +0000
   14.18 ++++ ioemu/xenstore.c	2006-12-20 15:21:53.000000000 +0000
   14.19  @@ -0,0 +1,187 @@
   14.20  +/*
   14.21  + * This file is subject to the terms and conditions of the GNU General
   14.22 @@ -204,8 +204,8 @@ Index: ioemu/xenstore.c
   14.23  +}
   14.24  Index: ioemu/vl.c
   14.25  ===================================================================
   14.26 ---- ioemu.orig/vl.c	2006-12-08 02:02:37.000000000 +0000
   14.27 -+++ ioemu/vl.c	2006-12-08 02:02:37.000000000 +0000
   14.28 +--- ioemu.orig/vl.c	2006-12-20 15:21:52.000000000 +0000
   14.29 ++++ ioemu/vl.c	2006-12-20 15:21:53.000000000 +0000
   14.30  @@ -5256,9 +5256,11 @@
   14.31              "Standard options:\n"
   14.32              "-M machine      select emulated machine (-M ? for list)\n"
   14.33 @@ -359,7 +359,7 @@ Index: ioemu/vl.c
   14.34   
   14.35       setvbuf(stdout, NULL, _IOLBF, 0);
   14.36       
   14.37 -@@ -6441,6 +6472,7 @@
   14.38 +@@ -6433,6 +6464,7 @@
   14.39   
   14.40   #endif /* !CONFIG_DM */
   14.41   
   14.42 @@ -367,7 +367,7 @@ Index: ioemu/vl.c
   14.43       /* we always create the cdrom drive, even if no disk is there */
   14.44       bdrv_init();
   14.45       if (cdrom_index >= 0) {
   14.46 -@@ -6467,6 +6499,7 @@
   14.47 +@@ -6459,6 +6491,7 @@
   14.48               }
   14.49           }
   14.50       }
   14.51 @@ -375,7 +375,7 @@ Index: ioemu/vl.c
   14.52   
   14.53       /* we always create at least one floppy disk */
   14.54       fd_table[0] = bdrv_new("fda");
   14.55 -@@ -6545,6 +6578,8 @@
   14.56 +@@ -6537,6 +6570,8 @@
   14.57           }
   14.58       }
   14.59   
   14.60 @@ -386,8 +386,8 @@ Index: ioemu/vl.c
   14.61                     kernel_filename, kernel_cmdline, initrd_filename,
   14.62  Index: ioemu/monitor.c
   14.63  ===================================================================
   14.64 ---- ioemu.orig/monitor.c	2006-12-08 02:02:35.000000000 +0000
   14.65 -+++ ioemu/monitor.c	2006-12-08 02:02:37.000000000 +0000
   14.66 +--- ioemu.orig/monitor.c	2006-12-20 15:21:47.000000000 +0000
   14.67 ++++ ioemu/monitor.c	2006-12-20 15:21:53.000000000 +0000
   14.68  @@ -24,6 +24,7 @@
   14.69   #include "vl.h"
   14.70   #include "disas.h"
   14.71 @@ -416,8 +416,8 @@ Index: ioemu/monitor.c
   14.72       int i;
   14.73  Index: ioemu/block.c
   14.74  ===================================================================
   14.75 ---- ioemu.orig/block.c	2006-12-08 02:02:06.000000000 +0000
   14.76 -+++ ioemu/block.c	2006-12-08 02:02:37.000000000 +0000
   14.77 +--- ioemu.orig/block.c	2006-12-20 15:21:31.000000000 +0000
   14.78 ++++ ioemu/block.c	2006-12-20 15:21:53.000000000 +0000
   14.79  @@ -758,6 +758,7 @@
   14.80   static void raw_close(BlockDriverState *bs)
   14.81   {
   14.82 @@ -428,8 +428,8 @@ Index: ioemu/block.c
   14.83   
   14.84  Index: ioemu/vl.h
   14.85  ===================================================================
   14.86 ---- ioemu.orig/vl.h	2006-12-08 02:02:37.000000000 +0000
   14.87 -+++ ioemu/vl.h	2006-12-08 02:02:37.000000000 +0000
   14.88 +--- ioemu.orig/vl.h	2006-12-20 15:21:52.000000000 +0000
   14.89 ++++ ioemu/vl.h	2006-12-20 15:21:53.000000000 +0000
   14.90  @@ -1191,6 +1191,8 @@
   14.91   void term_print_help(void);
   14.92   void monitor_readline(const char *prompt, int is_password,
   14.93 @@ -455,8 +455,8 @@ Index: ioemu/vl.h
   14.94   extern char domain_name[];
   14.95  Index: ioemu/hw/ide.c
   14.96  ===================================================================
   14.97 ---- ioemu.orig/hw/ide.c	2006-12-08 02:02:35.000000000 +0000
   14.98 -+++ ioemu/hw/ide.c	2006-12-08 02:02:37.000000000 +0000
   14.99 +--- ioemu.orig/hw/ide.c	2006-12-20 15:21:49.000000000 +0000
  14.100 ++++ ioemu/hw/ide.c	2006-12-20 15:21:53.000000000 +0000
  14.101  @@ -1158,6 +1158,7 @@
  14.102           } else {
  14.103               ide_atapi_cmd_error(s, SENSE_NOT_READY, 
    15.1 --- a/tools/ioemu/patches/xenstore-write-vnc-port	Wed Dec 20 15:16:13 2006 +0000
    15.2 +++ b/tools/ioemu/patches/xenstore-write-vnc-port	Wed Dec 20 15:22:46 2006 +0000
    15.3 @@ -1,7 +1,7 @@
    15.4  Index: ioemu/xenstore.c
    15.5  ===================================================================
    15.6 ---- ioemu.orig/xenstore.c	2006-12-08 02:02:37.000000000 +0000
    15.7 -+++ ioemu/xenstore.c	2006-12-08 02:02:37.000000000 +0000
    15.8 +--- ioemu.orig/xenstore.c	2006-12-20 15:21:53.000000000 +0000
    15.9 ++++ ioemu/xenstore.c	2006-12-20 15:21:54.000000000 +0000
   15.10  @@ -185,3 +185,31 @@
   15.11       free(image);
   15.12       free(vec);
   15.13 @@ -36,9 +36,9 @@ Index: ioemu/xenstore.c
   15.14  +}
   15.15  Index: ioemu/vl.c
   15.16  ===================================================================
   15.17 ---- ioemu.orig/vl.c	2006-12-08 02:02:37.000000000 +0000
   15.18 -+++ ioemu/vl.c	2006-12-08 02:02:37.000000000 +0000
   15.19 -@@ -6535,6 +6535,7 @@
   15.20 +--- ioemu.orig/vl.c	2006-12-20 15:21:53.000000000 +0000
   15.21 ++++ ioemu/vl.c	2006-12-20 15:21:54.000000000 +0000
   15.22 +@@ -6527,6 +6527,7 @@
   15.23   	vnc_display = vnc_display_init(ds, vnc_display, vncunused, &vnclisten_addr);
   15.24   	if (vncviewer)
   15.25   	    vnc_start_viewer(vnc_display);
   15.26 @@ -48,8 +48,8 @@ Index: ioemu/vl.c
   15.27           sdl_display_init(ds, full_screen);
   15.28  Index: ioemu/vl.h
   15.29  ===================================================================
   15.30 ---- ioemu.orig/vl.h	2006-12-08 02:02:37.000000000 +0000
   15.31 -+++ ioemu/vl.h	2006-12-08 02:02:37.000000000 +0000
   15.32 +--- ioemu.orig/vl.h	2006-12-20 15:21:53.000000000 +0000
   15.33 ++++ ioemu/vl.h	2006-12-20 15:21:54.000000000 +0000
   15.34  @@ -1210,6 +1210,7 @@
   15.35   int xenstore_fd(void);
   15.36   void xenstore_process_event(void *opaque);