summaryrefslogtreecommitdiff
path: root/hw/pci/pcie.c
AgeCommit message (Collapse)AuthorFilesLines
2014-03-09PCIE: fix regression with coldplugged multifunction deviceIgor Mammedov1-8/+8
PCIE is causing asserts each time a multifunction device is added on command line (coldplug). This is caused by commit a66e657e18cd9b70e9f57ae5512c07faf2bc508f pci/pcie: convert PCIE hotplug to use hotplug-handler API QEMU abort is caused by misplaced assertion, which should be checked only when device is hotplugged. Reference to regression report: http://www.mail-archive.com/qemu-devel@nongnu.org/msg216226.html Fixes: a66e657e18cd9b70e9f57ae5512c07faf2bc508f Reported-By: Nigel Kukard <nkukard+qemu@lbsd.net> 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-10pci/pcie: convert PCIE hotplug to use hotplug-handler APIIgor Mammedov1-25/+40
Split pcie_cap_slot_hotplug() into hotplug/unplug callbacks and register them as "hotplug-handler" interface implementation of PCIE_SLOT device. Replace pci_bus_hotplug() wiring with setting link on PCI BUS "hotplug-handler" property to PCI_BRIDGE_DEV 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>
2013-11-05qdev: Drop misleading qdev_free() functionStefan Hajnoczi1-1/+1
The qdev_free() function name is misleading since all the function does is unlink the device from its parent. The device is not necessarily freed. The device will be freed when its QObject refcount reaches zero. It is usual for the parent (bus) to hold the final reference but there are cases where something else holds a reference so "free" is a misleading name. Call object_unparent(obj) directly instead of having a qdev wrapper function. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-10-14hw/pcie: AER and hot-plug events must use device's interruptMarcel Apfelbaum1-2/+2
The fields hpev_intx and aer_intx were removed because both AER and hot-plug events must use device's interrupt. Assert/deassert interrupts using pci irq wrappers instead. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-07-29pci-bridge: Turn PCIBridge into abstract QOM typeAndreas Färber1-1/+1
Introduce TYPE_PCI_BRIDGE as base type and use PCI_BRIDGE() casts. Reviewed-by: Don Koch <dkoch@verizon.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> [AF: Updated pbm-bridge parent to TYPE_PCI_BRIDGE] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-03-26pcie: Add endpoint capability initialization wrapperAlex Williamson1-13/+16
Fix the awkward API of mangling the caller specified PCIe type and just provide an interface to initialize an endpoint device. This will pick either a regular endpoint or integrated endpoint based on the bus and return pcie_cap_init to doing exactly what is asked. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-03-26pcie: Mangle types to match topologyAlex Williamson1-0/+13
Windows will fail to start drivers for devices with an Endpoint type PCIe capability attached to a Root Complex (code 10 - Device cannot start). The proper type for such a device is Root Complex Integrated Endpoint. Devices don't care which they are, so do this conversion automatically. This allows the Windows driver to load for nec-usb-xhci when attached to pcie.0 of a q35 machine. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-12-26pcie: Fix bug in pcie_ext_cap_set_nextKnut Omang1-1/+1
Upper 16 bits of the PCIe Extended Capability Header was truncated during update, also breaking pcie_add_capability. Signed-off-by: Knut Omang <knut.omang@oracle.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-12-19misc: move include files to include/qemu/Paolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-17pci: rename pci_internals.h pci_bus.hMichael S. Tsirkin1-1/+1
There are lots of external users of pci_internals.h, apparently making it an internal interface only didn't work out. Let's stop pretending it's an internal header. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-12-17pci: fix path for local includesMichael S. Tsirkin1-6/+6
Include dependencies from pci core using the correct path. This is required now that it's in the separate directory. Need to check whether they can be minimized, for now, keep the code as is. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-12-17pci: move pci core code to hw/pciMichael S. Tsirkin1-0/+555
Move files and modify makefiles to pick them at the new location. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>