# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1217939039 -3600
# Node ID 18b41609a980ce763cb6c666a74df2b0f6bb36e8
# Parent dc40f94f8c4cbe1ed3341cd961bf4b6ea511711b
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@xxxxxxxxxx>
---
tools/ioemu/hw/pc.c | 19 ++++++++-----------
tools/python/xen/xend/image.py | 4 ----
2 files changed, 8 insertions(+), 15 deletions(-)
diff -r dc40f94f8c4c -r 18b41609a980 tools/ioemu/hw/pc.c
--- a/tools/ioemu/hw/pc.c Tue Aug 05 10:48:53 2008 +0100
+++ b/tools/ioemu/hw/pc.c Tue Aug 05 13:23:59 2008 +0100
@@ -30,9 +30,6 @@
#define VGABIOS_FILENAME "vgabios.bin"
#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;
@@ -542,6 +539,7 @@ static void load_linux(const char *kerne
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 *kerne
(size_t)cmdline_addr,
(size_t)prot_addr);
+ /* 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 */
- 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;
-
+ 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 -r dc40f94f8c4c -r 18b41609a980 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py Tue Aug 05 10:48:53 2008 +0100
+++ b/tools/python/xen/xend/image.py Tue Aug 05 13:23:59 2008 +0100
@@ -249,10 +249,6 @@ class ImageHandler:
# xm config file
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.
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|