-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PCI passthrough not working for HVM domains #1659
Comments
@rootkovska @mfc I've assigned priority "major" but maybe it deserve some higher? |
... or lower, rather? (as we currently we don't support HVM-based net/usb VMs, so this affects very few users) |
I would say the affected users fall into two main categories: (1) users trying to get GPU passthrough working for their Windows HVMs, to be able to do real 3D graphics applications, etc., and (2) users wanting to pass through a USB controller, so they can use a webcam or other devices with Windows. I would like to be able to do things like pass through a storage adapter and network adapter directly to a FreeBSD HVM, but that is admittedly an even more specialized use case affecting almost no one else. I think it would be good to clearly document that passthrough is not available for HVM domains and perhaps also remove the capability from Qubes Manager for HVM domains until this issue is resolved. |
Another use case: wanting to be able to have sound output in Windows (currently unavailable by any means): https://groups.google.com/forum/#!topic/qubes-users/BBWF9wguP-0 |
Would be great to have PCI passthrough on a dual-GPU laptop, for gaming purposes in Windows without sacrificing the isolation that Qubes provides. (audio via device passthrough is nice but really a working Qubes Windows Tools audio driver for better interaction with the rest of the system and not specialized applications, would be great). |
There is actually a 3rd category: disk controllers. It isn't possible to rip disks without the raw device being available to the VM. |
Some tests reveals that the problem is in stubdomain - the very same config ( |
Using libxl (xen packages 4.6.1) from Fedora 24 it does work, even with stubdomain... |
Though fedora 24 wasn't due until april? |
Yes, I've used packages from rawhide - to have the same version (F23 has Xen 4.5).
I've just tried one sample device and it is properly discovered in the VM. With our libxl/stubdom packages it doesn't show at all. |
SystemTestsMixin.prepare_hvm_system_linux creates minimal Linux installation necessary to launch simple shell script. It installs: - grub2 - kernel from dom0 (the same as the running one) - dracut based initramfs, with provided script set as pre-pivot hook Done in preparation for QubesOS/qubes-issues#1659 test
A simple test which checks if the device is visible there at all. Device set with QUBES_TEST_PCIDEV env variable is used - it should be some unimportant device which can be freely detached from dom0. QubesOS/qubes-issues#1659
Made automated test for this issue (annotated with "expected failure" for now). Should ease debugging (for example bisection). |
The race condition idea seems unlikely, since the problem we are chasing is seen across all systems on Qubes. There is a surprising number of patches in Fedora for Xen. However, at a glance, the only patches that seem to touch on code that would relate to this kind of problem are the patches for XSAs 154, 164, and 170 - assuming one of these patches is responsible. |
@marmarek, is this an accurate summary of your testing?
Also, how did you create the xl config file for testing? I tried doing
|
I would rather say "Fedora 24" instead of "Xen 4.6.1 with Fedora patches" - this may be broken by some other package than Xen (some library used or so). Additionally, I wasn't able to reproduce the success when running Qubes but launching domain using Fedora 24 binaries (from chroot). Which is another hint it isn't about just toolstack/qemu. As for config file - something like this. And indeed it seems to be crashing libvirtd... It looks like the bug is triggered by lack of I guess the whole problem may have something to do with disabled qemu in dom0 (in addition to stubdomain). This isn't fully consistent with test results, but there may be some other factors. |
Found configs from those tests: https://gist.github.com/marmarek/794305496557cc679fced21e252e05b4 |
Thanks, that did the trick.
Could the xen-pciback kernel module be to blame? Does Qubes make any modifications to it? |
No, we don't have any modifications there. It was working in Qubes R2, but there are a lot of differences:
Next thing I'd check is qemu in stubdomain - simply get stubdomain binary from R2 and try it on R3.x. It is in |
Ok, I replaced /usr/lib/xen/boot/ioemu-stubdom.gz with the ioemu-stubdom.gz from Qubes-R2-x86_64-DVD.iso. Unfortunately it doesn't want to start:
Here's some of the output from /var/log/xen/qemu-dm-pcihvm.log:
Any ideas? |
vchan library is different in R2 than in R3.x... You can try to fake the old one, execute:
But you need to be very fast with this, as you need to make it before stubdom reach this GUI initialization. Maybe |
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
Or update dom0 via Qubes Manager. |
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
There have been multiple reports that PCI passthrough does not work for HVM domains using the qubes software:
https://groups.google.com/d/msg/qubes-users/cmPRMOkxkdA/gIV68O0-CQAJ (reporting passthrough not working via libvirt, but that passthrough still could be done using Xen xl)
https://groups.google.com/d/msg/qubes-users/ExMvykCyYiY/M3nHxweRFAAJ (confirmation by Marek that passthrough was not working on R3)
https://groups.google.com/d/msg/qubes-users/ppKj_YWqr94/l2gHv6uJAgAJ
This issue appears to have started with use of the HAL in Qubes R3. PCI passthrough continues to work fine for PV-based Qubes VMs, such as sys-net.
Marek guessed that it could be a qemu issue (see second linked post). However, in the first linked post, PCI passthrough was done to an HVM domain via 'xl' using "device_model_version = 'qemu-xen-traditional'", so this may rule out qemu as the culprit.
The text was updated successfully, but these errors were encountered: