Commit 90321602 authored by Jan Beulich's avatar Jan Beulich Committed by Ingo Molnar

x86: Unify "numa=" command line option handling

In order to be able to suppress the use of SRAT tables that
32-bit Linux can't deal with (in one case known to lead to a
non-bootable system, unless disabling ACPI altogether), move the
"numa=" option handling to common code.
Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
Reviewed-by: default avatarThomas Renninger <trenn@suse.de>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Renninger <trenn@suse.de>
LKML-Reference: <4D36B581020000780002D0FF@vpn.id2.novell.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 6b35eb9d
#ifndef _ASM_X86_NUMA_32_H #ifndef _ASM_X86_NUMA_32_H
#define _ASM_X86_NUMA_32_H #define _ASM_X86_NUMA_32_H
extern int numa_off;
extern int pxm_to_nid(int pxm); extern int pxm_to_nid(int pxm);
extern void numa_remove_cpu(int cpu); extern void numa_remove_cpu(int cpu);
......
...@@ -40,6 +40,7 @@ extern void __cpuinit numa_remove_cpu(int cpu); ...@@ -40,6 +40,7 @@ extern void __cpuinit numa_remove_cpu(int cpu);
#ifdef CONFIG_NUMA_EMU #ifdef CONFIG_NUMA_EMU
#define FAKE_NODE_MIN_SIZE ((u64)32 << 20) #define FAKE_NODE_MIN_SIZE ((u64)32 << 20)
#define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL))
void numa_emu_cmdline(char *);
#endif /* CONFIG_NUMA_EMU */ #endif /* CONFIG_NUMA_EMU */
#else #else
static inline void init_cpu_to_node(void) { } static inline void init_cpu_to_node(void) { }
......
...@@ -2,6 +2,28 @@ ...@@ -2,6 +2,28 @@
#include <linux/topology.h> #include <linux/topology.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <asm/numa.h>
#include <asm/acpi.h>
int __initdata numa_off;
static __init int numa_setup(char *opt)
{
if (!opt)
return -EINVAL;
if (!strncmp(opt, "off", 3))
numa_off = 1;
#ifdef CONFIG_NUMA_EMU
if (!strncmp(opt, "fake=", 5))
numa_emu_cmdline(opt + 5);
#endif
#ifdef CONFIG_ACPI_NUMA
if (!strncmp(opt, "noacpi", 6))
acpi_numa = -1;
#endif
return 0;
}
early_param("numa", numa_setup);
/* /*
* Which logical CPUs are on which nodes * Which logical CPUs are on which nodes
......
...@@ -30,7 +30,6 @@ s16 apicid_to_node[MAX_LOCAL_APIC] __cpuinitdata = { ...@@ -30,7 +30,6 @@ s16 apicid_to_node[MAX_LOCAL_APIC] __cpuinitdata = {
[0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE
}; };
int numa_off __initdata;
static unsigned long __initdata nodemap_addr; static unsigned long __initdata nodemap_addr;
static unsigned long __initdata nodemap_size; static unsigned long __initdata nodemap_size;
...@@ -263,6 +262,11 @@ static struct bootnode nodes[MAX_NUMNODES] __initdata; ...@@ -263,6 +262,11 @@ static struct bootnode nodes[MAX_NUMNODES] __initdata;
static struct bootnode physnodes[MAX_NUMNODES] __cpuinitdata; static struct bootnode physnodes[MAX_NUMNODES] __cpuinitdata;
static char *cmdline __initdata; static char *cmdline __initdata;
void __init numa_emu_cmdline(char *str)
{
cmdline = str;
}
static int __init setup_physnodes(unsigned long start, unsigned long end, static int __init setup_physnodes(unsigned long start, unsigned long end,
int acpi, int amd) int acpi, int amd)
{ {
...@@ -670,24 +674,6 @@ unsigned long __init numa_free_all_bootmem(void) ...@@ -670,24 +674,6 @@ unsigned long __init numa_free_all_bootmem(void)
return pages; return pages;
} }
static __init int numa_setup(char *opt)
{
if (!opt)
return -EINVAL;
if (!strncmp(opt, "off", 3))
numa_off = 1;
#ifdef CONFIG_NUMA_EMU
if (!strncmp(opt, "fake=", 5))
cmdline = opt + 5;
#endif
#ifdef CONFIG_ACPI_NUMA
if (!strncmp(opt, "noacpi", 6))
acpi_numa = -1;
#endif
return 0;
}
early_param("numa", numa_setup);
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
static __init int find_near_online_node(int node) static __init int find_near_online_node(int node)
......
...@@ -59,7 +59,6 @@ static struct node_memory_chunk_s __initdata node_memory_chunk[MAXCHUNKS]; ...@@ -59,7 +59,6 @@ static struct node_memory_chunk_s __initdata node_memory_chunk[MAXCHUNKS];
static int __initdata num_memory_chunks; /* total number of memory chunks */ static int __initdata num_memory_chunks; /* total number of memory chunks */
static u8 __initdata apicid_to_pxm[MAX_APICID]; static u8 __initdata apicid_to_pxm[MAX_APICID];
int numa_off __initdata;
int acpi_numa __initdata; int acpi_numa __initdata;
static __init void bad_srat(void) static __init void bad_srat(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment