forked from QubesOS/qubes-vmm-xen
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatch-0001-libxl-attach-xen-pciback-only-to-PV-domains.patch
49 lines (43 loc) · 1.68 KB
/
patch-0001-libxl-attach-xen-pciback-only-to-PV-domains.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From 3368757dcc867bbb86f1d75649c9e68cc7f1456d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
Date: Thu, 22 Sep 2016 16:07:14 +0200
Subject: [PATCH] libxl: attach xen-pciback only to PV domains
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Cc: Marek Marczykowski-Górecki <[email protected]>
HVM domains use IOMMU and device model assistance for communicating with
PCI devices, xen-pcifront/pciback is used only in PV domains.
When HVM domain has device model in stubdomain, attaching xen-pciback to
the target domain itself is not only useless, but also may prevent
attaching xen-pciback to the stubdomain, effectively breaking PCI
passthrough.
Signed-off-by: Marek Marczykowski-Górecki <[email protected]>
---
tools/libxl/libxl_pci.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 8395352..7971160 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -1113,7 +1113,7 @@ out:
}
}
- if (!starting)
+ if (!starting && !hvm)
rc = libxl__device_pci_add_xenstore(gc, domid, pcidev, starting);
else
rc = 0;
@@ -1308,7 +1308,8 @@ static void libxl__add_pcidevs(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
}
}
- if (d_config->num_pcidevs > 0) {
+ if (d_config->num_pcidevs > 0
+ && d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV) {
rc = libxl__create_pci_backend(gc, domid, d_config->pcidevs,
d_config->num_pcidevs);
if (rc < 0) {
--
2.7.4