From patchwork Tue Jan 6 05:57:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 425551 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2035E140082 for ; Tue, 6 Jan 2015 17:05:33 +1100 (AEDT) Received: from localhost ([::1]:35041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8NGl-0006Y9-9v for incoming@patchwork.ozlabs.org; Tue, 06 Jan 2015 01:05:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8NGO-0005vW-Cw for qemu-devel@nongnu.org; Tue, 06 Jan 2015 01:05:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8NGL-0000GU-7F for qemu-devel@nongnu.org; Tue, 06 Jan 2015 01:05:08 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:61552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8NGK-00008w-EH for qemu-devel@nongnu.org; Tue, 06 Jan 2015 01:05:05 -0500 Received: from 172.24.2.119 (EHLO szxeml413-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id AZQ35731; Tue, 06 Jan 2015 13:59:39 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml413-hub.china.huawei.com (10.82.67.152) with Microsoft SMTP Server id 14.3.158.1; Tue, 6 Jan 2015 13:59:26 +0800 From: Shannon Zhao To: , , , , , Date: Tue, 6 Jan 2015 13:57:17 +0800 Message-ID: <1420523839-11672-2-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1420523839-11672-1-git-send-email-zhaoshenglong@huawei.com> References: <1420523839-11672-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.54AB79D7.0103, ss=1, re=0.001, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: d187f17d5d1730edd2d3318e23e2260a X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.66 Cc: wanghaibin.wang@huawei.com, hangaohuai@huawei.com, peter.huangpeng@huawei.com, zhaoshenglong@huawei.com Subject: [Qemu-devel] [RFC PATCH v3 1/3] hw/arm/virt: Use memory_region_allocate_system_memory to allocate memory X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Use memory_region_allocate_system_memory to allocate memory. The function is sensitive to NUMA and can allocate memory for NUMA topology. Signed-off-by: Shannon Zhao --- hw/arm/virt.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 2353440..fdafa79 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -627,9 +627,8 @@ static void machvirt_init(MachineState *machine) fdt_add_cpu_nodes(vbi); fdt_add_psci_node(vbi); - memory_region_init_ram(ram, NULL, "mach-virt.ram", machine->ram_size, - &error_abort); - vmstate_register_ram_global(ram); + memory_region_allocate_system_memory(ram, NULL, "mach-virt.ram", + machine->ram_size); memory_region_add_subregion(sysmem, vbi->memmap[VIRT_MEM].base, ram); create_flash(vbi);