freebsd-nq/sys
Mitchell Horne 958a094323 Enable interrupts while handling traps
I observed hangs post-r362977 in QEMU with -smp 2, in which one thread
would acquire write access to an rm_lock (sysctllock) and get stuck
waiting in smp_rendezvous_cpus while the other CPU was servicing a trap.
The other thread was waiting for read access to the same lock, thus
causing deadlock.

It's clear that this is just one symptom of a larger problem. The
general expectation of MI kernel code is that interrupts are enabled.
Violating this assumption will at best create some additional latency,
but otherwise might cause locking or other unforeseen issues. All other
architectures do so for some subset of trap values, but this somehow got
missed in the RISC-V port. Enable interrupts now during kernel page
faults and for all user trap types.

The code in exception.S already knows to disable interrupts while
handling the return from exception, so there are no changes required
there.

Reviewed by:	jhb, markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26017
2020-08-13 14:21:05 +00:00
..
amd64 o Add machine/iommu.h and include MD iommu headers from it, 2020-08-05 19:11:31 +00:00
arm aw_cir: in the pulse encoding the actual length is one greater than value 2020-08-12 09:57:28 +00:00
arm64 Add support for Cortex-A76/Neoverse-N1 to hwpmc 2020-08-12 10:17:17 +00:00
bsm bsm: add AUE_CLOSERANGE 2020-04-24 01:27:25 +00:00
cam Fill device serial_num and device_id in NVMe XPT. 2020-08-13 02:32:46 +00:00
cddl Fix linker error in libuutil with recent LLVM 2020-08-07 16:04:21 +00:00
compat linprocfs: Fix some inaccuracies in meminfo. 2020-08-12 16:08:44 +00:00
conf Allow linking the kernel with a linker that doesn't support -z ifunc-noplt 2020-08-11 16:47:00 +00:00
contrib Import PCG-C into sys/contrib 2020-07-30 23:54:25 +00:00
crypto padlock: fix Via Padlock with 192-bit keys 2020-07-20 16:12:14 +00:00
ddb [PowerPC] More relocation fixes 2020-06-21 03:39:26 +00:00
dev Report cpi->hba_* for nda(4) because why not. 2020-08-12 20:05:43 +00:00
dts Remove licenses 2020-06-04 17:20:58 +00:00
fs Fix a bug introduced by r363001 for the ext_pgs case. 2020-08-12 04:35:49 +00:00
gdb
geom Fix indentation. 2020-07-27 16:31:21 +00:00
gnu Import DTS files for arm, arm64, riscv from Linux 5.8 2020-08-04 19:44:43 +00:00
i386 o Add machine/iommu.h and include MD iommu headers from it, 2020-08-05 19:11:31 +00:00
isa
kern vfs: add missing pwd_drop on error in namei_setup 2020-08-13 10:24:45 +00:00
kgssapi Add support for optional separate output buffers to in-kernel crypto. 2020-05-25 22:12:04 +00:00
libkern libkern: Add arc4random_uniform 2020-05-23 17:51:06 +00:00
mips Include virtio support in std.MALTA 2020-07-31 11:28:09 +00:00
modules Allow overriding the tool used for stripping binaries 2020-08-11 16:46:27 +00:00
net Correctly set error in rt_mpath_unlink 2020-08-12 16:43:20 +00:00
net80211 net80211/ifconfig: print hardware device name for wlan interfaces 2020-08-07 12:24:23 +00:00
netgraph ng_iface(4): Remove unsupported protocols. 2020-07-31 14:08:54 +00:00
netinet Use a static initializer for the multicast free tasks. 2020-08-11 08:31:40 +00:00
netinet6 Use a static initializer for the multicast free tasks. 2020-08-11 08:31:40 +00:00
netipsec Simplify IPsec transform-specific teardown. 2020-06-25 23:59:16 +00:00
netpfil ipfw: make the "frag" keyword accept additional options "mf", 2020-08-11 15:46:22 +00:00
netsmb
nfs Transition from rtrequest1_fib() to rib_action(). 2020-07-21 19:56:13 +00:00
nfsclient
nfsserver
nlm Fix export_args ex_flags field so that is 64bits, the same as mnt_flags. 2020-06-14 00:10:18 +00:00
ofed Infiniband clients must be attached and detached in a specific order in ibcore. 2020-07-06 08:50:11 +00:00
opencrypto Add support for KTLS RX via software decryption. 2020-07-23 23:48:18 +00:00
powerpc Fix clang 11 inline asm constraint error when building powerpc GENERIC64 2020-08-07 19:32:54 +00:00
riscv Enable interrupts while handling traps 2020-08-13 14:21:05 +00:00
rpc Add an argument to newnfs_connect() that indicates use TLS for the connection. 2020-08-11 00:26:45 +00:00
security vfs: add VOP_STAT 2020-08-07 23:06:40 +00:00
sys Add support for Cortex-A76/Neoverse-N1 to hwpmc 2020-08-12 10:17:17 +00:00
teken
tests
tools makesyscalls.lua: improve syscall ordering validation 2020-08-04 21:49:13 +00:00
ufs vfs: clean MNTK_FPLOOKUP if MNT_UNION is set 2020-08-10 11:51:21 +00:00
vm Back out unrelated change 2020-08-12 00:21:30 +00:00
x86 Move dmar_domain_unload_task to busdma_iommu.c. 2020-08-06 12:49:25 +00:00
xdr Split XDR into separate kernel module. Make krpc depend on xdr. 2020-04-17 06:04:20 +00:00
xen
Makefile