Moved from ESXi 6.5 to KVM (Debian Stretch, 4.9.0) for my VM host on a HP Z230 workstation after ESXi was giving me trouble with GPU passthough. GPU passthrough now works well with KVM (though sometimes the host freezes after guest shutdown) and NIC passthrough worked well on both ESXi and KVM. However, I am getting a “DMA mapping failed” error when attempting to passthrough a HBA (LSI 9212-4i [SAS2008]). This appears to be a common problem on Debian with the SAS2008 cards with a Haswell CPU. Passthrough of the same card worked without issue on ESXi. I am now just passing the disks on the HBA directly through to the guest now, but this is not exactly ideal.
I know you guys have a lot of experience with PCIe passthrough in KVM, so I figured I would try to revive the issue here. Any thoughts? Thanks!
I would bet you would have better luck with a newer kernel and using i440FX instead of Seabios if that is what you are using.
You need to also make sure that card is in it’s own IOMMU group just like your GPU.
Thanks for the reply. I can confirm that the issue occurs while using either the i440FX or Q35 chipset. I can also confirm that the issue occurs while specifying either the BIOS or UEFI firmware for the VM. To be clear, all choices of chipset and firmware appear to present with the same issue.
I can confirm that the card is in it’s own IOMMU group. I can also confirm that the 4.9+80+deb9u6 is the latest kernel in the latest branch of Debian stable (Stretch). As the issue seems to occur in Debian, Ubuntu, and Proxmox (and not Fedora), it appears to be a Debian implementation issue, as opposed to a kernel specific issue.
Any other potential thoughts? Thanks,
Coincidentally I ran into this problem last week and have yet to find a solution.
I can pass everything I’ve thrown at this system except the LSI HBA which throws: “qemu-system-x86_64: vfio_dma_map(0x7fbe6a8ebe00, 0xfebd0000, 0x2000, 0x7fbe8efdf000)= -14 (Bad address)
qemu: hardware error: vfio: DMA mapping failed, unable to continue”
Debian Based 4.15.18-4
Before switching to KVM/QEMU I was using XEN, which worked great with this card.
Sounds like we have the same issue, along with the other people who posted on the other forums. Interesting that the bug is still present on newer kernels. Though I haven’t tried it myself, it looks like VFIO is working with the SAS2008 cards in Fedora.