Makefile.target: CONFIG_NO_* variables removed
CONFIG_NO_* variables replaced with the lnot logical function
Signed-off-by: Ákos Kovács <akoskovacs@gmx.com>[PMM: fixed a few CONFIG_NO_* uses that were missed]Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
pci: remove explicit check to 64K ioport size
This check is useless, as bigger addresses will be ignored whenadded to 'io' MemoryRegion, which has a size of 64K.
However, some architectures don't use the 'io' MemoryRegion, likethe alpha and versatile platforms. They create a PCI I/O region...
pci: add helper to retrieve the 64-bit range
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
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 <tomoki.sekiyama@hds.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>...
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.
qdev: Pass size to qbus_create_inplace()
To be passed to object_initialize().
Since commit 39355c3826f5d9a2eb1ce3dc9b4cdd68893769d6 the argument isvoid*, so drop some superfluous (BusState *) casts or direct parentfield usages.
Signed-off-by: Andreas Färber <afaerber@suse.de>
pci: Pass size to pci_bus_new_inplace()
To be passed to qbus_create_inplace().
Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
pci: add config space access traces
This adds pci_cfg_read and pci_cfg_write traces for config spacesaccesses.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
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 amethod on the PCIBus. At the moment that only has one caller, so themethod is simply open coded. We'll need another caller for VFIO, so...
pcie_port: Turn PCIEPort and PCIESlot into abstract QOM types
Move PCIEPort's "port" property to the new type, same for "aer_log_max".Move PCIESlot's "chassis" and "slot" properties to the new type.
Reviewed-by: Don Koch <dkoch@verizon.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>...
pci-bridge: Turn PCIBridge into abstract QOM type
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]...
scsi: Improve error propagation for scsi_bus_legacy_handle_cmdline()
Let scsi_bus_legacy_add_drive() and scsi_bus_legacy_handle_cmdline()return an Error**. Prepare qdev initfns for QOM realize error model.
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 <mst@redhat.com>...
pci-bridge: update mappings for migration/restore
Fix for LP#1187529: Devices on PCI bridge stop working whenlive-migrated. Update bridge mappings for all PCI bridgedevices in get_pci_config_device().
Signed-off-by: Don Koch <dkoch@verizon.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci,misc enhancements
This includes some pci enhancements:
Better support for systems with multiple PCI root busesFW cfg interface for more robust pci programming in BIOSMinor fixes/cleanups for fw cfg and cross-version migration -...
pci: Use helper to find device's root bus in pci_find_domain()
Currently pci_find_domain() performs two functions - it locates the PCIroot 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...
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 awhole PCI domain (i.e. the subtree under a PCI root bus). The trouble isthat many platforms may support multiple independent host bridges with no...
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 isworking on an address under the primary PCI root bus. This patch extends...
pci: Add root bus parameter to pci_nic_init()
At present, pci_nic_init() and pci_nic_init_nofail() assume that they willonly create a NIC under the primary PCI root. As we add support formultiple PCI roots, that may no longer be the case. This patch adds a root...
pci: Simpler implementation of primary PCI bus
Currently pci_find_primary_bus() searches the list of root buses for onewith 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...
pci: Remove domain from PCIHostBus
There are now no users of the domain field of PCIHostBus, so remove itfrom the structure, and as a parameter from the pci_host_bus_register()function which sets it.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
pci: Fold host_buses list into PCIHostState functionality
The host_buses list is an odd structure - a list of pointers to PCI rootbuses existing in parallel to the normal qdev tree structure. This patchremoves it, instead putting the link pointers into the PCIHostState...
pci: Abolish pci_find_root_bus()
pci_find_root_bus() takes a domain parameter. Currently PCI root buseswith domain other than 0 can't be created, so this is more or less a longwinded way of retrieving the main PCI root bus. Numbered domains don'tactually properly cover the (non x86) possibilities for multiple PCI root...
hw/p*: pass owner to memory_region_init* functions
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
memory: add owner argument to initialization functions
pci: Cleanup configuration for pci-hotplug.c
pci-hotplug.c and the CONFIG_PCI_HOTPLUG variable which controls itscompilation are misnamed. They're not about PCI hotplug in general, butrather about the pci_add/pci_del interface which are now deprecated in...
pci: Move pci_read_devaddr to pci-hotplug-old.c
pci_read_devaddr() is only used by the legacy functions for the old PCIhotplug interface in pci-hotplug-old.c. So we move the function there,and make it static.
dma: eliminate DMAContext
The DMAContext is a simple pointer to an AddressSpace that is now alwaysalready available. Make everyone hold the address space directly,and clean up the DMA API to use the AddressSpace directly.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
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 AddressSpacestructs created by PCI and VIO devices. Those devices do not normallyhave names and therefore not present in "info mtree" output....
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 <peter.maydell@linaro.org>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pci: use memory core for iommu support
Use the new iommu support in the memory core for iommu support. The onlyuser, spapr, is also converted, but it still provides a DMAContextinterface until the non-PCI bits switch to AddressSpace.
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>...
qdev: Drop FROM_QBUS() macro
Use QOM cast macros I2C_BUS(), SSI_BUS(), PCI_BUS() instead.
pci: add VMSTATE_MSIX
Using a trick cut+pasted from vmstate_scsi_deviceto wind up msix_save and msix_load.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>
exec: eliminate qemu_put_ram_ptr
hw: move PCI bridges to hw/pci-* or hw/ARCH
hw: move target-independent files to subdirectories
This patch tackles all files that are compiled once, movingthem to subdirectories of hw/.
hw: make all of hw/pci/ configurable via default-configs/
hw: move headers to include/
Many of these should be cleaned up with proper qdev-/QOM-ification.Right now there are many catch-all headers in include/hw/ARCH dependingon cpu.h, and this makes it necessary to compile these files per-target.However, fixing this does not belong in these patches....
usb-storage: Forward serial number to scsi-disk
usb-storage takes care to fetch the USB serial number from -driveoptions, but it neglected to pass its own 'serial' property to thescsi-disk it creates. With this patch, the 'serial' qdev property andthe 'serial' option in -drive behave the same and correctly apply the...
virtio,pci,qom
Work by Alex to support VGA assignment,pci and virtio fixes by Stefan, Jason and myself, and anew qmp event for hotplug support by myself.
pcie: Add endpoint capability initialization wrapper
Fix the awkward API of mangling the caller specified PCIe type andjust provide an interface to initialize an endpoint device. Thiswill pick either a regular endpoint or integrated endpoint based onthe bus and return pcie_cap_init to doing exactly what is asked....
pci: Create and register a new PCI Express TypeInfo
This will allow us to differentiate Express and Legacy buses.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: Move PCI and PCIE type defines
Move these so that we can reference them from a more common headerinstead of including pci_bus.h everywhere.
pci: Allow PCI bus creation interfaces to specify the type of bus
No change to any types.
pci: Create pci_bus_is_express helper
For testing the bus type.
pci: Create and use API to determine root buses
pcie: Mangle types to match topology
Windows will fail to start drivers for devices with an Endpoint typePCIe capability attached to a Root Complex (code 10 - Device cannotstart). The proper type for such a device is Root Complex IntegratedEndpoint. Devices don't care which they are, so do this conversion...
pci: Teach PCI Bridges about VGA routing
Each PCI Bridge has a set of implied VGA regions that are enabled whenthe VGA bit is set in the bridge control register. This allows VGAdevices behind bridges. Unfortunately with VGA Enable, which weformerly allowed but didn't back, comes along some required VGA...
pci_bridge: factor out common code
Reuse common code in pcie_port, override the hardwired-to-0bits per PCI Express spec.No functional change but makes the code easier to follow.
pci_bridge: drop formatting from source
We use the same formatting for all files, itdoesn't make sense to have formatting directives onlyin pci bridge header.
pci: Fix INTx routing notifier recursion
For some reason we recurse to fire the INTx routing notifier for eachchild of a bus, for each possible device of a bus. That means that ifwe add a root port, the notifier gets called for that bridge 256times. If we add an upstream switch behind that root port, 256^2. But...
pci_bridge: Use a default map_irq function
The PCI bridge spec defines a default swizzle for translating INTxIRQs from secondary bus to primary. Use this by default for anybridge that doesn't set a function.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>...
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 assertionqemu_ram_set_idstr() because RAMBlocks with duplicate addresses areallocated - due to zero size the allocator doesn't increment the next...
pci: Add PCI VGA helpers
Allow devices to register VGA memory regions for handling PCI specdefined VGA I/O port and MMIO areas. PCI will attach these to thebus address spaces and enable them according to the device commandregister value.
VMXNET3 device implementation
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>Signed-off-by: Yan Vugenfirer <yan@daynix.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Fix typos and misspellings
Fix various typos and misspellings. The bulk of these were found withcodespell.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Merge remote-tracking branch 'bonzini/hw-dirs' into staging
pci_host: Drop write-only address_space field
The address_space field of PCIHostState was only ever written, never used.Drop it completely.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw: move qdev-monitor.o to toplevel directory
qdev-monitor.c is the only "core qdev" file that is not used inuser-mode emulation, and it does not define anything that is usedby hardware models. Remove it from the hw/ directory andremove hw/qdev-monitor.h from hw/qdev.h too; this requires...
error: Strip trailing '\n' from error string arguments (again)
Commit 6daf194d and be62a2eb got rid of a bunch, but they keep comingback. Tracked down with this Coccinelle semantic patch:
r expression err, eno, cls, fmt; position p; @@ (...
r
pci: use qbus_create in pci_bus_new
Remove knowledge of QOM innards. The common part of pci_bus_new andpci_bus_new_inplace is moved to a new function pci_bus_init.
Acked-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
build: remove extra-obj-y
extra-obj-y is somewhat complicated to understand. Replace it with aspecial CONFIG_ALL symbol that is defined only at toplevel.This limits the case of directories defining more than one*-obj-y target.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
Add TEWS TPCI200 IndustryPack emulation
The TPCI200 is a PCI board that supports up to 4 IndustryPack modules.
A new bus type called 'IndustryPack' has been created so anycompatible module can be attached to this board.
Reviewed-by: Andreas Färber <afaerber@suse.de>...
pci,virtio
This further optimizes MSIX handling in virtio-pci.Also included is pci cleanup by Paolo, and pci deviceassignment fix by Alex.
Make all static TypeInfos const
Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register alltypes natively through QEMU Object Model), TypeInfo as used inthe common, non-iterative pattern is no longer amended with informationand should therefore be const....
pci: use constants for devices under the 1B36 device ID, document them
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
virtio-9p: use symbolic constant, add to pci-ids.txt
msix: add api to access msix message
Will be used by virtio pci.
msix: expose access to masked/pending state
For use by poll handler.
pcie: Fix bug in pcie_ext_cap_set_next
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>
msi: add API to get notified about pending bit poll
Update all users.
softmmu: move include files to include/sysemu/
misc: move include files to include/qemu/
monitor: move include files to include/monitor/
migration: move include files to include/migration/
janitor: add guards to headers
qapi: move include files to include/qobject/
exec: move include files to include/exec/
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 copiesthat existed. Leave include/net/tap.h as the interface for NICs, andnet/tap_int.h as the interface for OS-specific parts of the tap backend....
Merge commit '1dd3a74d2ee2d873cde0b390b536e45420b3fe05' into HEAD
pci_bus: update comment
Don't ask everyone to desist from including this header,simply recommend using accessors.
pci_bus.h: tweak include guards
Now that header has been renamed, tweak include guardsto match.
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.
Revert "pci: prepare makefiles for pci code reorganization"
This reverts commit 475d67c3bcd6ba9fef917b6e59d96ae69eb1a9b4.
Now that all users have been updated, we don't need themakefile hack or the softlink anymore.
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'twork out. Let's stop pretending it's an internal header.
pci: move pci core code to hw/pci
Move files and modify makefiles to pick them at thenew location.
pci: prepare makefiles for pci code reorganization
To make it easier to move code around without breakingbuild at intermedite steps, tweak makefilesto look in pci/ and hw/ for include files, automatically.This will be reverted at the end of the reorganization....