[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v18 09/14] numa: introduce memory_region_allocate_sy
From: |
Hu Tao |
Subject: |
[Qemu-devel] [PATCH v18 09/14] numa: introduce memory_region_allocate_system_memory |
Date: |
Wed, 19 Feb 2014 15:54:00 +0800 |
From: Paolo Bonzini <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Hu Tao <address@hidden>
---
hw/i386/pc.c | 4 +---
include/sysemu/sysemu.h | 5 +++++
numa.c | 10 ++++++++++
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 17d4820..ff078fb 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1165,9 +1165,7 @@ FWCfgState *pc_memory_init(QEMUMachineInitArgs *args,
* with older qemus that used qemu_ram_alloc().
*/
ram = g_malloc(sizeof(*ram));
- memory_region_init_ram(ram, NULL, "pc.ram",
- below_4g_mem_size + above_4g_mem_size);
- vmstate_register_ram_global(ram);
+ memory_region_allocate_system_memory(ram, NULL, "pc.ram", args);
*ram_memory = ram;
ram_below_4g = g_malloc(sizeof(*ram_below_4g));
memory_region_init_alias(ram_below_4g, NULL, "ram-below-4g", ram,
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 4c94cf5..e9da760 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -10,6 +10,8 @@
#include "qemu/notify.h"
#include "qemu/main-loop.h"
#include "qemu/bitmap.h"
+#include "qom/object.h"
+#include "hw/boards.h"
/* vl.c */
@@ -144,6 +146,9 @@ void set_numa_nodes(void);
void set_numa_modes(void);
extern QemuOptsList qemu_numa_opts;
int numa_init_func(QemuOpts *opts, void *opaque);
+void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
+ const char *name,
+ QEMUMachineInitArgs *args);
#define MAX_OPTION_ROMS 16
typedef struct QEMUOptionRom {
diff --git a/numa.c b/numa.c
index 827c76f..403b08b 100644
--- a/numa.c
+++ b/numa.c
@@ -188,3 +188,13 @@ void set_numa_modes(void)
}
}
}
+
+void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
+ const char *name,
+ QEMUMachineInitArgs *args)
+{
+ uint64_t ram_size = args->ram_size;
+
+ memory_region_init_ram(mr, owner, name, ram_size);
+ vmstate_register_ram_global(mr);
+}
--
1.8.5.2.229.g4448466
- Re: [Qemu-devel] [PATCH v18 11/14] qapi: make string input visitor parse int list, (continued)
- [Qemu-devel] [PATCH v18 03/14] NUMA: Add numa_info structure to contain numa nodes info, Hu Tao, 2014/02/19
- [Qemu-devel] [PATCH v18 04/14] NUMA: convert -numa option to use OptsVisitor, Hu Tao, 2014/02/19
- [Qemu-devel] [PATCH v18 07/14] add memdev backend infrastructure, Hu Tao, 2014/02/19
- [Qemu-devel] [PATCH v18 06/14] qapi: add SIZE type parser to string_input_visitor, Hu Tao, 2014/02/19
- [Qemu-devel] [PATCH v18 09/14] numa: introduce memory_region_allocate_system_memory,
Hu Tao <=
- [Qemu-devel] [PATCH v18 10/14] numa: add -numa node, memdev= option, Hu Tao, 2014/02/19
- [Qemu-devel] [PATCH v18 08/14] pc: pass QEMUMachineInitArgs to pc_memory_init, Hu Tao, 2014/02/19
- [Qemu-devel] [PATCH v18 02/14] NUMA: check if the total numa memory size is equal to ram_size, Hu Tao, 2014/02/19
- [Qemu-devel] [PATCH v18 14/14] amp: add query-memdev, Hu Tao, 2014/02/19
- [Qemu-devel] [PATCH v18 05/14] NUMA: expand MAX_NODES from 64 to 128, Hu Tao, 2014/02/19