From nobody Sun Feb 8 18:43:16 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 1494416149872626.8720328911788; Wed, 10 May 2017 04:35:49 -0700 (PDT) Received: from localhost ([::1]:41949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8PuG-0003ZW-Hb for importer@patchew.org; Wed, 10 May 2017 07:35:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8PpC-0007ej-3y for qemu-devel@nongnu.org; Wed, 10 May 2017 07:30:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d8Pp9-0001kg-0r for qemu-devel@nongnu.org; Wed, 10 May 2017 07:30:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49594) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d8Pp6-0001jV-R0; Wed, 10 May 2017 07:30:28 -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 ACB0280F91; Wed, 10 May 2017 11:30:27 +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 BB9527DFF5; Wed, 10 May 2017 11:30:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ACB0280F91 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=imammedo@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com ACB0280F91 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Wed, 10 May 2017 13:29:51 +0200 Message-Id: <1494415802-227633-8-git-send-email-imammedo@redhat.com> In-Reply-To: <1494415802-227633-1-git-send-email-imammedo@redhat.com> References: <1494415802-227633-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.27]); Wed, 10 May 2017 11:30:27 +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 v3 07/18] numa: do default mapping based on possible_cpus instead of node_cpu bitmaps 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" Signed-off-by: Igor Mammedov Reviewed-by: David Gibson Reviewed-by: Andrew Jones --- numa.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/numa.c b/numa.c index 7db5dde..c89fc2d 100644 --- a/numa.c +++ b/numa.c @@ -458,6 +458,7 @@ void numa_default_auto_assign_ram(MachineClass *mc, Nod= eInfo *nodes, void parse_numa_opts(MachineState *ms) { int i; + const CPUArchIdList *possible_cpus; MachineClass *mc =3D MACHINE_GET_CLASS(ms); =20 for (i =3D 0; i < MAX_NODES; i++) { @@ -519,18 +520,21 @@ void parse_numa_opts(MachineState *ms) =20 numa_set_mem_ranges(); =20 - for (i =3D 0; i < nb_numa_nodes; i++) { - if (!bitmap_empty(numa_info[i].node_cpu, max_cpus)) { - break; - } - } - /* assign CPUs to nodes using board provided default mapping */ - if (!mc->cpu_index_to_instance_props) { + if (!mc->cpu_index_to_instance_props || !mc->possible_cpu_arch_ids= ) { error_report("default CPUs to NUMA node mapping isn't supporte= d"); exit(1); } - if (i =3D=3D nb_numa_nodes) { + + possible_cpus =3D mc->possible_cpu_arch_ids(ms); + for (i =3D 0; i < possible_cpus->len; i++) { + if (possible_cpus->cpus[i].props.has_node_id) { + break; + } + } + + /* no CPUs are assigned to NUMA nodes */ + if (i =3D=3D possible_cpus->len) { for (i =3D 0; i < max_cpus; i++) { CpuInstanceProperties props; /* fetch default mapping from board and enable it */ --=20 2.7.4