History | View | Annotate | Download (16.7 kB)
msix: track function masked in pci device state
Only go over the table when function is masked.This is not really important for qemu.git but helpsfix a bug in qemu-kvm.git.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add stub functions for PCI device models to do PCI DMA
This patch adds functions to pci.[ch] to perform PCI DMA operations.At present, these are just stubs which perform directly cpu physicalmemory accesses. Stubs are included which are analogous tocpu_physical_memory_{read,write}(), the stX_phys() and ldX_phys()...
qapi: Convert query-pci
This also fixes a bug with the old version: QMP would invert device idand vendor id. This would look ok on HMP because it was printing"device:vendor" instead of "vendor:device".
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
pci: add pci_address_space_io()
Returns the I/O address space. Useful for implementingPCI-ISA bridge devices.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Avi Kivity <avi@redhat.com>
pci: implement bridge filtering
Support bridge filtering on top of the memoryAPI as suggested by Avi Kivity:
Create a memory region for the bridge's address space. This region isnot directly added to system_memory or its descendants. Devices underthe bridge see this region as its pci_address_space(). The region is...
pci: Remove unused pci_reserve_capability
eepro100 was the last user. Now pci_add_capability is powerful enough.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
PCI: delete unused mem_base and pci_to_cpu_addr
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
pci: add pci_address_space()
Returns the PCI address space. Useful for bridges that can obscurepart of the PCI address space.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
msix: convert to memory API
The msix table is defined as a subregion, to allow for a BAR thatmixes device specific regions with the msix table.
Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>...
pci: remove pci_register_bar_simple()
Superceded by pci_register_bar_region().
Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: convert pci rom to memory API
pci: remove pci_register_bar()
Superceded by pci_register_bar_region(). The implementationsare folded together.
pci: fold BAR mapping function into its caller
There is only one function, so no need for a function pointer.
pci: rename pci_register_bar_region() to pci_register_bar()
pci: pass I/O address space to new PCI bus
This lets us register BARs in the I/O address space.
pci: allow I/O BARs to be registered with pci_register_bar_region()
pci: add API to get a BAR's mapped address
Some (hacky) devices that have a back-channel to read thisaddress back outside the normal configuration mechanisms, suchas VMware svga.
Reviewed-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Avi Kivity <avi@redhat.com>...
pci: pass address space to pci bus when created
This is now done sloppily, via get_system_memory(). Eventually callerswill be converted to stop using that.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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 <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>...
Merge remote-tracking branch 'origin/master' into pci
Conflicts: hw/virtio-pci.c
pci: move ids of config space into PCIDeviceInfo
vender id/device id... in configuration space are read-only registerswhich are commonly defined for all pci devices.So move those initialization into common place.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
Fix typo in code and comments
Replace writeable -> writable
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
pci: add pci_register_bar_simple() API
This is similar to pci_register_bar(), but automatically registers a singlememory region spanning the entire BAR.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
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 eliminatedby this helper function.
Cc: Michael S. Tsirkin <mst@redhat.com>...
pci: replace the magic, 256, for the maximum of devfn
Introduce symbol PCI_SLOT_MAX for the # of slots,and replace the magic, 256.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
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).
pci: use uint8_t for devfn_min
use uint8_t for devfn_min instead of int.
pci: add creation functions that may fail
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 thatall irq is are deasserted.But now pci bus reset/flr is supported, and in that case irq needs to be...
pci: allow devices being tagged as not hotpluggable.
This patch adds a field to PCIDeviceInfo to tag devices as beingnot hotpluggable. Any attempt to plug-in or -out such a devicewill throw an error.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
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.
pcie: add flr support
Support flr: trigger device reset on flr config write.
pci: add ich9 pci id
We need a PCI ID for our new AHCI adapter. I just picked an ICH-9because that's the one in the Q35 chipset.
This patch adds a PCI ID define for an ICH-9 AHCI adapter.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
pci: untangle pci/msi dependency
msi depends on pci but pci should not depend on msi.The only dependency we have is a recent additionof pci_msi_ functions, IMO they add little enough toopen-code in the small number of users.
Follow-up patches add more cleanups....
pci: make command SERR bit writable
pcie aer needs SERR bit to be writable, and the PCI spec requiresthis as well. For compatibility, introduce compat global propertycommand_serr_enable and make this bit readonly for a pre 0.14 pcmachine.
pci: use qdev reset framework for pci bus reset
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
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 by5beb8ad503c88a76f2b8106c3b74b4ce485a60e1 .
Merge branch 'pci' into for_anthony
pcie: helper functions for pcie capability and extended capability
This patch implements helper functions for pci express capabilityand pci express extended capability allocation.NOTE: presence detection depends on pci_qdev_init() change.
msi: implements msi
implements msi related functions.
pci: introduce helper function to handle msi-x and msi.
this patch implements helper functions to handle msi-x and msiuniformly.They will be used later.
pci: introduce helper functions to test-and-{clear, set} mask in configuration space
This patch introduces helper functions to test-and-{clear, set} mask in configurationspace. pci_{byte, word, long, quad}_test_and_{clear, set}_mask().They will be used later....
pci: implement RW1C register framework.
Implement RW1C register framework.With this patch, it would be easy to implementW1C register by just setting w1cmask.Later RW1C register will be used by pcie.
Introduce range.h
Extract range functions from pci.h. These will be used by later patchesby non-PCI devices. Adjust current users.
pci: improve signature of pci_register_bar().
Make type uint8_t from int because PCIIORegion::type is uint8_t.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
pci: consolidate pci_add_capability_at_offset() into pci_add_capability().
By making pci_add_capability() the special case ofpci_add_capability_at_offset() of offset = 0,consolidate pci_add_capability_at_offset() into pci_add_capability().
Cc: Stefan Weil <weil@mail.berlios.de>...
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.
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.cfor 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....
pci_bridge: make pci bridge aware of pci multi function bit.
make pci bridge aware of pci multi function property and let pci genericcode to set the bit.
Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
pci: introduce multifunction property.
introduce multifunction property.Also introduce new convenient device creation function whichwill be used later.
For bisectability this patch doesn't do anything, but sets the propertyresulting in no functional changes....
pci: remove PCIDeviceInfo::header_type
replace PCIDeviceInfo::header_type with is_bridgeas suggested by Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
pci: insert assert that auto-assigned-address function is single function device.
Auto-assigned-address pci function (passing devfn = -1) is alwayssingle function.This patch adds assert() to guarantee that auto-assigned-address functionis always single function device at function = 0....
pci-hotplug: make them aware of pci domain.
add helper function which converts root bus to pci domain.make them aware of pci domain.
pci: add const to pci_is_express(), pci_config_size().
add const to pci_is_express(), pci_config_size().
pci.h: remove unused constants.
So remove unused constants,PCI_STATUS_RESERVED_MASK_LO, PCI_STATUS_RESERVED_MASK_HI,PCI_COMMAND_RESERVED, PCI_COMMAND_RESERVED_MASK_HI.They were used once, but they aren't used anymore.
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 <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>...
pci: add API to add capability at a known offset
Unlike virtio, device emulations need to add pci capabilitiesat known offsets to match real hardware. Make this possibleby adding an appropriate API.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
adding helper pci functions
Signed-off-by: Izik Eidus <ieidus@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: move pcibus_t to qemu-common
move pcibus_t to qemu-common.h to simplify header dependencies.
PCI: Convert pci_info() to QObject
The returned QObject is a QList of all buses. Each bus isrepresented by a QDict, which has a key with a QList of allPCI devices attached to it. Each device is represented bya QDict.
As has happended to other complex conversions, it's hard to...
pci: Add missing 'const' in argument to pci_get_xxx
pci_get_byte, pci_get_word, pci_get_long and pci_get_quadall take a const uint8_t pointer, because they only readthe configuration data.
Their prototypes should reflect this fact.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
pci: allow loading roms via fw_cfg.
This patch adds a pci bus property 'rombar' which specifies wheneverthe 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 whereno pci rom bar is present....
Merge remote branch 'mst/for_anthony' into staging
PCI: make pci_mem_base private
Make pci_mem_base private to PCIBus. Add a function to set it.
pcnet: switch to symbolic names for pci registers
No functional changes. I verified that the generated binarydoes not change.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>Acked-by: Glauber Costa <glommer@gmail.com>
pci: add more status bits
will be used by eepro100.
pci: add another devsel macro
will be used by ensoniq emulation
pci: remove unused macro
PCI_STATUS_DEVSEL is unused, and it alsohas a different name in pci_regs.hRemove.
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.
pci: use pci_regs.h
include pci_regs.h and remove duplicated defines.And remove unused PCI_REVISION and PCI_SUBDEVICE_ID.
Revert "Revert "pci: interrupt disable bit support""
This reverts commit d587e0787153f0224a6140c5015609963ceaabfb.
Support PCI based option rom loading
Currently, we preload option roms into the option rom space in memory. Thisprevents DDIM from functioning correctly which severely limits the numberof roms we can support.
This patch introduces a pci_add_option_rom() which registers the...
pci romfiles: add property, add default to PCIDeviceInfo
This patch adds a romfile property to the pci bus. It allows to specifya romfile to load into the rom bar of the pci device. The default valuecomes from a new field in PCIDeviceInfo. The property allows to change...
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 <aliguori@us.ibm.com>
pci: prepare irq code for interrupt state
This rearranges code in preparation for interrupt stateimplementation.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...
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 <mst@redhat.com>Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
pci: interrupt disable bit support
Interrupt disable bit is mandatory in PCI spec.Implement it to make devices spec compliant.
pci: move apb specific stuff to apb_pci.c
pci code had a TODO to move apb specificpci bridge initialization to apb_pci.Implement this and remove the TODO.
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.
pci: remove unused constants
This patch removes unused constants committed byfb23162885f7fd8cf7334bed22c25ac32c7d8b9d.
pci: remove some unnecessary comment in pci.h
This patch removes some comment which should go into commit login pci.h.
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" <mst@redhat.com>.
pci: move pci_data_{read, write}() declaration from pci.h to pci_host.h
Now pci host stuff has been moved from pci.[hc] to pci_host.[hc]so the declaration of pci_data_{read, write}() should be inpci_host.hThis patch moves them from pci.h to pci_host.h for consistency....
pci: pci.h cleanup: move out stuff not in pci.c
pci.h declares some functions which aren'tdefined in pci.h. Clean up moving thingsto appropriate headers, and update all users.
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....
pci: implement pci bridge filtering.
This patch implements pci bridge filtering.
TODO: currently almost all the map funcions assumesfiltered_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...
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 areapointed by BAR. It doesn't make sense, though.In that case, don't map the BAR.
pci: make pci configuration transaction more accurate.
This patch sorts out/enhances pci code to track pci bus topologymore accurately.- Track host bus bridge with pci domain number. Although the current qemu implementation supports only pci domian 0 yet....
pci_host: change the signature of pci_data_{read, write}.
change the first argument, void opaque to PCIBus *sof the pci_data_{read, write}.They aren't used as direct callback so the argument typedon't have to be void. So change it to the right type....
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 <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: add helper functions to check ranges overlap.
add helper function to check ranges overlap suggested byMichael S. Tsirkin <mst@redhat.com>.His original suggestion was to use [first, last], however I chosento use offset, length pair, i.e. [offset, offset + length)...
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/sizeinstead of uint32_t.Later this type will be changed to uint64_t....
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.
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 representspci bus addr/size from uint32_t to uint64_t.And also change FMT_pcibus for printf.
In pci_update_mapping() checks 32bit overflow....
pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.h
make constants for pci base address match pci_regs.h byrenaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>...
pci: make pci_bar() aware of header type 1.
make pci_bar() aware of header type 1. When PCI_ROM_SLOTit should return PCI_ROM_ADDRESS1 (!= PCI_ROM_ADDRESS)
pci: introduce constant PCI_NUM_PINS for the number of interrupt pins, 4.
introduce constant PCI_NUM_PINS for the number of interrupt pins, 4.and use it.
pci: define a constant to represent a unmapped bar and use it.
define a constant to represent a unmapped bar instead of -1 and use it.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: helper functions to access PCIDevice::config
add helper functions to get/set PCIDevice::configThose will be used later.
Revert "Fix exit on 'pci_add' Monitor command"
This reverts commit 0148fde54c2478ea8a47c8dbfe4c0fb8bda4d996.
As requested by Luiz.