Skip to content
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 fails critically #7717

Open
ZYousef opened this issue Aug 28, 2022 · 4 comments
Open

PCI Passthrough fails critically #7717

ZYousef opened this issue Aug 28, 2022 · 4 comments
Labels
affects-4.1 This issue affects Qubes OS 4.1. C: Xen hardware support needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.

Comments

@ZYousef
Copy link

ZYousef commented Aug 28, 2022

How to file a helpful issue

Qubes OS release

R4.1

Brief summary

Passing two PCIs to a single qubes makes it unstable.
The qubes fails to start occasionally due libxenlight being unable to reset PCI "even though PCI is set to no-strict-reset"

Steps to reproduce

Attach VGA and Audio PCI to a qube.
Set both PCI to no strict reset.

AppVM qubesd log:
Start failed: internal error: Unable to to reset PCI device X:::::: Internal error: libxenlight failed to create new domain "AppVM"

AppVM libxl-driver.log:
stubddom_xswait_cb: Domain X: Stubddom 5 for 4 startup: startup timed out.
domcreate_devmodel_started: Domain X: device model did not start -9

Expected behavior

qube boots up every time correctly.

Actual behavior

The qube fails sometimes with: Libxenlight failed to create new domain qube

@ZYousef ZYousef added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. labels Aug 28, 2022
@andrewdavidwong andrewdavidwong added hardware support C: Xen needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. labels Aug 29, 2022
@andrewdavidwong andrewdavidwong added this to the Release 4.1 updates milestone Aug 29, 2022
@jandryuk
Copy link

With Xen 4.16 (OpenXT), I sometimes see the multiple passthrough failure like:

libxl_pci.c:1824:device_pci_add_done:Domain 24:libxl__device_pci_add failed for PCI device 0:0:1f.6 (rc -9)
libxl_pci.c:1824:device_pci_add_done:Domain 24:libxl__device_pci_add failed for PCI device 0:1:0.0 (rc -9)
libxl_create.c:1945:domcreate_attach_devices:Domain 24:unable to add pci devices

I just posted this patch to handle it:
https://lore.kernel.org/lkml/20220829151536.8578-1-jandryuk@gmail.com/T/#u

@marmarek
Copy link
Member

I do see this issue from time to time too, even though qubes has this patch: https://github.com/QubesOS/qubes-vmm-xen/blob/xen-4.14/patch-libxl-add-pcidevs-to-stubdomain-earlier.patch. When it happens, it usually fails on the second device assigned to the VM, the first one is assigned successfully. I'm trying to collect more logging from QMP communication.

@jandryuk
Copy link

I had forgotten about https://github.com/QubesOS/qubes-vmm-xen/blob/xen-4.14/patch-libxl-add-pcidevs-to-stubdomain-earlier.patch. Yeah, that would be a different flow than what my patch addresses.

@ZYousef
Copy link
Author

ZYousef commented Aug 30, 2022

I found a workaround but I'm not sure what's going on. After investigating it looks like the second PCI falls out of the pci-assignable-list (xl pci-assignable-list), I set a script to add the pci at each boot the assignable list ( xl pci-assignable-add <second-pci-BDF> ). I've been testing the qube and it seems to be working fine ever since.

@andrewdavidwong andrewdavidwong added the affects-4.1 This issue affects Qubes OS 4.1. label Aug 8, 2023
@andrewdavidwong andrewdavidwong removed this from the Release 4.1 updates milestone Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.1 This issue affects Qubes OS 4.1. C: Xen hardware support needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.
Projects
None yet
Development

No branches or pull requests

4 participants