Page MenuHomeFreeBSD

bhyve nvme: Fix NVM Format completion status
ClosedPublic

Authored by chuck on Dec 19 2021, 4:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 8, 7:53 PM
Unknown Object (File)
Mon, Apr 8, 7:40 PM
Unknown Object (File)
Mon, Apr 8, 7:21 PM
Unknown Object (File)
Mon, Apr 8, 7:20 PM
Unknown Object (File)
Mon, Apr 8, 11:09 AM
Unknown Object (File)
Feb 19 2024, 2:42 AM
Unknown Object (File)
Feb 17 2024, 10:13 AM
Unknown Object (File)
Dec 20 2023, 9:54 PM

Details

Summary

The NVM Format command is unique among the Admin commands in that it
needs to finish asynchronously. For this reason, the emulation code
invented a synthetic completion status (NVME_NO_STATUS) to indicate that
the command was still in progress and the command processing loop should
not generate a completion message. The implementation used the value
0xffff for the synthetic value as this set both the Status Code and
Status Code Type fields to reserved values.

Format initialized the completion status to this value and expected
error cases to override it with a status code/type appropriate to the
situation. The macros used to set the NVMe status are careful not to
modify bit 0 (i.e. the phase bit), which with the synthetic completion
status, causes the phase bit to get out of sync. When running tests in a
guest with illegal NVM Format commands, Admin commands would eventually
hang because it appeared there were no completions due to the incorrect
phase bit value.

Fix is to only set NVME_NO_STATUS if the blockif delete command
succeeds. While in the neighborhood, add a missing break statement when
NVM Format is not supported.

Tested by:
MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable