]> git.proxmox.com Git - qemu.git/log
qemu.git
11 years agobuffered_file: unfold migrate_fd_wait_for_unfreeze
Juan Quintela [Fri, 20 Jul 2012 11:16:28 +0000 (13:16 +0200)]
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>
11 years agobuffered_file: unfold migrate_fd_put_ready
Juan Quintela [Fri, 20 Jul 2012 11:13:59 +0000 (13:13 +0200)]
buffered_file: unfold migrate_fd_put_ready

We only use it once, just remove the callback indirection.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agobuffered_file: unfold migrate_fd_put_buffer
Juan Quintela [Fri, 20 Jul 2012 11:10:54 +0000 (13:10 +0200)]
buffered_file: unfold migrate_fd_put_buffer

We only used it once, just remove the callback indirection

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agobuffered_file: opaque is MigrationState
Juan Quintela [Fri, 20 Jul 2012 11:07:17 +0000 (13:07 +0200)]
buffered_file: opaque is MigrationState

It always have that type, just change it.
We will remove buffered file later on the migration thread series.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agobuffered_file: rename opaque to migration_state
Juan Quintela [Fri, 20 Jul 2012 11:04:42 +0000 (13:04 +0200)]
buffered_file: rename opaque to migration_state

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoBufferedFile: append, then flush
Paolo Bonzini [Tue, 16 Aug 2011 23:43:24 +0000 (16:43 -0700)]
BufferedFile: append, then flush

Simplify the logic for pushing data from the buffer to the output
pipe/socket.  This also matches more closely what will be the
operation of the migration thread.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agomigration: Add dirty_pages_rate to query migrate output
Juan Quintela [Mon, 13 Aug 2012 10:31:25 +0000 (12:31 +0200)]
migration: Add dirty_pages_rate to query migrate output

It indicates how many pages were dirtied during the last second.

Signed-off-by: Juan Quintela <quintela@redhat.com>
11 years agoSeparate migration bitmap
Juan Quintela [Fri, 20 Jul 2012 10:33:00 +0000 (12:33 +0200)]
Separate migration bitmap

This patch creates a migration bitmap, which is periodically kept in
sync with the qemu bitmap. A separate copy of the dirty bitmap for the
migration limits the amount of concurrent access to the qemu bitmap
from iothread and migration thread (which requires taking the big
lock).

We use the qemu bitmap type.  We have to "undo" the dirty_pages
counting optimization on the general dirty bitmap and do the counting
optimization with the migration local bitmap.

Signed-off-by: Umesh Deshpande <udeshpan@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
11 years agoram: create trace event for migration sync bitmap
Juan Quintela [Tue, 4 Sep 2012 11:08:57 +0000 (13:08 +0200)]
ram: create trace event for migration sync bitmap

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoram: introduce migration_bitmap_sync()
Juan Quintela [Fri, 20 Jul 2012 08:52:51 +0000 (10:52 +0200)]
ram: introduce migration_bitmap_sync()

Helper that we use each time that we need to syncronize the migration
bitmap with the other dirty bitmaps.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoram: Export last_ram_offset()
Juan Quintela [Fri, 20 Jul 2012 08:37:54 +0000 (10:37 +0200)]
ram: Export last_ram_offset()

Is the only way of knowing the RAM size.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoram: Introduce migration_bitmap_test_and_reset_dirty()
Juan Quintela [Fri, 20 Jul 2012 08:36:12 +0000 (10:36 +0200)]
ram: Introduce migration_bitmap_test_and_reset_dirty()

It just test if the dirty bit is set, and clears it.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agoram: introduce migration_bitmap_set_dirty()
Juan Quintela [Fri, 20 Jul 2012 08:16:08 +0000 (10:16 +0200)]
ram: introduce migration_bitmap_set_dirty()

It just marks a region of memory as dirty.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agosavevm: Factorize ram globals reset in its own function
Juan Quintela [Tue, 17 Jul 2012 15:02:24 +0000 (17:02 +0200)]
savevm: Factorize ram globals reset in its own function

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agomigration: print expected downtime in info migrate
Juan Quintela [Mon, 13 Aug 2012 07:53:12 +0000 (09:53 +0200)]
migration: print expected downtime in info migrate

Signed-off-by: Juan Quintela <quintela@redhat.com>
11 years agomigration: export migrate_get_current()
Juan Quintela [Mon, 13 Aug 2012 07:42:49 +0000 (09:42 +0200)]
migration: export migrate_get_current()

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomigration: rename expected_time to expected_downtime
Juan Quintela [Mon, 13 Aug 2012 07:36:36 +0000 (09:36 +0200)]
migration: rename expected_time to expected_downtime

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agomigration: print total downtime for final phase of migration
Juan Quintela [Mon, 13 Aug 2012 07:35:16 +0000 (09:35 +0200)]
migration: print total downtime for final phase of migration

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agomigration: store end_time in a local variable
Juan Quintela [Fri, 10 Aug 2012 19:53:08 +0000 (21:53 +0200)]
migration: store end_time in a local variable

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agofix migration sync
Juan Quintela [Fri, 3 Aug 2012 10:58:16 +0000 (12:58 +0200)]
fix migration sync

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agobuffered_file: g_realloc() can't fail
Juan Quintela [Tue, 24 Jul 2012 12:14:32 +0000 (14:14 +0200)]
buffered_file: g_realloc() can't fail

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agotarget-mips: Pass MIPSCPU to mips_vpe_sleep()
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>
11 years agotarget-mips: Pass MIPSCPU to mips_tc_sleep()
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>
11 years agotarget-mips: Pass MIPSCPU to mips_vpe_is_wfi()
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>
11 years agotarget-mips: Pass MIPSCPU to mips_tc_wake()
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>
11 years agotarget-mips: Clean up other_cpu in helper_{d,e}vpe()
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>
11 years agotcg-ia64: Implement deposit
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>
11 years agotcg/ia64: slightly optimize TLB access code
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>
11 years agotcg/ia64: remove suboptimal register shifting in qemu_ld/st ops
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>
11 years agotcg/ia64: implement movcond_i32/64
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>
11 years agotcg/ia64: use stack for TCG temps
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>
11 years agotcg/arm: Implement movcond_i32
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>
11 years agotcg/arm: Factor out code to emit immediate or reg-reg op
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>
11 years agoFix popcnt in long mode
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>
11 years agosun4u: Pass SPARCCPU to cpu_set_ivec_irq()
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>
11 years agosun4u: Pass SPARCCPU to cpu_kick_irq()
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>
11 years agosun4u: Pass SPARCCPU to {,s,hs}tick_irq() and cpu_timer_create()
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>
11 years agosun4m: Pass SPARCCPU to cpu_kick_irq()
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>
11 years agosun4m: Pass SPARCCPU to cpu_set_irq()
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>
11 years agotcg-sparc: Emit MOVR insns for setcond_i64 and movcond_64
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>
11 years agotcg-sparc: Emit BPr insns for brcond_i64
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>
11 years agotcg-sparc: Dump illegal opode contents
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>
11 years agotcg-sparc: Drop use of Bicc in favor of BPcc
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>
11 years agotcg-sparc: Optimize setcond2 equality compare with 0.
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>
11 years agotcg-sparc: Use Z constraint for %g0
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>
11 years agotcg-sparc: Fix add2/sub2
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>
11 years agotcg-sparc: Fix setcond
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>
11 years agotcg-sparc: Fix qemu_st for 32-bit
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>
11 years agotcg-sparc: Fix setcond2
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>
11 years agotcg-sparc: Implement movcond.
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>
11 years agotcg-sparc: Fix brcond2
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>
11 years agotarget-sparc: Don't compute full flags value so often
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>
11 years agotarget-sparc: Avoid unnecessary local temporaries
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>
11 years agotarget-sparc: Optimize CC_OP_LOGIC conditions
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>
11 years agotarget-sparc: Fix optimized %icc comparisons
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>
11 years agoMerge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging
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

11 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
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

11 years agoMerge remote-tracking branch 'kraxel/usb.67' into staging
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

11 years agoMerge remote-tracking branch 'mdroth/qga-pull-10-9-12' into staging
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

11 years agoMerge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-20121008.0' into staging
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

11 years agoMerge remote-tracking branch 'stefanha/net' into staging
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

11 years agoMerge remote-tracking branch 'spice/spice.v61' into staging
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

11 years agoarm_gic: Rename gic_state to GICState
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>
11 years agozynq_slcr: Fixed ResetValues enum
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>
11 years agoversatilepb: add gpio pl061 support
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>
11 years agohw/ds1338: Implement state save/restore
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>
11 years agohw/ds1338: Remove 'now' field from state struct
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>
11 years agohw/ds1338: Recapture current time when register pointer wraps around
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>
11 years agohw/ds1338: Fix mishandling of register pointer
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>
11 years agohw/arm_gic.c: Fix improper DPRINTF output.
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>
11 years agocadence_ttc: Fix 'clear on read' behavior
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>
11 years agovnc: fix "info vnc" with "-vnc ..., reverse=on"
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>
11 years agosheepdog: use bool for boolean variables
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>
11 years agoconfigure: Tidy up remnants of non-64-bit physaddrs
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>
11 years agouhci: Raise interrupt when requested even for non active tds
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>
11 years agousb-redir: Don't make migration fail in none seamless case
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>
11 years agousb-redir: Change usbredir_open_chardev into usbredir_create_parser
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>
11 years agossi: Add slave autoconnect helper
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>
11 years agoMAINTAINERS: Added maintainerships for SSI
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>
11 years agoxilinx_zynq: Added SPI controllers + flashes
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>
11 years agoxilinx_spips: Xilinx Zynq SPI cntrlr device model
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>
11 years agopetalogix-ml605: added SPI controller with n25q128
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>
11 years agoxilinx_spi: Initial impl. of Xilinx SPI controller
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>
11 years agom25p80: Initial implementation of SPI flash device
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>
11 years agohw: Added generic FIFO API.
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>
11 years agostellaris: Removed SSI mux
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>
11 years agoqdev: allow multiple qdev_init_gpio_in() calls
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>
11 years agossi: Added create_slave_no_init()
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>
11 years agossi: Implemented CS behaviour
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>
11 years agossi: Support for multiple attached devices
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>
11 years agoqemu-ga: ga_open_pidfile(): add new line to pidfile
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>
11 years agoqemu-ga: use state dir from CONFIG_QEMU_LOCALSTATEDIR
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>
11 years agoconfigure: add --localstatedir
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>
11 years agovfio-pci: Fix BAR->VFIODevice translation in
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>
11 years agovfio-pci: Clang cleanup
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>
11 years agovfio-pci: Cleanup on INTx setup failure
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>
11 years agovfio-pci: Extend reset
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>
11 years agovfio-pci: Remove setting of MSI qsize
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>
11 years agovfio-pci: Use uintptr_t for void* cast
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>
11 years agovfio-pci: Don't peak at msi_supported
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>