From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Andrea Arcangeli <aarcange@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-devel] [PATCH 1/1] e820: pass high memory too.
Date: Thu, 17 Oct 2013 13:09:38 +0200 [thread overview]
Message-ID: <1382008179-5968-2-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1382008179-5968-1-git-send-email-kraxel@redhat.com>
We have a fw_cfg entry to pass e820 entries from qemu to the firmware.
Today it's used to pass reservations only. This patch makes qemu pass
entries for RAM too.
This allows to pass RAM sizes larger than 1TB to the firmware and it
will also allow to pass non-contignous memory ramges should we decide
to implement that some day, say for our virtual numa nodes.
Obviously this needs some extra care to not break existing firware.
SeaBIOS loads the entries and happily adds them without looking at the
type. Which is problematic for memory below 4g as this will overwrite
reservations added for bios memory etc. For memory above 4g it works
just fine, seabios will merge the entry derived from cmos with the one
loaded from fw_cfg.
OVMF doesn't look at the fw_cfg e820 table.
coreboot doesn't look at the fw_cfg e820 table.
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-By: Igor Mammedov <imammedo@redhat.com>
---
hw/i386/pc.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 0c313fe..ec5508b 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1134,12 +1134,20 @@ FWCfgState *pc_memory_init(MemoryRegion *system_memory,
memory_region_init_alias(ram_below_4g, NULL, "ram-below-4g", ram,
0, below_4g_mem_size);
memory_region_add_subregion(system_memory, 0, ram_below_4g);
+ if (0) {
+ /*
+ * Ideally we should do that too, but that would ruin the e820
+ * reservations added by seabios before initializing fw_cfg.
+ */
+ e820_add_entry(0, below_4g_mem_size, E820_RAM);
+ }
if (above_4g_mem_size > 0) {
ram_above_4g = g_malloc(sizeof(*ram_above_4g));
memory_region_init_alias(ram_above_4g, NULL, "ram-above-4g", ram,
below_4g_mem_size, above_4g_mem_size);
memory_region_add_subregion(system_memory, 0x100000000ULL,
ram_above_4g);
+ e820_add_entry(0x100000000ULL, above_4g_mem_size, E820_RAM);
}
--
1.8.3.1
next prev parent reply other threads:[~2013-10-17 11:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-17 11:09 [Qemu-devel] [PULL 0/1] e820: pass high memory too Gerd Hoffmann
2013-10-17 11:09 ` Gerd Hoffmann [this message]
2013-10-17 13:00 ` [Qemu-devel] [PATCH 1/1] " Andrea Arcangeli
2013-10-17 14:30 ` Gerd Hoffmann
2013-10-17 16:15 ` Andrea Arcangeli
2013-10-18 8:55 ` Gerd Hoffmann
2013-10-18 13:31 ` Andrea Arcangeli
2013-10-18 14:37 ` Gerd Hoffmann
2013-10-18 11:31 ` [Qemu-devel] [PULL 0/1] " Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1382008179-5968-2-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=aarcange@redhat.com \
--cc=aliguori@amazon.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).