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 Add aio_writev and aio_readv 2021-01-02 19:57:58 -07:00
cam Introduce "soft" serseq variant. 2021-05-05 23:18:38 -04:00
cddl fbt: Remove some handling for multiple CTF containers 2021-04-15 21:27:24 -04:00
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 armv8crypto: note derivation in armv8_crypto_wrap.c 2021-03-22 13:14:51 -03:00
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 Switch to the new device-tree vendor tree 2021-01-15 20:08:39 +01:00
fs nfscl: Change the default minor version for NFSv4 mounts 2021-07-11 15:26:55 -07:00
gdb gdb: report specific stop reason for watchpoints 2021-04-21 10:20:33 -03:00
geom gmultipath: make physpath distinct from the underlying providers' 2021-06-17 12:39:14 -06:00
gnu Remove the old dts imported tree. 2021-01-15 20:09:55 +01:00
i386 Add quirks for Linux ABI signals handling 2021-06-22 04:45:32 +03:00
isa Remove more remnants of sio(4) 2021-04-14 09:19:49 -04:00
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 net80211: Fix a typo in a comment 2021-03-20 11:13:31 +01:00
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 mend 2021-06-07 11:01:28 +02:00
netipsec Add missing sockaddr length and family validation to various protocols 2021-05-17 13:43:07 -04:00
netpfil pf: getstates: avoid taking the hashrow lock if the row is empty 2021-07-09 10:08:32 +02:00
netsmb netsmb: Avoid a read-after-free in smb_t2_request_int() 2021-06-02 09:34:47 -04:00
nfs
nfsclient
nfsserver nfs: Mark unused statistics variable as reserved 2020-11-18 04:35:49 +00:00
nlm
ofed ofed: quiet gcc -Wint-in-bool-context 2021-07-02 14:12:18 -07:00
opencrypto cryptodev: Fix some input validation bugs 2021-05-14 09:58:54 -04:00
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 loader: implement framebuffer console 2021-01-02 21:41:36 +02:00
tests tests: Revise FIB lookups per second benchmarking routines 2021-06-20 13:27:17 +02:00
tools makesyscalls.lua: improve generated file style(9) compliance 2021-05-19 20:31:54 -04:00
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 xen: remove .swp file from public headers 2021-01-11 18:14:11 +01:00
Makefile