diff options
author | Brian Gerst <brgerst@gmail.com> | 2009-01-18 10:38:58 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-01-18 10:38:58 -0500 |
commit | 3d1e42a7cf945e289d6ba26159aa0e2b0645401b (patch) | |
tree | 0b020226f5fce3abecf74e6680224ecb96fd18a8 /arch/x86/kernel/process_64.c | |
parent | 9af45651f1f7c89942e016a1a00a7ebddfa727f8 (diff) |
x86-64: Move oldrsp from PDA to per-cpu.
tj: * in asm-offsets_64.c, pda.h inclusion shouldn't be removed as pda
is still referenced in the file
* s/oldrsp/old_rsp/
Signed-off-by: Brian Gerst <brgerst@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'arch/x86/kernel/process_64.c')
-rw-r--r-- | arch/x86/kernel/process_64.c | 8 |
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); | |||
60 | DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task; | 60 | DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task; |
61 | EXPORT_PER_CPU_SYMBOL(current_task); | 61 | EXPORT_PER_CPU_SYMBOL(current_task); |
62 | 62 | ||
63 | DEFINE_PER_CPU(unsigned long, old_rsp); | ||
64 | |||
63 | unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED; | 65 | unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED; |
64 | 66 | ||
65 | static ATOMIC_NOTIFIER_HEAD(idle_notifier); | 67 | static 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, |