From nobody Mon Feb 9 04:03:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1493816756294261.07530424887034; Wed, 3 May 2017 06:05:56 -0700 (PDT) Received: from localhost ([::1]:36623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5tyX-0006V7-UQ for importer@patchew.org; Wed, 03 May 2017 09:05:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5tr6-0008UJ-Qg for qemu-devel@nongnu.org; Wed, 03 May 2017 08:58:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5tr6-00012o-1O for qemu-devel@nongnu.org; Wed, 03 May 2017 08:58:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52292) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d5tr3-0000yQ-Ic; Wed, 03 May 2017 08:58:05 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C96620264; Wed, 3 May 2017 12:58:02 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.34.112.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E5E917C5A; Wed, 3 May 2017 12:58:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8C96620264 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=imammedo@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8C96620264 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Wed, 3 May 2017 14:57:08 +0200 Message-Id: <1493816238-33120-15-git-send-email-imammedo@redhat.com> In-Reply-To: <1493816238-33120-1-git-send-email-imammedo@redhat.com> References: <1493816238-33120-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 03 May 2017 12:58:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 14/24] spapr: get numa node mapping from possible_cpus instead of numa_get_node_for_cpu() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Andrew Jones , Eduardo Habkost , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Shannon Zhao , Paolo Bonzini , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" it's safe to remove thread node_id !=3D core node_id error branch as machine_set_cpu_numa_node() also does mismatch check and is called even before any CPU is created. Signed-off-by: Igor Mammedov Acked-by: David Gibson --- hw/ppc/spapr.c | 4 ++-- hw/ppc/spapr_cpu_core.c | 14 ++------------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 7f58ee4..bcb91e7 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2863,8 +2863,8 @@ static void spapr_core_pre_plug(HotplugHandler *hotpl= ug_dev, DeviceState *dev, goto out; } =20 - node_id =3D numa_get_node_for_cpu(cc->core_id); - if (node_id =3D=3D nb_numa_nodes) { + node_id =3D core_slot->props.node_id; + if (!core_slot->props.has_node_id) { /* by default CPUState::numa_node was 0 if it's not set via CLI * keep it this way for now but in future we probably should * refuse to start up with incomplete numa mapping */ diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 9de7a56..a17ea07 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -181,7 +181,6 @@ static void spapr_cpu_core_realize(DeviceState *dev, Er= ror **errp) =20 sc->threads =3D g_malloc0(size * cc->nr_threads); for (i =3D 0; i < cc->nr_threads; i++) { - int node_id; char id[32]; CPUState *cs; =20 @@ -191,17 +190,8 @@ static void spapr_cpu_core_realize(DeviceState *dev, E= rror **errp) cs =3D CPU(obj); cs->cpu_index =3D cc->core_id + i; =20 - /* Set NUMA node for the added CPUs */ - node_id =3D numa_get_node_for_cpu(cs->cpu_index); - if (node_id !=3D sc->node_id) { - error_setg(&local_err, "Invalid node-id=3D%d of thread[cpu-ind= ex: %d]" - " on CPU[core-id: %d, node-id: %d], node-id must be the sa= me", - node_id, cs->cpu_index, cc->core_id, sc->node_id); - goto err; - } - if (node_id < nb_numa_nodes) { - cs->numa_node =3D node_id; - } + /* Set NUMA node for the threads belonged to core */ + cs->numa_node =3D sc->node_id; =20 snprintf(id, sizeof(id), "thread[%d]", i); object_property_add_child(OBJECT(sc), id, obj, &local_err); --=20 2.7.4