summaryrefslogtreecommitdiffstats
path: root/hw
Commit message (Collapse)AuthorAgeFilesLines
* hw/9pfs: Fix memory leak in error pathM. Mohan Kumar2013-07-091-9/+17
| | | | | | | | Fix few more memory leaks in virtio-9p-device.c detected using valgrind. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Message-id: 1372929678-14341-1-git-send-email-mohan@in.ibm.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Extend support of SMBUS(module pm_smbus.c) HST_STS register.MRatnikov2013-07-091-2/+23
| | | | | | | | | | | Previous realization doesn't consider flags in the status register. Add DS and INTR bits of HST_STS register set after transaction execution. Update bits resetting in HST_STS register. Update error processing: if DEV_ERR bit set transaction isn't execution. Signed-off-by: MRatnikov <m.o.ratnikov@gmail.com> Message-id: 1373230982-9190-1-git-send-email-m.o.ratnikov@gmail.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori2013-07-0826-145/+339
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pci,misc enhancements This includes some pci enhancements: Better support for systems with multiple PCI root buses FW cfg interface for more robust pci programming in BIOS Minor fixes/cleanups for fw cfg and cross-version migration - because of dependencies with other patches Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Sun 07 Jul 2013 03:11:18 PM CDT using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By David Gibson (10) and others # Via Michael S. Tsirkin * mst/tags/for_anthony: pci: Fold host_buses list into PCIHostState functionality pci: Remove domain from PCIHostBus pci: Simpler implementation of primary PCI bus pci: Add root bus parameter to pci_nic_init() pci: Add root bus argument to pci_get_bus_devfn() pci: Replace pci_find_domain() with more general pci_root_bus_path() pci: Use helper to find device's root bus in pci_find_domain() pci: Abolish pci_find_root_bus() pci: Move pci_read_devaddr to pci-hotplug-old.c pci: Cleanup configuration for pci-hotplug.c pvpanic: fix fwcfg for big endian hosts pvpanic: initialization cleanup MAINTAINERS: s/Marcelo/Paolo/ e1000: cleanup process_tx_desc pc_piix: cleanup init compat handling pc: pass PCI hole ranges to Guests pci: store PCI hole ranges in guestinfo structure range: add Range structure Message-id: 1373228271-31223-1-git-send-email-mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * pci: Fold host_buses list into PCIHostState functionalityDavid Gibson2013-07-071-19/+14
| | | | | | | | | | | | | | | | | | | | The host_buses list is an odd structure - a list of pointers to PCI root buses existing in parallel to the normal qdev tree structure. This patch removes it, instead putting the link pointers into the PCIHostState structure, which have a 1:1 relationship to PCIHostBus structures anyway. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: Remove domain from PCIHostBusDavid Gibson2013-07-071-4/+3
| | | | | | | | | | | | | | | | | | There are now no users of the domain field of PCIHostBus, so remove it from 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> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: Simpler implementation of primary PCI busDavid Gibson2013-07-072-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently pci_find_primary_bus() searches the list of root buses for one with 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 users of pci_find_primary_bus() are in pci-hotplug-old.c, which implements the old style pci_add/pci_del commands. Therefore, this patch redefines pci_find_primary_bus() to find the only PCI root bus, returning an error if there are multiple roots. The callers in pci-hotplug-old.c are updated correspondingly, to produce sensible error messages. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: Add root bus parameter to pci_nic_init()David Gibson2013-07-0716-24/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | At present, pci_nic_init() and pci_nic_init_nofail() assume that they will only create a NIC under the primary PCI root. As we add support for multiple PCI roots, that may no longer be the case. This patch adds a root bus parameter to pci_nic_init() (and updates callers accordingly) to allow the machine init code using it to specify the right PCI root for NICs created by old-style -net nic parameters. NICs created new-style, with -device can of course be put anywhere. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: Add root bus argument to pci_get_bus_devfn()David Gibson2013-07-072-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 is working on an address under the primary PCI root bus. This patch extends it to allow the caller to specify a root bus. This might seem a little odd since the supplied address can (theoretically) include a PCI domain number. However, attempting to use a non-zero domain number there is currently an error, so that shouldn't really cause problems. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: Replace pci_find_domain() with more general pci_root_bus_path()David Gibson2013-07-077-24/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pci_find_domain() is used in a number of places where we want an id for a whole PCI domain (i.e. the subtree under a PCI root bus). The trouble is that many platforms may support multiple independent host bridges with no hardware supplied notion of domain number. This patch, therefore, replaces calls to pci_find_domain() with calls to a new pci_root_bus_path() returning a string. The new call is implemented in terms of a new callback in the host bridge class, so it can be defined in some way that's well defined for the platform. When no callback is available we fall back on the qbus name. Most current uses of pci_find_domain() are for error or informational messages, so the change in identifiers should be harmless. The exception is pci_get_dev_path(), whose results form part of migration streams. To maintain compatibility with old migration streams, the PIIX PCI host is altered to always supply "0000" for this path, which matches the old domain number (since the code didn't actually support domains other than 0). For the pseries (spapr) PCI bridge we use a different platform-unique identifier (pseries machines can routinely have dozens of PCI host bridges). Theoretically that breaks migration streams, but given that we don't yet have migration support for pseries, it doesn't matter. Any other machines that have working migration support including PCI devices will need to be updated to maintain migration stream compatibility. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: Use helper to find device's root bus in pci_find_domain()David Gibson2013-07-073-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently pci_find_domain() performs two functions - it locates the PCI root 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 root bus for a given PCI device. This is then used in pci_find_domain(). This changes pci_find_domain()'s signature slightly, taking a PCIDevice instead of a PCIBus - since all callers passed something of the form dev->bus, this simplifies things slightly. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: Abolish pci_find_root_bus()David Gibson2013-07-073-14/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | pci_find_root_bus() takes a domain parameter. Currently PCI root buses with domain other than 0 can't be created, so this is more or less a long winded way of retrieving the main PCI root bus. Numbered domains don't actually properly cover the (non x86) possibilities for multiple PCI root buses, so this patch for now enforces the domain == 0 restriction in other places to replace pci_find_root_bus() with an explicit pci_find_primary_bus(). Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: Move pci_read_devaddr to pci-hotplug-old.cDavid Gibson2013-07-042-15/+15
| | | | | | | | | | | | | | | | | | pci_read_devaddr() is only used by the legacy functions for the old PCI hotplug interface in pci-hotplug-old.c. So we move the function there, and make it static. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: Cleanup configuration for pci-hotplug.cDavid Gibson2013-07-042-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pci-hotplug.c and the CONFIG_PCI_HOTPLUG variable which controls its compilation are misnamed. They're not about PCI hotplug in general, but rather about the pci_add/pci_del interface which are now deprecated in favour of the more general device_add/device_del interface. This patch therefore renames them to pci-hotplug-old.c and CONFIG_PCI_HOTPLUG_OLD. CONFIG_PCI_HOTPLUG=y was listed twice in {i386,x86_64}-softmmu.make for no particular reason, so we clean that up too. In addition it was included in ppc64-softmmu.mak for which the old hotplug interface was never used and is unsuitable, so we remove that too. Most of pci-hotplug.c was additionaly protected by #ifdef TARGET_I386. The small piece which wasn't is only called from the pci_add and pci_del hooks in hmp-commands.hx, which themselves were protected by #ifdef TARGET_I386. This patch therefore also removes the #ifdef from pci-hotplug-old.c, and changes the ifdefs in hmp-commands.hx to use CONFIG_PCI_HOTPLUG_OLD. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pvpanic: fix fwcfg for big endian hostsMichael S. Tsirkin2013-07-041-3/+4
| | | | | | | | | | | | | | Convert port number to little endian when exposing it in fw cfg. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pvpanic: initialization cleanupMichael S. Tsirkin2013-07-041-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid use of static variables: PC systems initialize pvpanic device through pvpanic_init, so we can simply create the fw_cfg file at that point. This also makes it possible to skip device creation completely if fw_cfg is not there, e.g. for xen - so the ports it reserves are not discoverable by guests. Also, make pvpanic_init void since callers ignore return status anyway. Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Paul Durrant <Paul.Durrant@citrix.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * e1000: cleanup process_tx_descAndrew Jones2013-07-041-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity complains about two overruns in process_tx_desc(). The complaints are false positives, but we might as well eliminate them. The problem is that "hdr" is defined as an unsigned int, but then used to offset an array of size 65536, and another of size 256 bytes. hdr will actually never be greater than 255 though, as it's assigned only once and to the value of tp->hdr_len, which is an uint8_t. This patch simply gets rid of hdr, replacing it with tp->hdr_len, which makes it consistent with all other tp member use in the function. v2: - also cleanup coding style issues in the touched lines Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pc_piix: cleanup init compat handlingMichael S. Tsirkin2013-07-041-14/+4
| | | | | | | | | | | | | | | | Make sure 1.4 calls 1.5, 1.3 calls 1.4 etc. This way it's enough to add enough new compat hook in a single place in piix. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pc: pass PCI hole ranges to GuestsMichael S. Tsirkin2013-07-043-3/+51
| | | | | | | | | | | | | | | | | | Guest currently has to jump through lots of hoops to guess the PCI hole ranges. It's fragile, and makes us change BIOS each time we add a new chipset. Let's report the window in a ROM file, to make BIOS do exactly what QEMU intends. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: store PCI hole ranges in guestinfo structureMichael S. Tsirkin2013-07-044-3/+71
| | | | | | | | | | | | Will be used to pass hole ranges to guests. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | Merge remote-tracking branch 'bonzini/iommu-for-anthony' into stagingAnthony Liguori2013-07-07329-928/+1159
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Paolo Bonzini (50) and others # Via Paolo Bonzini * bonzini/iommu-for-anthony: (66 commits) exec: change some APIs to take AddressSpaceDispatch exec: remove cur_map exec: put memory map in AddressSpaceDispatch exec: separate current radix tree from the one being built exec: move listener from AddressSpaceDispatch to AddressSpace memory: move MemoryListener declaration earlier exec: separate current memory map from the one being built exec: change well-known physical sections to macros qom: Use atomics for object refcounting memory: add reference counting to FlatView memory: use a new FlatView pointer on every topology update memory: access FlatView from a local variable add a header file for atomic operations hw/[u-x]*: pass owner to memory_region_init* functions hw/t*: pass owner to memory_region_init* functions hw/s*: pass owner to memory_region_init* functions hw/p*: pass owner to memory_region_init* functions hw/n*: pass owner to memory_region_init* functions hw/m*: pass owner to memory_region_init* functions hw/i*: pass owner to memory_region_init* functions ... Message-id: 1372950842-32422-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * add a header file for atomic operationsPaolo Bonzini2013-07-042-6/+6
| | | | | | | | | | | | | | | | We're already using them in several places, but __sync builtins are just too ugly to type, and do not provide seqcst load/store operations. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw/[u-x]*: pass owner to memory_region_init* functionsPaolo Bonzini2013-07-0412-25/+31
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw/t*: pass owner to memory_region_init* functionsPaolo Bonzini2013-07-0423-31/+41
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw/s*: pass owner to memory_region_init* functionsPaolo Bonzini2013-07-0414-26/+33
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw/p*: pass owner to memory_region_init* functionsPaolo Bonzini2013-07-0421-86/+91
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw/n*: pass owner to memory_region_init* functionsPaolo Bonzini2013-07-0420-39/+48
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw/m*: pass owner to memory_region_init* functionsPaolo Bonzini2013-07-0422-53/+58
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw/i*: pass owner to memory_region_init* functionsPaolo Bonzini2013-07-0441-87/+111
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw/gpio: pass owner to memory_region_init* functionsPaolo Bonzini2013-07-044-6/+6
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw/d*: pass owner to memory_region_init* functionsPaolo Bonzini2013-07-0415-27/+34
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw/c*: pass owner to memory_region_init* functionsPaolo Bonzini2013-07-0419-29/+36
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw/block: pass owner to memory_region_init* functionsPaolo Bonzini2013-07-045-13/+17
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw/a*: pass owner to memory_region_init* functionsPaolo Bonzini2013-07-0424-68/+88
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * piolist: add owner argument to initialization functions and pass devicesPaolo Bonzini2013-07-048-9/+10
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * pam: pass device to init_pam and use it to set ownerPaolo Bonzini2013-07-043-11/+13
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * spapr_iommu: pass device to spapr_tce_new_table and use it to set ownerPaolo Bonzini2013-07-043-4/+5
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * vfio: pass device to vfio_mmap_bar and use it to set ownerPaolo Bonzini2013-07-041-5/+6
| | | | | | | | | | Cc: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * ne2000: pass device to ne2000_setup_io, use it as ownerPaolo Bonzini2013-07-043-5/+5
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * vga: set owner in vga_update_memory_accessPaolo Bonzini2013-07-041-1/+2
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * vga: pass owner to vga_init_ioPaolo Bonzini2013-07-043-5/+5
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * vga: pass owner to vga_init_vbePaolo Bonzini2013-07-046-7/+7
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * vga: pass owner to cirrus_init_commonPaolo Bonzini2013-07-041-10/+12
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * vga: pass owner to vga_common_initPaolo Bonzini2013-07-048-10/+10
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * vga: pass owner to vga_initPaolo Bonzini2013-07-045-5/+7
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * escc: rename struct to ESCCStatePaolo Bonzini2013-07-041-17/+17
| | | | | | | | | | | | | | | | We are using the same struct name for two devices. 8250 is widespread enough that this causes some confusion, rename the other instance. Reviewed-by: Andreas Faerber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * memory: add ref/unref callsPaolo Bonzini2013-07-049-5/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add ref/unref calls at the following places: - places where memory regions are stashed by a listener and used outside the BQL (including in Xen or KVM). - memory_region_find callsites - creation of aliases and containers (only the aliased/contained region gets a reference to avoid loops) - around calls to del_subregion/add_subregion, where the region could disappear after the first call Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * memory: introduce memory_region_presentPaolo Bonzini2013-07-042-7/+7
| | | | | | | | | | | | | | This new API will avoid having too many memory_region_ref/unref in paths that currently use memory_region_find. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * memory: add owner argument to initialization functionsPaolo Bonzini2013-07-04313-739/+740
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * vmport: Disentangle read handler type from portioJan Kiszka2013-07-041-2/+2
| | | | | | | | | | | | | | | | In case the latter may vanish one day, make sure the vmport read handler type will remain unaffected. This is also conceptually cleaner. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * xen: Mark fixed platform I/O as unalignedJan Kiszka2013-07-041-0/+4
| | | | | | | | | | | | | | | | Before switching to the memory core dispatcher, we need to make sure that this pv-device will continue to receive unaligned portio accesses. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
OpenPOWER on IntegriCloud