diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/um/kernel/signal.c | 1 | ||||
-rw-r--r-- | arch/um/kernel/trap.c | 1 | ||||
-rw-r--r-- | arch/um/sys-x86/shared/sysdep/faultinfo_32.h | 6 | ||||
-rw-r--r-- | arch/um/sys-x86/shared/sysdep/faultinfo_64.h | 6 | ||||
-rw-r--r-- | arch/um/sys-x86/shared/sysdep/ptrace_32.h | 1 | ||||
-rw-r--r-- | arch/um/sys-x86/shared/sysdep/ptrace_64.h | 5 | ||||
-rw-r--r-- | arch/um/sys-x86/shared/sysdep/sigcontext_32.h | 8 | ||||
-rw-r--r-- | arch/um/sys-x86/shared/sysdep/sigcontext_64.h | 8 |
8 files changed, 14 insertions, 22 deletions
diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c index b5c094c4ade4..e8b889d3bce7 100644 --- a/arch/um/kernel/signal.c +++ b/arch/um/kernel/signal.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <asm/unistd.h> | 11 | #include <asm/unistd.h> |
12 | #include "frame_kern.h" | 12 | #include "frame_kern.h" |
13 | #include "kern_util.h" | 13 | #include "kern_util.h" |
14 | #include <sysdep/sigcontext.h> | ||
15 | 14 | ||
16 | EXPORT_SYMBOL(block_signals); | 15 | EXPORT_SYMBOL(block_signals); |
17 | EXPORT_SYMBOL(unblock_signals); | 16 | EXPORT_SYMBOL(unblock_signals); |
diff --git a/arch/um/kernel/trap.c b/arch/um/kernel/trap.c index 8c7b8823d1f0..f2a2036c026a 100644 --- a/arch/um/kernel/trap.c +++ b/arch/um/kernel/trap.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include "kern_util.h" | 14 | #include "kern_util.h" |
15 | #include "os.h" | 15 | #include "os.h" |
16 | #include "skas.h" | 16 | #include "skas.h" |
17 | #include "sysdep/sigcontext.h" | ||
18 | 17 | ||
19 | /* | 18 | /* |
20 | * Note this is constrained to return 0, -EFAULT, -EACCESS, -ENOMEM by | 19 | * Note this is constrained to return 0, -EFAULT, -EACCESS, -ENOMEM by |
diff --git a/arch/um/sys-x86/shared/sysdep/faultinfo_32.h b/arch/um/sys-x86/shared/sysdep/faultinfo_32.h index db437cc373bc..a26086b8a800 100644 --- a/arch/um/sys-x86/shared/sysdep/faultinfo_32.h +++ b/arch/um/sys-x86/shared/sysdep/faultinfo_32.h | |||
@@ -24,6 +24,12 @@ struct faultinfo { | |||
24 | #define FAULT_WRITE(fi) ((fi).error_code & 2) | 24 | #define FAULT_WRITE(fi) ((fi).error_code & 2) |
25 | #define FAULT_ADDRESS(fi) ((fi).cr2) | 25 | #define FAULT_ADDRESS(fi) ((fi).cr2) |
26 | 26 | ||
27 | /* This is Page Fault */ | ||
28 | #define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14) | ||
29 | |||
30 | /* SKAS3 has no trap_no on i386, but get_skas_faultinfo() sets it to 0. */ | ||
31 | #define SEGV_MAYBE_FIXABLE(fi) ((fi)->trap_no == 0 && ptrace_faultinfo) | ||
32 | |||
27 | #define PTRACE_FULL_FAULTINFO 0 | 33 | #define PTRACE_FULL_FAULTINFO 0 |
28 | 34 | ||
29 | #endif | 35 | #endif |
diff --git a/arch/um/sys-x86/shared/sysdep/faultinfo_64.h b/arch/um/sys-x86/shared/sysdep/faultinfo_64.h index cb917b0d5660..f811cbe15d62 100644 --- a/arch/um/sys-x86/shared/sysdep/faultinfo_64.h +++ b/arch/um/sys-x86/shared/sysdep/faultinfo_64.h | |||
@@ -24,6 +24,12 @@ struct faultinfo { | |||
24 | #define FAULT_WRITE(fi) ((fi).error_code & 2) | 24 | #define FAULT_WRITE(fi) ((fi).error_code & 2) |
25 | #define FAULT_ADDRESS(fi) ((fi).cr2) | 25 | #define FAULT_ADDRESS(fi) ((fi).cr2) |
26 | 26 | ||
27 | /* This is Page Fault */ | ||
28 | #define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14) | ||
29 | |||
30 | /* No broken SKAS API, which doesn't pass trap_no, here. */ | ||
31 | #define SEGV_MAYBE_FIXABLE(fi) 0 | ||
32 | |||
27 | #define PTRACE_FULL_FAULTINFO 1 | 33 | #define PTRACE_FULL_FAULTINFO 1 |
28 | 34 | ||
29 | #endif | 35 | #endif |
diff --git a/arch/um/sys-x86/shared/sysdep/ptrace_32.h b/arch/um/sys-x86/shared/sysdep/ptrace_32.h index 6096c8f89f4f..ce77fa1e2a15 100644 --- a/arch/um/sys-x86/shared/sysdep/ptrace_32.h +++ b/arch/um/sys-x86/shared/sysdep/ptrace_32.h | |||
@@ -43,6 +43,7 @@ extern int sysemu_supported; | |||
43 | 43 | ||
44 | #define REGS_SET_SYSCALL_RETURN(r, res) REGS_EAX(r) = (res) | 44 | #define REGS_SET_SYSCALL_RETURN(r, res) REGS_EAX(r) = (res) |
45 | 45 | ||
46 | #define IP_RESTART_SYSCALL(ip) ((ip) -= 2) | ||
46 | #define REGS_RESTART_SYSCALL(r) IP_RESTART_SYSCALL(REGS_IP(r)) | 47 | #define REGS_RESTART_SYSCALL(r) IP_RESTART_SYSCALL(REGS_IP(r)) |
47 | 48 | ||
48 | #ifndef PTRACE_SYSEMU_SINGLESTEP | 49 | #ifndef PTRACE_SYSEMU_SINGLESTEP |
diff --git a/arch/um/sys-x86/shared/sysdep/ptrace_64.h b/arch/um/sys-x86/shared/sysdep/ptrace_64.h index 9ed4597fa942..866fe7e47369 100644 --- a/arch/um/sys-x86/shared/sysdep/ptrace_64.h +++ b/arch/um/sys-x86/shared/sysdep/ptrace_64.h | |||
@@ -69,10 +69,9 @@ | |||
69 | 69 | ||
70 | #define REGS_SET_SYSCALL_RETURN(r, res) REGS_RAX(r) = (res) | 70 | #define REGS_SET_SYSCALL_RETURN(r, res) REGS_RAX(r) = (res) |
71 | 71 | ||
72 | #define IP_RESTART_SYSCALL(ip) ((ip) -= 2) | ||
72 | #define REGS_RESTART_SYSCALL(r) IP_RESTART_SYSCALL(REGS_IP(r)) | 73 | #define REGS_RESTART_SYSCALL(r) IP_RESTART_SYSCALL(REGS_IP(r)) |
73 | 74 | ||
74 | #define REGS_SEGV_IS_FIXABLE(r) SEGV_IS_FIXABLE((r)->trap_type) | ||
75 | |||
76 | #define REGS_FAULT_ADDR(r) ((r)->fault_addr) | 75 | #define REGS_FAULT_ADDR(r) ((r)->fault_addr) |
77 | 76 | ||
78 | #define REGS_FAULT_WRITE(r) FAULT_WRITE((r)->fault_type) | 77 | #define REGS_FAULT_WRITE(r) FAULT_WRITE((r)->fault_type) |
@@ -152,8 +151,6 @@ struct syscall_args { | |||
152 | 151 | ||
153 | #define UPT_RESTART_SYSCALL(r) REGS_RESTART_SYSCALL((r)->gp) | 152 | #define UPT_RESTART_SYSCALL(r) REGS_RESTART_SYSCALL((r)->gp) |
154 | 153 | ||
155 | #define UPT_SEGV_IS_FIXABLE(r) REGS_SEGV_IS_FIXABLE(&r->skas) | ||
156 | |||
157 | #define UPT_FAULTINFO(r) (&(r)->faultinfo) | 154 | #define UPT_FAULTINFO(r) (&(r)->faultinfo) |
158 | 155 | ||
159 | static inline void arch_init_registers(int pid) | 156 | static inline void arch_init_registers(int pid) |
diff --git a/arch/um/sys-x86/shared/sysdep/sigcontext_32.h b/arch/um/sys-x86/shared/sysdep/sigcontext_32.h index 382786436194..aebc2dd61f0d 100644 --- a/arch/um/sys-x86/shared/sysdep/sigcontext_32.h +++ b/arch/um/sys-x86/shared/sysdep/sigcontext_32.h | |||
@@ -8,8 +8,6 @@ | |||
8 | 8 | ||
9 | #include <generated/user_constants.h> | 9 | #include <generated/user_constants.h> |
10 | 10 | ||
11 | #define IP_RESTART_SYSCALL(ip) ((ip) -= 2) | ||
12 | |||
13 | #define SC_OFFSET(sc, field) \ | 11 | #define SC_OFFSET(sc, field) \ |
14 | *((unsigned long *) &(((char *) (sc))[HOST_##field])) | 12 | *((unsigned long *) &(((char *) (sc))[HOST_##field])) |
15 | 13 | ||
@@ -24,10 +22,4 @@ | |||
24 | (fi).trap_no = SC_TRAPNO(sc); \ | 22 | (fi).trap_no = SC_TRAPNO(sc); \ |
25 | } | 23 | } |
26 | 24 | ||
27 | /* This is Page Fault */ | ||
28 | #define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14) | ||
29 | |||
30 | /* SKAS3 has no trap_no on i386, but get_skas_faultinfo() sets it to 0. */ | ||
31 | #define SEGV_MAYBE_FIXABLE(fi) ((fi)->trap_no == 0 && ptrace_faultinfo) | ||
32 | |||
33 | #endif | 25 | #endif |
diff --git a/arch/um/sys-x86/shared/sysdep/sigcontext_64.h b/arch/um/sys-x86/shared/sysdep/sigcontext_64.h index 9fb527713efb..60d89a2fba06 100644 --- a/arch/um/sys-x86/shared/sysdep/sigcontext_64.h +++ b/arch/um/sys-x86/shared/sysdep/sigcontext_64.h | |||
@@ -15,8 +15,6 @@ | |||
15 | #define SC_ERR(sc) SC_OFFSET(sc, SC_ERR) | 15 | #define SC_ERR(sc) SC_OFFSET(sc, SC_ERR) |
16 | #define SC_TRAPNO(sc) SC_OFFSET(sc, SC_TRAPNO) | 16 | #define SC_TRAPNO(sc) SC_OFFSET(sc, SC_TRAPNO) |
17 | 17 | ||
18 | #define IP_RESTART_SYSCALL(ip) ((ip) -= 2) | ||
19 | |||
20 | #define GET_FAULTINFO_FROM_SC(fi, sc) \ | 18 | #define GET_FAULTINFO_FROM_SC(fi, sc) \ |
21 | { \ | 19 | { \ |
22 | (fi).cr2 = SC_CR2(sc); \ | 20 | (fi).cr2 = SC_CR2(sc); \ |
@@ -24,10 +22,4 @@ | |||
24 | (fi).trap_no = SC_TRAPNO(sc); \ | 22 | (fi).trap_no = SC_TRAPNO(sc); \ |
25 | } | 23 | } |
26 | 24 | ||
27 | /* This is Page Fault */ | ||
28 | #define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14) | ||
29 | |||
30 | /* No broken SKAS API, which doesn't pass trap_no, here. */ | ||
31 | #define SEGV_MAYBE_FIXABLE(fi) 0 | ||
32 | |||
33 | #endif | 25 | #endif |