X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fs390%2Fkernel%2Ftraps.c;fp=arch%2Fs390%2Fkernel%2Ftraps.c;h=c8319534a07bad4810d35d8e46f07945a5130f04;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hp=a46793beeddda592d70797ed79fc4c462477f1d6;hpb=4e76c8a9fa413ccc09d3f7f664183dcce3555d57;p=linux-2.6.git diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index a46793bee..c8319534a 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c @@ -14,12 +14,11 @@ * 'Traps.c' handles hardware traps and faults after we have saved some * state in 'asm.s'. */ -#include #include #include #include #include -#include +#include #include #include #include @@ -150,13 +149,11 @@ void show_stack(struct task_struct *task, unsigned long *sp) unsigned long *stack; int i; - // debugging aid: "show_stack(NULL);" prints the - // back trace for this cpu. - if (!sp) - sp = task ? (unsigned long *) task->thread.ksp : __r15; + stack = task ? (unsigned long *) task->thread.ksp : __r15; + else + stack = sp; - stack = sp; for (i = 0; i < kstack_depth_to_print; i++) { if (((addr_t) stack & (THREAD_SIZE-1)) == 0) break; @@ -173,7 +170,7 @@ void show_stack(struct task_struct *task, unsigned long *sp) */ void dump_stack(void) { - show_stack(0, 0); + show_stack(NULL, NULL); } EXPORT_SYMBOL(dump_stack); @@ -334,14 +331,14 @@ static void inline do_trap(long interruption_code, int signr, char *str, } } -static inline void *get_check_address(struct pt_regs *regs) +static inline void __user *get_check_address(struct pt_regs *regs) { - return (void *)((regs->psw.addr-S390_lowcore.pgm_ilc) & PSW_ADDR_INSN); + return (void __user *)((regs->psw.addr-S390_lowcore.pgm_ilc) & PSW_ADDR_INSN); } void do_single_step(struct pt_regs *regs) { - if ((current->ptrace & PT_PTRACED) != 0) + if (tracehook_consider_fatal_signal(current, SIGTRAP)) force_sig(SIGTRAP, current); } @@ -363,7 +360,7 @@ asmlinkage void name(struct pt_regs * regs, long interruption_code) \ info.si_signo = signr; \ info.si_errno = 0; \ info.si_code = sicode; \ - info.si_addr = (void *)siaddr; \ + info.si_addr = siaddr; \ do_trap(interruption_code, signr, str, regs, &info); \ } @@ -395,7 +392,7 @@ DO_ERROR_INFO(SIGILL, "translation exception", translation_exception, ILL_ILLOPN, get_check_address(regs)) static inline void -do_fp_trap(struct pt_regs *regs, void *location, +do_fp_trap(struct pt_regs *regs, void __user *location, int fpc, long interruption_code) { siginfo_t si; @@ -427,10 +424,10 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code) { siginfo_t info; __u8 opcode[6]; - __u16 *location; + __u16 __user *location; int signal = 0; - location = (__u16 *) get_check_address(regs); + location = get_check_address(regs); /* * We got all needed information from the lowcore and can @@ -442,7 +439,7 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code) if (regs->psw.mask & PSW_MASK_PSTATE) { get_user(*((__u16 *) opcode), (__u16 __user *) location); if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) { - if (current->ptrace & PT_PTRACED) + if (tracehook_consider_fatal_signal(current, SIGTRAP)) force_sig(SIGTRAP, current); else signal = SIGILL; @@ -562,10 +559,10 @@ DO_ERROR_INFO(SIGILL, "specification exception", specification_exception, asmlinkage void data_exception(struct pt_regs * regs, long interruption_code) { - __u16 *location; + __u16 __user *location; int signal = 0; - location = (__u16 *) get_check_address(regs); + location = get_check_address(regs); /* * We got all needed information from the lowcore and can