I am running Xen 4.6 on CentOS 7 in a Dell Poweredge T430 I need PCI Passthrough to get USB working. I am following the Xenproject Wiki I have enabled the Virtulasation in the BIOS. I have xen_pciback as a module I have issued the command: xl pci-assignable-add 00:1a0.0 and it shows up fine when I issue this xl pci-assignable-list
I have pci=['00:1a.0'] on the DomU config file I have added this iommu=soft and swiotlb=force both together and separately to the kernel command line in the DomU (running Debian 8), but I get the same error each time.
libxl: error: libxl_pci.c:999:do_pci_add: xc_assign_device failed: Operation not permitted libxl: error: libxl_create.c:1424:domcreate_attach_pci: libxl_device_pci_add failed: -3
Can anyone suggest a cure for this?
Many thanks Francis
On Thu, May 12, 2016 at 12:11 PM, Francis Greaves francis@choughs.net wrote:
I am running Xen 4.6 on CentOS 7 in a Dell Poweredge T430 I need PCI Passthrough to get USB working. I am following the Xenproject Wiki I have enabled the Virtulasation in the BIOS. I have xen_pciback as a module I have issued the command:
xl pci-assignable-add 00:1a0.0 and it shows up fine when I issue this xl pci-assignable-list
I have pci=['00:1a.0'] on the DomU config file I have added this iommu=soft and swiotlb=force both together and separately to the kernel command line in the DomU (running Debian 8), but I get the same error each time.
libxl: error: libxl_pci.c:999:do_pci_add: xc_assign_device failed: Operation not permitted libxl: error: libxl_create.c:1424:domcreate_attach_pci: libxl_device_pci_add failed: -3
Can you please attach the following: 1. The complete domU config file 2. A complete log of the command and all the output 3. The full output of "xl dmesg" just after you run the command
Thanks, -George
Dear George please find attached the three files as requested. I have used iommu=soft
in the grub command line for the kernel in the domU as explained before. many thanks Francis
From: "George Dunlap" dunlapg@umich.edu To: "francis" francis@choughs.net, "centos-virt" centos-virt@centos.org Sent: Monday, 16 May, 2016 10:29:09 Subject: Re: [CentOS-virt] PCI Passthrough not working
On Thu, May 12, 2016 at 12:11 PM, Francis Greaves francis@choughs.net wrote:
I am running Xen 4.6 on CentOS 7 in a Dell Poweredge T430 I need PCI Passthrough to get USB working. I am following the Xenproject Wiki I have enabled the Virtulasation in the BIOS. I have xen_pciback as a module I have issued the command:
xl pci-assignable-add 00:1a0.0 and it shows up fine when I issue this xl pci-assignable-list
I have pci=['00:1a.0'] on the DomU config file I have added this iommu=soft and swiotlb=force both together and separately to the kernel command line in the DomU (running Debian 8), but I get the same error each time.
libxl: error: libxl_pci.c:999:do_pci_add: xc_assign_device failed: Operation not permitted libxl: error: libxl_create.c:1424:domcreate_attach_pci: libxl_device_pci_add failed: -3
Can you please attach the following: 1. The complete domU config file 2. A complete log of the command and all the output 3. The full output of "xl dmesg" just after you run the command
Thanks, -George
On Mon, May 16, 2016 at 12:00 PM, Francis Greaves francis@choughs.net wrote:
Dear George please find attached the three files as requested. I have used
iommu=soft
in the grub command line for the kernel in the domU as explained before. many thanks
(Please reply in-line, like this, rather than top-posting.)
Thanks -- as I suspected, your USB device has RMRRs, which are what's causing the problem.
In this case, your USB controller's RMRRs are shared with another device. Theoretically, having two devices with the same RMRRs assigned to different domains could be a security issue, so Xen by default refuses to do it.
The options are: 1. Figure out what the other device is and assign them both to the guest 2. Tell Xen that you don't mind the sharing.
You should only do #2 if you're not using Xen for isolation -- i.e., if you trust the software in that VM not to attack dom0.
I *think* you should be able to do #2 by adding 'rdm_policy=relaxed' to your pci stanza; i.e., it should look like this:
pci=['00:1a.0,rdm_policy=relaxed']
Let me know if that works for you.
-George
On Mon, May 16, 2016 at 12:00 PM, Francis Greaves francis@choughs.net wrote:
Dear George please find attached the three files as requested. I have used
iommu=soft
in the grub command line for the kernel in the domU as explained before. many thanks
The options are:
- Figure out what the other device is and assign them both to the guest
- Tell Xen that you don't mind the sharing.
You should only do #2 if you're not using Xen for isolation -- i.e., if you trust the software in that VM not to attack dom0.
I *think* you should be able to do #2 by adding 'rdm_policy=relaxed' to your pci stanza; i.e., it should look like this:
pci=['00:1a.0,rdm_policy=relaxed']
Dear George That worked, do I still need to add this to the cfg file?
usb=1 usbdevice=['host:0529:0514']
or how do I assign the device without the 'rdm_policy=relaxed' option as per option 1?
Thanks so much for your speedy advice. Francis
On Mon, May 16, 2016 at 2:14 PM, Francis Greaves francis@choughs.net wrote:
On Mon, May 16, 2016 at 12:00 PM, Francis Greaves francis@choughs.net wrote:
Dear George please find attached the three files as requested. I have used
iommu=soft
in the grub command line for the kernel in the domU as explained before. many thanks
The options are:
- Figure out what the other device is and assign them both to the guest
- Tell Xen that you don't mind the sharing.
You should only do #2 if you're not using Xen for isolation -- i.e., if you trust the software in that VM not to attack dom0.
I *think* you should be able to do #2 by adding 'rdm_policy=relaxed' to your pci stanza; i.e., it should look like this:
pci=['00:1a.0,rdm_policy=relaxed']
Dear George That worked, do I still need to add this to the cfg file?
usb=1 usbdevice=['host:0529:0514']
or how do I assign the device without the 'rdm_policy=relaxed' option as per option 1?
Sorry, I don't understand your question.
In the pci case, you're passing through an entire USB controller. The guest will get access to anything plugged into that controller as though it were running on native.
In the second case, you're presenting an emulated controller, and then having qemu pass commands through to the device. This should also work, but may be a bit slower.
But for 4.6 it's only available in HVM mode -- and the config file you attached was set up to run in PV mode (if I remember correctly).
Thanks so much for your speedy advice.
Responding right away means I can delete it and forget about it. ;-)
-George