Edgar E. Iglesias [Thu, 26 Apr 2012 12:17:41 +0000 (14:17 +0200)]
microblaze: Support setting of TLS ptr
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Peter Crosthwaite [Tue, 16 Oct 2012 09:15:50 +0000 (19:15 +1000)]
target-arm/translate: Fix RRX operands
Instructions that both use the RRX second operand and update CS were
incorrect, as the Carry flag was updated too early. An example of such an
instruction would be:
ands r12,r13,RRX
Ands, because of the "s" flag will update the carry flag. But the RRX second
operand rotates through the C flag which should happen before the update.
Fixed the ordering of the two, the old carry is read by "r13,RRX" before being
updated.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reported-by: Vinesh Peringat <vineshp@xilinx.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Tue, 2 Oct 2012 18:32:30 +0000 (11:32 -0700)]
tcg: Optimize mulu2
Like add2, do operand ordering, constant folding, and dead operand
elimination. The latter happens about 15% of all mulu2 during an
x86_64 bios boot.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Tue, 2 Oct 2012 18:32:29 +0000 (11:32 -0700)]
tcg: Optimize half-dead add2/sub2
When x86_64 guest is not in 64-bit mode, the high-part of the 64-bit
add is dead. When the host is 32-bit, we can simplify to 32-bit
arithmetic.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Tue, 2 Oct 2012 18:32:28 +0000 (11:32 -0700)]
tcg: Constant fold add2 and sub2
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Tue, 2 Oct 2012 18:32:27 +0000 (11:32 -0700)]
tcg: Do constant folding on double-word comparisons
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Tue, 2 Oct 2012 18:32:26 +0000 (11:32 -0700)]
tcg: Split out subroutines from do_constant_folding_cond
We can re-use these for implementing double-word folding.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Tue, 2 Oct 2012 18:32:25 +0000 (11:32 -0700)]
tcg: Optimize double-word comparisons against zero
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Tue, 2 Oct 2012 18:32:24 +0000 (11:32 -0700)]
tcg: Use common code when failing to optimize
This saves a whole lot of repetitive code sequences.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Tue, 2 Oct 2012 18:32:23 +0000 (11:32 -0700)]
tcg: Swap commutative double-word comparisons
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Tue, 2 Oct 2012 18:32:22 +0000 (11:32 -0700)]
tcg: Canonicalize add2 operand ordering
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Tue, 2 Oct 2012 18:32:21 +0000 (11:32 -0700)]
tcg: Split out swap_commutative as a subroutine
Reduces code duplication and prefers
movcond d, c1, c2, const, s
to
movcond d, c1, c2, s, const
It also prefers
add r, r, c
over
add r, c, r
when both inputs are known constants. This doesn't matter for true add, as
we will fully constant fold that. But it matters for a follow-on patch using
this routine for add2 which may not be fully foldable.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Andreas Färber [Thu, 11 Oct 2012 22:56:37 +0000 (00:56 +0200)]
target-mips: Pass MIPSCPU to mips_vpe_sleep()
Needed for moving halted field to CPUState.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Andreas Färber [Thu, 11 Oct 2012 22:56:36 +0000 (00:56 +0200)]
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>
Andreas Färber [Thu, 11 Oct 2012 22:56:35 +0000 (00:56 +0200)]
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>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Andreas Färber [Thu, 11 Oct 2012 22:56:34 +0000 (00:56 +0200)]
target-mips: Pass MIPSCPU to mips_tc_wake()
Needed for changing mips_vpe_is_wfi() argument type to MIPSCPU.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Andreas Färber [Thu, 11 Oct 2012 22:56:33 +0000 (00:56 +0200)]
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.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Wed, 10 Oct 2012 23:01:35 +0000 (16:01 -0700)]
tcg-ia64: Implement deposit
Note that in the general reg=reg,reg case we're restricted
to 16-bit insertions. This makes it easy to allow "any"
constant as input, as post-truncation it will fit into the
constant load insn for which we have room in the bundle.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Tue, 9 Oct 2012 19:53:55 +0000 (21:53 +0200)]
tcg/ia64: slightly optimize TLB access code
It is possible to slightly optimize the TLB access code, by replacing
the movi + and instructions by a deposit instruction.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Tue, 9 Oct 2012 19:53:55 +0000 (21:53 +0200)]
tcg/ia64: remove suboptimal register shifting in qemu_ld/st ops
Remove suboptimal register shifting in qemu_ld/st ops, introduced at the
CONFIG_TCG_PASS_AREG0 time.
As mem_idx is now loaded in register R58/R59 for the slow path, we have
to make sure to do it last, to not add additional register constraints.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Tue, 9 Oct 2012 19:53:55 +0000 (21:53 +0200)]
tcg/ia64: implement movcond_i32/64
Implement movcond_i32/64 on ia64 hosts. It is not possible to have
immediate compare arguments without adding a new bundle, but it is
possible to have 22-bit immediate value arguments.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Blue Swirl [Tue, 9 Oct 2012 19:53:55 +0000 (21:53 +0200)]
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>
Peter Maydell [Wed, 26 Sep 2012 18:48:55 +0000 (19:48 +0100)]
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>
Peter Maydell [Wed, 26 Sep 2012 18:48:54 +0000 (19:48 +0100)]
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 is
duplicated in several places; factor it out into its own function.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
malc [Sun, 14 Oct 2012 10:54:38 +0000 (14:54 +0400)]
Fix popcnt in long mode
Thanks to Andriy Gapon for initial problem report.
Signed-off-by: malc <av1474@comtv.ru>
Andreas Färber [Fri, 12 Oct 2012 02:23:08 +0000 (04:23 +0200)]
sun4u: Pass SPARCCPU to cpu_set_ivec_irq()
Needed for moving halted field to CPUState.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Andreas Färber [Fri, 12 Oct 2012 02:23:07 +0000 (04:23 +0200)]
sun4u: Pass SPARCCPU to cpu_kick_irq()
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>
Andreas Färber [Fri, 12 Oct 2012 02:23:06 +0000 (04:23 +0200)]
sun4u: Pass SPARCCPU to {,s,hs}tick_irq() and cpu_timer_create()
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>
Andreas Färber [Fri, 12 Oct 2012 02:23:05 +0000 (04:23 +0200)]
sun4m: Pass SPARCCPU to cpu_kick_irq()
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>
Andreas Färber [Fri, 12 Oct 2012 02:23:04 +0000 (04:23 +0200)]
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>
Richard Henderson [Wed, 10 Oct 2012 16:02:47 +0000 (09:02 -0700)]
tcg-sparc: Emit MOVR insns for setcond_i64 and movcond_64
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Wed, 10 Oct 2012 16:02:46 +0000 (09:02 -0700)]
tcg-sparc: Emit BPr insns for brcond_i64
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Wed, 10 Oct 2012 16:02:45 +0000 (09:02 -0700)]
tcg-sparc: Dump illegal opode contents
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Wed, 10 Oct 2012 16:02:44 +0000 (09:02 -0700)]
tcg-sparc: Drop use of Bicc in favor of BPcc
Now that we're always sparcv9, we can not bother using Bicc for
32-bit branches and BPcc for 64-bit branches and instead always
use BPcc.
New interfaces allow less direct use of tcg_out32 and raw numbers
inside the qemu_ld/st routines.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Wed, 10 Oct 2012 16:02:43 +0000 (09:02 -0700)]
tcg-sparc: Optimize setcond2 equality compare with 0.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Wed, 10 Oct 2012 16:02:42 +0000 (09:02 -0700)]
tcg-sparc: Use Z constraint for %g0
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Wed, 10 Oct 2012 16:02:41 +0000 (09:02 -0700)]
tcg-sparc: Fix add2/sub2
We must care not to clobber the high parts before we consume them.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Wed, 10 Oct 2012 16:02:40 +0000 (09:02 -0700)]
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; the
register may already be in use from setcond2.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Wed, 10 Oct 2012 16:02:39 +0000 (09:02 -0700)]
tcg-sparc: Fix qemu_st for 32-bit
The datalo variable is still live in the miss path. Use another
when reconstructing the full data value.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Wed, 10 Oct 2012 16:02:38 +0000 (09:02 -0700)]
tcg-sparc: Fix setcond2
Like brcond2, use tcg_high_cond. Use movcc instead of branches.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Wed, 10 Oct 2012 16:02:37 +0000 (09:02 -0700)]
tcg-sparc: Implement movcond.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Wed, 10 Oct 2012 16:02:36 +0000 (09:02 -0700)]
tcg-sparc: Fix brcond2
Much the same problem as recently fixed for hppa.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Tue, 9 Oct 2012 21:50:00 +0000 (14:50 -0700)]
target-sparc: Don't compute full flags value so often
Avoid speculatively computing flags before every potentially trapping
operation and instead do the flags computation when a trap actually
occurs. This gives approximately 30% speedup in emulation.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Tue, 9 Oct 2012 21:49:59 +0000 (14:49 -0700)]
target-sparc: Avoid unnecessary local temporaries
Now that save_state never ends a BB, we don't need to copy
values into local temps around it.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Tue, 9 Oct 2012 21:49:58 +0000 (14:49 -0700)]
target-sparc: Optimize CC_OP_LOGIC conditions
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Tue, 9 Oct 2012 21:49:57 +0000 (14:49 -0700)]
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>
Anthony Liguori [Fri, 12 Oct 2012 16:20:14 +0000 (11:20 -0500)]
Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging
* 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
Anthony Liguori [Fri, 12 Oct 2012 16:19:56 +0000 (11:19 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
* stefanha/trivial-patches:
vnc: fix "info vnc" with "-vnc ..., reverse=on"
sheepdog: use bool for boolean variables
configure: Tidy up remnants of non-64-bit physaddrs
Anthony Liguori [Fri, 12 Oct 2012 14:14:32 +0000 (09:14 -0500)]
Merge remote-tracking branch 'kraxel/usb.67' into staging
* 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
Anthony Liguori [Fri, 12 Oct 2012 14:14:23 +0000 (09:14 -0500)]
Merge remote-tracking branch 'mdroth/qga-pull-10-9-12' into staging
* mdroth/qga-pull-10-9-12:
qemu-ga: ga_open_pidfile(): add new line to pidfile
qemu-ga: use state dir from CONFIG_QEMU_LOCALSTATEDIR
configure: add --localstatedir
Anthony Liguori [Fri, 12 Oct 2012 14:14:14 +0000 (09:14 -0500)]
Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-
20121008.0' 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
Anthony Liguori [Fri, 12 Oct 2012 14:14:04 +0000 (09:14 -0500)]
Merge remote-tracking branch 'stefanha/net' into staging
* 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
Anthony Liguori [Fri, 12 Oct 2012 14:13:58 +0000 (09:13 -0500)]
Merge remote-tracking branch 'spice/spice.v61' into staging
* 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
Peter Maydell [Fri, 12 Oct 2012 10:54:39 +0000 (11:54 +0100)]
arm_gic: Rename gic_state to GICState
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>
Peter A. G. Crosthwaite [Fri, 12 Oct 2012 10:54:39 +0000 (11:54 +0100)]
zynq_slcr: Fixed ResetValues enum
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>
Jean-Christophe PLAGNIOL-VILLARD [Fri, 12 Oct 2012 10:54:39 +0000 (11:54 +0100)]
versatilepb: add gpio pl061 support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Peter Maydell [Fri, 12 Oct 2012 10:54:38 +0000 (11:54 +0100)]
hw/ds1338: Implement state save/restore
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>
Peter Maydell [Fri, 12 Oct 2012 10:54:38 +0000 (11:54 +0100)]
hw/ds1338: Remove 'now' field from state struct
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>
Peter Maydell [Fri, 12 Oct 2012 10:54:38 +0000 (11:54 +0100)]
hw/ds1338: Recapture current time when register pointer wraps around
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>
Peter Maydell [Fri, 12 Oct 2012 10:54:38 +0000 (11:54 +0100)]
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
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>
Evgeny Voevodin [Fri, 12 Oct 2012 10:54:37 +0000 (11:54 +0100)]
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>
Soren Brinkmann [Fri, 12 Oct 2012 10:54:37 +0000 (11:54 +0100)]
cadence_ttc: Fix 'clear on read' behavior
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>
Paolo Bonzini [Wed, 10 Oct 2012 12:30:58 +0000 (14:30 +0200)]
vnc: fix "info vnc" with "-vnc ..., reverse=on"
When reverse connection is in use, there is no active VNC server
socket. Because of this, getsockopt(-1, ...) is attempted and
the following error is emitted:
$ socat TCP-LISTEN:5900,reuseaddr TCP-LISTEN:5901,reuseaddr &
$ x86_64-softmmu/qemu-system-x86_64 -vnc localhost:5900,reverse -monitor stdio
QEMU 1.2.50 monitor - type 'help' for more information
(qemu) info vnc
An undefined error has occurred
Because however the host, family, service and auth fields are
optional, we can just exit if there is no active server socket.
$ x86_64-softmmu/qemu-system-x86_64 -vnc localhost:5900,reverse -monitor stdio
QEMU 1.2.50 monitor - type 'help' for more information
(qemu) info vnc
Server:
Client:
address: 127.0.0.1:5900
x509_dname: none
username: none
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
MORITA Kazutaka [Sat, 6 Oct 2012 16:57:14 +0000 (01:57 +0900)]
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>
Peter Maydell [Fri, 5 Oct 2012 16:33:22 +0000 (17:33 +0100)]
configure: Tidy up remnants of non-64-bit physaddrs
Tidy up some remnants of code to support non-64-bit physaddrs
which were accidentally omitted from commit
4be403c8.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Hans de Goede [Wed, 10 Oct 2012 13:50:36 +0000 (15:50 +0200)]
uhci: Raise interrupt when requested even for non active tds
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>
Hans de Goede [Thu, 27 Sep 2012 15:25:45 +0000 (17:25 +0200)]
usb-redir: Don't make migration fail in none seamless case
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>
Hans de Goede [Thu, 27 Sep 2012 15:25:44 +0000 (17:25 +0200)]
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>
Peter Crosthwaite [Mon, 1 Oct 2012 02:34:37 +0000 (12:34 +1000)]
ssi: Add slave autoconnect helper
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>
Peter A. G. Crosthwaite [Mon, 6 Aug 2012 01:38:19 +0000 (11:38 +1000)]
MAINTAINERS: Added maintainerships for SSI
Added maintainership for SSI, M25P80 and the Xilinx SPI controllers.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Peter A. G. Crosthwaite [Fri, 3 Aug 2012 06:08:48 +0000 (16:08 +1000)]
xilinx_zynq: Added SPI controllers + flashes
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>
Peter A. G. Crosthwaite [Wed, 1 Aug 2012 10:52:36 +0000 (20:52 +1000)]
xilinx_spips: Xilinx Zynq SPI cntrlr device model
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>
Peter A. G. Crosthwaite [Tue, 27 Mar 2012 07:57:47 +0000 (17:57 +1000)]
petalogix-ml605: added SPI controller with n25q128
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>
Peter A. G. Crosthwaite [Mon, 26 Mar 2012 12:59:55 +0000 (22:59 +1000)]
xilinx_spi: Initial impl. of Xilinx SPI controller
Device model for xilinx XPS SPI controller (v2.0)
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Peter A. G. Crosthwaite [Mon, 26 Mar 2012 12:10:59 +0000 (22:10 +1000)]
m25p80: Initial implementation of SPI flash device
Added device model for m25p80 style SPI flash family.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Peter A. G. Crosthwaite [Wed, 1 Aug 2012 10:26:12 +0000 (20:26 +1000)]
hw: Added generic FIFO API.
Added a FIFO API that can be used to create and operate byte FIFOs.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Peter A. G. Crosthwaite [Tue, 31 Jul 2012 06:42:04 +0000 (16:42 +1000)]
stellaris: Removed SSI mux
Removed the explicit SSI mux and wired the CS line directly up to the SSI
devices.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Peter A. G. Crosthwaite [Tue, 31 Jul 2012 02:24:06 +0000 (12:24 +1000)]
qdev: allow multiple qdev_init_gpio_in() calls
Allow multiple qdev_init_gpio_in() calls for the one device. The first call will
define GPIOs 0-N-1, the next GPIOs N- ... . Allows different GPIOs to be handled
with different handlers. Needed when two levels of the QOM class heirachy both
define GPIO functionality, as a single GPIO handler with an index selecter is
not possible.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Peter A. G. Crosthwaite [Tue, 24 Jul 2012 03:56:27 +0000 (13:56 +1000)]
ssi: Added create_slave_no_init()
Slave creation function that can be used to create an SSI slave without
qdev_init() being called. This give machine models a chance to set properties.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Peter A. G. Crosthwaite [Tue, 24 Jul 2012 02:23:22 +0000 (12:23 +1000)]
ssi: Implemented CS behaviour
Added default CS behaviour for SSI slaves. SSI devices can set a property
to enable CS behaviour which will create a GPIO on the device which is the
CS. Tristating of the bus on SSI transfers is implemented.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Peter A. G. Crosthwaite [Tue, 24 Jul 2012 00:55:15 +0000 (10:55 +1000)]
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 function
called for transfers. Each device is responsible for knowing whether or not its
CS is active, and if not returning 0. The returned data is the logical or of
all responses from the (mulitple) devices.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Luiz Capitulino [Wed, 3 Oct 2012 21:40:01 +0000 (18:40 -0300)]
qemu-ga: ga_open_pidfile(): add new line to pidfile
FHS requires that pid files should end with a new line. Also change to
snprintf() while there.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Luiz Capitulino [Wed, 3 Oct 2012 21:35:58 +0000 (18:35 -0300)]
qemu-ga: use state dir from CONFIG_QEMU_LOCALSTATEDIR
Has the side effect of changing the default directory used to
save 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
still exist between invocations of the program. This defeats
the purpose of the freeze status file
2. FHS dictates that /var/run must be cleaned on boot, this
ensures that a stale freeze status file will be removed on boot
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>
Luiz Capitulino [Wed, 3 Oct 2012 21:35:57 +0000 (18:35 -0300)]
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>
Jan Kiszka [Mon, 8 Oct 2012 14:45:31 +0000 (08:45 -0600)]
vfio-pci: Fix BAR->VFIODevice translation in
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>
Alex Williamson [Mon, 8 Oct 2012 14:45:31 +0000 (08:45 -0600)]
vfio-pci: Clang cleanup
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>
Alex Williamson [Mon, 8 Oct 2012 14:45:30 +0000 (08:45 -0600)]
vfio-pci: Cleanup on INTx setup failure
Missing some unwind code.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:30 +0000 (08:45 -0600)]
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 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>
Alex Williamson [Mon, 8 Oct 2012 14:45:30 +0000 (08:45 -0600)]
vfio-pci: Remove setting of MSI qsize
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>
Alex Williamson [Mon, 8 Oct 2012 14:45:30 +0000 (08:45 -0600)]
vfio-pci: Use uintptr_t for void* cast
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>
Alex Williamson [Mon, 8 Oct 2012 14:45:30 +0000 (08:45 -0600)]
vfio-pci: Don't peak at msi_supported
Let the init function fail, just don't warn for -ENOTSUP.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:30 +0000 (08:45 -0600)]
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>
Alex Williamson [Mon, 8 Oct 2012 14:45:29 +0000 (08:45 -0600)]
vfio-pci: No spurious MSIs
FreeBSD doesn't like these spurious MSIs, remove them as they're
mostly paranoia anyway.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:29 +0000 (08:45 -0600)]
vfio-pci: Rework MSIX setup/teardown
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>
Alex Williamson [Mon, 8 Oct 2012 14:45:29 +0000 (08:45 -0600)]
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 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>
Alex Williamson [Mon, 8 Oct 2012 14:45:29 +0000 (08:45 -0600)]
vfio-pci: Re-order map/unmap
This cleans up the next patch that calls unmap from map.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Mon, 8 Oct 2012 14:45:29 +0000 (08:45 -0600)]
vfio-pci: Update slow path INTx algorithm
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>
Paolo Bonzini [Mon, 17 Sep 2012 16:43:51 +0000 (18:43 +0200)]
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 interface
for tap. Then having both net/tap.h and include/net/tap.h does
not work. "Fixed" by moving all the init functions to a single
header file net/clients.h.
The patch also adopts a uniform style for including net/*.h files
from net/*.c, without the net/ path.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Amos Kong [Fri, 28 Sep 2012 02:06:02 +0000 (10:06 +0800)]
virtio-net: update nc.link_down in virtio_net_load()
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>
Amos Kong [Fri, 28 Sep 2012 02:06:01 +0000 (10:06 +0800)]
e1000: update nc.link_down in e1000_post_load()
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>