linux-yocto/drivers/pci
Dexuan Cui 45d1aa5674 PCI: hv: Do not set PCI_COMMAND_MEMORY to reduce VM boot time
commit 23e118a48a upstream.

Currently when the pci-hyperv driver finishes probing and initializing the
PCI device, it sets the PCI_COMMAND_MEMORY bit; later when the PCI device
is registered to the core PCI subsystem, the core PCI driver's BAR detection
and initialization code toggles the bit multiple times, and each toggling of
the bit causes the hypervisor to unmap/map the virtual BARs from/to the
physical BARs, which can be slow if the BAR sizes are huge, e.g., a Linux VM
with 14 GPU devices has to spend more than 3 minutes on BAR detection and
initialization, causing a long boot time.

Reduce the boot time by not setting the PCI_COMMAND_MEMORY bit when we
register the PCI device (there is no need to have it set in the first place).
The bit stays off till the PCI device driver calls pci_enable_device().
With this change, the boot time of such a 14-GPU VM is reduced by almost
3 minutes.

Link: https://lore.kernel.org/lkml/20220419220007.26550-1-decui@microsoft.com/
Tested-by: Boqun Feng (Microsoft) <boqun.feng@gmail.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Jake Oshins <jakeo@microsoft.com>
Link: https://lore.kernel.org/r/20220502074255.16901-1-decui@microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-10 15:57:41 +02:00
..
controller PCI: hv: Do not set PCI_COMMAND_MEMORY to reduce VM boot time 2025-07-10 15:57:41 +02:00
endpoint PCI: endpoint: Finish virtual EP removal in pci_epf_remove_vepf() 2025-03-13 12:50:29 +01:00
hotplug PCI: pciehp: Don't enable HPIE when resuming in poll mode 2025-04-10 14:31:59 +02:00
pcie PCI/DPC: Initialize aer_err_info before using it 2025-06-27 11:05:16 +01:00
switch
access.c
ats.c
bus.c
ecam.c
host-bridge.c
iov.c
irq.c
Kconfig x86/kaslr: Reduce KASLR entropy on most x86 systems 2025-06-04 14:38:00 +02:00
Makefile
mmap.c
msi.c
of.c
p2pdma.c
pci-acpi.c
pci-bridge-emul.c
pci-bridge-emul.h
pci-driver.c
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c PCI: Add 'reset_subordinate' to reset hierarchy below bridge 2024-12-14 19:51:42 +01:00
pci.c PCI: Fix lock symmetry in pci_slot_unlock() 2025-06-27 11:05:27 +01:00
pci.h PCI: Add 'reset_subordinate' to reset hierarchy below bridge 2024-12-14 19:51:42 +01:00
probe.c PCI: Release resource invalidated by coalescing 2025-05-02 07:44:40 +02:00
proc.c
quirks.c PCI: Add ACS quirk for Loongson PCIe 2025-06-27 11:05:27 +01:00
remove.c PCI: Fix use-after-free in pci_bus_release_domain_nr() 2025-05-02 07:44:40 +02:00
rom.c
search.c
setup-bus.c PCI: Fix old_size lower bound in calculate_iosize() too 2025-06-04 14:38:01 +02:00
setup-irq.c
setup-res.c
slot.c PCI: Fix use-after-free of slot->bus on hot remove 2024-12-14 19:51:13 +01:00
syscall.c
vc.c
vpd.c
xen-pcifront.c