From nobody Thu Apr 25 18:58:19 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1570230669; cv=none; d=zoho.com; s=zohoarc; b=NWRPcobhwCMAH/hRNTaZCfeEStmYoez+57jtzs7s7nU1SyoSwy8LoF16vDYIR3ZVzp6XdUwLedMtHUnwUKQ3axNS+DNJxinYG74w9bF+MMwVNYVy1ehf+MIbHhwegDK1WPR4i9V0Rb6R+weE8QtSVH1Q0Z/lzDM2zBYQd/zr3NI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570230669; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=z2slEfEg4hfqTrw89UwA6t9o2k9bnu+QWcWwMeyUOS4=; b=CuPski5tb1U9sFO4MI7QKnEAbekrUcOHOf1aGhent1b6QOCSUoUpPUJYvvUlo23Nufcd1d/lJUvxj8p5ATsfGcP+YBKVa+PaH7RjVduoGgisly5fcfwreLMRX7X+4Pgx8UNBPTyOxu1xSn2t7o5ERbc5WqViBCY3n5Fk09NSZI4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1570230669681793.7508315644307; Fri, 4 Oct 2019 16:11:09 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iGWhq-0002Wu-D2; Fri, 04 Oct 2019 23:09: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 1iGWho-0002W8-St for xen-devel@lists.xenproject.org; Fri, 04 Oct 2019 23:09:48 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0f6e11ca-e6fc-11e9-80e3-bc764e2007e4; Fri, 04 Oct 2019 23:09:48 +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 16D3221D81; Fri, 4 Oct 2019 23:09:47 +0000 (UTC) X-Inumbo-ID: 0f6e11ca-e6fc-11e9-80e3-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570230587; bh=NTT9BZoNTyxmi2wjFfJZ8/AglDBPcv+c0SqXYG7zFUI=; h=Date:From:To:cc:Subject:From; b=y99pA7Y/rd53KA+AaXkAI002jx2Gmq8AFsElWUw4TK1J2xk+Se1HhvI2Tu6PnRuJI LGQ79845YcjoKS67RlIi5EHUtSu0+kBZnFrrU0h+O7gNl07Y3Lqnwx27CBfljVob1J AXS/G23t2nLUHXPQSwux5s+TqBHv9apyUK2UHO2Q= Date: Fri, 4 Oct 2019 16:09:46 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: xen-devel@lists.xenproject.org Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Subject: [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: jgross@suse.com, oleksandr_tyshchenko@epam.com, sstabellini@kernel.org, julien@xen.org, Volodymyr_Babchuk@epam.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 domai= n *d, int res, i; int reg_size =3D addrcells + sizecells; int nr_cells =3D reg_size * mem->nr_banks; + /* Placeholder for memory@ + a 32-bit number + \0 */ + char buf[18]; __be32 reg[NR_MEM_BANKS * 4 /* Worst case addrcells + sizecells */]; __be32 *cells; =20 BUG_ON(nr_cells >=3D ARRAY_SIZE(reg)); + /* Nothing to do */ + if ( mem->nr_banks =3D=3D 0 ) + return 0; =20 dt_dprintk("Create memory node (reg size %d, nr cells %d)\n", reg_size, nr_cells); =20 /* ePAPR 3.4 */ - res =3D fdt_begin_node(fdt, "memory"); + snprintf(buf, sizeof(buf), "memory@%"PRIx64, mem->bank[0].start); + res =3D fdt_begin_node(fdt, buf); if ( res ) return res; =20 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel