Statistics
| Branch: | Revision:

root / hw / pci.c @ 43ad7e3e

History | View | Annotate | Download (54.3 kB)

# Date Author Comment
a6a9239c 11/16/2010 04:40 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...

4cff0a59 11/16/2010 04:40 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 <>...

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

5a9ff381 09/13/2010 10:03 pm Isaku Yamahata

pci: sorting out type confusion in pci_register_bar().

This patch sorts out invalid use of pcibus_t.

In pci_register_bar(), pcibus_t wmask is used. It should,
however, be uint64_t because it is used to set
pci configuration space value(PCIDevice::wmask)...

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

ca77089d 09/07/2010 08:10 pm Isaku Yamahata

pci: consolidate pci_add_capability_at_offset() into pci_add_capability().

By making pci_add_capability() the special case of
pci_add_capability_at_offset() of offset = 0,
consolidate pci_add_capability_at_offset() into pci_add_capability().

Cc: Stefan Weil <>...

5beb8ad5 09/07/2010 08:10 pm Isaku Yamahata

pci: call hotplug callback even when not hotplug case for later use.

call hotplug callback even when not hotplug case for later use.
And move hotplug check into hotplug callback.
PCIE slot needs this for card presence detection.

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

43c945f1 09/07/2010 08:10 pm Isaku Yamahata

pci: make pci_parse_devfn() aware of func.

make pci_parse_devfn() aware of func. With func = NULL it behave as before.
This will be used later.

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

783753fd 07/22/2010 12:21 pm Isaku Yamahata

pci/bridge: split out pci bridge code into pci_bridge.c from pci.c

Move pci bridge related code into pci_bridge.c from pci.c
for further enhancement. pci.c is big enough now, so split it out.
No code change but exporting some accesser functions.

In fact, few pci bridge functions stays in pci.c....

cfb0a50a 07/19/2010 02:20 pm Isaku Yamahata

pci: move out pci internal structures, PCIBus, PCIBridge, and pci_bus_info.

move out pci internal structures, PCIBus, PCIBridge and pci_bus_info into
private header file, pci_internals.h.
This is a preparation. Later pci bridge implementation will be
split out form pci.c into pci_bridge.c....

a213ff63 07/11/2010 11:31 pm Isaku Yamahata

pci hotplug: make pci hotplug return value to caller

make pci hotplug callback return value to caller.
And when returning error, allocated resources are freed.

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

eb0557db 07/11/2010 11:31 pm Michael S. Tsirkin

pci: fix bridge update

bridge config write should trigger updates
on the secondary bus. never on the primary bus.

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

71ebd6dc 07/11/2010 11:14 pm Isaku Yamahata

pci: fix pci_device_reset

Clear interrupt disable bit on reset, according to PCI spec.
Fix pci_device_reset() with 64bit BAR.

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

6eab3de1 07/11/2010 08:01 pm Isaku Yamahata

pci: set PCI multi-function bit appropriately.

Set PCI multi-function bit according to multifunction property.
PCI address, devfn ,is exported to users as addr property,
so users can populate pci function(PCIDevice in qemu)
at arbitrary devfn.
It means each function(PCIDevice) don't know whether pci device...

7c7b829e 07/11/2010 08:01 pm Isaku Yamahata

pci_bridge: make pci bridge aware of pci multi function bit.

make pci bridge aware of pci multi function property and let pci generic
code to set the bit.

Cc: Blue Swirl <>
Signed-off-by: Isaku Yamahata <>
Signed-off-by: Blue Swirl <>

49823868 07/11/2010 08:00 pm Isaku Yamahata

pci: introduce multifunction property.

introduce multifunction property.
Also introduce new convenient device creation function which
will be used later.

For bisectability this patch doesn't do anything, but sets the property
resulting in no functional changes....

e327e323 07/11/2010 08:00 pm Isaku Yamahata

pci: remove PCIDeviceInfo::header_type

replace PCIDeviceInfo::header_type with is_bridge
as suggested by Michael S. Tsirkin <>

Signed-off-by: Isaku Yamahata <>
Signed-off-by: Blue Swirl <>

6fa84913 07/11/2010 08:00 pm Isaku Yamahata

pci: insert assert that auto-assigned-address function is single function device.

Auto-assigned-address pci function (passing devfn = -1) is always
single function.
This patch adds assert() to guarantee that auto-assigned-address function
is always single function device at function = 0....

4f43c1ff 07/06/2010 06:36 pm Alex Williamson

pci: Implement BusInfo.get_dev_path()

This works great for PCI since a <segment>:<bus>:<dev>.<fn> uniquely
describes a global address. No need to traverse up the qdev tree.
PCI segment support is a placeholder for compatibility once we
support multiple segments....

0be71e32 07/06/2010 06:36 pm Alex Williamson

savevm: Add DeviceState param

When available, we'd like to be able to access the DeviceState
when registering a savevm. For buses with a get_dev_path()
function, this will allow us to create more unique savevm
id strings.

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

1724f049 07/06/2010 06:36 pm Alex Williamson

qemu_ram_alloc: Add DeviceState and name parameters

These will be used to generate unique id strings for ramblocks. The name
field is required, the device pointer is optional as most callers don't
have a device. When there's no device or the device isn't a child of...

230741dc 07/06/2010 06:36 pm Alex Williamson

pci: Free the space allocated for the option rom on removal

Signed-off-by: Alex Williamson <>
Signed-off-by: Anthony Liguori <>

3709c1b7 06/14/2010 11:46 pm Daniel P. Berrange

Clarify error message when a PCI slot is already in use (v2)

When mistakenly configuring two devices in the same PCI slot,
QEMU gives a not entirely obvious message about a 'devfn' being
in use:

$ qemu -device rtl8139 -device virtio-balloon-pci,bus=pci.0,addr=0x3...

1bb65042 06/14/2010 11:46 pm Markus Armbruster

qdev: Revert the hack to let -net nic and pci_add set qdev ID

Setting the ID in pci_nic_init() is a blatant violation of the
DeviceState abstraction. Which even carries a comment advising
against this:

/* This structure should not be accessed directly. We declare it here...

637503d1 06/01/2010 09:48 pm Luiz Capitulino

Monitor: Drop QMP documentation from code

Previous commit added QMP documentation to the qemu-monitor.hx
file, it's is a copy of this information.

While it's good to keep it near code, maintaining two copies of
the same information is too hard and has little benefit as we...

e075e788 05/31/2010 04:39 pm Isaku Yamahata

pci-hotplug: make them aware of pci domain.

add helper function which converts root bus to pci domain.
make them aware of pci domain.

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

5e434f4e 05/31/2010 04:33 pm Isaku Yamahata

pci: clean up of pci_set_default_subsystem_id().

Use pci accessor function.
don't return value because it always return 0 and
the caller doesn't check the return value.

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

f7ce7287 05/17/2010 08:41 pm Anthony Liguori

Merge remote branch 'mst/for_anthony' into staging

87c30546 05/15/2010 07:26 pm Isaku Yamahata

pci hotplug: add argument to pci hot plug callback.

Add argument, DeviceState*, to pci hot plug callback.
The argument will be used later to remove global variable.

Signed-off-by: Isaku Yamahata <>
Acked-by: Gerd Hoffmann <>...

c3f8f611 05/12/2010 02:02 am Michael S. Tsirkin

pci: irq_state vmstate breakage

Code for saving irq_state got vm_state
macros wrong, passing in the wrong parameter.
As a result, we both saved a wrong value
and restored it to a wrong offset.

This leads to device and bus irq counts getting
out of sync, which in turn leads to interrupts getting lost or...

925fe64a 05/12/2010 01:59 am Alex Williamson

pci: cleanly backout of pci_qdev_init()

If the init function of a device fails, as might happen with device
assignment, we never undo the work done by do_pci_register_device().
This not only causes a bit of a memory leak, but also leaves a bogus
pointer in the bus devices array that can cause a segfault or...

470e6363 04/20/2010 08:15 pm Isaku Yamahata

pci: fix pci_find_bus().

When looking down child bus, it should look parent bridge's
bus number, not child bus's.
Optimized tail recursion and style fix.

Cc: Blue Swirl <>
Cc: "Michael S. Tsirkin" <>
Signed-off-by: Isaku Yamahata <>...

1db5a3aa 04/11/2010 07:37 pm Michael S. Tsirkin

pci: add API to add capability at a known offset

Unlike virtio, device emulations need to add pci capabilities
at known offsets to match real hardware. Make this possible
by adding an appropriate API.

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

1ecda02b 03/16/2010 05:58 pm Markus Armbruster

error: Replace qemu_error() by error_report()

error_report() terminates the message with a newline. Strip it it
from its arguments.

This fixes a few error messages lacking a newline:
net_handle_fd_param()'s "No file descriptor named %s found", and
tap_open()'s "vnet_hdr=1 requested, but no kernel support for...

b5937f29 02/13/2010 09:37 am Isaku Yamahata

pci: fix info pci with host bridge.

This patch fixes 525e05147d5a3bdc08caa422d108c1ef71b584b5.
pci host bridge doesn't have header type of bridge.
The check should be by header type, instead of pci class device.

Cc: Blue Swirl <>
Cc: "Michael S. Tsirkin" <>...

8fd5cf4b 02/08/2010 12:14 pm Isaku Yamahata

pci: fix pci_find_bus()

typo in c021f8e65f5009a5ab5711d9d5326fcab553ef1c.
comparison fix.

Cc: Blue Swirl <>
Cc: "Michael S. Tsirkin" <>
Signed-off-by: Isaku Yamahata <>
Signed-off-by: Michael S. Tsirkin <>

525e0514 02/06/2010 04:57 pm Blue Swirl

PCI: show also host bridge data in "info pci" output

Signed-off-by: Blue Swirl <>

c021f8e6 02/06/2010 11:20 am Blue Swirl

PCI: fix multiple bridge problems

When several PCI bridges were in use, monitor command "info pci" would
enter into infinite loop. Buses behind the bridge were not discoverable
because secondary and subordinate bus numbers were not used properly.
Other buses were not found because bus search terminated on first miss....

776e1bbb 01/26/2010 11:59 pm Blue Swirl

PCI: fix bridge configuration

PCI bridges' qdev info structures must indicate bridge header type,
otherwise critical bridge registers (esp. PCI_PRIMARY_BUS,
PCI_SECONDARY_BUS, PCI_SUBORDINATE_BUS) will not be writable.

Signed-off-by: Blue Swirl <>

163c8a59 01/26/2010 11:42 pm Luiz Capitulino

PCI: Convert pci_info() to QObject

The returned QObject is a QList of all buses. Each bus is
represented by a QDict, which has a key with a QList of all
PCI devices attached to it. Each device is represented by
a QDict.

As has happended to other complex conversions, it's hard to...

d5e4acf7 01/26/2010 11:42 pm Luiz Capitulino

PCI: do_pci_info(): PCI bridge devices support

This commit completes the do_pci_info() conversion to
QObject by adding support to PCI bridge devices.

This is done by recursively adding devices in the
"pci_bridge" key.

IMPORTANT: This code is being added separately because I could...

88169ddf 01/11/2010 09:41 pm Gerd Hoffmann

pci: allow loading roms via fw_cfg.

This patch adds a pci bus property 'rombar' which specifies whenever
the pci rom should be loaded via pci rom bar (default) or via fw_cfg.
The later can be used for compatibility with older qemu versions where
no pci rom bar is present....

ea3fdd5d 01/06/2010 03:16 pm Anthony Liguori

Merge remote branch 'mst/for_anthony' into staging

cf616802 12/27/2009 10:52 pm Blue Swirl

PCI: Fix bus address conversion

Pass physical addresses to map functions instead of PCI bus addresses.

Signed-off-by: Blue Swirl <>

c71b5b4a 12/25/2009 08:18 pm Blue Swirl

PCI: partially revert 2e01c8cf4b076b05013c87723e3fc710b50a0a7a

Bus address conversion was not correct.

Signed-off-by: Blue Swirl <>

2e01c8cf 12/25/2009 06:50 pm Blue Swirl

PCI: make pci_mem_base private

Make pci_mem_base private to PCIBus. Add a function to set it.

Signed-off-by: Blue Swirl <>

b8ba4176 12/23/2009 04:35 pm Isaku Yamahata

pci: remove PCIBus::config_reg.

PCIBus::config_reg isn't used anymore, so remove it.

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

3d09c490 12/23/2009 04:35 pm Isaku Yamahata

pci: s/PCI_SUBVENDOR_ID/PCI_SUBSYSTEM_VENDOR_ID/g

To match Linux PCI register definition,
rename PCI_SUBVENDOR_ID to PCI_SUBSYSTEM_VENDOR_ID.

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

a7b15a5c 12/23/2009 04:33 pm Michael S. Tsirkin

Revert "Revert "pci: interrupt disable bit support""

This reverts commit d587e0787153f0224a6140c5015609963ceaabfb.

c2039bd0 12/18/2009 07:26 pm Anthony Liguori

Support PCI based option rom loading

Currently, we preload option roms into the option rom space in memory. This
prevents DDIM from functioning correctly which severely limits the number
of roms we can support.

This patch introduces a pci_add_option_rom() which registers the...

8c52c8f3 12/18/2009 07:26 pm Gerd Hoffmann

pci romfiles: add property, add default to PCIDeviceInfo

This patch adds a romfile property to the pci bus. It allows to specify
a romfile to load into the rom bar of the pci device. The default value
comes from a new field in PCIDeviceInfo. The property allows to change...

d587e078 12/18/2009 07:26 pm Anthony Liguori

Revert "pci: interrupt disable bit support"

This reverts commit 0ea5709a32085f7d14901a09d12bd35f9b267607.

Per discussion with Michael Tsirkin, this is too risky for 0.12

Signed-off-by: Anthony Liguori <>

09e3acc6 12/12/2009 03:59 pm Gerd Hoffmann

pci: don't hw_error() when no slot is available.

Current PCI code will simply hw_error() and thus abort in case no free
PCI slot is available or the requested PCI slot is already in use by
another device. For the hotplug case this behavior is not acceptable....

d036bb21 12/07/2009 09:50 pm Michael S. Tsirkin

pci: prepare irq code for interrupt state

This rearranges code in preparation for interrupt state
implementation.
Changes:
- split up bus walk away from interrupt handling
into a subroutine
- change irq_state from an array to bitmask
- verify that irq_state values are 0 or 1 on load...

f9bf77dd 12/07/2009 09:50 pm Michael S. Tsirkin

pci: interrupt status bit implementation

interrupt status is a mandatory feature in PCI spec,
so devices must implement it to be spec compliant.

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

b6981cb5 12/07/2009 09:50 pm Michael S. Tsirkin

pci: interrupt disable bit support

Interrupt disable bit is mandatory in PCI spec.
Implement it to make devices spec compliant.

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

5084bca1 12/03/2009 06:04 pm Juan Quintela

pci: vmstate_register() already assign consecutive numbers starting at 0

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

d6318738 12/02/2009 04:57 pm Michael S. Tsirkin

pci: move apb specific stuff to apb_pci.c

pci code had a TODO to move apb specific
pci bridge initialization to apb_pci.
Implement this and remove the TODO.

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

88a95564 12/01/2009 05:52 pm Michael S. Tsirkin

pci: convert goto into scope in bridge_filter

goto into scope is evil. rearrange pci_bridge_filter
so that we always go to end of function on error.

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

d46636b8 12/01/2009 05:52 pm Isaku Yamahata

pci: pci bridge related clean up.

- fix bridge prefetchable memory accesser to check 64bit or not.
- use pcibus_t consistently instead mixing pcibus_t and uint64_t.

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

10c9c329 12/01/2009 05:52 pm Isaku Yamahata

pci: fix pci_config_get_io_base().

fix typo in pci_config_get_io_base().

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

b47b0706 12/01/2009 05:52 pm Isaku Yamahata

pci: remove magic number, 256 in pci.c

This patch replaces magic number, 256, with ARRAY_SIZE().

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

876a350d 12/01/2009 05:52 pm Michael S. Tsirkin

pci: split up up pci_update mappings

Split bar address math into a separate function.
In particular, this gets rid of an ugly forward goto
into scope that we have there.

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

ec503442 12/01/2009 05:52 pm Isaku Yamahata

pci: clean up of pci_update_mappings()

This patch converts r->size == 0 to !r_size.

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

3e21ffc9 12/01/2009 05:52 pm Isaku Yamahata

pci: clean up of pci_init_wmask().

This patch replaces for loop by memset in pci_init_wmask().

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

c34369d4 12/01/2009 05:51 pm Isaku Yamahata

pci: kill unnecessary included in pci.c

including pci_host.h isn't needed by pci.c.
This patch kills it.

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

c469e1dd 12/01/2009 05:51 pm Isaku Yamahata

pci: s/pci_find_host_bus/pci_find_root_bus/g

This patch renames pci_find_host_bus() to pci_find_root_bus()
as suggested by "Michael S. Tsirkin" <>.

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

070297d2 12/01/2009 05:51 pm Isaku Yamahata

pci: remove pci_sub_bus() by open coding.

Because pci_sub_bus() is used only once so eliminate it
by open coding as suggested by "Michael S. Tsirkin" <>.

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

f88d7509 12/01/2009 05:51 pm Isaku Yamahata

pci: fix pci_info_device().

It printed wrong limit value of bridge.
This patch fixes it.

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

c364c974 11/15/2009 04:30 pm Blue Swirl

PCI: make duplicate devfn allocation fatal

Only two callers of pci_create_simple/pci_register_device bothered
to check the return value. Other cases were prone to crashing with
spurious NULL pointer dereferences.

Make QEMU exit with an error message when devfn is attempted to...

91011d4f 11/14/2009 02:14 am Stefan Weil

pci: Fix function pci_default_write_config

Change 260c0cd3d985e51b15870ff47e17b7b930efbda1
(pci: use range helper functions) introduced a
bug which made pci cirrus vga on mips malta
(and maybe other pci devices) fail.

Don't change addr - its original value is needed...

dbe73d7f 11/12/2009 07:23 pm Juan Quintela

pci: fix the conversion of config field from array to pointer

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

260c0cd3 11/09/2009 04:43 pm Isaku Yamahata

pci: use range helper functions.

clean up pci_default_write_config() by the range helper functions.

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

edb00035 11/09/2009 04:43 pm Isaku Yamahata

pci: teach pci_default_config_write() ROM bar for normal/bridge device .

When updated ROM expantion address of header type 0, it missed
to update mappings.
Add PCI_ROM_ADDRESS check whether to call pci_update_mappings()
Also update pci mapping when PCI_ROM_ADDRESS1 is written for header type 1....

fb231628 11/09/2009 04:43 pm Isaku Yamahata

pci: initialize pci config headers depending it pci header type.

- Only sets default subsystem id for header type 00.(normal header type)
because header type 01 doesn't have subsystem id, and uses the register
for other purpose. So setting default subsystem id doesn't make sense....

a9688570 11/09/2009 04:43 pm Isaku Yamahata

pci: cosmetic on pci_upadte_mappings()

Remove one indentation of pci_update_mappings.
Just for cosmetics, no logic change.

Signed-off-by: Isaku Yamahata <>
Signed-off-by: Anthony Liguori <>

1074df4f 11/09/2009 04:43 pm Isaku Yamahata

pci: factor out pci_for_each_device().

split out device iteration logic from pci_for_each_device().
factored out function, pci_for_each_device_under_bus() will be used later.

Signed-off-by: Isaku Yamahata <>
Signed-off-by: Anthony Liguori <>

a0c7a97e 11/09/2009 04:43 pm Isaku Yamahata

pci: implement pci bridge filtering.

This patch implements pci bridge filtering.

TODO: currently almost all the map funcions assumes
filtered_size size and addr & ~(size - 1) addr.
However with bridge filtering, they aren't always true.
Teach them such cases, such that filtered_size < size and...

b4dccd8d 11/09/2009 04:43 pm Isaku Yamahata

pci/monitor: print out bridge's filtering values and so on.

make pci_info_device() print out bridge's filtering value like
io base/limit, subbus and subordinate bus.

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

14421258 11/09/2009 04:43 pm Isaku Yamahata

pci: 64bit bar support.

implemented pci 64bit bar support.
The tricky bit is pci_update_mapping().
An OS is allowed to set the BAR such that OS can't address the area
pointed by BAR. It doesn't make sense, though.
In that case, don't map the BAR.

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

e94ff650 11/09/2009 04:43 pm Isaku Yamahata

pci: remove bus_num member from struct PCIBus.

Since It can be retrieved from pci configuration space,
the member is unnecessary.

Signed-off-by: Isaku Yamahata <>
Signed-off-by: Anthony Liguori <>

e822a52a 11/09/2009 04:43 pm Isaku Yamahata

pci: make pci configuration transaction more accurate.

This patch sorts out/enhances pci code to track pci bus topology
more accurately.
- Track host bus bridge with pci domain number. Although the
current qemu implementation supports only pci domian 0 yet....

74e32ac1 11/09/2009 04:43 pm Isaku Yamahata

pci: factor out the conversion logic from io port address into pci device.

factor out the logic which converts io port address into pci device
and offset in PCI configuration space.

Signed-off-by: Isaku Yamahata <>
Signed-off-by: Anthony Liguori <>

766347cc 11/09/2009 04:43 pm Isaku Yamahata

pci: move pci host stuff from pci.c to pci_host.c

Move pci host stuff from pci.c to pci_host.c.
And add some comments.
Later pcie host bridge functions will be defined in pcie_host.c
not to bloat pci.c.

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

a9f49946 11/09/2009 04:43 pm Isaku Yamahata

pci: pcie host and mmcfg support.

This patch adds common routines for pcie host bridge and pcie mmcfg.
This will be used by q35 based chipset emulation.

Signed-off-by: Isaku Yamahata <>
Signed-off-by: Anthony Liguori <>

6e355d90 11/09/2009 04:43 pm Isaku Yamahata

pci: introduce pcibus_t to represent pci bus address/size instead of uint32_t

This patch is preliminary for 64 bit BAR support.
Introduce dedicated type, pcibus_t, to represent pci bus address/size
instead of uint32_t.
Later this type will be changed to uint64_t....

89e8b13c 11/09/2009 04:43 pm Isaku Yamahata

pci: introduce FMT_PCIBUS for printf format for pcibus_t.

This patch is preliminary for 64bit BAR.
Later pcibus_t will be changed from uint32_t to uint64_t.
Introduce FMT_PCIBUS for printf format for pcibus_t.

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

4f8589e1 11/09/2009 04:43 pm Isaku Yamahata

pci: typedef pcibus_t as uint64_t instead of uint32_t.

This patch is preliminary for 64bit bar.
For 64bit bar support, change pcibus_t which represents
pci bus addr/size from uint32_t to uint64_t.
And also change FMT_pcibus for printf.

In pci_update_mapping() checks 32bit overflow....

0392a017 11/09/2009 04:43 pm Isaku Yamahata

pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.h

make constants for pci base address match pci_regs.h by
renaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx.

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

5029fe12 11/09/2009 04:43 pm Isaku Yamahata

pci: clean up of pci_default_read_config.

This patch cleans up pci_default_read_config() removing
ugly length and range check.

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

b3b11697 11/09/2009 04:43 pm Isaku Yamahata

pci: make pci_bar() aware of header type 1.

make pci_bar() aware of header type 1. When PCI_ROM_SLOT
it should return PCI_ROM_ADDRESS1 (!= PCI_ROM_ADDRESS)

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

67a51b48 11/09/2009 04:43 pm Isaku Yamahata

pci: clean up pci_init_wmask()

use pci_set_word() for pci command register.

Signed-off-by: Isaku Yamahata <>
Signed-off-by: Anthony Liguori <>