aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-08-05 13:23:59 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-08-05 13:23:59 +0100
commit95d4283bb4284ffb463bde3670d80d06cf96c151 (patch)
tree6dc3ff8a0f683c22fe591f64ba82fdcd67d74888
parent92148d2eda828b038eb0137668bcedb1754a4159 (diff)
downloadxen-95d4283bb4284ffb463bde3670d80d06cf96c151.tar.gz
xen-95d4283bb4284ffb463bde3670d80d06cf96c151.tar.bz2
xen-95d4283bb4284ffb463bde3670d80d06cf96c151.zip
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>
-rw-r--r--tools/ioemu/hw/pc.c19
-rw-r--r--tools/python/xen/xend/image.py4
2 files changed, 8 insertions, 15 deletions
diff --git a/tools/ioemu/hw/pc.c b/tools/ioemu/hw/pc.c
index fc25a4224e..999b4f4e9e 100644
--- a/tools/ioemu/hw/pc.c
+++ b/tools/ioemu/hw/pc.c
@@ -31,9 +31,6 @@
#define VGABIOS_CIRRUS_FILENAME "vgabios-cirrus.bin"
#define LINUX_BOOT_FILENAME "linux_boot.bin"
-/* Leave a chunk of memory at the top of RAM for the BIOS ACPI tables. */
-#define ACPI_DATA_SIZE 0x10000
-
static fdctrl_t *floppy_controller;
static RTCState *rtc_state;
#ifndef CONFIG_DM
@@ -542,6 +539,7 @@ static void load_linux(const char *kernel_filename,
uint16_t seg[6];
uint16_t real_seg;
int setup_size, kernel_size, initrd_size, cmdline_size;
+ unsigned long end_low_ram;
uint32_t initrd_max;
uint8_t header[1024];
target_phys_addr_t real_addr, reloc_prot_addr, prot_addr, cmdline_addr, initrd_addr;
@@ -595,15 +593,14 @@ static void load_linux(const char *kernel_filename,
(size_t)cmdline_addr,
(size_t)prot_addr);
- /* highest address for loading the initrd */
- if (protocol >= 0x203)
- initrd_max = ldl_p(header+0x22c);
- else
- initrd_max = 0x37ffffff;
-
- if (initrd_max >= ram_size-ACPI_DATA_SIZE)
- initrd_max = ram_size-ACPI_DATA_SIZE-1;
+ /* Special pages are placed at end of low RAM: pick an arbitrary one and
+ * subtract a suitably large amount of padding (64kB) to skip BIOS data. */
+ xc_get_hvm_param(xc_handle, domid, HVM_PARAM_BUFIOREQ_PFN, &end_low_ram);
+ end_low_ram = (end_low_ram << 12) - (64*1024);
+ /* highest address for loading the initrd */
+ initrd_max = (protocol >= 0x203) ? ldl_p(header+0x22c) : 0x37ffffff;
+ initrd_max = MIN(initrd_max, (uint32_t)end_low_ram);
/* kernel command line */
ncmdline = strlen(kernel_cmdline);
diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py
index 49cce20225..d5b508d6f6 100644
--- a/tools/python/xen/xend/image.py
+++ b/tools/python/xen/xend/image.py
@@ -250,10 +250,6 @@ class ImageHandler:
def parseDeviceModelArgs(self, vmConfig):
ret = ["-domain-name", str(self.vm.info['name_label'])]
- # Tell QEMU how large the guest's memory allocation is
- # to help it when loading the initrd (if neccessary)
- ret += ["-m", str(self.getRequiredInitialReservation() / 1024)]
-
# Find RFB console device, and if it exists, make QEMU enable
# the VNC console.
if int(vmConfig['platform'].get('nographic', 0)) != 0: