Merge branch 'x86-irq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'x86-irq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86, 32-bit: Align percpu area and irq stacks to THREAD_SIZE
x86: Move alloc_desk_mask variables inside ifdef
x86-32: Align IRQ stacks properly
x86: Remove CONFIG_4KSTACKS
x86: Always use irq stacks

Fixed up trivial conflicts in include/linux/{irq.h, percpu-defs.h}

+25 -40
+3 -3
Documentation/x86/x86_64/kernel-stacks
··· 18 Used for external hardware interrupts. If this is the first external 19 hardware interrupt (i.e. not a nested hardware interrupt) then the 20 kernel switches from the current task to the interrupt stack. Like 21 - the split thread and interrupt stacks on i386 (with CONFIG_4KSTACKS), 22 - this gives more room for kernel interrupt processing without having 23 - to increase the size of every per thread stack. 24 25 The interrupt stack is also used when processing a softirq. 26
··· 18 Used for external hardware interrupts. If this is the first external 19 hardware interrupt (i.e. not a nested hardware interrupt) then the 20 kernel switches from the current task to the interrupt stack. Like 21 + the split thread and interrupt stacks on i386, this gives more room 22 + for kernel interrupt processing without having to increase the size 23 + of every per thread stack. 24 25 The interrupt stack is also used when processing a softirq. 26
-10
arch/x86/Kconfig.debug
··· 125 and the software setup of this feature. 126 If in doubt, say "N" 127 128 - config 4KSTACKS 129 - bool "Use 4Kb for kernel stacks instead of 8Kb" 130 - depends on X86_32 131 - ---help--- 132 - If you say Y here the kernel will use a 4Kb stacksize for the 133 - kernel stack attached to each process/thread. This facilitates 134 - running more threads on a system and also reduces the pressure 135 - on the VM subsystem for higher order allocations. This option 136 - will also use IRQ stacks to compensate for the reduced stackspace. 137 - 138 config DOUBLEFAULT 139 default y 140 bool "Enable doublefault exception handler" if EMBEDDED
··· 125 and the software setup of this feature. 126 If in doubt, say "N" 127 128 config DOUBLEFAULT 129 default y 130 bool "Enable doublefault exception handler" if EMBEDDED
+5 -7
arch/x86/include/asm/irq.h
··· 19 # define ARCH_HAS_NMI_WATCHDOG 20 #endif 21 22 - #ifdef CONFIG_4KSTACKS 23 - extern void irq_ctx_init(int cpu); 24 - extern void irq_ctx_exit(int cpu); 25 - # define __ARCH_HAS_DO_SOFTIRQ 26 #else 27 # define irq_ctx_init(cpu) do { } while (0) 28 # define irq_ctx_exit(cpu) do { } while (0) 29 - # ifdef CONFIG_X86_64 30 - # define __ARCH_HAS_DO_SOFTIRQ 31 - # endif 32 #endif 33 34 #ifdef CONFIG_HOTPLUG_CPU 35 #include <linux/cpumask.h>
··· 19 # define ARCH_HAS_NMI_WATCHDOG 20 #endif 21 22 + #ifdef CONFIG_X86_32 23 + extern void irq_ctx_init(int cpu); 24 + extern void irq_ctx_exit(int cpu); 25 #else 26 # define irq_ctx_init(cpu) do { } while (0) 27 # define irq_ctx_exit(cpu) do { } while (0) 28 #endif 29 + 30 + #define __ARCH_HAS_DO_SOFTIRQ 31 32 #ifdef CONFIG_HOTPLUG_CPU 33 #include <linux/cpumask.h>
+1 -6
arch/x86/include/asm/module.h
··· 60 #endif 61 62 #ifdef CONFIG_X86_32 63 - # ifdef CONFIG_4KSTACKS 64 - # define MODULE_STACKSIZE "4KSTACKS " 65 - # else 66 - # define MODULE_STACKSIZE "" 67 - # endif 68 - # define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_STACKSIZE 69 #endif 70 71 #endif /* _ASM_X86_MODULE_H */
··· 60 #endif 61 62 #ifdef CONFIG_X86_32 63 + # define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY 64 #endif 65 66 #endif /* _ASM_X86_MODULE_H */
-4
arch/x86/include/asm/page_32_types.h
··· 15 */ 16 #define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL) 17 18 - #ifdef CONFIG_4KSTACKS 19 - #define THREAD_ORDER 0 20 - #else 21 #define THREAD_ORDER 1 22 - #endif 23 #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) 24 25 #define STACKFAULT_STACK 0
··· 15 */ 16 #define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL) 17 18 #define THREAD_ORDER 1 19 #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) 20 21 #define STACKFAULT_STACK 0
+3 -9
arch/x86/kernel/irq_32.c
··· 49 static inline void print_stack_overflow(void) { } 50 #endif 51 52 - #ifdef CONFIG_4KSTACKS 53 /* 54 * per-CPU IRQ handling contexts (thread information and stack) 55 */ 56 union irq_ctx { 57 struct thread_info tinfo; 58 u32 stack[THREAD_SIZE/sizeof(u32)]; 59 - } __attribute__((aligned(PAGE_SIZE))); 60 61 static DEFINE_PER_CPU(union irq_ctx *, hardirq_ctx); 62 static DEFINE_PER_CPU(union irq_ctx *, softirq_ctx); 63 64 - static DEFINE_PER_CPU_PAGE_ALIGNED(union irq_ctx, hardirq_stack); 65 - static DEFINE_PER_CPU_PAGE_ALIGNED(union irq_ctx, softirq_stack); 66 67 static void call_on_stack(void *func, void *stack) 68 { ··· 185 186 local_irq_restore(flags); 187 } 188 - 189 - #else 190 - static inline int 191 - execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) { return 0; } 192 - #endif 193 194 bool handle_irq(unsigned irq, struct pt_regs *regs) 195 {
··· 49 static inline void print_stack_overflow(void) { } 50 #endif 51 52 /* 53 * per-CPU IRQ handling contexts (thread information and stack) 54 */ 55 union irq_ctx { 56 struct thread_info tinfo; 57 u32 stack[THREAD_SIZE/sizeof(u32)]; 58 + } __attribute__((aligned(THREAD_SIZE))); 59 60 static DEFINE_PER_CPU(union irq_ctx *, hardirq_ctx); 61 static DEFINE_PER_CPU(union irq_ctx *, softirq_ctx); 62 63 + static DEFINE_PER_CPU_MULTIPAGE_ALIGNED(union irq_ctx, hardirq_stack, THREAD_SIZE); 64 + static DEFINE_PER_CPU_MULTIPAGE_ALIGNED(union irq_ctx, softirq_stack, THREAD_SIZE); 65 66 static void call_on_stack(void *func, void *stack) 67 { ··· 186 187 local_irq_restore(flags); 188 } 189 190 bool handle_irq(unsigned irq, struct pt_regs *regs) 191 {
+1 -1
arch/x86/kernel/vmlinux.lds.S
··· 301 } 302 303 #if !defined(CONFIG_X86_64) || !defined(CONFIG_SMP) 304 - PERCPU(PAGE_SIZE) 305 #endif 306 307 . = ALIGN(PAGE_SIZE);
··· 301 } 302 303 #if !defined(CONFIG_X86_64) || !defined(CONFIG_SMP) 304 + PERCPU(THREAD_SIZE) 305 #endif 306 307 . = ALIGN(PAGE_SIZE);
+12
include/linux/percpu-defs.h
··· 148 DEFINE_PER_CPU_SECTION(type, name, "..readmostly") 149 150 /* 151 * Intermodule exports for per-CPU variables. sparse forgets about 152 * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to 153 * noop if __CHECKER__.
··· 148 DEFINE_PER_CPU_SECTION(type, name, "..readmostly") 149 150 /* 151 + * Declaration/definition used for large per-CPU variables that must be 152 + * aligned to something larger than the pagesize. 153 + */ 154 + #define DECLARE_PER_CPU_MULTIPAGE_ALIGNED(type, name, size) \ 155 + DECLARE_PER_CPU_SECTION(type, name, "..page_aligned") \ 156 + __aligned(size) 157 + 158 + #define DEFINE_PER_CPU_MULTIPAGE_ALIGNED(type, name, size) \ 159 + DEFINE_PER_CPU_SECTION(type, name, "..page_aligned") \ 160 + __aligned(size) 161 + 162 + /* 163 * Intermodule exports for per-CPU variables. sparse forgets about 164 * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to 165 * noop if __CHECKER__.