From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xe1OP-0008BV-Ll for qemu-devel@nongnu.org; Tue, 14 Oct 2014 08:40:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xe1OG-0002KM-CW for qemu-devel@nongnu.org; Tue, 14 Oct 2014 08:39:57 -0400 Received: from mail-lb0-x22b.google.com ([2a00:1450:4010:c04::22b]:54190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xe1OG-0002KF-4V for qemu-devel@nongnu.org; Tue, 14 Oct 2014 08:39:48 -0400 Received: by mail-lb0-f171.google.com with SMTP id z12so8135630lbi.16 for ; Tue, 14 Oct 2014 05:39:47 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <543D198D.7060203@redhat.com> Date: Tue, 14 Oct 2014 14:39:41 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1413254164-6320-1-git-send-email-zhuyijun@huawei.com> <543CB03E.3090902@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] hw/arm/virt: Replace memory_region_init_ram with memory_region_allocate_system_memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , hangaohuai@huawei.com, peter.huangpeng@huawei.com, zhuyijun Il 14/10/2014 07:42, Peter Maydell ha scritto: > On 14 October 2014 07:10, Paolo Bonzini wrote: >> Il 14/10/2014 06:54, Peter Maydell ha scritto: >>> Why is this patch only changing this board? What's special >>> about virt that means we don't want to also make this >>> change for the other ARM boards? What about all the other >>> boards for the other architectures? >> >> -mem-path is not too useful without KVM (TCG is too slow to >> notice the difference. PPC and S390 have already been fixed. > > MIPS has KVM too now... Yes. >>> Incidentally I can't see anything that guards against >>> calling memory_region_allocate_system_memory() twice, >>> so I think you would end up with two blocks of RAM >>> both backed by the same file then. Or have I misread >>> the code? >> >> That would be a bug in the board, it is caught here: >> >> if (memory_region_is_mapped(seg)) { >> char *path = object_get_canonical_path_component(OBJECT(backend)); >> error_report("memory backend %s is used multiple times. Each " >> "-numa option must use a different memdev value.", >> path); >> exit(1); >> } >> >> The error message gives the common user error rather than >> the less common developer error, but still you catch it. > > That's only in the NUMA code path though, isn't it? > I was looking at the non-numa codepath, which is what > all the boards I care about are going to be taking :-) The non-NUMA path will allocate memory from two separate files. -mem-path takes a path, not a file. > What's the right thing for a board where the system > RAM isn't contiguous, by the way? x86 allocates a big RAM region and uses aliases to split it into non-contiguous areas. Paolo