[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 0/9] Refactor PCI/SHPC/PCIE hotplug to use a
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH v6 0/9] Refactor PCI/SHPC/PCIE hotplug to use a more generic hotplug API |
Date: |
Mon, 10 Feb 2014 11:09:16 +0200 |
On Wed, Feb 05, 2014 at 04:36:43PM +0100, Igor Mammedov wrote:
> changes since v5:
> - fixed typos Eric pointed to
> - fix conflict of [5/9] with new patch "acpi-build: append description for
> non-hotplug"
> - rebased on top of todays PCI tree
>
> changes since v4:
> - rebased on top of PCI tree
> - added wrapper to set hotplug-device property
>
> changes since v3:
> - fixup/add comments as reqused by Peter Crosthwaite
> - use error_abort to reduce error handling verbosity
> - fix tests/test-qdev-global-props build failure on make check
> - rebase on top of current master:133fe7743 (with interface fixes)
>
> changes since v2:
> * s/hotplugable/hotpluggable/
> * move hotplug check to an earlier patch:
> "qdev: add "hotpluggable" property to Device"
This was on top my
acpi-build: append description for non-hotplug
which I'm not merging yet, so I had to rebase.
Applied and pushed, please verify and confirm.
> --
> Refactor PCI specific hotplug API to a more generic/reusable one.
> Model it after SCSI-BUS like hotplug API replacing single hotplug
> callback with hotplug/hot_unplug pair of callbacks as suggested by
> Paolo.
> Difference between SCSI-BUS and this approach is that the former
> is BUS centric while the latter is device centred. Which is evolved
> from the fact that hotplug callbacks used by ACPI/SHPC/PCIE are
> implemented by devices rather than by bus and bus serves only as
> a proxy to forward event to hotplug device.
> Memory hotplug also exposes tha same usage pattern hence an attempt
> to generalize hotplug API.
>
> Refactoring also simplifies wiring of a hotplug device with a bus,
> all it needs is to set "hotplug-device" link on bus, which
> would potentially allow to do it from configuration file,
> there is not need to setup hotplug device callbacks on bus
> synce it can get them via HOTPLUG_DEVICE API of "hotplug-device"
> target.
>
> In addition device centred hotplug API may be used by bus-less
> hotplug implementations as well if it's decided to use
> link<foo...> instead of bus.
>
> Patches 8-11 are should be merged as one and are split only for
> simplifying review (they compile fine but PCI hotplug is broken
> until the last patch is applyed).
>
> git tree for testing:
> https://github.com/imammedo/qemu/commits/hotplug_dev_inf_v6
>
> tested only ACPI and PCIE hotplug, since SHPC is not functional, tested
> it under debugger that hotplhug event reaches handler and corresponding
> interrupt is emited.
>
>
> Igor Mammedov (9):
> define hotplug interface
> qdev: add to BusState "hotplug-handler" link
> qdev: add "hotpluggable" property to Device
> hw/acpi: move typeinfo to the file end
> qdev:pci: refactor PCIDevice to use generic "hotpluggable" property
> acpi/piix4pm: convert ACPI PCI hotplug to use hotplug-handler API
> pci/shpc: convert SHPC hotplug to use hotplug-handler API
> pci/pcie: convert PCIE hotplug to use hotplug-handler API
> hw/pci: switch to a generic hotplug handling for PCIDevice
>
> hw/acpi/pcihp.c | 46 ++++++++++----
> hw/acpi/piix4.c | 128
> +++++++++++++++++++++-------------------
> hw/core/Makefile.objs | 1 +
> hw/core/hotplug.c | 48 +++++++++++++++
> hw/core/qdev.c | 50 ++++++++++++++-
> hw/display/cirrus_vga.c | 2 +-
> hw/display/qxl.c | 2 +-
> hw/display/vga-pci.c | 2 +-
> hw/display/vmware_vga.c | 2 +-
> hw/i386/acpi-build.c | 4 +-
> hw/ide/piix.c | 4 +-
> hw/isa/piix4.c | 2 +-
> hw/pci-bridge/pci_bridge_dev.c | 9 +++
> hw/pci-host/piix.c | 6 +-
> hw/pci/pci.c | 40 +------------
> hw/pci/pcie.c | 65 ++++++++++++--------
> hw/pci/pcie_port.c | 8 +++
> hw/pci/shpc.c | 124 ++++++++++++++++++++++++---------------
> hw/usb/hcd-ehci-pci.c | 2 +-
> hw/usb/hcd-ohci.c | 2 +-
> hw/usb/hcd-uhci.c | 2 +-
> hw/usb/hcd-xhci.c | 2 +-
> include/hw/acpi/acpi.h | 1 +
> include/hw/acpi/pcihp.h | 10 ++-
> include/hw/hotplug.h | 78 ++++++++++++++++++++++++
> include/hw/pci/pci.h | 13 ----
> include/hw/pci/pci_bus.h | 2 -
> include/hw/pci/pcie.h | 5 ++
> include/hw/pci/shpc.h | 8 +++
> include/hw/qdev-core.h | 15 +++++
> tests/Makefile | 2 +-
> 31 files changed, 463 insertions(+), 222 deletions(-)
> create mode 100644 hw/core/hotplug.c
> create mode 100644 include/hw/hotplug.h
- Re: [Qemu-devel] [PATCH v6 2/9] qdev: add to BusState "hotplug-handler" link, (continued)
- [Qemu-devel] [PATCH v6 1/9] define hotplug interface, Igor Mammedov, 2014/02/05
- [Qemu-devel] [PATCH v6 3/9] qdev: add "hotpluggable" property to Device, Igor Mammedov, 2014/02/05
- [Qemu-devel] [PATCH v6 4/9] hw/acpi: move typeinfo to the file end, Igor Mammedov, 2014/02/05
- [Qemu-devel] [PATCH v6 5/9] qdev:pci: refactor PCIDevice to use generic "hotpluggable" property, Igor Mammedov, 2014/02/05
- [Qemu-devel] [PATCH v6 7/9] pci/shpc: convert SHPC hotplug to use hotplug-handler API, Igor Mammedov, 2014/02/05
- [Qemu-devel] [PATCH v6 8/9] pci/pcie: convert PCIE hotplug to use hotplug-handler API, Igor Mammedov, 2014/02/05
- [Qemu-devel] [PATCH v6 6/9] acpi/piix4pm: convert ACPI PCI hotplug to use hotplug-handler API, Igor Mammedov, 2014/02/05
- [Qemu-devel] [PATCH v6 9/9] hw/pci: switch to a generic hotplug handling for PCIDevice, Igor Mammedov, 2014/02/05
- Re: [Qemu-devel] [PATCH v6 0/9] Refactor PCI/SHPC/PCIE hotplug to use a more generic hotplug API,
Michael S. Tsirkin <=