FreeBSD-EN-21:25.bhyve : Fix NVMe iovec construction for large IOs
Versions Affected : All versions prior to TrueNAS 12.0-U6
When a RHEL 8.4 and later (or variants) are installed as guests within bhyve(8) on emulated NVMe storage, the system will not boot due to a newer UEFI driver that is included with these distributions.
By default, NVMe data transfer operations use a scatter-gather list in which all entries point to a fixed-size memory region. For example, if the memory page size is 4KB, a 2MB IO requires 512 entries. Lists themselves are also fixed in size (default is 512 entries). Because the list size is fixed, the last entry is special. If the IO requires more than 512 entries, the last entry in the list contains the address of the next list of entries. But if the IO requires exactly 512 entries, the last entry points to data. The NVMe emulation missed this logic and unconditionally treated the last entry as a pointer to the next list.
Installation of a RHEL 8.3 guest and performing an in-place upgrade.
- Upgrade to TrueNAS 12.0-U6 or later.