Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161974444
D20525.id58271.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D20525.id58271.diff
View Options
Index: sys/amd64/vmm/io/ppt.c
===================================================================
--- sys/amd64/vmm/io/ppt.c
+++ sys/amd64/vmm/io/ppt.c
@@ -102,7 +102,9 @@
int num_msgs;
int startrid;
int msix_table_rid;
+ int msix_pba_rid;
struct resource *msix_table_res;
+ struct resource *msix_pba_res;
struct resource **res;
void **cookie;
struct pptintr_arg *arg;
@@ -292,6 +294,12 @@
for (i = 0; i < ppt->msix.num_msgs; i++)
ppt_teardown_msix_intr(ppt, i);
+ free(ppt->msix.res, M_PPTMSIX);
+ free(ppt->msix.cookie, M_PPTMSIX);
+ free(ppt->msix.arg, M_PPTMSIX);
+
+ pci_release_msi(ppt->dev);
+
if (ppt->msix.msix_table_res) {
bus_release_resource(ppt->dev, SYS_RES_MEMORY,
ppt->msix.msix_table_rid,
@@ -299,13 +307,14 @@
ppt->msix.msix_table_res = NULL;
ppt->msix.msix_table_rid = 0;
}
+ if (ppt->msix.msix_pba_res) {
+ bus_release_resource(ppt->dev, SYS_RES_MEMORY,
+ ppt->msix.msix_pba_rid,
+ ppt->msix.msix_pba_res);
+ ppt->msix.msix_pba_res = NULL;
+ ppt->msix.msix_pba_rid = 0;
+ }
- free(ppt->msix.res, M_PPTMSIX);
- free(ppt->msix.cookie, M_PPTMSIX);
- free(ppt->msix.arg, M_PPTMSIX);
-
- pci_release_msi(ppt->dev);
-
ppt->msix.num_msgs = 0;
}
@@ -634,6 +643,19 @@
}
ppt->msix.msix_table_rid = rid;
+ if (dinfo->cfg.msix.msix_table_bar !=
+ dinfo->cfg.msix.msix_pba_bar) {
+ rid = dinfo->cfg.msix.msix_pba_bar;
+ ppt->msix.msix_pba_res = bus_alloc_resource_any(
+ ppt->dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
+
+ if (ppt->msix.msix_pba_res == NULL) {
+ ppt_teardown_msix(ppt);
+ return (ENOSPC);
+ }
+ ppt->msix.msix_pba_rid = rid;
+ }
+
alloced = numvec;
error = pci_alloc_msix(ppt->dev, &alloced);
if (error || alloced != numvec) {
@@ -665,7 +687,6 @@
&ppt->msix.cookie[idx]);
if (error != 0) {
- bus_teardown_intr(ppt->dev, ppt->msix.res[idx], ppt->msix.cookie[idx]);
bus_release_resource(ppt->dev, SYS_RES_IRQ, rid, ppt->msix.res[idx]);
ppt->msix.cookie[idx] = NULL;
ppt->msix.res[idx] = NULL;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 9, 1:18 PM (17 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34888122
Default Alt Text
D20525.id58271.diff (2 KB)
Attached To
Mode
D20525: Support MSI-X for passthrough devices with a separate PBA BAR.
Attached
Detach File
Event Timeline
Log In to Comment