summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlauber Costa <glommer@redhat.com>2009-05-18 16:35:58 -0400
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-20 13:21:36 -0500
commitee60269c23bb2f672a9617cf36e74d43dc31a5aa (patch)
tree58e56b1e70f5355e77790f8803c6dab47d3c755e
parent3978d7b4c8fe68dc45ea40097c76017938fb0ba7 (diff)
downloadqemu-ee60269c23bb2f672a9617cf36e74d43dc31a5aa.tar.gz
keep initrd in below 4g area.
initrd must be kept on the memory area below 4g. By not doing this, we're seeing guests break while using -initrd and values of -mem superior to 4096. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--hw/pc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 40486aa369..bf5b6e6ef0 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -566,7 +566,8 @@ static long get_file_size(FILE *f)
static void load_linux(target_phys_addr_t option_rom,
const char *kernel_filename,
const char *initrd_filename,
- const char *kernel_cmdline)
+ const char *kernel_cmdline,
+ target_phys_addr_t max_ram_size)
{
uint16_t protocol;
uint32_t gpr[8];
@@ -632,8 +633,8 @@ static void load_linux(target_phys_addr_t option_rom,
else
initrd_max = 0x37ffffff;
- if (initrd_max >= ram_size-ACPI_DATA_SIZE)
- initrd_max = ram_size-ACPI_DATA_SIZE-1;
+ if (initrd_max >= max_ram_size-ACPI_DATA_SIZE)
+ initrd_max = max_ram_size-ACPI_DATA_SIZE-1;
/* kernel command line */
pstrcpy_targphys(cmdline_addr, 4096, kernel_cmdline);
@@ -930,7 +931,7 @@ vga_bios_error:
cpu_register_physical_memory(0xd0000, TARGET_PAGE_SIZE,
option_rom_offset);
load_linux(0xd0000,
- kernel_filename, initrd_filename, kernel_cmdline);
+ kernel_filename, initrd_filename, kernel_cmdline, below_4g_mem_size);
offset = TARGET_PAGE_SIZE;
}