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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D897C433F5 for ; Wed, 6 Oct 2021 10:38:15 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 A338761052 for ; Wed, 6 Oct 2021 10:38:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A338761052 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:57008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY4JR-0001Pc-UB for qemu-devel@archiver.kernel.org; Wed, 06 Oct 2021 06:38:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4I7-0000Ie-37 for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:36:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22690) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY4I5-0006ka-5R for qemu-devel@nongnu.org; Wed, 06 Oct 2021 06:36:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633516608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KOKjpdX1eUfRkCtEpyzXriLz/5ti4ma60fIzUz56kfQ=; b=YqCdlgs0BXfP5pbuBNTvz+iW/LQiFHDkQ56KD1BFkHSibdiCR/LpQFFMebBygq+XIMw88B +NZFQP2FEXLlLZwyyZNuFOLa0cK2JM7u+oGgnISfuhD7eKRIGRUDmvMmxNsciblhpCaMBM r7yOsUZCbXffGvK128pKnENVBA9KuS0= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-269-egLMtG86N7KK5Bpwtf97DQ-1; Wed, 06 Oct 2021 06:36:47 -0400 X-MC-Unique: egLMtG86N7KK5Bpwtf97DQ-1 Received: by mail-ed1-f71.google.com with SMTP id bo2-20020a0564020b2200b003db3540f206so2004029edb.23 for ; Wed, 06 Oct 2021 03:36:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KOKjpdX1eUfRkCtEpyzXriLz/5ti4ma60fIzUz56kfQ=; b=N4TAb0M2a1oYoBxegcebqV0OIQTem0XoBsjPUb/rHmeEETJl2+n/kkMrCIvweZC+Rz DKcIuircyKCEUOh58BgZKZcVTrtWwjNeLqIdgh1KdYiWQEGHPCpRUrldvP2rfogkRyp/ h6CVTB/GGEhOMlsshNXjuOZYjV3/XTJGAHQMeTzqrQbjgc6VFFfRRfylWPEZJJ2Fjoc9 G4Az09NZzt7m5p1owWsnkmmjkB0TsLbIKpC3lnzZwat2n8A9+mMJWKo5/DryydMD7I1s rI0d/2CQLv0qdIXysTf0vD7rsXMTdnkMk4pKa7yYmpJo44uh9NLdwXis283Ca5ngXEmW pT8w== X-Gm-Message-State: AOAM531X5vIvaACSL8q6FlyzI5nEXRXOGXofkImFrk+6KgG7hHIrEgtx tEvyZLG6y67UBMLrVcAs+2SqUMF0e2yKxGFfbME3jLI0yk5IfJlU0E0i7nOenCd+fuZkd3nCAgx D6P9bGQWLmYmPHfk= X-Received: by 2002:a17:906:25d7:: with SMTP id n23mr31166112ejb.322.1633516606162; Wed, 06 Oct 2021 03:36:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzRzXD8GTNb7xU+srA5+mEFfkyBVm0EO1sfPD3AZvyjV4yGYOWZ2yckswUhsGf+y/PlVtxiQ== X-Received: by 2002:a17:906:25d7:: with SMTP id n23mr31166096ejb.322.1633516606008; Wed, 06 Oct 2021 03:36:46 -0700 (PDT) Received: from gator.home (cst2-174-28.cust.vodafone.cz. [31.30.174.28]) by smtp.gmail.com with ESMTPSA id q23sm4755368ejr.0.2021.10.06.03.36.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 03:36:45 -0700 (PDT) Date: Wed, 6 Oct 2021 12:36:43 +0200 From: Andrew Jones To: Gavin Shan Subject: Re: [PATCH 2/2] hw/arm/virt: Don't create device-tree node for empty NUMA node Message-ID: <20211006103643.nzavhkf367pmackx@gator.home> References: <20211006102209.6989-1-gshan@redhat.com> <20211006102209.6989-3-gshan@redhat.com> MIME-Version: 1.0 In-Reply-To: <20211006102209.6989-3-gshan@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=drjones@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Received-SPF: pass client-ip=216.205.24.124; envelope-from=drjones@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org, shan.gavin@gmail.com, ehabkost@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Wed, Oct 06, 2021 at 06:22:09PM +0800, Gavin Shan wrote: > The empty NUMA node, where no memory resides, are allowed. For > example, the following command line specifies two empty NUMA nodes. > With this, QEMU fails to boot because of the conflicting device-tree > node names, as the following error message indicates. > > /home/gavin/sandbox/qemu.main/build/qemu-system-aarch64 \ > -accel kvm -machine virt,gic-version=host \ > -cpu host -smp 4,sockets=2,cores=2,threads=1 \ > -m 1024M,slots=16,maxmem=64G \ > -object memory-backend-ram,id=mem0,size=512M \ > -object memory-backend-ram,id=mem1,size=512M \ > -numa node,nodeid=0,cpus=0-1,memdev=mem0 \ > -numa node,nodeid=1,cpus=2-3,memdev=mem1 \ > -numa node,nodeid=2 \ > -numa node,nodeid=3 > : > qemu-system-aarch64: FDT: Failed to create subnode /memory@80000000: FDT_ERR_EXISTS > > As specified by linux device-tree binding document, the device-tree > nodes for these empty NUMA nodes shouldn't be generated. However, > the corresponding NUMA node IDs should be included in the distance > map device-tree node. This skips populating the device-tree nodes > for these empty NUMA nodes to avoid the error, so that QEMU can be > started successfully. > > Signed-off-by: Gavin Shan > --- > hw/arm/boot.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/hw/arm/boot.c b/hw/arm/boot.c > index 57efb61ee4..4e5898fcdc 100644 > --- a/hw/arm/boot.c > +++ b/hw/arm/boot.c > @@ -603,6 +603,10 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo, > mem_base = binfo->loader_start; > for (i = 0; i < ms->numa_state->num_nodes; i++) { > mem_len = ms->numa_state->nodes[i].node_mem; > + if (!mem_len) { > + continue; > + } > + > rc = fdt_add_memory_node(fdt, acells, mem_base, > scells, mem_len, i); > if (rc < 0) { > -- > 2.23.0 > Reviewed-by: Andrew Jones