Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b4fa851 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge branch 'x86/numa' into x86/devel



Conflicts:

	arch/x86/Kconfig
	arch/x86/kernel/e820.c
	arch/x86/kernel/efi_64.c
	arch/x86/kernel/mpparse.c
	arch/x86/kernel/setup.c
	arch/x86/kernel/setup_32.c
	arch/x86/mm/init_64.c
	include/asm-x86/proto.h

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parents 3de352bb 46f68e1c
Loading
Loading
Loading
Loading
+31 −4
Original line number Original line Diff line number Diff line
@@ -121,7 +121,7 @@ config ARCH_HAS_CACHE_LINE_SIZE
	def_bool y
	def_bool y


config HAVE_SETUP_PER_CPU_AREA
config HAVE_SETUP_PER_CPU_AREA
	def_bool X86_64 || (X86_SMP && !X86_VOYAGER)
	def_bool X86_64_SMP || (X86_SMP && !X86_VOYAGER)


config HAVE_CPUMASK_OF_CPU_MAP
config HAVE_CPUMASK_OF_CPU_MAP
	def_bool X86_64_SMP
	def_bool X86_64_SMP
@@ -579,7 +579,21 @@ config SWIOTLB


config IOMMU_HELPER
config IOMMU_HELPER
	def_bool (CALGARY_IOMMU || GART_IOMMU || SWIOTLB)
	def_bool (CALGARY_IOMMU || GART_IOMMU || SWIOTLB)
config MAXSMP
	bool "Configure Maximum number of SMP Processors and NUMA Nodes"
	depends on X86_64 && SMP
	default n
	help
	  Configure maximum number of CPUS and NUMA Nodes for this architecture.
	  If unsure, say N.


if MAXSMP
config NR_CPUS
	int
	default "4096"
endif

if !MAXSMP
config NR_CPUS
config NR_CPUS
	int "Maximum number of CPUs (2-4096)"
	int "Maximum number of CPUs (2-4096)"
	range 2 4096
	range 2 4096
@@ -592,7 +606,8 @@ config NR_CPUS
	  minimum value which makes sense is 2.
	  minimum value which makes sense is 2.


	  This is purely to save memory - each supported CPU adds
	  This is purely to save memory - each supported CPU adds
	  approximately one kilobyte to the kernel image.
	  approximately eight kilobytes to the kernel image.
endif


config SCHED_SMT
config SCHED_SMT
	bool "SMT (Hyperthreading) scheduler support"
	bool "SMT (Hyperthreading) scheduler support"
@@ -983,13 +998,25 @@ config NUMA_EMU
	  into virtual nodes when booted with "numa=fake=N", where N is the
	  into virtual nodes when booted with "numa=fake=N", where N is the
	  number of nodes. This is only useful for debugging.
	  number of nodes. This is only useful for debugging.


if MAXSMP

config NODES_SHIFT
	int
	default "9"
endif

if !MAXSMP
config NODES_SHIFT
config NODES_SHIFT
	int "Max num nodes shift(1-9)"
	int "Maximum NUMA Nodes (as a power of 2)"
	range 1 9   if X86_64
	range 1 9   if X86_64
	default "6" if X86_64
	default "6" if X86_64
	default "4" if X86_NUMAQ
	default "4" if X86_NUMAQ
	default "3"
	default "3"
	depends on NEED_MULTIPLE_NODES
	depends on NEED_MULTIPLE_NODES
	help
	  Specify the maximum number of NUMA Nodes available on the target
	  system.  Increases memory reserved to accomodate various tables.
endif


config HAVE_ARCH_BOOTMEM_NODE
config HAVE_ARCH_BOOTMEM_NODE
	def_bool y
	def_bool y
+1 −1
Original line number Original line Diff line number Diff line
@@ -68,7 +68,7 @@ config DEBUG_PAGEALLOC
config DEBUG_PER_CPU_MAPS
config DEBUG_PER_CPU_MAPS
	bool "Debug access to per_cpu maps"
	bool "Debug access to per_cpu maps"
	depends on DEBUG_KERNEL
	depends on DEBUG_KERNEL
	depends on X86_64_SMP
	depends on X86_SMP
	default n
	default n
	help
	help
	  Say Y to verify that the per_cpu map being accessed has
	  Say Y to verify that the per_cpu map being accessed has
+3 −6
Original line number Original line Diff line number Diff line
@@ -52,9 +52,6 @@


unsigned long mp_lapic_addr;
unsigned long mp_lapic_addr;


DEFINE_PER_CPU(u16, x86_bios_cpu_apicid) = BAD_APICID;
EXPORT_PER_CPU_SYMBOL(x86_bios_cpu_apicid);

/*
/*
 * Knob to control our willingness to enable the local APIC.
 * Knob to control our willingness to enable the local APIC.
 *
 *
@@ -1546,9 +1543,9 @@ void __cpuinit generic_processor_info(int apicid, int version)
	}
	}
#ifdef CONFIG_SMP
#ifdef CONFIG_SMP
	/* are we being called early in kernel startup? */
	/* are we being called early in kernel startup? */
	if (x86_cpu_to_apicid_early_ptr) {
	if (early_per_cpu_ptr(x86_cpu_to_apicid)) {
		u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr;
		u16 *cpu_to_apicid = early_per_cpu_ptr(x86_cpu_to_apicid);
		u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
		u16 *bios_cpu_apicid = early_per_cpu_ptr(x86_bios_cpu_apicid);


		cpu_to_apicid[cpu] = apicid;
		cpu_to_apicid[cpu] = apicid;
		bios_cpu_apicid[cpu] = apicid;
		bios_cpu_apicid[cpu] = apicid;
+4 −7
Original line number Original line Diff line number Diff line
@@ -90,9 +90,6 @@ static unsigned long apic_phys;


unsigned long mp_lapic_addr;
unsigned long mp_lapic_addr;


DEFINE_PER_CPU(u16, x86_bios_cpu_apicid) = BAD_APICID;
EXPORT_PER_CPU_SYMBOL(x86_bios_cpu_apicid);

unsigned int __cpuinitdata maxcpus = NR_CPUS;
unsigned int __cpuinitdata maxcpus = NR_CPUS;
/*
/*
 * Get the LAPIC version
 * Get the LAPIC version
@@ -1075,9 +1072,9 @@ void __cpuinit generic_processor_info(int apicid, int version)
		max_physical_apicid = apicid;
		max_physical_apicid = apicid;


	/* are we being called early in kernel startup? */
	/* are we being called early in kernel startup? */
	if (x86_cpu_to_apicid_early_ptr) {
	if (early_per_cpu_ptr(x86_cpu_to_apicid)) {
		u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr;
		u16 *cpu_to_apicid = early_per_cpu_ptr(x86_cpu_to_apicid);
		u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
		u16 *bios_cpu_apicid = early_per_cpu_ptr(x86_bios_cpu_apicid);


		cpu_to_apicid[cpu] = apicid;
		cpu_to_apicid[cpu] = apicid;
		bios_cpu_apicid[cpu] = apicid;
		bios_cpu_apicid[cpu] = apicid;
@@ -1253,7 +1250,7 @@ __cpuinit int apic_is_clustered_box(void)
	if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && !is_vsmp_box())
	if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && !is_vsmp_box())
		return 0;
		return 0;


	bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
	bios_cpu_apicid = early_per_cpu_ptr(x86_bios_cpu_apicid);
	bitmap_zero(clustermap, NUM_APIC_CLUSTERS);
	bitmap_zero(clustermap, NUM_APIC_CLUSTERS);


	for (i = 0; i < NR_CPUS; i++) {
	for (i = 0; i < NR_CPUS; i++) {
+19 −3
Original line number Original line Diff line number Diff line
@@ -25,6 +25,20 @@
#include <asm/e820.h>
#include <asm/e820.h>
#include <asm/bios_ebda.h>
#include <asm/bios_ebda.h>


/* boot cpu pda */
static struct x8664_pda _boot_cpu_pda __read_mostly;

#ifdef CONFIG_SMP
/*
 * We install an empty cpu_pda pointer table to indicate to early users
 * (numa_set_node) that the cpu_pda pointer table for cpus other than
 * the boot cpu is not yet setup.
 */
static struct x8664_pda *__cpu_pda[NR_CPUS] __initdata;
#else
static struct x8664_pda *__cpu_pda[NR_CPUS] __read_mostly;
#endif

static void __init zap_identity_mappings(void)
static void __init zap_identity_mappings(void)
{
{
	pgd_t *pgd = pgd_offset_k(0UL);
	pgd_t *pgd = pgd_offset_k(0UL);
@@ -88,10 +102,12 @@ void __init x86_64_start_kernel(char * real_mode_data)


	early_printk("Kernel alive\n");
	early_printk("Kernel alive\n");


 	for (i = 0; i < NR_CPUS; i++)
	_cpu_pda = __cpu_pda;
 		cpu_pda(i) = &boot_cpu_pda[i];
	cpu_pda(0) = &_boot_cpu_pda;

	pda_init(0);
	pda_init(0);

	early_printk("Kernel really alive\n");

	copy_bootdata(__va(real_mode_data));
	copy_bootdata(__va(real_mode_data));


	reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS");
	reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS");
Loading