diff options
Diffstat (limited to 'tools/testing/selftests/x86/syscall_arg_fault.c')
| -rw-r--r-- | tools/testing/selftests/x86/syscall_arg_fault.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/testing/selftests/x86/syscall_arg_fault.c b/tools/testing/selftests/x86/syscall_arg_fault.c index 7db4fc9fa09f..d2548401921f 100644 --- a/tools/testing/selftests/x86/syscall_arg_fault.c +++ b/tools/testing/selftests/x86/syscall_arg_fault.c | |||
| @@ -43,7 +43,7 @@ static sigjmp_buf jmpbuf; | |||
| 43 | 43 | ||
| 44 | static volatile sig_atomic_t n_errs; | 44 | static volatile sig_atomic_t n_errs; |
| 45 | 45 | ||
| 46 | static void sigsegv(int sig, siginfo_t *info, void *ctx_void) | 46 | static void sigsegv_or_sigbus(int sig, siginfo_t *info, void *ctx_void) |
| 47 | { | 47 | { |
| 48 | ucontext_t *ctx = (ucontext_t*)ctx_void; | 48 | ucontext_t *ctx = (ucontext_t*)ctx_void; |
| 49 | 49 | ||
| @@ -73,7 +73,13 @@ int main() | |||
| 73 | if (sigaltstack(&stack, NULL) != 0) | 73 | if (sigaltstack(&stack, NULL) != 0) |
| 74 | err(1, "sigaltstack"); | 74 | err(1, "sigaltstack"); |
| 75 | 75 | ||
| 76 | sethandler(SIGSEGV, sigsegv, SA_ONSTACK); | 76 | sethandler(SIGSEGV, sigsegv_or_sigbus, SA_ONSTACK); |
| 77 | /* | ||
| 78 | * The actual exception can vary. On Atom CPUs, we get #SS | ||
| 79 | * instead of #PF when the vDSO fails to access the stack when | ||
| 80 | * ESP is too close to 2^32, and #SS causes SIGBUS. | ||
| 81 | */ | ||
| 82 | sethandler(SIGBUS, sigsegv_or_sigbus, SA_ONSTACK); | ||
| 77 | sethandler(SIGILL, sigill, SA_ONSTACK); | 83 | sethandler(SIGILL, sigill, SA_ONSTACK); |
| 78 | 84 | ||
| 79 | /* | 85 | /* |
