linux-stable/drivers/xen
Igor Druzhinin 6c5207b5c4 xen/pci: reserve MCFG areas earlier
[ Upstream commit a4098bc6ee ]

If MCFG area is not reserved in E820, Xen by default will defer its usage
until Dom0 registers it explicitly after ACPI parser recognizes it as
a reserved resource in DSDT. Having it reserved in E820 is not
mandatory according to "PCI Firmware Specification, rev 3.2" (par. 4.1.2)
and firmware is free to keep a hole in E820 in that place. Xen doesn't know
what exactly is inside this hole since it lacks full ACPI view of the
platform therefore it's potentially harmful to access MCFG region
without additional checks as some machines are known to provide
inconsistent information on the size of the region.

Now xen_mcfg_late() runs after acpi_init() which is too late as some basic
PCI enumeration starts exactly there as well. Trying to register a device
prior to MCFG reservation causes multiple problems with PCIe extended
capability initializations in Xen (e.g. SR-IOV VF BAR sizing). There are
no convenient hooks for us to subscribe to so register MCFG areas earlier
upon the first invocation of xen_add_device(). It should be safe to do once
since all the boot time buses must have their MCFG areas in MCFG table
already and we don't support PCI bus hot-plug.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-10-11 18:18:38 +02:00
..
events xen/events: fix binding user event channels to cpus 2019-07-31 07:28:39 +02:00
xen-pciback xen/pciback: remove set but not used variable 'old_state' 2019-08-25 10:50:10 +02:00
xenbus xen/xenbus: fix self-deadlock after killing user process 2019-10-11 18:18:36 +02:00
xenfs
acpi.c
arm-device.c
balloon.c xen: let alloc_xenballooned_pages() fail if not enough memory free 2019-07-31 07:28:34 +02:00
biomerge.c
cpu_hotplug.c
dbgp.c
efi.c
evtchn.c xen/events: fix binding user event channels to cpus 2019-07-31 07:28:39 +02:00
fallback.c
features.c
gntalloc.c
gntdev.c
grant-table.c
Kconfig
Makefile
manage.c
mcelog.c
pci.c xen/pci: reserve MCFG areas earlier 2019-10-11 18:18:38 +02:00
pcpu.c
platform-pci.c
preempt.c
privcmd.c
privcmd.h
pvcalls-back.c
swiotlb-xen.c xen/swiotlb: fix condition for calling xen_destroy_contiguous_region() 2019-08-06 19:05:27 +02:00
sys-hypervisor.c
time.c
tmem.c
xen-acpi-cpuhotplug.c
xen-acpi-memhotplug.c
xen-acpi-pad.c
xen-acpi-processor.c
xen-balloon.c
xen-scsiback.c
xen-selfballoon.c
xen-stub.c
xlate_mmu.c