aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/process_64.c')
-rw-r--r--arch/x86/kernel/process_64.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 6c5f57602108..480128918926 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -60,6 +60,8 @@ asmlinkage extern void ret_from_fork(void);
60DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task; 60DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task;
61EXPORT_PER_CPU_SYMBOL(current_task); 61EXPORT_PER_CPU_SYMBOL(current_task);
62 62
63DEFINE_PER_CPU(unsigned long, old_rsp);
64
63unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED; 65unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED;
64 66
65static ATOMIC_NOTIFIER_HEAD(idle_notifier); 67static ATOMIC_NOTIFIER_HEAD(idle_notifier);
@@ -395,7 +397,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
395 load_gs_index(0); 397 load_gs_index(0);
396 regs->ip = new_ip; 398 regs->ip = new_ip;
397 regs->sp = new_sp; 399 regs->sp = new_sp;
398 write_pda(oldrsp, new_sp); 400 percpu_write(old_rsp, new_sp);
399 regs->cs = __USER_CS; 401 regs->cs = __USER_CS;
400 regs->ss = __USER_DS; 402 regs->ss = __USER_DS;
401 regs->flags = 0x200; 403 regs->flags = 0x200;
@@ -616,8 +618,8 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
616 /* 618 /*
617 * Switch the PDA and FPU contexts. 619 * Switch the PDA and FPU contexts.
618 */ 620 */
619 prev->usersp = read_pda(oldrsp); 621 prev->usersp = percpu_read(old_rsp);
620 write_pda(oldrsp, next->usersp); 622 percpu_write(old_rsp, next->usersp);
621 percpu_write(current_task, next_p); 623 percpu_write(current_task, next_p);
622 624
623 percpu_write(kernel_stack, 625 percpu_write(kernel_stack,