]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
spapr: Enable use of huge pages
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Thu, 10 Jul 2014 15:03:42 +0000 (01:03 +1000)
committerAlexander Graf <agraf@suse.de>
Tue, 15 Jul 2014 14:11:59 +0000 (16:11 +0200)
0b183fc87 "memory: move mem_path handling to
memory_region_allocate_system_memory" disabled -mempath use for all
machines that do not use memory_region_allocate_system_memory() to
register RAM. Since SPAPR uses memory_region_init_ram(), the huge pages
support was disabled for it.

This replaces memory_region_init_ram()+vmstate_register_ram_global() with
memory_region_allocate_system_memory() to get huge pages back.

This changes RAM size from (ram_limit - rma_alloc_size) to ram_limit as
the previous patch moved RMA memory region allocation after RAM allocation
and therefore this change does not have immediate effect but simplifies
the code.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/ppc/spapr.c

index 4ae5dbf8baa20e4ca685807cbfa2c5a8f9957f5b..d01978f3dc1d40ee5741f15afc2e6f879c1bd5da 100644 (file)
@@ -1335,14 +1335,9 @@ static void ppc_spapr_init(MachineState *machine)
 
     /* allocate RAM */
     spapr->ram_limit = ram_size;
-    if (spapr->ram_limit > rma_alloc_size) {
-        ram_addr_t nonrma_base = rma_alloc_size;
-        ram_addr_t nonrma_size = spapr->ram_limit - rma_alloc_size;
-
-        memory_region_init_ram(ram, NULL, "ppc_spapr.ram", nonrma_size);
-        vmstate_register_ram_global(ram);
-        memory_region_add_subregion(sysmem, nonrma_base, ram);
-    }
+    memory_region_allocate_system_memory(ram, NULL, "ppc_spapr.ram",
+                                         spapr->ram_limit);
+    memory_region_add_subregion(sysmem, 0, ram);
 
     if (rma_alloc_size && rma) {
         rma_region = g_new(MemoryRegion, 1);