From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCmmz-00087S-Ua for qemu-devel@nongnu.org; Mon, 10 Feb 2014 04:04:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCmmv-0006BQ-3p for qemu-devel@nongnu.org; Mon, 10 Feb 2014 04:04:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCmmu-0006BJ-Si for qemu-devel@nongnu.org; Mon, 10 Feb 2014 04:04:25 -0500 Date: Mon, 10 Feb 2014 11:09:16 +0200 From: "Michael S. Tsirkin" Message-ID: <20140210090916.GA16140@redhat.com> References: <1391614612-21107-1-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1391614612-21107-1-git-send-email-imammedo@redhat.com> Subject: Re: [Qemu-devel] [PATCH v6 0/9] Refactor PCI/SHPC/PCIE hotplug to use a more generic hotplug API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: kwolf@redhat.com, peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, stefanha@redhat.com, marcel.a@redhat.com, jan.kiszka@siemens.com, qemu-devel@nongnu.org, armbru@redhat.com, blauwirbel@gmail.com, alex.williamson@redhat.com, kraxel@redhat.com, aliguori@amazon.com, pbonzini@redhat.com, afaerber@suse.de 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 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