Skip to contentSkip to conversation

pc: add more padding between the end of the initrd and the end of memory

PATCH In review Paolo Bonzini 2 participants 2 messages Sep 18, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pc: add more padding between the end of the initrd and the end of memory

Besides ACPI tables, there are a few other uses of high memory in SeaBIOS:
SMBIOS tables and USB drivers use it in particular. These uses allocate a very small amount of memory. Malloc metadata also lives there. So we need _some_ extra padding there to avoid initrd breakage, but not much.

John Snow found a case where RHEL5 was broken by the recent change to ACPI_TABLE_SIZE; in his case 4KB of extra padding are fine, but just to be safe I am adding 32KB, which is roughly the same amount of padding that was left by QEMU 2.0 and earlier.

---
 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/pc.c +1 -1
index 77b6782..b9d4be7 100644
@@ -73,7 +73,7 @@
 #endif
 
 /* Leave a chunk of memory at the top of RAM for the BIOS ACPI tables.  */
-unsigned acpi_data_size = 0x20000;
+unsigned acpi_data_size = 0x28000;
 void pc_set_legacy_acpi_data_size(void)
 {
     acpi_data_size = 0x10000;
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 11 lines · Paolo Bonzini

Besides ACPI tables, there are a few other uses of high memory in SeaBIOS:
SMBIOS tables and USB drivers use it in particular. These uses allocate a very small amount of memory. Malloc metadata also lives there. So we need _some_ extra padding there to avoid initrd breakage, but not much.

John Snow found a case where RHEL5 was broken by the recent change to ACPI_TABLE_SIZE; in his case 4KB of extra padding are fine, but just to be safe I am adding 32KB, which is roughly the same amount of padding that was left by QEMU 2.0 and earlier.

I already queued a patch with some slightly better comments so I'll keep that.
Will append your text to the commit log.

Thanks!

Quoted 19 lines
---
 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/pc.c +1 -1
index 77b6782..b9d4be7 100644
@@ -73,7 +73,7 @@
 #endif
 
 /* Leave a chunk of memory at the top of RAM for the BIOS ACPI tables.  */
-unsigned acpi_data_size = 0x20000;
+unsigned acpi_data_size = 0x28000;
 void pc_set_legacy_acpi_data_size(void)
 {
     acpi_data_size = 0x10000;
Signature · 1 line
1.8.3.1