"DMA mapping failed" when trying passthrough with looking-glass #4662
-
Hey everyone, I'm not sure if this is even related to edk2/OVMF at all, but hopefully I might at least get some pointers here how/where to debug further. I'm on an Alderlake platform, trying to pass through an nvidia T400 to a qemu VM. However, this is the output I get:
After googling around and ruling out issues other people had, mostly the memlock limit, I finally figured out the VM starts up successfully if I don't try to pass the shared memory block to the VM that is needed for getting the frame buffer out of the VM via looking glass. If I remove the shared memory, the VM boots, the GPU is available to the guest and can run 3D applications and CUDA, as can be verified by connecting a screen to the GPU directly.
Yet the VM and GPU appear to work flawlessly. Another way to "fix" this, without removing the looking-glass shm, is to set the CPU to some specific (older) one, for example here Skylake. This is my qemu command line, minus the HDD image:
I tried to debug this using qemu's gdb stub, and I can see that it seems to be executing at least some code from edk2/ovmf before the crash happens. Unfortunately, that doesn't drop me into gdb, qemu still crashes hard, I assume since gdb would only trap on errors in the guest, not if DMA mapping fails. Also, removing edk2 from the qemu command line doesn't crash qemu, but instead it will just sit at the "no boot medium found" screen. So I assume it has something to do with what edk2 does if the shm block is present, but also somehow with CPU feature flags!? I'm completely at a loss here, so I'm hoping someone familiar with the code base can at least point me in the right direction at where to look or what even to debug. Could this be something in edk2, or is it more likely a bug in qemu that edk2 just happens to trigger? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
I ran into the same issue a few weeks ago, when I tried to set up a KVM with LookingGlass on Raptor Lake (13900K) for a good friend of mine and I couldn't fix it. The problem only seems to occur with newer CPUs that use efficiency and power cores because it works on Comet Lake (*), which was the last generation with only real (power) cores. According to this communication via mail, someone is already working on a patch. Oh, I just found another very interesting mail from Eric Auger. However, I'm not 100% sure if one or both patches will also solve the problem here. (*) I can also verify that it works on Coffee Lake (Refresh). Also worth mentioning: I also compiled and tried several stable releases by hand, because I read in some r/vfio thread that it should work with an older version of ovmf-edk2. Unfortunately, I couldn't confirm this. |
Beta Was this translation helpful? Give feedback.
It also works with simply
-cpu host,host-phys-bits-limit=0x28
, which in libvirt >= 9.3.0 can be set using: