cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
0a122b
From 2b35241a510c17f731ba0142aa071d7ae24bf55b Mon Sep 17 00:00:00 2001
0a122b
From: Markus Armbruster <armbru@redhat.com>
0a122b
Date: Thu, 19 Dec 2013 13:32:45 +0100
0a122b
Subject: [PATCH 03/16] vl: Round memory sizes below 2MiB up to 2MiB
0a122b
0a122b
RH-Author: Markus Armbruster <armbru@redhat.com>
0a122b
Message-id: <1387459965-19517-2-git-send-email-armbru@redhat.com>
0a122b
Patchwork-id: 56389
0a122b
O-Subject: [PATCH 7.0 qemu-kvm 1/1] vl: Round memory sizes below 2MiB up to 2MiB
0a122b
Bugzilla: 999836
0a122b
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
0a122b
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
0a122b
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
0a122b
0a122b
From: Markus Armbruster <armbru@redhat.com>
0a122b
0a122b
SeaBIOS requires at least 1MiB of RAM, but doesn't doesn't check for
0a122b
it.  It simply assumes it's there, and crashes when it isn't, often
0a122b
without any indication what's wrong.  No upstream SeaBIOS fix
0a122b
expected.
0a122b
0a122b
In RHEL-6, we round memory sizes below 2MiB up to 2MiB to protect
0a122b
SeaBIOS (commit 551c098 and commit b9d6c40).  Do the same for RHEL-7.
0a122b
Not wanted upstream.
0a122b
0a122b
Signed-off-by: Markus Armbruster <armbru@redhat.com>
0a122b
---
0a122b
 vl.c | 1 +
0a122b
 1 file changed, 1 insertion(+)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 vl.c |    1 +
0a122b
 1 files changed, 1 insertions(+), 0 deletions(-)
0a122b
0a122b
diff --git a/vl.c b/vl.c
0a122b
index b9074c5..781c352 100644
0a122b
--- a/vl.c
0a122b
+++ b/vl.c
0a122b
@@ -3165,6 +3165,7 @@ int main(int argc, char **argv, char **envp)
0a122b
                     exit(1);
0a122b
                 }
0a122b
                 sz = QEMU_ALIGN_UP((uint64_t)value, 8192);
0a122b
+                sz = MAX(sz, 2 * 1024 * 1024);
0a122b
                 ram_size = sz;
0a122b
                 if (ram_size != sz) {
0a122b
                     fprintf(stderr, "qemu: ram size too large\n");
0a122b
-- 
0a122b
1.7.1
0a122b