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)
Sep 29 2024, 10:09 AM
Unknown Object (File)
Sep 28 2024, 7:32 AM
Unknown Object (File)
Sep 27 2024, 6:20 AM
Unknown Object (File)
Sep 23 2024, 1:27 AM
Unknown Object (File)
Sep 22 2024, 6:11 AM
Unknown Object (File)
Sep 21 2024, 1:58 AM
Unknown Object (File)
Sep 19 2024, 9:12 AM
Unknown Object (File)
Sep 18 2024, 9:36 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