mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-05 01:54:09 +08:00
um: Fetch registers only for signals which need them
UML userspace fetches siginfo and passes it to signal handlers in UML. This is needed only for some of the signals, because key handlers like SIGIO make no use of this variable. Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
a374b7cb1e
commit
3c6ac61bc9
@ -400,7 +400,20 @@ void userspace(struct uml_pt_regs *regs, unsigned long *aux_fp_regs)
|
|||||||
if (WIFSTOPPED(status)) {
|
if (WIFSTOPPED(status)) {
|
||||||
int sig = WSTOPSIG(status);
|
int sig = WSTOPSIG(status);
|
||||||
|
|
||||||
ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
|
/* These signal handlers need the si argument.
|
||||||
|
* The SIGIO and SIGALARM handlers which constitute the
|
||||||
|
* majority of invocations, do not use it.
|
||||||
|
*/
|
||||||
|
switch (sig) {
|
||||||
|
case SIGSEGV:
|
||||||
|
case SIGTRAP:
|
||||||
|
case SIGILL:
|
||||||
|
case SIGBUS:
|
||||||
|
case SIGFPE:
|
||||||
|
case SIGWINCH:
|
||||||
|
ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch (sig) {
|
switch (sig) {
|
||||||
case SIGSEGV:
|
case SIGSEGV:
|
||||||
|
Loading…
Reference in New Issue
Block a user