Loading arch/x86/Kconfig +13 −17 Original line number Diff line number Diff line Loading @@ -1223,6 +1223,10 @@ config HAVE_ARCH_BOOTMEM def_bool y depends on X86_32 && NUMA config HAVE_ARCH_ALLOC_REMAP def_bool y depends on X86_32 && NUMA config ARCH_HAVE_MEMORY_PRESENT def_bool y depends on X86_32 && DISCONTIGMEM Loading @@ -1231,13 +1235,9 @@ config NEED_NODE_MEMMAP_SIZE def_bool y depends on X86_32 && (DISCONTIGMEM || SPARSEMEM) config HAVE_ARCH_ALLOC_REMAP def_bool y depends on X86_32 && NUMA config ARCH_FLATMEM_ENABLE def_bool y depends on X86_32 && ARCH_SELECT_MEMORY_MODEL && !NUMA depends on X86_32 && !NUMA config ARCH_DISCONTIGMEM_ENABLE def_bool y Loading @@ -1247,20 +1247,16 @@ config ARCH_DISCONTIGMEM_DEFAULT def_bool y depends on NUMA && X86_32 config ARCH_PROC_KCORE_TEXT def_bool y depends on X86_64 && PROC_KCORE config ARCH_SPARSEMEM_DEFAULT def_bool y depends on X86_64 config ARCH_SPARSEMEM_ENABLE def_bool y depends on X86_64 || NUMA || (EXPERIMENTAL && X86_32) || X86_32_NON_STANDARD select SPARSEMEM_STATIC if X86_32 select SPARSEMEM_VMEMMAP_ENABLE if X86_64 config ARCH_SPARSEMEM_DEFAULT def_bool y depends on X86_64 config ARCH_SELECT_MEMORY_MODEL def_bool y depends on ARCH_SPARSEMEM_ENABLE Loading @@ -1269,6 +1265,10 @@ config ARCH_MEMORY_PROBE def_bool X86_64 depends on MEMORY_HOTPLUG config ARCH_PROC_KCORE_TEXT def_bool y depends on X86_64 && PROC_KCORE config ILLEGAL_POINTER_VALUE hex default 0 if X86_32 Loading Loading @@ -1703,10 +1703,6 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE def_bool y depends on MEMORY_HOTPLUG config HAVE_ARCH_EARLY_PFN_TO_NID def_bool X86_64 depends on NUMA config USE_PERCPU_NUMA_NODE_ID def_bool y depends on NUMA Loading arch/x86/include/asm/cpufeature.h +9 −4 Original line number Diff line number Diff line Loading @@ -207,8 +207,7 @@ extern const char * const x86_power_flags[32]; #define test_cpu_cap(c, bit) \ test_bit(bit, (unsigned long *)((c)->x86_capability)) #define cpu_has(c, bit) \ (__builtin_constant_p(bit) && \ #define REQUIRED_MASK_BIT_SET(bit) \ ( (((bit)>>5)==0 && (1UL<<((bit)&31) & REQUIRED_MASK0)) || \ (((bit)>>5)==1 && (1UL<<((bit)&31) & REQUIRED_MASK1)) || \ (((bit)>>5)==2 && (1UL<<((bit)&31) & REQUIRED_MASK2)) || \ Loading @@ -218,10 +217,16 @@ extern const char * const x86_power_flags[32]; (((bit)>>5)==6 && (1UL<<((bit)&31) & REQUIRED_MASK6)) || \ (((bit)>>5)==7 && (1UL<<((bit)&31) & REQUIRED_MASK7)) || \ (((bit)>>5)==8 && (1UL<<((bit)&31) & REQUIRED_MASK8)) || \ (((bit)>>5)==9 && (1UL<<((bit)&31) & REQUIRED_MASK9)) ) \ ? 1 : \ (((bit)>>5)==9 && (1UL<<((bit)&31) & REQUIRED_MASK9)) ) #define cpu_has(c, bit) \ (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \ test_cpu_cap(c, bit)) #define this_cpu_has(bit) \ (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \ x86_this_cpu_test_bit(bit, (unsigned long *)&cpu_info.x86_capability)) #define boot_cpu_has(bit) cpu_has(&boot_cpu_data, bit) #define set_cpu_cap(c, bit) set_bit(bit, (unsigned long *)((c)->x86_capability)) Loading arch/x86/include/asm/mmzone_64.h +0 −23 Original line number Diff line number Diff line Loading @@ -4,36 +4,13 @@ #ifndef _ASM_X86_MMZONE_64_H #define _ASM_X86_MMZONE_64_H #ifdef CONFIG_NUMA #include <linux/mmdebug.h> #include <asm/smp.h> /* Simple perfect hash to map physical addresses to node numbers */ struct memnode { int shift; unsigned int mapsize; s16 *map; s16 embedded_map[64 - 8]; } ____cacheline_aligned; /* total size = 128 bytes */ extern struct memnode memnode; #define memnode_shift memnode.shift #define memnodemap memnode.map #define memnodemapsize memnode.mapsize extern struct pglist_data *node_data[]; static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) { unsigned nid; VIRTUAL_BUG_ON(!memnodemap); nid = memnodemap[addr >> memnode_shift]; VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]); return nid; } #define NODE_DATA(nid) (node_data[nid]) #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) Loading arch/x86/include/asm/percpu.h +27 −0 Original line number Diff line number Diff line Loading @@ -542,6 +542,33 @@ do { \ old__; \ }) static __always_inline int x86_this_cpu_constant_test_bit(unsigned int nr, const unsigned long __percpu *addr) { unsigned long __percpu *a = (unsigned long *)addr + nr / BITS_PER_LONG; return ((1UL << (nr % BITS_PER_LONG)) & percpu_read(*a)) != 0; } static inline int x86_this_cpu_variable_test_bit(int nr, const unsigned long __percpu *addr) { int oldbit; asm volatile("bt "__percpu_arg(2)",%1\n\t" "sbb %0,%0" : "=r" (oldbit) : "m" (*(unsigned long *)addr), "Ir" (nr)); return oldbit; } #define x86_this_cpu_test_bit(nr, addr) \ (__builtin_constant_p((nr)) \ ? x86_this_cpu_constant_test_bit((nr), (addr)) \ : x86_this_cpu_variable_test_bit((nr), (addr))) #include <asm-generic/percpu.h> /* We can use this directly for local CPU (faster). */ Loading arch/x86/kernel/apic/apic.c +1 −1 Original line number Diff line number Diff line Loading @@ -505,7 +505,7 @@ static void __cpuinit setup_APIC_timer(void) { struct clock_event_device *levt = &__get_cpu_var(lapic_events); if (cpu_has(__this_cpu_ptr(&cpu_info), X86_FEATURE_ARAT)) { if (this_cpu_has(X86_FEATURE_ARAT)) { lapic_clockevent.features &= ~CLOCK_EVT_FEAT_C3STOP; /* Make LAPIC timer preferrable over percpu HPET */ lapic_clockevent.rating = 150; Loading Loading
arch/x86/Kconfig +13 −17 Original line number Diff line number Diff line Loading @@ -1223,6 +1223,10 @@ config HAVE_ARCH_BOOTMEM def_bool y depends on X86_32 && NUMA config HAVE_ARCH_ALLOC_REMAP def_bool y depends on X86_32 && NUMA config ARCH_HAVE_MEMORY_PRESENT def_bool y depends on X86_32 && DISCONTIGMEM Loading @@ -1231,13 +1235,9 @@ config NEED_NODE_MEMMAP_SIZE def_bool y depends on X86_32 && (DISCONTIGMEM || SPARSEMEM) config HAVE_ARCH_ALLOC_REMAP def_bool y depends on X86_32 && NUMA config ARCH_FLATMEM_ENABLE def_bool y depends on X86_32 && ARCH_SELECT_MEMORY_MODEL && !NUMA depends on X86_32 && !NUMA config ARCH_DISCONTIGMEM_ENABLE def_bool y Loading @@ -1247,20 +1247,16 @@ config ARCH_DISCONTIGMEM_DEFAULT def_bool y depends on NUMA && X86_32 config ARCH_PROC_KCORE_TEXT def_bool y depends on X86_64 && PROC_KCORE config ARCH_SPARSEMEM_DEFAULT def_bool y depends on X86_64 config ARCH_SPARSEMEM_ENABLE def_bool y depends on X86_64 || NUMA || (EXPERIMENTAL && X86_32) || X86_32_NON_STANDARD select SPARSEMEM_STATIC if X86_32 select SPARSEMEM_VMEMMAP_ENABLE if X86_64 config ARCH_SPARSEMEM_DEFAULT def_bool y depends on X86_64 config ARCH_SELECT_MEMORY_MODEL def_bool y depends on ARCH_SPARSEMEM_ENABLE Loading @@ -1269,6 +1265,10 @@ config ARCH_MEMORY_PROBE def_bool X86_64 depends on MEMORY_HOTPLUG config ARCH_PROC_KCORE_TEXT def_bool y depends on X86_64 && PROC_KCORE config ILLEGAL_POINTER_VALUE hex default 0 if X86_32 Loading Loading @@ -1703,10 +1703,6 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE def_bool y depends on MEMORY_HOTPLUG config HAVE_ARCH_EARLY_PFN_TO_NID def_bool X86_64 depends on NUMA config USE_PERCPU_NUMA_NODE_ID def_bool y depends on NUMA Loading
arch/x86/include/asm/cpufeature.h +9 −4 Original line number Diff line number Diff line Loading @@ -207,8 +207,7 @@ extern const char * const x86_power_flags[32]; #define test_cpu_cap(c, bit) \ test_bit(bit, (unsigned long *)((c)->x86_capability)) #define cpu_has(c, bit) \ (__builtin_constant_p(bit) && \ #define REQUIRED_MASK_BIT_SET(bit) \ ( (((bit)>>5)==0 && (1UL<<((bit)&31) & REQUIRED_MASK0)) || \ (((bit)>>5)==1 && (1UL<<((bit)&31) & REQUIRED_MASK1)) || \ (((bit)>>5)==2 && (1UL<<((bit)&31) & REQUIRED_MASK2)) || \ Loading @@ -218,10 +217,16 @@ extern const char * const x86_power_flags[32]; (((bit)>>5)==6 && (1UL<<((bit)&31) & REQUIRED_MASK6)) || \ (((bit)>>5)==7 && (1UL<<((bit)&31) & REQUIRED_MASK7)) || \ (((bit)>>5)==8 && (1UL<<((bit)&31) & REQUIRED_MASK8)) || \ (((bit)>>5)==9 && (1UL<<((bit)&31) & REQUIRED_MASK9)) ) \ ? 1 : \ (((bit)>>5)==9 && (1UL<<((bit)&31) & REQUIRED_MASK9)) ) #define cpu_has(c, bit) \ (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \ test_cpu_cap(c, bit)) #define this_cpu_has(bit) \ (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \ x86_this_cpu_test_bit(bit, (unsigned long *)&cpu_info.x86_capability)) #define boot_cpu_has(bit) cpu_has(&boot_cpu_data, bit) #define set_cpu_cap(c, bit) set_bit(bit, (unsigned long *)((c)->x86_capability)) Loading
arch/x86/include/asm/mmzone_64.h +0 −23 Original line number Diff line number Diff line Loading @@ -4,36 +4,13 @@ #ifndef _ASM_X86_MMZONE_64_H #define _ASM_X86_MMZONE_64_H #ifdef CONFIG_NUMA #include <linux/mmdebug.h> #include <asm/smp.h> /* Simple perfect hash to map physical addresses to node numbers */ struct memnode { int shift; unsigned int mapsize; s16 *map; s16 embedded_map[64 - 8]; } ____cacheline_aligned; /* total size = 128 bytes */ extern struct memnode memnode; #define memnode_shift memnode.shift #define memnodemap memnode.map #define memnodemapsize memnode.mapsize extern struct pglist_data *node_data[]; static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) { unsigned nid; VIRTUAL_BUG_ON(!memnodemap); nid = memnodemap[addr >> memnode_shift]; VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]); return nid; } #define NODE_DATA(nid) (node_data[nid]) #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) Loading
arch/x86/include/asm/percpu.h +27 −0 Original line number Diff line number Diff line Loading @@ -542,6 +542,33 @@ do { \ old__; \ }) static __always_inline int x86_this_cpu_constant_test_bit(unsigned int nr, const unsigned long __percpu *addr) { unsigned long __percpu *a = (unsigned long *)addr + nr / BITS_PER_LONG; return ((1UL << (nr % BITS_PER_LONG)) & percpu_read(*a)) != 0; } static inline int x86_this_cpu_variable_test_bit(int nr, const unsigned long __percpu *addr) { int oldbit; asm volatile("bt "__percpu_arg(2)",%1\n\t" "sbb %0,%0" : "=r" (oldbit) : "m" (*(unsigned long *)addr), "Ir" (nr)); return oldbit; } #define x86_this_cpu_test_bit(nr, addr) \ (__builtin_constant_p((nr)) \ ? x86_this_cpu_constant_test_bit((nr), (addr)) \ : x86_this_cpu_variable_test_bit((nr), (addr))) #include <asm-generic/percpu.h> /* We can use this directly for local CPU (faster). */ Loading
arch/x86/kernel/apic/apic.c +1 −1 Original line number Diff line number Diff line Loading @@ -505,7 +505,7 @@ static void __cpuinit setup_APIC_timer(void) { struct clock_event_device *levt = &__get_cpu_var(lapic_events); if (cpu_has(__this_cpu_ptr(&cpu_info), X86_FEATURE_ARAT)) { if (this_cpu_has(X86_FEATURE_ARAT)) { lapic_clockevent.features &= ~CLOCK_EVT_FEAT_C3STOP; /* Make LAPIC timer preferrable over percpu HPET */ lapic_clockevent.rating = 150; Loading