summaryrefslogtreecommitdiff
path: root/hw/acpi/pcihp.c
AgeCommit message (Collapse)AuthorFilesLines
2014-02-10acpi/piix4pm: convert ACPI PCI hotplug to use hotplug-handler APIIgor Mammedov1-12/+31
Split piix4_device_hotplug() into hotplug/unplug callbacks and register them as "hotplug-handler" interface implementation of PIIX4_PM device. Replace pci_bus_hotplug() wiring with setting link on PCI BUS "hotplug-handler" property to PIIX4_PM device. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-02-10qdev:pci: refactor PCIDevice to use generic "hotpluggable" propertyIgor Mammedov1-1/+2
Get rid of PCIDevice specific PCIDeviceClass.no_hotplug and use generic DeviceClass.hotpluggable field instead. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-02-05hw:piix4:acpi: reuse pcihp code for legacy PCI hotplugIgor Mammedov1-5/+18
reduces acpi PCI hotplug code duplication by ~200LOC Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-02-05pcihp: make pci_read() mmio calback compatible with legacy ACPI hotplugIgor Mammedov1-2/+5
due to recent change introduced by: "pcihp: reduce number of device check events" 'up' field is cleared right after it's read. This is incompatible with legacy BIOS ACPI code where PCNF ACPI method reads this field 32 times. To make pci_read mmio callback compatible with legacy 'up' behavior, pcihp code will need to know in which mode it runs add 'legacy_piix' field to AcpiPciHpState structure and alter register behavior accordingly. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-02-05pcihp: make PCI hotplug mmio handlers indifferent to PCI_HOTPLUG_ADDRIgor Mammedov1-12/+12
... removes dependency of mmio handler on PCI_HOTPLUG_ADDR. It will be needed in case of Q35 where base could be different. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-02-05pcihp: replace enable|disable_device() with onelinersIgor Mammedov1-12/+2
enable_device() and disable_device() functions aren't reused anywere, so replace them with respective oneliners at call sites. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-02-05pcihp: reduce number of device check eventsMichael S. Tsirkin1-16/+5
PIIX created a made-up value for the UP register since it was read by guest 32 times for each interrupt. There's no reason to do this for the new PCIHP: register is only read once for each interrupt, so clean up code by making read act as an interrupt acknowledgement: the new UP register clear on read. In this way we cut down the number of bus rescans by a factor of 32, and drop a bunch of code that's now unused. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-01-26pcihp: generalization of piix4 acpiMichael S. Tsirkin1-0/+316
Add ACPI based PCI hotplug library with bridge hotplug support. Design - each bus gets assigned "bsel" property. - ACPI code writes this number to a new BNUM register, then uses existing UP/DOWN registers to probe slot status; to eject, write number to BNUM register, then slot into existing EJ. The interface is actually backwards-compatible with existing PIIX4 ACPI (though not migration compatible). This is split out from PIIX4 codebase so we can reuse it for Q35 as well. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>