summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2018-05-11 15:27:43 +0000
committerbluhm <bluhm@openbsd.org>2018-05-11 15:27:43 +0000
commit2d12045b7a88a5f21aa86994ae11301db64c781d (patch)
treed73ff5970e6a9dc46ba58f82c0d59cb8f9fd10ef /sys
parentMention netinet/tcp.h, like many others already do. (diff)
downloadwireguard-openbsd-2d12045b7a88a5f21aa86994ae11301db64c781d.tar.xz
wireguard-openbsd-2d12045b7a88a5f21aa86994ae11301db64c781d.zip
Fix fallout from i386 Meltdown preparation which is using interrupt
gates now. Interrupts for dna, fpu, and f00f_redirect were not properly enabled. Thus npxintr() tried to get the kernel lock with interrupts disabled causing a deadlock in pmap_tlb_shootwait(). Enable interrupts for dna, fpu, and f00f_redirect. dna and fpu leave the kernel directly, thus they have to disable interrupts again; f00f_redirect goes through calltrap which will enable interrupts. from hshoexer@; OK mlarkin@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/i386/locore.s7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s
index c01bd6253f2..8a8b22f7a38 100644
--- a/sys/arch/i386/i386/locore.s
+++ b/sys/arch/i386/i386/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.185 2018/04/11 15:44:08 bluhm Exp $ */
+/* $OpenBSD: locore.s,v 1.186 2018/05/11 15:27:43 bluhm Exp $ */
/* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */
/*-
@@ -988,6 +988,7 @@ IDTVEC(dna)
pushl $0 # dummy error code
pushl $T_DNA
INTRENTRY(dna)
+ sti
pushl CPUVAR(SELF)
call *_C_LABEL(npxdna_func)
addl $4,%esp
@@ -996,6 +997,7 @@ IDTVEC(dna)
#ifdef DIAGNOSTIC
movl $0xfd,%esi
#endif
+ cli
INTRFASTEXIT
#else
ZTRAP(T_DNA)
@@ -1015,6 +1017,7 @@ IDTVEC(prot)
IDTVEC(f00f_redirect)
pushl $T_PAGEFLT
INTRENTRY(f00f_redirect)
+ sti
testb $PGEX_U,TF_ERR(%esp)
jnz calltrap
movl %cr2,%eax
@@ -1050,6 +1053,7 @@ IDTVEC(fpu)
*/
subl $8,%esp /* space for tf_{err,trapno} */
INTRENTRY(fpu)
+ sti
pushl CPL # if_ppl in intrframe
pushl %esp # push address of intrframe
incl _C_LABEL(uvmexp)+V_TRAP
@@ -1058,6 +1062,7 @@ IDTVEC(fpu)
#ifdef DIAGNOSTIC
movl $0xfc,%esi
#endif
+ cli
INTRFASTEXIT
#else
ZTRAP(T_ARITHTRAP)