From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X73Vx-0002bC-3Q for qemu-devel@nongnu.org; Tue, 15 Jul 2014 10:15:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X73Vr-00029T-1g for qemu-devel@nongnu.org; Tue, 15 Jul 2014 10:15:29 -0400 From: Alexander Graf Date: Tue, 15 Jul 2014 16:15:20 +0200 Message-Id: <1405433721-28419-5-git-send-email-agraf@suse.de> In-Reply-To: <1405433721-28419-1-git-send-email-agraf@suse.de> References: <1405433721-28419-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PULL 4/5] spapr: Enable use of huge pages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-ppc@nongnu.org Cc: Alexey Kardashevskiy , Peter Maydell , qemu-devel@nongnu.org From: Alexey Kardashevskiy 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 Signed-off-by: Alexander Graf --- hw/ppc/spapr.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 4ae5dbf..d01978f 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -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); -- 1.8.1.4