Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

H. Peter Anvin and committed by
Ingo Molnar
faca6227 25149b62

+99 -101
+2 -2
arch/x86/kernel/asm-offsets_32.c
··· 101 101 OFFSET(pbe_orig_address, pbe, orig_address); 102 102 OFFSET(pbe_next, pbe, next); 103 103 104 - /* Offset from the sysenter stack to tss.esp0 */ 105 - DEFINE(TSS_sysenter_esp0, offsetof(struct tss_struct, x86_tss.esp0) - 104 + /* Offset from the sysenter stack to tss.sp0 */ 105 + DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) - 106 106 sizeof(struct tss_struct)); 107 107 108 108 DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
+1 -1
arch/x86/kernel/cpu/common.c
··· 691 691 BUG(); 692 692 enter_lazy_tlb(&init_mm, curr); 693 693 694 - load_esp0(t, thread); 694 + load_sp0(t, thread); 695 695 set_tss_desc(cpu,t); 696 696 load_TR_desc(); 697 697 load_LDT(&init_mm.context);
+8 -7
arch/x86/kernel/doublefault_32.c
··· 35 35 if (ptr_ok(tss)) { 36 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 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 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 ··· 51 50 52 51 struct tss_struct doublefault_tss __cacheline_aligned = { 53 52 .x86_tss = { 54 - .esp0 = STACK_START, 53 + .sp0 = STACK_START, 55 54 .ss0 = __KERNEL_DS, 56 55 .ldt = 0, 57 56 .io_bitmap_base = INVALID_IO_BITMAP_OFFSET, 58 57 59 - .eip = (unsigned long) doublefault_fn, 58 + .ip = (unsigned long) doublefault_fn, 60 59 /* 0x2 bit is always set */ 61 - .eflags = X86_EFLAGS_SF | 0x2, 62 - .esp = STACK_START, 60 + .flags = X86_EFLAGS_SF | 0x2, 61 + .sp = STACK_START, 63 62 .es = __USER_DS, 64 63 .cs = __KERNEL_CS, 65 64 .ss = __KERNEL_DS,
+3 -3
arch/x86/kernel/entry_32.S
··· 288 288 CFI_SIGNAL_FRAME 289 289 CFI_DEF_CFA esp, 0 290 290 CFI_REGISTER esp, ebp 291 - movl TSS_sysenter_esp0(%esp),%esp 291 + movl TSS_sysenter_sp0(%esp),%esp 292 292 sysenter_past_esp: 293 293 /* 294 294 * No need to follow this irqs on/off section: the syscall ··· 743 743 * that sets up the real kernel stack. Check here, since we can't 744 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 747 * already pushed 3 words if it hits on the sysenter instruction: 748 748 * eflags, cs and eip. 749 749 * ··· 755 755 cmpw $__KERNEL_CS,4(%esp); \ 756 756 jne ok; \ 757 757 label: \ 758 - movl TSS_sysenter_esp0+offset(%esp),%esp; \ 758 + movl TSS_sysenter_sp0+offset(%esp),%esp; \ 759 759 CFI_DEF_CFA esp, 0; \ 760 760 CFI_UNDEFINED eip; \ 761 761 pushfl; \
+1 -1
arch/x86/kernel/paravirt_32.c
··· 382 382 .write_ldt_entry = write_dt_entry, 383 383 .write_gdt_entry = write_dt_entry, 384 384 .write_idt_entry = write_dt_entry, 385 - .load_esp0 = native_load_esp0, 385 + .load_sp0 = native_load_sp0, 386 386 387 387 .irq_enable_syscall_ret = native_irq_enable_syscall_ret, 388 388 .iret = native_iret,
+6 -6
arch/x86/kernel/process_32.c
··· 75 75 */ 76 76 unsigned 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 488 childregs->ax = 0; 489 489 childregs->sp = sp; 490 490 491 - p->thread.esp = (unsigned long) childregs; 492 - p->thread.esp0 = (unsigned long) (childregs+1); 491 + p->thread.sp = (unsigned long) childregs; 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 496 savesegment(gs,p->thread.gs); 497 497 ··· 718 718 /* 719 719 * Reload esp0. 720 720 */ 721 - load_esp0(tss, next); 721 + load_sp0(tss, next); 722 722 723 723 /* 724 724 * Save away %gs. No need to save %fs, as it was saved on the ··· 851 851 if (!p || p == current || p->state == TASK_RUNNING) 852 852 return 0; 853 853 stack_page = (unsigned long)task_stack_page(p); 854 - sp = p->thread.esp; 854 + sp = p->thread.sp; 855 855 if (!stack_page || sp < stack_page || sp > top_esp+stack_page) 856 856 return 0; 857 857 /* include/asm-i386/system.h:switch_to() pushes bp last. */
+8 -8
arch/x86/kernel/process_64.c
··· 493 493 if (sp == ~0UL) 494 494 childregs->sp = (unsigned long)childregs; 495 495 496 - p->thread.rsp = (unsigned long) childregs; 497 - p->thread.rsp0 = (unsigned long) (childregs+1); 498 - p->thread.userrsp = me->thread.userrsp; 496 + p->thread.sp = (unsigned long) childregs; 497 + p->thread.sp0 = (unsigned long) (childregs+1); 498 + p->thread.usersp = me->thread.usersp; 499 499 500 500 set_tsk_thread_flag(p, TIF_FORK); 501 501 ··· 607 607 /* 608 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 613 * Switch DS and ES. ··· 666 666 /* 667 667 * Switch the PDA and FPU contexts. 668 668 */ 669 - prev->userrsp = read_pda(oldrsp); 670 - write_pda(oldrsp, next->userrsp); 669 + prev->usersp = read_pda(oldrsp); 670 + write_pda(oldrsp, next->usersp); 671 671 write_pda(pcurrent, next_p); 672 672 673 673 write_pda(kernelstack, ··· 769 769 if (!p || p == current || p->state==TASK_RUNNING) 770 770 return 0; 771 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 773 return 0; 774 - fp = *(u64 *)(p->thread.rsp); 774 + fp = *(u64 *)(p->thread.sp); 775 775 do { 776 776 if (fp < (unsigned long)stack || 777 777 fp > (unsigned long)stack+THREAD_SIZE)
+4 -4
arch/x86/kernel/smpboot_32.c
··· 454 454 "movl %0,%%esp\n\t" 455 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 460 /* Static state in head.S used to set up a CPU */ ··· 753 753 /* initialize thread_struct. we really want to avoid destroy 754 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 757 init_idle(idle, cpu); 758 758 return idle; 759 759 } ··· 798 798 per_cpu(current_task, cpu) = idle; 799 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 802 /* start_eip had better be page-aligned! */ 803 803 start_eip = setup_trampoline(); 804 804 ··· 808 808 /* So we see what's up */ 809 809 printk("Booting processor %d/%d ip %lx\n", cpu, apicid, start_eip); 810 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 813 irq_ctx_init(cpu); 814 814
+3 -3
arch/x86/kernel/smpboot_64.c
··· 577 577 c_idle.idle = get_idle_for_cpu(cpu); 578 578 579 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 581 (THREAD_SIZE + task_stack_page(c_idle.idle))) - 1); 582 582 init_idle(c_idle.idle, cpu); 583 583 goto do_rest; ··· 613 613 614 614 start_rip = setup_trampoline(); 615 615 616 - init_rsp = c_idle.idle->thread.rsp; 617 - per_cpu(init_tss,cpu).rsp0 = init_rsp; 616 + init_rsp = c_idle.idle->thread.sp; 617 + per_cpu(init_tss,cpu).sp0 = init_rsp; 618 618 initial_code = start_secondary; 619 619 clear_tsk_thread_flag(c_idle.idle, TIF_FORK); 620 620
+3 -3
arch/x86/kernel/traps_32.c
··· 163 163 unsigned long dummy; 164 164 stack = &dummy; 165 165 if (task != current) 166 - stack = (unsigned long *)task->thread.esp; 166 + stack = (unsigned long *)task->thread.sp; 167 167 } 168 168 169 169 #ifdef CONFIG_FRAME_POINTER ··· 173 173 asm ("movl %%ebp, %0" : "=r" (bp) : ); 174 174 } else { 175 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 179 #endif ··· 253 253 254 254 if (sp == NULL) { 255 255 if (task) 256 - sp = (unsigned long*)task->thread.esp; 256 + sp = (unsigned long*)task->thread.sp; 257 257 else 258 258 sp = (unsigned long *)&sp; 259 259 }
+2 -2
arch/x86/kernel/traps_64.c
··· 230 230 unsigned long dummy; 231 231 stack = &dummy; 232 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 366 367 367 if (sp == NULL) { 368 368 if (tsk) 369 - sp = (unsigned long *)tsk->thread.rsp; 369 + sp = (unsigned long *)tsk->thread.sp; 370 370 else 371 371 sp = (unsigned long *)&sp; 372 372 }
+8 -8
arch/x86/kernel/vm86_32.c
··· 147 147 } 148 148 149 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 151 current->thread.sysenter_cs = __KERNEL_CS; 152 - load_esp0(tss, &current->thread); 153 - current->thread.saved_esp0 = 0; 152 + load_sp0(tss, &current->thread); 153 + current->thread.saved_sp0 = 0; 154 154 put_cpu(); 155 155 156 156 ret = KVM86->regs32; ··· 207 207 int tmp, ret = -EPERM; 208 208 209 209 tsk = current; 210 - if (tsk->thread.saved_esp0) 210 + if (tsk->thread.saved_sp0) 211 211 goto out; 212 212 tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, 213 213 offsetof(struct kernel_vm86_struct, vm86plus) - ··· 256 256 257 257 /* we come here only for functions VM86_ENTER, VM86_ENTER_NO_BYPASS */ 258 258 ret = -EPERM; 259 - if (tsk->thread.saved_esp0) 259 + if (tsk->thread.saved_sp0) 260 260 goto out; 261 261 v86 = (struct vm86plus_struct __user *)regs.cx; 262 262 tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, ··· 318 318 * Save old state, set default return value (%ax) to 0 319 319 */ 320 320 info->regs32->ax = 0; 321 - tsk->thread.saved_esp0 = tsk->thread.esp0; 321 + tsk->thread.saved_sp0 = tsk->thread.sp0; 322 322 tsk->thread.saved_fs = info->regs32->fs; 323 323 savesegment(gs, tsk->thread.saved_gs); 324 324 325 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 327 if (cpu_has_sep) 328 328 tsk->thread.sysenter_cs = 0; 329 - load_esp0(tss, &tsk->thread); 329 + load_sp0(tss, &tsk->thread); 330 330 put_cpu(); 331 331 332 332 tsk->thread.screen_bitmap = info->screen_bitmap;
+5 -5
arch/x86/kernel/vmi_32.c
··· 62 62 void (*cpuid)(void /* non-c */); 63 63 void (*_set_ldt)(u32 selector); 64 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 66 void (*allocate_page)(u32, u32, u32, u32, u32); 67 67 void (*release_page)(u32, u32); 68 68 void (*set_pte)(pte_t, pte_t *, unsigned); ··· 214 214 vmi_ops.set_tr(GDT_ENTRY_TSS*sizeof(struct desc_struct)); 215 215 } 216 216 217 - static void vmi_load_esp0(struct tss_struct *tss, 217 + static void vmi_load_sp0(struct tss_struct *tss, 218 218 struct thread_struct *thread) 219 219 { 220 - tss->x86_tss.esp0 = thread->esp0; 220 + tss->x86_tss.sp0 = thread->sp0; 221 221 222 222 /* This can only happen when SEP is enabled, no need to test "SEP"arately */ 223 223 if (unlikely(tss->x86_tss.ss1 != thread->sysenter_cs)) { 224 224 tss->x86_tss.ss1 = thread->sysenter_cs; 225 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 230 230 static void vmi_flush_tlb_user(void) ··· 793 793 para_fill(pv_cpu_ops.write_ldt_entry, WriteLDTEntry); 794 794 para_fill(pv_cpu_ops.write_gdt_entry, WriteGDTEntry); 795 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 797 para_fill(pv_cpu_ops.set_iopl_mask, SetIOPLMask); 798 798 para_fill(pv_cpu_ops.io_delay, IODelay); 799 799
+3 -3
arch/x86/lguest/boot.c
··· 755 755 * segment), the privilege level (we're privilege level 1, the Host is 0 and 756 756 * will not tolerate us trying to use that), the stack pointer, and the number 757 757 * of pages in the stack. */ 758 - static void lguest_load_esp0(struct tss_struct *tss, 758 + static void lguest_load_sp0(struct tss_struct *tss, 759 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 762 THREAD_SIZE/PAGE_SIZE); 763 763 } 764 764 ··· 957 957 pv_cpu_ops.cpuid = lguest_cpuid; 958 958 pv_cpu_ops.load_idt = lguest_load_idt; 959 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 961 pv_cpu_ops.load_tr_desc = lguest_load_tr_desc; 962 962 pv_cpu_ops.set_ldt = lguest_set_ldt; 963 963 pv_cpu_ops.load_tls = lguest_load_tls;
+2 -2
arch/x86/vdso/vdso32-setup.c
··· 243 243 } 244 244 245 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 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 249 wrmsr(MSR_IA32_SYSENTER_EIP, (unsigned long) ia32_sysenter_target, 0); 250 250 put_cpu(); 251 251 }
+3 -3
arch/x86/xen/enlighten.c
··· 499 499 preempt_enable(); 500 500 } 501 501 502 - static void xen_load_esp0(struct tss_struct *tss, 502 + static void xen_load_sp0(struct tss_struct *tss, 503 503 struct thread_struct *thread) 504 504 { 505 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 507 xen_mc_issue(PARAVIRT_LAZY_CPU); 508 508 } 509 509 ··· 968 968 .write_ldt_entry = xen_write_ldt_entry, 969 969 .write_gdt_entry = xen_write_gdt_entry, 970 970 .write_idt_entry = xen_write_idt_entry, 971 - .load_esp0 = xen_load_esp0, 971 + .load_sp0 = xen_load_sp0, 972 972 973 973 .set_iopl_mask = xen_set_iopl_mask, 974 974 .io_delay = xen_io_delay,
+2 -2
arch/x86/xen/smp.c
··· 239 239 ctxt->gdt_ents = ARRAY_SIZE(gdt->gdt); 240 240 241 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 244 ctxt->kernel_ss = __KERNEL_DS; 245 - ctxt->kernel_sp = idle->thread.esp0; 245 + ctxt->kernel_sp = idle->thread.sp0; 246 246 247 247 ctxt->event_callback_cs = __KERNEL_CS; 248 248 ctxt->event_callback_eip = (unsigned long)xen_hypervisor_callback;
+2 -2
drivers/lguest/x86/core.c
··· 94 94 /* Set up the two "TSS" members which tell the CPU what stack to use 95 95 * for traps which do directly into the Guest (ie. traps at privilege 96 96 * level 1). */ 97 - pages->state.guest_tss.esp1 = lg->esp1; 97 + pages->state.guest_tss.sp1 = lg->esp1; 98 98 pages->state.guest_tss.ss1 = lg->ss1; 99 99 100 100 /* Copy direct-to-Guest trap entries. */ ··· 416 416 /* We know where we want the stack to be when the Guest enters 417 417 * the switcher: in pages->regs. The stack grows upwards, so 418 418 * we start it at the end of that structure. */ 419 - state->guest_tss.esp0 = (long)(&pages->regs + 1); 419 + state->guest_tss.sp0 = (long)(&pages->regs + 1); 420 420 /* And this is the GDT entry to use for the stack: we keep a 421 421 * couple of special LGUEST entries. */ 422 422 state->guest_tss.ss0 = LGUEST_DS;
+3 -3
include/asm-x86/paravirt.h
··· 101 101 int entrynum, u32 low, u32 high); 102 102 void (*write_idt_entry)(struct desc_struct *, 103 103 int entrynum, u32 low, u32 high); 104 - void (*load_esp0)(struct tss_struct *tss, struct thread_struct *t); 104 + void (*load_sp0)(struct tss_struct *tss, struct thread_struct *t); 105 105 106 106 void (*set_iopl_mask)(unsigned mask); 107 107 ··· 449 449 return pv_info.paravirt_enabled; 450 450 } 451 451 452 - static inline void load_esp0(struct tss_struct *tss, 452 + static inline void load_sp0(struct tss_struct *tss, 453 453 struct thread_struct *thread) 454 454 { 455 - PVOP_VCALL2(pv_cpu_ops.load_esp0, tss, thread); 455 + PVOP_VCALL2(pv_cpu_ops.load_sp0, tss, thread); 456 456 } 457 457 458 458 #define ARCH_SETUP pv_init_ops.arch_setup();
+17 -20
include/asm-x86/processor_32.h
··· 292 292 /* This is the TSS defined by the hardware. */ 293 293 struct i386_hw_tss { 294 294 unsigned short back_link,__blh; 295 - unsigned long esp0; 295 + unsigned long sp0; 296 296 unsigned short ss0,__ss0h; 297 - unsigned long esp1; 297 + unsigned long sp1; 298 298 unsigned short ss1,__ss1h; /* ss1 is used to cache MSR_IA32_SYSENTER_CS */ 299 - unsigned long esp2; 299 + unsigned long sp2; 300 300 unsigned short ss2,__ss2h; 301 301 unsigned long __cr3; 302 - unsigned long eip; 303 - unsigned long eflags; 304 - unsigned long eax,ecx,edx,ebx; 305 - unsigned long esp; 306 - unsigned long ebp; 307 - unsigned long esi; 308 - unsigned long edi; 302 + unsigned long ip; 303 + unsigned long flags; 304 + unsigned long ax, cx, dx, bx; 305 + unsigned long sp, bp, si, di; 309 306 unsigned short es, __esh; 310 307 unsigned short cs, __csh; 311 308 unsigned short ss, __ssh; ··· 343 346 struct thread_struct { 344 347 /* cached TLS descriptors. */ 345 348 struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; 346 - unsigned long esp0; 349 + unsigned long sp0; 347 350 unsigned long sysenter_cs; 348 - unsigned long eip; 349 - unsigned long esp; 351 + unsigned long ip; 352 + unsigned long sp; 350 353 unsigned long fs; 351 354 unsigned long gs; 352 355 /* Hardware debugging registers */ ··· 363 366 /* virtual 86 mode info */ 364 367 struct vm86_struct __user * vm86_info; 365 368 unsigned long screen_bitmap; 366 - unsigned long v86flags, v86mask, saved_esp0; 369 + unsigned long v86flags, v86mask, saved_sp0; 367 370 unsigned int saved_fs, saved_gs; 368 371 /* IO permissions */ 369 372 unsigned long *io_bitmap_ptr; ··· 375 378 }; 376 379 377 380 #define INIT_THREAD { \ 378 - .esp0 = sizeof(init_stack) + (long)&init_stack, \ 381 + .sp0 = sizeof(init_stack) + (long)&init_stack, \ 379 382 .vm86_info = NULL, \ 380 383 .sysenter_cs = __KERNEL_CS, \ 381 384 .io_bitmap_ptr = NULL, \ ··· 390 393 */ 391 394 #define INIT_TSS { \ 392 395 .x86_tss = { \ 393 - .esp0 = sizeof(init_stack) + (long)&init_stack, \ 396 + .sp0 = sizeof(init_stack) + (long)&init_stack, \ 394 397 .ss0 = __KERNEL_DS, \ 395 398 .ss1 = __KERNEL_CS, \ 396 399 .io_bitmap_base = INVALID_IO_BITMAP_OFFSET, \ ··· 500 503 501 504 #define cpu_relax() rep_nop() 502 505 503 - static inline void native_load_esp0(struct tss_struct *tss, struct thread_struct *thread) 506 + static inline void native_load_sp0(struct tss_struct *tss, struct thread_struct *thread) 504 507 { 505 - tss->x86_tss.esp0 = thread->esp0; 508 + tss->x86_tss.sp0 = thread->sp0; 506 509 /* This can only happen when SEP is enabled, no need to test "SEP"arately */ 507 510 if (unlikely(tss->x86_tss.ss1 != thread->sysenter_cs)) { 508 511 tss->x86_tss.ss1 = thread->sysenter_cs; ··· 582 585 #define paravirt_enabled() 0 583 586 #define __cpuid native_cpuid 584 587 585 - static inline void load_esp0(struct tss_struct *tss, struct thread_struct *thread) 588 + static inline void load_sp0(struct tss_struct *tss, struct thread_struct *thread) 586 589 { 587 - native_load_esp0(tss, thread); 590 + native_load_sp0(tss, thread); 588 591 } 589 592 590 593 /*
+10 -10
include/asm-x86/processor_64.h
··· 177 177 178 178 struct tss_struct { 179 179 u32 reserved1; 180 - u64 rsp0; 181 - u64 rsp1; 182 - u64 rsp2; 180 + u64 sp0; 181 + u64 sp1; 182 + u64 sp2; 183 183 u64 reserved2; 184 184 u64 ist[7]; 185 185 u32 reserved3; ··· 216 216 #endif 217 217 218 218 struct thread_struct { 219 - unsigned long rsp0; 220 - unsigned long rsp; 221 - unsigned long userrsp; /* Copy from PDA */ 219 + unsigned long sp0; 220 + unsigned long sp; 221 + unsigned long usersp; /* Copy from PDA */ 222 222 unsigned long fs; 223 223 unsigned long gs; 224 224 unsigned short es, ds, fsindex, gsindex; ··· 245 245 } __attribute__((aligned(16))); 246 246 247 247 #define INIT_THREAD { \ 248 - .rsp0 = (unsigned long)&init_stack + sizeof(init_stack) \ 248 + .sp0 = (unsigned long)&init_stack + sizeof(init_stack) \ 249 249 } 250 250 251 251 #define INIT_TSS { \ 252 - .rsp0 = (unsigned long)&init_stack + sizeof(init_stack) \ 252 + .sp0 = (unsigned long)&init_stack + sizeof(init_stack) \ 253 253 } 254 254 255 255 #define INIT_MMAP \ ··· 293 293 * Return saved PC of a blocked thread. 294 294 * What is this good for? it will be always the scheduler or ret_from_fork. 295 295 */ 296 - #define thread_saved_pc(t) (*(unsigned long *)((t)->thread.rsp - 8)) 296 + #define thread_saved_pc(t) (*(unsigned long *)((t)->thread.sp - 8)) 297 297 298 298 extern unsigned long get_wchan(struct task_struct *p); 299 - #define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.rsp0 - 1) 299 + #define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.sp0 - 1) 300 300 #define KSTK_EIP(tsk) (task_pt_regs(tsk)->ip) 301 301 #define KSTK_ESP(tsk) -1 /* sorry. doesn't work for syscall. */ 302 302
+2 -2
include/asm-x86/system_32.h
··· 28 28 "1:\t" \ 29 29 "popl %%ebp\n\t" \ 30 30 "popfl" \ 31 - :"=m" (prev->thread.esp),"=m" (prev->thread.eip), \ 31 + :"=m" (prev->thread.sp),"=m" (prev->thread.ip), \ 32 32 "=a" (last),"=S" (esi),"=D" (edi) \ 33 - :"m" (next->thread.esp),"m" (next->thread.eip), \ 33 + :"m" (next->thread.sp),"m" (next->thread.ip), \ 34 34 "2" (prev), "d" (next)); \ 35 35 } while (0) 36 36
+1 -1
include/asm-x86/system_64.h
··· 40 40 RESTORE_CONTEXT \ 41 41 : "=a" (last) \ 42 42 : [next] "S" (next), [prev] "D" (prev), \ 43 - [threadrsp] "i" (offsetof(struct task_struct, thread.rsp)), \ 43 + [threadrsp] "i" (offsetof(struct task_struct, thread.sp)), \ 44 44 [ti_flags] "i" (offsetof(struct thread_info, flags)),\ 45 45 [tif_fork] "i" (TIF_FORK), \ 46 46 [thread_info] "i" (offsetof(struct task_struct, stack)), \