diff options
author | Tong Bo <bo.tong@intel.com> | 2019-06-03 12:29:32 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-06-03 12:29:32 -0700 |
commit | dd5d5c1d63ab8024d94ceb18567287c6c6627922 (patch) | |
tree | 7332c2dc2c1488954834c763ef1ab381d036fc39 | |
parent | 72e5e3c53365d0ca10aaba7801876f6d9cb0678c (diff) | |
parent | 4c8ccc6b06137f9c9da3228a7e37a86544051e67 (diff) | |
download | linux-kselftest-dd5d5c1d63ab8024d94ceb18567287c6c6627922.tar.gz |
selftests/x86: Support Atom for syscall_arg_fault test am: 015e95e9fe am: 84c5a656a9
am: 4c8ccc6b06
Change-Id: Ie8594c0c3008ac3949061e7d4107bfcb9b840111
-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; static volatile sig_atomic_t n_errs; -static void sigsegv(int sig, siginfo_t *info, void *ctx_void) +static void sigsegv_or_sigbus(int sig, siginfo_t *info, void *ctx_void) { ucontext_t *ctx = (ucontext_t*)ctx_void; @@ -73,7 +73,13 @@ int main() if (sigaltstack(&stack, NULL) != 0) err(1, "sigaltstack"); - sethandler(SIGSEGV, sigsegv, SA_ONSTACK); + sethandler(SIGSEGV, sigsegv_or_sigbus, SA_ONSTACK); + /* + * The actual exception can vary. On Atom CPUs, we get #SS + * instead of #PF when the vDSO fails to access the stack when + * ESP is too close to 2^32, and #SS causes SIGBUS. + */ + sethandler(SIGBUS, sigsegv_or_sigbus, SA_ONSTACK); sethandler(SIGILL, sigill, SA_ONSTACK); /* |