]> xenbits.xensource.com Git - xen.git/commitdiff
vpci: add a priority parameter to the vPCI register initializer
authorRoger Pau Monne <roger.pau@citrix.com>
Thu, 22 Mar 2018 14:00:00 +0000 (15:00 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 23 Mar 2018 09:25:32 +0000 (10:25 +0100)
This is needed for MSI-X, since MSI-X will need to be initialized
before parsing the BARs, so that the header BAR handlers are aware of
the MSI-X related holes and make sure they are not mapped in order for
the trap handlers to work properly.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
[ARM]
Acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/xen.lds.S
xen/arch/x86/xen.lds.S
xen/drivers/vpci/header.c
xen/drivers/vpci/msi.c
xen/include/xen/vpci.h

index 49cae2af718d441886217eeb3ce8fee8901b904e..245a0e0e855b2c73ea27733adfc93e8e61ebee88 100644 (file)
@@ -69,7 +69,7 @@ SECTIONS
 #if defined(CONFIG_HAS_VPCI) && defined(CONFIG_LATE_HWDOM)
        . = ALIGN(POINTER_ALIGN);
        __start_vpci_array = .;
-       *(.data.vpci)
+       *(SORT(.data.vpci.*))
        __end_vpci_array = .;
 #endif
   } :text
@@ -182,7 +182,7 @@ SECTIONS
 #if defined(CONFIG_HAS_VPCI) && !defined(CONFIG_LATE_HWDOM)
        . = ALIGN(POINTER_ALIGN);
        __start_vpci_array = .;
-       *(.data.vpci)
+       *(SORT(.data.vpci.*))
        __end_vpci_array = .;
 #endif
   } :text
index 7bd6fb51c3d71c8f3f2eae09e6f5fe5a700bdff5..70afedd31d57f153a323d9ead91807df950d7c8d 100644 (file)
@@ -139,7 +139,7 @@ SECTIONS
 #if defined(CONFIG_HAS_VPCI) && defined(CONFIG_LATE_HWDOM)
        . = ALIGN(POINTER_ALIGN);
        __start_vpci_array = .;
-       *(.data.vpci)
+       *(SORT(.data.vpci.*))
        __end_vpci_array = .;
 #endif
   } :text
@@ -246,7 +246,7 @@ SECTIONS
 #if defined(CONFIG_HAS_VPCI) && !defined(CONFIG_LATE_HWDOM)
        . = ALIGN(POINTER_ALIGN);
        __start_vpci_array = .;
-       *(.data.vpci)
+       *(SORT(.data.vpci.*))
        __end_vpci_array = .;
 #endif
   } :text
index 25d8ec050785f4926c7769344fe65070c6fb28b6..9fa07992cc9915aa2ed059032d3cf766d7510d08 100644 (file)
@@ -532,7 +532,7 @@ static int init_bars(struct pci_dev *pdev)
 
     return (cmd & PCI_COMMAND_MEMORY) ? modify_bars(pdev, true, false) : 0;
 }
-REGISTER_VPCI_INIT(init_bars);
+REGISTER_VPCI_INIT(init_bars, VPCI_PRIORITY_MIDDLE);
 
 /*
  * Local variables:
index c3c69ec453649f673831149204b0fe1a17052d2c..de4ddf562e93c035101d0c4ed581fc8c91356b12 100644 (file)
@@ -267,7 +267,7 @@ static int init_msi(struct pci_dev *pdev)
 
     return 0;
 }
-REGISTER_VPCI_INIT(init_msi);
+REGISTER_VPCI_INIT(init_msi, VPCI_PRIORITY_LOW);
 
 void vpci_dump_msi(void)
 {
index 116b93f5191ccfa371b7b8b9341464a75854e68b..7266c17679377726af1b3751f18a469390b3a773 100644 (file)
@@ -15,9 +15,13 @@ typedef void vpci_write_t(const struct pci_dev *pdev, unsigned int reg,
 
 typedef int vpci_register_init_t(struct pci_dev *dev);
 
-#define REGISTER_VPCI_INIT(x)                   \
+#define VPCI_PRIORITY_HIGH      "1"
+#define VPCI_PRIORITY_MIDDLE    "5"
+#define VPCI_PRIORITY_LOW       "9"
+
+#define REGISTER_VPCI_INIT(x, p)                \
   static vpci_register_init_t *const x##_entry  \
-               __used_section(".data.vpci") = x
+               __used_section(".data.vpci." p) = x
 
 /* Add vPCI handlers to device. */
 int __must_check vpci_add_handlers(struct pci_dev *dev);