sdk/emulator/qemu.git
11 years agolinux-user: correct argument number for sys_mremap and sys_splice
Petar Jovanovic [Tue, 23 Jul 2013 17:00:10 +0000 (19:00 +0200)]
linux-user: correct argument number for sys_mremap and sys_splice

sys_mremap missed 5th argument (new_address), which caused examples that
remap to a specific address to fail.
sys_splice missed 5th and 6th argument which caused different examples to
fail.
This change has an effect on MIPS target only.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoPPC: dbdma: macio: Fix format specifiers (build regression)
Stefan Weil [Fri, 12 Jul 2013 16:48:39 +0000 (18:48 +0200)]
PPC: dbdma: macio: Fix format specifiers (build regression)

Fix a number of warnings for 32 bit builds (tested on MingW and Linux):

  CC    hw/ide/macio.o
qemu/hw/ide/macio.c: In function 'pmac_ide_atapi_transfer_cb':
qemu/hw/ide/macio.c:134:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format]
qemu/hw/ide/macio.c: In function 'pmac_ide_transfer_cb':
qemu/hw/ide/macio.c:215:5: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'int64_t' [-Werror=format]
qemu/hw/ide/macio.c:222:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format]
qemu/hw/ide/macio.c:264:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format]
cc1: all warnings being treated as errors
make: *** [hw/ide/macio.o] Error 1

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agowatchdog: Remove break after exit
Stefan Weil [Tue, 23 Jul 2013 04:46:49 +0000 (06:46 +0200)]
watchdog: Remove break after exit

This was dead code.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoexec: Remove env from list of poisoned names
Stefan Weil [Sun, 21 Jul 2013 14:43:14 +0000 (16:43 +0200)]
exec: Remove env from list of poisoned names

The global variable env was removed some time ago, so this name may be
used without any restriction now.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agohw/9pfs: Fix potential memory leak and avoid reuse of freed memory
Stefan Weil [Sun, 16 Jun 2013 10:14:36 +0000 (12:14 +0200)]
hw/9pfs: Fix potential memory leak and avoid reuse of freed memory

The leak was reported by cppcheck.

Function proxy_init also calls g_free for ctx->fs_root.
Avoid reuse of this memory by setting ctx->fs_root to NULL.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agotimer: make timers_state static
Liu Ping Fan [Sun, 21 Jul 2013 08:43:00 +0000 (08:43 +0000)]
timer: make timers_state static

Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoaes: Remove unused code (NDEBUG, u16)
Stefan Weil [Sat, 29 Jun 2013 15:10:48 +0000 (15:10 +0000)]
aes: Remove unused code (NDEBUG, u16)

The current code includes assert.h very early (from qemu-common.h),
so the definition of NDEBUG was without any effect.

In the initial version from 2004, NDEBUG was used to disable the assertions.
Those assertions are not in time critical code, so it is no longer
reasonable to disable them and the definition of NDEBUG can be removed.

Type u16 is also unused and therefore does not need a type definition.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoMerge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging
Anthony Liguori [Fri, 26 Jul 2013 22:53:19 +0000 (17:53 -0500)]
Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging

QOM CPUState refactorings

* Fix cpu_memory_rw_debug() breakage in s390x KVM
* Replace final CPUArchState in sysemu/kvm.h
* Introduce model subclasses for XtensaCPU
* Introduce CPUClass::gdb_num[_core]_regs
* Introduce CPUClass::gdb_core_xml_file
* Introduce CPUClass::gdb_{read,write}_register()
* Propagate CPUState further in gdbstub

# gpg: Signature made Fri 26 Jul 2013 05:04:28 PM CDT using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found

# By Andreas Färber (23) and others
# Via Andreas Färber
* afaerber/tags/qom-cpu-for-anthony: (25 commits)
  cpu: Introduce CPUClass::gdb_core_xml_file for GDB_CORE_XML
  target-cris: Factor out CPUClass::gdb_read_register() hook for v10
  cpu: Introduce CPUClass::gdb_{read,write}_register()
  gdbstub: Replace GET_REG*() macros with gdb_get_reg*() functions
  target-xtensa: Move cpu_gdb_{read,write}_register()
  target-lm32: Move cpu_gdb_{read,write}_register()
  target-s390x: Move cpu_gdb_{read,write}_register()
  target-alpha: Move cpu_gdb_{read,write}_register()
  target-cris: Move cpu_gdb_{read,write}_register()
  target-microblaze: Move cpu_gdb_{read,write}_register()
  target-sh4: Move cpu_gdb_{read,write}_register()
  target-openrisc: Move cpu_gdb_{read,write}_register()
  target-mips: Move cpu_gdb_{read,write}_register()
  target-m68k: Move cpu_gdb_{read,write}_register()
  target-arm: Move cpu_gdb_{read,write}_register()
  target-sparc: Move cpu_gdb_{read,write}_register()
  target-ppc: Move cpu_gdb_{read,write}_register()
  target-i386: Move cpu_gdb_{read,write}_register()
  cpu: Introduce CPUState::gdb_num_regs and CPUClass::gdb_num_core_regs
  gdbstub: Drop dead code in cpu_gdb_{read,write}_register()
  ...

11 years agocpu: Introduce CPUClass::gdb_core_xml_file for GDB_CORE_XML
Andreas Färber [Sun, 7 Jul 2013 13:08:22 +0000 (15:08 +0200)]
cpu: Introduce CPUClass::gdb_core_xml_file for GDB_CORE_XML

Replace the GDB_CORE_XML define in gdbstub.c with a CPUClass field.
Use first_cpu for qSupported and qXfer:features:read: for now.
Add a stub for xml_builtin.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-cris: Factor out CPUClass::gdb_read_register() hook for v10
Andreas Färber [Sun, 7 Jul 2013 12:39:41 +0000 (14:39 +0200)]
target-cris: Factor out CPUClass::gdb_read_register() hook for v10

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Introduce CPUClass::gdb_{read,write}_register()
Andreas Färber [Sat, 29 Jun 2013 02:18:45 +0000 (04:18 +0200)]
cpu: Introduce CPUClass::gdb_{read,write}_register()

Completes migration of target-specific code to new target-*/gdbstub.c.

Acked-by: Michael Walle <michael@walle.cc> (for lm32)
Acked-by: Max Filippov <jcmvbkbc@gmail.com> (for xtensa)
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agogdbstub: Replace GET_REG*() macros with gdb_get_reg*() functions
Andreas Färber [Sun, 7 Jul 2013 11:05:05 +0000 (13:05 +0200)]
gdbstub: Replace GET_REG*() macros with gdb_get_reg*() functions

This avoids polluting the global namespace with a non-prefixed macro and
makes it obvious in the call sites that we return.

Semi-automatic conversion using, e.g.,
 sed -i 's/GET_REGL(/return gdb_get_regl(mem_buf, /g' target-*/gdbstub.c
followed by manual tweaking for sparc's GET_REGA() and Coding Style.

Acked-by: Michael Walle <michael@walle.cc> (for lm32)
Acked-by: Max Filippov <jcmvbkbc@gmail.com> (for xtensa)
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-xtensa: Move cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 10:57:38 +0000 (12:57 +0200)]
target-xtensa: Move cpu_gdb_{read,write}_register()

Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-lm32: Move cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 10:55:44 +0000 (12:55 +0200)]
target-lm32: Move cpu_gdb_{read,write}_register()

Acked-by: Michael Walle <michael@walle.cc>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-s390x: Move cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 10:54:12 +0000 (12:54 +0200)]
target-s390x: Move cpu_gdb_{read,write}_register()

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-alpha: Move cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 10:52:32 +0000 (12:52 +0200)]
target-alpha: Move cpu_gdb_{read,write}_register()

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-cris: Move cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 10:50:22 +0000 (12:50 +0200)]
target-cris: Move cpu_gdb_{read,write}_register()

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-microblaze: Move cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 10:45:47 +0000 (12:45 +0200)]
target-microblaze: Move cpu_gdb_{read,write}_register()

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-sh4: Move cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 10:42:52 +0000 (12:42 +0200)]
target-sh4: Move cpu_gdb_{read,write}_register()

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-openrisc: Move cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 10:40:38 +0000 (12:40 +0200)]
target-openrisc: Move cpu_gdb_{read,write}_register()

Reviewed-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agosun4m: add display width and height to the firmware configuration
Mark Cave-Ayland [Fri, 26 Jul 2013 20:42:51 +0000 (21:42 +0100)]
sun4m: add display width and height to the firmware configuration

Currently the graphics resolution for TCX is fixed at 1024x768, however
other framebuffers are capable of supporting additional resolutions.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
CC: Anthony Liguori <aliguori@us.ibm.com>
CC: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Fri, 26 Jul 2013 21:54:19 +0000 (16:54 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

# By Kevin Wolf (16) and Ian Main (2)
# Via Kevin Wolf
* kwolf/for-anthony:
  Add tests for sync modes 'TOP' and 'NONE'
  Implement sync modes for drive-backup.
  Implement qdict_flatten()
  blockdev: Split up 'cache' option
  blockdev: Rename 'readonly' option to 'read-only'
  qcow2: Use dashes instead of underscores in options
  blockdev: Rename I/O throttling options for QMP
  QemuOpts: Add qemu_opt_unset()
  block: Allow "driver" option on the top level
  qapi: Anonymous unions
  qapi.py: Maintain a list of union types
  qapi: Add consume argument to qmp_input_get_object()
  qapi: Flat unions with arbitrary discriminator
  qapi: Add visitor for implicit structs
  docs: Document QAPI union types
  qapi-visit.py: Implement 'base' for unions
  qapi-visit.py: Split off generate_visit_struct_fields()
  qapi-types.py: Implement 'base' for unions

Message-id: 1374870032-31672-1-git-send-email-kwolf@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoseccomp: removing unused syscalls gtom whitelist
Eduardo Otubo [Mon, 22 Jul 2013 18:33:37 +0000 (15:33 -0300)]
seccomp: removing unused syscalls gtom whitelist

v3 update:
 - reincluding getrlimit(), it is used by Xen.

v2 update:
 - reincluding setrlimit(), it is used by Xen.

Signed-off-by: Eduardo Otubo <otubo@linux.vnet.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1374518017-10424-3-git-send-email-otubo@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoseccomp: no need to check arch in syscall whitelist
Eduardo Otubo [Mon, 22 Jul 2013 18:33:36 +0000 (15:33 -0300)]
seccomp: no need to check arch in syscall whitelist

v2 update:
- set libseccomp 2.1.0 as requirement on configure script.

Since libseccomp 2.0 there's no need to check the architecture type
anymore.

Signed-off-by: Eduardo Otubo <otubo@linux.vnet.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1374518017-10424-2-git-send-email-otubo@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotarget-mips: Move cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 10:38:42 +0000 (12:38 +0200)]
target-mips: Move cpu_gdb_{read,write}_register()

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-m68k: Move cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 10:33:56 +0000 (12:33 +0200)]
target-m68k: Move cpu_gdb_{read,write}_register()

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-arm: Move cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 10:32:15 +0000 (12:32 +0200)]
target-arm: Move cpu_gdb_{read,write}_register()

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-sparc: Move cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 10:29:26 +0000 (12:29 +0200)]
target-sparc: Move cpu_gdb_{read,write}_register()

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-ppc: Move cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 10:26:33 +0000 (12:26 +0200)]
target-ppc: Move cpu_gdb_{read,write}_register()

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-i386: Move cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 10:07:54 +0000 (12:07 +0200)]
target-i386: Move cpu_gdb_{read,write}_register()

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Introduce CPUState::gdb_num_regs and CPUClass::gdb_num_core_regs
Andreas Färber [Fri, 28 Jun 2013 21:18:47 +0000 (23:18 +0200)]
cpu: Introduce CPUState::gdb_num_regs and CPUClass::gdb_num_core_regs

CPUState::gdb_num_regs replaces num_g_regs.
CPUClass::gdb_num_core_regs replaces NUM_CORE_REGS.

Allows building gdb_register_coprocessor() for xtensa, too.

As a side effect this should fix coprocessor register numbering for SMP.

Acked-by: Michael Walle <michael@walle.cc> (for lm32)
Acked-by: Max Filippov <jcmvbkbc@gmail.com> (for xtensa)
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agogdbstub: Drop dead code in cpu_gdb_{read,write}_register()
Andreas Färber [Sun, 7 Jul 2013 09:52:52 +0000 (11:52 +0200)]
gdbstub: Drop dead code in cpu_gdb_{read,write}_register()

GET_REG*() macros include a return statement, thus no need for break.

Acked-by: Michael Walle <michael@walle.cc> (for lm32)
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agogdbstub: Fix cpu_gdb_{read,write}_register() Coding Style
Andreas Färber [Sun, 7 Jul 2013 09:17:26 +0000 (11:17 +0200)]
gdbstub: Fix cpu_gdb_{read,write}_register() Coding Style

Add braces, replace tabs, remove trailing whitespace, drop space before
parenthesis and place break etc. below case statements.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-xtensa: Introduce XtensaCPU subclasses
Andreas Färber [Sat, 6 Jul 2013 23:47:51 +0000 (01:47 +0200)]
target-xtensa: Introduce XtensaCPU subclasses

Register a CPU type per core registered. Save the XtensaConfig in
XtensaCPUClass and copy it from there to CPUXtensaState, to avoid
touching every env->config access for now.

Prepares for storing per-class GDB register count.

Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-s390x: Fix CPUState rework fallout
Christian Borntraeger [Fri, 26 Jul 2013 15:48:06 +0000 (17:48 +0200)]
target-s390x: Fix CPUState rework fallout

Commit f17ec444c3d39f76bcd8b71c2c05d5754bfe333e
exec: Change cpu_memory_rw_debug() argument to CPUState

missed to update s390x KVM code, breaking the build.

Let's fix it up.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agokvm: Change prototype of kvm_update_guest_debug()
Stefan Weil [Thu, 25 Jul 2013 18:50:21 +0000 (20:50 +0200)]
kvm: Change prototype of kvm_update_guest_debug()

Passing a CPUState pointer instead of a CPUArchState pointer eliminates
the last target dependent data type in sysemu/kvm.h.

It also simplifies the code.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agolinux-user: Avoid redundant ENV_GET_CPU()
Andreas Färber [Fri, 26 Jul 2013 14:42:25 +0000 (16:42 +0200)]
linux-user: Avoid redundant ENV_GET_CPU()

This fixes a mismerge in 874ec3c5b3821bb964f9f37b2f930f2a9ce51652.

Acked-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoAdd tests for sync modes 'TOP' and 'NONE'
Ian Main [Fri, 26 Jul 2013 18:39:05 +0000 (11:39 -0700)]
Add tests for sync modes 'TOP' and 'NONE'

This patch adds tests for sync modes top and none.  Test for 'TOP'
is separated out as it requires a backing file.  Also added a test
for invalid format.

Signed-off-by: Ian Main <imain@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoImplement sync modes for drive-backup.
Ian Main [Fri, 26 Jul 2013 18:39:04 +0000 (11:39 -0700)]
Implement sync modes for drive-backup.

This patch adds sync-modes to the drive-backup interface and
implements the FULL, NONE and TOP modes of synchronization.

FULL performs as before copying the entire contents of the drive
while preserving the point-in-time using CoW.
NONE only copies new writes to the target drive.
TOP copies changes to the topmost drive image and preserves the
point-in-time using CoW.

For sync mode TOP are creating a new target image using the same backing
file as the original disk image.  Then any new data that has been laid
on top of it since creation is copied in the main backup_run() loop.
There is an extra check in the 'TOP' case so that we don't bother to copy
all the data of the backing file as it already exists in the target.
This is where the bdrv_co_is_allocated() is used to determine if the
data exists in the topmost layer or below.

Also any new data being written is intercepted via the write_notifier
hook which ends up calling backup_do_cow() to copy old data out before
it gets overwritten.

For mode 'NONE' we create the new target image and only copy in the
original data from the disk image starting from the time the call was
made.  This preserves the point in time data by only copying the parts
that are *going to change* to the target image.  This way we can
reconstruct the final image by checking to see if the given block exists
in the new target image first, and if it does not, you can get it from
the original image.  This is basically an optimization allowing you to
do point-in-time snapshots with low overhead vs the 'FULL' version.

Since there is no old data to copy out the loop in backup_run() for the
NONE case just calls qemu_coroutine_yield() which only wakes up after
an event (usually cancel in this case).  The rest is handled by the
before_write notifier which again calls backup_do_cow() to write out
the old data so it can be preserved.

Signed-off-by: Ian Main <imain@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoImplement qdict_flatten()
Kevin Wolf [Mon, 8 Jul 2013 15:11:58 +0000 (17:11 +0200)]
Implement qdict_flatten()

qdict_flatten(): For each nested QDict with key x, all fields with key y
are moved to this QDict and their key is renamed to "x.y". This operation
is applied recursively for nested QDicts.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoblockdev: Split up 'cache' option
Kevin Wolf [Thu, 18 Jul 2013 14:31:25 +0000 (16:31 +0200)]
blockdev: Split up 'cache' option

The old 'cache' option really encodes three different boolean flags into
a cache mode name, without providing all combinations. Make them three
separate options instead and translate the old option to the new ones
for drive_init().

The specific boolean options take precedence if the old cache option is
specified as well, so the following options are equivalent:

-drive file=x,cache=none,cache.no-flush=true
-drive file=x,cache.writeback=true,cache.direct=true,cache.no-flush=true

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoblockdev: Rename 'readonly' option to 'read-only'
Kevin Wolf [Fri, 19 Jul 2013 18:07:29 +0000 (20:07 +0200)]
blockdev: Rename 'readonly' option to 'read-only'

Option name cleanup before it becomes a QMP API.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoqcow2: Use dashes instead of underscores in options
Kevin Wolf [Wed, 17 Jul 2013 12:45:34 +0000 (14:45 +0200)]
qcow2: Use dashes instead of underscores in options

This is what QMP wants to use. The options haven't been enabled in any
release yet, so we're still free to change them.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoblockdev: Rename I/O throttling options for QMP
Kevin Wolf [Wed, 17 Jul 2013 12:41:54 +0000 (14:41 +0200)]
blockdev: Rename I/O throttling options for QMP

In QMP, we want to use dashes instead of underscores in QMP argument
names, and use nested options for throttling.

The new option names affect the command line as well, but for
compatibility drive_init() will convert the old option names before
calling into the code that will be shared between -drive and
blockdev-add.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoQemuOpts: Add qemu_opt_unset()
Kevin Wolf [Wed, 17 Jul 2013 12:40:37 +0000 (14:40 +0200)]
QemuOpts: Add qemu_opt_unset()

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoblock: Allow "driver" option on the top level
Kevin Wolf [Tue, 9 Jul 2013 09:09:02 +0000 (11:09 +0200)]
block: Allow "driver" option on the top level

This is traditionally -drive format=..., which is now translated into
the new driver option. This gives us a more consistent way to select the
driver of BlockDriverStates that can be used in QMP context, too.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoqapi: Anonymous unions
Kevin Wolf [Mon, 8 Jul 2013 14:14:21 +0000 (16:14 +0200)]
qapi: Anonymous unions

The discriminator for anonymous unions is the data type. This allows to
have a union type that allows both of these:

    { 'file': 'my_existing_block_device_id' }
    { 'file': { 'filename': '/tmp/mydisk.qcow2', 'read-only': true } }

Unions like this are specified in the schema with an empty dict as
discriminator. For this example you could take:

    { 'union': 'BlockRef',
      'discriminator': {},
      'data': { 'definition': 'BlockOptions',
                'reference': 'str' } }
    { 'type': 'ExampleObject',
      'data: { 'file': 'BlockRef' } }

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoqapi.py: Maintain a list of union types
Kevin Wolf [Tue, 16 Jul 2013 08:49:41 +0000 (10:49 +0200)]
qapi.py: Maintain a list of union types

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoqapi: Add consume argument to qmp_input_get_object()
Kevin Wolf [Mon, 8 Jul 2013 09:33:07 +0000 (11:33 +0200)]
qapi: Add consume argument to qmp_input_get_object()

This allows to just look at the next element without actually consuming
it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoqapi: Flat unions with arbitrary discriminator
Kevin Wolf [Wed, 3 Jul 2013 13:58:57 +0000 (15:58 +0200)]
qapi: Flat unions with arbitrary discriminator

Instead of the rather verbose syntax that distinguishes base and
subclass fields...

  { "type": "file",
    "read-only": true,
    "data": {
        "filename": "test"
    } }

...we can now have both in the same namespace, allowing a more direct
mapping of the command line, and moving fields between the common base
and subclasses without breaking the API:

  { "driver": "file",
    "read-only": true,
    "filename": "test" }

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoqapi: Add visitor for implicit structs
Kevin Wolf [Wed, 3 Jul 2013 13:52:42 +0000 (15:52 +0200)]
qapi: Add visitor for implicit structs

These can be used when an embedded struct is parsed and members not
belonging to the struct may be present in the input (e.g. parsing a
flat namespace QMP union, where fields from both the base and one
of the alternative types are mixed in the JSON object)

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agodocs: Document QAPI union types
Kevin Wolf [Tue, 16 Jul 2013 11:17:27 +0000 (13:17 +0200)]
docs: Document QAPI union types

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoqapi-visit.py: Implement 'base' for unions
Kevin Wolf [Tue, 2 Jul 2013 14:20:04 +0000 (16:20 +0200)]
qapi-visit.py: Implement 'base' for unions

This implements the visitor part of base types for unions. Parsed into
QMP, this example schema definition...

    { 'type': 'BlockOptionsBase', 'data': { 'read-only': 'bool' } }
    { 'type': 'BlockOptionsQcow2, 'data': { 'lazy-refcounts': 'bool' } }

    { 'union': 'BlockOptions',
      'base': 'BlockOptionsBase',
      'data': {
          'raw': 'BlockOptionsRaw'
          'qcow2': 'BlockOptionsQcow2'
      } }

...would describe the following JSON object:

    { "type": "qcow2",
      "read-only": true,
      "data": { "lazy-refcounts": false } }

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoqapi-visit.py: Split off generate_visit_struct_fields()
Kevin Wolf [Tue, 2 Jul 2013 14:18:35 +0000 (16:18 +0200)]
qapi-visit.py: Split off generate_visit_struct_fields()

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoqapi-types.py: Implement 'base' for unions
Kevin Wolf [Tue, 2 Jul 2013 10:18:47 +0000 (12:18 +0200)]
qapi-types.py: Implement 'base' for unions

The new 'base' key in a union definition refers to a struct type, which
is inlined into the union definition and can represent fields common to
all kinds.

For example the following schema definition...

    { 'type': 'BlockOptionsBase', 'data': { 'read-only': 'bool' } }

    { 'union': 'BlockOptions',
      'base': 'BlockOptionsBase',
      'data': {
          'raw': 'BlockOptionsRaw'
          'qcow2': 'BlockOptionsQcow2'
      } }

...would result in this generated C struct:

    struct BlockOptions
    {
        BlockOptionsKind kind;
        union {
            void *data;
            BlockOptionsRaw * raw;
            BlockOptionsQcow2 * qcow2;
        };
        bool read_only;
    };

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
11 years agoMerge remote-tracking branch 'rth/tcg-next' into staging
Anthony Liguori [Fri, 26 Jul 2013 18:04:21 +0000 (13:04 -0500)]
Merge remote-tracking branch 'rth/tcg-next' into staging

# By Claudio Fontana (1) and others
# Via Richard Henderson
* rth/tcg-next:
  tcg: Remove temp_buf
  tcg/aarch64: Implement tlb lookup fast path
  tcg/aarch64: implement ldst 12bit scaled uimm offset

Message-id: 1373919944-8521-1-git-send-email-rth@twiddle.net
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'jliu/or32' into staging
Anthony Liguori [Fri, 26 Jul 2013 18:04:07 +0000 (13:04 -0500)]
Merge remote-tracking branch 'jliu/or32' into staging

# By Jia Liu
# Via Jia Liu
* jliu/or32:
  target-openrisc: Free typename in openrisc_cpu_class_by_name
  hw/openrisc: Use stderr output instead of qemu_log
  hw/openrisc: Indent typo

Message-id: 1374576458-22808-1-git-send-email-proljc@gmail.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'mdroth/qga-pull-2013-7-25' into staging
Anthony Liguori [Thu, 25 Jul 2013 20:58:29 +0000 (15:58 -0500)]
Merge remote-tracking branch 'mdroth/qga-pull-2013-7-25' into staging

# By Laszlo Ersek
# Via Michael Roth
* mdroth/qga-pull-2013-7-25:
  qga: escape cmdline args when registering win32 service (CVE-2013-2231)
  ga_install_service(): nest error paths more idiomatically
  qga/service-win32.c: diagnostic output should go to stderr

Message-id: 1374784644-29078-1-git-send-email-mdroth@linux.vnet.ibm.com

11 years agoMerge remote-tracking branch 'kraxel/seabios-1.7.3' into staging
Anthony Liguori [Thu, 25 Jul 2013 20:56:36 +0000 (15:56 -0500)]
Merge remote-tracking branch 'kraxel/seabios-1.7.3' into staging

# By Gerd Hoffmann
# Via Gerd Hoffmann
* kraxel/seabios-1.7.3:
  seabios: update to 1.7.3

Message-id: 1374673573-25074-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'riku/linux-user-for-upstream' into staging
Anthony Liguori [Thu, 25 Jul 2013 20:56:06 +0000 (15:56 -0500)]
Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging

* riku/linux-user-for-upstream: (21 commits)
  linux-user: Handle compressed ISA encodings when processing MIPS exceptions
  linux-user: Unlock mmap_lock when resuming guest from page_unprotect
  linux-user: Reset copied CPUs in cpu_copy() always
  linux-user: Fix epoll on ARM hosts
  linux-user: fix segmentation fault passing with h2g(x) != x
  linux-user: Fix pipe syscall return for SPARC
  linux-user: Fix target_stat and target_stat64 for OpenRISC
  linux-user: Avoid conditional cpu_reset()
  configure: Make NPTL non-optional
  linux-user: Enable NPTL for x86-64
  linux-user: Add i386 TLS setter
  linux-user: Clean up handling of clone() argument order
  linux-user: Add missing 'break' in i386 get_thread_area syscall
  linux-user: Enable NPTL for m68k
  linux-user: Enable NPTL for SPARC targets
  linux-user: Enable NPTL for OpenRISC
  linux-user: Move includes of target-specific headers to end of qemu.h
  configure: Enable threading for unicore32-linux-user
  configure: Enable threading on all ppc and mips linux-user targets
  configure: Don't say target_nptl="no" if there is no linux-user target
  ...

Conflicts:
linux-user/main.c

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqga: escape cmdline args when registering win32 service (CVE-2013-2231)
Laszlo Ersek [Wed, 3 Jul 2013 13:14:10 +0000 (15:14 +0200)]
qga: escape cmdline args when registering win32 service (CVE-2013-2231)

Reported-by: Lev Veyde <lveyde@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
11 years agoga_install_service(): nest error paths more idiomatically
Laszlo Ersek [Wed, 3 Jul 2013 13:14:09 +0000 (15:14 +0200)]
ga_install_service(): nest error paths more idiomatically

Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
11 years agoqga/service-win32.c: diagnostic output should go to stderr
Laszlo Ersek [Wed, 3 Jul 2013 13:14:08 +0000 (15:14 +0200)]
qga/service-win32.c: diagnostic output should go to stderr

Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
11 years agopc-testdev: add I/O port to test memory.c auto split/combine
Paolo Bonzini [Mon, 22 Jul 2013 13:54:38 +0000 (15:54 +0200)]
pc-testdev: add I/O port to test memory.c auto split/combine

The ports at 0xe8..0xeb have impl.min/max_access_size == 1, so
that memory accesses are split and combined by the memory core.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-29-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomemory: check memory region endianness, not target's
Paolo Bonzini [Mon, 22 Jul 2013 13:54:37 +0000 (15:54 +0200)]
memory: check memory region endianness, not target's

When combining multiple accesses into a single value, we need to do so
in the device's desired endianness.  The target endianness does not have
any influence.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-28-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomemory: pass MemoryRegion to access_with_adjusted_size
Paolo Bonzini [Mon, 22 Jul 2013 13:54:36 +0000 (15:54 +0200)]
memory: pass MemoryRegion to access_with_adjusted_size

The accessors all use a MemoryRegion opaque value.  Avoid going
uselessly through void*.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-27-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomemory: move functions around
Paolo Bonzini [Mon, 22 Jul 2013 13:54:35 +0000 (15:54 +0200)]
memory: move functions around

Prepare for next patch, no semantic change.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-26-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqtest: add test for ISA I/O space endianness
Paolo Bonzini [Mon, 22 Jul 2013 13:54:34 +0000 (15:54 +0200)]
qtest: add test for ISA I/O space endianness

This writes a register and reads its 1/2/4 byte parts.  Masking
is done in the device model.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-25-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agodefault-configs/ppc64: add all components of i82378 SuperIO chip used by prep
Paolo Bonzini [Mon, 22 Jul 2013 13:54:33 +0000 (15:54 +0200)]
default-configs/ppc64: add all components of i82378 SuperIO chip used by prep

The device provides an ISA bus so that pseries can also run the
endianness test.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-24-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agodefault-configs: add SuperIO to SH4
Paolo Bonzini [Mon, 22 Jul 2013 13:54:32 +0000 (15:54 +0200)]
default-configs: add SuperIO to SH4

The device provides an ISA bus to run the endianness test on.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-23-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agodefault-configs: add test device to all machines supporting ISA
Paolo Bonzini [Mon, 22 Jul 2013 13:54:31 +0000 (15:54 +0200)]
default-configs: add test device to all machines supporting ISA

This will let these machines run an endianness test for ISA
I/O port space.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-22-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agosparc64: unbreak
Paolo Bonzini [Mon, 22 Jul 2013 13:54:30 +0000 (15:54 +0200)]
sparc64: unbreak

... by making apb a subclass of TYPE_PCI_HOST_BRIDGE.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-21-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agosh4: unbreak r2d
Paolo Bonzini [Mon, 22 Jul 2013 13:54:29 +0000 (15:54 +0200)]
sh4: unbreak r2d

... by making sh_pci a subclass of TYPE_PCI_HOST_BRIDGE.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-20-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomips: degrade BIOS error to warning
Paolo Bonzini [Mon, 22 Jul 2013 13:54:28 +0000 (15:54 +0200)]
mips: degrade BIOS error to warning

No free MIPS BIOS is available, so it makes little sense to quit.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-19-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc-testdev: remove useless cpu_to_le64/le64_to_cpu
Paolo Bonzini [Mon, 22 Jul 2013 13:54:27 +0000 (15:54 +0200)]
pc-testdev: remove useless cpu_to_le64/le64_to_cpu

So far the device was only used on little-endian machines.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-18-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc-testdev: support 8 and 16-bit accesses to 0xe0
Paolo Bonzini [Mon, 22 Jul 2013 13:54:26 +0000 (15:54 +0200)]
pc-testdev: support 8 and 16-bit accesses to 0xe0

This will let us use the testdev to test endianness.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-17-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoRevert "ioport: remove LITTLE_ENDIAN mark for portio"
Paolo Bonzini [Mon, 22 Jul 2013 13:54:25 +0000 (15:54 +0200)]
Revert "ioport: remove LITTLE_ENDIAN mark for portio"

This reverts commit c3cb8e77804313e1be99b5f28a34a346736707a5.

The scenario where I/O ports are accessed with DEVICE_LITTLE_ENDIAN
endianness now works and will soon be unit tested.  Since the PortioList
indirection assumes little endian, define portio_ops the same way.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-16-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoisa_mmio: delete
Paolo Bonzini [Mon, 22 Jul 2013 13:54:24 +0000 (15:54 +0200)]
isa_mmio: delete

It is not used anymore.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-15-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoebus: do not use isa_mmio
Paolo Bonzini [Mon, 22 Jul 2013 13:54:23 +0000 (15:54 +0200)]
ebus: do not use isa_mmio

This is untested, because ebus does not have a libqos module.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-14-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agosparc64: remove indirection for I/O port access
Paolo Bonzini [Mon, 22 Jul 2013 13:54:22 +0000 (15:54 +0200)]
sparc64: remove indirection for I/O port access

This fixes endianness bugs in I/O port access.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-13-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomips_fulong2e: do not use isa_mmio
Paolo Bonzini [Mon, 22 Jul 2013 13:54:21 +0000 (15:54 +0200)]
mips_fulong2e: do not use isa_mmio

This board is little-endian, but still isa_mmio should die. :)

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-12-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomipssim: do not use isa_mmio
Paolo Bonzini [Mon, 22 Jul 2013 13:54:20 +0000 (15:54 +0200)]
mipssim: do not use isa_mmio

Untested, this board does not support PCI so it cannot run endianness-test.
It should fix endianness bugs in I/O port access.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-11-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoppc440_bamboo: do not use isa_mmio
Paolo Bonzini [Mon, 22 Jul 2013 13:54:19 +0000 (15:54 +0200)]
ppc440_bamboo: do not use isa_mmio

This fixes endianness bugs in I/O port access.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-10-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomips_malta: do not use isa_mmio
Paolo Bonzini [Mon, 22 Jul 2013 13:54:18 +0000 (15:54 +0200)]
mips_malta: do not use isa_mmio

This fixes endianness bugs in I/O port access.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-9-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomips_r4k: do not use isa_mmio
Paolo Bonzini [Mon, 22 Jul 2013 13:54:17 +0000 (15:54 +0200)]
mips_r4k: do not use isa_mmio

This fixes endianness bugs in I/O port access.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-8-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomips_jazz: do not use isa_mmio
Paolo Bonzini [Mon, 22 Jul 2013 13:54:16 +0000 (15:54 +0200)]
mips_jazz: do not use isa_mmio

This fixes endianness bugs in I/O port access.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-7-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoprep: fix I/O port endianness
Paolo Bonzini [Mon, 22 Jul 2013 13:54:15 +0000 (15:54 +0200)]
prep: fix I/O port endianness

Do not swap endianness here, it will happen during cpu_{in,out}{b,w,l}.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-6-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agospapr_pci: remove indirection for I/O port access
Alexey Kardashevskiy [Mon, 22 Jul 2013 13:54:14 +0000 (15:54 +0200)]
spapr_pci: remove indirection for I/O port access

This fixes endianness bugs in I/O port access.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-5-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoppc_newworld: do not use isa_mmio
Paolo Bonzini [Mon, 22 Jul 2013 13:54:13 +0000 (15:54 +0200)]
ppc_newworld: do not use isa_mmio

This fixes endianness bugs in I/O port access.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-4-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoppc_oldworld: do not use isa_mmio
Paolo Bonzini [Mon, 22 Jul 2013 13:54:12 +0000 (15:54 +0200)]
ppc_oldworld: do not use isa_mmio

This fixes endianness bugs in I/O port access.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-3-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agosh4: do not use isa_mmio
Paolo Bonzini [Mon, 22 Jul 2013 13:54:11 +0000 (15:54 +0200)]
sh4: do not use isa_mmio

This fixes endianness bugs in I/O port access (for sh4eb).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1374501278-31549-2-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoseabios: update to 1.7.3
Gerd Hoffmann [Wed, 24 Jul 2013 13:32:31 +0000 (15:32 +0200)]
seabios: update to 1.7.3

Changes summary (git shortlog rel-1.7.2.2..rel-1.7.3):

Alex Williamson (4):
      seabios q35: Enable all PIRQn IRQs at startup
      seabios q35: Add new PCI slot to irq routing function
      seabios: Add a dummy PCI slot to irq mapping function
      pciinit: Enable default VGA device

Asias He (2):
      virtio-scsi: Set _DRIVER_OK flag before scsi target scanning
      virtio-scsi: Pack struct virtio_scsi_{req_cmd,resp_cmd}

Avik Sil (1):
      USB-EHCI: Fix null pointer assignment

Christian Gmeiner (5):
      geodevga: fix errors in geode_fp_* functions
      geodevga: move framebuffer setup
      geodevga: move output setup to own function
      geodevga: add debug to msr functions
      geodevga: fix wrong define name

David Woodhouse (26):
      Add macros for pushing and popping struct bregs
      Clean up #if in pirtable.c. CONFIG_PIRTABLE can't be set if CONFIG_COREBOOT is
      post: Export functions which will be used individually by CSM
      Export callrom() for CSM to use
      Export copy_smbios() from biostables.c
      Import LegacyBios.h from OVMF
      Complete and checksum EFI_COMPATIBILITY16_TABLE at build time
      Add pic_save_mask() and pic_restore_mask() functions
      Add CSM support
      Add README.CSM
      Add find_pmtimer() function
      Enable PMTIMER for CSM build
      Fix rom_reserve()/rom_confirm() for CSM oprom dispatch
      Don't calibrate TSC if PMTIMER is already set up
      Move find_pmtimer() to ACPI table setup where it logically belongs
      Use find_pmtimer() after copying Xen ACPI tables
      Use find_pmtimer() after copying coreboot ACPI tables
      Unify return path for CSM to go via csm_return()
      Make CONFIG_OPTIONROMS_DEPLOYED depend on CONFIG_QEMU
      Implement !CONFIG_OPTIONROMS support for CSM
      Implement !CONFIG_BOOT for CSM
      Enable VGA output when settings bochs-specific mode
      Disable CONFIG_THREAD_OPTIONROMS for CSM build
      Fix return type of le64_to_cpu() and be64_to_cpu()
      Rename find_pmtimer() to find_acpi_features()
      Add acpi_reboot() reset method using RESET_REG

Gerd Hoffmann (3):
      config: allow DEBUG_IO for !QEMU
      coreboot: add qemu detection
      tweak coreboot qemu detection

Hu Tao (1):
      Add pvpanic device driver

Kevin O'Connor (99):
      pmm: Use 'struct segoff_s' in pmm header.
      Minor: Update README - variable changes are now reset on soft-reboots.
      Normalize POST initialization function name suffixes.
      POST: Reorganize post init functions for better grouping and reusability.
      Fix rebase error in commit 8a0a972f that broke LOWMEM variables.
      Support calling a function other than maininit() from reloc_preinit().
      Ensure exported symbols are visible in the final link
      POST: Move QEMU specific ramsize and BIOS table setup to paravirt.c.
      POST: Reorganize post entry and "preinit" functions.
      POST: Move cpu caching and dma setup to platform_hardware_setup().
      Undo incorrect assumptions about Xen in commit 6ca0460f.
      Determine century during init and store in VARLOW mem during runtime.
      No need to check both CONFIG_THREADS and CONFIG_THREAD_OPTIONROMS.
      Add runningOnQEMU() and runningOnXen() for runtime platform detection.
      Consistently use CONFIG_COREBOOT, CONFIG_QEMU, and runningOnXen().
      Convert kvm_para_available() to runningOnKVM().
      Minor - move definitions to paravirt.c from paravirt.h.
      Only perform SMP setup on QEMU.
      Start device_hardware_setup in mainint even with CONFIG_THREAD_OPTIONROMS.
      The mathcp setup touches the PIC and thus move to the "setup" phase.
      Update tools/acpi_extract.py to handle iasl 20130117 release.
      Support skipping content when reading from QEMU fw_cfg romfile entries.
      Convert fw_cfg ACPI entries into romfile entries.
      Convert fw_cfg SMBIOS entries into romfile entries.
      Convert basic integer fw_cfg entries into romfile entries.
      Convert fw_cfg NUMA entries into a romfile entry.
      Process fw_cfg e820 entries during the fw_cfg setup stage.
      Integrate qemu_cfg_preinit() into qemu_romfile_init().
      Group QEMU platform setup together and move to paravirt.c.
      vgabios: Bochs/QEMU vgabios support should depend on CONFIG_QEMU.
      Warn on unaligned PCI ROM structure in option roms.
      Fix Makefile - don't reference "out/" directly, instead use "$(OUT)".
      build: Don't require $(OUT) to be a sub-directory of the main directory.
      Rename rom_get_top() to rom_get_max().
      Report on f-segment UMB ram also.
      Clarify build generated "zone low" values.
      Verify CC is valid during build tests.
      Disable handle_post() on CSM builds.
      Remove unnecessary "export" declarations from assembler functions.
      Minor assembler enhancements to __csm_return.
      Introduce VARFSEG for variables that will reside in the f-segment.
      Convert VAR16VISIBLE, VAR16EXPORT, and VAR32VISIBLE to VARFSEG.
      Don't relocate "varlow" variable references at runtime.
      Move malloc's ZoneFSeg and ZoneLow setup to malloc_init.
      Calculate "RamSize" needed by 16bit interface dynamically.
      Eliminate separate BiosTableSpace[] space for f-segment allocations.
      Use CONFIG_ prefix for Kconfig variables; use BUILD_ for others.
      Try to detect an unsuccessful hard-reboot to prevent soft-reboot loops.
      Minor - fix confusing final_sec32low_start name in layoutrom.py.
      Minor - introduce numeric defines for the IVT offset of hw irqs.
      Separate out 16bit PCI-BIOS entry point from regular int 0x1a entry point.
      Support using the "extra stack" for all 16bit irq entry points.
      Minor - improve comments and grouping of handle_08().
      floppy: Introduce 'struct floppy_pio_s' for floppy PIO ops.
      floppy: Cleanup floppy irq wait handling.
      floppy: Clean up Check Interrupt Status code.
      floppy: Move recalibration and results parsing to floppy_cmd().
      floppy: Improve floppy_pio() error checking.
      floppy: Implement media format sensing.
      floppy: Actually do controller reset in floppy_reset().
      Minor - note that passing QEMU config via cmos is deprecated.
      Cache boot-fail-wait to avoid romfile access after POST.
      Rename src/ssdt-susp.dsl to src/ssdt-misc.dsl.
      acpi: Eliminate BDAT parameter passing to DSDT code.
      Add additional dependency checks to Makefile.
      Don't use __FILE__ in virtio-ring.c.
      shadow: Don't use PCIDevices list in make_bios_readonly().
      smm: Don't use PCIDevices list in smm_setup().
      Add VARVERIFY32INIT attribute for variables only available during "init".
      Use VARVERIFY32INIT on global variables that point to "tmp" memory.
      vgabios: Fix stdvga_perform_gray_scale_summing().
      vgabios: Fix cirrus memory clear on mode switch.
      Minor - add missing newline to floppy debug statement.
      Fix bug in NUMA node setup - don't create SRAT if NUMA not present.
      Update README - copy *.aml files for QEMU.
      Add dependencies to vgafixup.py and buildversion.sh scripts.
      Set ZF prior to keyboard read call in check_for_keystroke().
      mptable: Don't describe pci-to-pci bridges.
      mptable: Use same PCI irqs as ACPI code.
      Cleanup QEMU_CFG_NUMA fw_cfg processing - split into two romfile entries.
      Use container_of on romfile entries.
      acpi: Move ACPI table definitions from acpi.c to acpi.h.
      acpi: Remove dead code with descriptions of bit flags.
      acpi: Use cpu_to_leXX() consistently.
      Minor - explicitly close files in buildrom.py.
      Minor - move "tracked memory alloc" code in pmm.c.
      Introduce and convert pmm code to use standard list helpers.
      Minor - relocate code in stacks.c to keep low-level thread code together.
      Introduce helper function have_threads() in stacks.c.
      Convert stacks.c to use standard list manipulation code.
      Convert boot.c to use standard list manipulation code.
      Convert pciinit.c to use standard list manipulation code.
      Convert PCIDevices list to use standard list manipultion code.
      Revert "Convert pciinit.c to use standard list manipulation code."
      Fix error in hlist_for_each_entry_safe macro.
      Convert pciinit.c to use standard list manipulation code.
      make qemu_cfg_init depend on QEMU_HARDWARE instead of QEMU
      Another fix for hlist_for_each_entry_safe.
      Minor - remove debugging dprintf added to pciinit.c.

Laszlo Ersek (1):
      Enable VGA output when setting Cirrus-specific mode

Michael S. Tsirkin (1):
      acpi: make default DSDT optional

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agopo/Makefile: Use macro quiet-command for nice looking messages
Stefan Weil [Fri, 5 Jul 2013 20:55:44 +0000 (22:55 +0200)]
po/Makefile: Use macro quiet-command for nice looking messages

Suppress also the "... done" message from msgmerge.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopo/Makefile: Fix generation of messages.po
Stefan Weil [Fri, 5 Jul 2013 20:55:43 +0000 (22:55 +0200)]
po/Makefile: Fix generation of messages.po

* Tell xgettext that we use UTF-8 encoding (this is currently optional).

* Set charset=UTF-8 in messages.po. This avoids warnings from msgmerge:
  warning: Charset "CHARSET" is not a portable encoding name.

* Use filename relative to root directory (ui/gtk.c instead of ../ui/gtk.c
  or $(SRC_PATH)/ui/gtk.c) for comments in *.po files.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopo/Makefile: Fix *.mo generation for out-of-tree builds (regression)
Stefan Weil [Fri, 5 Jul 2013 20:55:42 +0000 (22:55 +0200)]
po/Makefile: Fix *.mo generation for out-of-tree builds (regression)

Commit f84756554e32d97db3aa949db1dd58c7eea62375 added a wildcard search
for *.po files. This search found no files for out of tree builds, so
those builds no longer created and installed *.mo files.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopo/Makefile: Fix and improve help message
Stefan Weil [Fri, 5 Jul 2013 20:55:41 +0000 (22:55 +0200)]
po/Makefile: Fix and improve help message

The help message contains single quotes which got lost in the output.
Fix also a typo and use two instead of three lines.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'quintela/migration.next' into staging
Anthony Liguori [Tue, 23 Jul 2013 15:57:23 +0000 (10:57 -0500)]
Merge remote-tracking branch 'quintela/migration.next' into staging

# By Michael R. Hines (8) and others
# Via Juan Quintela
* quintela/migration.next:
  migration: add autoconvergence documentation
  Fix real mode guest segments dpl value in savevm
  Fix real mode guest migration
  rdma: account for the time spent in MIG_STATE_SETUP through QMP
  rdma: introduce MIG_STATE_NONE and change MIG_STATE_SETUP state transition
  rdma: allow state transitions between other states besides ACTIVE
  rdma: send pc.ram
  rdma: core logic
  rdma: introduce ram_handle_compressed()
  rdma: bugfix: ram_control_save_page()
  rdma: update documentation to reflect new unpin support

Message-id: 1374590725-14144-1-git-send-email-quintela@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging
Anthony Liguori [Tue, 23 Jul 2013 15:57:04 +0000 (10:57 -0500)]
Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging

QOM CPUState refactorings

* Fix NULL pointer dereference in gdbstub
* Introduce vaddr type
* Introduce CPUClass::set_pc()
* Introduce CPUClass::synchronize_from_tb()
* Introduce CPUClass::get_phys_page_debug()
* Introduce CPUClass::memory_rw_debug()
* Move singlestep_enabled and gdb_regs fields out of CPU_COMMON
* Adopt CPUState in more APIs
* Propagate CPUState in gdbstub

# gpg: Signature made Mon 22 Jul 2013 07:50:17 PM CDT using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found

# By Andreas Färber (21) and others
# Via Andreas Färber
* afaerber/tags/qom-cpu-for-anthony: (24 commits)
  linux-user: Use X86CPU property to retrieve CPUID family
  gdbstub: Change gdb_register_coprocessor() argument to CPUState
  cpu: Move gdb_regs field from CPU_COMMON to CPUState
  gdbstub: Change GDBState::{c,g}_cpu and find_cpu() to CPUState
  cpu: Introduce CPUClass::memory_rw_debug() for target_memory_rw_debug()
  exec: Change cpu_memory_rw_debug() argument to CPUState
  cpu: Turn cpu_get_phys_page_debug() into a CPUClass hook
  gdbstub: Change gdb_{read,write}_register() argument to CPUState
  gdbstub: Change gdb_handlesig() argument to CPUState
  gdbstub: Change syscall callback argument to CPUState
  kvm: Change kvm_{insert,remove}_breakpoint() argument to CPUState
  cpu: Change cpu_single_step() argument to CPUState
  gdbstub: Update gdb_handlesig() and gdb_signalled() Coding Style
  cpu: Move singlestep_enabled field from CPU_COMMON to CPUState
  target-alpha: Copy implver to DisasContext
  target-alpha: Copy singlestep_enabled to DisasContext
  cpu: Introduce CPUClass::synchronize_from_tb() for cpu_pc_from_tb()
  target-unicore32: Implement CPUClass::set_pc()
  target-moxie: Implement CPUClass::set_pc()
  target-m68k: Implement CPUClass::set_pc()
  ...

11 years agoMerge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into staging
Anthony Liguori [Tue, 23 Jul 2013 15:56:55 +0000 (10:56 -0500)]
Merge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into staging

QOM device refactorings

* Avoid TYPE_* in VMStateDescription name
* Replace some DO_UPCAST()s and FROM_SYSBUS()s with QOM casts
* Limit legacy SCSI command line handling to non-hotplugged devices
* Replace some SysBusDeviceClass::init with DeviceClass::realize

# gpg: Signature made Mon 22 Jul 2013 06:31:42 PM CDT using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found

# By Hu Tao (26) and others
# Via Andreas Färber
* afaerber/tags/qom-devices-for-anthony: (55 commits)
  isa-bus: Drop isabus_bridge_init() since it does nothing
  ioapic: Use QOM realize for ioapic
  kvmvapic: Use QOM realize
  kvm/clock: Use QOM realize for kvmclock
  hpet: Use QOM realize for hpet
  scsi: Improve error propagation for scsi_bus_legacy_handle_cmdline()
  megasas: Legacy command line handling fix
  scsi/esp: Use QOM realize for scsi esp
  fw_cfg: Use QOM realize for fw_cfg
  ahci: Use QOM realize for ahci
  pflash_cfi02: Use QOM realize for pflash_cfi02
  pflash_cfi01: Use QOM realize for pflash_cfi01
  fdc: Improve error propagation for QOM realize
  fdc: Use QOM realize for fdc
  kvm/clock: QOM'ify some more
  hpet: QOM'ify some more
  scsi/esp: QOM'ify some more
  fwcfg: QOM'ify some more
  ahci: QOM'ify some more
  pflash-cfi02: QOM'ify some more
  ...

11 years agolinux-user: Handle compressed ISA encodings when processing MIPS exceptions
Kwok Cheung Yeung [Fri, 19 Jul 2013 16:21:44 +0000 (09:21 -0700)]
linux-user: Handle compressed ISA encodings when processing MIPS exceptions

Decode trap instructions during the handling of an EXCP_BREAK or EXCP_TRAP
according to the current ISA mode.

Signed-off-by: Kwok Cheung Yeung <kcy@codesourcery.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>