]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
10 years agotcg-aarch64: Make debug_frame const
Richard Henderson [Thu, 15 May 2014 19:49:13 +0000 (12:49 -0700)]
tcg-aarch64: Make debug_frame const

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-i386: Make debug_frame const
Richard Henderson [Thu, 15 May 2014 19:48:43 +0000 (12:48 -0700)]
tcg-i386: Make debug_frame const

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Allow the debug_frame data structure to be constant
Richard Henderson [Thu, 15 May 2014 19:48:01 +0000 (12:48 -0700)]
tcg: Allow the debug_frame data structure to be constant

Adjust the FDE to point to the code_buffer after we've copied it
to the image, rather than requiring that the backend set it prior.
This allows the backend to use read-only storage for its data.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Move size effects out of dh_arg
Richard Henderson [Tue, 8 Apr 2014 15:53:28 +0000 (08:53 -0700)]
tcg: Move size effects out of dh_arg

Tidying the initialization of the args arrays at the same time.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Remove sizemask and flags arguments to tcg_gen_callN
Richard Henderson [Tue, 8 Apr 2014 15:39:43 +0000 (08:39 -0700)]
tcg: Remove sizemask and flags arguments to tcg_gen_callN

Take them from the TCGHelperInfo struct instead.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Save flags and computed sizemask in TCGHelperInfo
Richard Henderson [Mon, 7 Apr 2014 22:10:05 +0000 (15:10 -0700)]
tcg: Save flags and computed sizemask in TCGHelperInfo

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Register the helper info struct rather than the name
Richard Henderson [Tue, 8 Apr 2014 07:17:53 +0000 (00:17 -0700)]
tcg: Register the helper info struct rather than the name

This will let us find all the info from the hash table.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Move side effects out of dh_sizemask
Richard Henderson [Tue, 8 Apr 2014 07:01:09 +0000 (00:01 -0700)]
tcg: Move side effects out of dh_sizemask

Moving them into dh_arg instead.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Inline tcg_gen_helperN
Richard Henderson [Tue, 8 Apr 2014 06:44:10 +0000 (23:44 -0700)]
tcg: Inline tcg_gen_helperN

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Use helper-gen.h in tcg-op.h
Richard Henderson [Tue, 8 Apr 2014 06:36:08 +0000 (23:36 -0700)]
tcg: Use helper-gen.h in tcg-op.h

No need to open-code the setup of the builtin helpers.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Push tcg-runtime routines into exec/helper-*
Richard Henderson [Tue, 8 Apr 2014 06:08:47 +0000 (23:08 -0700)]
tcg: Push tcg-runtime routines into exec/helper-*

Rather than special casing them, use the standard mechanisms
for tcg helper generation.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Invert the inclusion of helper.h
Richard Henderson [Tue, 8 Apr 2014 05:31:41 +0000 (22:31 -0700)]
tcg: Invert the inclusion of helper.h

Rather than include helper.h with N values of GEN_HELPER, include a
secondary file that sets up the macros to include helper.h.  This
minimizes the files that must be rebuilt when changing the macros
for file N.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg: Optimize brcond2 and setcond2 ne/eq
Richard Henderson [Thu, 24 Apr 2014 05:18:30 +0000 (22:18 -0700)]
tcg: Optimize brcond2 and setcond2 ne/eq

If either the high or low pair can be resolved, we can
simplify to either a constant or to a 32-bit comparison.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agoMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Peter Maydell [Wed, 28 May 2014 14:22:40 +0000 (15:22 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

Block pull request

# gpg: Signature made Wed 28 May 2014 13:31:15 BST using RSA key ID 81AB73C8
# gpg: Can't check signature: public key not found

* remotes/stefanha/tags/block-pull-request: (33 commits)
  block/sheepdog: Don't use qerror_report()
  block/sheepdog: Fix silent sd_open(), sd_create() failures
  block/sheepdog: Propagate errors to open and create methods
  block/sheepdog: Propagate errors through find_vdi_name()
  block/sheepdog: Propagate errors through do_sd_create()
  block/sheepdog: Propagate errors through sd_prealloc()
  block/sheepdog: Propagate errors through get_sheep_fd()
  block/sheepdog: Propagate errors through connect_to_sdog()
  block/vvfat: Propagate errors through init_directories()
  block/vvfat: Propagate errors through enable_write_target()
  block/ssh: Propagate errors to open and create methods
  block/ssh: Propagate errors through connect_to_ssh()
  block/ssh: Propagate errors through authenticate()
  block/ssh: Propagate errors through check_host_key()
  block/ssh: Drop superfluous libssh2_session_last_errno() calls
  block/rbd: Propagate errors to open and create methods
  qemu-nbd: Don't use qerror_report()
  blockdev: Don't use qerror_report() in do_drive_del()
  blockdev: Don't use qerror_report_err() in drive_init()
  docs: Define refcount_bits value
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20140527' into...
Peter Maydell [Wed, 28 May 2014 14:00:33 +0000 (15:00 +0100)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20140527' into staging

target-arm:
 * Preliminary restructuring for EL2/EL3 support
 * improve CPACR handling
 * fix pxa2xx_lcd palette formats
 * update highbank/midway maintainer

# gpg: Signature made Tue 27 May 2014 17:26:27 BST using RSA key ID 14360CDE
# gpg: Can't check signature: public key not found

* remotes/pmaydell/tags/pull-target-arm-20140527: (26 commits)
  target-arm: A64: Register VBAR_EL3
  target-arm: A64: Register VBAR_EL2
  target-arm: Make vbar_write writeback to any CPREG
  target-arm: A64: Generalize update_spsel for the various ELs
  target-arm: A64: Generalize ERET to various ELs
  target-arm: A64: Trap ERET from EL0 at translation time
  target-arm: A64: Forbid ERET to higher or unimplemented ELs
  target-arm: Register EL3 versions of ELR and SPSR
  target-arm: Register EL2 versions of ELR and SPSR
  target-arm: Add a feature flag for EL3
  target-arm: Add a feature flag for EL2
  target-arm: A64: Introduce aarch64_banked_spsr_index()
  target-arm: Add SPSR entries for EL2/HYP and EL3/MON
  target-arm: A64: Add ELR entries for EL2 and 3
  target-arm: A64: Add SP entries for EL2 and 3
  target-arm: c12_vbar -> vbar_el[]
  target-arm: Make esr_el1 an array
  target-arm: Make elr_el1 an array
  target-arm: Use a 1:1 mapping between EL and MMU index
  target-arm: A32: Use get_mem_index for load/stores
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/xtensa/tags/20140526-xtensa' into staging
Peter Maydell [Wed, 28 May 2014 13:47:35 +0000 (14:47 +0100)]
Merge remote-tracking branch 'remotes/xtensa/tags/20140526-xtensa' into staging

Xtensa fixes queue 2014-05-26:
- fix cross-page jumps/calls at the end of TB;
- add tests for TBs and instructions crossing page boundary.

# gpg: Signature made Mon 26 May 2014 09:37:39 BST using RSA key ID F83FA044
# gpg: Can't check signature: public key not found

* remotes/xtensa/tags/20140526-xtensa:
  target-xtensa: add tests for cross-page TB
  target-xtensa: completely clean TLB between MMU tests
  target-xtensa: fix cross-page jumps/calls at the end of TB

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-usb-7' into staging
Peter Maydell [Wed, 28 May 2014 12:52:03 +0000 (13:52 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-7' into staging

usb: usb3 streams support for usb-host and usb-redir
usb: xhci and mtp bugfixes.

# gpg: Signature made Mon 26 May 2014 09:44:09 BST using RSA key ID D3E87138
# gpg: Can't check signature: public key not found

* remotes/kraxel/tags/pull-usb-7:
  usb-host-libusb: Set stream id when submitting bulk-stream transfers
  usb-host-libusb: Add alloc / free streams ops
  usb-host-libusb: Fill in endpoint max_streams when available
  usb-redir: Add support for bulk streams
  usb-mtp: handle usb_mtp_get_object failure
  usb-mtp: handle lseek failure
  usb-mtp: use bool to track MTPObject init status
  xhci: add xhci_get_flag
  xhci: add endpoint cap on express bus only
  xhci: child detach fix

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoblock/sheepdog: Don't use qerror_report()
Markus Armbruster [Fri, 16 May 2014 09:00:26 +0000 (11:00 +0200)]
block/sheepdog: Don't use qerror_report()

qerror_report() is a transitional interface to help with converting
existing HMP commands to QMP.  It should not be used elsewhere.
Replace by error_report().

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: Fix silent sd_open(), sd_create() failures
Markus Armbruster [Fri, 16 May 2014 09:00:25 +0000 (11:00 +0200)]
block/sheepdog: Fix silent sd_open(), sd_create() failures

Open and create methods must set an error when they fail.

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: Propagate errors to open and create methods
Markus Armbruster [Fri, 16 May 2014 09:00:24 +0000 (11:00 +0200)]
block/sheepdog: Propagate errors to open and create methods

Completes the conversion to Error started in commit 015a103^..d5124c0,
except for a few bugs fixed in the next commit.

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: Propagate errors through find_vdi_name()
Markus Armbruster [Fri, 16 May 2014 09:00:23 +0000 (11:00 +0200)]
block/sheepdog: Propagate errors through find_vdi_name()

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: Propagate errors through do_sd_create()
Markus Armbruster [Fri, 16 May 2014 09:00:22 +0000 (11:00 +0200)]
block/sheepdog: Propagate errors through do_sd_create()

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: Propagate errors through sd_prealloc()
Markus Armbruster [Fri, 16 May 2014 09:00:21 +0000 (11:00 +0200)]
block/sheepdog: Propagate errors through sd_prealloc()

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: Propagate errors through get_sheep_fd()
Markus Armbruster [Fri, 16 May 2014 09:00:20 +0000 (11:00 +0200)]
block/sheepdog: Propagate errors through get_sheep_fd()

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/sheepdog: Propagate errors through connect_to_sdog()
Markus Armbruster [Fri, 16 May 2014 09:00:19 +0000 (11:00 +0200)]
block/sheepdog: Propagate errors through connect_to_sdog()

Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/vvfat: Propagate errors through init_directories()
Markus Armbruster [Fri, 16 May 2014 09:00:18 +0000 (11:00 +0200)]
block/vvfat: Propagate errors through init_directories()

Completes the conversion of the open method to Error started in commit
015a103.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/vvfat: Propagate errors through enable_write_target()
Markus Armbruster [Fri, 16 May 2014 09:00:17 +0000 (11:00 +0200)]
block/vvfat: Propagate errors through enable_write_target()

Continues the conversion of the open method to Error started in commit
015a103.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/ssh: Propagate errors to open and create methods
Markus Armbruster [Fri, 16 May 2014 09:00:16 +0000 (11:00 +0200)]
block/ssh: Propagate errors to open and create methods

Completes the conversion to Error started in commit 015a103^..d5124c0.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/ssh: Propagate errors through connect_to_ssh()
Markus Armbruster [Fri, 16 May 2014 09:00:15 +0000 (11:00 +0200)]
block/ssh: Propagate errors through connect_to_ssh()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/ssh: Propagate errors through authenticate()
Markus Armbruster [Fri, 16 May 2014 09:00:14 +0000 (11:00 +0200)]
block/ssh: Propagate errors through authenticate()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/ssh: Propagate errors through check_host_key()
Markus Armbruster [Fri, 16 May 2014 09:00:13 +0000 (11:00 +0200)]
block/ssh: Propagate errors through check_host_key()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/ssh: Drop superfluous libssh2_session_last_errno() calls
Markus Armbruster [Fri, 16 May 2014 09:00:12 +0000 (11:00 +0200)]
block/ssh: Drop superfluous libssh2_session_last_errno() calls

libssh2_session_last_error() already returns the error code.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/rbd: Propagate errors to open and create methods
Markus Armbruster [Fri, 16 May 2014 09:00:11 +0000 (11:00 +0200)]
block/rbd: Propagate errors to open and create methods

Completes the conversion to Error started in commit 015a103^..d5124c0.

Cc: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqemu-nbd: Don't use qerror_report()
Markus Armbruster [Fri, 16 May 2014 09:00:10 +0000 (11:00 +0200)]
qemu-nbd: Don't use qerror_report()

qerror_report() is a transitional interface to help with converting
existing HMP commands to QMP.  It should not be used elsewhere.
Replace by error_report().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblockdev: Don't use qerror_report() in do_drive_del()
Markus Armbruster [Fri, 16 May 2014 09:00:09 +0000 (11:00 +0200)]
blockdev: Don't use qerror_report() in do_drive_del()

qerror_report() is a transitional interface to help with converting
existing HMP commands to QMP.  It should not be used elsewhere.

do_drive_del() is an HMP command that won't be converted to QMP (we'll
create a new QMP command instead).  It uses both qerror_report() and
error_report().  Convert the former to the latter.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblockdev: Don't use qerror_report_err() in drive_init()
Markus Armbruster [Fri, 16 May 2014 09:00:08 +0000 (11:00 +0200)]
blockdev: Don't use qerror_report_err() in drive_init()

qerror_report_err() is a transitional interface to help with
converting existing HMP commands to QMP.  It should not be used
elsewhere.

drive_init() is not meant to be used by QMP commands.  It uses both
qerror_report_err() and error_report().  Convert the former to the
latter.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agodocs: Define refcount_bits value
Maria Kustova [Fri, 23 May 2014 13:41:29 +0000 (17:41 +0400)]
docs: Define refcount_bits value

The 'refcount_bits' term used in the description of refcount block entry is
not defined in the specification. The definition is added in the
'refcount_order' section where refcount_bits was used as 'width in bits'.

Signed-off-by: Maria Kustova <maria.k@catit.be>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: Drop redundant bdrv_refresh_limits
Fam Zheng [Fri, 23 May 2014 13:29:48 +0000 (21:29 +0800)]
block: Drop redundant bdrv_refresh_limits

The above bdrv_set_backing_hd already does this.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: Add backing_blocker in BlockDriverState
Fam Zheng [Fri, 23 May 2014 13:29:47 +0000 (21:29 +0800)]
block: Add backing_blocker in BlockDriverState

This makes use of op_blocker and blocks all the operations except for
commit target, on each BlockDriverState->backing_hd.

The asserts for op_blocker in bdrv_swap are removed because with this
change, the target of block commit has at least the backing blocker of
its child, so the assertion is not true. Callers should do their check.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: Use bdrv_set_backing_hd everywhere
Fam Zheng [Fri, 23 May 2014 13:29:46 +0000 (21:29 +0800)]
block: Use bdrv_set_backing_hd everywhere

We need to handle the coming backing_blocker properly, so don't open
code the assignment, instead, call bdrv_set_backing_hd to change
backing_hd.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: Add bdrv_set_backing_hd()
Fam Zheng [Fri, 23 May 2014 13:29:45 +0000 (21:29 +0800)]
block: Add bdrv_set_backing_hd()

This is the common but non-trivial steps to assign or change the
backing_hd of BDS.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: Move op_blocker check from block_job_create to its caller
Fam Zheng [Fri, 23 May 2014 13:29:44 +0000 (21:29 +0800)]
block: Move op_blocker check from block_job_create to its caller

It makes no sense to check for "any" blocker on bs, we are here only
because of the mechanical conversion from in_use to op_blockers. Remove
it now, and let the callers check specific operation types. Backup and
mirror already have it, add checker to stream and commit.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: Replace in_use with operation blocker
Fam Zheng [Fri, 23 May 2014 13:29:43 +0000 (21:29 +0800)]
block: Replace in_use with operation blocker

This drops BlockDriverState.in_use with op_blockers:

  - Call bdrv_op_block_all in place of bdrv_set_in_use(bs, 1).

  - Call bdrv_op_unblock_all in place of bdrv_set_in_use(bs, 0).

  - Check bdrv_op_is_blocked() in place of bdrv_in_use(bs).

    The specific types are used, e.g. in place of starting block backup,
    bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_BACKUP, ...).

    There is one exception in block_job_create, where
    bdrv_op_blocker_is_empty() is used, because we don't know the operation
    type here. This doesn't matter because in a few commits away we will drop
    the check and move it to callers that _do_ know the type.

  - Check bdrv_op_blocker_is_empty() in place of assert(!bs->in_use).

Note: there is only bdrv_op_block_all and bdrv_op_unblock_all callers at
this moment. So although the checks are specific to op types, this
changes can still be seen as identical logic with previously with
in_use. The difference is error message are improved because of blocker
error info.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: Introduce op_blockers to BlockDriverState
Fam Zheng [Fri, 23 May 2014 13:29:42 +0000 (21:29 +0800)]
block: Introduce op_blockers to BlockDriverState

BlockDriverState.op_blockers is an array of lists with BLOCK_OP_TYPE_MAX
elements. Each list is a list of blockers of an operation type
(BlockOpType), that marks this BDS as currently blocked for a certain
type of operation with reason errors stored in the list. The rule of
usage is:

 * BDS user who wants to take an operation should check if there's any
   blocker of the type with bdrv_op_is_blocked().

 * BDS user who wants to block certain types of operation, should call
   bdrv_op_block (or bdrv_op_block_all to block all types of operations,
   which is similar to the existing bdrv_set_in_use()).

 * A blocker is only referenced by op_blockers, so the lifecycle is
   managed by caller, and shouldn't be lost until unblock, so typically
   a caller does these:

   - Allocate a blocker with error_setg or similar, call bdrv_op_block()
     to block some operations.
   - Hold the blocker, do his job.
   - Unblock operations that it blocked, with the same reason pointer
     passed to bdrv_op_unblock().
   - Release the blocker with error_free().

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: Add BlockOpType enum
Fam Zheng [Fri, 23 May 2014 13:29:41 +0000 (21:29 +0800)]
block: Add BlockOpType enum

This adds the enum of all the operations that can be taken on a block
device.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoiotests: Use _img_info in test 089
Max Reitz [Tue, 20 May 2014 20:43:19 +0000 (22:43 +0200)]
iotests: Use _img_info in test 089

Currently, test 089 uses $QEMU_IMG info manually in order to obtain the
according output. However, the iotests should generally use _img_info as
this filters out more irrelevant information such as the host image size
or format specific information. Therefore, test 089 should use _img_info
as well.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reported-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoaio: Fix use-after-free in cancellation path
Fam Zheng [Wed, 21 May 2014 02:42:13 +0000 (10:42 +0800)]
aio: Fix use-after-free in cancellation path

The current flow of canceling a thread from THREAD_ACTIVE state is:

  1) Caller wants to cancel a request, so it calls thread_pool_cancel.

  2) thread_pool_cancel waits on the conditional variable
     elem->check_cancel.

  3) The worker thread changes state to THREAD_DONE once the task is
     done, and notifies elem->check_cancel to allow thread_pool_cancel
     to continue execution, and signals the notifier (pool->notifier) to
     allow callback function to be called later. But because of the
     global mutex, the notifier won't get processed until step 4) and 5)
     are done.

  4) thread_pool_cancel continues, leaving the notifier signaled, it
     just returns to caller.

  5) Caller thinks the request is already canceled successfully, so it
     releases any related data, such as freeing elem->common.opaque.

  6) In the next main loop iteration, the notifier handler,
     event_notifier_ready, is called. It finds the canceled thread in
     THREAD_DONE state, so calls elem->common.cb, with an (likely)
     dangling opaque pointer. This is a use-after-free.

Fix it by calling event_notifier_ready before leaving
thread_pool_cancel.

Test case update: This change will let cancel complete earlier than
test-thread-pool.c expects, so update the code to check this case: if
it's already done, done_cb sets .aiocb to NULL, skip calling
bdrv_aio_cancel on them.

Reported-by: Ulrich Obergfell <uobergfe@redhat.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqcow2: Fix memory leak in COW error path
Kevin Wolf [Mon, 19 May 2014 15:56:01 +0000 (17:56 +0200)]
qcow2: Fix memory leak in COW error path

This triggers if bs->drv becomes NULL in a concurrent request. This is
currently only the case when corruption prevention kicks in (i.e. at
most once per image, and after that it produces I/O errors).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoQemuOpt: add unit tests
Leandro Dorileo [Mon, 19 May 2014 21:53:55 +0000 (18:53 -0300)]
QemuOpt: add unit tests

Cover basic aspects and API usage for QemuOpt. The current implementation
covers the API's planned to be changed by Chunyan Liu in his QEMUOptionParameter
replacement/cleanup job.

Other APIs should be covered in future improvements.

[Squashing in a small fix "QemuOpt: use qemu_find_opts_err() to avoid
output on stderr in tests".

qemu_find_opts() calls error_report() instead of propagating the Error
object.  It is undesirable to clutter test case output with error
messages from a passing test.

Use qemu_find_opts_err() to avoid the output on stderr.
--Stefan]

Signed-off-by: Leandro Dorileo <l@dorileo.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqemu-iotests: Handle cache mode option in 091
Fam Zheng [Tue, 20 May 2014 01:10:32 +0000 (09:10 +0800)]
qemu-iotests: Handle cache mode option in 091

We should allow testing this on tmpfs. Any cache setting in iotests
should try to obey $CACHEMODE.

The cache mode is still "none" by default but overridable

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-console-1' into staging
Peter Maydell [Wed, 28 May 2014 11:36:25 +0000 (12:36 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-console-1' into staging

console: multiwindow support for text terminal QemuConsoles
console: small fixes

# gpg: Signature made Mon 26 May 2014 09:17:27 BST using RSA key ID D3E87138
# gpg: Can't check signature: public key not found

* remotes/kraxel/tags/pull-console-1:
  console: add kbd_put_keysym_console
  console: rework text terminal cursor logic
  console: update text terminal surface unconditionally
  console: nicer initial screen
  console: Abort on property access errors

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-gtk-7' into staging
Peter Maydell [Wed, 28 May 2014 10:18:58 +0000 (11:18 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-gtk-7' into staging

gtk: ui overhaul, multiwindow support.

# gpg: Signature made Mon 26 May 2014 08:54:55 BST using RSA key ID D3E87138
# gpg: Can't check signature: public key not found

* remotes/kraxel/tags/pull-gtk-7: (24 commits)
  gtk: workaround gtk2 vte resize issue
  gtk: window sizing overhaul
  gtk: zap unused global_state
  gtk: Add handling for the xfree86 keycodes
  gtk: enable untabify for gfx
  gtk: detached window pointer grabs
  gtk: update all windows on mouse mode changes
  gtk: fix grab checks
  gtk: update gd_update_caption
  gtk: skip keyboard grab when hover autograb is active
  gtk: keep track of grab owner
  gtk: add gd_grab trace event
  gtk: add tab to trace events
  gtk: allow moving tabs to windows and back.
  gtk: simplify resize
  gtk: use device type as label
  gtk: support multiple gfx displays
  gtk: move vga state into VirtualGfxConsole
  gtk: VirtualConsole restruction
  gtk: remove page numbering assumtions from the code
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-input-9' into staging
Peter Maydell [Wed, 28 May 2014 09:33:05 +0000 (10:33 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-9' into staging

input: add event routing and multiseat support.
input: misc bugfixes and minor improvements.

# gpg: Signature made Mon 26 May 2014 07:44:29 BST using RSA key ID D3E87138
# gpg: Can't check signature: public key not found

* remotes/kraxel/tags/pull-input-9:
  docs: add multiseat.txt
  usb: add input routing support for tablet and keyboard
  sdl: pass key event source to input layer
  input: bind devices and input routing
  input: switch hid mouse and tablet to the new input layer api.
  input: switch hid keyboard to new input layer api.
  input: keymap: add meta keys
  input: add name to input_event_key_number
  input: add qemu_input_key_number_to_qcode
  input (curses): mask keycodes to remove modifier bits

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-05-26' into staging
Peter Maydell [Tue, 27 May 2014 21:45:03 +0000 (22:45 +0100)]
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-05-26' into staging

trivial patches for 2014-05-26

# gpg: Signature made Mon 26 May 2014 08:17:08 BST using RSA key ID A4C3D7DB
# gpg: Can't check signature: public key not found

* remotes/mjt/tags/trivial-patches-2014-05-26: (23 commits)
  libcacard: remove useless initializers
  net: cadence_gem: Fix top comment
  bsd-user: replace fprintf(stderr, ...) with error_report()
  audio: replace fprintf(stderr, ...) with error_report() in audio
  libcacard: fix wrong array expansion logic
  libcacard/vcard_emul_nss: Drop a redundant conditional
  libcacard: Convert two leftover realloc() to GLib
  libcacard/vreader: Tighten assertion to clarify intent
  libcacard/vreader: Drop broken recovery from failed assertion
  libcacard: Plug memory leaks around vreader_get_reader_list()
  libcacard/vscclient: Bury some dead code
  vl: fix 'name' option to work with -readconfig
  configure: Put tempfiles in a subdir of the build directory
  dma-helpers: avoid calling dma_bdrv_unmap() twice
  arch_init: replace fprintf(stderr, ...) with error_report()
  pci: move dereferencing of root only after verifying valid root pointer
  jazz_led: Add missing break in switch case
  bswap.h: Rename ldl_p, stl_p, etc to ldl_he_p, stl_he_p, etc
  configure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable
  nbd: Miscellaneous typo fixes.
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/mwalle/tags/lm32-semihosting/20140524' into...
Peter Maydell [Tue, 27 May 2014 21:11:25 +0000 (22:11 +0100)]
Merge remote-tracking branch 'remotes/mwalle/tags/lm32-semihosting/20140524' into staging

* remotes/mwalle/tags/lm32-semihosting/20140524:
  lm32: remove lm32_sys
  test: lm32: use semihosting for testing
  target-lm32: add semihosting support
  test: lm32: make test cases independent

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/rth/tcg-mips' into staging
Peter Maydell [Tue, 27 May 2014 17:31:02 +0000 (18:31 +0100)]
Merge remote-tracking branch 'remotes/rth/tcg-mips' into staging

* remotes/rth/tcg-mips: (24 commits)
  tcg-mips: Enable direct chaining of TBs
  tcg-mips: Simplify movcond
  tcg-mips: Simplify brcond2
  tcg-mips: Improve setcond eq/ne vs zeros
  tcg-mips: Simplify setcond2
  tcg-mips: Simplify brcond
  tcg-mips: Simplify setcond
  tcg-mips: Commonize opcode implementations
  tcg-mips: Improve add2/sub2
  tcg-mips: Hoist args loads
  tcg-mips: Fix subtract immediate range
  tcg-mips: Name the opcode enumeration
  tcg-mips: Use EXT for AND on mips32r2
  tcg-mips: Use T9 for TCG_TMP1
  tcg-mips: Introduce TCG_TMP0, TCG_TMP1
  tcg-mips: Rearrange register allocation
  tcg-mips: Convert to new_ldst
  tcg-mips: Convert to new qemu_l/st helpers
  tcg-mips: Move softmmu slow path out of line
  tcg-mips: Split large ldst offsets
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: A64: Register VBAR_EL3
Edgar E. Iglesias [Tue, 27 May 2014 16:09:55 +0000 (17:09 +0100)]
target-arm: A64: Register VBAR_EL3

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-24-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: A64: Register VBAR_EL2
Edgar E. Iglesias [Tue, 27 May 2014 16:09:54 +0000 (17:09 +0100)]
target-arm: A64: Register VBAR_EL2

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-23-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: Make vbar_write writeback to any CPREG
Edgar E. Iglesias [Tue, 27 May 2014 16:09:54 +0000 (17:09 +0100)]
target-arm: Make vbar_write writeback to any CPREG

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-22-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: A64: Generalize update_spsel for the various ELs
Edgar E. Iglesias [Tue, 27 May 2014 16:09:54 +0000 (17:09 +0100)]
target-arm: A64: Generalize update_spsel for the various ELs

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-21-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: A64: Generalize ERET to various ELs
Edgar E. Iglesias [Tue, 27 May 2014 16:09:54 +0000 (17:09 +0100)]
target-arm: A64: Generalize ERET to various ELs

Adds support for ERET to and from AArch64 EL2 and 3.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-20-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: A64: Trap ERET from EL0 at translation time
Edgar E. Iglesias [Tue, 27 May 2014 16:09:54 +0000 (17:09 +0100)]
target-arm: A64: Trap ERET from EL0 at translation time

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-19-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: A64: Forbid ERET to higher or unimplemented ELs
Edgar E. Iglesias [Tue, 27 May 2014 16:09:53 +0000 (17:09 +0100)]
target-arm: A64: Forbid ERET to higher or unimplemented ELs

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-18-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: Register EL3 versions of ELR and SPSR
Edgar E. Iglesias [Tue, 27 May 2014 16:09:53 +0000 (17:09 +0100)]
target-arm: Register EL3 versions of ELR and SPSR

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-17-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: Register EL2 versions of ELR and SPSR
Edgar E. Iglesias [Tue, 27 May 2014 16:09:53 +0000 (17:09 +0100)]
target-arm: Register EL2 versions of ELR and SPSR

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-16-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: Add a feature flag for EL3
Edgar E. Iglesias [Tue, 27 May 2014 16:09:53 +0000 (17:09 +0100)]
target-arm: Add a feature flag for EL3

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-15-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: Add a feature flag for EL2
Edgar E. Iglesias [Tue, 27 May 2014 16:09:52 +0000 (17:09 +0100)]
target-arm: Add a feature flag for EL2

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-14-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: A64: Introduce aarch64_banked_spsr_index()
Edgar E. Iglesias [Tue, 27 May 2014 16:09:52 +0000 (17:09 +0100)]
target-arm: A64: Introduce aarch64_banked_spsr_index()

Add aarch64_banked_spsr_index(), used to map an Exception Level
to an index in the banked_spsr array.

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-13-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: Add SPSR entries for EL2/HYP and EL3/MON
Edgar E. Iglesias [Tue, 27 May 2014 16:09:52 +0000 (17:09 +0100)]
target-arm: Add SPSR entries for EL2/HYP and EL3/MON

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-12-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: A64: Add ELR entries for EL2 and 3
Edgar E. Iglesias [Tue, 27 May 2014 16:09:52 +0000 (17:09 +0100)]
target-arm: A64: Add ELR entries for EL2 and 3

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-11-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: A64: Add SP entries for EL2 and 3
Edgar E. Iglesias [Tue, 27 May 2014 16:09:52 +0000 (17:09 +0100)]
target-arm: A64: Add SP entries for EL2 and 3

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-10-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: c12_vbar -> vbar_el[]
Edgar E. Iglesias [Tue, 27 May 2014 16:09:51 +0000 (17:09 +0100)]
target-arm: c12_vbar -> vbar_el[]

No functional change.
Preparation for adding EL2 and 3 versions of this reg.

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-9-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: Make esr_el1 an array
Edgar E. Iglesias [Tue, 27 May 2014 16:09:51 +0000 (17:09 +0100)]
target-arm: Make esr_el1 an array

No functional change.
Prepares for future addtion of EL2 and 3 versions of this reg.

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-8-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: Make elr_el1 an array
Edgar E. Iglesias [Tue, 27 May 2014 16:09:51 +0000 (17:09 +0100)]
target-arm: Make elr_el1 an array

No functional change.
Prepares for future additions of the EL2 and 3 versions of this reg.

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-7-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: Use a 1:1 mapping between EL and MMU index
Edgar E. Iglesias [Tue, 27 May 2014 16:09:51 +0000 (17:09 +0100)]
target-arm: Use a 1:1 mapping between EL and MMU index

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Message-id: 1400980132-25949-6-git-send-email-edgar.iglesias@gmail.com
Message-id: 1400805738-11889-7-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: A32: Use get_mem_index for load/stores
Edgar E. Iglesias [Tue, 27 May 2014 16:09:50 +0000 (17:09 +0100)]
target-arm: A32: Use get_mem_index for load/stores

Avoid using IS_USER directly as the MMU-idx to simplify future
changes to the MMU layout.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1400980132-25949-5-git-send-email-edgar.iglesias@gmail.com
Message-id: 1400805738-11889-6-git-send-email-edgar.iglesias@gmail.com
[PMM: parts relating to LDRT/STRT moved into earlier patches]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm/translate.c: Use get_mem_index() for SRS memory accesses
Peter Maydell [Tue, 27 May 2014 16:09:50 +0000 (17:09 +0100)]
target-arm/translate.c: Use get_mem_index() for SRS memory accesses

The SRS instruction was using a hardcoded 0 for the memory
accesses. This happens to be OK since the SRS instruction is
UNPREDICTABLE in User and System modes, but is awkward if we
want to rearrange the MMU index uses. Switch to using
get_mem_index() like all the other accesses.

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1400980132-25949-4-git-send-email-edgar.iglesias@gmail.com

10 years agotarget-arm/translate.c: Clean up mmu index handling for ldrt/strt
Peter Maydell [Tue, 27 May 2014 16:09:50 +0000 (17:09 +0100)]
target-arm/translate.c: Clean up mmu index handling for ldrt/strt

Clean up the mmu index handling for ldrt/strt insns: instead
of a flag 'user' indicating whether to treat the store as user
mode or not, use 'memidx' to indicate the correct memory index to use.

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1400980132-25949-3-git-send-email-edgar.iglesias@gmail.com

10 years agotarget-arm: Move get_mem_index to translate.h
Edgar E. Iglesias [Tue, 27 May 2014 16:09:50 +0000 (17:09 +0100)]
target-arm: Move get_mem_index to translate.h

So that it can be shared with the AArch32 code.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1400980132-25949-2-git-send-email-edgar.iglesias@gmail.com
Message-id: 1400805738-11889-5-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: implement CPACR register logic for ARMv7
Fabian Aggeler [Tue, 27 May 2014 16:09:49 +0000 (17:09 +0100)]
target-arm: implement CPACR register logic for ARMv7

In ARMv7 the CPACR register allows to control access rights to
coprocessor 0-13 interfaces. Bits corresponding to unimplemented
coprocessors should be RAZ/WI. Bits ASEDIS, D32DIS, TRCDIS are
UNK/SBZP if VFP is not implemented and RAO/WI in some cases.
Treating TRCDIS as RAZ/WI since we neither implement a trace
macrocell nor a CP14 interface to the trace macrocell registers.

Since CPACR bits for VFP/Neon access are honoured with the CPACR_FPEN
bit in the TB flags, flushing the TLB is not necessary anymore.

Signed-off-by: Fabian Aggeler <aggelerf@ethz.ch>
Message-id: 1400532968-30668-1-git-send-email-aggelerf@ethz.ch
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agohw/display/pxa2xx_lcd: Fix 16bpp+alpha and 18bpp+alpha palette formats
Peter Maydell [Tue, 27 May 2014 16:09:49 +0000 (17:09 +0100)]
hw/display/pxa2xx_lcd: Fix 16bpp+alpha and 18bpp+alpha palette formats

The pxa2xx palette entry "16bpp plus transparency" format is
xxxxxxxTRRRRR000GGGGGG00BBBBB000, and "18bpp plus transparency" is
xxxxxxxTRRRRRR00GGGGGG00BBBBBB00.

Correct errors in the code for reading these and converting
them to the internal format. In particular, the buggy code
was attempting to mask out bit 24 of a uint16_t, which
Coverity spotted as an error.

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1400233901-31785-1-git-send-email-peter.maydell@linaro.org

10 years agoMAINTAINERS: update Calxeda Highbank maintainer and status
Rob Herring [Tue, 27 May 2014 16:09:49 +0000 (17:09 +0100)]
MAINTAINERS: update Calxeda Highbank maintainer and status

Signed-off-by: Rob Herring <rob.herring@linaro.org>
Message-id: 1400116198-3155-1-git-send-email-robherring2@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/rth/fix-tci' into staging
Peter Maydell [Tue, 27 May 2014 13:44:03 +0000 (14:44 +0100)]
Merge remote-tracking branch 'remotes/rth/fix-tci' into staging

* remotes/rth/fix-tci:
  tci: Fix tcg_out_call

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: Fix segfault on startup when KVM enabled
Christoffer Dall [Tue, 27 May 2014 12:37:43 +0000 (14:37 +0200)]
target-arm: Fix segfault on startup when KVM enabled

Commit 50a2c6e55fa introduced a bug where QEMU would segfault on startup
when using KVM on ARM hosts, because kvm_arm_reset_cpu() accesses
cpu->cpreg_reset_values, which is not allocated before
kvm_arch_init_vcpu(). Fix this by not calling cpu_reset() until after
qemu_init_vcpu().

Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Faerber <afaerber@suse.de>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Message-id: 1401194263-13010-1-git-send-email-christoffer.dall@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-xtensa: add tests for cross-page TB
Max Filippov [Tue, 20 May 2014 18:24:56 +0000 (22:24 +0400)]
target-xtensa: add tests for cross-page TB

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
10 years agotarget-xtensa: completely clean TLB between MMU tests
Max Filippov [Tue, 20 May 2014 20:50:12 +0000 (00:50 +0400)]
target-xtensa: completely clean TLB between MMU tests

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
10 years agotarget-xtensa: fix cross-page jumps/calls at the end of TB
Max Filippov [Tue, 20 May 2014 10:48:45 +0000 (14:48 +0400)]
target-xtensa: fix cross-page jumps/calls at the end of TB

Use tb->pc instead of dc->pc to check for cross-page jumps.
When TB translation stops at the page boundary dc->pc points to the next
page allowing chaining to TBs in it, which is wrong.

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
10 years agodocs: add multiseat.txt
Gerd Hoffmann [Tue, 20 May 2014 07:17:01 +0000 (09:17 +0200)]
docs: add multiseat.txt

Howto on setting up multiseat for guests.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: add input routing support for tablet and keyboard
Gerd Hoffmann [Mon, 19 May 2014 13:26:51 +0000 (15:26 +0200)]
usb: add input routing support for tablet and keyboard

Add display property to the keyboard.
Add display and head properties to the tablet.

If properties are set bind device to the display specified to
setup input routing.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agosdl: pass key event source to input layer
Gerd Hoffmann [Tue, 20 May 2014 06:11:25 +0000 (08:11 +0200)]
sdl: pass key event source to input layer

So the input layer knows where the input is coming from
and input routing works correctly.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: bind devices and input routing
Gerd Hoffmann [Mon, 19 May 2014 13:18:37 +0000 (15:18 +0200)]
input: bind devices and input routing

Add function to bind input devices to display devices.  Implementing
input routing on top of this:  Events coming from the display device in
question are routed to the input device bound to it (if there is one).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: switch hid mouse and tablet to the new input layer api.
Gerd Hoffmann [Mon, 19 May 2014 13:02:21 +0000 (15:02 +0200)]
input: switch hid mouse and tablet to the new input layer api.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: switch hid keyboard to new input layer api.
Gerd Hoffmann [Tue, 11 Mar 2014 12:52:27 +0000 (13:52 +0100)]
input: switch hid keyboard to new input layer api.

Minimal patch to get the switchover done.  We continue processing ps/2
scancodes for now as they are part of the live migration stream.  Fixing
that, then mapping directly from QKeyValue to HID keycodes is left as
excercise for another day.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: keymap: add meta keys
Gerd Hoffmann [Wed, 21 May 2014 11:54:32 +0000 (13:54 +0200)]
input: keymap: add meta keys

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: add name to input_event_key_number
Gerd Hoffmann [Wed, 21 May 2014 11:49:59 +0000 (13:49 +0200)]
input: add name to input_event_key_number

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: add qemu_input_key_number_to_qcode
Gerd Hoffmann [Wed, 21 May 2014 11:28:32 +0000 (13:28 +0200)]
input: add qemu_input_key_number_to_qcode

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput (curses): mask keycodes to remove modifier bits
Andrew Oates [Sat, 24 May 2014 00:16:09 +0000 (20:16 -0400)]
input (curses): mask keycodes to remove modifier bits

Without the mask, control bits are passed on in the keycode, generating
incorrect PS/2 sequences when SHIFT, ALT, etc are held down.

Cc: qemu-stable@nongnu.org
Signed-off-by: Andrew Oates <andrew@aoates.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agolibcacard: remove useless initializers
Michael Tokarev [Thu, 8 May 2014 17:17:38 +0000 (21:17 +0400)]
libcacard: remove useless initializers

libcacard has many functions which initializes local variables
at declaration time, which are always assigned some values later
(often right after declaration).  Clean up these initializers.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agonet: cadence_gem: Fix top comment
Peter Crosthwaite [Wed, 7 May 2014 09:17:31 +0000 (02:17 -0700)]
net: cadence_gem: Fix top comment

To indicate Cadence GEM not Xilinx.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agobsd-user: replace fprintf(stderr, ...) with error_report()
Le Tan [Fri, 9 May 2014 23:55:22 +0000 (07:55 +0800)]
bsd-user: replace fprintf(stderr, ...) with error_report()

Replace fprintf(stderr,...) with error_report() in files bsd-user/*.
The trailing "\n"s of the @fmt argument have been removed
because @fmt of error_report() should not contain newline.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>