diff options
Diffstat (limited to 'arch/s390/kernel/kprobes.c')
-rw-r--r-- | arch/s390/kernel/kprobes.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index 61f0b6c3618c..4efd5dbfd72d 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c | |||
@@ -585,8 +585,8 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, | |||
585 | int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) | 585 | int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) |
586 | { | 586 | { |
587 | struct jprobe *jp = container_of(p, struct jprobe, kp); | 587 | struct jprobe *jp = container_of(p, struct jprobe, kp); |
588 | unsigned long addr; | ||
589 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | 588 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); |
589 | unsigned long stack; | ||
590 | 590 | ||
591 | memcpy(&kcb->jprobe_saved_regs, regs, sizeof(struct pt_regs)); | 591 | memcpy(&kcb->jprobe_saved_regs, regs, sizeof(struct pt_regs)); |
592 | 592 | ||
@@ -594,14 +594,10 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) | |||
594 | regs->psw.addr = (unsigned long)(jp->entry) | PSW_ADDR_AMODE; | 594 | regs->psw.addr = (unsigned long)(jp->entry) | PSW_ADDR_AMODE; |
595 | regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT); | 595 | regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT); |
596 | 596 | ||
597 | /* r14 is the function return address */ | ||
598 | kcb->jprobe_saved_r14 = (unsigned long)regs->gprs[14]; | ||
599 | /* r15 is the stack pointer */ | 597 | /* r15 is the stack pointer */ |
600 | kcb->jprobe_saved_r15 = (unsigned long)regs->gprs[15]; | 598 | stack = (unsigned long) regs->gprs[15]; |
601 | addr = (unsigned long)kcb->jprobe_saved_r15; | ||
602 | 599 | ||
603 | memcpy(kcb->jprobes_stack, (kprobe_opcode_t *) addr, | 600 | memcpy(kcb->jprobes_stack, (void *) stack, MIN_STACK_SIZE(stack)); |
604 | MIN_STACK_SIZE(addr)); | ||
605 | return 1; | 601 | return 1; |
606 | } | 602 | } |
607 | 603 | ||
@@ -618,13 +614,14 @@ void __kprobes jprobe_return_end(void) | |||
618 | int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) | 614 | int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) |
619 | { | 615 | { |
620 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | 616 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); |
621 | unsigned long stack_addr = (unsigned long)(kcb->jprobe_saved_r15); | 617 | unsigned long stack; |
618 | |||
619 | stack = (unsigned long) kcb->jprobe_saved_regs.gprs[15]; | ||
622 | 620 | ||
623 | /* Put the regs back */ | 621 | /* Put the regs back */ |
624 | memcpy(regs, &kcb->jprobe_saved_regs, sizeof(struct pt_regs)); | 622 | memcpy(regs, &kcb->jprobe_saved_regs, sizeof(struct pt_regs)); |
625 | /* put the stack back */ | 623 | /* put the stack back */ |
626 | memcpy((kprobe_opcode_t *) stack_addr, kcb->jprobes_stack, | 624 | memcpy((void *) stack, kcb->jprobes_stack, MIN_STACK_SIZE(stack)); |
627 | MIN_STACK_SIZE(stack_addr)); | ||
628 | preempt_enable_no_resched(); | 625 | preempt_enable_no_resched(); |
629 | return 1; | 626 | return 1; |
630 | } | 627 | } |