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

[Xen-changelog] [xen-unstable] [qemu] Fix HVM guests with more than 2G RAM on x86_64,



# HG changeset patch
# User chris@xxxxxxxxxxxxxxxxxxxxxxxx
# Node ID f20f1e7091a416a7aff644c4aa8fbd025d3f632a
# Parent  14642f36a201af34b62169dce69ba92e94cff9ee
[qemu] Fix HVM guests with more than 2G RAM on x86_64,
where "startx" will cause qemu dm to die.

Signed-off-by: Xin Li <xin.b.li@xxxxxxxxx>
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxxx>
---
 tools/ioemu/hw/vga.c                  |    3 -
 tools/ioemu/patches/domain-timeoffset |    8 +--
 tools/ioemu/patches/qemu-64bit        |   49 +++++++++++++++--------
 tools/ioemu/patches/shadow-vram       |   16 ++++---
 tools/ioemu/patches/shared-vram       |   71 +++++++++++++++++-----------------
 5 files changed, 84 insertions(+), 63 deletions(-)

diff -r 14642f36a201 -r f20f1e7091a4 tools/ioemu/hw/vga.c
--- a/tools/ioemu/hw/vga.c      Wed Jul 26 11:47:44 2006 +0100
+++ b/tools/ioemu/hw/vga.c      Wed Jul 26 13:23:05 2006 +0100
@@ -1392,7 +1392,8 @@ static void vga_draw_graphic(VGAState *s
 static void vga_draw_graphic(VGAState *s, int full_update)
 {
     int y1, y, update, page_min, page_max, linesize, y_start, double_scan, 
mask;
-    int width, height, shift_control, line_offset, page0, page1, bwidth;
+    int width, height, shift_control, line_offset, bwidth;
+    ram_addr_t page0, page1;
     int disp_width, multi_scan, multi_run;
     uint8_t *d;
     uint32_t v, addr1, addr;
diff -r 14642f36a201 -r f20f1e7091a4 tools/ioemu/patches/domain-timeoffset
--- a/tools/ioemu/patches/domain-timeoffset     Wed Jul 26 11:47:44 2006 +0100
+++ b/tools/ioemu/patches/domain-timeoffset     Wed Jul 26 13:23:05 2006 +0100
@@ -1,7 +1,7 @@ Index: ioemu/hw/mc146818rtc.c
 Index: ioemu/hw/mc146818rtc.c
 ===================================================================
---- ioemu.orig/hw/mc146818rtc.c        2006-07-14 15:55:55.450963213 +0100
-+++ ioemu/hw/mc146818rtc.c     2006-07-14 15:56:02.195195680 +0100
+--- ioemu.orig/hw/mc146818rtc.c        2006-07-26 13:18:13.783025944 +0100
++++ ioemu/hw/mc146818rtc.c     2006-07-26 13:20:34.934314196 +0100
 @@ -178,10 +178,27 @@
      }
  }
@@ -46,8 +46,8 @@ Index: ioemu/hw/mc146818rtc.c
  static void rtc_copy_date(RTCState *s)
 Index: ioemu/hw/pc.c
 ===================================================================
---- ioemu.orig/hw/pc.c 2006-07-14 15:56:01.774243586 +0100
-+++ ioemu/hw/pc.c      2006-07-14 15:56:02.196195566 +0100
+--- ioemu.orig/hw/pc.c 2006-07-26 13:20:34.463363339 +0100
++++ ioemu/hw/pc.c      2006-07-26 13:20:34.935314092 +0100
 @@ -151,7 +151,7 @@
  }
  
@@ -117,8 +117,8 @@ Index: ioemu/hw/pc.c
  QEMUMachine pc_machine = {
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-07-14 15:56:02.010216731 +0100
-+++ ioemu/vl.c 2006-07-14 15:56:02.198195338 +0100
+--- ioemu.orig/vl.c    2006-07-26 13:20:34.812326925 +0100
++++ ioemu/vl.c 2006-07-26 13:20:34.937313883 +0100
 @@ -164,6 +164,8 @@
  
  int xc_handle;
@@ -174,8 +174,8 @@ Index: ioemu/vl.c
      qemu_mod_timer(gui_timer, qemu_get_clock(rt_clock));
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-07-14 15:56:01.779243017 +0100
-+++ ioemu/vl.h 2006-07-14 15:56:02.199195224 +0100
+--- ioemu.orig/vl.h    2006-07-26 13:20:34.467362921 +0100
++++ ioemu/vl.h 2006-07-26 13:20:34.938313779 +0100
 @@ -556,7 +556,7 @@
                                   int boot_device,
               DisplayState *ds, const char **fd_filename, int snapshot,
diff -r 14642f36a201 -r f20f1e7091a4 tools/ioemu/patches/qemu-64bit
--- a/tools/ioemu/patches/qemu-64bit    Wed Jul 26 11:47:44 2006 +0100
+++ b/tools/ioemu/patches/qemu-64bit    Wed Jul 26 13:23:05 2006 +0100
@@ -1,7 +1,8 @@ diff -r 2b3e57b3e1ec cpu-all.h
-diff -r 2b3e57b3e1ec cpu-all.h
---- a/cpu-all.h        Mon Jun 26 15:16:39 2006 +0100
-+++ b/cpu-all.h        Mon Jun 26 15:16:44 2006 +0100
-@@ -822,7 +822,7 @@ int cpu_inl(CPUState *env, int addr);
+Index: ioemu/cpu-all.h
+===================================================================
+--- ioemu.orig/cpu-all.h       2006-07-26 13:19:49.515051864 +0100
++++ ioemu/cpu-all.h    2006-07-26 13:19:49.563046860 +0100
+@@ -822,7 +822,7 @@
  
  /* memory API */
  
@@ -10,10 +11,11 @@ diff -r 2b3e57b3e1ec cpu-all.h
  extern int phys_ram_fd;
  extern uint8_t *phys_ram_base;
  extern uint8_t *phys_ram_dirty;
-diff -r 2b3e57b3e1ec hw/pc.c
---- a/hw/pc.c  Mon Jun 26 15:16:39 2006 +0100
-+++ b/hw/pc.c  Mon Jun 26 15:16:44 2006 +0100
-@@ -147,7 +147,7 @@ static void cmos_init_hd(int type_ofs, i
+Index: ioemu/hw/pc.c
+===================================================================
+--- ioemu.orig/hw/pc.c 2006-07-26 13:19:49.516051760 +0100
++++ ioemu/hw/pc.c      2006-07-26 13:19:49.564046755 +0100
+@@ -147,7 +147,7 @@
  }
  
  /* hd_table must contain 4 block drivers */
@@ -22,7 +24,7 @@ diff -r 2b3e57b3e1ec hw/pc.c
  {
      RTCState *s = rtc_state;
      int val;
-@@ -604,7 +604,7 @@ static void pc_init_ne2k_isa(NICInfo *nd
+@@ -604,7 +604,7 @@
  }
  
  /* PC hardware initialisation */
@@ -31,7 +33,7 @@ diff -r 2b3e57b3e1ec hw/pc.c
                       DisplayState *ds, const char **fd_filename, int snapshot,
                       const char *kernel_filename, const char *kernel_cmdline,
                       const char *initrd_filename,
-@@ -853,7 +853,7 @@ static void pc_init1(int ram_size, int v
+@@ -853,7 +853,7 @@
      }
  }
  
@@ -40,7 +42,7 @@ diff -r 2b3e57b3e1ec hw/pc.c
                          DisplayState *ds, const char **fd_filename, 
                          int snapshot, 
                          const char *kernel_filename, 
-@@ -866,7 +866,7 @@ static void pc_init_pci(int ram_size, in
+@@ -866,7 +866,7 @@
               initrd_filename, 1);
  }
  
@@ -49,10 +51,11 @@ diff -r 2b3e57b3e1ec hw/pc.c
                          DisplayState *ds, const char **fd_filename, 
                          int snapshot, 
                          const char *kernel_filename, 
-diff -r 2b3e57b3e1ec vl.c
---- a/vl.c     Mon Jun 26 15:16:39 2006 +0100
-+++ b/vl.c     Mon Jun 26 15:16:44 2006 +0100
-@@ -123,7 +123,7 @@ const char* keyboard_layout = NULL;
+Index: ioemu/vl.c
+===================================================================
+--- ioemu.orig/vl.c    2006-07-26 13:19:49.552048007 +0100
++++ ioemu/vl.c 2006-07-26 13:19:49.566046547 +0100
+@@ -123,7 +123,7 @@
  const char* keyboard_layout = NULL;
  int64_t ticks_per_sec;
  int boot_device = 'c';
@@ -61,7 +64,7 @@ diff -r 2b3e57b3e1ec vl.c
  int pit_min_timer_count = 0;
  int nb_nics;
  NICInfo nd_table[MAX_NICS];
-@@ -5320,7 +5320,7 @@ int main(int argc, char **argv)
+@@ -5320,7 +5320,7 @@
                  help();
                  break;
              case QEMU_OPTION_m:
@@ -70,10 +73,11 @@ diff -r 2b3e57b3e1ec vl.c
                  if (ram_size <= 0)
                      help();
                  if (ram_size > PHYS_RAM_MAX_SIZE) {
-diff -r 2b3e57b3e1ec vl.h
---- a/vl.h     Mon Jun 26 15:16:39 2006 +0100
-+++ b/vl.h     Mon Jun 26 15:16:44 2006 +0100
-@@ -138,7 +138,7 @@ extern int xc_handle;
+Index: ioemu/vl.h
+===================================================================
+--- ioemu.orig/vl.h    2006-07-26 13:19:49.552048007 +0100
++++ ioemu/vl.h 2006-07-26 13:19:49.567046443 +0100
+@@ -138,7 +138,7 @@
  extern int xc_handle;
  extern int domid;
  
@@ -82,7 +86,7 @@ diff -r 2b3e57b3e1ec vl.h
  extern int bios_size;
  extern int rtc_utc;
  extern int cirrus_vga_enabled;
-@@ -542,7 +542,7 @@ int qcow_compress_cluster(BlockDriverSta
+@@ -542,7 +542,7 @@
  
  #ifndef QEMU_TOOL
  
@@ -91,3 +95,17 @@ diff -r 2b3e57b3e1ec vl.h
                                   int boot_device,
               DisplayState *ds, const char **fd_filename, int snapshot,
               const char *kernel_filename, const char *kernel_cmdline,
+Index: ioemu/hw/vga.c
+===================================================================
+--- ioemu.orig/hw/vga.c        2006-07-26 13:19:49.549048319 +0100
++++ ioemu/hw/vga.c     2006-07-26 13:20:17.956085603 +0100
+@@ -1293,7 +1293,8 @@
+ static void vga_draw_graphic(VGAState *s, int full_update)
+ {
+     int y1, y, update, page_min, page_max, linesize, y_start, double_scan, 
mask;
+-    int width, height, shift_control, line_offset, page0, page1, bwidth;
++    int width, height, shift_control, line_offset, bwidth;
++    ram_addr_t page0, page1;
+     int disp_width, multi_scan, multi_run;
+     uint8_t *d;
+     uint32_t v, addr1, addr;
diff -r 14642f36a201 -r f20f1e7091a4 tools/ioemu/patches/shadow-vram
--- a/tools/ioemu/patches/shadow-vram   Wed Jul 26 11:47:44 2006 +0100
+++ b/tools/ioemu/patches/shadow-vram   Wed Jul 26 13:23:05 2006 +0100
@@ -1,7 +1,8 @@ diff -r 0ef2ae12258c hw/vga.c
-diff -r 0ef2ae12258c hw/vga.c
---- a/hw/vga.c Mon Jun 26 16:07:22 2006 +0100
-+++ b/hw/vga.c Tue Jun 27 09:42:44 2006 +0100
-@@ -1287,6 +1287,105 @@ void vga_invalidate_scanlines(VGAState *
+Index: ioemu/hw/vga.c
+===================================================================
+--- ioemu.orig/hw/vga.c        2006-07-26 13:20:34.464363234 +0100
++++ ioemu/hw/vga.c     2006-07-26 13:20:34.660342784 +0100
+@@ -1287,6 +1287,105 @@
      }
  }
  
@@ -107,7 +108,7 @@ diff -r 0ef2ae12258c hw/vga.c
  /* 
   * graphic modes
   */
-@@ -1381,6 +1480,11 @@ static void vga_draw_graphic(VGAState *s
+@@ -1382,6 +1481,11 @@
      printf("w=%d h=%d v=%d line_offset=%d cr[0x09]=0x%02x cr[0x17]=0x%02x 
linecmp=%d sr[0x01]=0x%02x\n",
             width, height, v, line_offset, s->cr[9], s->cr[0x17], 
s->line_compare, s->sr[0x01]);
  #endif
@@ -119,7 +120,7 @@ diff -r 0ef2ae12258c hw/vga.c
      addr1 = (s->start_addr * 4);
      bwidth = width * 4;
      y_start = -1;
-@@ -1699,6 +1803,14 @@ void vga_common_init(VGAState *s, Displa
+@@ -1700,6 +1804,14 @@
  
      vga_reset(s);
  
@@ -134,9 +135,10 @@ diff -r 0ef2ae12258c hw/vga.c
      s->vram_ptr = qemu_malloc(vga_ram_size);
      s->vram_offset = vga_ram_offset;
      s->vram_size = vga_ram_size;
-diff -r 0ef2ae12258c hw/vga_int.h
---- a/hw/vga_int.h     Mon Jun 26 16:07:22 2006 +0100
-+++ b/hw/vga_int.h     Tue Jun 27 09:42:44 2006 +0100
+Index: ioemu/hw/vga_int.h
+===================================================================
+--- ioemu.orig/hw/vga_int.h    2006-07-26 13:20:34.464363234 +0100
++++ ioemu/hw/vga_int.h 2006-07-26 13:20:34.661342680 +0100
 @@ -76,6 +76,7 @@
  
  #define VGA_STATE_COMMON                                                \
diff -r 14642f36a201 -r f20f1e7091a4 tools/ioemu/patches/shared-vram
--- a/tools/ioemu/patches/shared-vram   Wed Jul 26 11:47:44 2006 +0100
+++ b/tools/ioemu/patches/shared-vram   Wed Jul 26 13:23:05 2006 +0100
@@ -1,6 +1,7 @@ diff -r 62e05863ec04 hw/cirrus_vga.c
-diff -r 62e05863ec04 hw/cirrus_vga.c
---- a/hw/cirrus_vga.c  Mon Jun 26 15:18:40 2006 +0100
-+++ b/hw/cirrus_vga.c  Mon Jun 26 15:19:40 2006 +0100
+Index: ioemu/hw/cirrus_vga.c
+===================================================================
+--- ioemu.orig/hw/cirrus_vga.c 2006-07-26 13:18:13.906013141 +0100
++++ ioemu/hw/cirrus_vga.c      2006-07-26 13:20:34.462363443 +0100
 @@ -28,6 +28,9 @@
   */
  #include "vl.h"
@@ -11,7 +12,7 @@ diff -r 62e05863ec04 hw/cirrus_vga.c
  
  /*
   * TODO:
-@@ -231,6 +234,8 @@ typedef struct CirrusVGAState {
+@@ -231,6 +234,8 @@
      int cirrus_linear_io_addr;
      int cirrus_linear_bitblt_io_addr;
      int cirrus_mmio_io_addr;
@@ -20,7 +21,7 @@ diff -r 62e05863ec04 hw/cirrus_vga.c
      uint32_t cirrus_addr_mask;
      uint32_t linear_mmio_mask;
      uint8_t cirrus_shadow_gr0;
-@@ -267,6 +272,8 @@ typedef struct CirrusVGAState {
+@@ -267,6 +272,8 @@
      int last_hw_cursor_y_end;
      int real_vram_size; /* XXX: suppress that */
      CPUWriteMemoryFunc **cirrus_linear_write;
@@ -29,7 +30,7 @@ diff -r 62e05863ec04 hw/cirrus_vga.c
  } CirrusVGAState;
  
  typedef struct PCICirrusVGAState {
-@@ -276,6 +283,8 @@ typedef struct PCICirrusVGAState {
+@@ -276,6 +283,8 @@
  
  static uint8_t rop_to_index[256];
      
@@ -38,7 +39,7 @@ diff -r 62e05863ec04 hw/cirrus_vga.c
  /***************************************
   *
   *  prototypes.
-@@ -2520,6 +2529,80 @@ static CPUWriteMemoryFunc *cirrus_linear
+@@ -2520,6 +2529,80 @@
      cirrus_linear_bitblt_writel,
  };
  
@@ -119,7 +120,7 @@ diff -r 62e05863ec04 hw/cirrus_vga.c
  /* Compute the memory access functions */
  static void cirrus_update_memory_access(CirrusVGAState *s)
  {
-@@ -2538,11 +2621,39 @@ static void cirrus_update_memory_access(
+@@ -2538,11 +2621,39 @@
          
        mode = s->gr[0x05] & 0x7;
        if (mode < 4 || mode > 5 || ((s->gr[0x0B] & 0x4) == 0)) {
@@ -159,7 +160,7 @@ diff -r 62e05863ec04 hw/cirrus_vga.c
              s->cirrus_linear_write[0] = cirrus_linear_writeb;
              s->cirrus_linear_write[1] = cirrus_linear_writew;
              s->cirrus_linear_write[2] = cirrus_linear_writel;
-@@ -3136,6 +3247,13 @@ static void cirrus_pci_lfb_map(PCIDevice
+@@ -3136,6 +3247,13 @@
      /* XXX: add byte swapping apertures */
      cpu_register_physical_memory(addr, s->vram_size,
                                 s->cirrus_linear_io_addr);
@@ -173,10 +174,11 @@ diff -r 62e05863ec04 hw/cirrus_vga.c
      cpu_register_physical_memory(addr + 0x1000000, 0x400000,
                                 s->cirrus_linear_bitblt_io_addr);
  }
-diff -r 62e05863ec04 hw/pc.c
---- a/hw/pc.c  Mon Jun 26 15:18:40 2006 +0100
-+++ b/hw/pc.c  Mon Jun 26 15:19:40 2006 +0100
-@@ -783,14 +783,14 @@ static void pc_init1(uint64_t ram_size, 
+Index: ioemu/hw/pc.c
+===================================================================
+--- ioemu.orig/hw/pc.c 2006-07-26 13:20:34.396370329 +0100
++++ ioemu/hw/pc.c      2006-07-26 13:20:34.463363339 +0100
+@@ -783,14 +783,14 @@
      if (cirrus_vga_enabled) {
          if (pci_enabled) {
              pci_cirrus_vga_init(pci_bus, 
@@ -194,10 +196,11 @@ diff -r 62e05863ec04 hw/pc.c
                         vga_ram_size, 0, 0);
      }
  
-diff -r 62e05863ec04 hw/vga.c
---- a/hw/vga.c Mon Jun 26 15:18:40 2006 +0100
-+++ b/hw/vga.c Mon Jun 26 15:19:40 2006 +0100
-@@ -1668,6 +1668,7 @@ static void vga_map(PCIDevice *pci_dev, 
+Index: ioemu/hw/vga.c
+===================================================================
+--- ioemu.orig/hw/vga.c        2006-07-26 13:20:33.293485412 +0100
++++ ioemu/hw/vga.c     2006-07-26 13:20:34.464363234 +0100
+@@ -1669,6 +1669,7 @@
      }
  }
  
@@ -205,7 +208,7 @@ diff -r 62e05863ec04 hw/vga.c
  void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base, 
                       unsigned long vga_ram_offset, int vga_ram_size)
  {
-@@ -1698,7 +1699,7 @@ void vga_common_init(VGAState *s, Displa
+@@ -1699,7 +1700,7 @@
  
      vga_reset(s);
  
@@ -214,12 +217,10 @@ diff -r 62e05863ec04 hw/vga.c
      s->vram_offset = vga_ram_offset;
      s->vram_size = vga_ram_size;
      s->ds = ds;
-@@ -1808,6 +1809,31 @@ int vga_initialize(PCIBus *bus, DisplayS
- #endif
-     }
+@@ -1811,6 +1812,31 @@
      return 0;
-+}
-+
+ }
+ 
 +void *vga_update_vram(VGAState *s, void *vga_ram_base, int vga_ram_size)
 +{
 +    uint8_t *old_pointer;
@@ -243,27 +244,30 @@ diff -r 62e05863ec04 hw/vga.c
 +    s->vram_ptr = vga_ram_base;
 +
 +    return old_pointer;
- }
- 
++}
++
  /********************************************************/
-diff -r 62e05863ec04 hw/vga_int.h
---- a/hw/vga_int.h     Mon Jun 26 15:18:40 2006 +0100
-+++ b/hw/vga_int.h     Mon Jun 26 15:19:40 2006 +0100
-@@ -166,5 +166,6 @@ void vga_draw_cursor_line_32(uint8_t *d1
+ /* vga screen dump */
+ 
+Index: ioemu/hw/vga_int.h
+===================================================================
+--- ioemu.orig/hw/vga_int.h    2006-07-26 13:20:33.063509409 +0100
++++ ioemu/hw/vga_int.h 2006-07-26 13:20:34.464363234 +0100
+@@ -166,5 +166,6 @@
                               unsigned int color0, unsigned int color1,
                               unsigned int color_xor);
  
 +void *vga_update_vram(VGAState *s, void *vga_ram_base, int vga_ram_size);
  extern const uint8_t sr_mask[8];
  extern const uint8_t gr_mask[16];
-diff -r 62e05863ec04 vl.c
---- a/vl.c     Mon Jun 26 15:18:40 2006 +0100
-+++ b/vl.c     Mon Jun 26 15:19:40 2006 +0100
-@@ -5147,6 +5147,78 @@ static void select_soundhw (const char *
- #endif
+Index: ioemu/vl.c
+===================================================================
+--- ioemu.orig/vl.c    2006-07-26 13:20:34.398370121 +0100
++++ ioemu/vl.c 2006-07-26 13:20:34.466363026 +0100
+@@ -5148,6 +5148,78 @@
  
  #define MAX_NET_CLIENTS 32
-+
+ 
 +#include <xg_private.h>
 +
 +/* FIXME Flush the shadow page */
@@ -335,13 +339,15 @@ diff -r 62e05863ec04 vl.c
 +
 +    return 0;
 +}
- 
++
  int main(int argc, char **argv)
  {
-diff -r 62e05863ec04 vl.h
---- a/vl.h     Mon Jun 26 15:18:40 2006 +0100
-+++ b/vl.h     Mon Jun 26 15:19:40 2006 +0100
-@@ -136,6 +136,13 @@ extern int reset_requested;
+ #ifdef CONFIG_GDBSTUB
+Index: ioemu/vl.h
+===================================================================
+--- ioemu.orig/vl.h    2006-07-26 13:20:34.268383684 +0100
++++ ioemu/vl.h 2006-07-26 13:20:34.467362921 +0100
+@@ -136,6 +136,13 @@
  
  void main_loop_wait(int timeout);
  

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