Commit e6ade764ebbbac9a0ce2f710ef0d97272eb1657f
Committed by
Anthony Liguori
1 parent
95b134ea
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>
Showing
1 changed file
with
5 additions
and
4 deletions
hw/pc.c
... | ... | @@ -596,7 +596,8 @@ static long get_file_size(FILE *f) |
596 | 596 | static void load_linux(target_phys_addr_t option_rom, |
597 | 597 | const char *kernel_filename, |
598 | 598 | const char *initrd_filename, |
599 | - const char *kernel_cmdline) | |
599 | + const char *kernel_cmdline, | |
600 | + target_phys_addr_t max_ram_size) | |
600 | 601 | { |
601 | 602 | uint16_t protocol; |
602 | 603 | uint32_t gpr[8]; |
... | ... | @@ -662,8 +663,8 @@ static void load_linux(target_phys_addr_t option_rom, |
662 | 663 | else |
663 | 664 | initrd_max = 0x37ffffff; |
664 | 665 | |
665 | - if (initrd_max >= ram_size-ACPI_DATA_SIZE) | |
666 | - initrd_max = ram_size-ACPI_DATA_SIZE-1; | |
666 | + if (initrd_max >= max_ram_size-ACPI_DATA_SIZE) | |
667 | + initrd_max = max_ram_size-ACPI_DATA_SIZE-1; | |
667 | 668 | |
668 | 669 | /* kernel command line */ |
669 | 670 | pstrcpy_targphys(cmdline_addr, 4096, kernel_cmdline); |
... | ... | @@ -960,7 +961,7 @@ static void pc_init1(ram_addr_t ram_size, |
960 | 961 | |
961 | 962 | if (linux_boot) { |
962 | 963 | load_linux(0xc0000 + oprom_area_size, |
963 | - kernel_filename, initrd_filename, kernel_cmdline); | |
964 | + kernel_filename, initrd_filename, kernel_cmdline, below_4g_mem_size); | |
964 | 965 | oprom_area_size += 2048; |
965 | 966 | } |
966 | 967 | ... | ... |