aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-01-30 07:31:02 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:31:02 -0500
commitfaca62273b602ab482fb7d3d940dbf41ef08b00e (patch)
tree913fb1c565a2b719b00ae4b745c38cc9b0ebf279 /arch/x86
parent25149b62d3e6a3e737af39bd4a0b4e97de0811b7 (diff)
x86: use generic register name in the thread and tss structures
This changes size-specific register names (eip/rip, esp/rsp, etc.) to generic names in the thread and tss structures. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/asm-offsets_32.c4
-rw-r--r--arch/x86/kernel/cpu/common.c2
-rw-r--r--arch/x86/kernel/doublefault_32.c15
-rw-r--r--arch/x86/kernel/entry_32.S6
-rw-r--r--arch/x86/kernel/paravirt_32.c2
-rw-r--r--arch/x86/kernel/process_32.c12
-rw-r--r--arch/x86/kernel/process_64.c16
-rw-r--r--arch/x86/kernel/smpboot_32.c8
-rw-r--r--arch/x86/kernel/smpboot_64.c6
-rw-r--r--arch/x86/kernel/traps_32.c6
-rw-r--r--arch/x86/kernel/traps_64.c4
-rw-r--r--arch/x86/kernel/vm86_32.c16
-rw-r--r--arch/x86/kernel/vmi_32.c10
-rw-r--r--arch/x86/lguest/boot.c6
-rw-r--r--arch/x86/vdso/vdso32-setup.c4
-rw-r--r--arch/x86/xen/enlighten.c6
-rw-r--r--arch/x86/xen/smp.c4
17 files changed, 64 insertions, 63 deletions
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
index 4fc24a61f431..415313556708 100644
--- a/arch/x86/kernel/asm-offsets_32.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -101,8 +101,8 @@ void foo(void)
101 OFFSET(pbe_orig_address, pbe, orig_address); 101 OFFSET(pbe_orig_address, pbe, orig_address);
102 OFFSET(pbe_next, pbe, next); 102 OFFSET(pbe_next, pbe, next);
103 103
104 /* Offset from the sysenter stack to tss.esp0 */ 104 /* Offset from the sysenter stack to tss.sp0 */
105 DEFINE(TSS_sysenter_esp0, offsetof(struct tss_struct, x86_tss.esp0) - 105 DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) -
106 sizeof(struct tss_struct)); 106 sizeof(struct tss_struct));
107 107
108 DEFINE(PAGE_SIZE_asm, PAGE_SIZE); 108 DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 5db2a163bf4b..235cd615b89d 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -691,7 +691,7 @@ void __cpuinit cpu_init(void)
691 BUG(); 691 BUG();
692 enter_lazy_tlb(&init_mm, curr); 692 enter_lazy_tlb(&init_mm, curr);
693 693
694 load_esp0(t, thread); 694 load_sp0(t, thread);
695 set_tss_desc(cpu,t); 695 set_tss_desc(cpu,t);
696 load_TR_desc(); 696 load_TR_desc();
697 load_LDT(&init_mm.context); 697 load_LDT(&init_mm.context);
diff --git a/arch/x86/kernel/doublefault_32.c b/arch/x86/kernel/doublefault_32.c
index 40978af630e7..cc19a3ea403a 100644
--- a/arch/x86/kernel/doublefault_32.c
+++ b/arch/x86/kernel/doublefault_32.c
@@ -35,12 +35,13 @@ static void doublefault_fn(void)
35 if (ptr_ok(tss)) { 35 if (ptr_ok(tss)) {
36 struct i386_hw_tss *t = (struct i386_hw_tss *)tss; 36 struct i386_hw_tss *t = (struct i386_hw_tss *)tss;
37 37
38 printk(KERN_EMERG "eip = %08lx, esp = %08lx\n", t->eip, t->esp); 38 printk(KERN_EMERG "eip = %08lx, esp = %08lx\n",
39 t->ip, t->sp);
39 40
40 printk(KERN_EMERG "eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n", 41 printk(KERN_EMERG "eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n",
41 t->eax, t->ebx, t->ecx, t->edx); 42 t->ax, t->bx, t->cx, t->dx);
42 printk(KERN_EMERG "esi = %08lx, edi = %08lx\n", 43 printk(KERN_EMERG "esi = %08lx, edi = %08lx\n",
43 t->esi, t->edi); 44 t->si, t->di);
44 } 45 }
45 } 46 }
46 47
@@ -50,15 +51,15 @@ static void doublefault_fn(void)
50 51
51struct tss_struct doublefault_tss __cacheline_aligned = { 52struct tss_struct doublefault_tss __cacheline_aligned = {
52 .x86_tss = { 53 .x86_tss = {
53 .esp0 = STACK_START, 54 .sp0 = STACK_START,
54 .ss0 = __KERNEL_DS, 55 .ss0 = __KERNEL_DS,
55 .ldt = 0, 56 .ldt = 0,
56 .io_bitmap_base = INVALID_IO_BITMAP_OFFSET, 57 .io_bitmap_base = INVALID_IO_BITMAP_OFFSET,
57 58
58 .eip = (unsigned long) doublefault_fn, 59 .ip = (unsigned long) doublefault_fn,
59 /* 0x2 bit is always set */ 60 /* 0x2 bit is always set */
60 .eflags = X86_EFLAGS_SF | 0x2, 61 .flags = X86_EFLAGS_SF | 0x2,
61 .esp = STACK_START, 62 .sp = STACK_START,
62 .es = __USER_DS, 63 .es = __USER_DS,
63 .cs = __KERNEL_CS, 64 .cs = __KERNEL_CS,
64 .ss = __KERNEL_DS, 65 .ss = __KERNEL_DS,
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index 153bb87a4eea..6a474e1028c7 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -288,7 +288,7 @@ ENTRY(ia32_sysenter_target)
288 CFI_SIGNAL_FRAME 288 CFI_SIGNAL_FRAME
289 CFI_DEF_CFA esp, 0 289 CFI_DEF_CFA esp, 0
290 CFI_REGISTER esp, ebp 290 CFI_REGISTER esp, ebp
291 movl TSS_sysenter_esp0(%esp),%esp 291 movl TSS_sysenter_sp0(%esp),%esp
292sysenter_past_esp: 292sysenter_past_esp:
293 /* 293 /*
294 * No need to follow this irqs on/off section: the syscall 294 * No need to follow this irqs on/off section: the syscall
@@ -743,7 +743,7 @@ END(device_not_available)
743 * that sets up the real kernel stack. Check here, since we can't 743 * that sets up the real kernel stack. Check here, since we can't
744 * allow the wrong stack to be used. 744 * allow the wrong stack to be used.
745 * 745 *
746 * "TSS_sysenter_esp0+12" is because the NMI/debug handler will have 746 * "TSS_sysenter_sp0+12" is because the NMI/debug handler will have
747 * already pushed 3 words if it hits on the sysenter instruction: 747 * already pushed 3 words if it hits on the sysenter instruction:
748 * eflags, cs and eip. 748 * eflags, cs and eip.
749 * 749 *
@@ -755,7 +755,7 @@ END(device_not_available)
755 cmpw $__KERNEL_CS,4(%esp); \ 755 cmpw $__KERNEL_CS,4(%esp); \
756 jne ok; \ 756 jne ok; \
757label: \ 757label: \
758 movl TSS_sysenter_esp0+offset(%esp),%esp; \ 758 movl TSS_sysenter_sp0+offset(%esp),%esp; \
759 CFI_DEF_CFA esp, 0; \ 759 CFI_DEF_CFA esp, 0; \
760 CFI_UNDEFINED eip; \ 760 CFI_UNDEFINED eip; \
761 pushfl; \ 761 pushfl; \
diff --git a/arch/x86/kernel/paravirt_32.c b/arch/x86/kernel/paravirt_32.c
index 706b0562ea40..f4e3a8e01cf2 100644
--- a/arch/x86/kernel/paravirt_32.c
+++ b/arch/x86/kernel/paravirt_32.c
@@ -382,7 +382,7 @@ struct pv_cpu_ops pv_cpu_ops = {
382 .write_ldt_entry = write_dt_entry, 382 .write_ldt_entry = write_dt_entry,
383 .write_gdt_entry = write_dt_entry, 383 .write_gdt_entry = write_dt_entry,
384 .write_idt_entry = write_dt_entry, 384 .write_idt_entry = write_dt_entry,
385 .load_esp0 = native_load_esp0, 385 .load_sp0 = native_load_sp0,
386 386
387 .irq_enable_syscall_ret = native_irq_enable_syscall_ret, 387 .irq_enable_syscall_ret = native_irq_enable_syscall_ret,
388 .iret = native_iret, 388 .iret = native_iret,
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 3744cf63682c..add3bf34e205 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -75,7 +75,7 @@ EXPORT_PER_CPU_SYMBOL(cpu_number);
75 */ 75 */
76unsigned long thread_saved_pc(struct task_struct *tsk) 76unsigned long thread_saved_pc(struct task_struct *tsk)
77{ 77{
78 return ((unsigned long *)tsk->thread.esp)[3]; 78 return ((unsigned long *)tsk->thread.sp)[3];
79} 79}
80 80
81/* 81/*
@@ -488,10 +488,10 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
488 childregs->ax = 0; 488 childregs->ax = 0;
489 childregs->sp = sp; 489 childregs->sp = sp;
490 490
491 p->thread.esp = (unsigned long) childregs; 491 p->thread.sp = (unsigned long) childregs;
492 p->thread.esp0 = (unsigned long) (childregs+1); 492 p->thread.sp0 = (unsigned long) (childregs+1);
493 493
494 p->thread.eip = (unsigned long) ret_from_fork; 494 p->thread.ip = (unsigned long) ret_from_fork;
495 495
496 savesegment(gs,p->thread.gs); 496 savesegment(gs,p->thread.gs);
497 497
@@ -718,7 +718,7 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
718 /* 718 /*
719 * Reload esp0. 719 * Reload esp0.
720 */ 720 */
721 load_esp0(tss, next); 721 load_sp0(tss, next);
722 722
723 /* 723 /*
724 * Save away %gs. No need to save %fs, as it was saved on the 724 * Save away %gs. No need to save %fs, as it was saved on the
@@ -851,7 +851,7 @@ unsigned long get_wchan(struct task_struct *p)
851 if (!p || p == current || p->state == TASK_RUNNING) 851 if (!p || p == current || p->state == TASK_RUNNING)
852 return 0; 852 return 0;
853 stack_page = (unsigned long)task_stack_page(p); 853 stack_page = (unsigned long)task_stack_page(p);
854 sp = p->thread.esp; 854 sp = p->thread.sp;
855 if (!stack_page || sp < stack_page || sp > top_esp+stack_page) 855 if (!stack_page || sp < stack_page || sp > top_esp+stack_page)
856 return 0; 856 return 0;
857 /* include/asm-i386/system.h:switch_to() pushes bp last. */ 857 /* include/asm-i386/system.h:switch_to() pushes bp last. */
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index efbb1a2eab97..238193822e23 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -493,9 +493,9 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
493 if (sp == ~0UL) 493 if (sp == ~0UL)
494 childregs->sp = (unsigned long)childregs; 494 childregs->sp = (unsigned long)childregs;
495 495
496 p->thread.rsp = (unsigned long) childregs; 496 p->thread.sp = (unsigned long) childregs;
497 p->thread.rsp0 = (unsigned long) (childregs+1); 497 p->thread.sp0 = (unsigned long) (childregs+1);
498 p->thread.userrsp = me->thread.userrsp; 498 p->thread.usersp = me->thread.usersp;
499 499
500 set_tsk_thread_flag(p, TIF_FORK); 500 set_tsk_thread_flag(p, TIF_FORK);
501 501
@@ -607,7 +607,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
607 /* 607 /*
608 * Reload esp0, LDT and the page table pointer: 608 * Reload esp0, LDT and the page table pointer:
609 */ 609 */
610 tss->rsp0 = next->rsp0; 610 tss->sp0 = next->sp0;
611 611
612 /* 612 /*
613 * Switch DS and ES. 613 * Switch DS and ES.
@@ -666,8 +666,8 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
666 /* 666 /*
667 * Switch the PDA and FPU contexts. 667 * Switch the PDA and FPU contexts.
668 */ 668 */
669 prev->userrsp = read_pda(oldrsp); 669 prev->usersp = read_pda(oldrsp);
670 write_pda(oldrsp, next->userrsp); 670 write_pda(oldrsp, next->usersp);
671 write_pda(pcurrent, next_p); 671 write_pda(pcurrent, next_p);
672 672
673 write_pda(kernelstack, 673 write_pda(kernelstack,
@@ -769,9 +769,9 @@ unsigned long get_wchan(struct task_struct *p)
769 if (!p || p == current || p->state==TASK_RUNNING) 769 if (!p || p == current || p->state==TASK_RUNNING)
770 return 0; 770 return 0;
771 stack = (unsigned long)task_stack_page(p); 771 stack = (unsigned long)task_stack_page(p);
772 if (p->thread.rsp < stack || p->thread.rsp > stack+THREAD_SIZE) 772 if (p->thread.sp < stack || p->thread.sp > stack+THREAD_SIZE)
773 return 0; 773 return 0;
774 fp = *(u64 *)(p->thread.rsp); 774 fp = *(u64 *)(p->thread.sp);
775 do { 775 do {
776 if (fp < (unsigned long)stack || 776 if (fp < (unsigned long)stack ||
777 fp > (unsigned long)stack+THREAD_SIZE) 777 fp > (unsigned long)stack+THREAD_SIZE)
diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c
index 3566191832b3..0f294d6e22cf 100644
--- a/arch/x86/kernel/smpboot_32.c
+++ b/arch/x86/kernel/smpboot_32.c
@@ -454,7 +454,7 @@ void __devinit initialize_secondary(void)
454 "movl %0,%%esp\n\t" 454 "movl %0,%%esp\n\t"
455 "jmp *%1" 455 "jmp *%1"
456 : 456 :
457 :"m" (current->thread.esp),"m" (current->thread.eip)); 457 :"m" (current->thread.sp),"m" (current->thread.ip));
458} 458}
459 459
460/* Static state in head.S used to set up a CPU */ 460/* Static state in head.S used to set up a CPU */
@@ -753,7 +753,7 @@ static inline struct task_struct * __cpuinit alloc_idle_task(int cpu)
753 /* initialize thread_struct. we really want to avoid destroy 753 /* initialize thread_struct. we really want to avoid destroy
754 * idle tread 754 * idle tread
755 */ 755 */
756 idle->thread.esp = (unsigned long)task_pt_regs(idle); 756 idle->thread.sp = (unsigned long)task_pt_regs(idle);
757 init_idle(idle, cpu); 757 init_idle(idle, cpu);
758 return idle; 758 return idle;
759 } 759 }
@@ -798,7 +798,7 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)
798 per_cpu(current_task, cpu) = idle; 798 per_cpu(current_task, cpu) = idle;
799 early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu); 799 early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu);
800 800
801 idle->thread.eip = (unsigned long) start_secondary; 801 idle->thread.ip = (unsigned long) start_secondary;
802 /* start_eip had better be page-aligned! */ 802 /* start_eip had better be page-aligned! */
803 start_eip = setup_trampoline(); 803 start_eip = setup_trampoline();
804 804
@@ -808,7 +808,7 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)
808 /* So we see what's up */ 808 /* So we see what's up */
809 printk("Booting processor %d/%d ip %lx\n", cpu, apicid, start_eip); 809 printk("Booting processor %d/%d ip %lx\n", cpu, apicid, start_eip);
810 /* Stack for startup_32 can be just as for start_secondary onwards */ 810 /* Stack for startup_32 can be just as for start_secondary onwards */
811 stack_start.sp = (void *) idle->thread.esp; 811 stack_start.sp = (void *) idle->thread.sp;
812 812
813 irq_ctx_init(cpu); 813 irq_ctx_init(cpu);
814 814
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
index ac1089f2b917..c3f2736ba530 100644
--- a/arch/x86/kernel/smpboot_64.c
+++ b/arch/x86/kernel/smpboot_64.c
@@ -577,7 +577,7 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid)
577 c_idle.idle = get_idle_for_cpu(cpu); 577 c_idle.idle = get_idle_for_cpu(cpu);
578 578
579 if (c_idle.idle) { 579 if (c_idle.idle) {
580 c_idle.idle->thread.rsp = (unsigned long) (((struct pt_regs *) 580 c_idle.idle->thread.sp = (unsigned long) (((struct pt_regs *)
581 (THREAD_SIZE + task_stack_page(c_idle.idle))) - 1); 581 (THREAD_SIZE + task_stack_page(c_idle.idle))) - 1);
582 init_idle(c_idle.idle, cpu); 582 init_idle(c_idle.idle, cpu);
583 goto do_rest; 583 goto do_rest;
@@ -613,8 +613,8 @@ do_rest:
613 613
614 start_rip = setup_trampoline(); 614 start_rip = setup_trampoline();
615 615
616 init_rsp = c_idle.idle->thread.rsp; 616 init_rsp = c_idle.idle->thread.sp;
617 per_cpu(init_tss,cpu).rsp0 = init_rsp; 617 per_cpu(init_tss,cpu).sp0 = init_rsp;
618 initial_code = start_secondary; 618 initial_code = start_secondary;
619 clear_tsk_thread_flag(c_idle.idle, TIF_FORK); 619 clear_tsk_thread_flag(c_idle.idle, TIF_FORK);
620 620
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index 27713553cc59..57491942cc4e 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -163,7 +163,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
163 unsigned long dummy; 163 unsigned long dummy;
164 stack = &dummy; 164 stack = &dummy;
165 if (task != current) 165 if (task != current)
166 stack = (unsigned long *)task->thread.esp; 166 stack = (unsigned long *)task->thread.sp;
167 } 167 }
168 168
169#ifdef CONFIG_FRAME_POINTER 169#ifdef CONFIG_FRAME_POINTER
@@ -173,7 +173,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
173 asm ("movl %%ebp, %0" : "=r" (bp) : ); 173 asm ("movl %%ebp, %0" : "=r" (bp) : );
174 } else { 174 } else {
175 /* bp is the last reg pushed by switch_to */ 175 /* bp is the last reg pushed by switch_to */
176 bp = *(unsigned long *) task->thread.esp; 176 bp = *(unsigned long *) task->thread.sp;
177 } 177 }
178 } 178 }
179#endif 179#endif
@@ -253,7 +253,7 @@ static void show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
253 253
254 if (sp == NULL) { 254 if (sp == NULL) {
255 if (task) 255 if (task)
256 sp = (unsigned long*)task->thread.esp; 256 sp = (unsigned long*)task->thread.sp;
257 else 257 else
258 sp = (unsigned long *)&sp; 258 sp = (unsigned long *)&sp;
259 } 259 }
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index f7fecf9d47c3..965f2cc3a013 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -230,7 +230,7 @@ void dump_trace(struct task_struct *tsk, struct pt_regs *regs,
230 unsigned long dummy; 230 unsigned long dummy;
231 stack = &dummy; 231 stack = &dummy;
232 if (tsk && tsk != current) 232 if (tsk && tsk != current)
233 stack = (unsigned long *)tsk->thread.rsp; 233 stack = (unsigned long *)tsk->thread.sp;
234 } 234 }
235 235
236 /* 236 /*
@@ -366,7 +366,7 @@ _show_stack(struct task_struct *tsk, struct pt_regs *regs, unsigned long *sp)
366 366
367 if (sp == NULL) { 367 if (sp == NULL) {
368 if (tsk) 368 if (tsk)
369 sp = (unsigned long *)tsk->thread.rsp; 369 sp = (unsigned long *)tsk->thread.sp;
370 else 370 else
371 sp = (unsigned long *)&sp; 371 sp = (unsigned long *)&sp;
372 } 372 }
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
index 980e85b90091..e85bb44265cb 100644
--- a/arch/x86/kernel/vm86_32.c
+++ b/arch/x86/kernel/vm86_32.c
@@ -147,10 +147,10 @@ struct pt_regs * fastcall save_v86_state(struct kernel_vm86_regs * regs)
147 } 147 }
148 148
149 tss = &per_cpu(init_tss, get_cpu()); 149 tss = &per_cpu(init_tss, get_cpu());
150 current->thread.esp0 = current->thread.saved_esp0; 150 current->thread.sp0 = current->thread.saved_sp0;
151 current->thread.sysenter_cs = __KERNEL_CS; 151 current->thread.sysenter_cs = __KERNEL_CS;
152 load_esp0(tss, &current->thread); 152 load_sp0(tss, &current->thread);
153 current->thread.saved_esp0 = 0; 153 current->thread.saved_sp0 = 0;
154 put_cpu(); 154 put_cpu();
155 155
156 ret = KVM86->regs32; 156 ret = KVM86->regs32;
@@ -207,7 +207,7 @@ asmlinkage int sys_vm86old(struct pt_regs regs)
207 int tmp, ret = -EPERM; 207 int tmp, ret = -EPERM;
208 208
209 tsk = current; 209 tsk = current;
210 if (tsk->thread.saved_esp0) 210 if (tsk->thread.saved_sp0)
211 goto out; 211 goto out;
212 tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, 212 tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs,
213 offsetof(struct kernel_vm86_struct, vm86plus) - 213 offsetof(struct kernel_vm86_struct, vm86plus) -
@@ -256,7 +256,7 @@ asmlinkage int sys_vm86(struct pt_regs regs)
256 256
257 /* we come here only for functions VM86_ENTER, VM86_ENTER_NO_BYPASS */ 257 /* we come here only for functions VM86_ENTER, VM86_ENTER_NO_BYPASS */
258 ret = -EPERM; 258 ret = -EPERM;
259 if (tsk->thread.saved_esp0) 259 if (tsk->thread.saved_sp0)
260 goto out; 260 goto out;
261 v86 = (struct vm86plus_struct __user *)regs.cx; 261 v86 = (struct vm86plus_struct __user *)regs.cx;
262 tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, 262 tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs,
@@ -318,15 +318,15 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
318 * Save old state, set default return value (%ax) to 0 318 * Save old state, set default return value (%ax) to 0
319 */ 319 */
320 info->regs32->ax = 0; 320 info->regs32->ax = 0;
321 tsk->thread.saved_esp0 = tsk->thread.esp0; 321 tsk->thread.saved_sp0 = tsk->thread.sp0;
322 tsk->thread.saved_fs = info->regs32->fs; 322 tsk->thread.saved_fs = info->regs32->fs;
323 savesegment(gs, tsk->thread.saved_gs); 323 savesegment(gs, tsk->thread.saved_gs);
324 324
325 tss = &per_cpu(init_tss, get_cpu()); 325 tss = &per_cpu(init_tss, get_cpu());
326 tsk->thread.esp0 = (unsigned long) &info->VM86_TSS_ESP0; 326 tsk->thread.sp0 = (unsigned long) &info->VM86_TSS_ESP0;
327 if (cpu_has_sep) 327 if (cpu_has_sep)
328 tsk->thread.sysenter_cs = 0; 328 tsk->thread.sysenter_cs = 0;
329 load_esp0(tss, &tsk->thread); 329 load_sp0(tss, &tsk->thread);
330 put_cpu(); 330 put_cpu();
331 331
332 tsk->thread.screen_bitmap = info->screen_bitmap; 332 tsk->thread.screen_bitmap = info->screen_bitmap;
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
index 599b6f2ed562..4cfda7dbe90f 100644
--- a/arch/x86/kernel/vmi_32.c
+++ b/arch/x86/kernel/vmi_32.c
@@ -62,7 +62,7 @@ static struct {
62 void (*cpuid)(void /* non-c */); 62 void (*cpuid)(void /* non-c */);
63 void (*_set_ldt)(u32 selector); 63 void (*_set_ldt)(u32 selector);
64 void (*set_tr)(u32 selector); 64 void (*set_tr)(u32 selector);
65 void (*set_kernel_stack)(u32 selector, u32 esp0); 65 void (*set_kernel_stack)(u32 selector, u32 sp0);
66 void (*allocate_page)(u32, u32, u32, u32, u32); 66 void (*allocate_page)(u32, u32, u32, u32, u32);
67 void (*release_page)(u32, u32); 67 void (*release_page)(u32, u32);
68 void (*set_pte)(pte_t, pte_t *, unsigned); 68 void (*set_pte)(pte_t, pte_t *, unsigned);
@@ -214,17 +214,17 @@ static void vmi_set_tr(void)
214 vmi_ops.set_tr(GDT_ENTRY_TSS*sizeof(struct desc_struct)); 214 vmi_ops.set_tr(GDT_ENTRY_TSS*sizeof(struct desc_struct));
215} 215}
216 216
217static void vmi_load_esp0(struct tss_struct *tss, 217static void vmi_load_sp0(struct tss_struct *tss,
218 struct thread_struct *thread) 218 struct thread_struct *thread)
219{ 219{
220 tss->x86_tss.esp0 = thread->esp0; 220 tss->x86_tss.sp0 = thread->sp0;
221 221
222 /* This can only happen when SEP is enabled, no need to test "SEP"arately */ 222 /* This can only happen when SEP is enabled, no need to test "SEP"arately */
223 if (unlikely(tss->x86_tss.ss1 != thread->sysenter_cs)) { 223 if (unlikely(tss->x86_tss.ss1 != thread->sysenter_cs)) {
224 tss->x86_tss.ss1 = thread->sysenter_cs; 224 tss->x86_tss.ss1 = thread->sysenter_cs;
225 wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0); 225 wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0);
226 } 226 }
227 vmi_ops.set_kernel_stack(__KERNEL_DS, tss->x86_tss.esp0); 227 vmi_ops.set_kernel_stack(__KERNEL_DS, tss->x86_tss.sp0);
228} 228}
229 229
230static void vmi_flush_tlb_user(void) 230static void vmi_flush_tlb_user(void)
@@ -793,7 +793,7 @@ static inline int __init activate_vmi(void)
793 para_fill(pv_cpu_ops.write_ldt_entry, WriteLDTEntry); 793 para_fill(pv_cpu_ops.write_ldt_entry, WriteLDTEntry);
794 para_fill(pv_cpu_ops.write_gdt_entry, WriteGDTEntry); 794 para_fill(pv_cpu_ops.write_gdt_entry, WriteGDTEntry);
795 para_fill(pv_cpu_ops.write_idt_entry, WriteIDTEntry); 795 para_fill(pv_cpu_ops.write_idt_entry, WriteIDTEntry);
796 para_wrap(pv_cpu_ops.load_esp0, vmi_load_esp0, set_kernel_stack, UpdateKernelStack); 796 para_wrap(pv_cpu_ops.load_sp0, vmi_load_sp0, set_kernel_stack, UpdateKernelStack);
797 para_fill(pv_cpu_ops.set_iopl_mask, SetIOPLMask); 797 para_fill(pv_cpu_ops.set_iopl_mask, SetIOPLMask);
798 para_fill(pv_cpu_ops.io_delay, IODelay); 798 para_fill(pv_cpu_ops.io_delay, IODelay);
799 799
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index ea46d05853bb..c751e3c03e85 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -755,10 +755,10 @@ static void lguest_time_init(void)
755 * segment), the privilege level (we're privilege level 1, the Host is 0 and 755 * segment), the privilege level (we're privilege level 1, the Host is 0 and
756 * will not tolerate us trying to use that), the stack pointer, and the number 756 * will not tolerate us trying to use that), the stack pointer, and the number
757 * of pages in the stack. */ 757 * of pages in the stack. */
758static void lguest_load_esp0(struct tss_struct *tss, 758static void lguest_load_sp0(struct tss_struct *tss,
759 struct thread_struct *thread) 759 struct thread_struct *thread)
760{ 760{
761 lazy_hcall(LHCALL_SET_STACK, __KERNEL_DS|0x1, thread->esp0, 761 lazy_hcall(LHCALL_SET_STACK, __KERNEL_DS|0x1, thread->sp0,
762 THREAD_SIZE/PAGE_SIZE); 762 THREAD_SIZE/PAGE_SIZE);
763} 763}
764 764
@@ -957,7 +957,7 @@ __init void lguest_init(void)
957 pv_cpu_ops.cpuid = lguest_cpuid; 957 pv_cpu_ops.cpuid = lguest_cpuid;
958 pv_cpu_ops.load_idt = lguest_load_idt; 958 pv_cpu_ops.load_idt = lguest_load_idt;
959 pv_cpu_ops.iret = lguest_iret; 959 pv_cpu_ops.iret = lguest_iret;
960 pv_cpu_ops.load_esp0 = lguest_load_esp0; 960 pv_cpu_ops.load_sp0 = lguest_load_sp0;
961 pv_cpu_ops.load_tr_desc = lguest_load_tr_desc; 961 pv_cpu_ops.load_tr_desc = lguest_load_tr_desc;
962 pv_cpu_ops.set_ldt = lguest_set_ldt; 962 pv_cpu_ops.set_ldt = lguest_set_ldt;
963 pv_cpu_ops.load_tls = lguest_load_tls; 963 pv_cpu_ops.load_tls = lguest_load_tls;
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
index d97a6d7d062b..e0feb66a2408 100644
--- a/arch/x86/vdso/vdso32-setup.c
+++ b/arch/x86/vdso/vdso32-setup.c
@@ -243,9 +243,9 @@ void enable_sep_cpu(void)
243 } 243 }
244 244
245 tss->x86_tss.ss1 = __KERNEL_CS; 245 tss->x86_tss.ss1 = __KERNEL_CS;
246 tss->x86_tss.esp1 = sizeof(struct tss_struct) + (unsigned long) tss; 246 tss->x86_tss.sp1 = sizeof(struct tss_struct) + (unsigned long) tss;
247 wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0); 247 wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0);
248 wrmsr(MSR_IA32_SYSENTER_ESP, tss->x86_tss.esp1, 0); 248 wrmsr(MSR_IA32_SYSENTER_ESP, tss->x86_tss.sp1, 0);
249 wrmsr(MSR_IA32_SYSENTER_EIP, (unsigned long) ia32_sysenter_target, 0); 249 wrmsr(MSR_IA32_SYSENTER_EIP, (unsigned long) ia32_sysenter_target, 0);
250 put_cpu(); 250 put_cpu();
251} 251}
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 29517faaa735..d81e8d709102 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -499,11 +499,11 @@ static void xen_write_gdt_entry(struct desc_struct *dt, int entry,
499 preempt_enable(); 499 preempt_enable();
500} 500}
501 501
502static void xen_load_esp0(struct tss_struct *tss, 502static void xen_load_sp0(struct tss_struct *tss,
503 struct thread_struct *thread) 503 struct thread_struct *thread)
504{ 504{
505 struct multicall_space mcs = xen_mc_entry(0); 505 struct multicall_space mcs = xen_mc_entry(0);
506 MULTI_stack_switch(mcs.mc, __KERNEL_DS, thread->esp0); 506 MULTI_stack_switch(mcs.mc, __KERNEL_DS, thread->sp0);
507 xen_mc_issue(PARAVIRT_LAZY_CPU); 507 xen_mc_issue(PARAVIRT_LAZY_CPU);
508} 508}
509 509
@@ -968,7 +968,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
968 .write_ldt_entry = xen_write_ldt_entry, 968 .write_ldt_entry = xen_write_ldt_entry,
969 .write_gdt_entry = xen_write_gdt_entry, 969 .write_gdt_entry = xen_write_gdt_entry,
970 .write_idt_entry = xen_write_idt_entry, 970 .write_idt_entry = xen_write_idt_entry,
971 .load_esp0 = xen_load_esp0, 971 .load_sp0 = xen_load_sp0,
972 972
973 .set_iopl_mask = xen_set_iopl_mask, 973 .set_iopl_mask = xen_set_iopl_mask,
974 .io_delay = xen_io_delay, 974 .io_delay = xen_io_delay,
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 8e1234e14559..aafc54437403 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -239,10 +239,10 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
239 ctxt->gdt_ents = ARRAY_SIZE(gdt->gdt); 239 ctxt->gdt_ents = ARRAY_SIZE(gdt->gdt);
240 240
241 ctxt->user_regs.cs = __KERNEL_CS; 241 ctxt->user_regs.cs = __KERNEL_CS;
242 ctxt->user_regs.esp = idle->thread.esp0 - sizeof(struct pt_regs); 242 ctxt->user_regs.esp = idle->thread.sp0 - sizeof(struct pt_regs);
243 243
244 ctxt->kernel_ss = __KERNEL_DS; 244 ctxt->kernel_ss = __KERNEL_DS;
245 ctxt->kernel_sp = idle->thread.esp0; 245 ctxt->kernel_sp = idle->thread.sp0;
246 246
247 ctxt->event_callback_cs = __KERNEL_CS; 247 ctxt->event_callback_cs = __KERNEL_CS;
248 ctxt->event_callback_eip = (unsigned long)xen_hypervisor_callback; 248 ctxt->event_callback_eip = (unsigned long)xen_hypervisor_callback;