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: 9898485 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 253A360230 for ; Mon, 14 Aug 2017 10:13:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 180BD2785D for ; Mon, 14 Aug 2017 10:13:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C4D528564; Mon, 14 Aug 2017 10:13:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 629A6285B9 for ; Mon, 14 Aug 2017 10:13:17 +0000 (UTC) Received: from localhost ([::1]:34782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhCM5-0008MC-IB for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Aug 2017 06:12:17 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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;