From patchwork Tue Sep 11 11:26:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 10595515 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13FBC920 for ; Tue, 11 Sep 2018 11:28:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03E8F28CD9 for ; Tue, 11 Sep 2018 11:28:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBB1028CFF; Tue, 11 Sep 2018 11:28:47 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 1A7C928CD9 for ; Tue, 11 Sep 2018 11:28:46 +0000 (UTC) Received: from localhost ([::1]:57023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzgqb-0001Xm-E2 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 11 Sep 2018 07:28:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzgoz-0006qi-4M for qemu-devel@nongnu.org; Tue, 11 Sep 2018 07:27:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzgoy-0000YB-BJ for qemu-devel@nongnu.org; Tue, 11 Sep 2018 07:27:05 -0400 Received: from mail-oi0-x241.google.com ([2607:f8b0:4003:c06::241]:35532) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fzgom-0000OE-W6; Tue, 11 Sep 2018 07:26:53 -0400 Received: by mail-oi0-x241.google.com with SMTP id m11-v6so46451494oic.2; Tue, 11 Sep 2018 04:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ti22XjzuA3P2U7p+yTUxOohe/3zSfTZFYWpxuFBcVTY=; b=uQDRatB1al/ZZnLCGJ5H+m1Ayr3lf1KW1au0xL7MJkPiqnjmfEQ0VMAxwvvS+6OjzZ 12IpZ3wRkJVxsI5srblbhNwYdBmRUSRjQ/sjwqKWXfT0B89yaL1kBgyQqViS4pKNT9Rb LoJSZJ5IoQzMAu1deMi49M3Mx8DQEkFmJIDGZ4h9h4mYYlUtNvLrcfwfUfM1qWtVVWsz Edx49e1omD/wZ02XKOCaoLFs14kgq9qJwCBpKUEN51i4fIT9HEORFvZdAt8M3qGpbY3a ya8s8JW/voortJ14wSJqfQ2Qp4OjzBoFRqI7xWqH80uXqX2oJwGdfeVDBVW0tiICjOsF MLTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ti22XjzuA3P2U7p+yTUxOohe/3zSfTZFYWpxuFBcVTY=; b=NR8KeVzIdGPin/QrnaRYzMj7v+zI2h39p0EO1x/3nlYPdxOAoE+zwdbfiScGo3Xsgc O7olYw/Yhu6P8KDmRMaalNEuJh02BkptOhpVfXmTJv7IqmwnCBTgks9vLqTO6NLC6xRJ yfJGXIpsdHo5kg0F4NZjH0Sz4FQHI+CGWEgC7dt/ouTq2P6SW5DtBcTUc77Otg++whVa +7vA2yLIcXexwO725liFp7pd6nKsh+gXC35ABKNHLF7pwwXZNpW2ak8O/JQXeaVbOLEn bTvaYQcY1B90yro82LxT+cNjkGkTe2JxBCU08dZics13dS2MpwKvbwzJai+htP7eKQMB nZEw== X-Gm-Message-State: APzg51AJw4PLxF7AU6U9S+Ljwa7OMjTL+Rjj2c7UY87jntyzOFTSZySf MnoFsgF+gDhth0bqB4Q8DZKEu+bt X-Google-Smtp-Source: ANB0VdbkFtQePfJupITBD5jZ2xbDjNv9lqDUjdXJlgQcuIAbr9m8ClHkhQQygq57sIieRcC0C31o0w== X-Received: by 2002:aca:7513:: with SMTP id q19-v6mr25237465oic.13.1536665210608; Tue, 11 Sep 2018 04:26:50 -0700 (PDT) Received: from MININT-0CAG7HA.hz.ali.com ([47.89.83.37]) by smtp.gmail.com with ESMTPSA id w84-v6sm15341456oie.40.2018.09.11.04.26.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Sep 2018 04:26:49 -0700 (PDT) From: Shannon Zhao X-Google-Original-From: Shannon Zhao To: qemu-arm@nongnu.org Date: Tue, 11 Sep 2018 19:26:43 +0800 Message-Id: <20180911112643.19296-1-shenglong.zsl@alibaba-inc.com> X-Mailer: git-send-email 2.18.0.windows.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::241 Subject: [Qemu-devel] [PATCH] hw/arm/virt-acpi-build: Add a check for memory-less NUMA nodes 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: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Shannon Zhao Like commit 16b4226(hw/acpi-build: Add a check for memory-less NUMA node ), it also needs to check memory length for NUMA nodes on ARM. Signed-off-by: Shannon Zhao Reviewed-by: Andrew Jones --- hw/arm/virt-acpi-build.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index ce31abd..5785fb6 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -562,10 +562,12 @@ build_srat(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) mem_base = vms->memmap[VIRT_MEM].base; for (i = 0; i < nb_numa_nodes; ++i) { - numamem = acpi_data_push(table_data, sizeof(*numamem)); - build_srat_memory(numamem, mem_base, numa_info[i].node_mem, i, - MEM_AFFINITY_ENABLED); - mem_base += numa_info[i].node_mem; + if (numa_info[i].node_mem > 0) { + numamem = acpi_data_push(table_data, sizeof(*numamem)); + build_srat_memory(numamem, mem_base, numa_info[i].node_mem, i, + MEM_AFFINITY_ENABLED); + mem_base += numa_info[i].node_mem; + } } build_header(linker, table_data, (void *)(table_data->data + srat_start),