<div dir="ltr">Hi,<div><br></div><div>I'm currently trying to figure weird behaviour with vfio-pci. When I fire up my Windows VM with VGA passthrough, I seem to be able to boot and shut it down just fine, binding and unbinding vfio-pci without issues, so long I just do simple things with the GPU inside the VM.</div><div><br></div><div>Whenever I run a game inside the VM, after shutting it down, unbinding vfio-pci usually ends up in a kernel panic, either saying...</div><div><div><br></div><div>[  311.157926] BUG: unable to handle kernel paging request at 00007f23c8b47000</div></div><div><br></div><div>-or-</div><div><br></div><div><div>[ 2782.316934] kernel tried to execute NX-protected page - exploit attempt? (uid: 0)</div></div><div><br></div><div>It's pretty easy to reproduce, pretty much as described above. I start my VM with Windows 10, run say GTA V for just a minute, shut it down immediately, and when the helper script unbinds vfio-pci, it panics. However, if I start the VM, do some simpler things, like browsing the web, watching some video with hardware accelerated decoding, and even run some WebGL demos (that appear hardware accelerated, I suppose similar to a game), and shut it down again, everything unbinds cleanly. And I can repeatedly start the VM without needing to reboot in-between or other tricks, as long I don't run a fullblown game.</div><div><br></div><div>Any idea what's going on and how I can fix this?</div><div><br></div><div>The system is an Intel Core i7-5820K, an Asrock X99 Extreme4 mainboard and the card being passed through is an NVidia GTX780 from EVGA. This happens on both Linux 4.4 and 4.5-rc1.<br></div><div><br></div><div><div>My current version of the helper script for reference: <a href="http://pastebin.com/kz79Cppv">http://pastebin.com/kz79Cppv</a></div></div><div><br></div><div>Thanks for any help and ideas,<br></div><div>-mg</div></div>