提交 352651c8 编写于 作者: H He Sheng 提交者: Zheng Zengkai

sw64: force signal and fault for traps and debugging

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG

--------------------------------

Suppose that parent traces child which masks all the signals.
If trap or fault occurs on child, it will pass through. To do
it right, we have to force signal and fault in that case.
Signed-off-by: NHe Sheng <hesheng@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 9d216f35
......@@ -137,8 +137,8 @@ do_sigreturn(struct sigcontext __user *sc)
/* Send SIGTRAP if we're single-stepping: */
if (ptrace_cancel_bpt(current)) {
send_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *) regs->pc, 0,
current);
force_sig_fault(SIGTRAP, TRAP_BRKPT,
(void __user *)regs->pc, 0);
}
return;
......@@ -168,8 +168,8 @@ do_rt_sigreturn(struct rt_sigframe __user *frame)
/* Send SIGTRAP if we're single-stepping: */
if (ptrace_cancel_bpt(current)) {
send_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *) regs->pc, 0,
current);
force_sig_fault(SIGTRAP, TRAP_BRKPT,
(void __user *)regs->pc, 0);
}
return;
......
......@@ -180,7 +180,7 @@ do_entArith(unsigned long summary, unsigned long write_mask,
}
die_if_kernel("Arithmetic fault", regs, 0, NULL);
send_sig_fault(SIGFPE, si_code, (void __user *) regs->pc, 0, current);
force_sig_fault(SIGFPE, si_code, (void __user *)regs->pc, 0);
}
asmlinkage void
......@@ -213,13 +213,11 @@ do_entIF(unsigned long inst_type, struct pt_regs *regs)
if (ptrace_cancel_bpt(current))
regs->pc -= 4; /* make pc point to former bpt */
send_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->pc, 0,
current);
force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->pc, 0);
return;
case 1: /* bugcheck */
send_sig_fault(SIGTRAP, TRAP_UNK, (void __user *)regs->pc, 0,
current);
force_sig_fault(SIGTRAP, TRAP_UNK, (void __user *)regs->pc, 0);
return;
case 2: /* gentrap */
......@@ -280,8 +278,7 @@ do_entIF(unsigned long inst_type, struct pt_regs *regs)
break;
}
send_sig_fault(signo, code, (void __user *)regs->pc, 0,
current);
force_sig_fault(signo, code, (void __user *)regs->pc, regs->r16);
return;
case 4: /* opDEC */
......@@ -324,8 +321,7 @@ do_entIF(unsigned long inst_type, struct pt_regs *regs)
break;
}
send_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)regs->pc, 0,
current);
force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)regs->pc, 0);
}
/*
......@@ -1601,12 +1597,12 @@ do_entUnaUser(void __user *va, unsigned long opcode,
si_code = SEGV_MAPERR;
up_read(&mm->mmap_lock);
}
send_sig_fault(SIGBUS, si_code, va, 0, current);
force_sig_fault(SIGSEGV, si_code, va, 0);
return;
give_sigbus:
regs->pc -= 4;
send_sig_fault(SIGBUS, BUS_ADRALN, va, 0, current);
force_sig_fault(SIGBUS, BUS_ADRALN, va, 0);
}
void
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册