Statistics
| Branch: | Revision:

root / hw / pci / pci.c @ ddf5636d

History | View | Annotate | Download (68.9 kB)

# Date Author Comment
5e954943 02/10/2014 10:27 am Igor Mammedov

hw/pci: switch to a generic hotplug handling for PCIDevice

make qdev_unplug()/device_set_realized() to call hotplug handler's
plug/unplug methods if available and remove not needed anymore
hot(un)plug handling from PCIDevice.

In case if hotplug handler is not available, revert to the legacy...

2897ae02 02/10/2014 10:26 am Igor Mammedov

qdev:pci: refactor PCIDevice to use generic "hotpluggable" property

Get rid of PCIDevice specific PCIDeviceClass.no_hotplug and use
generic DeviceClass.hotpluggable field instead.

Signed-off-by: Igor Mammedov <>
Reviewed-by: Michael S. Tsirkin <>...

30607764 01/26/2014 01:11 pm Marcel Apfelbaum

hw/pci: fix error flow in pci multifunction init

Scenario:
- There is a non multifunction pci device A on 00:0X.0.
- Hot-plug another multifunction pci device B at 00:0X.1.
- The operation will fail of course.
- Try to hot-plug the B device 2-3 more times, qemu will crash....

eb0acfdd 01/26/2014 01:06 pm Michael S. Tsirkin

pci: add pci_for_each_bus_depth_first

Useful for ACPI hotplug.

Signed-off-by: Michael S. Tsirkin <>

81e3e75b 12/23/2013 01:12 pm Paolo Bonzini

pci: do not export pci_bus_reset

qbus_reset_all can be used instead. There is no semantic change
because pcibus_reset returns 1 and takes care of the device
tree traversal.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Michael S. Tsirkin <>

9bdbbfc3 12/23/2013 01:12 pm Paolo Bonzini

pci: clean up resetting of IRQs

pci_device_reset will deassert the INTX pins, and this will make the
irq_count array all-zeroes. Check that this is the case, and remove
the existing loop which might even unsync irq_count and irq_state.

Signed-off-by: Paolo Bonzini <>...

dcc20931 12/23/2013 01:12 pm Paolo Bonzini

qdev: switch reset to post-order

Post-order is the only sensible direction for the reset signals.
For example, suppose pre-order is used and the parent has some data
structures that cache children state (for example a list of active
requests). When the reset method is invoked on the parent, these caches...

4c41425d 12/11/2013 08:11 pm Gerd Hoffmann

pci: fix pci bridge fw path

qemu uses "pci" as name for pci bridges in the firmware device path.
seabios expects "pci-bridge". Result is that bootorder is broken for
devices behind pci bridges.

Some googling suggests that "pci-bridge" is the correct one. At least...

5c397242 11/21/2013 04:25 pm Bandan Das

pci: unregister vmstate_pcibus on unplug

PCIBus registers a vmstate during init. Unregister it upon
removal/unplug.

Signed-off-by: Bandan Das <>
Cc:
Reviewed-by: Andreas Färber <>
Signed-off-by: Michael S. Tsirkin <>

0fbf50b6 11/10/2013 02:30 pm Marcel Apfelbaum

Revert "hw/pci: partially handle pci master abort"

This reverts commit a53ae8e934cd54686875b5bcfc2f434244ee55d6.

The patch being reverted introduced a low-priority memory region
covering all 64 bit pci address space. This exposed the following bugs
elsewhere in the code:...

77d6f4ea 10/14/2013 05:48 pm Michael S. Tsirkin

pci: fix up w64 size calculation helper

BAR base was calculated incorrectly.
Use existing pci_bar_address to get it right.

Tested-by: Igor Mammedov <>
Reviewed-by: Igor Mammedov <>
Signed-off-by: Michael S. Tsirkin <>

c31d04b5 10/14/2013 05:11 pm Marcel Apfelbaum

hw/pci: removed irq field from PCIDevice

Instead of exposing the the irq field,
pci wrappers to qemu_set_irq or qemu_irq_*
can be used.

Signed-off-by: Marcel Apfelbaum <>
Signed-off-by: Michael S. Tsirkin <>

a53ae8e9 10/14/2013 05:11 pm Marcel Apfelbaum

hw/pci: partially handle pci master abort

A MemoryRegion with negative priority was created and
it spans over all the pci address space.
It "intercepts" the accesses to unassigned pci
address space and will follow the pci spec:
1. returns -1 on read
2. does nothing on write...

d98f08f5 10/14/2013 05:11 pm Marcel Apfelbaum

hw/pci: add pci wrappers for allocating and asserting irqs

Interrupt pin is selected and saved into PCI_INTERRUPT_PIN
register during device initialization. Devices should not call
directly qemu_set_irq and specify the INTx pin on each call.

Added pci_* wrappers to replace qemu_set_irq, qemu_irq_raise,...

9f1a029a 09/15/2013 11:49 am Hervé Poussineau

pci: remove explicit check to 64K ioport size

This check is useless, as bigger addresses will be ignored when
added to 'io' MemoryRegion, which has a size of 64K.

However, some architectures don't use the 'io' MemoryRegion, like
the alpha and versatile platforms. They create a PCI I/O region...

43864069 09/15/2013 11:49 am Michael S. Tsirkin

pci: add helper to retrieve the 64-bit range

Signed-off-by: Michael S. Tsirkin <>

6f88009e 09/09/2013 10:17 pm Tomoki Sekiyama

Add c++ keywords to QAPI helper script

Add c++ keywords to avoid errors in compiling with c++ compiler.
This also renames class member of PciDeviceInfo to q_class.

Signed-off-by: Tomoki Sekiyama <>
Reviewed-by: Laszlo Ersek <>...

9889e04a 09/03/2013 08:31 pm Anthony Liguori

Merge remote-tracking branch 'mst/tags/for_anthony' into staging

pc,pci,virtio fixes and cleanups

This includes pc and pci cleanups and enhancements,
and a virtio bugfix for level interrupts.

Signed-off-by: Michael S. Tsirkin <>

  1. gpg: Signature made Sun 01 Sep 2013 03:15:36 AM CDT using RSA key ID D28D5469...
fb17dfe0 08/30/2013 10:15 pm Andreas Färber

qdev: Pass size to qbus_create_inplace()

To be passed to object_initialize().

Since commit 39355c3826f5d9a2eb1ce3dc9b4cdd68893769d6 the argument is
void*, so drop some superfluous (BusState *) casts or direct parent
field usages.

Signed-off-by: Andreas Färber <>

dd301ca6 08/30/2013 09:14 pm Andreas Färber

pci: Pass size to pci_bus_new_inplace()

To be passed to qbus_create_inplace().

Reviewed-by: Wenchao Xia <>
Signed-off-by: Andreas Färber <>

9eda7d37 08/27/2013 08:30 am Alexey Kardashevskiy

pci: Introduce helper to retrieve a PCI device's DMA address space

A PCI device's DMA address space (possibly an IOMMU) is returned by a
method on the PCIBus. At the moment that only has one caller, so the
method is simply open coded. We'll need another caller for VFIO, so...

f055e96b 07/29/2013 09:44 pm Andreas Färber

pci-bridge: Turn PCIBridge into abstract QOM type

Introduce TYPE_PCI_BRIDGE as base type and use PCI_BRIDGE() casts.

Reviewed-by: Don Koch <>
Acked-by: Michael S. Tsirkin <>
[AF: Updated pbm-bridge parent to TYPE_PCI_BRIDGE]...

e9acb8ce 07/18/2013 04:12 pm Anthony Liguori

Merge remote-tracking branch 'mst/tags/for_anthony' into staging

pci,net,pc enhancements

This includes some fixes and enhancements that accumulated in my tree:
pci fixes by dkoch, virtio-net enhancements by akong and mst,
and a fix for xen pc by mst.

Signed-off-by: Michael S. Tsirkin <>...

e78e9ae4 07/10/2013 12:49 pm Don Koch

pci-bridge: update mappings for migration/restore

Fix for LP#1187529: Devices on PCI bridge stop working when
live-migrated. Update bridge mappings for all PCI bridge
devices in get_pci_config_device().

Signed-off-by: Don Koch <>
Signed-off-by: Michael S. Tsirkin <>

dc11549e 07/08/2013 04:00 pm Anthony Liguori

Merge remote-tracking branch 'mst/tags/for_anthony' into staging

pci,misc enhancements

This includes some pci enhancements:

Better support for systems with multiple PCI root buses
FW cfg interface for more robust pci programming in BIOS
Minor fixes/cleanups for fw cfg and cross-version migration -...

c473d18d 07/07/2013 11:10 pm David Gibson

pci: Use helper to find device's root bus in pci_find_domain()

Currently pci_find_domain() performs two functions - it locates the PCI
root bus above the given bus, then looks up that root bus's domain number.
This patch adds a helper function to perform the first task, finding the...

568f0690 07/07/2013 11:10 pm David Gibson

pci: Replace pci_find_domain() with more general pci_root_bus_path()

pci_find_domain() is used in a number of places where we want an id for a
whole PCI domain (i.e. the subtree under a PCI root bus). The trouble is
that many platforms may support multiple independent host bridges with no...

85c6e4fa 07/07/2013 11:10 pm David Gibson

pci: Add root bus argument to pci_get_bus_devfn()

pci_get_bus_devfn() interprets a full PCI address string to give a PCIBus *
and device/function number within that bus. Currently it assumes it is
working on an address under the primary PCI root bus. This patch extends...

29b358f9 07/07/2013 11:10 pm David Gibson

pci: Add root bus parameter to pci_nic_init()

At present, pci_nic_init() and pci_nic_init_nofail() assume that they will
only create a NIC under the primary PCI root. As we add support for
multiple PCI roots, that may no longer be the case. This patch adds a root...

9bc47305 07/07/2013 11:10 pm David Gibson

pci: Simpler implementation of primary PCI bus

Currently pci_find_primary_bus() searches the list of root buses for one
with domain 0. But since host buses are always registered with domain 0,
this just amounts to finding the only PCI host bus. The only remaining...

2b8cc89a 07/07/2013 11:10 pm David Gibson

pci: Remove domain from PCIHostBus

There are now no users of the domain field of PCIHostBus, so remove it
from the structure, and as a parameter from the pci_host_bus_register()
function which sets it.

Signed-off-by: David Gibson <>...

7588e2b0 07/07/2013 11:10 pm David Gibson

pci: Fold host_buses list into PCIHostState functionality

The host_buses list is an odd structure - a list of pointers to PCI root
buses existing in parallel to the normal qdev tree structure. This patch
removes it, instead putting the link pointers into the PCIHostState...

1ef7a2a2 07/07/2013 11:10 pm David Gibson

pci: Abolish pci_find_root_bus()

pci_find_root_bus() takes a domain parameter. Currently PCI root buses
with domain other than 0 can't be created, so this is more or less a long
winded way of retrieving the main PCI root bus. Numbered domains don't
actually properly cover the (non x86) possibilities for multiple PCI root...

40c5dce9 07/04/2013 06:42 pm Paolo Bonzini

hw/p*: pass owner to memory_region_init* functions

Signed-off-by: Paolo Bonzini <>

2c9b15ca 07/04/2013 06:42 pm Paolo Bonzini

memory: add owner argument to initialization functions

Signed-off-by: Paolo Bonzini <>

6ac363b5 07/04/2013 10:45 am David Gibson

pci: Move pci_read_devaddr to pci-hotplug-old.c

pci_read_devaddr() is only used by the legacy functions for the old PCI
hotplug interface in pci-hotplug-old.c. So we move the function there,
and make it static.

Signed-off-by: David Gibson <>...

df32fd1c 06/20/2013 05:39 pm Paolo Bonzini

dma: eliminate DMAContext

The DMAContext is a simple pointer to an AddressSpace that is now always
already available. Make everyone hold the address space directly,
and clean up the DMA API to use the AddressSpace directly.

Reviewed-by: Peter Maydell <>...

7dca8043 06/20/2013 05:39 pm Alexey Kardashevskiy

memory: give name to every AddressSpace

The "info mtree" command in QEMU console prints only "memory" and "I/O"
address spaces while there are actually a lot more other AddressSpace
structs created by PCI and VIO devices. Those devices do not normally
have names and therefore not present in "info mtree" output....

24addbc7 06/20/2013 05:32 pm Paolo Bonzini

dma: eliminate old-style IOMMU support

The translate function in the DMAContext is now always NULL.
Remove every reference to it.

Reviewed-by: Peter Maydell <>
Signed-off-by: Paolo Bonzini <>

e00387d5 06/20/2013 05:32 pm Avi Kivity

pci: use memory core for iommu support

Use the new iommu support in the memory core for iommu support. The only
user, spapr, is also converted, but it still provides a DMAContext
interface until the non-PCI bits switch to AddressSpace.

Reviewed-by: Michael S. Tsirkin <>...

fef7fbc9 06/07/2013 03:55 pm Andreas Färber

qdev: Drop FROM_QBUS() macro

Use QOM cast macros I2C_BUS(), SSI_BUS(), PCI_BUS() instead.

Signed-off-by: Andreas Färber <>

4f39178b 05/24/2013 07:42 pm Paolo Bonzini

exec: eliminate qemu_put_ram_ptr

Reviewed-by: Peter Maydell <>
Signed-off-by: Paolo Bonzini <>

3a861c46 03/26/2013 09:02 pm Alex Williamson

pci: Create and register a new PCI Express TypeInfo

This will allow us to differentiate Express and Legacy buses.

Signed-off-by: Alex Williamson <>
Signed-off-by: Michael S. Tsirkin <>

60a0e443 03/26/2013 09:02 pm Alex Williamson

pci: Allow PCI bus creation interfaces to specify the type of bus

No change to any types.

Signed-off-by: Alex Williamson <>
Signed-off-by: Michael S. Tsirkin <>

8c0bf9e2 03/26/2013 09:02 pm Alex Williamson

pci: Create pci_bus_is_express helper

For testing the bus type.

Signed-off-by: Alex Williamson <>
Signed-off-by: Michael S. Tsirkin <>

0889464a 03/26/2013 09:02 pm Alex Williamson

pci: Create and use API to determine root buses

Signed-off-by: Alex Williamson <>
Signed-off-by: Michael S. Tsirkin <>

ba7d8515 03/26/2013 09:02 pm Alex Williamson

pci: Teach PCI Bridges about VGA routing

Each PCI Bridge has a set of implied VGA regions that are enabled when
the VGA bit is set in the bridge control register. This allows VGA
devices behind bridges. Unfortunately with VGA Enable, which we
formerly allowed but didn't back, comes along some required VGA...

45eb768c 03/26/2013 09:02 pm Michael S. Tsirkin

pci_bridge: factor out common code

Reuse common code in pcie_port, override the hardwired-to-0
bits per PCI Express spec.
No functional change but makes the code easier to follow.

Signed-off-by: Michael S. Tsirkin <>

e5368f0d 03/26/2013 09:02 pm Alex Williamson

pci: Fix INTx routing notifier recursion

For some reason we recurse to fire the INTx routing notifier for each
child of a bus, for each possible device of a bus. That means that if
we add a root port, the notifier gets called for that bridge 256
times. If we add an upstream switch behind that root port, 256^2. But...

8c7f3dd0 03/26/2013 09:02 pm Stefan Hajnoczi

pci: refuse empty ROM files

A zero size ROM file is invalid and should produce a warning.
Attempting to use a zero size file ends up hitting an assertion
qemu_ram_set_idstr() because RAMBlocks with duplicate addresses are
allocated - due to zero size the allocator doesn't increment the next...

e01fd687 03/26/2013 09:02 pm Alex Williamson

pci: Add PCI VGA helpers

Allow devices to register VGA memory regions for handling PCI spec
defined VGA I/O port and MMIO areas. PCI will attach these to the
bus address spaces and enable them according to the device command
register value.

Signed-off-by: Alex Williamson <>...

312fd5f2 02/11/2013 04:13 pm Markus Armbruster

error: Strip trailing '\n' from error string arguments (again)

Commit 6daf194d and be62a2eb got rid of a bunch, but they keep coming
back. Tracked down with this Coccinelle semantic patch:

r
expression err, eno, cls, fmt;
position p;
@@
(...
4fec6404 02/01/2013 11:53 pm Paolo Bonzini

pci: use qbus_create in pci_bus_new

Remove knowledge of QOM innards. The common part of pci_bus_new and
pci_bus_new_inplace is moved to a new function pci_bus_init.

Acked-by: Andreas Färber <>
Signed-off-by: Paolo Bonzini <>...

8c43a6f0 01/10/2013 11:11 pm Andreas Färber

Make all static TypeInfos const

Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register all
types natively through QEMU Object Model), TypeInfo as used in
the common, non-iterative pattern is no longer amended with information
and should therefore be const....

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

83c9089e 12/19/2012 09:31 am Paolo Bonzini

monitor: move include files to include/monitor/

Signed-off-by: Paolo Bonzini <>

022c62cb 12/19/2012 09:31 am Paolo Bonzini

exec: move include files to include/exec/

Signed-off-by: Paolo Bonzini <>

1422e32d 12/19/2012 09:31 am Paolo Bonzini

net: reorganize headers

Move public headers to include/net, and leave private headers in net/.
Put the virtio headers in include/net/tap.h, removing the multiple copies
that existed. Leave include/net/tap.h as the interface for NICs, and
net/tap_int.h as the interface for OS-specific parts of the tap backend....

c759b24f 12/17/2012 01:02 pm Michael S. Tsirkin

pci: fix path for local includes

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 <>

06aac7bd 12/17/2012 01:02 pm Michael S. Tsirkin

pci: rename pci_internals.h pci_bus.h

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 <>

315a1350 12/17/2012 01:02 pm Michael S. Tsirkin

pci: move pci core code to hw/pci

Move files and modify makefiles to pick them at the
new location.

Signed-off-by: Michael S. Tsirkin <>