summaryrefslogtreecommitdiff
path: root/sys/arch/i386/isa
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2018-03-01 13:01:27 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2018-03-01 13:01:27 +0000
commitcf13b54c5c48c6def3be985aa7b656b318261b69 (patch)
treef72ae8c0db357dde52b712a1bb66261f9c7ed3eb /sys/arch/i386/isa
parentf0ee19bfeeceb04f95550ce4b57312e49abd17b8 (diff)
Protect the calls to trapsignal() and psignal() with a kernel lock
when processing an npx interrupt. This fixes a kernel locked assertion in postsig_done() during the libc ieeefp/except regression test. OK visa@
Diffstat (limited to 'sys/arch/i386/isa')
-rw-r--r--sys/arch/i386/isa/npx.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/i386/isa/npx.c b/sys/arch/i386/isa/npx.c
index 3f25bc5a7fe..e5f66b54eb3 100644
--- a/sys/arch/i386/isa/npx.c
+++ b/sys/arch/i386/isa/npx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: npx.c,v 1.63 2017/12/30 20:46:59 guenther Exp $ */
+/* $OpenBSD: npx.c,v 1.64 2018/03/01 13:01:26 bluhm Exp $ */
/* $NetBSD: npx.c,v 1.57 1996/05/12 23:12:24 mycroft Exp $ */
#if 0
@@ -528,7 +528,9 @@ npxintr(void *arg)
else
code = x86fpflags_to_siginfo(addr->sv_87.sv_ex_sw);
sv.sival_int = frame->if_eip;
+ KERNEL_LOCK();
trapsignal(p, SIGFPE, T_ARITHTRAP, code, sv);
+ KERNEL_UNLOCK();
} else {
/*
* Nested interrupt. These losers occur when:
@@ -544,7 +546,9 @@ npxintr(void *arg)
*
* Treat them like a true async interrupt.
*/
+ KERNEL_LOCK();
psignal(p, SIGFPE);
+ KERNEL_UNLOCK();
}
return (1);