[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 4/5] vpci/msix: move MSI-X hole punching as a result of memory decoding enable
Deferring the p2m unpopulate of the MSI-X table region to after the BAR are mapped in the p2m is not needed. The aim of vpci_make_msix_hole() is to cope with the BAR containing the MSI-X table being positioned over a reserved e820 region, by making sure the MSI-X table region is unpopulated on the p2m. Note that reserved e820 regions are identity mapped in the hardware domain p2m by default. Doing it before or after the BAR p2m changes are done is irrelevant, hence do it ahead of the p2m changes, as that's simpler. Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> --- xen/drivers/vpci/header.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c index 1a501a0ba47e..255c6d54b406 100644 --- a/xen/drivers/vpci/header.c +++ b/xen/drivers/vpci/header.c @@ -133,19 +133,6 @@ static void modify_decoding(const struct pci_dev *pdev, uint16_t cmd, bool map = cmd & PCI_COMMAND_MEMORY; unsigned int i; - /* - * Make sure there are no mappings in the MSIX MMIO areas, so that accesses - * can be trapped (and emulated) by Xen when the memory decoding bit is - * enabled. - * - * FIXME: punching holes after the p2m has been set up might be racy for - * DomU usage, needs to be revisited. - */ -#ifdef CONFIG_HAS_PCI_MSI - if ( map && !rom_only && vpci_make_msix_hole(pdev) ) - return; -#endif - for ( i = 0; i < ARRAY_SIZE(header->bars); i++ ) { struct vpci_bar *bar = &header->bars[i]; @@ -547,6 +534,11 @@ static void cf_check cmd_write( */ return; +#ifdef CONFIG_HAS_PCI_MSI + /* Unpopulate MSI-X table region, so accesses trap into Xen. */ + if ( (cmd & PCI_COMMAND_MEMORY) && vpci_make_msix_hole(pdev) ) + return; +#endif /* * FIXME: for domUs we don't want the guest toggling the memory decoding * bit. It should be set in vpci_init_header() and guest attempts to -- 2.49.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |