aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/smpboot.c3
-rw-r--r--include/linux/sched.h13
2 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 2d872e08fab9..42a2dca984b3 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1284,6 +1284,9 @@ static void remove_siblinginfo(int cpu)
1284 1284
1285 for_each_cpu(sibling, cpu_sibling_mask(cpu)) 1285 for_each_cpu(sibling, cpu_sibling_mask(cpu))
1286 cpumask_clear_cpu(cpu, cpu_sibling_mask(sibling)); 1286 cpumask_clear_cpu(cpu, cpu_sibling_mask(sibling));
1287 for_each_cpu(sibling, cpu_llc_shared_mask(cpu))
1288 cpumask_clear_cpu(cpu, cpu_llc_shared_mask(sibling));
1289 cpumask_clear(cpu_llc_shared_mask(cpu));
1287 cpumask_clear(cpu_sibling_mask(cpu)); 1290 cpumask_clear(cpu_sibling_mask(cpu));
1288 cpumask_clear(cpu_core_mask(cpu)); 1291 cpumask_clear(cpu_core_mask(cpu));
1289 c->phys_proc_id = 0; 1292 c->phys_proc_id = 0;
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 5c2c885ee52b..1f07040d28e3 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2608,9 +2608,22 @@ static inline void setup_thread_stack(struct task_struct *p, struct task_struct
2608 task_thread_info(p)->task = p; 2608 task_thread_info(p)->task = p;
2609} 2609}
2610 2610
2611/*
2612 * Return the address of the last usable long on the stack.
2613 *
2614 * When the stack grows down, this is just above the thread
2615 * info struct. Going any lower will corrupt the threadinfo.
2616 *
2617 * When the stack grows up, this is the highest address.
2618 * Beyond that position, we corrupt data on the next page.
2619 */
2611static inline unsigned long *end_of_stack(struct task_struct *p) 2620static inline unsigned long *end_of_stack(struct task_struct *p)
2612{ 2621{
2622#ifdef CONFIG_STACK_GROWSUP
2623 return (unsigned long *)((unsigned long)task_thread_info(p) + THREAD_SIZE) - 1;
2624#else
2613 return (unsigned long *)(task_thread_info(p) + 1); 2625 return (unsigned long *)(task_thread_info(p) + 1);
2626#endif
2614} 2627}
2615 2628
2616#endif 2629#endif