[vfio-users] What makes or breaks proper unbinding of vfio-pci?

Mario Goebbels me at tomservo.cc
Tue Jan 26 00:29:48 UTC 2016


Small update. I managed to figure out an alternative way to unbind the
graphics device properly and reuse it back on the host. Instead of directly
unbinding it, I just remove the device(s) and then rescan the PCI bus. Like
this:

echo > /sys/bus/pci/devices/${DEV}/driver_override
echo 1 > /sys/bus/pci/devices/${DEV}/remove
echo 1 > /sys/bus/pci/rescan

Seems to work reliably (for now, knocking on wood).

Regards,
-mg

On Mon, Jan 25, 2016 at 2:56 AM, Mario Goebbels <me at tomservo.cc> wrote:

> Hi,
>
> 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.
>
> Whenever I run a game inside the VM, after shutting it down, unbinding
> vfio-pci usually ends up in a kernel panic, either saying...
>
> [  311.157926] BUG: unable to handle kernel paging request at
> 00007f23c8b47000
>
> -or-
>
> [ 2782.316934] kernel tried to execute NX-protected page - exploit
> attempt? (uid: 0)
>
> 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.
>
> Any idea what's going on and how I can fix this?
>
> 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.
>
> My current version of the helper script for reference:
> http://pastebin.com/kz79Cppv
>
> Thanks for any help and ideas,
> -mg
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20160126/1d893754/attachment.htm>


More information about the vfio-users mailing list