[S390] fix kprobes single stepping
Fix kprobes after git commit 1e54622e04
broke it. The kprobe_handler is now called with interrupts in the state
at the time of the breakpoint. The single step of the replaced instruction
is done with interrupts off which makes it necessary to enable and disable
the interupts in the kprobes code.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:

committed by
Martin Schwidefsky

父節點
f2166bb117
當前提交
9ec2708053
@@ -316,6 +316,8 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
|
||||
return 1;
|
||||
|
||||
ss_probe:
|
||||
if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO))
|
||||
local_irq_disable();
|
||||
prepare_singlestep(p, regs);
|
||||
kcb->kprobe_status = KPROBE_HIT_SS;
|
||||
return 1;
|
||||
@@ -463,6 +465,8 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs)
|
||||
goto out;
|
||||
}
|
||||
reset_current_kprobe();
|
||||
if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO))
|
||||
local_irq_enable();
|
||||
out:
|
||||
preempt_enable_no_resched();
|
||||
|
||||
@@ -502,8 +506,11 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
|
||||
regs->psw.mask |= kcb->kprobe_saved_imask;
|
||||
if (kcb->kprobe_status == KPROBE_REENTER)
|
||||
restore_previous_kprobe(kcb);
|
||||
else
|
||||
else {
|
||||
reset_current_kprobe();
|
||||
if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO))
|
||||
local_irq_enable();
|
||||
}
|
||||
preempt_enable_no_resched();
|
||||
break;
|
||||
case KPROBE_HIT_ACTIVE:
|
||||
|
Reference in New Issue
Block a user