Statistics
| Branch: | Revision:

root / hw / pci.c @ 3871481c

History | View | Annotate | Download (60.6 kB)

# Date Author Comment
5fa45de5 06/28/2012 12:33 am David Gibson

iommu: Allow PCI to use IOMMU infrastructure

This patch adds some hooks to let PCI devices and busses use the new IOMMU
infrastructure. When IOMMU support is enabled, each PCI device now
contains a DMAContext * which is used by the pci_dma_*() wrapper functions....

7aa8cbb9 06/21/2012 07:06 pm Anthony PERARD

pci.c: Add opaque argument to pci_for_each_device.

The purpose is to have a more generic pci_for_each_device by passing an extra
argument to the function called on every device.

This patch will be used in a next patch.

Signed-off-by: Anthony PERARD <>...

8aca5215 06/18/2012 06:35 pm Anthony Liguori

Merge remote-tracking branch 'afaerber-or/qom-next-2' into staging

  • afaerber-or/qom-next-2: (22 commits)
    qom: Push error reporting to object_property_find()
    qdev: Remove qdev_prop_exists()
    qbus: Initialize in standard way
    qbus: Make child devices links...
df6606f4 06/18/2012 06:18 pm Anthony Liguori

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

  • mst/tags/for_anthony:
    pci_bridge_dev: fix error path in pci_bridge_dev_initfn()
    qdev: release parent properties on dc->init failure
    msi: Use msi/msix_present more consistently
    msi: Invoke msi/msix_write_config from PCI core...
0d936928 06/18/2012 04:14 pm Anthony Liguori

qdev: Convert busses to QEMU Object Model

This is far less interesting than it sounds. We simply add an Object to each
BusState and then register the types appropriately. Most of the interesting
refactoring will follow in the next patches.

Since we're changing fundamental type names (BusInfo -> BusClass), it all needs...

3cb75a7c 06/18/2012 04:14 pm Paolo Bonzini

qdev: Move bus properties to a separate global

Simple code movement in order to simplify future refactoring.

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

bce54474 06/18/2012 04:14 pm Paolo Bonzini

qdev: Move bus properties to abstract superclasses

In qdev, each bus in practice identified an abstract superclass, but
this was mostly hidden. In QOM, instead, these abstract classes are
explicit so we can move bus properties there.

All bus property walks are removed, and all device property walks...

09f1bbcd 06/08/2012 05:11 pm Michael Roth

qdev: Use int32_t container for devfn property

Valid range for devfn is -1 to 255 (-1 for automatic assignment). We do
not currently validate this due to devfn being stored as a uint32_t.
This can lead to segfaults and other strange behavior.

We could technically just cast it to int32_t to implement the checking,...

cbd2d434 06/07/2012 05:19 pm Jan Kiszka

msi: Invoke msi/msix_reset from PCI core

There is no point in pushing this burden to the devices, they tend to
forget to call them (like intel-hda, ahci, xhci did). Instead, reset
functions are now called from pci_device_reset. They do nothing if
MSI/MSI-X is not in use....

95d65800 06/07/2012 05:19 pm Jan Kiszka

msi: Invoke msi/msix_write_config from PCI core

Also this functions is better invoked by the core than by each and every
device. This allows to drop the config_write callbacks from ich and
intel-hda.

CC: Alexander Graf <>
CC: Gerd Hoffmann <>...

a6de8ed8 05/30/2012 04:19 am Amos Kong

pci: call object_unparent() before free_qdev()

Start VM with 8 multiple-function block devs, hot-removing
those block devs by 'device_del ...' would cause qemu abort.

| (qemu) device_del virti0-0-0 | (qemu) ** |ERROR:qom/object.c:389:object_delete: assertion failed: (obj->ref == 0)...

4e1957ac 04/10/2012 04:21 pm Anthony Liguori

Merge commit 'ff71f2e8cacefae99179993204172bc65e4303df' into staging

  • commit 'ff71f2e8cacefae99179993204172bc65e4303df': (21 commits)
    rtl8139: do the network/host communication only in normal operating mode
    rtl8139: correctly check the opmode
    net: move compute_mcast_idx() to net.h...
e5ab1404 03/16/2012 08:17 pm Anthony Liguori

pci: fix double free of romfile property

The qdev property release function frees any string properties. This was
resulting in a double free during hot unplug.

It manifests in network devices because block devices have a NULL romfile
property by default....

15ab7a75 03/16/2012 12:41 am Michael S. Tsirkin

pci: set memory type for memory behind the bridge

As we make upper bits in IO and prefetcheable memory
registers writeable, we should declare support
for 64 bit prefetcheable memory and 32 bit io
in the bridge.

This changes the default for apb, dec, but I'm guessing...

68917102 03/16/2012 12:41 am Michael S. Tsirkin

pci: fix bridge IO/BASE

commit 5caef97a16010f818ea8b950e2ee24ba876643ad introduced
a regression: we do not make IO base/limit upper 16
bit registers writeable, so we should report a 16 bit
IO range type, not a 32 bit one.
Note that PCI_PREF_RANGE_TYPE_32 is 0x0, but PCI_IO_RANGE_TYPE_32 is 0x1....

fdba4878 03/15/2012 05:04 pm Anthony PERARD

pci: Do not check if a bus exist in pci_parse_devaddr.

Actually, pci_parse_devaddr checks if the dom/bus of the PCI address exist. But
this should be the jobs of a caller. In fact, the two callers of this function
will try to retrieve the PCIBus related to the devaddr and return an error if...

94a09e2c 03/15/2012 05:04 pm Michael S. Tsirkin

pci: don't export an internal function

Make an internal function, pci_parse_devaddr,
static.

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

d662210a 03/15/2012 05:04 pm Michael S. Tsirkin

pci: make another unused extern function static

Make pci_find_bus static and rename to pci_find_bus_nr to match
functionality.

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

d5f27e88 02/22/2012 05:02 pm Michael S. Tsirkin

pci: set memory type for memory behind the bridge

As we make upper bits in IO and prefetcheable memory
registers writeable, we should declare support
for 64 bit prefetcheable memory and 32 bit io
in the bridge.

This changes the default for apb, dec, but I'm guessing...

83f7d43a 02/15/2012 05:39 pm Andreas Färber

qom: Unify type registration

Replace device_init() with generalized type_init().

While at it, unify naming convention: type_init([$prefix_]register_types)
Also, type_init() is a function, so add preceding blank line where
necessary and don't put a semicolon after the closing brace....

57c9fafe 02/03/2012 06:41 pm Anthony Liguori

qom: move properties from qdev to object

This is mostly code movement although not entirely. This makes properties part
of the Object base class which means that we can now start using Object in a
meaningful way outside of qdev.

Signed-off-by: Anthony Liguori <>

39bffca2 02/03/2012 06:41 pm Anthony Liguori

qdev: register all types natively through QEMU Object Model

This was done in a mostly automated fashion. I did it in three steps and then
rebased it into a single step which avoids repeatedly touching every file in
the tree.

The first step was a sed-based addition of the parent type to the subclass...

d307af79 02/03/2012 06:41 pm Anthony Liguori

qdev: kill off DeviceInfo

It is no longer used in the tree since everything is done natively through
QEMU Object Model.

Signed-off-by: Anthony Liguori <>

6e008585 02/03/2012 06:41 pm Anthony Liguori

qdev: remove info from class

Now DeviceInfo is no longer used after object construction. All of the
relevant members have been moved to DeviceClass.

Signed-off-by: Anthony Liguori <>

4be9f0d1 02/03/2012 06:41 pm Anthony Liguori

qdev: make DeviceInfo private

Introduce accessors and remove any code that directly accesses DeviceInfo
members.

Signed-off-by: Anthony Liguori <>

40021f08 01/27/2012 06:50 pm Anthony Liguori

pci: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <>

f79f2bfc 01/27/2012 06:50 pm Anthony Liguori

qdev: don't access name through info

We already have a QOM interface for this so let's use it.

Signed-off-by: Anthony Liguori <>

30fbb9fc 01/27/2012 06:50 pm Anthony Liguori

qdev: move qdev->info to class

Right now, DeviceInfo acts as the class for qdev. In order to switch to a
proper ObjectClass derivative, we need to ween all of the callers off of
interacting directly with the info pointer.

Signed-off-by: Anthony Liguori <>

6fc4925b 01/27/2012 06:28 pm Anthony Liguori

pci: call reset unconditionally

Because now all PCI devices are converted to qdev.

Signed-off-by: Anthony Liguori <>

a369da5f 01/22/2012 09:27 am Blue Swirl

vga: improve VGA logic

Improve VGA selection logic, push check for device availabilty to vl.c.
Create the devices at board level unconditionally.

Remove now unused pci_try_create*() functions.

Make PCI VGA devices optional.

Reviewed-by: Jan Kiszka <>...

c5705a77 01/04/2012 01:34 pm Avi Kivity

vmstate, memory: decouple vmstate from memory API

Currently creating a memory region automatically registers it for
live migration. This differs from other state (which is enumerated
in a VMStateDescription structure) and ties the live migration code
into the memory core....

79627472 10/27/2011 04:48 pm Luiz Capitulino

qapi: Convert query-pci

This also fixes a bug with the old version: QMP would invert device id
and vendor id. This would look ok on HMP because it was printing
"device:vendor" instead of "vendor:device".

Signed-off-by: Anthony Liguori <>...

8b881e77 10/17/2011 04:59 pm Avi Kivity

pci: simplify memory region registration

The two code paths (for ADDRESS_SPACE_IO and ADDRESS_SPACE_MEM) are
identical. Unify them.

Signed-off-by: Avi Kivity <>

e11d6439 09/25/2011 02:57 pm Richard Henderson

pci: add pci_address_space_io()

Returns the I/O address space. Useful for implementing
PCI-ISA bridge devices.

Signed-off-by: Richard Henderson <>
Signed-off-by: Avi Kivity <>

7df32ca0 09/19/2011 09:22 pm Michael S. Tsirkin

pci: implement bridge filtering

Support bridge filtering on top of the memory
API as suggested by Avi Kivity:

Create a memory region for the bridge's address space. This region is
not directly added to system_memory or its descendants. Devices under
the bridge see this region as its pci_address_space(). The region is...

ab346bb2 09/19/2011 09:22 pm Jan Kiszka

pci: Remove unused pci_reserve_capability

eepro100 was the last user. Now pci_add_capability is powerful enough.

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

f64e02b6 09/10/2011 05:56 pm Blue Swirl

PCI: delete unused mem_base and pci_to_cpu_addr

Signed-off-by: Blue Swirl <>

c9abe111 08/24/2011 03:52 pm Jan Kiszka

pci: Error on PCI capability collisions

Nothing good can happen when we overlap capabilities. This may happen
when plugging in assigned devices or when devices models contain bugs.
Detect the overlap and report it.

Based on qemu-kvm commit by Alex Williamson....

f5e6fed8 08/22/2011 06:47 pm Avi Kivity

pci: add pci_address_space()

Returns the PCI address space. Useful for bridges that can obscure
part of the PCI address space.

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

03952339 08/08/2011 06:22 pm Avi Kivity

pci: remove support for pre memory API BARs

Not used anymore.

Reviewed-by: Richard Henderson <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

fa6c6065 08/08/2011 06:22 pm Avi Kivity

pci: remove pci_register_bar_simple()

Superceded by pci_register_bar_region().

Reviewed-by: Richard Henderson <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

14caaf7f 08/08/2011 06:22 pm Avi Kivity

pci: convert pci rom to memory API

Reviewed-by: Richard Henderson <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

cfc0be25 08/08/2011 06:22 pm Avi Kivity

pci: remove pci_register_bar()

Superceded by pci_register_bar_region(). The implementations
are folded together.

Reviewed-by: Richard Henderson <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>...

50181f10 08/08/2011 06:22 pm Avi Kivity

pci: fold BAR mapping function into its caller

There is only one function, so no need for a function pointer.

Reviewed-by: Richard Henderson <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

e824b2cc 08/08/2011 06:22 pm Avi Kivity

pci: rename pci_register_bar_region() to pci_register_bar()

Reviewed-by: Richard Henderson <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

aee97b84 08/08/2011 06:15 pm Avi Kivity

pci: pass I/O address space to new PCI bus

This lets us register BARs in the I/O address space.

Reviewed-by: Richard Henderson <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

5968eca3 08/08/2011 06:15 pm Avi Kivity

pci: allow I/O BARs to be registered with pci_register_bar_region()

Reviewed-by: Richard Henderson <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

16a96f28 08/08/2011 06:15 pm Avi Kivity

pci: add API to get a BAR's mapped address

Some (hacky) devices that have a back-channel to read this
address back outside the normal configuration mechanisms, such
as VMware svga.

Reviewed-by: Richard Henderson <>
Signed-off-by: Avi Kivity <>...

81e34a24 08/05/2011 01:15 am Anthony Liguori

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

1e39101c 07/29/2011 04:25 pm Avi Kivity

pci: pass address space to pci bus when created

This is now done sloppily, via get_system_memory(). Eventually callers
will be converted to stop using that.

Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

79ff8cb0 07/29/2011 04:25 pm Avi Kivity

pci: add MemoryRegion based BAR management API

Allow registering a BAR using a MemoryRegion. Once all users are converted,
pci_register_bar() and pci_register_bar_simple() will be removed.

Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>...

42e4126b 07/27/2011 10:57 am Jan Kiszka

pci: Common overflow prevention

Introduce pci_config_read/write_common helpers to prevent passing
accesses down the callback chain that go beyond the config space limits.
Adjust length assertions as they are no longer correct (cutting may
generate valid 3 byte accesses)....

c2afc922 06/15/2011 06:32 pm Isaku Yamahata

pci: don't call qdev pci init method

As pci id initialization is moved to common layer,
some initialization function can be empty.
So don't call init method if NULL.

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

befeac45 06/15/2011 06:27 pm Michael S. Tsirkin

Merge remote-tracking branch 'origin/master' into pci

Conflicts:
hw/virtio-pci.c

113f89df 06/12/2011 10:33 am Isaku Yamahata

pci: move ids of config space into PCIDeviceInfo

vender id/device id... in configuration space are read-only registers
which are commonly defined for all pci devices.
So move those initialization into common place.

Signed-off-by: Isaku Yamahata <>...

711c2128 05/12/2011 04:08 pm Anthony Liguori

Merge remote-tracking branch 'stefanha/trivial-patches' into staging

Conflicts:
cpu-all.h

8c12f191 05/08/2011 11:10 am John Baboval

pci: Use of qemu_put_ram_ptr in pci_add_option_rom.

Prevent a deadlock caused by leaving a map cache bucket locked by the
preceding qemu_get_ram_ptr() call.

Signed-off-By: John Baboval <>
Signed-off-by: Anthony PERARD <>...

ebabb67a 05/06/2011 10:19 am Stefan Weil

Fix typo in code and comments

Replace writeable -> writable

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

602ef4d9 05/05/2011 04:11 pm Jan Kiszka

pci: Add class 0x403 as 'audio controller'

Used by HD audio controllers like our intel-hda.

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

17cbcb0b 04/07/2011 01:56 pm Avi Kivity

pci: add pci_register_bar_simple() API

This is similar to pci_register_bar(), but automatically registers a single
memory region spanning the entire BAR.

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

9ddf8437 04/01/2011 03:53 pm Isaku Yamahata

pci: add accessor function to get irq levels

Introduce accessor function to know INTx levels.
It will be used later by q35.
Although piix_pci tracks the intx line levels, it can be eliminated
by this helper function.

Cc: Michael S. Tsirkin <>...

5256d8bf 03/28/2011 07:34 pm Isaku Yamahata

pci: use devfn for pci_find_device() instead of (slot, fn) pair

(slot, fn) pair is somewhat confusing because of ARI.
So use devfn for pci_find_device() instead of (slot, fn).

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

6ff534b6 03/28/2011 07:34 pm Isaku Yamahata

pci: use PCI_DEVFN in pci_get_bus_devfn()

Replace hardcoded logic by a common macro.

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

6f3279b5 03/28/2011 07:34 pm Isaku Yamahata

pci: use uint8_t for devfn_min

use uint8_t for devfn_min instead of int.

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

386bbf45 02/20/2011 07:23 pm Stefan Weil

pci: Fix memory leak

Signed-off-by: Stefan Weil <>
Signed-off-by: Aurelien Jarno <>

7cc050b1 02/12/2011 10:27 am Blue Swirl

pci: add creation functions that may fail

Signed-off-by: Blue Swirl <>

4c900518 01/27/2011 06:55 am Isaku Yamahata

pci: typo in pcibus_get_dev_path()

This patch fixes typo in pcibus_get_dev_path().
Without this patch, the result of pcibus_get_dev_path() isn't unique.

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

bb34007e 01/27/2011 06:54 am Michael S. Tsirkin

pci: bridge control fixup

PCI_BRIDGE_CTL_DISCARD_STATUS (bit 10 in bridge control register)
is W1C so we should not make it writeable, otherwise the assert(!(wmask
& w1cmask)) in pci_default_write_config() is hit

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

be7052c2 01/24/2011 03:40 pm Isaku Yamahata

pci: memory leak of PCIDevice::rom_file

PCIDevice::rom_file is leaked.
PCIDevice::rom_file is allocated in pci_qdev_init(), but not freed anywhere.
free it in qemu_unregister_device().

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

e10990c3 01/20/2011 03:44 pm Isaku Yamahata

pci: use qemu_malloc() in pcibus_get_dev_path()

use qemu_malloc() instead of direct use of malloc().

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

4c92325b 01/20/2011 03:33 pm Isaku Yamahata

pci: deassert intx on reset.

deassert intx on device reset.
So far pci_device_reset() is used for system reset.
In that case, interrupt controller is reset at the same time so that
all irq is are deasserted.
But now pci bus reset/flr is supported, and in that case irq needs to be...

2991181a 01/19/2011 09:18 pm Michael S. Tsirkin

pci: fix device paths

Patch a6a7005d14b3c32d4864a718fb1cb19c789f58a5 generated
broken device paths. We snprintf with a length shorter
than the output, so the last character is discarded and replaced
by the null byte. Fix it up by snprintf to a buffer
which is larger by 1 byte and then memcpy the data (without...

180c22e1 01/10/2011 01:29 pm Gerd Hoffmann

pci: allow devices being tagged as not hotpluggable.

This patch adds a field to PCIDeviceInfo to tag devices as being
not hotpluggable. Any attempt to plug-in or -out such a device
will throw an error.

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

a6a7005d 12/27/2010 11:21 am Michael S. Tsirkin

pci: fix migration path for devices behind bridges

The device path used for migration is currently broken for
for all devices behind a nested bridge.

Replace this by a hierarchical list of slot/function numbers, walking
the path from root down to device. Add :00 after the domain number...

f3006dd1 12/24/2010 10:35 am Isaku Yamahata

pci: introduce a helper function to convert qdev id to PCIDevice

This patch introduce a helper function to get PCIDevice from qdev id.
This function will be used later.

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

0ead87c8 12/22/2010 09:01 am Isaku Yamahata

pcie: add flr support

Support flr: trigger device reset on flr config write.

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

af0669f0 12/19/2010 02:06 pm Michael S. Tsirkin

pci: don't use bus number in migration, stub out

Using bus numbers in migration is clearly wrong as
they are guest assigned. Not really sure what the
right thing to do is, for now stick 0 in there so things
keep working for non-nested setups, add a TODO....

b254b0d1 12/17/2010 04:21 pm Anthony Liguori

Merge remote branch 'mst/for_anthony' into staging

2e55e842 12/11/2010 11:32 pm Gleb Natapov

Add bootindex for option roms.

Extend -option-rom command to have additional parameter ,bootindex=.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Blue Swirl <>

5e0259e7 12/11/2010 11:32 pm Gleb Natapov

Add get_fw_dev_path callback for pci bus.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Blue Swirl <>

4a9dd665 12/09/2010 12:48 pm Michael S. Tsirkin

pci: untangle pci/msi dependency

msi depends on pci but pci should not depend on msi.
The only dependency we have is a recent addition
of pci_msi_ functions, IMO they add little enough to
open-code in the small number of users.

Follow-up patches add more cleanups....

b1aeb926 12/09/2010 12:47 pm Isaku Yamahata

pci: make command SERR bit writable

pcie aer needs SERR bit to be writable, and the PCI spec requires
this as well. For compatibility, introduce compat global property
command_serr_enable and make this bit readonly for a pre 0.14 pc
machine.

Signed-off-by: Isaku Yamahata <>...

929176c3 11/24/2010 05:04 pm Michael S. Tsirkin

pci: fix bus walk under secondary bus reset

Take into account secondary bus reset bit for
bus walk: devices behind a reset bus should not
respond to configuration cycles.

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

ab85ceb1 11/22/2010 10:00 am Stefan Weil

pci: Automatically patch PCI vendor id and device id in PCI ROM

PCI devices with different vendor or device ids sometimes share
the same rom code. Only the ids and the checksum
differs in a boot rom for such devices.

The i825xx ethernet controller family is a typical example...

9bb33586 11/22/2010 10:00 am Isaku Yamahata

pci: use qdev reset framework for pci bus reset

Signed-off-by: Isaku Yamahata <>
Signed-off-by: Anthony Liguori <>
Signed-off-by: Michael S. Tsirkin <>

89d437df 11/22/2010 10:00 am Isaku Yamahata

pci: add W1C bits to pci status register

This patch adds W1C bit support in the initialization/reset of pci
status registers.

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

f6bdfcc9 11/22/2010 10:00 am Michael S. Tsirkin

pci: fix bridge control bit wmask

Bits 12 to 15 in bridge control register are reserver and must be
read-only zero, curent mask is 0xffff which makes them writeable. Fix
this up by using symbolic bit names for writeable bits instead of a
hardcoded constant....

e927d487 11/16/2010 02:55 pm Michael S. Tsirkin

pci: allow hotplug removal of cold-plugged devices

This patch fixes hot unplug of cold plugged devices
(those present at system start), which got broken by
5beb8ad503c88a76f2b8106c3b74b4ce485a60e1 .

Signed-off-by: Isaku Yamahata <>...

7f5feab4 11/16/2010 02:53 pm Alex Williamson

PCI: Bus number from the bridge, not the device

pcibus_dev_print() was erroneously retrieving the device bus
number from the secondary bus number offset of the device
instead of the bridge above the device. This ends of landing
in the 2nd byte of the 3rd BAR for devices, which thankfully...

b907b69d 10/27/2010 08:07 pm Michael S. Tsirkin

Merge branch 'pci' into for_anthony

f9aebe2e 10/27/2010 08:01 pm Michael S. Tsirkin

pci: improve w1c mask handling

- save/restore must not check w1c bits
since they are in fact guest controlled
- clear w1c bits on reset

Note: for express there are different kinds of
reset, some leave part of config space alone.
We will likely need a sticky bit mask to implement this....

99443c21 10/19/2010 02:57 pm Isaku Yamahata

pci: use pci_word_test_and_clear_mask() in pci_device_reset()

use pci_clear_bit_word() in pci_device_reset() where appropriate.

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

a5d1fd20 10/19/2010 02:57 pm Isaku Yamahata

pci: introduce helper function to handle msi-x and msi.

this patch implements helper functions to handle msi-x and msi
uniformly.
They will be used later.

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

1a4f5971 10/18/2010 09:07 am Isaku Yamahata

pci: make pci_del_capability() update for w1cmask

Clear w1cmask when deleting a pci capability.

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

b0cd712c 10/05/2010 09:53 pm Stefan Weil

Fix spelling in comments

multifuction -> multifunction
successfull -> successful.

Signed-off-by: Stefan Weil <>

92ba5f51 09/20/2010 09:10 pm Isaku Yamahata

pci: implement RW1C register framework.

Implement RW1C register framework.
With this patch, it would be easy to implement
W1C register by just setting w1cmask.
Later RW1C register will be used by pcie.

Signed-off-by: Isaku Yamahata <>...

bf1b0071 09/18/2010 08:53 am Blue Swirl

Introduce range.h

Extract range functions from pci.h. These will be used by later patches
by non-PCI devices. Adjust current users.

Signed-off-by: Blue Swirl <>

2bbb9c2f 09/13/2010 10:03 pm Isaku Yamahata

pci: don't ignore invalid parameter for pci_register_bar().

Abort when invalid value for region_num is passed to pci_register_bar.
That is caller's bug. Abort instead of silently ignoring invalid value.

Signed-off-by: Isaku Yamahata <>...

0bb750ef 09/13/2010 10:03 pm Isaku Yamahata

pci: improve signature of pci_register_bar().

Make type uint8_t from int because PCIIORegion::type is uint8_t.

Signed-off-by: Isaku Yamahata <>