libxl: do not attach xen-pciback to HVM domain, if stubdomain is in use
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Sat, 28 Sep 2019 14:20:35 +0000 (15:20 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 4 Oct 2019 16:04:51 +0000 (17:04 +0100)
commit83aa53f110941a6a4609ad1842dd7dc033d9fe44
tree7e1dbfe74d3021996637f4062d56cef950b54fc3
parent1a734d51902dff44501a7589fdf44d269a55cffd
libxl: do not attach xen-pciback to HVM domain, if stubdomain is in use

HVM domains use IOMMU and device model assistance for communicating with
PCI devices, xen-pcifront/pciback isn't directly needed by HVM domain.
But pciback serve also second function - it reset the device when it is
deassigned from the guest and for this reason pciback needs to be used
with HVM domain too.
When HVM domain has device model in stubdomain, attaching xen-pciback to
the target domain itself may prevent attaching xen-pciback to the
(PV) stubdomain, effectively breaking PCI passthrough.

Fix this by attaching pciback only to one domain: if PV stubdomain is in
use, let it be stubdomain (the commit prevents attaching device to target
HVM in this case); otherwise, attach it to the target domain.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
tools/libxl/libxl_pci.c