From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71FBBECE58C for ; Mon, 7 Oct 2019 21:31:03 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4052520835 for ; Mon, 7 Oct 2019 21:31:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="tfvMNKhD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4052520835 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iHaag-0006Et-Nv; Mon, 07 Oct 2019 21:30:50 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iHaae-0006El-M8 for xen-devel@lists.xenproject.org; Mon, 07 Oct 2019 21:30:48 +0000 X-Inumbo-ID: b9ce2836-e949-11e9-80e3-bc764e2007e4 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b9ce2836-e949-11e9-80e3-bc764e2007e4; Mon, 07 Oct 2019 21:30:47 +0000 (UTC) Received: from localhost (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7E31B20867; Mon, 7 Oct 2019 21:30:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570483846; bh=ZP6p2oensXj7KkRd+Cu8T8ycR2MOFR2Tss3SYBpTO3c=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=tfvMNKhDSjkDRvYoXLoFhTv5+2hxAZjlXzO6UENeISz0R/rl8qdOClgBpxfKkPyxf JLtttMBfQLpZNel7a5O38/iIzkLAI+GzoE1d+LNxUcf/cWszR5wO0HwwBP6RHTrKVk Y8D2v5DjW2NNNv5Eop70w7GKYSaCKvF+/auhhx74= Date: Mon, 7 Oct 2019 14:30:44 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: =?UTF-8?Q?J=C3=BCrgen_Gro=C3=9F?= In-Reply-To: <71fe02ae-a279-8d30-28e9-35d6c84c9a08@suse.com> Message-ID: References: <71fe02ae-a279-8d30-28e9-35d6c84c9a08@suse.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-441291930-1570483846=:13684" Subject: Re: [Xen-devel] [PATCH for-4.13] xen/arm: fix duplicate memory node in DT X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: julien@xen.org, xen-devel@lists.xenproject.org, Stefano Stabellini , Volodymyr_Babchuk@epam.com, oleksandr_tyshchenko@epam.com Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-441291930-1570483846=:13684 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Mon, 7 Oct 2019, Jürgen Groß wrote: > On 05.10.19 01:09, Stefano Stabellini wrote: > > When reserved-memory regions are present in the host device tree, dom0 > > is started with multiple memory nodes. Each memory node should have a > > unique name, but today they are all called "memory" leading to Linux > > printing the following warning at boot: > > > > OF: Duplicate name in base, renamed to "memory#1" > > > > This patch fixes the problem by appending a "@" to the > > name, as per the Device Tree specification, where matches > > the base of address of the first region. > > > > Reported-by: Oleksandr Tyshchenko > > Signed-off-by: Stefano Stabellini > > > > --- > > > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > > index 921b054520..a4c07db383 100644 > > --- a/xen/arch/arm/domain_build.c > > +++ b/xen/arch/arm/domain_build.c > > @@ -646,16 +646,22 @@ static int __init make_memory_node(const struct domain > > *d, > > int res, i; > > int reg_size = addrcells + sizecells; > > int nr_cells = reg_size * mem->nr_banks; > > + /* Placeholder for memory@ + a 32-bit number + \0 */ > > + char buf[18]; > > You are using PRIx64 for printing the number, so I guess you should > enlarge buf by 8 bytes and adjust the comment (s/32/64/). Well spotted! In fact, there is a similar error in make_cpus_node. I'll fix that one too in a separate patch. > > __be32 reg[NR_MEM_BANKS * 4 /* Worst case addrcells + sizecells */]; > > __be32 *cells; > > BUG_ON(nr_cells >= ARRAY_SIZE(reg)); > > + /* Nothing to do */ > > + if ( mem->nr_banks == 0 ) > > + return 0; > > dt_dprintk("Create memory node (reg size %d, nr cells %d)\n", > > reg_size, nr_cells); > > /* ePAPR 3.4 */ > > - res = fdt_begin_node(fdt, "memory"); > > + snprintf(buf, sizeof(buf), "memory@%"PRIx64, mem->bank[0].start); > > + res = fdt_begin_node(fdt, buf); > > if ( res ) > > return res; > > > Juergen > --8323329-441291930-1570483846=:13684 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmcKaHR0cHM6Ly9saXN0 cy54ZW5wcm9qZWN0Lm9yZy9tYWlsbWFuL2xpc3RpbmZvL3hlbi1kZXZlbA== --8323329-441291930-1570483846=:13684--