qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Glauber Costa <glommer@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com
Subject: [Qemu-devel] [PATCH] split memory allocation
Date: Thu, 11 Sep 2008 10:42:21 -0300	[thread overview]
Message-ID: <1221140541-24464-1-git-send-email-glommer@redhat.com> (raw)

Right now, kvm keeps the memory allocation split, so we can
handle different areas in different ways. This schema works with qemu
too, so it appears to be the common ground.

This patch proposes using this common ground for everyone, by spliting
raw qemu.

Signed-off-by: Glauber Costa <glommer@redhat.com>
---
 hw/pc.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 435c7d4..d6084ee 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -777,16 +777,24 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
     vmport_init();
 
     /* allocate RAM */
-    ram_addr = qemu_ram_alloc(ram_size);
-    cpu_register_physical_memory(0, below_4g_mem_size, ram_addr);
+    ram_addr = qemu_ram_alloc(0xa0000);
+    cpu_register_physical_memory(0, 0xa0000, ram_addr);
+
+    ram_addr = qemu_ram_alloc(0x100000 - 0xa0000);   /* hole */
+    ram_addr = qemu_ram_alloc(below_4g_mem_size - 0x100000);
+    cpu_register_physical_memory(0x100000,
+                 below_4g_mem_size - 0x100000,
+                 ram_addr);
 
     /* above 4giga memory allocation */
     if (above_4g_mem_size > 0) {
-        cpu_register_physical_memory((target_phys_addr_t) 0x100000000ULL,
+        ram_addr = qemu_ram_alloc(above_4g_mem_size);
+        cpu_register_physical_memory(0x100000000ULL,
                                      above_4g_mem_size,
-                                     ram_addr + below_4g_mem_size);
+                                     ram_addr);
     }
 
+
     /* allocate VGA RAM */
     vga_ram_addr = qemu_ram_alloc(vga_ram_size);
 
-- 
1.5.5.1

             reply	other threads:[~2008-09-11 13:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-11 13:42 Glauber Costa [this message]
2008-09-11 14:18 ` [Qemu-devel] [PATCH] split memory allocation Aurelien Jarno
2008-09-11 14:35   ` Anthony Liguori
2008-09-11 14:42     ` Glauber Costa
2008-09-11 14:43 ` [Qemu-devel] " Anthony Liguori
2008-09-11 15:03   ` Glauber Costa
2008-09-11 15:29   ` Avi Kivity
2008-09-11 18:31     ` Glauber Costa
2008-09-19 23:29       ` Avi Kivity
2008-09-11 15:28 ` [Qemu-devel] " Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2008-09-12 13:18 Glauber Costa
2008-09-15 15:49 Glauber Costa
2008-09-15 16:00 ` Anthony Liguori
2008-09-15 16:11   ` Glauber Costa

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=1221140541-24464-1-git-send-email-glommer@redhat.com \
    --to=glommer@redhat.com \
    --cc=aliguori@us.ibm.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).