aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/x86/syscall_arg_fault.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2019-05-31 18:48:45 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2019-05-31 18:48:45 -0400
commit24e8a2ca1f74574ad2ed1ac7af0260dd90fd911e (patch)
treec863dd43c84579d853f3a2ae0ee6ead46c967703 /tools/testing/selftests/x86/syscall_arg_fault.c
parent66f61c92889ff3ca365161fb29dd36d6354682ba (diff)
parentd724c9e54939a597592de3659541da11fc7aa112 (diff)
Merge tag 'kvm-ppc-fixes-5.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into kvm-master
PPC KVM fixes for 5.2 - Several bug fixes for the new XIVE-native code. - Replace kvm->lock by other mutexes in several places where we hold a vcpu mutex, to avoid lock order inversions. - Fix a lockdep warning on guest entry for radix-mode guests. - Fix a bug causing user-visible corruption of SPRG3 on the host.
Diffstat (limited to 'tools/testing/selftests/x86/syscall_arg_fault.c')
-rw-r--r--tools/testing/selftests/x86/syscall_arg_fault.c10
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
44static volatile sig_atomic_t n_errs; 44static volatile sig_atomic_t n_errs;
45 45
46static void sigsegv(int sig, siginfo_t *info, void *ctx_void) 46static 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 /*