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.
Signed-off-by: Andreas Färber <afaerber@suse.de>
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
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
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...
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
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.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
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.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
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....