]> git.proxmox.com Git - qemu.git/log
qemu.git
10 years agotcg-ppc: Cleanup tcg_out_qemu_ld/st_slow_path
Richard Henderson [Thu, 29 Aug 2013 17:07:24 +0000 (10:07 -0700)]
tcg-ppc: Cleanup tcg_out_qemu_ld/st_slow_path

Coding style fixes.  Use TCGReg enumeration values instead of raw
numbers.  Don't needlessly pull the whole TCGLabelQemuLdst struct
into local variables.  Less conditional compilation.

No functional changes.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc: Avoid code for nop move
Richard Henderson [Wed, 28 Aug 2013 22:51:08 +0000 (15:51 -0700)]
tcg-ppc: Avoid code for nop move

While these are rare from code that's been through the optimizer,
it's not uncommon within the tcg backend.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc: use new return-argument ld/st helpers
Paolo Bonzini [Thu, 5 Sep 2013 08:22:09 +0000 (10:22 +0200)]
tcg-ppc: use new return-argument ld/st helpers

These use a 32-bit load-of-immediate to save a mflr+addi+mtlr sequence.
Tested with a Windows 98 guest (pretty much the most recent thing I
could run on my PPC machine) and kvm-unit-tests's sieve.flat.  The
speed up for sieve.flat is as high as 10% for qemu-system-i386, 25%
(no kidding) for qemu-system-x86_64 on my PowerBook G4.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc: fix qemu_ld/qemu_st for AIX ABI
Paolo Bonzini [Thu, 5 Sep 2013 08:22:08 +0000 (10:22 +0200)]
tcg-ppc: fix qemu_ld/qemu_st for AIX ABI

For the AIX ABI, the function pointer and small area pointer need
to be loaded in the trampoline.  The trampoline instead is called
with a normal BL instruction.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agoconfigure: Allow command-line configure for ppc32
Richard Henderson [Wed, 28 Aug 2013 22:48:21 +0000 (15:48 -0700)]
configure: Allow command-line configure for ppc32

Similar to manually selecting i386 for an x86_64 host.

Signed-off-by: Richard Henderson <rth@twiddle.net>
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 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 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>
10 years agoqxl: compile only once
Gerd Hoffmann [Wed, 11 Sep 2013 11:32:07 +0000 (13:32 +0200)]
qxl: compile only once

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoqxl: simplify page dirtying
Gerd Hoffmann [Wed, 11 Sep 2013 11:15:48 +0000 (13:15 +0200)]
qxl: simplify page dirtying

No need to do target page size calculations here,
memory_region_set_dirty will care for us.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoqxl: simplify qxl_rom_size
Gerd Hoffmann [Wed, 11 Sep 2013 11:08:49 +0000 (13:08 +0200)]
qxl: simplify qxl_rom_size

Nowdays rom size is fixed at 8192 for live migration compat reasons.
So we can ditch the pointless math trying to calculate the size needed.
Also make the size sanity check fail at compile time not runtime.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoqxl: define qxl operating on 4k pages
Gerd Hoffmann [Wed, 11 Sep 2013 11:14:25 +0000 (13:14 +0200)]
qxl: define qxl operating on 4k pages

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoblock/iscsi: Drop iscsi_co_get_block_status for older versions of libiscsi
Stefan Weil [Tue, 17 Sep 2013 17:33:49 +0000 (19:33 +0200)]
block/iscsi: Drop iscsi_co_get_block_status for older versions of libiscsi

Debian wheezy includes libiscsi-dev 1.4.0 which does not provide
SCSI_PROVISIONING_TYPE_DEALLOCATED. Drop iscsi_co_get_block_status
in this case to allow compilation without errors.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agoMAINTAINERS: Add myself to MAINTAINERS file
Eduardo Otubo [Mon, 9 Sep 2013 17:04:15 +0000 (14:04 -0300)]
MAINTAINERS: Add myself to MAINTAINERS file

Add myself to the MAINTAINERS file. I'll be looking at qemu-seccomp.c
and include/sysemu/seccomp.h.

Signed-off-by: Eduardo Otubo <otubo@linux.vnet.ibm.com>
Acked-by: Paul Moore <pmoore@redhat.com>
Message-id: 1378746255-2089-1-git-send-email-otubo@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
10 years agohmp: block-stream: fix typo
Anthony Liguori [Tue, 17 Sep 2013 16:10:47 +0000 (11:10 -0500)]
hmp: block-stream: fix typo

Found this by enabling C++ errors.  The bool and enum arguments
are mistakenly flipped.

Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
10 years agoMerge remote-tracking branch 'kiszka/queues/slirp' into staging
Anthony Liguori [Tue, 17 Sep 2013 15:01:24 +0000 (10:01 -0500)]
Merge remote-tracking branch 'kiszka/queues/slirp' into staging

# By Liu Ping Fan (3) and Jan Kiszka (1)
# Via Jan Kiszka
* kiszka/queues/slirp:
  slirp: clean up slirp_update_timeout
  slirp: set mainloop timeout with more precise value
  slirp: define timeout as macro
  slirp: make timeout local

Message-id: cover.1379415024.git.jan.kiszka@siemens.com

10 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Tue, 17 Sep 2013 14:51:40 +0000 (09:51 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

# By Max Reitz (16) and others
# Via Kevin Wolf
* kwolf/for-anthony: (33 commits)
  qemu-iotests: Fix test 038
  block: Assert validity of BdrvActionOps
  qemu-iotests: Cleanup test image in test number 007
  qemu-img: fix invalid JSON
  coroutine: add ./configure --disable-coroutine-pool
  qemu-iotests: Adjustments due to error propagation
  qcow2: Use Error parameter
  qemu-img create: Emit filename on error
  block: Error parameter for create functions
  block: Error parameter for open functions
  bdrv: Use "Error" for creating images
  bdrv: Use "Error" for opening images
  qemu-iotests: add 057 internal snapshot for block device test case
  hmp: add interface hmp_snapshot_delete_blkdev_internal
  hmp: add interface hmp_snapshot_blkdev_internal
  qmp: add interface blockdev-snapshot-delete-internal-sync
  qmp: add interface blockdev-snapshot-internal-sync
  qmp: add internal snapshot support in qmp_transaction
  snapshot: distinguish id and name in snapshot delete
  snapshot: new function bdrv_snapshot_find_by_id_and_name()
  ...

Message-id: 1379073063-14963-1-git-send-email-kwolf@redhat.com

10 years agoMerge remote-tracking branch 'rth/tgt-i386' into staging
Anthony Liguori [Tue, 17 Sep 2013 14:51:23 +0000 (09:51 -0500)]
Merge remote-tracking branch 'rth/tgt-i386' into staging

# By Paolo Bonzini (1) and Peter Maydell (1)
# Via Richard Henderson
* rth/tgt-i386:
  target-i386: Only provide CMOV and friends if feature bit set
  target-i386: fix disassembly with PAE=1, PG=0

Message-id: 1379010496-5875-1-git-send-email-rth@twiddle.net

10 years agoMerge remote-tracking branch 'bonzini/scsi-next' into staging
Anthony Liguori [Tue, 17 Sep 2013 14:50:23 +0000 (09:50 -0500)]
Merge remote-tracking branch 'bonzini/scsi-next' into staging

# By Peter Lieven (3) and others
# Via Paolo Bonzini
* bonzini/scsi-next:
  spapr-vscsi: Report error on unsupported MAD requests
  spapr-vscsi: Adding VSCSI capabilities
  iscsi: split discard requests in multiple parts
  iscsi: add .bdrv_get_block_status
  iscsi: add logical block provisioning information to iscsilun
  hw/scsi/lsi53c895a: Use deposit32 rather than handcoded shift/mask
  hw/scsi/lsi53c895a: Use sextract32 for sign-extension
  scsi: Fix scsi_bus_legacy_add_drive() scsi-generic with serial
  virtio-scsi: Make type virtio-scsi-common abstract
  spapr-vscsi: add task management
  scsi: prefer UUID to VM name for the initiator name

Message-id: 1378984634-765-1-git-send-email-pbonzini@redhat.com

10 years agoMerge remote-tracking branch 'kraxel/chardev.7' into staging
Anthony Liguori [Tue, 17 Sep 2013 14:49:43 +0000 (09:49 -0500)]
Merge remote-tracking branch 'kraxel/chardev.7' into staging

# By Gerd Hoffmann
# Via Gerd Hoffmann
* kraxel/chardev.7:
  chardev: fix pty_chr_timer

Message-id: 1378972894-11185-1-git-send-email-kraxel@redhat.com

10 years agoslirp: clean up slirp_update_timeout
Jan Kiszka [Wed, 28 Aug 2013 17:12:15 +0000 (19:12 +0200)]
slirp: clean up slirp_update_timeout

No need to write out the timeout early, keep it local until we are done.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
10 years agoslirp: set mainloop timeout with more precise value
Liu Ping Fan [Sun, 25 Aug 2013 02:01:21 +0000 (10:01 +0800)]
slirp: set mainloop timeout with more precise value

If slirp needs to emulate tcp timeout, then the timeout value
for mainloop should be more precise, which is determined by
slirp's fasttimo or slowtimo. Achieve this by swap the logic
sequence of slirp_pollfds_fill and slirp_update_timeout.

Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
10 years agoslirp: define timeout as macro
Liu Ping Fan [Sun, 25 Aug 2013 02:01:20 +0000 (10:01 +0800)]
slirp: define timeout as macro

Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
10 years agoslirp: make timeout local
Liu Ping Fan [Sun, 25 Aug 2013 02:01:19 +0000 (10:01 +0800)]
slirp: make timeout local

Each slirp has its own time to caculate timeout.

Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
10 years agolsi: add 53C810 variant
Hervé Poussineau [Sat, 14 Sep 2013 15:51:09 +0000 (17:51 +0200)]
lsi: add 53C810 variant

Currently, treat it exactly as a 53C895A.
53C895A is a 53C810 with more capabilities, so this should work.

However, this lets us test different code paths on Linux, which
don't use lastest features if it detect a 810, or on some OSes
which only support 810 and not 895A (like very old Windows NT
versions).

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agolsi: remove todo
Hervé Poussineau [Sat, 14 Sep 2013 15:51:08 +0000 (17:51 +0200)]
lsi: remove todo

LSI emulation has been tested with Linux on PPC platform.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agolsi: ignore write accesses to CTEST0 registers
Hervé Poussineau [Sat, 14 Sep 2013 15:51:07 +0000 (17:51 +0200)]
lsi: ignore write accesses to CTEST0 registers

53C895A datasheet says that this register is read/write, and that the value
returned on read access is dependant of DMA FIFO state. However, nothing is
said for written value.

53C810A datasheet gives more insight about this register:
"This was a general purpose read/write register in previous SYM53C8XX
family chips. Although it is still a read/write register, Symbios reserves
the right to use these bits for future 53C8XX family enhancements."

This prevents going to the default case, which prints an error message.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agolsi: check ssid versus sdid only if ssid is valid
Hervé Poussineau [Sat, 14 Sep 2013 15:51:06 +0000 (17:51 +0200)]
lsi: check ssid versus sdid only if ssid is valid

This prevents some (invalid) error messages on console.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agolsi: use constant name instead of its value
Hervé Poussineau [Sat, 14 Sep 2013 15:51:05 +0000 (17:51 +0200)]
lsi: use constant name instead of its value

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agoqemu-iotests: Fix test 038
Max Reitz [Fri, 13 Sep 2013 08:37:12 +0000 (10:37 +0200)]
qemu-iotests: Fix test 038

Test 038 uses asynchronous I/O, resulting (potentially) in a different
output for every run (regarding the order of the I/O accesses). This can
be fixed by simply sorting the I/O access messages, since their order is
irrelevant anyway (for this asynchonous I/O).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agotarget-i386: Only provide CMOV and friends if feature bit set
Peter Maydell [Mon, 15 Jul 2013 17:21:40 +0000 (18:21 +0100)]
target-i386: Only provide CMOV and friends if feature bit set

The instructions CMOVcc, FCMOVcc and F[U]COMI[P] should only be
present if the CMOV feature bit is set. Add missing feature bit
checks so we correctly fault if emulating a 486 or 586.
This fixes bug LP:1201446.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: fix disassembly with PAE=1, PG=0
Paolo Bonzini [Fri, 30 Aug 2013 09:58:45 +0000 (11:58 +0200)]
target-i386: fix disassembly with PAE=1, PG=0

CR4.PAE=1 will not enable paging if CR0.PG=0, but the "if" chain
in x86_cpu_get_phys_page_debug says otherwise.  Check CR0.PG
before everything else.

Fixes "-d in_asm" for a code section at the beginning of OVMF.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
10 years agopc_sysfw: Fix ISA BIOS init for ridiculously big flash
Markus Armbruster [Wed, 31 Jul 2013 13:11:12 +0000 (15:11 +0200)]
pc_sysfw: Fix ISA BIOS init for ridiculously big flash

pc_isa_bios_init() suffers integer overflow for flash larger than
INT_MAX.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1375276272-15988-9-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
10 years agoexec: Don't abort when we can't allocate guest memory
Markus Armbruster [Wed, 31 Jul 2013 13:11:11 +0000 (15:11 +0200)]
exec: Don't abort when we can't allocate guest memory

We abort() on memory allocation failure.  abort() is appropriate for
programming errors.  Maybe most memory allocation failures are
programming errors, maybe not.  But guest memory allocation failure
isn't, and aborting when the user asks for more memory than we can
provide is not nice.  exit(1) instead, and do it in just one place, so
the error message is consistent.

Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1375276272-15988-8-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
10 years agoexec: Clean up unnecessary S390 ifdeffery
Markus Armbruster [Wed, 31 Jul 2013 13:11:10 +0000 (15:11 +0200)]
exec: Clean up unnecessary S390 ifdeffery

Another issue missed in commit fdec991 is -mem-path: it needs to be
rejected only for old S390 KVM, not for any S390.  Not that I
personally care, but the ifdeffery in qemu_ram_alloc_from_ptr() annoys
me.

Note that this doesn't actually make -mem-path work, as the kernel
doesn't (yet?)  support large pages in the host for KVM guests.  Clean
it up anyway.

Thanks to Christian Borntraeger for pointing out the S390 kernel
limitations.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1375276272-15988-7-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
10 years agoexec: Drop incorrect & dead S390 code in qemu_ram_remap()
Markus Armbruster [Wed, 31 Jul 2013 13:11:09 +0000 (15:11 +0200)]
exec: Drop incorrect & dead S390 code in qemu_ram_remap()

Old S390 KVM wants guest RAM mapped in a peculiar way.  Commit 6b02494
implemented that.

When qemu_ram_remap() got added in commit cd19cfa, its code carefully
mimicked the allocation code: peculiar way if defined(TARGET_S390X) &&
defined(CONFIG_KVM), else normal way.

For new S390 KVM, we actually want the normal way.  Commit fdec991
changed qemu_ram_alloc_from_ptr() accordingly, but forgot to update
qemu_ram_remap().  If qemu_ram_alloc_from_ptr() maps RAM the normal
way, but qemu_ram_remap() remaps it the peculiar way, remapping
changes protection and flags, which it shouldn't.

Fortunately, this can't happen, as we never remap on S390.

Replace the incorrect code with an assertion.

Thanks to Christian Borntraeger for help with assessing the bug's
(non-)impact.

Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-id: 1375276272-15988-6-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
10 years agoexec: Simplify the guest physical memory allocation hook
Markus Armbruster [Wed, 31 Jul 2013 13:11:08 +0000 (15:11 +0200)]
exec: Simplify the guest physical memory allocation hook

Make it a generic hook rather than a KVM hook.  Less code and
ifdeffery.

Since the only user of the hook is old S390 KVM, there's hope we can
get rid of it some day.

Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Message-id: 1375276272-15988-5-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>