ia64/xen-unstable

changeset 18265:18b41609a980

ioemu: Do not pass -m (memory) option to qemu, as ioemu-remote rejects
memory sizes greater than 2GB when built as a 32-bit binary.

Instead, direct HVM Linux loading approximates end of low memory via a
different method.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Aug 05 13:23:59 2008 +0100 (2008-08-05)
parents dc40f94f8c4c
children 0afe29785305
files tools/ioemu/hw/pc.c tools/python/xen/xend/image.py
line diff
     1.1 --- a/tools/ioemu/hw/pc.c	Tue Aug 05 10:48:53 2008 +0100
     1.2 +++ b/tools/ioemu/hw/pc.c	Tue Aug 05 13:23:59 2008 +0100
     1.3 @@ -31,9 +31,6 @@
     1.4  #define VGABIOS_CIRRUS_FILENAME "vgabios-cirrus.bin"
     1.5  #define LINUX_BOOT_FILENAME "linux_boot.bin"
     1.6  
     1.7 -/* Leave a chunk of memory at the top of RAM for the BIOS ACPI tables.  */
     1.8 -#define ACPI_DATA_SIZE        0x10000
     1.9 -
    1.10  static fdctrl_t *floppy_controller;
    1.11  static RTCState *rtc_state;
    1.12  #ifndef CONFIG_DM
    1.13 @@ -542,6 +539,7 @@ static void load_linux(const char *kerne
    1.14      uint16_t seg[6];
    1.15      uint16_t real_seg;
    1.16      int setup_size, kernel_size, initrd_size, cmdline_size;
    1.17 +    unsigned long end_low_ram;
    1.18      uint32_t initrd_max;
    1.19      uint8_t header[1024];
    1.20      target_phys_addr_t real_addr, reloc_prot_addr, prot_addr, cmdline_addr, initrd_addr;
    1.21 @@ -595,15 +593,14 @@ static void load_linux(const char *kerne
    1.22              (size_t)cmdline_addr,
    1.23              (size_t)prot_addr);
    1.24  
    1.25 +    /* Special pages are placed at end of low RAM: pick an arbitrary one and
    1.26 +     * subtract a suitably large amount of padding (64kB) to skip BIOS data. */
    1.27 +    xc_get_hvm_param(xc_handle, domid, HVM_PARAM_BUFIOREQ_PFN, &end_low_ram);
    1.28 +    end_low_ram = (end_low_ram << 12) - (64*1024);
    1.29 +
    1.30      /* highest address for loading the initrd */
    1.31 -    if (protocol >= 0x203)
    1.32 -        initrd_max = ldl_p(header+0x22c);
    1.33 -    else
    1.34 -        initrd_max = 0x37ffffff;
    1.35 -
    1.36 -    if (initrd_max >= ram_size-ACPI_DATA_SIZE)
    1.37 -        initrd_max = ram_size-ACPI_DATA_SIZE-1;
    1.38 -
    1.39 +    initrd_max = (protocol >= 0x203) ? ldl_p(header+0x22c) : 0x37ffffff;
    1.40 +    initrd_max = MIN(initrd_max, (uint32_t)end_low_ram);
    1.41  
    1.42      /* kernel command line */
    1.43      ncmdline = strlen(kernel_cmdline);
     2.1 --- a/tools/python/xen/xend/image.py	Tue Aug 05 10:48:53 2008 +0100
     2.2 +++ b/tools/python/xen/xend/image.py	Tue Aug 05 13:23:59 2008 +0100
     2.3 @@ -250,10 +250,6 @@ class ImageHandler:
     2.4      def parseDeviceModelArgs(self, vmConfig):
     2.5          ret = ["-domain-name", str(self.vm.info['name_label'])]
     2.6  
     2.7 -        # Tell QEMU how large the guest's memory allocation is
     2.8 -        # to help it when loading the initrd (if neccessary)
     2.9 -        ret += ["-m", str(self.getRequiredInitialReservation() / 1024)]
    2.10 -
    2.11          # Find RFB console device, and if it exists, make QEMU enable
    2.12          # the VNC console.
    2.13          if int(vmConfig['platform'].get('nographic', 0)) != 0: