From patchwork Mon Aug 14 10:11:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dou Liyang X-Patchwork-Id: 801129 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xWBH4120Zz9t2r for ; Mon, 14 Aug 2017 20:11:58 +1000 (AEST) Received: from localhost ([::1]:34782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhCLj-0008MC-QW for incoming@patchwork.ozlabs.org; Mon, 14 Aug 2017 06:11:55 -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 X-IronPort-AV: E=Sophos;i="5.41,372,1498492800"; d="scan'208";a="23503011" 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Currently, Using the fisrt node without memory on the machine makes QEMU unhappy. With this example command line: ... \ -m 1024M,slots=4,maxmem=32G \ -numa node,nodeid=0 \ -numa node,mem=1024M,nodeid=1 \ -numa node,nodeid=2 \ -numa node,nodeid=3 \ 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 == nb_numa_nodes) { assert(mc->numa_auto_assign_ram); mc->numa_auto_assign_ram(mc, numa_info, nb_numa_nodes, ram_size); + } else if (i != 0) { + error_report("The first NUMA node must have some memory" + " for building ACPI SART"); + exit(1); } numa_total = 0;