-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
0620-libxl-Allow-stubdomain-to-control-interupts-of-PCI-d.patch
43 lines (38 loc) · 1.54 KB
/
0620-libxl-Allow-stubdomain-to-control-interupts-of-PCI-d.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
From b264671e40262b0e81cf7b1badef2a4da3837946 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
Date: Wed, 16 Nov 2022 01:31:42 +0100
Subject: [PATCH] libxl: Allow stubdomain to control interupts of PCI device
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Especially allow it to control MSI/MSI-X enabling bits. This part only
writes a flag to a sysfs, the actual implementation is on the kernel
side.
Signed-off-by: Marek Marczykowski-Górecki <[email protected]>
---
tools/libs/light/libxl_pci.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index bf4acb46d6e8..e87c58100127 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -1512,6 +1512,17 @@ static void pci_add_dm_done(libxl__egc *egc,
rc = ERROR_FAIL;
goto out;
}
+ } else if (libxl_is_stubdom(ctx, domid, NULL)) {
+ /* Allow acces to MSI enable flag in PCI config space for the stubdom */
+ if ( sysfs_write_bdf(gc, SYSFS_PCIBACK_DRIVER"/allow_interrupt_control",
+ pci) < 0 ) {
+ if ( sysfs_write_bdf(gc, SYSFS_PCIBACK_DRIVER"/allow_msi_enable",
+ pci) < 0 ) {
+ LOGD(ERROR, domainid, "Setting allow_msi_enable for device");
+ rc = ERROR_FAIL;
+ goto out;
+ }
+ }
}
out_no_irq:
--
2.44.0