Blame SOURCES/0015-vl-Round-memory-sizes-below-2MiB-up-to-2MiB.patch

4a2fec
From 29e44e4e1f10ac7d2f9ac824b928518f3a2ccc10 Mon Sep 17 00:00:00 2001
4a2fec
From: Markus Armbruster <armbru@redhat.com>
4a2fec
Date: Mon, 7 Jul 2014 10:28:38 +0200
4a2fec
Subject: vl: Round memory sizes below 2MiB up to 2MiB
4a2fec
4a2fec
RH-Author: Markus Armbruster <armbru@redhat.com>
4a2fec
Message-id: <1387459965-19517-2-git-send-email-armbru@redhat.com>
4a2fec
Patchwork-id: 56389
4a2fec
O-Subject: [PATCH 7.0 qemu-kvm 1/1] vl: Round memory sizes below 2MiB up to 2MiB
4a2fec
Bugzilla: 999836
4a2fec
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
4a2fec
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
4a2fec
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
4a2fec
4a2fec
From: Markus Armbruster <armbru@redhat.com>
4a2fec
4a2fec
SeaBIOS requires at least 1MiB of RAM, but doesn't doesn't check for
4a2fec
it.  It simply assumes it's there, and crashes when it isn't, often
4a2fec
without any indication what's wrong.  No upstream SeaBIOS fix
4a2fec
expected.
4a2fec
4a2fec
In RHEL-6, we round memory sizes below 2MiB up to 2MiB to protect
4a2fec
SeaBIOS (commit 551c098 and commit b9d6c40).  Do the same for RHEL-7.
4a2fec
Not wanted upstream.
4a2fec
4a2fec
Signed-off-by: Markus Armbruster <armbru@redhat.com>
4a2fec
(cherry picked from commit 5c401c750c8e52fe5c67b4e60143a862a0d584c1)
4a2fec
---
4a2fec
 vl.c | 1 +
4a2fec
 1 file changed, 1 insertion(+)
4a2fec
4a2fec
diff --git a/vl.c b/vl.c
4a2fec
index ff4e7f7..59f515c 100644
4a2fec
--- a/vl.c
4a2fec
+++ b/vl.c
4a2fec
@@ -2906,6 +2906,7 @@ static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size,
4a2fec
     }
4a2fec
 
4a2fec
     sz = QEMU_ALIGN_UP(sz, 8192);
4a2fec
+    sz = MAX(sz, 2 * 1024 * 1024);
4a2fec
     ram_size = sz;
4a2fec
     if (ram_size != sz) {
4a2fec
         error_report("ram size too large");
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec