xen/vpci: fix backport of 53859596c0

Commit 53859596c0 depends on the behavioral change introduced in
ee2eb6849d that inverted the initialization of the MSI-X and header vPCI
handlers.  53859596c0 requires the header to be initialized before MSI-X.

Change the order of initialization and adjust init_msix() to carve holes
for the MSI-X tables if necessary, since it will now run after the BARs
have been possibly mapped into the domain p2m.

Fixes: 50b649c742 ("vpci/msix: improve handling of bogus MSI-X capabilities")
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Roger Pau Monné authored and Jan Beulich committed 2025-10-22 13:44:01 +02:00
1 parent 5177ae0672
commit 8a62bb04e2
2 files changed
+8 -3

No files matched your search

+1 -1
View File
@@ -1016,7 +1016,7 @@ static int cf_check init_header(struct pci_dev *pdev)
pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
return rc;
}
REGISTER_VPCI_INIT(init_header, VPCI_PRIORITY_MIDDLE);
REGISTER_VPCI_INIT(init_header, VPCI_PRIORITY_HIGH);
/*
* Local variables:
+7 -2
View File
@@ -790,9 +790,14 @@ static int cf_check init_msix(struct pci_dev *pdev)
pdev->vpci->msix = msix;
list_add(&msix->next, &d->arch.hvm.msix_tables);
return 0;
/*
* vPCI header initialization will have mapped the whole BAR into the
* p2m, as MSI-X capability was not yet initialized. Crave a hole for
* the MSI-X table here, so that Xen can trap accesses.
*/
return vpci_make_msix_hole(pdev);
}
REGISTER_VPCI_INIT(init_msix, VPCI_PRIORITY_HIGH);
REGISTER_VPCI_INIT(init_msix, VPCI_PRIORITY_MIDDLE);
/*
* Local variables:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.