From nobody Wed Oct 22 13:05:15 2025 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519407625029192.33801714307776; Fri, 23 Feb 2018 09:40:25 -0800 (PST) Received: from localhost ([::1]:46362 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epHKV-0002QJ-C3 for importer@patchew.org; Fri, 23 Feb 2018 12:40:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epHHO-0000VG-T4 for qemu-devel@nongnu.org; Fri, 23 Feb 2018 12:37:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epHHJ-0000b7-W3 for qemu-devel@nongnu.org; Fri, 23 Feb 2018 12:37:06 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36170 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1epHHJ-0000ao-RN; Fri, 23 Feb 2018 12:37:01 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 673E54027E5D; Fri, 23 Feb 2018 17:37:01 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-252.ams2.redhat.com [10.36.117.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46FAC9C04F; Fri, 23 Feb 2018 17:36:58 +0000 (UTC) From: David Hildenbrand To: qemu-s390x@nongnu.org Date: Fri, 23 Feb 2018 18:36:57 +0100 Message-Id: <20180223173657.29125-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 23 Feb 2018 17:37:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 23 Feb 2018 17:37:01 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v1] numa: s390x has no NUMA 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: Christian Borntraeger , Cornelia Huck , David Hildenbrand , qemu-devel@nongnu.org, Eduardo Habkost 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" Right now it is possible to crash QEMU for s390x by providing e.g. -numa node,nodeid=3D0,cpus=3D0-1 Problem is, that numa.c uses mc->cpu_index_to_instance_props as an indicator whether NUMA is supported by a machine type. We don't implement NUMA on s390x (and that concept also doesn't really exist). We need mc->cpu_index_to_instance_props for query-cpus. So let's fix this case. qemu-system-s390x: -numa node,nodeid=3D0,cpus=3D0-1: NUMA is not supported = by this machine-type Signed-off-by: David Hildenbrand Reviewed-by: Claudio Imbrenda --- numa.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/numa.c b/numa.c index 7e0e789b02..3b9be613d9 100644 --- a/numa.c +++ b/numa.c @@ -80,10 +80,16 @@ static void parse_numa_node(MachineState *ms, NumaNodeO= ptions *node, return; } =20 +#ifdef TARGET_S390X + /* s390x provides cpu_index_to_instance_props but has no NUMA */ + error_report("NUMA is not supported by this machine-type"); + exit(1); +#else if (!mc->cpu_index_to_instance_props) { error_report("NUMA is not supported by this machine-type"); exit(1); } +#endif for (cpus =3D node->cpus; cpus; cpus =3D cpus->next) { CpuInstanceProperties props; if (cpus->value >=3D max_cpus) { --=20 2.14.3