qemu-e2k/include/hw
Igor Mammedov 6b0969f1ec acpi: pcihp: pcie: set power on cap on parent slot
on creation a PCIDevice has power turned on at the end of pci_qdev_realize()
however later on if PCIe slot isn't populated with any children
it's power is turned off. It's fine if native hotplug is used
as plug callback will power slot on among other things.
However when ACPI hotplug is enabled it replaces native PCIe plug
callbacks with ACPI specific ones (acpi_pcihp_device_*plug_cb) and
as result slot stays powered off. It works fine as ACPI hotplug
on guest side takes care of enumerating/initializing hotplugged
device. But when later guest is migrated, call chain introduced by]
commit d5daff7d31 (pcie: implement slot power control for pcie root ports)

   pcie_cap_slot_post_load()
       -> pcie_cap_update_power()
           -> pcie_set_power_device()
               -> pci_set_power()
                   -> pci_update_mappings()

will disable earlier initialized BARs for the hotplugged device
in powered off slot due to commit 23786d1344 (pci: implement power state)
which disables BARs if power is off.

Fix it by setting PCI_EXP_SLTCTL_PCC to PCI_EXP_SLTCTL_PWR_ON
on slot (root port/downstream port) at the time a device
hotplugged into it. As result PCI_EXP_SLTCTL_PWR_ON is migrated
to target and above call chain keeps device plugged into it
powered on.

Fixes: d5daff7d31 ("pcie: implement slot power control for pcie root ports")
Fixes: 23786d1344 ("pci: implement power state")
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2053584
Suggested-by: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20220301151200.3507298-3-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2022-03-06 05:08:23 -05:00
..
acpi ACPI ERST: create ACPI ERST table for pc/x86 machines 2022-02-06 04:33:50 -05:00
adc
arm ast2600: Add Secure Boot Controller model 2022-02-26 18:40:51 +01:00
audio
block
char hw/riscv: spike: Allow using binary firmware as bios 2022-01-21 15:52:56 +10:00
core
cpu
cris
display hw/mips/jazz: Inline vga_mmio_init() and remove it 2022-01-13 10:58:54 +01:00
dma hw/dma/xlnx_csu_dma: Support starting a read transfer through a class method 2022-01-28 14:29:46 +00:00
firmware
gpio
hyperv
i2c
i386 intel_iommu: support snoop control 2022-03-06 05:08:23 -05:00
ide
input
intc hw/intc: Add RISC-V AIA APLIC device emulation 2022-02-16 12:24:19 +10:00
ipack
ipmi
isa intc: Unexport InterruptStatsProviderClass-related functions 2022-01-27 12:08:50 +01:00
kvm
m68k hw/m68k/mcf: Add missing 'exec/hwaddr.h' header 2022-02-21 10:35:13 +01:00
mem nvdimm: Add realize, unrealize callbacks to NVDIMMDevice class 2022-02-18 08:34:13 +01:00
mips
misc hw/misc/pvpanic: Use standard headers instead 2022-03-06 05:08:23 -05:00
net hw/net: Move MV88W8618 network device out of hw/arm/ directory 2022-01-20 11:47:52 +00:00
nubus
nvram
pci acpi: pcihp: pcie: set power on cap on parent slot 2022-03-06 05:08:23 -05:00
pci-bridge pci: expose TYPE_XIO3130_DOWNSTREAM name 2022-03-06 05:08:23 -05:00
pci-host ppc/pnv: Add support for PHB5 "Address-based trigger" mode 2022-03-02 06:51:39 +01:00
ppc pnv/xive2: Add support for 8bits thread id 2022-03-02 06:51:39 +01:00
rdma
remote
riscv hw/riscv: Remove macros for ELF BIOS image names 2022-01-21 15:52:57 +10:00
rtc
rx
s390x s390x/css: fix PMCW invalid mask 2022-01-17 08:34:19 +01:00
scsi hw/dma: Let dma_buf_read() / dma_buf_write() propagate MemTxResult 2022-01-18 12:56:29 +01:00
sd
sensor
sh4
southbridge
sparc
ssi aspeed/smc: Add an address mask on segment registers 2022-02-26 18:40:51 +01:00
timer hw: timer: ibex_timer: Fixup reading w/o register 2022-01-21 15:52:56 +10:00
tricore hw/tricore: Remove unused and incorrect header 2022-02-21 10:36:50 +01:00
usb
vfio
virtio virtio-iommu: Default to bypass during boot 2022-03-06 05:08:23 -05:00
watchdog
xen
xtensa
boards.h
clock.h
elf_ops.h hw/elf_ops: clear uninitialized segment space 2022-01-20 09:09:37 +01:00
fw-path-provider.h
hotplug.h
hw.h
ide.h
irq.h
loader-fit.h
loader.h semihosting/arm-compat: replace heuristic for softmmu SYS_HEAPINFO 2022-02-28 16:42:35 +00:00
nmi.h
or-irq.h
pcmcia.h
platform-bus.h
ptimer.h
qdev-clock.h
qdev-core.h qdev-core.h: Fix wrongly named reference to TYPE_SPLIT_IRQ 2022-01-18 12:32:16 +01:00
qdev-dma.h
qdev-properties-system.h
qdev-properties.h
register.h
registerfields.h hw/registerfields: Add FIELD_SEX<N> and FIELD_SDP<N> 2022-03-02 19:27:36 +00:00
resettable.h
stream.h
sysbus.h
usb.h
vmstate-if.h