diff options
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/extable_32.c | 6 | ||||
-rw-r--r-- | arch/x86/mm/fault_32.c | 38 | ||||
-rw-r--r-- | arch/x86/mm/fault_64.c | 22 |
3 files changed, 33 insertions, 33 deletions
diff --git a/arch/x86/mm/extable_32.c b/arch/x86/mm/extable_32.c index 0ce4f22a2635..41685461f8b2 100644 --- a/arch/x86/mm/extable_32.c +++ b/arch/x86/mm/extable_32.c @@ -11,7 +11,7 @@ int fixup_exception(struct pt_regs *regs) const struct exception_table_entry *fixup; #ifdef CONFIG_PNPBIOS - if (unlikely(SEGMENT_IS_PNP_CODE(regs->xcs))) + if (unlikely(SEGMENT_IS_PNP_CODE(regs->cs))) { extern u32 pnp_bios_fault_eip, pnp_bios_fault_esp; extern u32 pnp_bios_is_utter_crap; @@ -25,9 +25,9 @@ int fixup_exception(struct pt_regs *regs) } #endif - fixup = search_exception_tables(regs->eip); + fixup = search_exception_tables(regs->ip); if (fixup) { - regs->eip = fixup->fixup; + regs->ip = fixup->fixup; return 1; } diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c index a2273d44aa27..6056c6d71835 100644 --- a/arch/x86/mm/fault_32.c +++ b/arch/x86/mm/fault_32.c @@ -72,15 +72,15 @@ static inline int notify_page_fault(struct pt_regs *regs) static inline unsigned long get_segment_eip(struct pt_regs *regs, unsigned long *eip_limit) { - unsigned long eip = regs->eip; - unsigned seg = regs->xcs & 0xffff; + unsigned long ip = regs->ip; + unsigned seg = regs->cs & 0xffff; u32 seg_ar, seg_limit, base, *desc; /* Unlikely, but must come before segment checks. */ - if (unlikely(regs->eflags & VM_MASK)) { + if (unlikely(regs->flags & VM_MASK)) { base = seg << 4; *eip_limit = base + 0xffff; - return base + (eip & 0xffff); + return base + (ip & 0xffff); } /* The standard kernel/user address space limit. */ @@ -88,16 +88,16 @@ static inline unsigned long get_segment_eip(struct pt_regs *regs, /* By far the most common cases. */ if (likely(SEGMENT_IS_FLAT_CODE(seg))) - return eip; + return ip; /* Check the segment exists, is within the current LDT/GDT size, that kernel/user (ring 0..3) has the appropriate privilege, that it's a code segment, and get the limit. */ __asm__ ("larl %3,%0; lsll %3,%1" : "=&r" (seg_ar), "=r" (seg_limit) : "0" (0), "rm" (seg)); - if ((~seg_ar & 0x9800) || eip > seg_limit) { + if ((~seg_ar & 0x9800) || ip > seg_limit) { *eip_limit = 0; - return 1; /* So that returned eip > *eip_limit. */ + return 1; /* So that returned ip > *eip_limit. */ } /* Get the GDT/LDT descriptor base. @@ -127,7 +127,7 @@ static inline unsigned long get_segment_eip(struct pt_regs *regs, seg_limit += base; if (seg_limit < *eip_limit && seg_limit >= base) *eip_limit = seg_limit; - return eip + base; + return ip + base; } /* @@ -345,7 +345,7 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs, /* It's safe to allow irq's after cr2 has been saved and the vmalloc fault has been handled. */ - if (regs->eflags & (X86_EFLAGS_IF|VM_MASK)) + if (regs->flags & (X86_EFLAGS_IF|VM_MASK)) local_irq_enable(); mm = tsk->mm; @@ -374,7 +374,7 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs, */ if (!down_read_trylock(&mm->mmap_sem)) { if ((error_code & 4) == 0 && - !search_exception_tables(regs->eip)) + !search_exception_tables(regs->ip)) goto bad_area_nosemaphore; down_read(&mm->mmap_sem); } @@ -388,12 +388,12 @@ fastcall void __kprobes do_page_fault(struct pt_regs *regs, goto bad_area; if (error_code & 4) { /* - * Accessing the stack below %esp is always a bug. + * Accessing the stack below %sp is always a bug. * The large cushion allows instructions like enter * and pusha to work. ("enter $65535,$31" pushes - * 32 pointers and then decrements %esp by 65535.) + * 32 pointers and then decrements %sp by 65535.) */ - if (address + 65536 + 32 * sizeof(unsigned long) < regs->esp) + if (address + 65536 + 32 * sizeof(unsigned long) < regs->sp) goto bad_area; } if (expand_stack(vma, address)) @@ -442,7 +442,7 @@ good_area: /* * Did it hit the DOS screen memory VA from vm86 mode? */ - if (regs->eflags & VM_MASK) { + if (regs->flags & VM_MASK) { unsigned long bit = (address - 0xA0000) >> PAGE_SHIFT; if (bit < 32) tsk->thread.screen_bitmap |= 1 << bit; @@ -474,11 +474,11 @@ bad_area_nosemaphore: if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) && printk_ratelimit()) { - printk("%s%s[%d]: segfault at %08lx eip %08lx " - "esp %08lx error %lx\n", + printk("%s%s[%d]: segfault at %08lx ip %08lx " + "sp %08lx error %lx\n", task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG, - tsk->comm, task_pid_nr(tsk), address, regs->eip, - regs->esp, error_code); + tsk->comm, task_pid_nr(tsk), address, regs->ip, + regs->sp, error_code); } tsk->thread.cr2 = address; /* Kernel addresses are always protection faults */ @@ -544,7 +544,7 @@ no_context: printk(KERN_ALERT "BUG: unable to handle kernel paging" " request"); printk(" at virtual address %08lx\n",address); - printk(KERN_ALERT "printing eip: %08lx ", regs->eip); + printk(KERN_ALERT "printing ip: %08lx ", regs->ip); page = read_cr3(); page = ((__typeof__(page) *) __va(page))[address >> PGDIR_SHIFT]; diff --git a/arch/x86/mm/fault_64.c b/arch/x86/mm/fault_64.c index 0e26230669ca..88a7abda29ce 100644 --- a/arch/x86/mm/fault_64.c +++ b/arch/x86/mm/fault_64.c @@ -198,7 +198,7 @@ KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n"; static int is_errata93(struct pt_regs *regs, unsigned long address) { static int warned; - if (address != regs->rip) + if (address != regs->ip) return 0; if ((address >> 32) != 0) return 0; @@ -209,7 +209,7 @@ static int is_errata93(struct pt_regs *regs, unsigned long address) printk(errata93_warning); warned = 1; } - regs->rip = address; + regs->ip = address; return 1; } return 0; @@ -355,7 +355,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, if (notify_page_fault(regs)) return; - if (likely(regs->eflags & X86_EFLAGS_IF)) + if (likely(regs->flags & X86_EFLAGS_IF)) local_irq_enable(); if (unlikely(error_code & PF_RSVD)) @@ -393,7 +393,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, */ if (!down_read_trylock(&mm->mmap_sem)) { if ((error_code & PF_USER) == 0 && - !search_exception_tables(regs->rip)) + !search_exception_tables(regs->ip)) goto bad_area_nosemaphore; down_read(&mm->mmap_sem); } @@ -409,7 +409,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, /* Allow userspace just enough access below the stack pointer * to let the 'enter' instruction work. */ - if (address + 65536 + 32 * sizeof(unsigned long) < regs->rsp) + if (address + 65536 + 32 * sizeof(unsigned long) < regs->sp) goto bad_area; } if (expand_stack(vma, address)) @@ -488,10 +488,10 @@ bad_area_nosemaphore: if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) && printk_ratelimit()) { printk( - "%s%s[%d]: segfault at %lx rip %lx rsp %lx error %lx\n", + "%s%s[%d]: segfault at %lx ip %lx sp %lx error %lx\n", tsk->pid > 1 ? KERN_INFO : KERN_EMERG, - tsk->comm, tsk->pid, address, regs->rip, - regs->rsp, error_code); + tsk->comm, tsk->pid, address, regs->ip, + regs->sp, error_code); } tsk->thread.cr2 = address; @@ -509,9 +509,9 @@ bad_area_nosemaphore: no_context: /* Are we prepared to handle this kernel fault? */ - fixup = search_exception_tables(regs->rip); + fixup = search_exception_tables(regs->ip); if (fixup) { - regs->rip = fixup->fixup; + regs->ip = fixup->fixup; return; } @@ -537,7 +537,7 @@ no_context: else printk(KERN_ALERT "Unable to handle kernel paging request"); printk(" at %016lx RIP: \n" KERN_ALERT,address); - printk_address(regs->rip); + printk_address(regs->ip); dump_pagetable(address); tsk->thread.cr2 = address; tsk->thread.trap_no = 14; |