HomeFreeBSD

bhyve: add locks around NVMe queue accesses

Description

bhyve: add locks around NVMe queue accesses

The NVMe code attempted to ensure thread safety through a combination of
using atomics and a "busy" flag. But this approach leads to unavoidable
race conditions.

Fix is to use per-queue mutex locks to ensure thread safety within the
queue processing code. While in the neighborhood, move all the queue
initialization code to a common function.

Tested by: Jason Tubnor
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19841

Details

Provenance
chuckAuthored on
Differential Revision
D19841: bhyve: add locks around NVMe queue accesses
Parents
rS362747: bhyve: add a comment explaining NVME dsm option
Branches
Unknown
Tags
Unknown