summaryrefslogtreecommitdiffstats
path: root/hw
Commit message (Collapse)AuthorAgeFilesLines
* sun4u: Pass SPARCCPU to cpu_set_ivec_irq()Andreas Färber2012-10-131-4/+3
| | | | | | | Needed for moving halted field to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sun4u: Pass SPARCCPU to cpu_kick_irq()Andreas Färber2012-10-131-4/+6
| | | | | | | Needed for changing qemu_cpu_kick() argument type to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sun4u: Pass SPARCCPU to {,s,hs}tick_irq() and cpu_timer_create()Andreas Färber2012-10-131-8/+11
| | | | | | | Needed for changing cpu_kick_irq() argument type to SPARCCPU. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sun4m: Pass SPARCCPU to cpu_kick_irq()Andreas Färber2012-10-131-2/+4
| | | | | | | Needed for changing qemu_cpu_kick() argument type to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sun4m: Pass SPARCCPU to cpu_set_irq()Andreas Färber2012-10-131-2/+3
| | | | | | | Needed for changing cpu_kick_irq() argument type to SPARCCPU. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into stagingAnthony Liguori2012-10-128-83/+137
|\ | | | | | | | | | | | | | | | | | | | | | | | | * pmaydell/arm-devs.for-upstream: arm_gic: Rename gic_state to GICState zynq_slcr: Fixed ResetValues enum versatilepb: add gpio pl061 support hw/ds1338: Implement state save/restore hw/ds1338: Remove 'now' field from state struct hw/ds1338: Recapture current time when register pointer wraps around hw/ds1338: Fix mishandling of register pointer hw/arm_gic.c: Fix improper DPRINTF output. cadence_ttc: Fix 'clear on read' behavior
| * arm_gic: Rename gic_state to GICStatePeter Maydell2012-10-124-43/+43
| | | | | | | | | | | | | | | | | | | | | | Rename the gic_state struct to match QEMU's coding style conventions for structure names, since the impending KVM-for-ARM patches will create another subclass of it. This patch was created using: sed -i 's/gic_state/GICState/g' hw/arm_gic.c hw/arm_gic_common.c \ hw/arm_gic_internal.h hw/armv7m_nvic.c Acked-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * zynq_slcr: Fixed ResetValues enumPeter A. G. Crosthwaite2012-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | There is a gap in the reset region of the address space at offset 0x208. This throws out all these enum values by one when translating them to address offsets. Fixed by putting the corresponding gap in the enum as well. Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * versatilepb: add gpio pl061 supportJean-Christophe PLAGNIOL-VILLARD2012-10-121-0/+5
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * hw/ds1338: Implement state save/restorePeter Maydell2012-10-121-5/+22
| | | | | | | | | | | | | | | | Implement state save/restore for the DS1338. This requires the usual minor adjustment of types in the state struct to get fixed-width ones with vmstate macros. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * hw/ds1338: Remove 'now' field from state structPeter Maydell2012-10-121-20/+21
| | | | | | | | | | | | | | | | | | The 'struct tm now' field in the state structure is in fact only ever used as a temporary (the actual RTC state is held in 'offset'). Remove it from the state structure in favour of using local variables to avoid confusion about whether it needs to be saved on migration. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * hw/ds1338: Recapture current time when register pointer wraps aroundPeter Maydell2012-10-121-17/+42
| | | | | | | | | | | | | | | | The DS1338 datasheet documents that the current time is captured into the secondary registers when the register pointer wraps round to zero as well as at a START condition. Implement this. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * hw/ds1338: Fix mishandling of register pointerPeter Maydell2012-10-121-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct several deficiencies in the handling of the register pointer: * it should wrap around after 0x3f, not 0xff * guard against the caller handing us an out of range pointer (on h/w this can never happen, because only a 7 bit value is transferred over the I2C bus) * there was confusion over whether nvram[] holds only the 56 bytes of guest-accessible NVRAM, or also the secondary registers which hold the value of the clock captured at the start of a multibyte read. Correct to consistently be the latter, by fixing the array size and the offset used for NVRAM writes. * ds1338_send was attempting to use 'data' as both the data and the register offset simultaneously, which meant that writes to any register were broken; fix to use the register pointer. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * hw/arm_gic.c: Fix improper DPRINTF output.Evgeny Voevodin2012-10-121-1/+1
| | | | | | | | | | | | | | | | s->cpu_enabled is an array, so s->cpu_enabled ? "En" : "Dis" returns "En" always. We should use s->cpu_enabled[cpu] here. Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * cadence_ttc: Fix 'clear on read' behaviorSoren Brinkmann2012-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | A missing call to qemu_set_irq() when reading the IRQ register required SW to write to the IRQ register to acknowledge an interrupt. With this patch the behavior is fixed: - Reading the interrupt register clears it and updates the timers interrupt status - Writes to the interrupt register are ignored Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* | Merge remote-tracking branch 'kraxel/usb.67' into stagingAnthony Liguori2012-10-122-11/+23
|\ \ | | | | | | | | | | | | | | | | | | * kraxel/usb.67: uhci: Raise interrupt when requested even for non active tds usb-redir: Don't make migration fail in none seamless case usb-redir: Change usbredir_open_chardev into usbredir_create_parser
| * | uhci: Raise interrupt when requested even for non active tdsHans de Goede2012-10-111-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the spec we must raise an interrupt when one is requested even for non active tds. Linux depends on this, for bulk transfers it runs an inactivity timer to work around a bug in early uhci revisions, when we take longer then 200 ms to process a packet, this timer goes of, and as part of the handling Linux then unlinks the qh, and relinks it after the frindex has increased by atleast 1, the problem is Linux only checks for the frindex increases on an interrupt, and we don't send that, causing the qh to go inactive for more then 32 frames, at which point we consider the packet cancelled. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb-redir: Don't make migration fail in none seamless caseHans de Goede2012-10-111-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | Instead simple disconnect the device like host redirection does on migration. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb-redir: Change usbredir_open_chardev into usbredir_create_parserHans de Goede2012-10-111-6/+5
| |/ | | | | | | | | | | | | As we need to create the parser at more places. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-20121008.0' ↵Anthony Liguori2012-10-122-307/+305
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging * awilliam/tags/vfio-pci-for-qemu-20121008.0: vfio-pci: Fix BAR->VFIODevice translation in vfio-pci: Clang cleanup vfio-pci: Cleanup on INTx setup failure vfio-pci: Extend reset vfio-pci: Remove setting of MSI qsize vfio-pci: Use uintptr_t for void* cast vfio-pci: Don't peak at msi_supported vfio-pci: Roll the header into the .c file vfio-pci: No spurious MSIs vfio-pci: Rework MSIX setup/teardown vfio-pci: Unmap and retry DMA mapping vfio-pci: Re-order map/unmap vfio-pci: Update slow path INTx algorithm
| * | vfio-pci: Fix BAR->VFIODevice translation inJan Kiszka2012-10-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DO_UPCAST is supposed to translate from the first member of a struct to that struct, not from arbitrary ones. And it (usually) breaks the build when neglecting this rule. Use container_of to fix the build breakage and likely also the runtime behavior. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> aw: runtime behavior is actually the same, but clearly misuse of DO_UPCAST Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | vfio-pci: Clang cleanupAlex Williamson2012-10-081-43/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blue Swirl reports that Clang doesn't like the structure we define to avoid dynamic allocation for a number of calls to VFIO_DEVICE_SET_IRQS. Adding an element after a variable sized type is a GNU extension. Switch back to dynamic allocation, which really isn't a problem since this is only done on interrupt setup changes. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | vfio-pci: Cleanup on INTx setup failureAlex Williamson2012-10-081-0/+2
| | | | | | | | | | | | | | | | | | Missing some unwind code. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | vfio-pci: Extend resetAlex Williamson2012-10-081-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Take what we've learned from pci-assign and apply it to vfio-pci. On reset, disable previous interrupt config, perform a device reset if available, re-enable INTx, and disable memory regions on the device to prevent continuing DMA. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | vfio-pci: Remove setting of MSI qsizeAlex Williamson2012-10-081-18/+0
| | | | | | | | | | | | | | | | | | | | | This was a misinterpretation of the spec, hardware doesn't get to specify how many were actually enabled through this field. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | vfio-pci: Use uintptr_t for void* castAlex Williamson2012-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | | We don't seem to run into any sign extension problems, but unsigned looks more correct. Signed-off-by: Alex williamson <alex.williamson@redhat.com>
| * | vfio-pci: Don't peak at msi_supportedAlex Williamson2012-10-081-16/+6
| | | | | | | | | | | | | | | | | | Let the init function fail, just don't warn for -ENOTSUP. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | vfio-pci: Roll the header into the .c fileAlex Williamson2012-10-082-115/+96
| | | | | | | | | | | | | | | | | | | | | It's only ~100 lines and nobody else should be using this. Suggested by Michael Tsirkin. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | vfio-pci: No spurious MSIsAlex Williamson2012-10-081-15/+0
| | | | | | | | | | | | | | | | | | | | | FreeBSD doesn't like these spurious MSIs, remove them as they're mostly paranoia anyway. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | vfio-pci: Rework MSIX setup/teardownAlex Williamson2012-10-081-53/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We try to do lazy initialization of MSIX since we don't actually need to setup anything until MSIX vectors start getting used. This leads to problems if MSIX is enabled, but never used (we can end up trying to re-enable INTx while it's still enabled). We also run into problems trying to expand our reset function to tear down interrupts as we can then get vector release notifications after we've released data structures. By making explicit initialization and teardown we can avoid both of these problems and behave more similar to bare metal. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | vfio-pci: Unmap and retry DMA mappingAlex Williamson2012-10-081-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Occasionally we get regions added that overlap with existing mappings. These always seems to be in the VGA ROM range. VFIO returns EBUSY for these mapping attempts. We can try a little harder and assume that the latest mapping is correct by removing any overlapping ranges and retrying the original request. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | vfio-pci: Re-order map/unmapAlex Williamson2012-10-081-18/+18
| | | | | | | | | | | | | | | | | | This cleans up the next patch that calls unmap from map. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | vfio-pci: Update slow path INTx algorithmAlex Williamson2012-10-082-25/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't afford the overhead of switching out and back into mmap mode around each interrupt, but we can do it lazily via a timer. On INTx interrupt, disable the mmap'd memory regions and set a timer. On every interrupt, push the timer out. If the timer expires and the interrupt is no longer pending, switch back to mmap mode. This has the benefit that things like graphics cards, which rarely or never, fire an interrupt don't need manual user intervention to add the x-intx=off parameter. They'll just remain in mmap mode until they trigger an interrupt, and if they don't continue to regularly fire interrupts, they'll switch back. The default timeout is tuned for network cards so that a ping is just enough to keep them in non-mmap mode, where they have much better latency. It is tunable with an experimental option, x-intx-mmap-timeout-ms. A value of 0 keeps the device in non-mmap mode after the first interrupt. It's possible we could look at the class code of devices and come up with reasonable per-class defaults based on expected interrupt frequency and latency. None of this is used for MSI interrupts and also won't be used if we can bypass through KVM. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* | | Merge remote-tracking branch 'stefanha/net' into stagingAnthony Liguori2012-10-123-2/+39
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stefanha/net: net: consolidate NetClientState header files into one virtio-net: update nc.link_down in virtio_net_load() e1000: update nc.link_down in e1000_post_load() rtl8139: implement 8139cp link status
| * | | virtio-net: update nc.link_down in virtio_net_load()Amos Kong2012-10-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nc.link_down could not be migrated, this patch updates link_down in virtio_post_load() to keep it coincident with real link status. Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
| * | | e1000: update nc.link_down in e1000_post_load()Amos Kong2012-10-081-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduced e1000_post_load(), it will be called in the end of migration. nc.link_down could not be migrated, this patch updates link_down in e1000_post_load() to keep it coincident with real link status. Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
| * | | rtl8139: implement 8139cp link statusJason Wang2012-10-081-2/+22
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a link status chang callback and change the link status bit in BMSR & MSR accordingly. Tested in Linux/Windows guests. The link status bit of MediaStatus is infered from BasicModeStatus, they are inverse. nc.link_down could not be migrated, this patch updates link_down in rtl8139_post_load() to keep it coincident with real link status. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
* | | Merge remote-tracking branch 'spice/spice.v61' into stagingAnthony Liguori2012-10-124-54/+20
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * spice/spice.v61: qxl: set default revision to 4 spice: raise requirement to 0.12 hw/qxl: qxl_dirty_surfaces: use uintptr_t hw/qxl: fix condition for exiting guest_bug hw/qxl: exit on failure to register qxl interface qxl: fix range check for rev3 io commands. qxl/update_area_io: cleanup invalid parameters handling qxl: always update displaysurface on resize
| * | qxl: set default revision to 4Gerd Hoffmann2012-10-082-5/+8
| | | | | | | | | | | | | | | | | | | | | Set qxl pci revision to 4 (for pc-1.3+) so guests know spice-server 0.12 features are available. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | spice: raise requirement to 0.12Gerd Hoffmann2012-10-081-30/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the next qemu version (1.3) we are going to bump the qxl device revision to 4. The new features available require a recent spice-server version, so raise up the bar. Otherwise we would end up with different qxl revisions depending on the spice-server version installed, which would be a major PITA when it comes to compat properties. Clear out a big bunch of #ifdefs which are not needed any more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | hw/qxl: qxl_dirty_surfaces: use uintptr_tAlon Levy2012-10-081-2/+2
| | | | | | | | | | | | | | | | | | | | | As suggested by Paolo Bonzini, to avoid possible integer overflow issues. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | hw/qxl: fix condition for exiting guest_bugAlon Levy2012-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | | Reported and suggested by Paolo Bonzini, thanks. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | hw/qxl: exit on failure to register qxl interfaceAlon Levy2012-10-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | This prevents a segfault later on when the device reset handler tries to access a NULL ssd.worker since interface_attach_worker has not been called. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | qxl: fix range check for rev3 io commands.Gerd Hoffmann2012-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | | Enables QXL_IO_FLUSH_SURFACES_ASYNC and QXL_IO_FLUSH_RELEASE which are part of the qxl rev3 feature set. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | qxl/update_area_io: cleanup invalid parameters handlingMichael Tokarev2012-10-081-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cleans up two additions of almost the same code in commits 511b13e2c9 and ccc2960d654. While at it, make error paths consistent (always use 'break' instead of 'return'). Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Cc: Dunrong Huang <riegamaths@gmail.com> Cc: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | qxl: always update displaysurface on resizeGerd Hoffmann2012-10-081-4/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Don't try to be clever and skip displaysurface reinitialization in case the size hasn't changed. Other parameters might have changed nevertheless, for example depth or stride, resulting in rendering being broken then. Trigger: boot linux guest with vesafb, start X11, make sure both vesafb and X11 use the display same resolution. Then watch X11 screen being upside down. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | ssi: Add slave autoconnect helperPeter Crosthwaite2012-10-104-3/+44
| | | | | | | | | | | | | | | | | | Added helper function to automatically connect SPI slaves based on the QOM child nodes of a device. A SSI master device can call this routine to automatically hook-up all child nodes to its SPI bus. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Acked-by: Peter Maydell <peter.maydell@linaro.org>
* | xilinx_zynq: Added SPI controllers + flashesPeter A. G. Crosthwaite2012-10-101-0/+34
| | | | | | | | | | | | | | | | Added the two SPI controllers to the zynq machine model. Attached two SPI flash devices to each controller. Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Acked-by: Peter Maydell <peter.maydell@linaro.org>
* | xilinx_spips: Xilinx Zynq SPI cntrlr device modelPeter A. G. Crosthwaite2012-10-102-0/+353
| | | | | | | | | | | | | | Added device model for the Xilinx Zynq SPI controller (SPIPS). Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Acked-by: Peter Maydell <peter.maydell@linaro.org>
* | petalogix-ml605: added SPI controller with n25q128Peter A. G. Crosthwaite2012-10-101-0/+27
| | | | | | | | | | | | | | | | Added SPI controller to the reference design, with two n25q128 spi-flashes connected. Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Acked-by: Peter Maydell <peter.maydell@linaro.org>
OpenPOWER on IntegriCloud