xhci and nvme can't bind DMA memory with IOMMU enabled
Both xhci and nvme have problems when allocating DMA memory with IOMMU enabled.
This happens when the size of the DMA buffer is the same as the specified maximum DMA transfer size in the DMA attributes (dma_attr_maxxfer). After most of the work for DMA binding is done, roonex_coredma_bindhdl() will check whether the DMA size is less than the maximum size. If it isn't, it will either go through a "slow path" when IOMMU is disabled, or fail the request if IOMMU is enabled.
This seems to be wrong, the code should check for the DMA size to be less or equal than the maximum size. Other places in rootnex always check for the DMA size to not be larger than the maximum size, which also makes much more sense.
Updated by Hans Rosenfeld about 5 years ago
This was tested by running it on a single machine with IOMMU enabled. The previously failing nvme driver would suddenly work with this fix. Other drivers used on this machine (mpt_sas, e1000g, ahci) didn't suffer from any regressions.
This change has been in illumos-joyent since around June.
Updated by Electric Monk about 5 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 6667d029bb28f9a4d1cb7f3366aad23b59e7dca4 Author: Hans Rosenfeld <firstname.lastname@example.org> Date: 2017-09-20T18:35:31.000Z 8624 xhci and nvme can't bind DMA memory with IOMMU enabled Reviewed by: Robert Mustacchi <email@example.com> Reviewed by: Jerry Jelinek <firstname.lastname@example.org> Reviewed by: Garrett D'Amore <email@example.com> Approved by: Richard Lowe <firstname.lastname@example.org>