ia64/xen-unstable

changeset 10800:14642f36a201

Fix cirrus and rt8139 co-exist issue in new qemu-dm.
The root cause is that if two MMIO spaces are continuous, qemu may misuse
last MMIO space's read/write to handle current request.

Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author chris@kneesaa.uk.xensource.com
date Wed Jul 26 11:47:44 2006 +0100 (2006-07-26)
parents 9b7e1ea4c4d2
children f20f1e7091a4
files tools/ioemu/patches/qemu-target-i386-dm tools/ioemu/target-i386-dm/exec-dm.c
line diff
     1.1 --- a/tools/ioemu/patches/qemu-target-i386-dm	Wed Jul 26 11:34:12 2006 +0100
     1.2 +++ b/tools/ioemu/patches/qemu-target-i386-dm	Wed Jul 26 11:47:44 2006 +0100
     1.3 @@ -1,7 +1,8 @@
     1.4 -diff -r 9af27fed6713 Makefile.target
     1.5 ---- a/Makefile.target	Wed Jun 21 17:46:33 2006 +0100
     1.6 -+++ b/Makefile.target	Mon Jun 26 15:59:21 2006 +0100
     1.7 -@@ -57,6 +57,8 @@ QEMU_SYSTEM=qemu-fast
     1.8 +Index: ioemu/Makefile.target
     1.9 +===================================================================
    1.10 +--- ioemu.orig/Makefile.target	2006-07-26 11:45:57.572129351 +0100
    1.11 ++++ ioemu/Makefile.target	2006-07-26 11:45:57.589127569 +0100
    1.12 +@@ -57,6 +57,8 @@
    1.13   QEMU_SYSTEM=qemu-fast
    1.14   endif
    1.15   
    1.16 @@ -10,7 +11,7 @@ diff -r 9af27fed6713 Makefile.target
    1.17   ifdef CONFIG_USER_ONLY
    1.18   PROGS=$(QEMU_USER)
    1.19   else
    1.20 -@@ -274,6 +276,9 @@ OBJS+=gdbstub.o
    1.21 +@@ -274,6 +276,9 @@
    1.22   OBJS+=gdbstub.o
    1.23   endif
    1.24   
    1.25 @@ -20,7 +21,7 @@ diff -r 9af27fed6713 Makefile.target
    1.26   all: $(PROGS)
    1.27   
    1.28   $(QEMU_USER): $(OBJS)
    1.29 -@@ -328,7 +333,7 @@ ifeq ($(TARGET_BASE_ARCH), i386)
    1.30 +@@ -328,7 +333,7 @@
    1.31   ifeq ($(TARGET_BASE_ARCH), i386)
    1.32   # Hardware support
    1.33   VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
    1.34 @@ -29,10 +30,11 @@ diff -r 9af27fed6713 Makefile.target
    1.35   VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o
    1.36   DEFINES += -DHAS_AUDIO
    1.37   endif
    1.38 -diff -r 9af27fed6713 configure
    1.39 ---- a/configure	Wed Jun 21 17:46:33 2006 +0100
    1.40 -+++ b/configure	Mon Jun 26 15:59:21 2006 +0100
    1.41 -@@ -359,6 +359,8 @@ if test -z "$target_list" ; then
    1.42 +Index: ioemu/configure
    1.43 +===================================================================
    1.44 +--- ioemu.orig/configure	2006-07-26 11:45:57.573129246 +0100
    1.45 ++++ ioemu/configure	2006-07-26 11:45:57.590127464 +0100
    1.46 +@@ -359,6 +359,8 @@
    1.47       if [ "$user" = "yes" ] ; then
    1.48           target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user $target_list"
    1.49       fi
    1.50 @@ -41,10 +43,11 @@ diff -r 9af27fed6713 configure
    1.51   else
    1.52       target_list=`echo "$target_list" | sed -e 's/,/ /g'`
    1.53   fi
    1.54 -diff -r 9af27fed6713 monitor.c
    1.55 ---- a/monitor.c	Wed Jun 21 17:46:33 2006 +0100
    1.56 -+++ b/monitor.c	Mon Jun 26 15:59:21 2006 +0100
    1.57 -@@ -1142,6 +1142,10 @@ static term_cmd_t info_cmds[] = {
    1.58 +Index: ioemu/monitor.c
    1.59 +===================================================================
    1.60 +--- ioemu.orig/monitor.c	2006-07-26 11:45:57.576128931 +0100
    1.61 ++++ ioemu/monitor.c	2006-07-26 11:45:57.591127359 +0100
    1.62 +@@ -1142,6 +1142,10 @@
    1.63         "", "show host USB devices", },
    1.64       { "profile", "", do_info_profile,
    1.65         "", "show profiling information", },
    1.66 @@ -55,9 +58,10 @@ diff -r 9af27fed6713 monitor.c
    1.67       { NULL, NULL, },
    1.68   };
    1.69   
    1.70 -diff -r 9af27fed6713 vl.c
    1.71 ---- a/vl.c	Wed Jun 21 17:46:33 2006 +0100
    1.72 -+++ b/vl.c	Mon Jun 26 15:59:21 2006 +0100
    1.73 +Index: ioemu/vl.c
    1.74 +===================================================================
    1.75 +--- ioemu.orig/vl.c	2006-07-26 11:45:57.579128617 +0100
    1.76 ++++ ioemu/vl.c	2006-07-26 11:45:57.593127149 +0100
    1.77  @@ -87,7 +87,7 @@
    1.78   
    1.79   #include "exec-all.h"
    1.80 @@ -67,7 +71,7 @@ diff -r 9af27fed6713 vl.c
    1.81   
    1.82   //#define DEBUG_UNUSED_IOPORT
    1.83   //#define DEBUG_IOPORT
    1.84 -@@ -4382,7 +4382,7 @@ typedef struct QEMUResetEntry {
    1.85 +@@ -4382,7 +4382,7 @@
    1.86   
    1.87   static QEMUResetEntry *first_reset_entry;
    1.88   static int reset_requested;
    1.89 @@ -76,7 +80,7 @@ diff -r 9af27fed6713 vl.c
    1.90   static int powerdown_requested;
    1.91   
    1.92   void qemu_register_reset(QEMUResetHandler *func, void *opaque)
    1.93 -@@ -4534,6 +4534,7 @@ void main_loop_wait(int timeout)
    1.94 +@@ -4534,6 +4534,7 @@
    1.95                       qemu_get_clock(rt_clock));
    1.96   }
    1.97   
    1.98 @@ -84,7 +88,7 @@ diff -r 9af27fed6713 vl.c
    1.99   static CPUState *cur_cpu;
   1.100   
   1.101   int main_loop(void)
   1.102 -@@ -4608,6 +4609,7 @@ int main_loop(void)
   1.103 +@@ -4608,6 +4609,7 @@
   1.104       cpu_disable_ticks();
   1.105       return ret;
   1.106   }
   1.107 @@ -92,9 +96,10 @@ diff -r 9af27fed6713 vl.c
   1.108   
   1.109   void help(void)
   1.110   {
   1.111 -diff -r 9af27fed6713 vl.h
   1.112 ---- a/vl.h	Wed Jun 21 17:46:33 2006 +0100
   1.113 -+++ b/vl.h	Mon Jun 26 15:59:21 2006 +0100
   1.114 +Index: ioemu/vl.h
   1.115 +===================================================================
   1.116 +--- ioemu.orig/vl.h	2006-07-26 11:45:39.289045710 +0100
   1.117 ++++ ioemu/vl.h	2006-07-26 11:45:57.594127044 +0100
   1.118  @@ -38,6 +38,8 @@
   1.119   #include <fcntl.h>
   1.120   #include <sys/stat.h>
   1.121 @@ -104,19 +109,19 @@ diff -r 9af27fed6713 vl.h
   1.122   
   1.123   #ifndef O_LARGEFILE
   1.124   #define O_LARGEFILE 0
   1.125 -@@ -130,6 +132,11 @@ void qemu_system_powerdown(void);
   1.126 - #endif
   1.127 +@@ -131,6 +133,11 @@
   1.128   
   1.129   void main_loop_wait(int timeout);
   1.130 -+
   1.131 + 
   1.132  +extern FILE *logfile;
   1.133  +
   1.134  +extern int xc_handle;
   1.135  +extern int domid;
   1.136 - 
   1.137 ++
   1.138   extern int ram_size;
   1.139   extern int bios_size;
   1.140 -@@ -814,6 +821,7 @@ uint32_t pic_intack_read(PicState2 *s);
   1.141 + extern int rtc_utc;
   1.142 +@@ -814,6 +821,7 @@
   1.143   uint32_t pic_intack_read(PicState2 *s);
   1.144   void pic_info(void);
   1.145   void irq_info(void);
   1.146 @@ -124,9 +129,10 @@ diff -r 9af27fed6713 vl.h
   1.147   
   1.148   /* APIC */
   1.149   typedef struct IOAPICState IOAPICState;
   1.150 -diff -r 9af27fed6713 target-i386-dm/cpu.h
   1.151 ---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   1.152 -+++ b/target-i386-dm/cpu.h	Mon Jun 26 15:59:21 2006 +0100
   1.153 +Index: ioemu/target-i386-dm/cpu.h
   1.154 +===================================================================
   1.155 +--- /dev/null	1970-01-01 00:00:00.000000000 +0000
   1.156 ++++ ioemu/target-i386-dm/cpu.h	2006-07-26 11:45:57.594127044 +0100
   1.157  @@ -0,0 +1,86 @@
   1.158  +/*
   1.159  + * i386 virtual CPU header
   1.160 @@ -214,9 +220,10 @@ diff -r 9af27fed6713 target-i386-dm/cpu.
   1.161  +#include "cpu-all.h"
   1.162  +
   1.163  +#endif /* CPU_I386_H */
   1.164 -diff -r 9af27fed6713 target-i386-dm/exec-dm.c
   1.165 ---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   1.166 -+++ b/target-i386-dm/exec-dm.c	Mon Jun 26 15:59:21 2006 +0100
   1.167 +Index: ioemu/target-i386-dm/exec-dm.c
   1.168 +===================================================================
   1.169 +--- /dev/null	1970-01-01 00:00:00.000000000 +0000
   1.170 ++++ ioemu/target-i386-dm/exec-dm.c	2006-07-26 11:46:01.059763730 +0100
   1.171  @@ -0,0 +1,512 @@
   1.172  +/*
   1.173  + *  virtual page mapping and translated block handling
   1.174 @@ -602,7 +609,7 @@ diff -r 9af27fed6713 target-i386-dm/exec
   1.175  +                start = mmio[i].start;
   1.176  +                end = mmio[i].start + mmio[i].size;
   1.177  +
   1.178 -+                if ((addr >= start) && (addr <= end)){
   1.179 ++                if ((addr >= start) && (addr < end)){
   1.180  +                        return (mmio[i].io_index >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);
   1.181  +                }
   1.182  +        }
   1.183 @@ -730,9 +737,10 @@ diff -r 9af27fed6713 target-i386-dm/exec
   1.184  +
   1.185  +	return;
   1.186  +}
   1.187 -diff -r 9af27fed6713 target-i386-dm/helper2.c
   1.188 ---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   1.189 -+++ b/target-i386-dm/helper2.c	Mon Jun 26 15:59:21 2006 +0100
   1.190 +Index: ioemu/target-i386-dm/helper2.c
   1.191 +===================================================================
   1.192 +--- /dev/null	1970-01-01 00:00:00.000000000 +0000
   1.193 ++++ ioemu/target-i386-dm/helper2.c	2006-07-26 11:45:57.596126835 +0100
   1.194  @@ -0,0 +1,464 @@
   1.195  +/*
   1.196  + *  i386 helpers (without register variable usage)
   1.197 @@ -1198,9 +1206,10 @@ diff -r 9af27fed6713 target-i386-dm/help
   1.198  +    }
   1.199  +    return 0;
   1.200  +}
   1.201 -diff -r 9af27fed6713 target-i386-dm/i8259-dm.c
   1.202 ---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   1.203 -+++ b/target-i386-dm/i8259-dm.c	Mon Jun 26 15:59:21 2006 +0100
   1.204 +Index: ioemu/target-i386-dm/i8259-dm.c
   1.205 +===================================================================
   1.206 +--- /dev/null	1970-01-01 00:00:00.000000000 +0000
   1.207 ++++ ioemu/target-i386-dm/i8259-dm.c	2006-07-26 11:45:57.596126835 +0100
   1.208  @@ -0,0 +1,107 @@
   1.209  +/* Xen 8259 stub for interrupt controller emulation
   1.210  + * 
   1.211 @@ -1309,18 +1318,20 @@ diff -r 9af27fed6713 target-i386-dm/i825
   1.212  +                          void *alt_irq_opaque)
   1.213  +{
   1.214  +}
   1.215 -diff -r 9af27fed6713 target-i386-dm/qemu-dm.debug
   1.216 ---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   1.217 -+++ b/target-i386-dm/qemu-dm.debug	Mon Jun 26 15:59:21 2006 +0100
   1.218 +Index: ioemu/target-i386-dm/qemu-dm.debug
   1.219 +===================================================================
   1.220 +--- /dev/null	1970-01-01 00:00:00.000000000 +0000
   1.221 ++++ ioemu/target-i386-dm/qemu-dm.debug	2006-07-26 11:45:57.596126835 +0100
   1.222  @@ -0,0 +1,5 @@
   1.223  +#!/bin/sh
   1.224  +
   1.225  +echo $* > /tmp/args
   1.226  +echo $DISPLAY >> /tmp/args
   1.227  +exec /usr/lib/xen/bin/qemu-dm $*
   1.228 -diff -r 9af27fed6713 target-i386-dm/qemu-ifup
   1.229 ---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   1.230 -+++ b/target-i386-dm/qemu-ifup	Mon Jun 26 15:59:21 2006 +0100
   1.231 +Index: ioemu/target-i386-dm/qemu-ifup
   1.232 +===================================================================
   1.233 +--- /dev/null	1970-01-01 00:00:00.000000000 +0000
   1.234 ++++ ioemu/target-i386-dm/qemu-ifup	2006-07-26 11:45:57.597126730 +0100
   1.235  @@ -0,0 +1,10 @@
   1.236  +#!/bin/sh
   1.237  +
     2.1 --- a/tools/ioemu/target-i386-dm/exec-dm.c	Wed Jul 26 11:34:12 2006 +0100
     2.2 +++ b/tools/ioemu/target-i386-dm/exec-dm.c	Wed Jul 26 11:47:44 2006 +0100
     2.3 @@ -382,7 +382,7 @@ int iomem_index(target_phys_addr_t addr)
     2.4                  start = mmio[i].start;
     2.5                  end = mmio[i].start + mmio[i].size;
     2.6  
     2.7 -                if ((addr >= start) && (addr <= end)){
     2.8 +                if ((addr >= start) && (addr < end)){
     2.9                          return (mmio[i].io_index >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);
    2.10                  }
    2.11          }