From nobody Sat Apr 27 17:26:38 2024 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502705556204854.6530402876062; Mon, 14 Aug 2017 03:12:36 -0700 (PDT) Received: from localhost ([::1]:34811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhCMI-0000L2-AA for importer@patchew.org; Mon, 14 Aug 2017 06:12:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhCLP-0008LB-BN for qemu-devel@nongnu.org; Mon, 14 Aug 2017 06:11:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dhCLL-0002aV-6P for qemu-devel@nongnu.org; Mon, 14 Aug 2017 06:11:35 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:11471 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhCLK-0002WB-Qk for qemu-devel@nongnu.org; Mon, 14 Aug 2017 06:11:31 -0400 Received: from localhost (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 14 Aug 2017 18:11:22 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id DEBF147227B3; Mon, 14 Aug 2017 18:11:18 +0800 (CST) Received: from localhost.localdomain.localdomain (10.167.226.106) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 14 Aug 2017 18:11:21 +0800 X-IronPort-AV: E=Sophos;i="5.41,372,1498492800"; d="scan'208";a="23503011" From: Dou Liyang To: Date: Mon, 14 Aug 2017 18:11:11 +0800 Message-ID: <1502705471-28407-1-git-send-email-douly.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: DEBF147227B3.A0FCA X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 183.91.158.132 Subject: [Qemu-devel] [PATCH] numa: Add a check whether the node0 has memory or not 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: Dou Liyang , ehabkost@redhat.com, david@redhat.com, armbru@redhat.com, dgilbert@redhat.com, imammedo@redhat.com 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 Content-Type: text/plain; charset="utf-8" Currently, Using the fisrt node without memory on the machine makes QEMU unhappy. With this example command line: ... \ -m 1024M,slots=3D4,maxmem=3D32G \ -numa node,nodeid=3D0 \ -numa node,mem=3D1024M,nodeid=3D1 \ -numa node,nodeid=3D2 \ -numa node,nodeid=3D3 \ Guest reports "No NUMA configuration found" and the NUMA topology is wrong. This is because when QEMU builds ACPI SRAT, it regards node0 as the default node to deal with the memory hole(640K-1M). this means the node0 must have some memory(>1M) firstly. Add a check in parse_numa_opts to avoid this situation. Signed-off-by: Dou Liyang --- numa.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/numa.c b/numa.c index e32af04..1d6f73f 100644 --- a/numa.c +++ b/numa.c @@ -464,6 +464,10 @@ void parse_numa_opts(MachineState *ms) if (i =3D=3D nb_numa_nodes) { assert(mc->numa_auto_assign_ram); mc->numa_auto_assign_ram(mc, numa_info, nb_numa_nodes, ram_siz= e); + } else if (i !=3D 0) { + error_report("The first NUMA node must have some memory" + " for building ACPI SART"); + exit(1); } =20 numa_total =3D 0; --=20 2.5.5