OSDN Git Service

qmiga/qemu.git
10 years agoblock: Fail gracefully with missing filename
Kevin Wolf [Mon, 3 Feb 2014 13:49:42 +0000 (14:49 +0100)]
block: Fail gracefully with missing filename

This fixes a regression introduced in commit 2a05cbe42 ('block: Allow
block devices without files'):

$ qemu-system-x86_64 -drive driver=file
qemu-system-x86_64: block.c:892: bdrv_open_common: Assertion
`!drv->bdrv_needs_filename || filename != ((void *)0)' failed.

Now the respective check must be performed not only in bdrv_file_open(),
but also in bdrv_open().

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqemu-iotests: enable support for NFS protocol
Peter Lieven [Mon, 3 Feb 2014 09:26:17 +0000 (10:26 +0100)]
qemu-iotests: enable support for NFS protocol

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-iotests: enable test 016 and 025 to work with NFS protocol
Peter Lieven [Mon, 3 Feb 2014 09:26:16 +0000 (10:26 +0100)]
qemu-iotests: enable test 016 and 025 to work with NFS protocol

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-iotests: blacklist test 020 for NFS protocol
Peter Lieven [Mon, 3 Feb 2014 09:26:15 +0000 (10:26 +0100)]
qemu-iotests: blacklist test 020 for NFS protocol

reopening is currently not supported.

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-iotests: change _supported_proto to file for various tests
Peter Lieven [Mon, 3 Feb 2014 09:26:14 +0000 (10:26 +0100)]
qemu-iotests: change _supported_proto to file for various tests

all these tests do anything of the following and thus fail with any
protocol other than file:
 - the tests use rm, cp or mv shell commands which only work on file
 - the tests use qcow2.py
 - the images construct new filenames (e.g. backing file names) and
   the logic is broken for anything else than file

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblock: add native support for NFS
Peter Lieven [Mon, 3 Feb 2014 09:26:13 +0000 (10:26 +0100)]
block: add native support for NFS

This patch adds native support for accessing images on NFS
shares without the requirement to actually mount the entire
NFS share on the host.

NFS Images can simply be specified by an url of the form:
nfs://<host>/<export>/<filename>[?param=value[&param2=value2[&...]]]

For example:
qemu-img create -f qcow2 nfs://10.0.0.1/qemu-images/test.qcow2

You need LibNFS from Ronnie Sahlberg available at:
   git://github.com/sahlberg/libnfs.git
for this to work.

During configure it is automatically probed for libnfs and support
is enabled on-the-fly. You can forbid or enforce libnfs support
with --disable-libnfs or --enable-libnfs respectively.

Due to NFS restrictions you might need to execute your binaries
as root, allow them to open priviledged ports (<1024) or specify
insecure option on the NFS server.

For additional information on ROOT vs. non-ROOT operation and URL
format + parameters see:
   https://raw.github.com/sahlberg/libnfs/master/README

Supported by qemu are the uid, gid and tcp-syncnt URL parameters.

LibNFS currently support NFS version 3 only.

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-iotest: Make 077 raw-only
Kevin Wolf [Thu, 30 Jan 2014 11:52:47 +0000 (12:52 +0100)]
qemu-iotest: Make 077 raw-only

The qemu-io command sequences make the assumption that an unaligned
request on the format layer will be unaligned on the blkdebug layer as
well. This doesn't necessarily hold true for drivers other than raw.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Benoît Canet <benoit@irqsave.net>
10 years agoMerge remote-tracking branch 'remotes/mwalle/tags/lm32-fixes/20140204' into staging
Peter Maydell [Sat, 8 Feb 2014 15:57:51 +0000 (15:57 +0000)]
Merge remote-tracking branch 'remotes/mwalle/tags/lm32-fixes/20140204' into staging

target-lm32: fixes

# gpg: Signature made Tue 04 Feb 2014 18:47:56 GMT using DSA key ID 3F98A378
# gpg: Can't check signature: public key not found

* remotes/mwalle/tags/lm32-fixes/20140204:
  hw/lm32: print error if cpu model is not found
  target-lm32: stop VM on illegal or unknown instruction
  lm32_sys: dump cpu state if test case fails
  lm32_sys: print test result on stderr
  target-lm32: add breakpoint/watchpoint support
  target-lm32: move model features to LM32CPU
  target-lm32: kill cpu_abort() calls
  milkymist-vgafb: swap pixel data in source buffer
  lm32_uart/lm32_juart: use qemu_chr_fe_write_all()
  milkymist-uart: use qemu_chr_fe_write_all() instead of qemu_chr_fe_write()
  tests: lm32: new rule for single test cases
  lm32_sys: increase test case name length limit

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/juanquintela/tags/migration/20140204-1' into...
Peter Maydell [Sat, 8 Feb 2014 13:12:50 +0000 (13:12 +0000)]
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20140204-1' into staging

migration/next for 20140204

# gpg: Signature made Tue 04 Feb 2014 15:52:00 GMT using RSA key ID 5872D723
# gpg: Can't check signature: public key not found

* remotes/juanquintela/tags/migration/20140204-1:
  Don't abort on memory allocation error
  Don't abort on out of memory when creating page cache
  XBZRLE cache size should not be larger than guest memory size
  migration:fix free XBZRLE decoded_buf wrong
  Add check for cache size smaller than page size
  Set xbzrle buffers to NULL after freeing them to avoid double free errors
  exec: fix ram_list dirty map optimization
  vmstate: Make VMSTATE_STRUCT_POINTER take type, not ptr-to-type

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-roms-1' into staging
Peter Maydell [Fri, 7 Feb 2014 16:42:13 +0000 (16:42 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-roms-1' into staging

Update seabios to 1.7.4

# gpg: Signature made Mon 03 Feb 2014 14:42:44 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-roms-1:
  Update seabios binaries to 1.7.4
  Update seabios submodule to 1.7.4
  roms: remove explicit MAKEFLAGS from recursive make invocations

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/stefanha/tags/qtest-for-peter' into staging
Peter Maydell [Fri, 7 Feb 2014 16:03:13 +0000 (16:03 +0000)]
Merge remote-tracking branch 'remotes/stefanha/tags/qtest-for-peter' into staging

qtest resource cleanup patches

# gpg: Signature made Tue 04 Feb 2014 08:29:12 GMT using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/qtest-for-peter:
  qtest: unlink UNIX domain sockets after connecting
  qtest: unlink QEMU pid file after startup

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kvm/uq/master' into staging
Peter Maydell [Thu, 6 Feb 2014 23:51:24 +0000 (23:51 +0000)]
Merge remote-tracking branch 'remotes/kvm/uq/master' into staging

* remotes/kvm/uq/master:
  target-i386: Move KVM default-vendor hack to instance_init
  target-i386: Don't change x86_def_t struct on cpu_x86_register()
  target-i386: Eliminate CONFIG_KVM #ifdefs
  kvm: add support for hyper-v timers
  kvm: make hyperv vapic assist page migratable
  kvm: make hyperv hypercall and guest os id MSRs migratable.
  kvm: make availability of Hyper-V enlightenments dependent on KVM_CAP_HYPERV
  KVM: fix coexistence of KVM and Hyper-V leaves
  kvm: print suberror on all internal errors
  target-i386: kvm_check_features_against_host(): Kill feature word array
  target-i386: kvm_cpu_fill_host(): Fill feature words in a loop
  target-i386: kvm_cpu_fill_host(): Set all feature words at end of function
  target-i386: kvm_cpu_fill_host(): No need to check xlevel2
  target-i386: kvm_cpu_fill_host(): No need to check CPU vendor
  target-i386: kvm_cpu_fill_host(): No need to check level
  target-i386: kvm_cpu_fill_host(): Kill unused code

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/spice/tags/pull-spice-2' into staging
Peter Maydell [Thu, 6 Feb 2014 10:21:12 +0000 (10:21 +0000)]
Merge remote-tracking branch 'remotes/spice/tags/pull-spice-2' into staging

misc spice patches

# gpg: Signature made Mon 03 Feb 2014 15:05:29 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/spice/tags/pull-spice-2:
  spice: hook qemu_chr_fe_set_open() event to ports
  Add the ability to vary Spice playback and record rates, to facilitate Opus support.
  hw/display/qxl: fix signed to unsigned comparison
  qxl: clear irq on reset

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-02-02' into staging
Peter Maydell [Wed, 5 Feb 2014 16:37:26 +0000 (16:37 +0000)]
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-02-02' into staging

trivial patches for 2014-02-02

# gpg: Signature made Sun 02 Feb 2014 16:11:37 GMT using RSA key ID 74F0C838
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
# gpg:                 aka "Michael Tokarev <mjt@corpit.ru>"
# gpg:                 aka "Michael Tokarev <mjt@debian.org>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
#      Subkey fingerprint: E190 8639 3B10 B51B AC2C  8B73 5253 C5AD 74F0 C838

* remotes/mjt/tags/trivial-patches-2014-02-02:
  tests/.gitignore: Ignore tests/check-qom-interface
  hw/ppc: Remove unused defines
  readline: Add missing GCC_FMT_ATTR
  tcg/s390: Remove sigill_handler
  i386: Add missing include file for QEMU_PACKED
  osdep: drop unused #include "trace.h"
  qemu 1.7.0 does not build on NetBSD

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Peter Maydell [Wed, 5 Feb 2014 16:29:01 +0000 (16:29 +0000)]
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

Block pull request

# gpg: Signature made Fri 31 Jan 2014 21:16:43 GMT using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  qemu-iotests: only run 071 on qcow2
  dataplane: Comment fix
  block/vhdx: Error checking fixes
  qemu-iotests: Drop assert_no_active_commit in case 040
  block/vmdk: add basic .bdrv_check support
  block: remove qcow2 .bdrv_make_empty implementation
  block: remove QED .bdrv_make_empty implementation
  Describe flaws in qcow/qcow2 encryption in the docs

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agohw/lm32: print error if cpu model is not found
Michael Walle [Thu, 28 Nov 2013 18:09:33 +0000 (19:09 +0100)]
hw/lm32: print error if cpu model is not found

QEMU crashed if a the given cpu_model is not found.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-lm32: stop VM on illegal or unknown instruction
Michael Walle [Mon, 23 Sep 2013 18:47:33 +0000 (20:47 +0200)]
target-lm32: stop VM on illegal or unknown instruction

Instead of translating the instruction to a no-op, pause the VM and display
a message to the user.

As a side effect, this also works for instructions where the operands are
only known at runtime.

Signed-off-by: Michael Walle <michael@walle.cc>
10 years agolm32_sys: dump cpu state if test case fails
Michael Walle [Mon, 23 Sep 2013 18:53:04 +0000 (20:53 +0200)]
lm32_sys: dump cpu state if test case fails

This will ease debugging the test cases.

Signed-off-by: Michael Walle <michael@walle.cc>
10 years agolm32_sys: print test result on stderr
Michael Walle [Mon, 23 Sep 2013 18:49:17 +0000 (20:49 +0200)]
lm32_sys: print test result on stderr

Do not use qemu_log().

Signed-off-by: Michael Walle <michael@walle.cc>
10 years agotarget-lm32: add breakpoint/watchpoint support
Michael Walle [Wed, 18 Sep 2013 17:10:45 +0000 (19:10 +0200)]
target-lm32: add breakpoint/watchpoint support

This patch adds in-target breakpoint and watchpoint support.

Signed-off-by: Michael Walle <michael@walle.cc>
10 years agoMerge remote-tracking branch 'remotes/borntraeger/tags/kvm-s390-20140131' into staging
Peter Maydell [Tue, 4 Feb 2014 18:46:33 +0000 (18:46 +0000)]
Merge remote-tracking branch 'remotes/borntraeger/tags/kvm-s390-20140131' into staging

This patch set contains the sclp defines and events for cpu hotplug,
the initial sclp defines (without code yet) for standby memory (some
sort of memory hotplug) as well as a cleanup of the kvm register
synchronization.

# gpg: Signature made Fri 31 Jan 2014 08:54:29 GMT using RSA key ID B5A61C7C
# gpg: Can't check signature: public key not found

* remotes/borntraeger/tags/kvm-s390-20140131:
  s390x/kvm: cleanup partial register handling
  sclp-s390: Define new SCLP codes and structures
  s390-sclp: SCLP Event integration
  s390-sclp: SCLP CPU Info
  s390-sclp: Define New SCLP Codes

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-lm32: move model features to LM32CPU
Michael Walle [Tue, 17 Sep 2013 16:33:16 +0000 (18:33 +0200)]
target-lm32: move model features to LM32CPU

This allows us to completely remove CPULM32State from DisasContext.
Instead, copy the fields we need to DisasContext.

Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael Walle <michael@walle.cc>
10 years agotarget-lm32: kill cpu_abort() calls
Michael Walle [Mon, 16 Sep 2013 18:13:05 +0000 (20:13 +0200)]
target-lm32: kill cpu_abort() calls

Instead of killing QEMU, translate instructions which are not available on
the CPU model as a noop and issue a log message at translation time.

On the real hardware CPU unknown opcodes results in undefined behaviour.

These changes prepare the removal of CPULM32State from DisasContext.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Andreas Färber <afaerber@suse.de>
10 years agomilkymist-vgafb: swap pixel data in source buffer
Michael Walle [Mon, 16 Sep 2013 17:32:54 +0000 (19:32 +0200)]
milkymist-vgafb: swap pixel data in source buffer

In commit fc97bb5ba3e7239c0b6d24095df6784868dfebbf the lduw_raw() call was
eliminated. But we are reading from the target buffer a 16-bit value, which
is in big-endian format. Therefore, use lduw_be_p() to read the value.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Walle <michael@walle.cc>
10 years agolm32_uart/lm32_juart: use qemu_chr_fe_write_all()
Michael Walle [Mon, 16 Sep 2013 16:29:32 +0000 (18:29 +0200)]
lm32_uart/lm32_juart: use qemu_chr_fe_write_all()

qemu_chr_fe_write() may return EAGAIN. Therefore, use
qemu_chr_fe_write_all().

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10 years agomilkymist-uart: use qemu_chr_fe_write_all() instead of qemu_chr_fe_write()
Antony Pavlov [Sat, 31 Aug 2013 17:22:39 +0000 (21:22 +0400)]
milkymist-uart: use qemu_chr_fe_write_all() instead of qemu_chr_fe_write()

qemu_chr_fe_write() is capable of returning 0
to indicate EAGAIN (and friends) and we don't
handle this.

Just change it to qemu_chr_fe_write_all() to fix.

Reported-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotests: lm32: new rule for single test cases
Michael Walle [Sun, 9 Dec 2012 23:03:09 +0000 (00:03 +0100)]
tests: lm32: new rule for single test cases

Introduce new target "check_%" to run individual test caes, eg.
  make check_mmu

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10 years agolm32_sys: increase test case name length limit
Michael Walle [Sun, 9 Dec 2012 23:00:24 +0000 (00:00 +0100)]
lm32_sys: increase test case name length limit

The new MMU tests use longer names.

Signed-off-by: Michael Walle <michael@walle.cc>
10 years agoMerge remote-tracking branch 'remotes/mcayland/qemu-openbios' into staging
Peter Maydell [Tue, 4 Feb 2014 16:16:37 +0000 (16:16 +0000)]
Merge remote-tracking branch 'remotes/mcayland/qemu-openbios' into staging

* remotes/mcayland/qemu-openbios:
  Update OpenBIOS images

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoDon't abort on memory allocation error
Orit Wasserman [Thu, 30 Jan 2014 18:08:38 +0000 (20:08 +0200)]
Don't abort on memory allocation error

It is better to fail migration in case of failure to
allocate new cache item

Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agoDon't abort on out of memory when creating page cache
Orit Wasserman [Thu, 30 Jan 2014 18:08:37 +0000 (20:08 +0200)]
Don't abort on out of memory when creating page cache

Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agoXBZRLE cache size should not be larger than guest memory size
Orit Wasserman [Thu, 30 Jan 2014 18:08:36 +0000 (20:08 +0200)]
XBZRLE cache size should not be larger than guest memory size

Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agomigration:fix free XBZRLE decoded_buf wrong
Gonglei (Arei) [Thu, 30 Jan 2014 18:08:35 +0000 (20:08 +0200)]
migration:fix free XBZRLE decoded_buf wrong

When qemu do live migration with xbzrle, qemu malloc decoded_buf
at destination end but free it at source end. It will crash qemu
by double free error in some scenarios. Splitting the XBZRLE structure
for clear logic distinguishing src/dst side.

Signed-off-by: ChenLiang <chenliang88@huawei.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
Signed-off-by: GongLei <arei.gonglei@huawei.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agoAdd check for cache size smaller than page size
Orit Wasserman [Thu, 30 Jan 2014 18:08:34 +0000 (20:08 +0200)]
Add check for cache size smaller than page size

Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agoSet xbzrle buffers to NULL after freeing them to avoid double free errors
Orit Wasserman [Thu, 30 Jan 2014 18:08:33 +0000 (20:08 +0200)]
Set xbzrle buffers to NULL after freeing them to avoid double free errors

Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agoexec: fix ram_list dirty map optimization
Alexey Kardashevskiy [Thu, 30 Jan 2014 12:03:50 +0000 (23:03 +1100)]
exec: fix ram_list dirty map optimization

The ae2810c4bb3b383176e8e1b33931b16c01483aab patch introduced
optimization for ram_list.dirty_memory update. However it can only
work correctly if hpratio is 1 as the @bitmap parameter stores 1 bits
per system page size (may vary, 4K or 64K on PPC64) and
ram_list.dirty_memory stores 1 bit per TARGET_PAGE_SIZE
(which is hardcoded to 4K).

This fixes hpratio!=1 case to fall back to the slow path.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agovmstate: Make VMSTATE_STRUCT_POINTER take type, not ptr-to-type
Peter Maydell [Wed, 1 Jan 2014 21:56:57 +0000 (21:56 +0000)]
vmstate: Make VMSTATE_STRUCT_POINTER take type, not ptr-to-type

The VMSTATE_STRUCT_POINTER macros are a bit odd in that they
must be passed an argument "FooType *" rather than just taking
the FooType. They're only used in one place, so it's easy to
tidy this up. This also lets us use the macro to replace the
hand-rolled VMSTATE_PTIMER.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Juan Quintela <quintela@redhat.com>
10 years agotarget-i386: Move KVM default-vendor hack to instance_init
Eduardo Habkost [Thu, 30 Jan 2014 19:48:55 +0000 (17:48 -0200)]
target-i386: Move KVM default-vendor hack to instance_init

As we will not have a cpu_x86_find_by_name() function anymore,
move the KVM default-vendor hack to instance_init.

Unfortunately we can't move that code to class_init because it depends
on KVM being initialized.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: Don't change x86_def_t struct on cpu_x86_register()
Eduardo Habkost [Thu, 30 Jan 2014 19:48:54 +0000 (17:48 -0200)]
target-i386: Don't change x86_def_t struct on cpu_x86_register()

As eventually the x86_def_t data is going to be provided by the CPU
class, it's better to not touch it, and handle the special cases on the
X86CPU object itself.

Current behavior of the code should stay exactly the same.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: Eliminate CONFIG_KVM #ifdefs
Eduardo Habkost [Thu, 30 Jan 2014 19:48:53 +0000 (17:48 -0200)]
target-i386: Eliminate CONFIG_KVM #ifdefs

The compiler is already able to eliminate the kvm_arch_get_supported_cpuid()
calls in kvm_cpu_fill_host() and filter_features_for_kvm(), so we can
eliminate the CONFIG_KVM #ifdefs there.

Also, kvm_cpu_fill_host() and host_cpuid() don't need to check
CONFIG_KVM, as they don't have any KVM-specific function calls.

Tested to build successfully with CONFIG_KVM disabled, using the
following CFLAGS combinations: "-DNDEBUG", "-DNDEBUG -O', "-DNDEBUG
-O0", "-DNDEBUG -O1", "-DNDEBUG -O2".

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agokvm: add support for hyper-v timers
Vadim Rozenfeld [Thu, 23 Jan 2014 13:40:49 +0000 (00:40 +1100)]
kvm: add support for hyper-v timers

http://msdn.microsoft.com/en-us/library/windows/hardware/ff541625%28v=vs.85%29.aspx

This code is generic for activating reference time counter or virtual reference time stamp counter

Signed-off-by: Vadim Rozenfeld <vrozenfe@redhat.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agokvm: make hyperv vapic assist page migratable
Vadim Rozenfeld [Thu, 23 Jan 2014 13:40:48 +0000 (00:40 +1100)]
kvm: make hyperv vapic assist page migratable

Signed-off-by: Vadim Rozenfeld <vrozenfe@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agokvm: make hyperv hypercall and guest os id MSRs migratable.
Vadim Rozenfeld [Thu, 23 Jan 2014 13:40:47 +0000 (00:40 +1100)]
kvm: make hyperv hypercall and guest os id MSRs migratable.

Signed-off-by: Vadim Rozenfeld <vrozenfe@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agokvm: make availability of Hyper-V enlightenments dependent on KVM_CAP_HYPERV
Paolo Bonzini [Thu, 23 Jan 2014 18:16:12 +0000 (19:16 +0100)]
kvm: make availability of Hyper-V enlightenments dependent on KVM_CAP_HYPERV

The MS docs specify HV_X64_MSR_HYPERCALL as a mandatory interface,
thus we must provide the MSRs even if the user only specified
features that, like relaxed timing, in principle don't require them.
And the MSRs are only there if the hypervisor has KVM_CAP_HYPERV.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agoKVM: fix coexistence of KVM and Hyper-V leaves
Paolo Bonzini [Thu, 23 Jan 2014 18:27:24 +0000 (19:27 +0100)]
KVM: fix coexistence of KVM and Hyper-V leaves

kvm_arch_init_vcpu's initialization of the KVM leaves at 0x40000100
is broken, because KVM_CPUID_FEATURES is left at 0x40000001.  Move
it to 0x40000101 if Hyper-V is enabled.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agokvm: print suberror on all internal errors
Radim Krčmář [Tue, 21 Jan 2014 17:11:31 +0000 (18:11 +0100)]
kvm: print suberror on all internal errors

KVM introduced internal error exit reason and suberror at the same time,
and later extended it with internal error data.
QEMU does not report suberror on hosts between these two events because
we check for the extension. (half a year in 2009, but it is misleading)

Fix by removing KVM_CAP_INTERNAL_ERROR_DATA condition on printf.

(partially improved by bb44e0d12df70 and ba4047cf848a3 in the past)

Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: kvm_check_features_against_host(): Kill feature word array
Eduardo Habkost [Mon, 20 Jan 2014 16:41:14 +0000 (14:41 -0200)]
target-i386: kvm_check_features_against_host(): Kill feature word array

We don't need the ft[] array on kvm_check_features_against_host()
anymore, as we can simply use the feature_word_info[] array, that has
everything we need.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: kvm_cpu_fill_host(): Fill feature words in a loop
Eduardo Habkost [Mon, 20 Jan 2014 16:41:13 +0000 (14:41 -0200)]
target-i386: kvm_cpu_fill_host(): Fill feature words in a loop

Now that the kvm_cpu_fill_host() code is simplified, we can simply set
the feature word array using a simple loop.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: kvm_cpu_fill_host(): Set all feature words at end of function
Eduardo Habkost [Mon, 20 Jan 2014 16:41:12 +0000 (14:41 -0200)]
target-i386: kvm_cpu_fill_host(): Set all feature words at end of function

Reorder the code so all the code that sets x86_cpu_def->features is at
the end of the function.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: kvm_cpu_fill_host(): No need to check xlevel2
Eduardo Habkost [Mon, 20 Jan 2014 16:41:11 +0000 (14:41 -0200)]
target-i386: kvm_cpu_fill_host(): No need to check xlevel2

There's no need to check CPU xlevel2 before calling
kvm_arch_get_supported_cpuid(s, 0xC0000001, 0, R_EDX), because:

 * The kernel won't return any entry for 0xC0000000 if host CPU vendor
   is not Centaur (See kvm_dev_ioctl_get_supported_cpuid() on the kernel
   code)
 * Similarly, the kernel won't return any entry for 0xC0000001 if
   CPUID[0xC0000000].EAX is < 0xC0000001
 * kvm_arch_get_supported_cpuid() will return 0 if no entry is returned
   by the kernel for the requested leaf

For similar reasons, we can simply set x86_cpu_def->xlevel2 directly
instead of making it conditional, because it will be set to 0 CPU vendor
is not Centaur.

This will simplify the kvm_cpu_fill_host() code a little.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
[Remove unparseable comment. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: kvm_cpu_fill_host(): No need to check CPU vendor
Eduardo Habkost [Mon, 20 Jan 2014 16:41:10 +0000 (14:41 -0200)]
target-i386: kvm_cpu_fill_host(): No need to check CPU vendor

There's no need to check CPU vendor before calling
kvm_arch_get_supported_cpuid(s, 0xC0000000, 0, R_EAX), because:

 * The kernel won't return any entry for 0xC0000000 if host CPU vendor
   is not Centaur (See kvm_dev_ioctl_get_cpuid() on the kernel code);
 * kvm_arch_get_supported_cpuid() will return 0 if no entry is returned
   by the kernel for the requested leaf.

This will simplify the kvm_cpu_fill_host() code a little.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: kvm_cpu_fill_host(): No need to check level
Eduardo Habkost [Mon, 20 Jan 2014 16:41:09 +0000 (14:41 -0200)]
target-i386: kvm_cpu_fill_host(): No need to check level

There's no need to check level (CPUID[0].EAX) before calling
kvm_arch_get_supported_cpuid(s, 0x7, 0, R_EBX), because:

 * The kernel won't return any entry for CPUID 7 if CPUID[0].EAX is < 7
   on the host (See kvm_dev_ioctl_get_cpuid() on the kernel code);
 * kvm_arch_get_supported_cpuid() will return 0 if no entry is returned
   by the kernel for the requested leaf.

This will simplify the kvm_cpu_fill_host() code a little.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: kvm_cpu_fill_host(): Kill unused code
Eduardo Habkost [Mon, 20 Jan 2014 16:41:08 +0000 (14:41 -0200)]
target-i386: kvm_cpu_fill_host(): Kill unused code

Those host_cpuid() calls are useless. They are leftovers from when the
old code using host_cpuid() was removed.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agoqtest: unlink UNIX domain sockets after connecting
Stefan Hajnoczi [Thu, 21 Nov 2013 10:37:25 +0000 (11:37 +0100)]
qtest: unlink UNIX domain sockets after connecting

UNIX domain sockets are leaked when tests call abort(3) (indirectly via
glib assert functions).

Unlink the files immediately after the connection has been established
to avoid leaks.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqtest: unlink QEMU pid file after startup
Stefan Hajnoczi [Thu, 21 Nov 2013 10:33:17 +0000 (11:33 +0100)]
qtest: unlink QEMU pid file after startup

After starting the QEMU process and initializing the QMP connection, we
can read the pid file and unlink it.

Just stash away the pid instead of the pid filename.  This way we can
avoid pid file leaks since running tests may abort(3) without cleanup.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoUpdate seabios binaries to 1.7.4
Gerd Hoffmann [Mon, 3 Feb 2014 14:36:01 +0000 (15:36 +0100)]
Update seabios binaries to 1.7.4

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoUpdate seabios submodule to 1.7.4
Gerd Hoffmann [Mon, 3 Feb 2014 14:31:47 +0000 (15:31 +0100)]
Update seabios submodule to 1.7.4

Not that many changes as we already have a git snapshot pretty close
to final 1.7.4 in the tree.  Most notably change is the vgabios change
which fixes the windows guest regression.

Full git shortlog:

Gerd Hoffmann (2):
      run qemu_cfg_e820 only for CONFIG_QEMU=y
      change boot order load log level

Kevin O'Connor (10):
      Minor - move sgdt/lgdt macros from stacks.c to x86.h.
      Separate out sec32init sections even when not doing code relocation.
      floppy: Fix incorrect LBA to CHS translation.
      floppy: Fix accesses to DOR register.
      vgabios: Avoid memory references via %esp register in vgabios.
      Small improvements to irqentry_extrastack assembler.
      floppy: Encode command and flags into single value in floppy pio code.
      On disk format request, verify cylinders and pass to driver.
      floppy: Implement cylinder seeking when accessing a different cylinder.
      coreboot: Make sure to print the SeaBIOS version in cbmem debug output.

Kyösti Mälkki (1):
      Fix CBMEM console overflow

10 years agoroms: remove explicit MAKEFLAGS from recursive make invocations
Bruce Rogers [Fri, 13 Dec 2013 17:13:50 +0000 (10:13 -0700)]
roms: remove explicit MAKEFLAGS from recursive make invocations

When using $(MAKE) within a makefile, we shouldn't be explicitly
including $(MAKEFLAGS) on the command-line. It causes problems
when that makefile is recursively invoked. When the roms/Makefile
is invoked as in make -C roms bios a spurious 'w' appears on the
sub-make invocation, due to the erroneous $(MAKEFLAGS) inclusion.

Signed-off-by: Bruce Rogers <brogers@suse.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agolinux-user: Fix trampoline code for CRIS
Stefan Weil [Sat, 1 Feb 2014 08:41:09 +0000 (09:41 +0100)]
linux-user: Fix trampoline code for CRIS

__put_user can write bytes, words (2 bytes) or longwords (4 bytes).
Here obviously words should have been written, but bytes were written,
so values like 0x9c5f were truncated to 0x5f.

Fix this by changing retcode from uint8_t to to uint16_t in
target_signal_frame and also in the unused rt_signal_frame.

This problem was reported by static code analysis (smatch).

Cc: qemu-stable@nongnu.org
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Acked-by: Riku Voipio <riku.voipio@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
10 years agocris: Remove the CRIS PIC glue
Edgar E. Iglesias [Tue, 21 Jan 2014 13:49:44 +0000 (23:49 +1000)]
cris: Remove the CRIS PIC glue

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
10 years agoaxis-dev88: Connect the PIC upstream IRQs directly to the CPU
Edgar E. Iglesias [Tue, 21 Jan 2014 12:45:54 +0000 (22:45 +1000)]
axis-dev88: Connect the PIC upstream IRQs directly to the CPU

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
10 years agocris: Add interrupt signals to the CPU device
Edgar E. Iglesias [Tue, 21 Jan 2014 12:44:23 +0000 (22:44 +1000)]
cris: Add interrupt signals to the CPU device

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
10 years agocris: Abort when a v10 takes interrupts while in a delayslot
Edgar E. Iglesias [Sat, 18 Jan 2014 04:07:48 +0000 (04:07 +0000)]
cris: Abort when a v10 takes interrupts while in a delayslot

This is an internal error as the CRISv10 should mask interrupts
while executing delay slots. Bail out sooner rather than later.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
10 years agocris: Add "any" as alias for "crisv32" in user emulation
Edgar E. Iglesias [Sat, 18 Jan 2014 03:42:23 +0000 (03:42 +0000)]
cris: Add "any" as alias for "crisv32" in user emulation

Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
10 years agospice: hook qemu_chr_fe_set_open() event to ports
Marc-André Lureau [Fri, 10 Jan 2014 23:20:24 +0000 (00:20 +0100)]
spice: hook qemu_chr_fe_set_open() event to ports

This wires up a spice port event on virtio-ports open/close, so the
client is notified when the other end is ready.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoAdd the ability to vary Spice playback and record rates, to facilitate Opus support.
Jeremy White [Thu, 2 Jan 2014 15:25:56 +0000 (09:25 -0600)]
Add the ability to vary Spice playback and record rates, to facilitate Opus support.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agohw/display/qxl: fix signed to unsigned comparison
Alon Levy [Mon, 20 Jan 2014 16:57:12 +0000 (18:57 +0200)]
hw/display/qxl: fix signed to unsigned comparison

Several small signedness / overflow corrections to qxl_create_guest_primary:
1. use 64 bit unsigned for size to avoid overflow possible from two 32
bit multiplicants.
2. correct sign for requested_height
3. add a more verbose error message when setting guest bug state (which
causes a complete guess blackout until reset, so it helps if it is
verbose).

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoqxl: clear irq on reset
Alon Levy [Mon, 20 Jan 2014 10:44:19 +0000 (12:44 +0200)]
qxl: clear irq on reset

Without this we occasionally trigger an assert at
hw/pci/pci.c:pcibus_reset that asserts the irq_count is zero on reset.

This has become a problem with the new drm driver for linux, since doing
a reboot from console causes a race between console updates that set the
irq and the reset assertion that the irq is clear.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoMerge remote-tracking branch 'qmp-unstable/queue/qmp' into staging
Peter Maydell [Sat, 1 Feb 2014 23:32:23 +0000 (23:32 +0000)]
Merge remote-tracking branch 'qmp-unstable/queue/qmp' into staging

* qmp-unstable/queue/qmp:
  monitor: Cleanup mon->outbuf on write error
  virtio_rng: replace custom backend API with UserCreatable.complete() callback
  add optional 2nd stage initialization to -object/object-add commands
  vl.c: -object: don't ignore duplicate 'id'
  object_add: consolidate error handling

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'pmaydell/tags/pull-target-arm-20140131' into staging
Peter Maydell [Sat, 1 Feb 2014 23:06:11 +0000 (23:06 +0000)]
Merge remote-tracking branch 'pmaydell/tags/pull-target-arm-20140131' into staging

target-arm queue:
 * implementation of first part of the A64 Neon instruction set
 * v8 AArch32 rounding and 16<->64 fp conversion instructions
 * fix MIDR value on Zynq boards
 * some minor bugfixes/code cleanups

# gpg: Signature made Fri 31 Jan 2014 15:06:34 GMT using RSA key ID 14360CDE
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"

* pmaydell/tags/pull-target-arm-20140131: (34 commits)
  arm_gic: Fix GICD_ICPENDR and GICD_ISPENDR writes
  arm_gic: Introduce define for GIC_NR_SGIS
  target-arm: A64: Add SIMD shift by immediate
  target-arm: A64: Add simple SIMD 3-same floating point ops
  target-arm: A64: Add integer ops from SIMD 3-same group
  target-arm: A64: Add logic ops from SIMD 3 same group
  target-arm: A64: Add top level decode for SIMD 3-same group
  target-arm: A64: Add SIMD scalar 3 same add, sub and compare ops
  target-arm: A64: Add SIMD three-different ABDL instructions
  target-arm: A64: Add SIMD three-different multiply accumulate insns
  target-arm: Add AArch32 SIMD VCVTA, VCVTN, VCVTP and VCVTM
  target-arm: Add AArch32 FP VCVTA, VCVTN, VCVTP and VCVTM
  target-arm: Add AArch32 SIMD VRINTA, VRINTN, VRINTP, VRINTM, VRINTZ
  target-arm: Add set_neon_rmode helper
  target-arm: Add support for AArch32 SIMD VRINTX
  target-arm: Add support for AArch32 FP VRINTX
  target-arm: Add support for AArch32 FP VRINTZ
  target-arm: Add support for AArch32 FP VRINTR
  target-arm: Add AArch32 FP VRINTA, VRINTN, VRINTP and VRINTM
  target-arm: Move arm_rmode_to_sf to a shared location.
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/awilliam/tags/vfio-pci-for-qemu-20140128.0...
Peter Maydell [Sat, 1 Feb 2014 21:07:59 +0000 (21:07 +0000)]
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-pci-for-qemu-20140128.0' into staging

vfio-pci updates include:
 - Destroy MemoryRegions on device teardown
 - Print warnings around PCI option ROM failures
 - Skip bogus mappings from 64bit BAR sizing
 - Act on DMA mapping failures
 - Fix alignment to avoid MSI-X table mapping
 - Fix debug macro typo

# gpg: Signature made Tue 28 Jan 2014 15:27:47 GMT using RSA key ID 3BB08B22
# gpg: Can't check signature: public key not found

* remotes/awilliam/tags/vfio-pci-for-qemu-20140128.0:
  vfio: correct debug macro typo
  vfio: fix mapping of MSIX bar
  kvm: initialize qemu_host_page_size
  vfio-pci: Fail initfn on DMA mapping errors
  vfio: Filter out bogus mappings
  vfio: Do not reattempt a failed rom read
  vfio: warn if host device rom can't be read
  vfio: Destroy memory regions

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/sstabellini/xen-140130' into staging
Peter Maydell [Sat, 1 Feb 2014 20:43:07 +0000 (20:43 +0000)]
Merge remote-tracking branch 'remotes/sstabellini/xen-140130' into staging

* remotes/sstabellini/xen-140130:
  address_space_translate: do not cross page boundaries

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotests/.gitignore: Ignore tests/check-qom-interface
Fam Zheng [Mon, 27 Jan 2014 08:26:21 +0000 (16:26 +0800)]
tests/.gitignore: Ignore tests/check-qom-interface

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agohw/ppc: Remove unused defines
Stefan Weil [Sun, 26 Jan 2014 14:02:29 +0000 (15:02 +0100)]
hw/ppc: Remove unused defines

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoreadline: Add missing GCC_FMT_ATTR
Stefan Weil [Sat, 25 Jan 2014 17:18:23 +0000 (18:18 +0100)]
readline: Add missing GCC_FMT_ATTR

This fixes a compiler warning with -Werror=missing-format-attribute
and allows improved compiler checks for variable argument lists.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agotcg/s390: Remove sigill_handler
Richard Henderson [Wed, 29 Jan 2014 21:08:30 +0000 (13:08 -0800)]
tcg/s390: Remove sigill_handler

Commit c9baa30f42a87f61627391698f63fa4d1566d9d8 failed to
delete all of the relevant code, leading to Werrors about
unused symbols.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoi386: Add missing include file for QEMU_PACKED
Stefan Weil [Fri, 31 Jan 2014 22:05:24 +0000 (23:05 +0100)]
i386: Add missing include file for QEMU_PACKED

Instead of packing BiosLinkerLoaderEntry, an unused global variable called
QEMU_PACKED was created (detected by smatch static code analysis).

Including qemu-common.h gets the right definition and also includes some
standard include files which now can be removed here.

Cc: qemu-stable@nongnu.org
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoosdep: drop unused #include "trace.h"
Stefan Hajnoczi [Thu, 23 Jan 2014 20:27:59 +0000 (14:27 -0600)]
osdep: drop unused #include "trace.h"

osdep.c does not use trace_*() so we can just drop the include.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoqemu 1.7.0 does not build on NetBSD
Martin Husemann [Sat, 18 Jan 2014 13:47:23 +0000 (14:47 +0100)]
qemu 1.7.0 does not build on NetBSD

 Do not rely on int8_t (and friends) not being preprocessor
 symbols (or symbols expanding to themselves). On NetBSD (for example) the
 glue(u, SDATA_TYPE) results in u__int8_t, which is undefined. There is no way
 to stop cpp expanding inner macros, so just add the few lines explicitly and
 get rid of the magic.

Signed-off-by: Martin Husemann <martin@NetBSD.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoqemu-iotests: only run 071 on qcow2
Stefan Hajnoczi [Wed, 29 Jan 2014 15:33:54 +0000 (16:33 +0100)]
qemu-iotests: only run 071 on qcow2

The 071 test is designed for IMGFMT=qcow2 because it uses the l2_load
blkdebug event.  Its output filtering also assumes that IMGFMT is not
raw since 071.out contains "format=raw" but IMGFMT=raw would filter the
output to "format=IMGFMT".

Perhaps the test case can be rewritten to be more generic, but for now
let's document that it was only supposed to work with qcow2.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
10 years agodataplane: Comment fix
Markus Armbruster [Thu, 30 Jan 2014 15:34:12 +0000 (16:34 +0100)]
dataplane: Comment fix

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/vhdx: Error checking fixes
Markus Armbruster [Wed, 29 Jan 2014 17:05:08 +0000 (18:05 +0100)]
block/vhdx: Error checking fixes

Errors are inadvertently ignored in a few places.  Has always been
broken.  Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqemu-iotests: Drop assert_no_active_commit in case 040
Fam Zheng [Wed, 29 Jan 2014 10:47:23 +0000 (18:47 +0800)]
qemu-iotests: Drop assert_no_active_commit in case 040

It is exactly assert_no_active_block_jobs in iotests.py

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/vmdk: add basic .bdrv_check support
Peter Lieven [Wed, 29 Jan 2014 08:34:16 +0000 (09:34 +0100)]
block/vmdk: add basic .bdrv_check support

this adds a basic vmdk corruption check. it should detect severe
table corruptions and file truncation.

Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: remove qcow2 .bdrv_make_empty implementation
Jeff Cody [Mon, 27 Jan 2014 21:09:13 +0000 (16:09 -0500)]
block: remove qcow2 .bdrv_make_empty implementation

The QCOW2 .bdrv_make_empty implementation always returns 0 for success,
but does not actually do anything.

The proper way to not support an optional driver function stub is to
just not implement it, so let's remove the stub.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: remove QED .bdrv_make_empty implementation
Jeff Cody [Mon, 27 Jan 2014 21:09:12 +0000 (16:09 -0500)]
block: remove QED .bdrv_make_empty implementation

The QED .bdrv_make_empty() implementation does nothing but return
-ENOTSUP, which causes problems in bdrv_commit().  Since the function
stub exists for QED, it is called, which then always returns an error.

The proper way to not support an optional driver function stub is to
just not implement it, so let's remove the stub.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoDescribe flaws in qcow/qcow2 encryption in the docs
Daniel P. Berrange [Wed, 22 Jan 2014 15:47:10 +0000 (15:47 +0000)]
Describe flaws in qcow/qcow2 encryption in the docs

The qemu-img.texi / qemu-doc.texi files currently describe the
qcow2/qcow2 encryption thus

  "Encryption uses the AES format which is very secure (128 bit
   keys). Use a long password (16 characters) to get maximum
   protection."

While AES is indeed a strong encryption system, the way that
QCow/QCow2 use it results in a poor/weak encryption system.
Due to the use of predictable IVs, based on the sector number
extended to 128 bits, it is vulnerable to chosen plaintext
attacks which can reveal the existence of encrypted data.

The direct use of the user passphrase as the encryption key
also leads to an inability to change the passphrase of an
image. If passphrase is ever compromised the image data will
all be vulnerable, since it cannot be re-encrypted. The admin
has to clone the image files with a new passphrase and then
use a program like shred to secure erase all the old files.

Recommend against any use of QCow/QCow2 encryption, directing
users to dm-crypt / LUKS which can meet modern cryptography
best practices.

[Changed "Qcow" to "qcow" for consistency.
--Stefan]

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoarm_gic: Fix GICD_ICPENDR and GICD_ISPENDR writes
Christoffer Dall [Fri, 31 Jan 2014 14:47:38 +0000 (14:47 +0000)]
arm_gic: Fix GICD_ICPENDR and GICD_ISPENDR writes

Fix two bugs that would allow changing the state of SGIs through the
ICPENDR and ISPENDRs.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoarm_gic: Introduce define for GIC_NR_SGIS
Christoffer Dall [Fri, 31 Jan 2014 14:47:38 +0000 (14:47 +0000)]
arm_gic: Introduce define for GIC_NR_SGIS

Instead of hardcoding 16 various places in the code, use a define to
make it more clear what is going on.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: A64: Add SIMD shift by immediate
Alex Bennée [Fri, 31 Jan 2014 14:47:37 +0000 (14:47 +0000)]
target-arm: A64: Add SIMD shift by immediate

This implements a subset of the AdvSIMD shift operations (namely all the
none saturating or narrowing ones). The actual shift generation code
itself is common for both the scalar and vector cases but wrapped with
either vector element iteration or the fp reg access.

The rounding operations need to take special care to correctly reflect
the result of adding rounding bits on high bits as the intermediates do
not truncate.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: A64: Add simple SIMD 3-same floating point ops
Peter Maydell [Fri, 31 Jan 2014 14:47:37 +0000 (14:47 +0000)]
target-arm: A64: Add simple SIMD 3-same floating point ops

Implement a simple subset of the SIMD 3-same floating point
operations. This includes a common helper function used for both
scalar and vector ops; FABD is the only currently implemented
shared op.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-arm: A64: Add integer ops from SIMD 3-same group
Peter Maydell [Fri, 31 Jan 2014 14:47:37 +0000 (14:47 +0000)]
target-arm: A64: Add integer ops from SIMD 3-same group

Add some of the integer operations in the SIMD 3-same group:
specifically, the comparisons, addition and subtraction.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-arm: A64: Add logic ops from SIMD 3 same group
Peter Maydell [Fri, 31 Jan 2014 14:47:37 +0000 (14:47 +0000)]
target-arm: A64: Add logic ops from SIMD 3 same group

Add support for the logical operations (ORR, AND, BIC, ORN, EOR, BSL,
BIT and BIF) from the SIMD 3 register same group (C3.6.16).

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-arm: A64: Add top level decode for SIMD 3-same group
Peter Maydell [Fri, 31 Jan 2014 14:47:37 +0000 (14:47 +0000)]
target-arm: A64: Add top level decode for SIMD 3-same group

Add top level decode for the A64 SIMD three regs same group
(C3.6.16), splitting it into the pairwise, logical, float and
integer subgroups.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-arm: A64: Add SIMD scalar 3 same add, sub and compare ops
Peter Maydell [Fri, 31 Jan 2014 14:47:36 +0000 (14:47 +0000)]
target-arm: A64: Add SIMD scalar 3 same add, sub and compare ops

Implement the add, sub and compare ops from the SIMD "scalar three same"
group.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-arm: A64: Add SIMD three-different ABDL instructions
Peter Maydell [Fri, 31 Jan 2014 14:47:36 +0000 (14:47 +0000)]
target-arm: A64: Add SIMD three-different ABDL instructions

Implement the absolute-difference instructions in the SIMD
three-different group: SABAL, SABAL2, UABAL, UABAL2, SABDL,
SABDL2, UABDL, UABDL2.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-arm: A64: Add SIMD three-different multiply accumulate insns
Peter Maydell [Fri, 31 Jan 2014 14:47:36 +0000 (14:47 +0000)]
target-arm: A64: Add SIMD three-different multiply accumulate insns

Add support for the multiply-accumulate instructions from the
SIMD three-different instructions group (C3.6.15):
 * skeleton decode of unallocated encodings and split of
   the group into its three sub-parts
 * framework for handling the 64x64->128 widening subpart
 * implementation of the multiply-accumulate instructions
   SMLAL, SMLAL2, UMLAL, UMLAL2, SMLSL, SMLSL2, UMLSL, UMLSL2,
   UMULL, UMULL2, SMULL, SMULL2

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-arm: Add AArch32 SIMD VCVTA, VCVTN, VCVTP and VCVTM
Will Newton [Fri, 31 Jan 2014 14:47:35 +0000 (14:47 +0000)]
target-arm: Add AArch32 SIMD VCVTA, VCVTN, VCVTP and VCVTM

Add support for the AArch32 Advanced SIMD VCVTA, VCVTN, VCVTP
and VCVTM instructions.

Signed-off-by: Will Newton <will.newton@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: Add AArch32 FP VCVTA, VCVTN, VCVTP and VCVTM
Will Newton [Fri, 31 Jan 2014 14:47:35 +0000 (14:47 +0000)]
target-arm: Add AArch32 FP VCVTA, VCVTN, VCVTP and VCVTM

Add support for the AArch32 floating-point VCVTA, VCVTN, VCVTP
and VCVTM instructions.

Signed-off-by: Will Newton <will.newton@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: Add AArch32 SIMD VRINTA, VRINTN, VRINTP, VRINTM, VRINTZ
Will Newton [Fri, 31 Jan 2014 14:47:35 +0000 (14:47 +0000)]
target-arm: Add AArch32 SIMD VRINTA, VRINTN, VRINTP, VRINTM, VRINTZ

Add support for the AArch32 Advanced SIMD VRINTA, VRINTN, VRINTP
VRINTM and VRINTZ instructions.

Signed-off-by: Will Newton <will.newton@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>