opnsense-src/sys
Warner Losh ffb294bd31 nvme: coherently read status of completion records
Coherently read the phase bit of the status completion record. We loop
over the completion record array, looking for all the transactions in
the same phase that have been completed. In doing that, we have to be
careful to read the status field first, and if it indicates a complete
record, we need to read and process that record. Otherwise, the host
might be overtaken by device when reading this completion record,
leading to a mistaken belief that the record is in phase. This leads to
the code using old values and looking at an already completed entry, which
has no current tracker.

To work around this problem, we read the status and make sure it is in
phase, we then re-read the entire completion record guaranteeing it's
complete, valid, and consistent . In addition we resync the dmatag to
reflect changes since the prior loop for the bouncing dma case.

Reviewed by:		jrtc27@, chuck@
Found by:		jrtc27 (this fix is based in part on her D30995 fix)
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31002

(cherry picked from commit aa0ab681ae)
2021-07-12 13:39:58 -06:00
..
amd64 amd64: do not touch BIOS reset flag halfword, unless we boot through BIOS 2021-06-30 07:42:13 +03:00
arm arm: Make sure we can handle a thumb entry point. 2021-07-07 22:22:41 +02:00
arm64 arm64: Make sure COMPAT_FREEBSD32 handles thumb entry point. 2021-07-07 22:22:18 +02:00
bsm
cam
cddl
compat linux(4): Prevent integer overflow in futex_requeue. 2021-06-29 15:58:32 -04:00
conf kern.mk: fix -Wno-error style to fix build with Clang 12 2021-06-22 21:20:39 +02:00
contrib zfs: merge openzfs/zfs@4f92fe0f5 (zfs-2.1-release) into stable/13 2021-07-10 17:59:52 +02:00
crypto
ddb ddb: reliably fail with ambiguous commands 2021-07-02 14:13:24 -07:00
dev nvme: coherently read status of completion records 2021-07-12 13:39:58 -06:00
dts
fs nfscl: Change the default minor version for NFSv4 mounts 2021-07-11 15:26:55 -07:00
gdb
geom gmultipath: make physpath distinct from the underlying providers' 2021-06-17 12:39:14 -06:00
gnu
i386 Add quirks for Linux ABI signals handling 2021-06-22 04:45:32 +03:00
isa
kern config_intrhook: provide config_intrhook_drain 2021-07-12 13:30:55 -06:00
kgssapi
libkern Use '.arch_extension crc' in the arm64 crc32 code 2021-06-12 02:21:54 +01:00
mips Consolidate machine/endian.h definitions 2021-06-24 20:42:56 -03:00
modules zfs: merge openzfs/zfs@4f92fe0f5 (zfs-2.1-release) into stable/13 2021-07-10 17:59:52 +02:00
net iflib: switch bare zone_mbuf use to m_free_raw 2021-07-05 12:05:00 +00:00
net80211
netgraph Consistently use the SOLISTENING() macro 2021-06-21 09:14:40 -04:00
netinet libalias: Switch to SPLAY trees 2021-07-06 08:55:53 +02:00
netinet6
netipsec
netpfil pf: getstates: avoid taking the hashrow lock if the row is empty 2021-07-09 10:08:32 +02:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed ofed: quiet gcc -Wint-in-bool-context 2021-07-02 14:12:18 -07:00
opencrypto
powerpc Consolidate machine/endian.h definitions 2021-06-24 20:42:56 -03:00
riscv Consolidate machine/endian.h definitions 2021-06-24 20:42:56 -03:00
rpc krpc: Acquire ref count of CLIENT for backchannel use 2021-06-26 16:03:41 -07:00
security mac: cheaper check for ifnet_create_mbuf and ifnet_check_transmit 2021-07-05 11:32:14 +00:00
sys config_intrhook: provide config_intrhook_drain 2021-07-12 13:30:55 -06:00
teken
tests tests: Revise FIB lookups per second benchmarking routines 2021-06-20 13:27:17 +02:00
tools
ufs ffs_softdep: force sync if journal is low in journal_check_space 2021-07-07 13:50:44 +03:00
vm Un-staticise vm_page_init_page() 2021-06-24 05:20:33 +03:00
x86 Consolidate machine/endian.h definitions 2021-06-24 20:42:56 -03:00
xdr
xen
Makefile