]> git.proxmox.com Git - qemu.git/log
qemu.git
10 years agoMerge remote-tracking branch 'kraxel/audio.1' into staging
Anthony Liguori [Mon, 30 Sep 2013 22:13:32 +0000 (17:13 -0500)]
Merge remote-tracking branch 'kraxel/audio.1' into staging

# By Bandan Das (3) and Gerd Hoffmann (1)
# Via Gerd Hoffmann
* kraxel/audio.1:
  audio: remove CONFIG_MIXEMU configure option
  hda-codec: make mixemu selectable at runtime
  hda-codec: refactor common definitions into a header file
  audio maintainers update

Message-id: 1380011943-15083-1-git-send-email-kraxel@redhat.com

10 years agoMerge remote-tracking branch 'borntraeger/tags/s390-next-20130924' into staging
Anthony Liguori [Mon, 30 Sep 2013 22:13:18 +0000 (17:13 -0500)]
Merge remote-tracking branch 'borntraeger/tags/s390-next-20130924' into staging

This is a bunch of fixes/changes for the s390 architecture. It also
contains the fixes from the previous pull request, which did not make
it yet.
Overall it contains
- a fix for kexec without kdump (which uses diag308 subcode 0 instead of 1)
- several sclp related fixes
- some initial sclp migration code
- the sclp line mode console
- A fix for a boot problem with the virtio ccw ipl bios
- zeroed out padding bytes for the notes section of dump-guest-memory
- some cleanups

# gpg: Signature made Tue 24 Sep 2013 02:18:44 AM CDT using RSA key ID B5A61C7C
# gpg: Can't check signature: public key not found

# By Christian Borntraeger (6) and others
# Via Christian Borntraeger
* borntraeger/tags/s390-next-20130924:
  s390/sclplmconsole: Add support for SCLP line-mode console
  s390/ebcdic: Move conversion tables to header file
  s390/eventfacility: allow childs to handle more than 1 event type
  s390/eventfacility: remove unused event_type variable
  s390/eventfacility: Fix receive/send masks
  s390/eventfacility: fix multiple Read Event Data sources
  s390/sclp: add reset() functions
  s390/sclpquiesce: Add code to support live migration
  s390/sclpconsole: Add code to support live migration for sclpconsole
  s390/sclpconsole: modify definition of input buffer
  s390/kexec: Implement diag308 subcode 0
  s390/ioinst: Moved the CC setting to the IO instruction handlers
  s390/cpu: Make setcc() function available to other files
  s390/ipl: Update the s390-ccw.img rom
  s390/ipl: Fix waiting for virtio processing
  s390/dump: zero out padding bytes in notes sections
  s390/kvm: Add check for priviledged SCLP handler

Message-id: 1380007671-18976-1-git-send-email-borntraeger@de.ibm.com

10 years agoaudio: remove CONFIG_MIXEMU configure option
Bandan Das [Sat, 7 Sep 2013 04:54:00 +0000 (00:54 -0400)]
audio: remove CONFIG_MIXEMU configure option

Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agohda-codec: make mixemu selectable at runtime
Bandan Das [Sat, 7 Sep 2013 04:53:59 +0000 (00:53 -0400)]
hda-codec: make mixemu selectable at runtime

Define PARAM so that we have two versions of the "desc_codec
and family" structs. Add a property called "mixer" whose default
value depends on whether CONFIG_MIXEMU is defined or not which
will help us call the appropriate instance init functions.

Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agohda-codec: refactor common definitions into a header file
Bandan Das [Sat, 7 Sep 2013 04:53:58 +0000 (00:53 -0400)]
hda-codec: refactor common definitions into a header file

Move common defines and structs to a header file.
The next commit will include it twice, once for a device with a
mixer, and once for device without a mixer.

Signed-off-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoaudio maintainers update
Gerd Hoffmann [Tue, 24 Sep 2013 08:26:24 +0000 (10:26 +0200)]
audio maintainers update

av1474@comtv.ru bounces, and I havn't seen malc @ qemu-devel for quite a
while (anyone knows what is up?).  Adding myself as audio maintainer, so
audio patches don't fall through the cracks that easily.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agolinux-user: Handle SOCK_CLOEXEC/NONBLOCK if unavailable on host
Edgar E. Iglesias [Mon, 23 Sep 2013 12:11:53 +0000 (14:11 +0200)]
linux-user: Handle SOCK_CLOEXEC/NONBLOCK if unavailable on host

If the host lacks SOCK_CLOEXEC, bail out with -EINVAL.
If the host lacks SOCK_ONONBLOCK, try to emulate it with fcntl()
and O_NONBLOCK.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years ago[v2] linux-user: implement m68k atomic syscalls
Riku Voipio [Wed, 24 Jul 2013 06:44:26 +0000 (09:44 +0300)]
[v2] linux-user: implement m68k atomic syscalls

With nptl enabled, atomic_cmpxchg_32 and atomic_barrier
system calls are needed. This patch enabled really dummy
versions of the system calls, modeled after the m68k
kernel code.

With this patch I am able to execute m68k binaries
with qemu linux-user (busybox compiled for coldfire).

[v2] que an segfault instead of returning a EFAULT
to keep in line with kernel code.

Cc: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: Check type of microMIPS break instruction
Kwok Cheung Yeung [Tue, 10 Sep 2013 00:36:40 +0000 (17:36 -0700)]
linux-user: Check type of microMIPS break instruction

microMIPS instructions that cause breakpoint exceptions come in
16-bit and 32-bit variants.  When handling exceptions caused by
such instructions, the instruction type needs to be taken into
account when extracting the break code.

The code has also been restructured for better clarity.

Signed-off-by: Kwok Cheung Yeung <kcy@codesourcery.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: correct how SOL_SOCKET is converted from target to host and back
Petar Jovanovic [Fri, 13 Sep 2013 17:27:29 +0000 (19:27 +0200)]
linux-user: correct how SOL_SOCKET is converted from target to host and back

Previous implementation does not take into account that SOL_SOCKET constant
can be arch specific. This change fixes some issues with sendmsg/recvmsg.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: add support of binfmt_misc 'O' flag
Laurent Vivier [Thu, 29 Aug 2013 23:46:44 +0000 (01:46 +0200)]
linux-user: add support of binfmt_misc 'O' flag

The binfmt_misc module can calculate the credentials and security
token according to the binary instead of to the interpreter if the
'C' flag is enabled.

To be able to execute non-readable binaries, this flag implies 'O'
flag. When 'O' flag is enabled, bintfmt_misc opens the file for
reading and pass the file descriptor to the interpreter.

References:
linux/Documentation/binfmt_misc.txt          ['O' and 'C' description]
linux/fs/binfmt_misc.c linux/fs/binfmt_elf.c [ AT_EXECFD usage ]

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: add some IPV6 commands in setsockop()
Laurent Vivier [Thu, 29 Aug 2013 23:46:43 +0000 (01:46 +0200)]
linux-user: add some IPV6 commands in setsockop()

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: allow use of TIOCGSID
Laurent Vivier [Thu, 29 Aug 2013 23:46:42 +0000 (01:46 +0200)]
linux-user: allow use of TIOCGSID

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: Add setsockopt(SO_ATTACH_FILTER)
Laurent Vivier [Thu, 29 Aug 2013 23:46:41 +0000 (01:46 +0200)]
linux-user: Add setsockopt(SO_ATTACH_FILTER)

This is needed to be able to run dhclient.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: convert /proc/net/route when endianess differs
Laurent Vivier [Thu, 29 Aug 2013 23:46:40 +0000 (01:46 +0200)]
linux-user: convert /proc/net/route when endianess differs

This patch allows to have IP addresses in correct order
in the case of "netstat -nr" when the endianess of the
guest differs from one of the host.

For instance, an m68k guest on an x86_64 host:

WITHOUT this patch:

$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         1.3.0.10        0.0.0.0         UG        0 0          0 eth0
0.3.0.10        0.0.0.0         0.255.255.255   U         0 0          0 eth0
$ cat /proc/net/route
Iface Destination Gateway  Flags RefCnt Use Metric Mask MTU Window IRTT

eth0 00000000 0103000A 0003 0 0 0 000000000 0 0
eth0 0003000A 00000000 0001 0 0 0 00FFFFFF0 0 0

WITH this patch:

$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.0.3.1        0.0.0.0         UG        0 0          0 eth0
10.0.3.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0
$ cat /proc/net/route
Iface Destination Gateway  Flags RefCnt Use Metric Mask MTU Window IRTT
eth0 00000000 0a000301 0003 0 0 0 000000000 0 0
eth0 0a000300 00000000 0001 0 0 0 ffffff000 0 0

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agomips-linux-user: Adjust names in mips_syscall_args
Richard Henderson [Wed, 24 Jul 2013 19:50:01 +0000 (09:50 -1000)]
mips-linux-user: Adjust names in mips_syscall_args

The name field of MIPS_SYS isn't actually used; it's just documentation.
But adjust the umount entries to match mips/syscall_nr.h anyway.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agoalpha-linux-user: Fix umount syscall numbers
Richard Henderson [Wed, 24 Jul 2013 19:50:00 +0000 (09:50 -1000)]
alpha-linux-user: Fix umount syscall numbers

It has been pointed out on LKML that the alpha umount syscall numbers
are named wrong, and a patch to rectify that has been posted for 3.11.

Glibc works around this by treating NR_umount as NR_umount2 if
NR_oldumount exists.  That's more complicated than we need in QEMU,
given that we control linux-user/*/syscall_nr.h.

This is the last instance of TARGET_NR_oldumount, so delete that from
the strace.list.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agoMerge remote-tracking branch 'stefanha/tracing' into staging
Anthony Liguori [Mon, 23 Sep 2013 16:53:22 +0000 (11:53 -0500)]
Merge remote-tracking branch 'stefanha/tracing' into staging

# By Alexey Kardashevskiy
# Via Stefan Hajnoczi
* stefanha/tracing:
  kvm: fix traces to use %x instead of %d

Message-id: 1379699931-5837-1-git-send-email-stefanha@redhat.com

10 years agoMerge remote-tracking branch 'stefanha/net' into staging
Anthony Liguori [Mon, 23 Sep 2013 16:53:11 +0000 (11:53 -0500)]
Merge remote-tracking branch 'stefanha/net' into staging

# By Aurelien Jarno (1) and Vincenzo Maffione (1)
# Via Stefan Hajnoczi
* stefanha/net:
  e1000: NetClientInfo.receive_iov implemented
  pcnet-pci: mark I/O and MMIO as LITTLE_ENDIAN

Message-id: 1379699613-5338-1-git-send-email-stefanha@redhat.com

10 years agoMerge remote-tracking branch 'stefanha/block' into staging
Anthony Liguori [Mon, 23 Sep 2013 16:53:05 +0000 (11:53 -0500)]
Merge remote-tracking branch 'stefanha/block' into staging

# By Stefan Hajnoczi (4) and others
# Via Stefan Hajnoczi
* stefanha/block:
  virtio-blk: do not relay a previous driver's WCE configuration to the current
  blockdev: do not default cache.no-flush to true
  block: don't lose data from last incomplete sector
  qcow2: Correct snapshots size for overlap check
  coroutine: fix /perf/nesting coroutine benchmark
  coroutine: add qemu_coroutine_yield benchmark
  qemu-timer: do not take the lock in timer_pending
  qemu-timer: make qemu_timer_mod_ns() and qemu_timer_del() thread-safe
  qemu-timer: drop outdated signal safety comments
  osdep: warn if open(O_DIRECT) on fails with EINVAL
  libcacard: link against qemu-error.o for error_report()

Message-id: 1379698931-946-1-git-send-email-stefanha@redhat.com

10 years agoMerge remote-tracking branch 'mjt/trivial-patches' into staging
Anthony Liguori [Mon, 23 Sep 2013 16:52:55 +0000 (11:52 -0500)]
Merge remote-tracking branch 'mjt/trivial-patches' into staging

# By Stefan Weil (8) and others
# Via Michael Tokarev
* mjt/trivial-patches:
  tests/.gitignore: ignore test-throttle
  exec: Fix broken build for MinGW (regression)
  kvm: Fix compiler warning (clang)
  tcg-sparc: Fix parenthesis warning
  Makefile: Remove some more files when cleaning
  target-i386: Fix segment cache dump
  iov: avoid "orig_len may be used unitialized" warning
  vscclient: remove unnecessary use of uninitialized variable
  trace-events: Clean up with scripts/cleanup-trace-events.pl again
  tci: Fix qemu-alpha on 32 bit hosts (wrong assertions)
  *-user: Improve documentation for lock_user function
  MAINTAINERS: Add missing entry to filelist for TCI target
  translate-all: Fix formatting of dump output
  *-user: Fix typo in comment (ulocking -> unlocking)
  docs: Fix IO port number for CPU present bitmap.
  q35: Fix typo in constant DEFUALT -> DEFAULT.
  configure: Undefine _FORTIFY_SOURCE prior using it

Message-id: 1379696296-32105-1-git-send-email-mjt@msgid.tls.msk.ru

10 years agoMerge remote-tracking branch 'qemu-kvm/uq/master' into staging
Anthony Liguori [Mon, 23 Sep 2013 16:52:49 +0000 (11:52 -0500)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

# By Alexey Kardashevskiy (3) and others
# Via Paolo Bonzini
* qemu-kvm/uq/master:
  target-i386: add feature kvm_pv_unhalt
  linux-headers: update to 3.12-rc1
  target-i386: forward CPUID cache leaves when -cpu host is used
  linux-headers: update to 3.11
  kvm: fix traces to use %x instead of %d
  kvmvapic: Clear also physical ROM address when entering INACTIVE state
  kvmvapic: Enter inactive state on hardware reset
  kvmvapic: Catch invalid ROM size
  kvm irqfd: support direct msimessage to irq translation
  fix steal time MSR vmsd callback to proper opaque type
  kvm: warn if num cpus is greater than num recommended
  cpu: Move cpu state syncs up into cpu_dump_state()
  exec: always use MADV_DONTFORK

Message-id: 1379694292-1601-1-git-send-email-pbonzini@redhat.com

10 years agoMerge remote-tracking branch 'bonzini/scsi-next' into staging
Anthony Liguori [Mon, 23 Sep 2013 16:52:32 +0000 (11:52 -0500)]
Merge remote-tracking branch 'bonzini/scsi-next' into staging

# By Hervé Poussineau (5) and Stefan Weil (1)
# Via Paolo Bonzini
* bonzini/scsi-next:
  block/iscsi: Drop iscsi_co_get_block_status for older versions of libiscsi
  lsi: add 53C810 variant
  lsi: remove todo
  lsi: ignore write accesses to CTEST0 registers
  lsi: check ssid versus sdid only if ssid is valid
  lsi: use constant name instead of its value

10 years agokvm: fix traces to use %x instead of %d
Alexey Kardashevskiy [Wed, 4 Sep 2013 10:26:25 +0000 (20:26 +1000)]
kvm: fix traces to use %x instead of %d

KVM request types are normally defined using hex constants but QEMU traces
print decimal values instead, which is not very convenient.

This changes the request type format from %d to %x.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoe1000: NetClientInfo.receive_iov implemented
Vincenzo Maffione [Thu, 12 Sep 2013 08:47:37 +0000 (10:47 +0200)]
e1000: NetClientInfo.receive_iov implemented

This patch implements the NetClientInfo.receive_iov method for the
e1000 device emulation. In this way a network backend that uses
qemu_sendv_packet() can deliver the fragmented packet without
requiring an additional copy in the frontend/backend network code
(nc_sendv_compat() function).

The existing method NetClientInfo.receive has been reimplemented
using the new method.

Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agopcnet-pci: mark I/O and MMIO as LITTLE_ENDIAN
Aurelien Jarno [Wed, 28 Aug 2013 12:17:39 +0000 (14:17 +0200)]
pcnet-pci: mark I/O and MMIO as LITTLE_ENDIAN

Now that the memory subsystem is propagating the endianness correctly,
the pcnet-pci device should have its I/O ports and MMIO memory marked
as LITTLE_ENDIAN, as PCI devices are little endian.

This makes the pcnet-pci NIC to work again on big endian MIPS Malta
(default NIC).

Cc: qemu-stable@nongnu.org
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agovirtio-blk: do not relay a previous driver's WCE configuration to the current
Paolo Bonzini [Fri, 20 Sep 2013 15:31:55 +0000 (17:31 +0200)]
virtio-blk: do not relay a previous driver's WCE configuration to the current

The following sequence happens:
- the SeaBIOS virtio-blk driver does not support the WCE feature, which
causes QEMU to disable writeback caching

- the Linux virtio-blk driver resets the device, finds WCE is available
but writeback caching is disabled; tells block layer to not send cache
flush commands

- the Linux virtio-blk driver sets the DRIVER_OK bit, which causes
writeback caching to be re-enabled, but the Linux virtio-blk driver does
not know of this side effect and cache flushes remain disabled

The bug is at the third step.  If the guest does know about CONFIG_WCE,
QEMU should ignore the WCE feature's state.  The guest will control the
cache mode solely using configuration space.  This change makes Linux
do flushes correctly, but Linux will keep SeaBIOS's writethrough mode.

Hence, whenever the guest is reset, the cache mode of the disk should
be reset to whatever was specified in the "-drive" option.  With this
change, the Linux virtio-blk driver finds that writeback caching is
enabled, and tells the block layer to send cache flush commands
appropriately.

Reported-by: Rusty Russell <rusty@au1.ibm.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblockdev: do not default cache.no-flush to true
Paolo Bonzini [Thu, 19 Sep 2013 16:48:53 +0000 (18:48 +0200)]
blockdev: do not default cache.no-flush to true

That's why all my VMs were so fast lately. :)

This changed in 1.6.0 by mistake in patch 29c4e2b (blockdev: Split up
'cache' option, 2013-07-18).

Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: don't lose data from last incomplete sector
Fam Zheng [Wed, 18 Sep 2013 11:14:14 +0000 (19:14 +0800)]
block: don't lose data from last incomplete sector

To read the last sector that is not aligned to sector boundary, current
code for growable backends, since commit 893a8f6 "block: Produce zeros
when protocols reading beyond end of file", drops the data and directly
returns zeroes. That is incorrect.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agotests/.gitignore: ignore test-throttle
Fam Zheng [Mon, 16 Sep 2013 07:20:40 +0000 (15:20 +0800)]
tests/.gitignore: ignore test-throttle

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoexec: Fix broken build for MinGW (regression)
Stefan Weil [Wed, 18 Sep 2013 05:48:15 +0000 (07:48 +0200)]
exec: Fix broken build for MinGW (regression)

Commit 3435f39513a104294b5e3bbf3612047028d25cfc reduced the ifdeffery with
this result for MinGW:

exec.c: In function ‘qemu_ram_free’:
exec.c:1239:17: warning:
 implicit declaration of function ‘munmap’ [-Wimplicit-function-declaration]
exec.c:1239:17: warning:
 nested extern declaration of ‘munmap’ [-Wnested-externs]
exec.c:1239: undefined reference to `munmap'

Add some ifdeffery again to fix this.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agokvm: Fix compiler warning (clang)
Stefan Weil [Tue, 17 Sep 2013 20:39:55 +0000 (22:39 +0200)]
kvm: Fix compiler warning (clang)

Report from clang analyzer:

clock.c:42:15: warning:
Value stored to 'cpu' during its initialization is never read

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agotcg-sparc: Fix parenthesis warning
Richard Henderson [Fri, 6 Sep 2013 20:24:11 +0000 (13:24 -0700)]
tcg-sparc: Fix parenthesis warning

error: suggest parentheses around comparison in operand of ‘&’ [-Werror=parentheses]

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoMakefile: Remove some more files when cleaning
Stefan Weil [Thu, 25 Jul 2013 16:24:58 +0000 (18:24 +0200)]
Makefile: Remove some more files when cleaning

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agotarget-i386: Fix segment cache dump
Tobias Markus [Sun, 25 Aug 2013 10:20:06 +0000 (12:20 +0200)]
target-i386: Fix segment cache dump

When in Long Mode, cpu_x86_seg_cache() logs "DS16" because the Default
operation size bit (D/B bit) is not set for Long Mode Data Segments since
there are only Data Segments in Long Mode and no explicit 16/32/64-bit
Descriptors.
This patch fixes this by checking the Long Mode Active bit of the hidden
flags variable and logging "DS" if it is set. (I.e. in Long Mode all Data
Segments are logged as "DS")

Signed-off-by: Tobias Markus <tobias@markus-regensburg.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoiov: avoid "orig_len may be used unitialized" warning
Michael Tokarev [Sat, 14 Sep 2013 09:11:36 +0000 (13:11 +0400)]
iov: avoid "orig_len may be used unitialized" warning

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agovscclient: remove unnecessary use of uninitialized variable
Michael Tokarev [Sat, 14 Sep 2013 09:10:16 +0000 (13:10 +0400)]
vscclient: remove unnecessary use of uninitialized variable

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agotrace-events: Clean up with scripts/cleanup-trace-events.pl again
Markus Armbruster [Fri, 13 Sep 2013 08:49:51 +0000 (10:49 +0200)]
trace-events: Clean up with scripts/cleanup-trace-events.pl again

Event qxl_render_blit_guest_primary_initialized is unused since commit
c58c7b9, drop it.

Commit 42e5b4c moved hw/ppc/xics.c to hw/intc/xics.c without updating
the comment in trace-events.

"scripts/cleanup-trace-events.pl trace-events | diff trace-events" is
now clean again.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agotci: Fix qemu-alpha on 32 bit hosts (wrong assertions)
Stefan Weil [Thu, 12 Sep 2013 18:17:50 +0000 (20:17 +0200)]
tci: Fix qemu-alpha on 32 bit hosts (wrong assertions)

Debian busybox-static for alpha has a load address of 0x0000000120000000
which is mapped to 0x0000000020000000 for 32 bit hosts.

qemu-alpha uses the TCG opcodes qemu_ld32, qemu_ld64, qemu_st32 and
qemu_st64 which all raise the assertion (taddr == host_addr).

Remove all assertions of this type because they are either wrong or
unnecessary (when sizeof(tcg_target_ulong) >= sizeof(target_ulong)).

Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years ago*-user: Improve documentation for lock_user function
Stefan Weil [Thu, 12 Sep 2013 17:57:15 +0000 (19:57 +0200)]
*-user: Improve documentation for lock_user function

Add a missing "function" and replace "and" by "any".
BSD and Linux use the same documentation here, so fix both.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoMAINTAINERS: Add missing entry to filelist for TCI target
Stefan Weil [Thu, 12 Sep 2013 18:24:31 +0000 (20:24 +0200)]
MAINTAINERS: Add missing entry to filelist for TCI target

tci.c is also a maintained part of the TCI implementation.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agotranslate-all: Fix formatting of dump output
Stefan Weil [Thu, 12 Sep 2013 18:09:06 +0000 (20:09 +0200)]
translate-all: Fix formatting of dump output

The page dump writes a table with 3 abi_ulong values in each row.
These values take 8 or 16 characters (depending on sizeof abi_ulong).

Fix the table headings to be aligned with the table columns.

old:
start    end      size     prot
0000000120000000-000000012021e000 000000000021e000 rwx
0000004000000000-0000004000002000 0000000000002000 ---
0000004000002000-0000004000802000 0000000000800000 rw-

new:
start            end              size             prot
0000000120000000-000000012021e000 000000000021e000 rwx
0000004000000000-0000004000002000 0000000000002000 ---
0000004000002000-0000004000802000 0000000000800000 rw-

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years ago*-user: Fix typo in comment (ulocking -> unlocking)
Stefan Weil [Thu, 12 Sep 2013 17:57:41 +0000 (19:57 +0200)]
*-user: Fix typo in comment (ulocking -> unlocking)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agodocs: Fix IO port number for CPU present bitmap.
Anthony PERARD [Tue, 10 Sep 2013 16:36:18 +0000 (17:36 +0100)]
docs: Fix IO port number for CPU present bitmap.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewd-By: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoq35: Fix typo in constant DEFUALT -> DEFAULT.
Richard W.M. Jones [Mon, 2 Sep 2013 13:43:36 +0000 (14:43 +0100)]
q35: Fix typo in constant DEFUALT -> DEFAULT.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoconfigure: Undefine _FORTIFY_SOURCE prior using it
Michal Privoznik [Thu, 5 Sep 2013 10:54:49 +0000 (12:54 +0200)]
configure: Undefine _FORTIFY_SOURCE prior using it

Currently, we are enforcing the _FORTIFY_SOURCE=2 without any
previous detection if the macro has been already defined, e.g.
by environment, or is just enabled by compiler by default.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoMerge remote-tracking branch 'spice/spice.v74' into staging
Anthony Liguori [Fri, 20 Sep 2013 13:08:18 +0000 (08:08 -0500)]
Merge remote-tracking branch 'spice/spice.v74' into staging

# By Gerd Hoffmann
# Via Gerd Hoffmann
* spice/spice.v74:
  qxl: compile only once
  qxl: simplify page dirtying
  qxl: simplify qxl_rom_size
  qxl: define qxl operating on 4k pages

Message-id: 1379583534-7831-1-git-send-email-kraxel@redhat.com

10 years agoMerge remote-tracking branch 'kraxel/usb.90' into staging
Anthony Liguori [Fri, 20 Sep 2013 13:08:08 +0000 (08:08 -0500)]
Merge remote-tracking branch 'kraxel/usb.90' into staging

# By Hans de Goede (6) and Gerd Hoffmann (1)
# Via Gerd Hoffmann
* kraxel/usb.90:
  usb: Fix iovec memleak on combined-packet free
  usb: Also reset max_packet_size on ep_reset
  xhci: Fix memory leak on xhci_disable_ep
  xhci: Add xhci_epid_to_usbep helper function
  xhci: Init a transfers xhci, slotid and epid member on epctx alloc
  xhci: Fix number of streams allocated when using streams
  usb: remove old usb-host code

Message-id: 1379583298-7524-1-git-send-email-kraxel@redhat.com

10 years agoMerge remote-tracking branch 'luiz/queue/qmp' into staging
Anthony Liguori [Fri, 20 Sep 2013 13:06:38 +0000 (08:06 -0500)]
Merge remote-tracking branch 'luiz/queue/qmp' into staging

# By Luiz Capitulino
# Via Luiz Capitulino
* luiz/queue/qmp:
  QMP: qmp-events.txt: alphabetical order fix and other minor changes
  QMP: Update qmp-spec.txt
  QMP: Update README file
  QMP: QMP/ -> docs/qmp/
  QMP: fix qmp-commands.txt generation path
  QMP: add scripts/qmp

Message-id: 1379509422-29115-1-git-send-email-lcapitulino@redhat.com

10 years agos390/sclplmconsole: Add support for SCLP line-mode console
Heinz Graalfs [Wed, 22 May 2013 12:11:36 +0000 (14:11 +0200)]
s390/sclplmconsole: Add support for SCLP line-mode console

Add simple support for SCLP line-mode also known as operating
system messages. This can be added in addition to or instead of
the SCLP full screen console with -device sclplmconsole.

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/ebcdic: Move conversion tables to header file
Heinz Graalfs [Tue, 21 May 2013 15:04:58 +0000 (17:04 +0200)]
s390/ebcdic: Move conversion tables to header file

Move conversion tables to header file.
   - In SCLP line mode processing EBCDIC/ASCII conversion is needed.
   - An additional EBCDIC to ASCII conversion function is added.

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/eventfacility: allow childs to handle more than 1 event type
Christian Borntraeger [Tue, 17 Sep 2013 11:07:30 +0000 (13:07 +0200)]
s390/eventfacility: allow childs to handle more than 1 event type

Currently all handlers (quiesce, console) only handle one event type.
Some drivers will handle multiple (compatible) event types. Rework the
code accordingly.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
10 years agos390/eventfacility: remove unused event_type variable
Christian Borntraeger [Tue, 17 Sep 2013 11:01:31 +0000 (13:01 +0200)]
s390/eventfacility: remove unused event_type variable

The event_type variable is never used. Get rid of it.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
10 years agos390/eventfacility: Fix receive/send masks
Christian Borntraeger [Tue, 17 Sep 2013 08:32:54 +0000 (10:32 +0200)]
s390/eventfacility: Fix receive/send masks

Currently we announce interchanged receive/send masks. This did not
trigger a bug, since the sclp console has the same masks for
send/receive and the Linux guest does not check the sclp mask for simple
events like quiesce. With other event users like the sclp line mode
console, we will have different send/receive bits. Fix it.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
10 years agos390/eventfacility: fix multiple Read Event Data sources
Ralf Hoppe [Mon, 19 Aug 2013 07:41:24 +0000 (09:41 +0200)]
s390/eventfacility: fix multiple Read Event Data sources

Make the handler for SCLP Read Event Data deal with notifications
for multiple sources correctly.

Signed-off-by: Ralf Hoppe <rhoppe@de.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
[split bigger patch into smaller independent chunks]
Reviewed-by: Alexander Graf <agraf@suse.de>
10 years agos390/sclp: add reset() functions
Heinz Graalfs [Wed, 4 Sep 2013 10:55:45 +0000 (12:55 +0200)]
s390/sclp: add reset() functions

Add reset() functions for event-facility, sclpconsole, and sclpquiesce.
The reset() functions perform variable initialization
at IPL and e.g. when monitor system_reset is called.

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/sclpquiesce: Add code to support live migration
Heinz Graalfs [Tue, 11 Sep 2012 11:41:26 +0000 (13:41 +0200)]
s390/sclpquiesce: Add code to support live migration

This patch adds the necessary life migration pieces to sclpquiesce
by using the vmstate_register.

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/sclpconsole: Add code to support live migration for sclpconsole
Heinz Graalfs [Tue, 11 Sep 2012 11:41:26 +0000 (13:41 +0200)]
s390/sclpconsole: Add code to support live migration for sclpconsole

This patch adds the necessary life migration pieces to the sclp code
by using vmstate_register.

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/sclpconsole: modify definition of input buffer
Heinz Graalfs [Wed, 28 Aug 2013 14:30:28 +0000 (16:30 +0200)]
s390/sclpconsole: modify definition of input buffer

To use VMState for migration, we need to adapt some sclp code:
   - allocate console buffer as part of the console
   - change semantic of sclpconsole offset fields

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/kexec: Implement diag308 subcode 0
Christian Borntraeger [Thu, 19 Sep 2013 07:32:03 +0000 (09:32 +0200)]
s390/kexec: Implement diag308 subcode 0

This patch implements subcode 0 of diag 308. This is necessary for kexec
(without kdump). The main difference to subcode 1 is that all CPUs get
a full reset, instead of the architectured CPU reset (which leaves all
registers untouched).

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agoqcow2: Correct snapshots size for overlap check
Max Reitz [Thu, 19 Sep 2013 10:29:15 +0000 (12:29 +0200)]
qcow2: Correct snapshots size for overlap check

Using s->snapshots_size instead of snapshots_size for the metadata
overlap check in qcow2_write_snapshots leads to the detection of an
overlap with the main qcow2 image header when deleting the last
snapshot, since s->snapshots_size has not yet been updated and is
therefore non-zero. However, the offset returned by qcow2_alloc_clusters
will be zero since snapshots_size is zero. Therefore, an overlap is
detected albeit no such will occur.

This patch fixes this by replacing s->snapshots_size by snapshots_size
when calling qcow2_pre_write_overlap_check.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agos390/ioinst: Moved the CC setting to the IO instruction handlers
Thomas Huth [Mon, 1 Jul 2013 13:44:18 +0000 (15:44 +0200)]
s390/ioinst: Moved the CC setting to the IO instruction handlers

The IO instruction handlers now take care of setting the CC value on
their own, so that the confusing return code magic in kvm_handle_css_inst()
is not needed anymore.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/cpu: Make setcc() function available to other files
Thomas Huth [Tue, 2 Jul 2013 11:43:38 +0000 (13:43 +0200)]
s390/cpu: Make setcc() function available to other files

Moved the setcc() function to cpu.h so that it can be used by other
files, too. It now also does not modify the kvm state anymore since
this gets updated during kvm_arch_put_registers() anyway.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/ipl: Update the s390-ccw.img rom
Christian Borntraeger [Mon, 2 Sep 2013 09:05:43 +0000 (11:05 +0200)]
s390/ipl: Update the s390-ccw.img rom

Rebuild of the virtio-ccw rom containing these patches:
1. s390/ipl: Fix waiting for virtio processing

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/ipl: Fix waiting for virtio processing
Cornelia Huck [Thu, 29 Aug 2013 15:52:43 +0000 (17:52 +0200)]
s390/ipl: Fix waiting for virtio processing

The guest side must not manipulate the index for the used buffers. Instead,
remember the state of the used buffer locally and wait until it has moved.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/dump: zero out padding bytes in notes sections
Christian Borntraeger [Thu, 29 Aug 2013 10:40:25 +0000 (12:40 +0200)]
s390/dump: zero out padding bytes in notes sections

The prstatus of an s390x dump contains several padding areas. Zero out
these bytes to make reading the notes section easier with a hexdump.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agos390/kvm: Add check for priviledged SCLP handler
Thomas Huth [Mon, 29 Jul 2013 13:49:16 +0000 (15:49 +0200)]
s390/kvm: Add check for priviledged SCLP handler

The SCLP instruction is priviledged, so we should make sure that
we generate an exception when it is called from the problem state.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
10 years agotarget-i386: add feature kvm_pv_unhalt
Andrew Jones [Wed, 18 Sep 2013 14:41:45 +0000 (16:41 +0200)]
target-i386: add feature kvm_pv_unhalt

I don't know yet if want this feature on by default, so for now I'm
just adding support for "-cpu ...,+kvm_pv_unhalt".

Signed-off-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agolinux-headers: update to 3.12-rc1
Andrew Jones [Wed, 18 Sep 2013 14:41:44 +0000 (16:41 +0200)]
linux-headers: update to 3.12-rc1

Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agotarget-i386: forward CPUID cache leaves when -cpu host is used
Benoît Canet [Mon, 2 Sep 2013 15:06:37 +0000 (17:06 +0200)]
target-i386: forward CPUID cache leaves when -cpu host is used

Some users running cpu intensive tasks checking the cache CPUID leaves at
startup and making decisions based on the result reported that the guest was
not reflecting the host CPUID leaves when -cpu host is used.

This patch fix this.

Signed-off-by: Benoît Canet <benoit@irqsave.net>
[Rename new field to cache_info_passthrough - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agolinux-headers: update to 3.11
Alexey Kardashevskiy [Tue, 3 Sep 2013 08:27:37 +0000 (18:27 +1000)]
linux-headers: update to 3.11

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agokvm: fix traces to use %x instead of %d
Alexey Kardashevskiy [Wed, 4 Sep 2013 10:26:25 +0000 (20:26 +1000)]
kvm: fix traces to use %x instead of %d

KVM request types are normally defined using hex constants but QEMU traces
print decimal values instead, which is not very convenient.

This changes the request type format from %d to %x.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agokvmvapic: Clear also physical ROM address when entering INACTIVE state
Jan Kiszka [Tue, 3 Sep 2013 16:08:52 +0000 (18:08 +0200)]
kvmvapic: Clear also physical ROM address when entering INACTIVE state

To avoid misinterpreting INACTIVE after migration as old qemu-kvm's
STANDBY, also clear rom_state_paddr when going back to this state.

CC: qemu-stable@nongnu.org
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agokvmvapic: Enter inactive state on hardware reset
Jan Kiszka [Tue, 3 Sep 2013 16:08:51 +0000 (18:08 +0200)]
kvmvapic: Enter inactive state on hardware reset

ROM layout may change after reset of devices are hotplugged, so we have
to pick up the physical address again when the ROM is initialized. This
is best achieved by resetting the state to INACTIVE.

CC: qemu-stable@nongnu.org
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agokvmvapic: Catch invalid ROM size
Jan Kiszka [Tue, 3 Sep 2013 16:08:50 +0000 (18:08 +0200)]
kvmvapic: Catch invalid ROM size

If not caught early, a zero-length ROM will cause a NULL-pointer access
later on in patch_hypercalls when allocating a zero-length ROM copy and
trying to read from it.

CC: qemu-stable@nongnu.org
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agokvm irqfd: support direct msimessage to irq translation
Alexey Kardashevskiy [Tue, 3 Sep 2013 08:08:25 +0000 (18:08 +1000)]
kvm irqfd: support direct msimessage to irq translation

On PPC64 systems MSI Messages are translated to system IRQ in a PCI
host bridge. This is already supported for emulated MSI/MSIX but
not for irqfd where the current QEMU allocates IRQ numbers from
irqchip and maps MSIMessages to IRQ in the host kernel.

This adds a new direct mapping flag which tells
the kvm_irqchip_add_msi_route() function that a new VIRQ
should not be allocated, instead the value from MSIMessage::data
should be used. It is up to the platform code to make sure that
this contains a valid IRQ number as sPAPR does in spapr_pci.c.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agofix steal time MSR vmsd callback to proper opaque type
Marcelo Tosatti [Tue, 3 Sep 2013 21:55:16 +0000 (18:55 -0300)]
fix steal time MSR vmsd callback to proper opaque type

Convert steal time MSR vmsd callback pointer to proper X86CPU type.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agokvm: warn if num cpus is greater than num recommended
Andrew Jones [Fri, 23 Aug 2013 13:24:37 +0000 (15:24 +0200)]
kvm: warn if num cpus is greater than num recommended

The comment in kvm_max_vcpus() states that it's using the recommended
procedure from the kernel API documentation to get the max number
of vcpus that kvm supports. It is, but by always returning the
maximum number supported. The maximum number should only be used
for development purposes. qemu should check KVM_CAP_NR_VCPUS for
the recommended number of vcpus. This patch adds a warning if a user
specifies a number of cpus between the recommended and max.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
10 years agocpu: Move cpu state syncs up into cpu_dump_state()
James Hogan [Tue, 27 Aug 2013 11:19:10 +0000 (12:19 +0100)]
cpu: Move cpu state syncs up into cpu_dump_state()

The x86 and ppc targets call cpu_synchronize_state() from their
*_cpu_dump_state() callbacks to ensure that up to date state is dumped
when KVM is enabled (for example when a KVM internal error occurs).

Move this call up into the generic cpu_dump_state() function so that
other KVM targets (namely MIPS) can take advantage of it.

This requires kvm_cpu_synchronize_state() and cpu_synchronize_state() to
be moved out of the #ifdef NEED_CPU_H in <sysemu/kvm.h> so that they're
accessible to qom/cpu.c.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Andreas Färber <afaerber@suse.de>
Cc: Alexander Graf <agraf@suse.de>
Cc: Gleb Natapov <gleb@redhat.com>
Cc: qemu-ppc@nongnu.org
Cc: kvm@vger.kernel.org
Signed-off-by: Gleb Natapov <gleb@redhat.com>
10 years agoexec: always use MADV_DONTFORK
Andrea Arcangeli [Thu, 25 Jul 2013 10:11:15 +0000 (12:11 +0200)]
exec: always use MADV_DONTFORK

MADV_DONTFORK prevents fork to fail with -ENOMEM if the default
overcommit heuristics decides there's too much anonymous virtual
memory allocated. If the KVM secondary MMU is synchronized with MMU
notifiers or not, doesn't make a difference in that regard.

Secondly it's always more efficient to avoid copying the guest
physical address space in the fork child (so we avoid to mark all the
guest memory readonly in the parent and so we skip the establishment
and teardown of lots of pagetables in the child).

In the common case we can ignore the error if MADV_DONTFORK is not
available. Leave a second invocation that errors out in the KVM path
if MMU notifiers are missing and KVM is enabled, to abort in such
case.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Tested-By: Benoit Canet <benoit@irqsave.net>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
10 years agocoroutine: fix /perf/nesting coroutine benchmark
Gabriel Kerneis [Tue, 17 Sep 2013 16:26:48 +0000 (18:26 +0200)]
coroutine: fix /perf/nesting coroutine benchmark

The /perf/nesting benchmark is broken because the counters are
not reset after each iteration. Therefore, nesting is done only
on the first iteration, and skipped on every other.

This patch fixes the issue, and reduces the number of iterations
to make it possible to run the benchmark in a reasonable amount of
time.

Signed-off-by: Gabriel Kerneis <gabriel@kerneis.info>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agocoroutine: add qemu_coroutine_yield benchmark
Gabriel Kerneis [Tue, 17 Sep 2013 15:09:39 +0000 (17:09 +0200)]
coroutine: add qemu_coroutine_yield benchmark

Current coroutine performance benchmarks test only coroutine creation,
either directly or in a nested way. This patch adds a benchmark to
evaluate the performance of qemu_coroutine_yield.

Signed-off-by: Gabriel Kerneis <gabriel@kerneis.info>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agousb: Fix iovec memleak on combined-packet free
Hans de Goede [Tue, 17 Sep 2013 19:44:52 +0000 (21:44 +0200)]
usb: Fix iovec memleak on combined-packet free

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: Also reset max_packet_size on ep_reset
Hans de Goede [Tue, 17 Sep 2013 19:44:53 +0000 (21:44 +0200)]
usb: Also reset max_packet_size on ep_reset

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoxhci: Fix memory leak on xhci_disable_ep
Hans de Goede [Tue, 17 Sep 2013 19:44:51 +0000 (21:44 +0200)]
xhci: Fix memory leak on xhci_disable_ep

The USBPacket-s in the transfers need to be cleaned up so that the memory
allocated by the iovec in there gets freed.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoxhci: Add xhci_epid_to_usbep helper function
Hans de Goede [Tue, 17 Sep 2013 19:44:50 +0000 (21:44 +0200)]
xhci: Add xhci_epid_to_usbep helper function

And use it instead of prying the USBEndpoint out of the packet struct
in various places.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoxhci: Init a transfers xhci, slotid and epid member on epctx alloc
Hans de Goede [Tue, 17 Sep 2013 19:44:49 +0000 (21:44 +0200)]
xhci: Init a transfers xhci, slotid and epid member on epctx alloc

Transfers are part of an epctx, which is part of a slot, which is part of
a xhci. Transfers cannot dynamically be moved from one epctx to another,
so once created their xhci, slotid and epid are constant, so lets set these
up at creation time, rather then re-initializing them with the same
value each time a transfer gets submitted.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoxhci: Fix number of streams allocated when using streams
Hans de Goede [Mon, 16 Sep 2013 15:04:27 +0000 (17:04 +0200)]
xhci: Fix number of streams allocated when using streams

According to the xhci spec the total number of streams is
2 ^ (MaxPStreams + 1), and this is also how the Linux xhci driver
uses this field.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: remove old usb-host code
Gerd Hoffmann [Tue, 10 Sep 2013 09:02:59 +0000 (11:02 +0200)]
usb: remove old usb-host code

The usb-host code has been rewritten for qemu 1.5 to use libusb,
the old code has been left in as temporary fallback.  Now we are
two releases further out, targeting the 1.7 release.  No major
issues with the new code poped up until now.  Time to remove it
from tre tree.  Should we ever need it again for some reason --
git has a copy for us in the history.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoqemu-timer: do not take the lock in timer_pending
Paolo Bonzini [Thu, 12 Sep 2013 09:02:20 +0000 (11:02 +0200)]
qemu-timer: do not take the lock in timer_pending

We can deduce the result from expire_time, by making it always -1 if
the timer is not in the active_timers list.  We need to check against
negative times passed to timer_mod_ns; clamping them to zero is not
a problem because the only clock that has a zero value at VM startup
is QEMU_CLOCK_VIRTUAL, and it is monotonic so it cannot be non-zero.
QEMU_CLOCK_HOST, instead, is not monotonic but it cannot go to negative
values unless the host time is seriously screwed up and points to
the 1960s.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqemu-timer: make qemu_timer_mod_ns() and qemu_timer_del() thread-safe
Stefan Hajnoczi [Thu, 12 Sep 2013 09:02:19 +0000 (11:02 +0200)]
qemu-timer: make qemu_timer_mod_ns() and qemu_timer_del() thread-safe

Introduce QEMUTimerList->active_timers_lock to protect the linked list
of active timers.  This allows qemu_timer_mod_ns() to be called from any
thread.

Note that vm_clock is not thread-safe and its use of
qemu_clock_has_timers() works fine today but is also not thread-safe.

The purpose of this patch is to eventually let device models set or
cancel timers from a vcpu thread without holding the global mutex.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqemu-timer: drop outdated signal safety comments
Stefan Hajnoczi [Thu, 12 Sep 2013 09:02:18 +0000 (11:02 +0200)]
qemu-timer: drop outdated signal safety comments

host_alarm_handler() is invoked from the signal processing thread
(currently the iothread).  Previously we did processing in a real signal
handler with signalfd and therefore needed signal-safe timer code.

Today host_alarm_handler() just marks the alarm timer as expired/pending
and notifies the main loop using qemu_notify_event().

Therefore these outdated comments about signal safety can be dropped.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoosdep: warn if open(O_DIRECT) on fails with EINVAL
Stefan Hajnoczi [Thu, 22 Aug 2013 09:29:03 +0000 (11:29 +0200)]
osdep: warn if open(O_DIRECT) on fails with EINVAL

Print a warning when opening a file O_DIRECT fails with EINVAL.  This
saves users a lot of time trying to figure out the EINVAL error, which
is typical when attempting to open a file O_DIRECT on Linux tmpfs.

Reported-by: Deepak C Shetty <deepakcs@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
10 years agolibcacard: link against qemu-error.o for error_report()
Stefan Hajnoczi [Thu, 22 Aug 2013 09:29:02 +0000 (11:29 +0200)]
libcacard: link against qemu-error.o for error_report()

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoQMP: qmp-events.txt: alphabetical order fix and other minor changes
Luiz Capitulino [Wed, 11 Sep 2013 17:58:12 +0000 (13:58 -0400)]
QMP: qmp-events.txt: alphabetical order fix and other minor changes

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
10 years agoQMP: Update qmp-spec.txt
Luiz Capitulino [Wed, 11 Sep 2013 17:52:51 +0000 (13:52 -0400)]
QMP: Update qmp-spec.txt

Simplify the text, fix some of the examples.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
10 years agoQMP: Update README file
Luiz Capitulino [Tue, 10 Sep 2013 21:15:49 +0000 (17:15 -0400)]
QMP: Update README file

Drop unneeded info, fix some of the examples and rename QEMU Monitor
Protocol to QEMU Machine Protocol.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
10 years agoQMP: QMP/ -> docs/qmp/
Luiz Capitulino [Tue, 10 Sep 2013 21:00:45 +0000 (17:00 -0400)]
QMP: QMP/ -> docs/qmp/

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
10 years agoQMP: fix qmp-commands.txt generation path
Luiz Capitulino [Tue, 10 Sep 2013 20:56:14 +0000 (16:56 -0400)]
QMP: fix qmp-commands.txt generation path

This file should be generated in the BUILD_DIR, as all other docs.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
10 years agoQMP: add scripts/qmp
Luiz Capitulino [Tue, 10 Sep 2013 20:39:23 +0000 (16:39 -0400)]
QMP: add scripts/qmp

Populate it with all scripts stored in QMP/. Also fixes trailing
whitespaces in qmp-shell and qmp.py.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>