From patchwork Tue Apr 23 07:44:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Xu X-Patchwork-Id: 1089116 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44pFsk3BfKz9sNf for ; Tue, 23 Apr 2019 17:47:38 +1000 (AEST) Received: from localhost ([127.0.0.1]:49564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIq9Q-0001lr-BN for incoming@patchwork.ozlabs.org; Tue, 23 Apr 2019 03:47:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIq8V-0001iS-2O for qemu-devel@nongnu.org; Tue, 23 Apr 2019 03:46:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIq8U-0002qV-1y for qemu-devel@nongnu.org; Tue, 23 Apr 2019 03:46:39 -0400 Received: from mga11.intel.com ([192.55.52.93]:31624) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hIq8T-0002nl-PA for qemu-devel@nongnu.org; Tue, 23 Apr 2019 03:46:38 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2019 00:46:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,385,1549958400"; d="scan'208";a="163990238" Received: from tao-optiplex-7060.sh.intel.com ([10.239.13.92]) by fmsmga002.fm.intel.com with ESMTP; 23 Apr 2019 00:46:31 -0700 From: Tao Xu To: ehabkost@redhat.com, imammedo@redhat.com, pbonzini@redhat.com Date: Tue, 23 Apr 2019 15:44:25 +0800 Message-Id: <20190423074428.23031-1-tao3.xu@intel.com> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.93 Subject: [Qemu-devel] [PATCH v3 0/3] numa: move numa global variables into MachineState 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: jingqi.liu@intel.com, tao3.xu@intel.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The aim of this patch is to add struct NumaState in MachineState and move existing numa global nb_numa_nodes into NumaState. And add variable numa_support into MachineClass to decide which submachines support NUMA. --- Changes in v3 -> v2: - rename the "NumaState::nb_numa_nodes" as "NumaState::num_nodes", and rename the "NumaState::numa_info" as "NumaState::nodes" (Eduardo) - use machine_num_numa_nodes(MachineState *ms) to check if ms->numa_state is NULL before using NumaState::num_nodes (Eduardo) - check if ms->numa_state == NULL in the set_numa_options to avoid using -numa in a machine-type which don't support numa Changes in v2: - fix the mistake in numa_complete_configuration in numa.c - add MachineState into some functions to avoid using qdev_get_machine - add some if experssion to avoid the NumaState is null Tao Xu (3): numa: move numa global variable nb_numa_nodes into MachineState numa: move numa global variable have_numa_distance into MachineState numa: move numa global variable numa_info into MachineState exec.c | 5 +- hw/acpi/aml-build.c | 9 ++-- hw/arm/boot.c | 4 +- hw/arm/virt-acpi-build.c | 17 ++++--- hw/arm/virt.c | 8 +++- hw/core/machine.c | 21 ++++++-- hw/i386/acpi-build.c | 4 +- hw/i386/pc.c | 11 +++-- hw/mem/pc-dimm.c | 2 + hw/pci-bridge/pci_expander_bridge.c | 2 + hw/ppc/spapr.c | 25 ++++++++-- hw/ppc/spapr_pci.c | 2 + include/hw/acpi/aml-build.h | 2 +- include/hw/boards.h | 22 +++++++++ include/sysemu/numa.h | 13 +---- monitor.c | 4 +- numa.c | 74 +++++++++++++++++------------ 17 files changed, 155 insertions(+), 70 deletions(-)