yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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