buffered_file: unfold migrate_fd_wait_for_unfreeze
We only used it once, just remove the callback indirection.
Signed-off-by: Juan Quintela <quintela@redhat.com>
buffered_file: unfold migrate_fd_close
buffered_file: We can access directly to bandwidth_limit
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
buffered_file: callers of buffered_flush() already check for errors
buffered_file: make buffered_flush return the error code
Or the amount of data written if there is no error. Adjust all callers.
migration: make migrate_fd_wait_for_unfreeze() return errors
Adjust all callers
savevm: unexport qemu_fflush
It is not used outside of savevm.c
virtio-net: use qemu_get_buffer() in a temp buffer
qemu_fseek() is known to be wrong. Would be removed on the nextcommit. This code should never been used (value has beenMAC_TABLE_ENTRIES since 2009).
Signed-off-by: Juan Quintela <quintela@redhat.com>...
savevm: Remove qemu_fseek()
It has no users, and is only half implemented.
savevm: make qemu_fflush() return an error code
Adjust all the callers. We moved the set of last_error from insideqemu_fflush() to all the callers.
savevm: unfold qemu_fclose_internal()
It was used only one, and was only one if. It makes error handlingsaner.
fix migration sync
migration: store end_time in a local variable
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>
migration: print total downtime for final phase of migration
migration: rename expected_time to expected_downtime
migration: export migrate_get_current()
migration: print expected downtime in info migrate
savevm: Factorize ram globals reset in its own function
ram: introduce migration_bitmap_set_dirty()
It just marks a region of memory as dirty.
ram: Introduce migration_bitmap_test_and_reset_dirty()
It just test if the dirty bit is set, and clears it.
ram: Export last_ram_offset()
Is the only way of knowing the RAM size.
ram: introduce migration_bitmap_sync()
Helper that we use each time that we need to syncronize the migrationbitmap with the other dirty bitmaps.
ram: create trace event for migration sync bitmap
Separate migration bitmap
This patch creates a migration bitmap, which is periodically kept insync with the qemu bitmap. A separate copy of the dirty bitmap for themigration limits the amount of concurrent access to the qemu bitmapfrom iothread and migration thread (which requires taking the big...
migration: Add dirty_pages_rate to query migrate output
It indicates how many pages were dirtied during the last second.
BufferedFile: append, then flush
Simplify the logic for pushing data from the buffer to the outputpipe/socket. This also matches more closely what will be theoperation of the migration thread.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>...
buffered_file: rename opaque to migration_state
buffered_file: opaque is MigrationState
It always have that type, just change it.We will remove buffered file later on the migration thread series.
buffered_file: unfold migrate_fd_put_buffer
We only used it once, just remove the callback indirection
buffered_file: unfold migrate_fd_put_ready
We only use it once, just remove the callback indirection.
buffered_file: g_realloc() can't fail
target-mips: Pass MIPSCPU to mips_vpe_is_wfi()
Needed for moving halted field to CPUState.The variable name "c" is retained for MIPSCPU to leave "cpu" for CPUState.
Also change return type to bool while at it.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
target-mips: Pass MIPSCPU to mips_tc_sleep()
Needed for changing mips_vpe_sleep() argument type to MIPSCPU.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-mips: Pass MIPSCPU to mips_vpe_sleep()
Needed for moving halted field to CPUState.
target-mips: Clean up other_cpu in helper_{d,e}vpe()
Free the variable name "other_cpu" for later use for MIPSCPU.
Fix off-by-one indentation while at it.
target-mips: Pass MIPSCPU to mips_tc_wake()
Needed for changing mips_vpe_is_wfi() argument type to MIPSCPU.
tcg/ia64: remove suboptimal register shifting in qemu_ld/st ops
Remove suboptimal register shifting in qemu_ld/st ops, introduced at theCONFIG_TCG_PASS_AREG0 time.
As mem_idx is now loaded in register R58/R59 for the slow path, we haveto make sure to do it last, to not add additional register constraints....
tcg/ia64: slightly optimize TLB access code
It is possible to slightly optimize the TLB access code, by replacingthe movi + and instructions by a deposit instruction.
Reviewed-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg-ia64: Implement deposit
Note that in the general reg=reg,reg case we're restrictedto 16-bit insertions. This makes it easy to allow "any" constant as input, as post-truncation it will fit into theconstant load insn for which we have room in the bundle....
tcg/ia64: use stack for TCG temps
Use stack instead of temp_buf array in CPUState for TCG temps.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg/ia64: implement movcond_i32/64
Implement movcond_i32/64 on ia64 hosts. It is not possible to haveimmediate compare arguments without adding a new bundle, but it ispossible to have 22-bit immediate value arguments.
Reviewed-by: Richard Henderson <rth@twiddle.net>...
tcg/arm: Implement movcond_i32
Implement movcond_i32 for ARM, as the sequence mov dst, v2 (implicitly done by the tcg common code) cmp c1, c2 movCC dst, v1
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg/arm: Factor out code to emit immediate or reg-reg op
The code to emit either an immediate cmp or a register cmp insn isduplicated in several places; factor it out into its own function.
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()
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.