From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUgFK-0003dr-Vy for qemu-devel@nongnu.org; Thu, 18 Sep 2014 14:16:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUgFF-0005ks-Tg for qemu-devel@nongnu.org; Thu, 18 Sep 2014 14:15:58 -0400 Date: Thu, 18 Sep 2014 21:19:05 +0300 From: "Michael S. Tsirkin" Message-ID: <1411063757-29216-15-git-send-email-mst@redhat.com> References: <1411063757-29216-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1411063757-29216-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL v2 14/15] pc: leave more space for BIOS allocations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , John Snow , qemu-stable@nongnu.org, Anthony Liguori , Paolo Bonzini Since QEMU 2.1, we are allocating more space for ACPI tables, so no space is left after initrd for the BIOS to allocate 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. Move initrd to leave some space for the BIOS. Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini Reported-by: John Snow Signed-off-by: Michael S. Tsirkin --- hw/i386/pc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index b6c9b61..9ac5bd2 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -72,8 +72,10 @@ #define DPRINTF(fmt, ...) #endif -/* Leave a chunk of memory at the top of RAM for the BIOS ACPI tables. */ -unsigned acpi_data_size = 0x20000; +/* Leave a chunk of memory at the top of RAM for the BIOS ACPI tables + * (128K) and other BIOS datastructures (less than 4K reported to be used at + * the moment, 32K should be enough for a while). */ +unsigned acpi_data_size = 0x20000 + 0x8000; void pc_set_legacy_acpi_data_size(void) { acpi_data_size = 0x10000; -- MST