xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/mcfg: Call PHYSDEVOP_pci_mmcfg_reserved before PCI enumeration
@ 2015-09-15 23:29 Ed Swierk
  2015-09-21 15:58 ` Ed Swierk
  0 siblings, 1 reply; 23+ messages in thread
From: Ed Swierk @ 2015-09-15 23:29 UTC (permalink / raw)
  To: xen-devel; +Cc: Ed Swierk

On systems where the ACPI DSDT advertises the PCI MMCONFIG area but the
E820 table does not reserve it, it's up to Dom0 to inform Xen via
PHYSDEVOP_pci_mmcfg_reserved.  This needs to happen before Xen tries to
access extended capabilities like SRIOV in pci_add_device(), which is
triggered when Linux enumerates PCI devices in acpi_init().  Changing
xen_mcfg_late() to arch_initcall_sync ensures it gets called before
acpi_init(), but after pci_mmcfg_list is populated by pci_arch_init().

Without this change, Xen 4.4 and 4.5 emit WARN messsages from
msix_capability_init() when setting up Intel 82599 VFs, since vf_rlen has
not been initialized by pci_add_device().  And on Xen 4.5, Xen nukes the
DomU due to "Potentially insecure use of MSI-X" when the VF driver loads
in the DomU.  Both problems are fixed by this change.

Signed-off-by: Ed Swierk <eswierk@skyportsystems.com>
---
 drivers/xen/pci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c
index 7494dbe..7b5bbdb 100644
--- a/drivers/xen/pci.c
+++ b/drivers/xen/pci.c
@@ -253,7 +253,9 @@ static int __init xen_mcfg_late(void)
 	return 0;
 }
 /*
- * Needs to be done after acpi_init which are subsys_initcall.
+ * Needs to be called after pci_arch_init (arch_initcall) populates
+ * pci_mmcfg_list, but before acpi_init (subsys_initcall) triggers
+ * pci_add_device() in Xen, since the latter probes extended capabilities.
  */
-subsys_initcall_sync(xen_mcfg_late);
+arch_initcall_sync(xen_mcfg_late);
 #endif
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2015-09-23  0:53 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-15 23:29 [PATCH] xen/mcfg: Call PHYSDEVOP_pci_mmcfg_reserved before PCI enumeration Ed Swierk
2015-09-21 15:58 ` Ed Swierk
2015-09-21 18:05   ` Konrad Rzeszutek Wilk
2015-09-22  5:23     ` Jan Beulich
2015-09-22 13:36       ` Konrad Rzeszutek Wilk
2015-09-22 13:57         ` Jan Beulich
2015-09-22 14:09           ` Konrad Rzeszutek Wilk
2015-09-22 14:12             ` Jan Beulich
2015-09-22 14:33               ` Konrad Rzeszutek Wilk
2015-09-22 15:07                 ` Jan Beulich
2015-09-22  5:21   ` Jan Beulich
2015-09-22 12:35     ` Ed Swierk
2015-09-22 12:40       ` Jan Beulich
2015-09-22 13:26       ` Ed Swierk
2015-09-22 13:36         ` Jan Beulich
2015-09-22 13:39         ` Konrad Rzeszutek Wilk
2015-09-22 13:52           ` Jan Beulich
2015-09-22 14:03             ` Konrad Rzeszutek Wilk
2015-09-22 14:11               ` Jan Beulich
2015-09-22 14:37                 ` Konrad Rzeszutek Wilk
2015-09-22 15:09                   ` Jan Beulich
2015-09-22 20:17                     ` Ed Swierk
2015-09-23  0:53                       ` Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).