diff options
| -rw-r--r-- | arch/x86/Kconfig | 1 | ||||
| -rw-r--r-- | arch/x86/include/asm/irq.h | 2 | ||||
| -rw-r--r-- | arch/x86/include/asm/smp.h | 9 | ||||
| -rw-r--r-- | arch/x86/kernel/dumpstack_32.c | 6 | ||||
| -rw-r--r-- | arch/x86/kernel/dumpstack_64.c | 8 | ||||
| -rw-r--r-- | arch/x86/kernel/irq_32.c | 12 | ||||
| -rw-r--r-- | arch/x86/kernel/reboot.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/smp.c | 15 | ||||
| -rw-r--r-- | arch/x86/kernel/smpboot.c | 1 | ||||
| -rw-r--r-- | arch/x86/xen/enlighten.c | 2 | ||||
| -rw-r--r-- | arch/x86/xen/smp.c | 6 | ||||
| -rw-r--r-- | include/linux/percpu-defs.h | 12 |
12 files changed, 31 insertions, 45 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index dfabfefc21c4..299fbc86f570 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
| @@ -347,6 +347,7 @@ endif | |||
| 347 | 347 | ||
| 348 | config X86_VSMP | 348 | config X86_VSMP |
| 349 | bool "ScaleMP vSMP" | 349 | bool "ScaleMP vSMP" |
| 350 | select PARAVIRT_GUEST | ||
| 350 | select PARAVIRT | 351 | select PARAVIRT |
| 351 | depends on X86_64 && PCI | 352 | depends on X86_64 && PCI |
| 352 | depends on X86_EXTENDED_PLATFORM | 353 | depends on X86_EXTENDED_PLATFORM |
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h index 0bf5b0083650..13b0ebaa512f 100644 --- a/arch/x86/include/asm/irq.h +++ b/arch/x86/include/asm/irq.h | |||
| @@ -21,10 +21,8 @@ static inline int irq_canonicalize(int irq) | |||
| 21 | 21 | ||
| 22 | #ifdef CONFIG_X86_32 | 22 | #ifdef CONFIG_X86_32 |
| 23 | extern void irq_ctx_init(int cpu); | 23 | extern void irq_ctx_init(int cpu); |
| 24 | extern void irq_ctx_exit(int cpu); | ||
| 25 | #else | 24 | #else |
| 26 | # define irq_ctx_init(cpu) do { } while (0) | 25 | # define irq_ctx_init(cpu) do { } while (0) |
| 27 | # define irq_ctx_exit(cpu) do { } while (0) | ||
| 28 | #endif | 26 | #endif |
| 29 | 27 | ||
| 30 | #define __ARCH_HAS_DO_SOFTIRQ | 28 | #define __ARCH_HAS_DO_SOFTIRQ |
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index 4cfc90824068..4c2f63c7fc1b 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h | |||
| @@ -50,7 +50,7 @@ struct smp_ops { | |||
| 50 | void (*smp_prepare_cpus)(unsigned max_cpus); | 50 | void (*smp_prepare_cpus)(unsigned max_cpus); |
| 51 | void (*smp_cpus_done)(unsigned max_cpus); | 51 | void (*smp_cpus_done)(unsigned max_cpus); |
| 52 | 52 | ||
| 53 | void (*smp_send_stop)(void); | 53 | void (*stop_other_cpus)(int wait); |
| 54 | void (*smp_send_reschedule)(int cpu); | 54 | void (*smp_send_reschedule)(int cpu); |
| 55 | 55 | ||
| 56 | int (*cpu_up)(unsigned cpu); | 56 | int (*cpu_up)(unsigned cpu); |
| @@ -73,7 +73,12 @@ extern struct smp_ops smp_ops; | |||
| 73 | 73 | ||
| 74 | static inline void smp_send_stop(void) | 74 | static inline void smp_send_stop(void) |
| 75 | { | 75 | { |
| 76 | smp_ops.smp_send_stop(); | 76 | smp_ops.stop_other_cpus(0); |
| 77 | } | ||
| 78 | |||
| 79 | static inline void stop_other_cpus(void) | ||
| 80 | { | ||
| 81 | smp_ops.stop_other_cpus(1); | ||
| 77 | } | 82 | } |
| 78 | 83 | ||
| 79 | static inline void smp_prepare_boot_cpu(void) | 84 | static inline void smp_prepare_boot_cpu(void) |
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c index 0f6376ffa2d9..1bc7f75a5bda 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c | |||
| @@ -82,11 +82,11 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, | |||
| 82 | if (kstack_end(stack)) | 82 | if (kstack_end(stack)) |
| 83 | break; | 83 | break; |
| 84 | if (i && ((i % STACKSLOTS_PER_LINE) == 0)) | 84 | if (i && ((i % STACKSLOTS_PER_LINE) == 0)) |
| 85 | printk("\n%s", log_lvl); | 85 | printk(KERN_CONT "\n"); |
| 86 | printk(" %08lx", *stack++); | 86 | printk(KERN_CONT " %08lx", *stack++); |
| 87 | touch_nmi_watchdog(); | 87 | touch_nmi_watchdog(); |
| 88 | } | 88 | } |
| 89 | printk("\n"); | 89 | printk(KERN_CONT "\n"); |
| 90 | show_trace_log_lvl(task, regs, sp, bp, log_lvl); | 90 | show_trace_log_lvl(task, regs, sp, bp, log_lvl); |
| 91 | } | 91 | } |
| 92 | 92 | ||
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index 57a21f11c791..6a340485249a 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c | |||
| @@ -265,20 +265,20 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, | |||
| 265 | if (stack >= irq_stack && stack <= irq_stack_end) { | 265 | if (stack >= irq_stack && stack <= irq_stack_end) { |
| 266 | if (stack == irq_stack_end) { | 266 | if (stack == irq_stack_end) { |
| 267 | stack = (unsigned long *) (irq_stack_end[-1]); | 267 | stack = (unsigned long *) (irq_stack_end[-1]); |
| 268 | printk(" <EOI> "); | 268 | printk(KERN_CONT " <EOI> "); |
| 269 | } | 269 | } |
| 270 | } else { | 270 | } else { |
| 271 | if (((long) stack & (THREAD_SIZE-1)) == 0) | 271 | if (((long) stack & (THREAD_SIZE-1)) == 0) |
| 272 | break; | 272 | break; |
| 273 | } | 273 | } |
| 274 | if (i && ((i % STACKSLOTS_PER_LINE) == 0)) | 274 | if (i && ((i % STACKSLOTS_PER_LINE) == 0)) |
| 275 | printk("\n%s", log_lvl); | 275 | printk(KERN_CONT "\n"); |
| 276 | printk(" %016lx", *stack++); | 276 | printk(KERN_CONT " %016lx", *stack++); |
| 277 | touch_nmi_watchdog(); | 277 | touch_nmi_watchdog(); |
| 278 | } | 278 | } |
| 279 | preempt_enable(); | 279 | preempt_enable(); |
| 280 | 280 | ||
| 281 | printk("\n"); | 281 | printk(KERN_CONT "\n"); |
| 282 | show_trace_log_lvl(task, regs, sp, bp, log_lvl); | 282 | show_trace_log_lvl(task, regs, sp, bp, log_lvl); |
| 283 | } | 283 | } |
| 284 | 284 | ||
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c index 50fbbe60e507..64668dbf00a4 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c | |||
| @@ -60,9 +60,6 @@ union irq_ctx { | |||
| 60 | static DEFINE_PER_CPU(union irq_ctx *, hardirq_ctx); | 60 | static DEFINE_PER_CPU(union irq_ctx *, hardirq_ctx); |
| 61 | static DEFINE_PER_CPU(union irq_ctx *, softirq_ctx); | 61 | static DEFINE_PER_CPU(union irq_ctx *, softirq_ctx); |
| 62 | 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) | 63 | static void call_on_stack(void *func, void *stack) |
| 67 | { | 64 | { |
| 68 | asm volatile("xchgl %%ebx,%%esp \n" | 65 | asm volatile("xchgl %%ebx,%%esp \n" |
| @@ -128,7 +125,7 @@ void __cpuinit irq_ctx_init(int cpu) | |||
| 128 | if (per_cpu(hardirq_ctx, cpu)) | 125 | if (per_cpu(hardirq_ctx, cpu)) |
| 129 | return; | 126 | return; |
| 130 | 127 | ||
| 131 | irqctx = &per_cpu(hardirq_stack, cpu); | 128 | irqctx = (union irq_ctx *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER); |
| 132 | irqctx->tinfo.task = NULL; | 129 | irqctx->tinfo.task = NULL; |
| 133 | irqctx->tinfo.exec_domain = NULL; | 130 | irqctx->tinfo.exec_domain = NULL; |
| 134 | irqctx->tinfo.cpu = cpu; | 131 | irqctx->tinfo.cpu = cpu; |
| @@ -137,7 +134,7 @@ void __cpuinit irq_ctx_init(int cpu) | |||
| 137 | 134 | ||
| 138 | per_cpu(hardirq_ctx, cpu) = irqctx; | 135 | per_cpu(hardirq_ctx, cpu) = irqctx; |
| 139 | 136 | ||
| 140 | irqctx = &per_cpu(softirq_stack, cpu); | 137 | irqctx = (union irq_ctx *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER); |
| 141 | irqctx->tinfo.task = NULL; | 138 | irqctx->tinfo.task = NULL; |
| 142 | irqctx->tinfo.exec_domain = NULL; | 139 | irqctx->tinfo.exec_domain = NULL; |
| 143 | irqctx->tinfo.cpu = cpu; | 140 | irqctx->tinfo.cpu = cpu; |
| @@ -150,11 +147,6 @@ void __cpuinit irq_ctx_init(int cpu) | |||
| 150 | cpu, per_cpu(hardirq_ctx, cpu), per_cpu(softirq_ctx, cpu)); | 147 | cpu, per_cpu(hardirq_ctx, cpu), per_cpu(softirq_ctx, cpu)); |
| 151 | } | 148 | } |
| 152 | 149 | ||
| 153 | void irq_ctx_exit(int cpu) | ||
| 154 | { | ||
| 155 | per_cpu(hardirq_ctx, cpu) = NULL; | ||
| 156 | } | ||
| 157 | |||
| 158 | asmlinkage void do_softirq(void) | 150 | asmlinkage void do_softirq(void) |
| 159 | { | 151 | { |
| 160 | unsigned long flags; | 152 | unsigned long flags; |
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index f7f53dcd3e0a..c495aa8d4815 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
| @@ -635,7 +635,7 @@ void native_machine_shutdown(void) | |||
| 635 | /* O.K Now that I'm on the appropriate processor, | 635 | /* O.K Now that I'm on the appropriate processor, |
| 636 | * stop all of the others. | 636 | * stop all of the others. |
| 637 | */ | 637 | */ |
| 638 | smp_send_stop(); | 638 | stop_other_cpus(); |
| 639 | #endif | 639 | #endif |
| 640 | 640 | ||
| 641 | lapic_shutdown(); | 641 | lapic_shutdown(); |
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c index d801210945d6..513deac7228d 100644 --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c | |||
| @@ -159,10 +159,10 @@ asmlinkage void smp_reboot_interrupt(void) | |||
| 159 | irq_exit(); | 159 | irq_exit(); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | static void native_smp_send_stop(void) | 162 | static void native_stop_other_cpus(int wait) |
| 163 | { | 163 | { |
| 164 | unsigned long flags; | 164 | unsigned long flags; |
| 165 | unsigned long wait; | 165 | unsigned long timeout; |
| 166 | 166 | ||
| 167 | if (reboot_force) | 167 | if (reboot_force) |
| 168 | return; | 168 | return; |
| @@ -179,9 +179,12 @@ static void native_smp_send_stop(void) | |||
| 179 | if (num_online_cpus() > 1) { | 179 | if (num_online_cpus() > 1) { |
| 180 | apic->send_IPI_allbutself(REBOOT_VECTOR); | 180 | apic->send_IPI_allbutself(REBOOT_VECTOR); |
| 181 | 181 | ||
| 182 | /* Don't wait longer than a second */ | 182 | /* |
| 183 | wait = USEC_PER_SEC; | 183 | * Don't wait longer than a second if the caller |
| 184 | while (num_online_cpus() > 1 && wait--) | 184 | * didn't ask us to wait. |
| 185 | */ | ||
| 186 | timeout = USEC_PER_SEC; | ||
| 187 | while (num_online_cpus() > 1 && (wait || timeout--)) | ||
| 185 | udelay(1); | 188 | udelay(1); |
| 186 | } | 189 | } |
| 187 | 190 | ||
| @@ -227,7 +230,7 @@ struct smp_ops smp_ops = { | |||
| 227 | .smp_prepare_cpus = native_smp_prepare_cpus, | 230 | .smp_prepare_cpus = native_smp_prepare_cpus, |
| 228 | .smp_cpus_done = native_smp_cpus_done, | 231 | .smp_cpus_done = native_smp_cpus_done, |
| 229 | 232 | ||
| 230 | .smp_send_stop = native_smp_send_stop, | 233 | .stop_other_cpus = native_stop_other_cpus, |
| 231 | .smp_send_reschedule = native_smp_send_reschedule, | 234 | .smp_send_reschedule = native_smp_send_reschedule, |
| 232 | 235 | ||
| 233 | .cpu_up = native_cpu_up, | 236 | .cpu_up = native_cpu_up, |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 6c7faecd9e4a..083e99d1b7df 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
| @@ -1373,7 +1373,6 @@ void play_dead_common(void) | |||
| 1373 | { | 1373 | { |
| 1374 | idle_task_exit(); | 1374 | idle_task_exit(); |
| 1375 | reset_lazy_tlbstate(); | 1375 | reset_lazy_tlbstate(); |
| 1376 | irq_ctx_exit(raw_smp_processor_id()); | ||
| 1377 | c1e_remove_cpu(raw_smp_processor_id()); | 1376 | c1e_remove_cpu(raw_smp_processor_id()); |
| 1378 | 1377 | ||
| 1379 | mb(); | 1378 | mb(); |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 44ab12dc2a12..580da1aa4a4c 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
| @@ -1016,7 +1016,7 @@ static void xen_reboot(int reason) | |||
| 1016 | struct sched_shutdown r = { .reason = reason }; | 1016 | struct sched_shutdown r = { .reason = reason }; |
| 1017 | 1017 | ||
| 1018 | #ifdef CONFIG_SMP | 1018 | #ifdef CONFIG_SMP |
| 1019 | smp_send_stop(); | 1019 | stop_other_cpus(); |
| 1020 | #endif | 1020 | #endif |
| 1021 | 1021 | ||
| 1022 | if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r)) | 1022 | if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r)) |
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 25f232b18a82..f4d010031465 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
| @@ -400,9 +400,9 @@ static void stop_self(void *v) | |||
| 400 | BUG(); | 400 | BUG(); |
| 401 | } | 401 | } |
| 402 | 402 | ||
| 403 | static void xen_smp_send_stop(void) | 403 | static void xen_stop_other_cpus(int wait) |
| 404 | { | 404 | { |
| 405 | smp_call_function(stop_self, NULL, 0); | 405 | smp_call_function(stop_self, NULL, wait); |
| 406 | } | 406 | } |
| 407 | 407 | ||
| 408 | static void xen_smp_send_reschedule(int cpu) | 408 | static void xen_smp_send_reschedule(int cpu) |
| @@ -470,7 +470,7 @@ static const struct smp_ops xen_smp_ops __initdata = { | |||
| 470 | .cpu_disable = xen_cpu_disable, | 470 | .cpu_disable = xen_cpu_disable, |
| 471 | .play_dead = xen_play_dead, | 471 | .play_dead = xen_play_dead, |
| 472 | 472 | ||
| 473 | .smp_send_stop = xen_smp_send_stop, | 473 | .stop_other_cpus = xen_stop_other_cpus, |
| 474 | .smp_send_reschedule = xen_smp_send_reschedule, | 474 | .smp_send_reschedule = xen_smp_send_reschedule, |
| 475 | 475 | ||
| 476 | .send_call_func_ipi = xen_smp_send_call_function_ipi, | 476 | .send_call_func_ipi = xen_smp_send_call_function_ipi, |
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 018db9a62ffe..27ef6b190ea6 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
| @@ -148,18 +148,6 @@ | |||
| 148 | DEFINE_PER_CPU_SECTION(type, name, "..readmostly") | 148 | DEFINE_PER_CPU_SECTION(type, name, "..readmostly") |
| 149 | 149 | ||
| 150 | /* | 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 | 151 | * Intermodule exports for per-CPU variables. sparse forgets about |
| 164 | * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to | 152 | * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to |
| 165 | * noop if __CHECKER__. | 153 | * noop if __CHECKER__. |
