memory: manage coalesced mmio via a MemoryListener
Instead of calling a global function on coalesced mmio changes, whichroutes the call to kvm if enabled, add coalesced mmio hooks toMemoryListener and make kvm use that instead.
The motivation is support for multiple address spaces (which means we...
xen: drop no-op MemoryListener callbacks
Removes quite a bit of useless code.
Signed-off-by: Avi Kivity <avi@redhat.com>
memory: drop no-op MemoryListener callbacks
vfio: drop no-op MemoryListener callbacks
xen_pt: drop no-op MemoryListener callbacks
kvm: drop no-op MemoryListener callbacks
vhost: use MemoryListener filtering to only monitor RAM address space
Instead of checking manually, let the listener filter for us. This preparesus for DMA address spaces.
kvm: use separate MemoryListeners for memory and I/O
The construct
if (address_space == get_system_memory()) { // memory thing } else { // io thing }
fails if we have more than two address spaces. Use a separate listenerfor memory and I/O, and utilize MemoryListener's address space filtering to...
xen_pt: use separate MemoryListeners for memory and I/O
Using an unfiltered memory listener will cause regions to be reportedfails multiple times if we have more than two address spaces. Use a separatelistener for memory and I/O, and utilize MemoryListener's address space...
memory: prepare AddressSpace for exporting
AddressSpace contains a member, current_map, of type FlatView. Since wewant to limit the leakage of internal types to public headers, switch toa pointer to a FlatView. There is no performance impact as this isn't used...
memory: export AddressSpace
The DMA API will use an AddressSpace to differentiate among differentinitiators.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>
memory: maintain a list of address spaces
Instead of embedding knowledge of the memory and I/O address spaces in thememory core, maintain a list of all address spaces. This list will laterbe extended dynamically for other bus masters.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
memory: provide defaults for MemoryListener operations
Many listeners don't need to respond to all MemoryListener callbacks;provide suitable no-op defaults instead.
memory: rename 'exec-obsolete.h'
exec-obsolete.h used to hold pre-memory-API functions that were used fromdevice code prior to the transition to the memory API. Now that thetransition is complete, the name no longer describes the file. Thefunctions still need to be merged better into the memory core, but there's...
Fix popcnt in long mode
Thanks to Andriy Gapon for initial problem report.
Signed-off-by: malc <av1474@comtv.ru>
sun4m: Pass SPARCCPU to cpu_set_irq()
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()
Needed for changing qemu_cpu_kick() argument type to CPUState.
sun4u: Pass SPARCCPU to {,s,hs}tick_irq() and cpu_timer_create()
sun4u: Pass SPARCCPU to cpu_kick_irq()
sun4u: Pass SPARCCPU to cpu_set_ivec_irq()
Needed for moving halted field to CPUState.
tcg-sparc: Fix qemu_st for 32-bit
The datalo variable is still live in the miss path. Use anotherwhen reconstructing the full data value.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tcg-sparc: Fix setcond
The set of comparisons that can immediately use the carry are LTU/GEU,not LTU/LEU. Don't swap operands when we need a temp register; theregister may already be in use from setcond2.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
tcg-sparc: Fix add2/sub2
We must care not to clobber the high parts before we consume them.
tcg-sparc: Use Z constraint for %g0
tcg-sparc: Optimize setcond2 equality compare with 0.
tcg-sparc: Drop use of Bicc in favor of BPcc
Now that we're always sparcv9, we can not bother using Bicc for32-bit branches and BPcc for 64-bit branches and instead alwaysuse BPcc.
New interfaces allow less direct use of tcg_out32 and raw numbersinside the qemu_ld/st routines....
tcg-sparc: Dump illegal opode contents
tcg-sparc: Emit BPr insns for brcond_i64
tcg-sparc: Emit MOVR insns for setcond_i64 and movcond_64
tcg-sparc: Fix brcond2
Much the same problem as recently fixed for hppa.
tcg-sparc: Implement movcond.
tcg-sparc: Fix setcond2
Like brcond2, use tcg_high_cond. Use movcc instead of branches.
target-sparc: Fix optimized %icc comparisons
Signed-off-by: Richard Henderson <rth@twiddle.net>Tested-by: Aurelien Jarno <aurelien@aurel32.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-sparc: Optimize CC_OP_LOGIC conditions
target-sparc: Avoid unnecessary local temporaries
Now that save_state never ends a BB, we don't need to copyvalues into local temps around it.
target-sparc: Don't compute full flags value so often
Avoid speculatively computing flags before every potentially trappingoperation and instead do the flags computation when a trap actuallyoccurs. This gives approximately 30% speedup in emulation.
Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'kraxel/usb.67' into staging
Merge remote-tracking branch 'mdroth/qga-pull-10-9-12' into staging
Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-20121008.0' into staging
Merge remote-tracking branch 'stefanha/net' into staging
Merge remote-tracking branch 'spice/spice.v61' into staging
versatilepb: add gpio pl061 support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
zynq_slcr: Fixed ResetValues enum
There is a gap in the reset region of the address space at offset 0x208. Thisthrows out all these enum values by one when translating them to address offsets.Fixed by putting the corresponding gap in the enum as well....
arm_gic: Rename gic_state to GICState
Rename the gic_state struct to match QEMU's coding style conventionsfor structure names, since the impending KVM-for-ARM patches willcreate 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/ds1338: Fix mishandling of register pointer
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...
hw/ds1338: Recapture current time when register pointer wraps around
The DS1338 datasheet documents that the current time is captured intothe secondary registers when the register pointer wraps round to zeroas well as at a START condition. Implement this....
hw/ds1338: Remove 'now' field from state struct
The 'struct tm now' field in the state structure is in fact onlyever used as a temporary (the actual RTC state is held in 'offset').Remove it from the state structure in favour of using local variablesto avoid confusion about whether it needs to be saved on migration....
hw/ds1338: Implement state save/restore
Implement state save/restore for the DS1338. This requiresthe usual minor adjustment of types in the state struct toget fixed-width ones with vmstate macros.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
cadence_ttc: Fix 'clear on read' behavior
A missing call to qemu_set_irq() when reading the IRQ registerrequired SW to write to the IRQ register to acknowledge aninterrupt. With this patch the behavior is fixed: - Reading the interrupt register clears it and updates the timers...
hw/arm_gic.c: Fix improper DPRINTF output.
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>
vnc: fix "info vnc" with "-vnc ..., reverse=on"
When reverse connection is in use, there is no active VNC serversocket. Because of this, getsockopt(-1, ...) is attempted andthe following error is emitted:
$ socat TCP-LISTEN:5900,reuseaddr TCP-LISTEN:5901,reuseaddr &...
configure: Tidy up remnants of non-64-bit physaddrs
Tidy up some remnants of code to support non-64-bit physaddrswhich were accidentally omitted from commit 4be403c8.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
sheepdog: use bool for boolean variables
This improves readability.
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
uhci: Raise interrupt when requested even for non active tds
According to the spec we must raise an interrupt when one is requestedeven for non active tds.
Linux depends on this, for bulk transfers it runs an inactivity timerto work around a bug in early uhci revisions, when we take longer then...
usb-redir: Change usbredir_open_chardev into usbredir_create_parser
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>
usb-redir: Don't make migration fail in none seamless case
Instead simple disconnect the device like host redirection does onmigration.
qdev: allow multiple qdev_init_gpio_in() calls
Allow multiple qdev_init_gpio_in() calls for the one device. The first call willdefine GPIOs 0-N-1, the next GPIOs N- ... . Allows different GPIOs to be handledwith different handlers. Needed when two levels of the QOM class heirachy both...
stellaris: Removed SSI mux
Removed the explicit SSI mux and wired the CS line directly up to the SSIdevices.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
hw: Added generic FIFO API.
Added a FIFO API that can be used to create and operate byte FIFOs.
m25p80: Initial implementation of SPI flash device
Added device model for m25p80 style SPI flash family.
xilinx_spi: Initial impl. of Xilinx SPI controller
Device model for xilinx XPS SPI controller (v2.0)
petalogix-ml605: added SPI controller with n25q128
Added SPI controller to the reference design, with two n25q128 spi-flashesconnected.
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 model
Added device model for the Xilinx Zynq SPI controller (SPIPS).
xilinx_zynq: Added SPI controllers + flashes
Added the two SPI controllers to the zynq machine model. Attached two SPI flashdevices to each controller.
MAINTAINERS: Added maintainerships for SSI
Added maintainership for SSI, M25P80 and the Xilinx SPI controllers.
ssi: Add slave autoconnect helper
Added helper function to automatically connect SPI slaves based on the QOM childnodes of a device. A SSI master device can call this routine to automaticallyhook-up all child nodes to its SPI bus.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
ssi: Support for multiple attached devices
Removed assertion that only one device is attached to the SSI bus.
When multiple devices are attached, all slaves have their transfer functioncalled for transfers. Each device is responsible for knowing whether or not its...
ssi: Implemented CS behaviour
Added default CS behaviour for SSI slaves. SSI devices can set a propertyto enable CS behaviour which will create a GPIO on the device which is theCS. Tristating of the bus on SSI transfers is implemented.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>...
ssi: Added create_slave_no_init()
Slave creation function that can be used to create an SSI slave withoutqdev_init() being called. This give machine models a chance to set properties.
qemu-ga: ga_open_pidfile(): add new line to pidfile
FHS requires that pid files should end with a new line. Also change tosnprintf() while there.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>...
qemu-ga: use state dir from CONFIG_QEMU_LOCALSTATEDIR
Has the side effect of changing the default directory used tosave the freeze status file from /tmp to ${prefix}/var/run.
This is a beneficial change for two reasons:
1. FHS states that programs must not assume that files in /tmp will...
configure: add --localstatedir
Next commit wants to use it.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
vfio-pci: Clang cleanup
Blue Swirl reports that Clang doesn't like the structure we define toavoid 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...
vfio-pci: Fix BAR->VFIODevice translation in
DO_UPCAST is supposed to translate from the first member of a struct tothat struct, not from arbitrary ones. And it (usually) breaks the buildwhen neglecting this rule. Use container_of to fix the build breakage...
vfio-pci: Roll the header into the .c file
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: Don't peak at msi_supported
Let the init function fail, just don't warn for -ENOTSUP.
vfio-pci: Use uintptr_t for void* cast
We don't seem to run into any sign extension problems, butunsigned looks more correct.
Signed-off-by: Alex williamson <alex.williamson@redhat.com>
vfio-pci: Remove setting of MSI qsize
This was a misinterpretation of the spec, hardware doesn't get tospecify how many were actually enabled through this field.
vfio-pci: Extend reset
Take what we've learned from pci-assign and apply it to vfio-pci.On reset, disable previous interrupt config, perform a devicereset if available, re-enable INTx, and disable memory regions onthe device to prevent continuing DMA....
vfio-pci: Cleanup on INTx setup failure
Missing some unwind code.
vfio-pci: Update slow path INTx algorithm
We can't afford the overhead of switching out and back into mmap modearound each interrupt, but we can do it lazily via a timer. On INTxinterrupt, disable the mmap'd memory regions and set a timer. Onevery interrupt, push the timer out. If the timer expires and the...
vfio-pci: Re-order map/unmap
This cleans up the next patch that calls unmap from map.
vfio-pci: Unmap and retry DMA mapping
Occasionally we get regions added that overlap with existing mappings.These always seems to be in the VGA ROM range. VFIO returns EBUSYfor these mapping attempts. We can try a little harder and assumethat the latest mapping is correct by removing any overlapping ranges...
vfio-pci: Rework MSIX setup/teardown
We try to do lazy initialization of MSIX since we don't actually needto setup anything until MSIX vectors start getting used. This leadsto problems if MSIX is enabled, but never used (we can end up tryingto re-enable INTx while it's still enabled). We also run into...
vfio-pci: No spurious MSIs
FreeBSD doesn't like these spurious MSIs, remove them as they'remostly paranoia anyway.
e1000: update nc.link_down in e1000_post_load()
This patch introduced e1000_post_load(), it will be called in the end ofmigration. nc.link_down could not be migrated, this patch updateslink_down in e1000_post_load() to keep it coincident with real link...
virtio-net: update nc.link_down in virtio_net_load()
nc.link_down could not be migrated, this patch updates link_down invirtio_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>
net: consolidate NetClientState header files into one
This patch doesn't seem much useful alone, I must admit. However,it makes sense as part of the upcoming directory reorganization,where I want to have include/net/tap.h as the net<->hw interfacefor tap. Then having both net/tap.h and include/net/tap.h does...
rtl8139: implement 8139cp link status
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...
qxl: fix range check for rev3 io commands.
Enables QXL_IO_FLUSH_SURFACES_ASYNC and QXL_IO_FLUSH_RELEASEwhich are part of the qxl rev3 feature set.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/qxl: exit on failure to register qxl interface
This prevents a segfault later on when the device reset handlertries to access a NULL ssd.worker since interface_attach_worker hasnot been called.
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/qxl: fix condition for exiting guest_bug
Reported and suggested by Paolo Bonzini, thanks.
hw/qxl: qxl_dirty_surfaces: use uintptr_t
As suggested by Paolo Bonzini, to avoid possible integer overflow issues.
spice: raise requirement to 0.12
With the next qemu version (1.3) we are going to bump the qxl devicerevision to 4. The new features available require a recent spice-serverversion, so raise up the bar. Otherwise we would end up with differentqxl revisions depending on the spice-server version installed, which...
qxl: set default revision to 4
Set qxl pci revision to 4 (for pc-1.3+) so guests knowspice-server 0.12 features are available.
qxl/update_area_io: cleanup invalid parameters handling
This cleans up two additions of almost the same code in commits511b13e2c9 and ccc2960d654. While at it, make error pathsconsistent (always use 'break' instead of 'return').
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>...
qxl: always update displaysurface on resize
Don't try to be clever and skip displaysurface reinitialization in casethe size hasn't changed. Other parameters might have changednevertheless, for example depth or stride, resulting in rendering beingbroken then....
Merge branch 'master' of git.qemu.org:/pub/git/qemu