Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757879AbcLOLx2 (ORCPT ); Thu, 15 Dec 2016 06:53:28 -0500 Received: from terminus.zytor.com ([198.137.202.10]:42416 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757794AbcLOLxY (ORCPT ); Thu, 15 Dec 2016 06:53:24 -0500 Date: Thu, 15 Dec 2016 03:53:10 -0800 From: tip-bot for Boris Ostrovsky Message-ID: Cc: tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, boris.ostrovsky@oracle.com, hpa@zytor.com Reply-To: hpa@zytor.com, boris.ostrovsky@oracle.com, linux-kernel@vger.kernel.org, mingo@kernel.org, tglx@linutronix.de In-Reply-To: <1481602709-18260-1-git-send-email-boris.ostrovsky@oracle.com> References: <1481602709-18260-1-git-send-email-boris.ostrovsky@oracle.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] ACPI/NUMA: Do not map pxm to node when NUMA is turned off Git-Commit-ID: aec03f89e905dca9ce4b061e03ee1da3a3eb3432 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3386 Lines: 101 Commit-ID: aec03f89e905dca9ce4b061e03ee1da3a3eb3432 Gitweb: http://git.kernel.org/tip/aec03f89e905dca9ce4b061e03ee1da3a3eb3432 Author: Boris Ostrovsky AuthorDate: Mon, 12 Dec 2016 23:18:29 -0500 Committer: Thomas Gleixner CommitDate: Thu, 15 Dec 2016 11:32:32 +0100 ACPI/NUMA: Do not map pxm to node when NUMA is turned off acpi_map_pxm_to_node() unconditially maps nodes even when NUMA is turned off. So acpi_get_node() might return a node > 0, which is fatal when NUMA is disabled as the rest of the kernel assumes that only node 0 exists. Expose numa_off to the acpi code and return NUMA_NO_NODE when it's set. Signed-off-by: Boris Ostrovsky Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: linux-ia64@vger.kernel.org Cc: catalin.marinas@arm.com Cc: rjw@rjwysocki.net Cc: will.deacon@arm.com Cc: linux-acpi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: lenb@kernel.org Link: http://lkml.kernel.org/r/1481602709-18260-1-git-send-email-boris.ostrovsky@oracle.com Signed-off-by: Thomas Gleixner --- arch/arm64/include/asm/numa.h | 2 ++ arch/arm64/mm/numa.c | 2 +- arch/ia64/include/asm/numa.h | 2 ++ arch/x86/mm/numa.c | 2 +- drivers/acpi/numa.c | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm64/include/asm/numa.h b/arch/arm64/include/asm/numa.h index 600887e..bf466d1 100644 --- a/arch/arm64/include/asm/numa.h +++ b/arch/arm64/include/asm/numa.h @@ -15,6 +15,8 @@ int __node_distance(int from, int to); extern nodemask_t numa_nodes_parsed __initdata; +extern bool numa_off; + /* Mappings between node number and cpus on that node. */ extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES]; void numa_clear_node(unsigned int cpu); diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c index 4b32168..b388a99 100644 --- a/arch/arm64/mm/numa.c +++ b/arch/arm64/mm/numa.c @@ -35,7 +35,7 @@ static int cpu_to_node_map[NR_CPUS] = { [0 ... NR_CPUS-1] = NUMA_NO_NODE }; static int numa_distance_cnt; static u8 *numa_distance; -static bool numa_off; +bool numa_off; static __init int numa_parse_early_param(char *opt) { diff --git a/arch/ia64/include/asm/numa.h b/arch/ia64/include/asm/numa.h index 2db0a6c..ebef7f4 100644 --- a/arch/ia64/include/asm/numa.h +++ b/arch/ia64/include/asm/numa.h @@ -65,6 +65,8 @@ extern int paddr_to_nid(unsigned long paddr); #define local_nodeid (cpu_to_node_map[smp_processor_id()]) +#define numa_off 0 + extern void map_cpu_to_node(int cpu, int nid); extern void unmap_cpu_from_node(int cpu, int nid); extern void numa_clear_node(int cpu); diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 3f35b48..12dcad7 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -19,7 +19,7 @@ #include "numa_internal.h" -int __initdata numa_off; +int numa_off; nodemask_t numa_nodes_parsed __initdata; struct pglist_data *node_data[MAX_NUMNODES] __read_mostly; diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index ce3a7a1..edb0c79 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c @@ -70,7 +70,7 @@ int acpi_map_pxm_to_node(int pxm) { int node; - if (pxm < 0 || pxm >= MAX_PXM_DOMAINS) + if (pxm < 0 || pxm >= MAX_PXM_DOMAINS || numa_off) return NUMA_NO_NODE; node = pxm_to_node_map[pxm];