]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
7 years agoMerge remote-tracking branch 'remotes/xtensa/tags/20170124-xtensa' into staging
Peter Maydell [Wed, 25 Jan 2017 16:36:57 +0000 (16:36 +0000)]
Merge remote-tracking branch 'remotes/xtensa/tags/20170124-xtensa' into staging

target/xtensa updates:

- refactor CCOUNT/CCOMPARE (use QEMU timers instead of instruction counting);
- support icount; run target/xtensa TCG tests with icount;
- implement SMP prerequisites: static vector selection, RUNSTALL and RER/WER.

# gpg: Signature made Wed 25 Jan 2017 00:27:51 GMT
# gpg:                using RSA key 0x51F9CC91F83FA044
# gpg: Good signature from "Max Filippov <max.filippov@cogentembedded.com>"
# gpg:                 aka "Max Filippov <jcmvbkbc@gmail.com>"
# Primary key fingerprint: 2B67 854B 98E5 327D CDEB  17D8 51F9 CC91 F83F A044

* remotes/xtensa/tags/20170124-xtensa:
  target-xtensa: implement RER/WER instructions
  target/xtensa: tests: clean up interrupt tests
  target/xtensa: tests: add memctl test
  target/xtensa: implement MEMCTL SR
  target/xtensa: fix ICACHE/DCACHE options detection
  target/xtensa: tests: add ccount write tests
  target/xtensa: tests: replace hardcoded interrupt masks
  target/xtensa: tests: fix timer tests
  target/xtensa: tests: run tests with icount
  target/xtensa: don't continue translation after exception
  target/xtensa: support icount
  target/xtensa: refactor CCOUNT/CCOMPARE
  target/xtensa: implement RUNSTALL
  target/xtensa: add static vectors selection

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-nios-20170124' into staging
Peter Maydell [Wed, 25 Jan 2017 13:30:23 +0000 (13:30 +0000)]
Merge remote-tracking branch 'remotes/rth/tags/pull-nios-20170124' into staging

nios2 target support

# gpg: Signature made Tue 24 Jan 2017 21:11:47 GMT
# gpg:                using RSA key 0xAD1270CC4DD0279B
# gpg: Good signature from "Richard Henderson <rth7680@gmail.com>"
# gpg:                 aka "Richard Henderson <rth@redhat.com>"
# gpg:                 aka "Richard Henderson <rth@twiddle.net>"
# Primary key fingerprint: 9CB1 8DDA F8E8 49AD 2AFC  16A4 AD12 70CC 4DD0 279B

* remotes/rth/tags/pull-nios-20170124:
  nios2: Add support for Nios-II R1
  nios2: Add Altera 10M50 GHRD emulation
  nios2: Add periodic timer emulation
  nios2: Add IIC interrupt controller emulation
  nios2: Add usermode binaries emulation
  nios2: Add disas entries
  nios2: Add architecture emulation support

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging
Peter Maydell [Wed, 25 Jan 2017 10:42:26 +0000 (10:42 +0000)]
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging

trivial patches for 2017-01-24

# gpg: Signature made Tue 24 Jan 2017 20:27:08 GMT
# gpg:                using RSA key 0x701B4F6B1A693E59
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
# gpg:                 aka "Michael Tokarev <mjt@corpit.ru>"
# gpg:                 aka "Michael Tokarev <mjt@debian.org>"
# Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
#      Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931  4B22 701B 4F6B 1A69 3E59

* remotes/mjt/tags/trivial-patches-fetch: (31 commits)
  hw/isa/isa-bus: Set category of the "isabus-bridge" device
  usb: Set category and description of the MTP device
  gdbstub.c: update old error report statements
  gdbstub.c: fix GDB connection segfault caused by empty machines
  scsi-disk: add 'fall through' comment to switch VERIFY cases
  Drop duplicate display option documentation
  hw/display/framebuffer.c: Avoid overflow for framebuffers > 4GB
  win32: use glib gpoll if glib >= 2.50
  util/mmap-alloc: refactor a little bit for readability
  util/mmap-alloc: check parameter before using
  vfio: remove a duplicated word in comments
  docs: sync pci-ids.txt
  disas/cris.c: Fix Coverity warning about unchecked NULL
  lm32: milkymist-tmu2: fix another integer overflow
  hw/i386/kvmvapic: Remove dead code in patch_hypercalls()
  doc/usb2: fix typo
  qga: fix erroneous argument to strerror
  block: remove dead check
  pci-assign: avoid pointless stat
  qemu-img: remove dead check
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agonios2: Add support for Nios-II R1
Marek Vasut [Wed, 18 Jan 2017 22:01:46 +0000 (23:01 +0100)]
nios2: Add support for Nios-II R1

Add remaining bits of the Altera NiosII R1 support into qemu, which
is documentation, MAINTAINERS file entry, configure bits, arch_init
and configuration files for both linux-user (userland binaries) and
softmmu (hardware emulation).

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chris Wulff <crwulff@gmail.com>
Cc: Jeff Da Silva <jdasilva@altera.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Sandra Loosemore <sandra@codesourcery.com>
Cc: Yves Vandervennet <yvanderv@altera.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Message-Id: <20170118220146.489-8-marex@denx.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agonios2: Add Altera 10M50 GHRD emulation
Marek Vasut [Wed, 18 Jan 2017 22:01:45 +0000 (23:01 +0100)]
nios2: Add Altera 10M50 GHRD emulation

Add the Altera 10M50 Nios2 GHRD model. This allows emulating the
10M50 development kit with the Nios2 GHRD loaded in the FPGA. It
is possible to boot Linux kernel and run userspace, thus far only
from initrd as storage support is not yet implemented.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chris Wulff <crwulff@gmail.com>
Cc: Jeff Da Silva <jdasilva@altera.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Sandra Loosemore <sandra@codesourcery.com>
Cc: Yves Vandervennet <yvanderv@altera.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Message-Id: <20170118220146.489-7-marex@denx.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agonios2: Add periodic timer emulation
Chris Wulff [Wed, 18 Jan 2017 22:01:44 +0000 (23:01 +0100)]
nios2: Add periodic timer emulation

Add the Altera timer model.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chris Wulff <crwulff@gmail.com>
Cc: Jeff Da Silva <jdasilva@altera.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Sandra Loosemore <sandra@codesourcery.com>
Cc: Yves Vandervennet <yvanderv@altera.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Message-Id: <20170118220146.489-6-marex@denx.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agonios2: Add IIC interrupt controller emulation
Chris Wulff [Wed, 18 Jan 2017 22:01:43 +0000 (23:01 +0100)]
nios2: Add IIC interrupt controller emulation

Add the Altera Nios2 internal interrupt controller model.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chris Wulff <crwulff@gmail.com>
Cc: Jeff Da Silva <jdasilva@altera.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Sandra Loosemore <sandra@codesourcery.com>
Cc: Yves Vandervennet <yvanderv@altera.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Message-Id: <20170118220146.489-5-marex@denx.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agonios2: Add usermode binaries emulation
Marek Vasut [Wed, 18 Jan 2017 22:01:42 +0000 (23:01 +0100)]
nios2: Add usermode binaries emulation

Add missing bits for qemu-user required for emulating Altera Nios2
userspace binaries.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chris Wulff <crwulff@gmail.com>
Cc: Jeff Da Silva <jdasilva@altera.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Sandra Loosemore <sandra@codesourcery.com>
Cc: Yves Vandervennet <yvanderv@altera.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Message-Id: <20170118220146.489-4-marex@denx.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agonios2: Add disas entries
Marek Vasut [Wed, 18 Jan 2017 22:01:40 +0000 (23:01 +0100)]
nios2: Add disas entries

Add nios2 disassembler support. This patch is composed from binutils files
from commit "Opcodes and assembler support for Nios II R2". The files from
binutils used in this patch are:

    include/opcode/nios2.h
    include/opcode/nios2r1.h
    include/opcode/nios2r2.h
    opcodes/nios2-opc.c
    opcodes/nios2-dis.c

Checkpatch says total: 114 errors, 0 warnings, 3609 lines checked , which
is caused by a different coding style in those files. These warnings and
errors are not addressed To let these files be easily synchronized between
binutils and qemu.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chris Wulff <crwulff@gmail.com>
Cc: Jeff Da Silva <jdasilva@altera.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Sandra Loosemore <sandra@codesourcery.com>
Cc: Yves Vandervennet <yvanderv@altera.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Message-Id: <20170118220146.489-2-marex@denx.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agonios2: Add architecture emulation support
Chris Wulff [Wed, 18 Jan 2017 22:01:41 +0000 (23:01 +0100)]
nios2: Add architecture emulation support

Add support for emulating Altera NiosII R1 architecture into qemu.
This patch is based on previous work by Chris Wulff from 2012 and
updated to latest mainline QEMU.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chris Wulff <crwulff@gmail.com>
Cc: Jeff Da Silva <jdasilva@altera.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Sandra Loosemore <sandra@codesourcery.com>
Cc: Yves Vandervennet <yvanderv@altera.com>
Cc: Alexander Graf <agraf@suse.de>
Message-Id: <20170118220146.489-3-marex@denx.de>
[rth: Remove tlb_flush from nios2_cpu_reset.]
Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agohw/isa/isa-bus: Set category of the "isabus-bridge" device
Thomas Huth [Fri, 20 Jan 2017 15:53:59 +0000 (16:53 +0100)]
hw/isa/isa-bus: Set category of the "isabus-bridge" device

It has "bridge" in its name, so it should be in the category
DEVICE_CATEGORY_BRIDGE.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agousb: Set category and description of the MTP device
Thomas Huth [Fri, 20 Jan 2017 13:11:04 +0000 (14:11 +0100)]
usb: Set category and description of the MTP device

It's a storage device, so let's classify it accordingly. And
while we're at it, also add a short description for people who
do not know what MTP means.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agogdbstub.c: update old error report statements
Ziyue Yang [Wed, 18 Jan 2017 08:03:29 +0000 (16:03 +0800)]
gdbstub.c: update old error report statements

Some updates from fprintf(stderr, ...) to error_report.

Signed-off-by: Ziyue Yang <skiver.cloud.yzy@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agogdbstub.c: fix GDB connection segfault caused by empty machines
Ziyue Yang [Wed, 18 Jan 2017 08:02:41 +0000 (16:02 +0800)]
gdbstub.c: fix GDB connection segfault caused by empty machines

This patch is to fix the segmentation fault caused by attaching
GDB to a QEMU instance initialized with "-M none" option.

The bug can be reproduced by

> ./qemu-system-x86_64 -M none -nographic -S -s

and attach a GDB to it by

> gdb -ex 'target remote :1234

The segmentation fault was originally caused by trying to read
the information about CPU when communicating with GDB. However,
it's impossible for any control flow to exist on an empty machine,
nor can CPU's be hot plugged to an empty machine later by QOM
commands. So I think simply disabling GDB connections on empty
machines makes sense.

Signed-off-by: Ziyue Yang <skiver.cloud.yzy@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agoscsi-disk: add 'fall through' comment to switch VERIFY cases
Peter Maydell [Mon, 16 Jan 2017 18:46:00 +0000 (18:46 +0000)]
scsi-disk: add 'fall through' comment to switch VERIFY cases

Commit 166dbda7e131 added some extra cases to a switch() such
that the existing code is intended to fall through the new
case statements. It's clear from the commit that this is
intentional, but less clear to subsequent readers of the
code, and not clear at all to static analysis tools like
Coverity. Add a /* fall through */ comment to indicate the
intent. (Fixes CID 1368287.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agoDrop duplicate display option documentation
Samuel Thibault [Sun, 15 Jan 2017 20:30:14 +0000 (21:30 +0100)]
Drop duplicate display option documentation

The curses and none possibilities are already documented on a separate line,
so documenting it on the sdl line was both unneeded and confusing.

Introduced in commit f04ec5afbb7d60a56863add800fd90ceee66f362
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agohw/display/framebuffer.c: Avoid overflow for framebuffers > 4GB
Peter Maydell [Mon, 9 Jan 2017 16:45:09 +0000 (16:45 +0000)]
hw/display/framebuffer.c: Avoid overflow for framebuffers > 4GB

Coverity points out that calculating src_len by multiplying
src_width by rows could overflow. This can only happen in
the implausible case of a framebuffer larger than 4GB, but
we may as well fix it, placating Coverity. (CID1005515)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agowin32: use glib gpoll if glib >= 2.50
Marc-André Lureau [Tue, 3 Jan 2017 19:19:33 +0000 (20:19 +0100)]
win32: use glib gpoll if glib >= 2.50

A fix has been committed in upstream glib commit
210a9796f78eb90f76f1bd6a304e9fea05e97617.
(See also related bug https://bugzilla.gnome.org/show_bug.cgi?id=764415)

It is desirable to use the glib version instead of qemu copy, since it
provides more debugging facilities (G_MAIN_POLL_DEBUG etc), and
hopefully has a better maintainance. Hopefully, we can drop the qemu
copy in a few years.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agoutil/mmap-alloc: refactor a little bit for readability
Cao jin [Wed, 2 Nov 2016 13:44:47 +0000 (21:44 +0800)]
util/mmap-alloc: refactor a little bit for readability

1st mmap returns *ptr* which aligns to host page size,

    |             size + align               |
    ------------------------------------------
 ptr

input param *align* could be 1M, or 2M, or host page size. After
QEMU_ALIGN_UP, offset will >= 0

2nd mmap use flag MAP_FIXED, then it return ptr+offset, or else fail.
If it success, then we will have something like:

    | offset |          size             |
    --------------------------------------
 ptr      ptr1

*ptr1* is what we really want to return, it equals ptr+offset.

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agoutil/mmap-alloc: check parameter before using
Cao jin [Wed, 2 Nov 2016 13:44:46 +0000 (21:44 +0800)]
util/mmap-alloc: check parameter before using

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agovfio: remove a duplicated word in comments
Cao jin [Fri, 11 Nov 2016 03:01:36 +0000 (11:01 +0800)]
vfio: remove a duplicated word in comments

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agodocs: sync pci-ids.txt
Gerd Hoffmann [Wed, 11 Jan 2017 11:02:22 +0000 (12:02 +0100)]
docs: sync pci-ids.txt

Three commits allocated pci ids in include/hw/pci/pci.h
without also updating docs/specs/pci-ids.txt:

  bf439db pci: Allocate PCIe host bridge PCI ID
  40d14be hw/pci: introduce PCI Expander Bridge (PXB)
  02b0743 hw/pxb: introduce pxb-pcie expander for PCIe machines

This patch updates pci-ids.txt accordingly.

Cc: qemu-trivial@nongnu.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agodisas/cris.c: Fix Coverity warning about unchecked NULL
Peter Maydell [Mon, 9 Jan 2017 19:05:59 +0000 (19:05 +0000)]
disas/cris.c: Fix Coverity warning about unchecked NULL

Coverity (CID 1005689) warns that we don't check that
spec_reg_info() returned non-NULL before dereferencing.
Add the check, though as the comment notes this is
a can't-really-happen case because the earlier constraint
matching should have ruled out the "unknown reg" case.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agolm32: milkymist-tmu2: fix another integer overflow
Peter Maydell [Fri, 6 Jan 2017 17:45:14 +0000 (17:45 +0000)]
lm32: milkymist-tmu2: fix another integer overflow

Don't truncate the multiplication and do a 64 bit one instead
because the result is stored in a 64 bit variable.

This fixes a similar coverity warning to commit 237a8650d640,
in a similar way, and is the other half of the fix for
coverity CID 1167561.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Michael Walle <michael@walle.cc>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agohw/i386/kvmvapic: Remove dead code in patch_hypercalls()
Peter Maydell [Mon, 9 Jan 2017 17:05:21 +0000 (17:05 +0000)]
hw/i386/kvmvapic: Remove dead code in patch_hypercalls()

The patch_hypercalls() function sets up a 'patches'
variable and checks it at the end of the function, but
never modifies it in the middle. Remove this dead code,
which seems to have been present since the function was
added in commit e5ad936b0fd7 in 2012.

(Spotted by Coverity: CID 1005581.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agodoc/usb2: fix typo
Cao jin [Thu, 12 Jan 2017 07:44:55 +0000 (15:44 +0800)]
doc/usb2: fix typo

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agoqga: fix erroneous argument to strerror
Paolo Bonzini [Wed, 4 Jan 2017 14:52:10 +0000 (15:52 +0100)]
qga: fix erroneous argument to strerror

process_command returns a negative value in case of error.  Make this
clear in the "if" statement and fix the strerror argument to flip it
to positive.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agoblock: remove dead check
Paolo Bonzini [Wed, 4 Jan 2017 14:59:14 +0000 (15:59 +0100)]
block: remove dead check

options must be non-NULL here, because a NULL value is replaced with
qdict_new earlier in the function.  Reported by Coverity.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agopci-assign: avoid pointless stat
Paolo Bonzini [Wed, 4 Jan 2017 15:05:25 +0000 (16:05 +0100)]
pci-assign: avoid pointless stat

Just check the errno value after fopen and follow it with fstat.
This shuts up Coverity's complaint about TOC/TOU violation.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agoqemu-img: remove dead check
Paolo Bonzini [Wed, 4 Jan 2017 14:56:24 +0000 (15:56 +0100)]
qemu-img: remove dead check

options must be non-NULL here, because it has been checked before.
Reported by Coverity.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agopcie: fix typo in comments
Cao jin [Fri, 11 Nov 2016 03:02:48 +0000 (11:02 +0800)]
pcie: fix typo in comments

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agoobject: make some funcs static
Marc-André Lureau [Mon, 12 Dec 2016 17:31:51 +0000 (20:31 +0300)]
object: make some funcs static

There is no need to have those functions as public API.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agoobject.h: spelling fix
Marc-André Lureau [Mon, 12 Dec 2016 17:31:49 +0000 (20:31 +0300)]
object.h: spelling fix

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agousb: Fix typo in documentation
Frediano Ziglio [Wed, 7 Dec 2016 16:00:37 +0000 (16:00 +0000)]
usb: Fix typo in documentation

simliar -> similar

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agoqemu-options: cleanup duplicated help message for kernel_irqchip
Po-Hsu Lin [Tue, 29 Nov 2016 03:34:22 +0000 (11:34 +0800)]
qemu-options: cleanup duplicated help message for kernel_irqchip

Remove the duplicated help message for 'kernel_irqchip'.

Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agohw: Fix typos found by codespell
Stefan Weil [Sat, 19 Nov 2016 19:29:26 +0000 (20:29 +0100)]
hw: Fix typos found by codespell

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Acked-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agoinclude: Fix typos found by codespell
Stefan Weil [Sat, 19 Nov 2016 19:47:15 +0000 (20:47 +0100)]
include: Fix typos found by codespell

Add also a missing parenthesis in a comment.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Acked-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agoFix documentation and some comments (article, grammar)
Stefan Weil [Sat, 19 Nov 2016 19:22:07 +0000 (20:22 +0100)]
Fix documentation and some comments (article, grammar)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agoREADME: Add linux to macOS build info
Peter Maydell [Mon, 31 Oct 2016 17:01:30 +0000 (17:01 +0000)]
README: Add linux to macOS build info

The README lists the URLs for the wiki pages describing
how to build on Linux and Windows; add the equivalent
link for building on macOS.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agohw/block/m25p80: Fix typo in local macro name
Stefan Weil [Tue, 1 Nov 2016 17:03:02 +0000 (18:03 +0100)]
hw/block/m25p80: Fix typo in local macro name

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
7 years agodoc: don't mention -memory, it is -m
Michael Tokarev [Thu, 10 Nov 2016 14:51:32 +0000 (17:51 +0300)]
doc: don't mention -memory, it is -m

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
7 years agoMerge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20170124b' into...
Peter Maydell [Tue, 24 Jan 2017 19:25:19 +0000 (19:25 +0000)]
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20170124b' into staging

Migration

1 My maintainer change
2 Jianjun's qtailq
3 Ashijeet's only-migratable
4 Zhanghailiang's re-active images
5 Pankaj's change name of migration thread
6 My PCI migration merge
7 Juan's debug to tracing
8 My tracing on save

# gpg: Signature made Tue 24 Jan 2017 18:39:35 GMT
# gpg:                using RSA key 0x0516331EBC5BFDE7
# gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A  9FA9 0516 331E BC5B FDE7

* remotes/dgilbert/tags/pull-migration-20170124b:
  migration/tracing: Add tracing on save
  migration: transform remaining DPRINTF into trace_
  PCI/migration merge vmstate_pci_device and vmstate_pcie_device
  migration: Change name of live migration thread
  migration: re-active images while migration been canceled after inactive them
  migration: Fail migration blocker for --only-migratable
  migration: disallow migrate_add_blocker during migration
  migration: Allow "device add" options to only add migratable devices
  migration: Add a new option to enable only-migratable
  block/vvfat: Remove the undesirable comment
  migration: add error_report
  tests/migration: Add test for QTAILQ migration
  migration: migrate QTAILQ
  migration: extend VMStateInfo
  MAINTAINERS: Add myself as a migration submaintainer

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agomigration/tracing: Add tracing on save
Dr. David Alan Gilbert [Mon, 12 Dec 2016 12:58:38 +0000 (12:58 +0000)]
migration/tracing: Add tracing on save

Add some tracing to vmstate_subsection_save and vmstate_save_state
to help in debugging when you're not sure if a conditional piece
of data is being saved.

In vmstate_subsection_save I renamed the inner vmsd to avoid the aliasing
and be able to print both names.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20161212125838.14425-1-dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agomigration: transform remaining DPRINTF into trace_
Juan Quintela [Mon, 23 Jan 2017 21:32:05 +0000 (22:32 +0100)]
migration: transform remaining DPRINTF into trace_

So we can remove DPRINTF() macro

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <1485207141-1941-2-git-send-email-quintela@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  Fixed up 'remained/remaining' as requested by Eric

7 years agoPCI/migration merge vmstate_pci_device and vmstate_pcie_device
Dr. David Alan Gilbert [Wed, 14 Dec 2016 19:58:29 +0000 (19:58 +0000)]
PCI/migration merge vmstate_pci_device and vmstate_pcie_device

The vmstate_pci_device and vmstate_pcie_devices differ
just in the size of one buffer; combine the two using a _TEST
macro.

I think this is safe as long as everywhere which currently
uses either of these two uses the right type.

One thing that concerns me is that some places use pci_device_load/save
which does some irq mangling, but others just use the VMSTATE_PCI_DEVICE
macro - how are they getting the same irq mangling?

This passes a smoke test migrate of:
./x86_64-softmmu/qemu-system-x86_64 -M pc,accel=kvm -m 1024
./littlefed20.img -device e1000e -device virtio-net -device
e1000 -device virtio-rng -device megasas -device megasas-gen2 -device
ioh3420 -device nec-usb-xhci

to an unmodified qemu.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20161214195829.18241-1-dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agomigration: Change name of live migration thread
Pankaj Gupta [Mon, 23 Jan 2017 13:42:56 +0000 (19:12 +0530)]
migration: Change name of live migration thread

Change the name of live migration thread from 'migration'
to 'live_migration' to identify it clearly. 'migration'
is a generic word and kernel also has  tasks for process
migration with the name 'migration/cpu#'.

Signed-off-by: Pankaj Gupta <pagupta@redhat.com>
Message-Id: <1485178976-15225-1-git-send-email-pagupta@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agomigration: re-active images while migration been canceled after inactive them
zhanghailiang [Tue, 24 Jan 2017 07:59:52 +0000 (15:59 +0800)]
migration: re-active images while migration been canceled after inactive them

commit fe904ea8242cbae2d7e69c052c754b8f5f1ba1d6 fixed a case
which migration aborted QEMU because it didn't regain the control
of images while some errors happened.

Actually, there are another two cases can trigger the same error reports:
" bdrv_co_do_pwritev: Assertion `!(bs->open_flags & 0x0800)' failed",

Case 1, codes path:
migration_thread()
    migration_completion()
        bdrv_inactivate_all() ----------------> inactivate images
        qemu_savevm_state_complete_precopy()
            socket_writev_buffer() --------> error because destination fails
                qemu_fflush() ----------------> set error on migration stream
-> qmp_migrate_cancel() ----------------> user cancelled migration concurrently
    -> migrate_set_state() ------------------> set migrate CANCELLIN
    migration_completion() -----------------> go on to fail_invalidate
if (s->state == MIGRATION_STATUS_ACTIVE) -> Jump this branch

Case 2, codes path:
migration_thread()
    migration_completion()
        bdrv_inactivate_all() ----------------> inactivate images
    migreation_completion() finished
-> qmp_migrate_cancel() ---------------> user cancelled migration concurrently
    qemu_mutex_lock_iothread();
    qemu_bh_schedule (s->cleanup_bh);

As we can see from above, qmp_migrate_cancel can slip in whenever
migration_thread does not hold the global lock. If this happens after
bdrv_inactive_all() been called, the above error reports will appear.

To prevent this, we can call bdrv_invalidate_cache_all() in qmp_migrate_cancel()
directly if we find images become inactive.

Besides, bdrv_invalidate_cache_all() in migration_completion() doesn't have the
protection of big lock, fix it by add the missing qemu_mutex_lock_iothread();

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Message-Id: <1485244792-11248-1-git-send-email-zhang.zhanghailiang@huawei.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agomigration: Fail migration blocker for --only-migratable
Ashijeet Acharya [Mon, 16 Jan 2017 11:31:54 +0000 (17:01 +0530)]
migration: Fail migration blocker for --only-migratable

migrate_add_blocker should rightly fail if the '--only-migratable'
option was specified and the device in use should not be able to
perform the action which results in an unmigratable VM.

Make migrate_add_blocker return -EACCES in this case.

Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com>
Message-Id: <1484566314-3987-6-git-send-email-ashijeetacharya@gmail.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agomigration: disallow migrate_add_blocker during migration
Ashijeet Acharya [Mon, 16 Jan 2017 11:31:53 +0000 (17:01 +0530)]
migration: disallow migrate_add_blocker during migration

If a migration is already in progress and somebody attempts
to add a migration blocker, this should rightly fail.

Add an errp parameter and a retcode return value to migrate_add_blocker.

Signed-off-by: John Snow <jsnow@redhat.com>
Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com>
Message-Id: <1484566314-3987-5-git-send-email-ashijeetacharya@gmail.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Acked-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  Merged with recent 'Allow invtsc migration' change

7 years agomigration: Allow "device add" options to only add migratable devices
Ashijeet Acharya [Mon, 16 Jan 2017 11:31:52 +0000 (17:01 +0530)]
migration: Allow "device add" options to only add migratable devices

Introduce checks for the unmigratable flag in the VMStateDescription
structs of respective devices when user attempts to add them. If the
"--only-migratable" was specified, all unmigratable devices will
rightly fail to add. This feature is made compatible for both "-device"
and "-usbdevice" command line options and covers their hmp and qmp
counterparts as well.

Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com>
Message-Id: <1484566314-3987-4-git-send-email-ashijeetacharya@gmail.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agomigration: Add a new option to enable only-migratable
Ashijeet Acharya [Mon, 16 Jan 2017 11:31:51 +0000 (17:01 +0530)]
migration: Add a new option to enable only-migratable

Add a new option "--only-migratable" in qemu which will allow to add
only those devices which will not fail qemu after migration. Devices
set with the flag 'unmigratable' cannot be added when this option will
be used.

Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com>
Message-Id: <1484566314-3987-3-git-send-email-ashijeetacharya@gmail.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoblock/vvfat: Remove the undesirable comment
Ashijeet Acharya [Mon, 16 Jan 2017 11:31:50 +0000 (17:01 +0530)]
block/vvfat: Remove the undesirable comment

Remove the "// assert(is_consistent(s))" comment in block/vvfat.c

Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com>
Message-Id: <1484566314-3987-2-git-send-email-ashijeetacharya@gmail.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agomigration: add error_report
Jianjun Duan [Thu, 19 Jan 2017 19:00:53 +0000 (11:00 -0800)]
migration: add error_report

Added error_report where version_ids do not match in vmstate_load_state.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Jianjun Duan <duanj@linux.vnet.ibm.com>
Message-Id: <1484852453-12728-5-git-send-email-duanj@linux.vnet.ibm.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agotests/migration: Add test for QTAILQ migration
Jianjun Duan [Thu, 19 Jan 2017 19:00:52 +0000 (11:00 -0800)]
tests/migration: Add test for QTAILQ migration

Add a test for QTAILQ migration to tests/test-vmstate.c.

Signed-off-by: Jianjun Duan <duanj@linux.vnet.ibm.com>
Message-Id: <1484852453-12728-4-git-send-email-duanj@linux.vnet.ibm.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agomigration: migrate QTAILQ
Jianjun Duan [Thu, 19 Jan 2017 19:00:51 +0000 (11:00 -0800)]
migration: migrate QTAILQ

Currently we cannot directly transfer a QTAILQ instance because of the
limitation in the migration code. Here we introduce an approach to
transfer such structures. We created VMStateInfo vmstate_info_qtailq
for QTAILQ. Similar VMStateInfo can be created for other data structures
such as list.

When a QTAILQ is migrated from source to target, it is appended to the
corresponding QTAILQ structure, which is assumed to have been properly
initialized.

This approach will be used to transfer pending_events and ccs_list in spapr
state.

We also create some macros in qemu/queue.h to access a QTAILQ using pointer
arithmetic. This ensures that we do not depend on the implementation
details about QTAILQ in the migration code.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Jianjun Duan <duanj@linux.vnet.ibm.com>
Message-Id: <1484852453-12728-3-git-send-email-duanj@linux.vnet.ibm.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agomigration: extend VMStateInfo
Jianjun Duan [Thu, 19 Jan 2017 19:00:50 +0000 (11:00 -0800)]
migration: extend VMStateInfo

Current migration code cannot handle some data structures such as
QTAILQ in qemu/queue.h. Here we extend the signatures of put/get
in VMStateInfo so that customized handling is supported. put now
will return int type.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Jianjun Duan <duanj@linux.vnet.ibm.com>
Message-Id: <1484852453-12728-2-git-send-email-duanj@linux.vnet.ibm.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoMAINTAINERS: Add myself as a migration submaintainer
Dr. David Alan Gilbert [Tue, 24 Jan 2017 10:04:37 +0000 (10:04 +0000)]
MAINTAINERS: Add myself as a migration submaintainer

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20170124100437.18200-1-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoMerge remote-tracking branch 'remotes/cohuck/tags/s390x-20170124' into staging
Peter Maydell [Tue, 24 Jan 2017 17:26:26 +0000 (17:26 +0000)]
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20170124' into staging

Two s390x fixes: One for the kvm.c build failure, and one for a bug
that might cause random guest crashes with zeroed out pages on host
kernels with working cmma (< 4.6 and likely >= 4.10).

# gpg: Signature made Tue 24 Jan 2017 15:00:50 GMT
# gpg:                using RSA key 0xDECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>"
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20170124:
  s390x/kvm: fix cmma reset for KVM
  s390x/kvm: include hw_accel.h instead of kvm.h

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/ehabkost/tags/x86-and-machine-pull-request...
Peter Maydell [Tue, 24 Jan 2017 15:39:09 +0000 (15:39 +0000)]
Merge remote-tracking branch 'remotes/ehabkost/tags/x86-and-machine-pull-request' into staging

x86, machine, numa queue (2017-01-23)

# gpg: Signature made Mon 23 Jan 2017 23:26:59 GMT
# gpg:                using RSA key 0x2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/x86-and-machine-pull-request:
  kvm: Allow invtsc migration if tsc-khz is set explicitly
  kvm: Simplify invtsc check
  hw/core/null-machine: Add the possibility to instantiate a CPU and RAM
  qemu-options: Rename variables on the -numa "cpus" option
  MAINTAINERS: Add an entry for hw/core/null-machine.c
  machine: Make possible_cpu_arch_ids() return const pointer
  pc: don't return cpu pointer from pc_new_cpu() as it's not needed anymore
  pc: cleanup: move smbios_set_cpuid() into pc_build_smbios()
  arch_init: Remove unnecessary default_config_files table
  vl: Ensure the numa_post_machine_init func in the appropriate location
  i386: Return migration-safe field on query-cpu-definitions
  i386: Remove AMD feature flag aliases from Opteron models
  x86: add AVX512_VPOPCNTDQ features

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agos390x/kvm: fix cmma reset for KVM
Christian Borntraeger [Tue, 24 Jan 2017 13:28:13 +0000 (14:28 +0100)]
s390x/kvm: fix cmma reset for KVM

We must reset the CMMA states for normal memory (when not on mem path),
but the current code does the opposite. This was unnoticed for some time
as the kernel since 4.6 also had a bug which mostly disabled the paging
optimizations.

Fixes: 07059effd14e ("s390x/kvm: let the CPU model control CMM(A)")
Cc: qemu-stable@nongnu.org # v2.8
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agos390x/kvm: include hw_accel.h instead of kvm.h
Cornelia Huck [Tue, 24 Jan 2017 09:18:02 +0000 (10:18 +0100)]
s390x/kvm: include hw_accel.h instead of kvm.h

Commit b394662 ("kvm: move cpu synchronization code") switched
to hw_accel.h instead of kvm.h, but missed s390x, resulting in

  CC      s390x-softmmu/target/s390x/kvm.o
/home/cohuck/git/qemu/target/s390x/kvm.c: In function ‘kvm_sclp_service_call’:
/home/cohuck/git/qemu/target/s390x/kvm.c:1034:5: error: implicit declaration of function ‘cpu_synchronize_state’ [-Werror=implicit-function-declaration]
     cpu_synchronize_state(CPU(cpu));
     ^
/home/cohuck/git/qemu/target/s390x/kvm.c:1034:5: error: nested extern declaration of ‘cpu_synchronize_state’ [-Werror=nested-externs]
/home/cohuck/git/qemu/target/s390x/kvm.c: In function ‘sigp_initial_cpu_reset’:
/home/cohuck/git/qemu/target/s390x/kvm.c:1628:5: error: implicit declaration of function ‘cpu_synchronize_post_reset’ [-Werror=implicit-function-declaration]
     cpu_synchronize_post_reset(cs);
     ^
/home/cohuck/git/qemu/target/s390x/kvm.c:1628:5: error: nested extern declaration of ‘cpu_synchronize_post_reset’ [-Werror=nested-externs]
/home/cohuck/git/qemu/target/s390x/kvm.c: In function ‘sigp_set_prefix’:
/home/cohuck/git/qemu/target/s390x/kvm.c:1665:5: error: implicit declaration of function ‘cpu_synchronize_post_init’ [-Werror=implicit-function-declaration]
     cpu_synchronize_post_init(cs);
     ^
/home/cohuck/git/qemu/target/s390x/kvm.c:1665:5: error: nested extern declaration of ‘cpu_synchronize_post_init’ [-Werror=nested-externs]
cc1: all warnings being treated as errors
/home/cohuck/git/qemu/rules.mak:64: recipe for target 'target/s390x/kvm.o' failed

Fix this.

Fixes: b394662 ("kvm: move cpu synchronization code")
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Vincent Palatin <vpalatin@chromium.org>
7 years agoMakefile: Add qemu-doc.txt to distclean and dependencies
Peter Maydell [Tue, 24 Jan 2017 14:02:18 +0000 (14:02 +0000)]
Makefile: Add qemu-doc.txt to distclean and dependencies

When qemu-doc.txt was added as a new output format in
commit f8bab10b4c3f, it was not added to either the
list of files to remove in distclean or to the dependency
line that forces qemu-options.texi to be built before
attempting to build qemu-doc.*.

In particular, the missing dependency meant that on
some platforms (notably OSX hosts) we would try to
build qemu-doc.txt before qemu-options.texi had been
fully written out, and then makeinfo would complain
about missing cross-reference targets.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1485266538-10119-1-git-send-email-peter.maydell@linaro.org
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-hppa-20170123' into staging
Peter Maydell [Tue, 24 Jan 2017 09:52:42 +0000 (09:52 +0000)]
Merge remote-tracking branch 'remotes/rth/tags/pull-hppa-20170123' into staging

hppa-linux target support

# gpg: Signature made Mon 23 Jan 2017 17:54:09 GMT
# gpg:                using RSA key 0xAD1270CC4DD0279B
# gpg: Good signature from "Richard Henderson <rth7680@gmail.com>"
# gpg:                 aka "Richard Henderson <rth@redhat.com>"
# gpg:                 aka "Richard Henderson <rth@twiddle.net>"
# Primary key fingerprint: 9CB1 8DDA F8E8 49AD 2AFC  16A4 AD12 70CC 4DD0 279B

* remotes/rth/tags/pull-hppa-20170123: (25 commits)
  target-hppa: Implement floating-point insns
  target-hppa: Implement system and memory-management insns
  target-hppa: Implement loads and stores
  target-hppa: Implement shifts and deposits
  target-hppa: Implement linux-user gateway page
  target-hppa: Implement branches
  target-hppa: Implement basic arithmetic
  target-hppa: Add nullification framework
  target-hppa: Add framework and enable compilation
  target-hppa: Add softfloat specializations
  linux-user: Add HPPA startup and main loop
  linux-user: Add HPPA signal handling
  linux-user: Add HPPA target_signal.h and target_cpu.h
  linux-user: Add HPPA target_structs.h
  linux-user: Add HPPA definitions to syscall_defs.h
  linux-user: Add HPPA target_syscall.h
  linux-user: Add HPPA termbits.h
  linux-user: Add HPPA syscall numbers
  linux-user: Add HPPA socket.h definitions
  linux-user: Add some hppa ioctls
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agokvm: Allow invtsc migration if tsc-khz is set explicitly
Eduardo Habkost [Sun, 8 Jan 2017 17:32:34 +0000 (15:32 -0200)]
kvm: Allow invtsc migration if tsc-khz is set explicitly

We can safely allow a VM to be migrated with invtsc enabled if
tsc-khz is set explicitly, because:
* QEMU already refuses to start if it can't set the TSC frequency
  to the configured value.
* Management software is already required to keep device
  configuration (including CPU configuration) the same on
  migration source and destination.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170108173234.25721-3-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7 years agokvm: Simplify invtsc check
Eduardo Habkost [Sun, 8 Jan 2017 17:32:33 +0000 (15:32 -0200)]
kvm: Simplify invtsc check

Instead of searching the table we have just built, we can check
the env->features field directly.

Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170108173234.25721-2-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7 years agohw/core/null-machine: Add the possibility to instantiate a CPU and RAM
Thomas Huth [Wed, 18 Jan 2017 12:44:50 +0000 (13:44 +0100)]
hw/core/null-machine: Add the possibility to instantiate a CPU and RAM

Sometimes it is useful to have just a machine with CPU and RAM, without
any further hardware in it, e.g. if you just want to do some instruction
debugging for TCG with a remote GDB attached to QEMU, or run some embedded
code with the "-semihosting" QEMU parameter. qemu-system-m68k already
features a "dummy" machine, and xtensa a "sim" machine for exactly this
purpose.
All target architectures have nowadays also a "none" machine, which would
be a perfect match for this, too - but it currently does not allow to add
CPU and RAM yet. Thus let's add these possibilities in a generic way to the
"none" machine, too, so that we hopefully do not need additional "dummy"
machines in the future anymore (and maybe can also get rid of the already
existing "dummy"/"sim" machines one day).
Note that the default behaviour of the "none" machine is not changed, i.e.
no CPU and no RAM is instantiated by default. You have explicitely got to
specify the CPU model with "-cpu" and the amount of RAM with "-m" to get
these new features.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1484743490-24721-1-git-send-email-thuth@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7 years agoqemu-options: Rename variables on the -numa "cpus" option
Eduardo Habkost [Mon, 23 Jan 2017 18:06:31 +0000 (16:06 -0200)]
qemu-options: Rename variables on the -numa "cpus" option

Use @var{firstcpu} and @var{lastcpu} to make the metasyntatic
variables a bit clearer. While doing this, use @var only around
the metasyntatic variables, not including the square brackets and
hyphen.

The semantics of the "cpus" option will be clarified by rewriting
the whole -numa documentation in a follow-up patch.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170123180632.28942-2-ehabkost@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7 years agoMAINTAINERS: Add an entry for hw/core/null-machine.c
Thomas Huth [Mon, 23 Jan 2017 05:54:55 +0000 (06:54 +0100)]
MAINTAINERS: Add an entry for hw/core/null-machine.c

The "Machine core" section sounds like a good match for this file.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1485150895-19753-1-git-send-email-thuth@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7 years agomachine: Make possible_cpu_arch_ids() return const pointer
Igor Mammedov [Wed, 18 Jan 2017 17:13:20 +0000 (18:13 +0100)]
machine: Make possible_cpu_arch_ids() return const pointer

make sure that external callers won't try to modify
possible_cpus and owner of possible_cpus can access
it directly when it modifies it.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <1484759609-264075-5-git-send-email-imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7 years agopc: don't return cpu pointer from pc_new_cpu() as it's not needed anymore
Igor Mammedov [Wed, 18 Jan 2017 17:13:19 +0000 (18:13 +0100)]
pc: don't return cpu pointer from pc_new_cpu() as it's not needed anymore

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <1484759609-264075-4-git-send-email-imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7 years agopc: cleanup: move smbios_set_cpuid() into pc_build_smbios()
Igor Mammedov [Wed, 18 Jan 2017 17:13:18 +0000 (18:13 +0100)]
pc: cleanup: move smbios_set_cpuid() into pc_build_smbios()

move smbios_set_cpuid() close to the rest of smbios init code
where it belongs to instead of calling it from pc_cpus_init().

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <1484759609-264075-3-git-send-email-imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7 years agoarch_init: Remove unnecessary default_config_files table
Eduardo Habkost [Tue, 17 Jan 2017 18:00:51 +0000 (16:00 -0200)]
arch_init: Remove unnecessary default_config_files table

The existing default_config_files table in arch_init.c has a
single entry, making it completely unnecessary. The whole code
can be replaced by a single qemu_read_config_file() call in vl.c.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170117180051.11958-1-ehabkost@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7 years agovl: Ensure the numa_post_machine_init func in the appropriate location
Dou Liyang [Tue, 17 Jan 2017 14:42:31 +0000 (22:42 +0800)]
vl: Ensure the numa_post_machine_init func in the appropriate location

In the numa_post_machine_init(), we use CPU_FOREACH macro to set all
CPUs' namu_node. So, we should make sure that we call it after Qemu
has already initialied all the CPUs.

As we all know, the CPUs can be created by "-smp"(pc_new_cpu) or
"-device"(qdev_device_add) command. But, before the device init,
Qemu execute the numa_post_machine_init earlier. It makes the mapping
of NUMA nodes and CPUs incorrect.

The patch move the numa_post_machine_init func in the appropriate
location.

Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Message-Id: <1484664152-24446-2-git-send-email-douly.fnst@cn.fujitsu.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7 years agoi386: Return migration-safe field on query-cpu-definitions
Eduardo Habkost [Mon, 16 Jan 2017 18:12:12 +0000 (16:12 -0200)]
i386: Return migration-safe field on query-cpu-definitions

Return the migration-safe field on query-cpu-definitions. All CPU
models in x86 are migration-safe except "host".

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170116181212.31565-1-ehabkost@redhat.com>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7 years agoi386: Remove AMD feature flag aliases from Opteron models
Eduardo Habkost [Fri, 13 Jan 2017 19:00:57 +0000 (17:00 -0200)]
i386: Remove AMD feature flag aliases from Opteron models

When CPU vendor is set to AMD, the AMD feature alias bits on
CPUID[0x80000001].EDX are already automatically copied from CPUID[1].EDX
on x86_cpu_realizefn(). When CPU vendor is Intel, those bits are
reserved and should be zero. On either case, those bits shouldn't be set
in the CPU model table.

Commit 726a8ff68677d8d5fba17eb0ffb85076bfb598dc removed those
bits from most CPU models, but the Opteron_* entries still have
them. Remove the alias bits from Opteron_* too.

Add an assert() to x86_register_cpudef_type() to ensure we don't
make the same mistake again.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170113190057.6327-1-ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7 years agox86: add AVX512_VPOPCNTDQ features
He Chen [Fri, 13 Jan 2017 01:53:31 +0000 (09:53 +0800)]
x86: add AVX512_VPOPCNTDQ features

AVX512_VPOPCNTDQ: Vector POPCNT instructions for word and qwords.
variable precision.

Signed-off-by: He Chen <he.chen@linux.intel.com>
Message-Id: <1484272411-28073-1-git-send-email-he.chen@linux.intel.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
7 years agotarget-hppa: Implement floating-point insns
Richard Henderson [Thu, 15 Dec 2016 23:04:19 +0000 (15:04 -0800)]
target-hppa: Implement floating-point insns

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agotarget-hppa: Implement system and memory-management insns
Richard Henderson [Thu, 15 Dec 2016 22:59:03 +0000 (14:59 -0800)]
target-hppa: Implement system and memory-management insns

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agotarget-hppa: Implement loads and stores
Richard Henderson [Thu, 15 Dec 2016 22:54:51 +0000 (14:54 -0800)]
target-hppa: Implement loads and stores

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agotarget-hppa: Implement shifts and deposits
Richard Henderson [Thu, 15 Dec 2016 22:04:13 +0000 (14:04 -0800)]
target-hppa: Implement shifts and deposits

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agotarget-hppa: Implement linux-user gateway page
Richard Henderson [Thu, 15 Dec 2016 21:55:46 +0000 (13:55 -0800)]
target-hppa: Implement linux-user gateway page

For linux, page 0 is mapped as an execute-only gateway.  A gateway
page is a special bit in the page table that allows a B,GATE insn
within that page to raise processor permissions.  This is how system
calls are implemented for HPPA.

Rather than actually map anything here, or handle permissions at all,
implement the semantics of the actual linux syscall entry points.

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agotarget-hppa: Implement branches
Richard Henderson [Thu, 15 Dec 2016 21:50:28 +0000 (13:50 -0800)]
target-hppa: Implement branches

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agotarget-hppa: Implement basic arithmetic
Richard Henderson [Thu, 15 Dec 2016 21:37:23 +0000 (13:37 -0800)]
target-hppa: Implement basic arithmetic

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agotarget-hppa: Add nullification framework
Richard Henderson [Thu, 15 Dec 2016 19:58:17 +0000 (11:58 -0800)]
target-hppa: Add nullification framework

The HPPA cpu has a unique form of predicated execution in which
almost any instruction can set the PSW[N] (or "nullify") bit,
which suppresses execution (and even decoding) of the following
instruction.  Execution of a nullified insn clears the PSW[N] bit.

This adds a generic framework for branching over nullified insns,
or for sufficiently simple insns, transforming the writeback of
the result to a conditional move.  In the process, we want to be
able to represent PSW[N] as a TCG condition, which implies management
of the related tcg temps.

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agotarget-hppa: Add framework and enable compilation
Richard Henderson [Thu, 15 Dec 2016 19:26:14 +0000 (11:26 -0800)]
target-hppa: Add framework and enable compilation

This is just about the minimum required to enable compilation
without actually executing any instructions.  This contains the
HPPACPU structure and the required callbacks, the gdbstub, the
basic translation loop, and a translate_one function that always
results in an illegal instruction.

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agotarget-hppa: Add softfloat specializations
Richard Henderson [Thu, 15 Dec 2016 18:46:40 +0000 (10:46 -0800)]
target-hppa: Add softfloat specializations

Like the original MIPS, HPPA has the MSB of an SNaN set.
However, it has different rules for silencing an SNaN:
(1) msb is cleared and (2) msb-1 must be set if the fraction
is now zero, and (implementation defined) may be set always.
I haven't checked real hardware but chose the set always
alternative because it's easy and within spec.

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agolinux-user: Add HPPA startup and main loop
Richard Henderson [Thu, 15 Dec 2016 18:01:00 +0000 (10:01 -0800)]
linux-user: Add HPPA startup and main loop

Including support for the atomic memory op syscalls.

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agolinux-user: Add HPPA signal handling
Richard Henderson [Thu, 15 Dec 2016 17:59:01 +0000 (09:59 -0800)]
linux-user: Add HPPA signal handling

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agolinux-user: Add HPPA target_signal.h and target_cpu.h
Richard Henderson [Thu, 15 Dec 2016 17:58:14 +0000 (09:58 -0800)]
linux-user: Add HPPA target_signal.h and target_cpu.h

The cpu.h structure that these manipulate hasn't been defined
yet, but we haven't enabled compilation yet either.

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agolinux-user: Add HPPA target_structs.h
Richard Henderson [Thu, 15 Dec 2016 17:57:04 +0000 (09:57 -0800)]
linux-user: Add HPPA target_structs.h

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agolinux-user: Add HPPA definitions to syscall_defs.h
Richard Henderson [Thu, 15 Dec 2016 17:56:41 +0000 (09:56 -0800)]
linux-user: Add HPPA definitions to syscall_defs.h

7 years agolinux-user: Add HPPA target_syscall.h
Richard Henderson [Thu, 15 Dec 2016 17:55:12 +0000 (09:55 -0800)]
linux-user: Add HPPA target_syscall.h

Which is primarily a re-definition of errno numbers.

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agolinux-user: Add HPPA termbits.h
Richard Henderson [Thu, 15 Dec 2016 17:54:13 +0000 (09:54 -0800)]
linux-user: Add HPPA termbits.h

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agolinux-user: Add HPPA syscall numbers
Richard Henderson [Thu, 15 Dec 2016 17:53:28 +0000 (09:53 -0800)]
linux-user: Add HPPA syscall numbers

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agolinux-user: Add HPPA socket.h definitions
Richard Henderson [Thu, 15 Dec 2016 17:49:25 +0000 (09:49 -0800)]
linux-user: Add HPPA socket.h definitions

Split this out into a "cpu/sockbits.h" file now,
like we ought to do for all of the other targets.

Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agolinux-user: Add some hppa ioctls
Helge Deller [Wed, 7 Dec 2016 19:32:58 +0000 (11:32 -0800)]
linux-user: Add some hppa ioctls

Add F_GETLK, F_SETLK, F_SETLKW, F_GETOWN, F_SETOWN, F_SETSIG, F_GETSIG,
F_GETLK64, F_SETLK64 and F_SETLKW64 for hppa.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
7 years agoMerge remote-tracking branch 'remotes/berrange/tags/pull-qio-2017-01-23-2' into staging
Peter Maydell [Mon, 23 Jan 2017 15:59:09 +0000 (15:59 +0000)]
Merge remote-tracking branch 'remotes/berrange/tags/pull-qio-2017-01-23-2' into staging

Merge io/ 2017-01-23

# gpg: Signature made Mon 23 Jan 2017 15:56:14 GMT
# gpg:                using RSA key 0xBE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>"
# gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>"
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF

* remotes/berrange/tags/pull-qio-2017-01-23-2:
  io: introduce a DNS resolver API
  io: remove Error parameter from QIOTask thread worker
  io: change the QIOTask callback signature
  io: add ability to associate an error with a task
  io: add ability to associate an opaque "result" with with a task
  io: fix typo in docs for QIOTask
  io: stop incrementing reference in qio_task_get_source
  sockets: add ability to disable DNS resolution for InetSocketAddress

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoio: introduce a DNS resolver API
Daniel P. Berrange [Tue, 19 Jul 2016 11:54:47 +0000 (12:54 +0100)]
io: introduce a DNS resolver API

Currently DNS resolution is done automatically as part
of the creation of a QIOChannelSocket object instance.
This works ok for network clients where you just end
up a single network socket, but for servers, the results
of DNS resolution may require creation of multiple
sockets.

Introducing a DNS resolver API allows DNS resolution
to be separated from the socket object creation. This
will make it practical to create multiple QIOChannelSocket
instances for servers.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoio: remove Error parameter from QIOTask thread worker
Daniel P. Berrange [Thu, 11 Aug 2016 16:38:07 +0000 (17:38 +0100)]
io: remove Error parameter from QIOTask thread worker

Now that task objects have a directly associated error,
there's no need for an an Error **errp parameter to
the QIOTask thread worker function. It already has a
QIOTask object, so can directly set the error on it.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoio: change the QIOTask callback signature
Daniel P. Berrange [Thu, 11 Aug 2016 14:20:58 +0000 (15:20 +0100)]
io: change the QIOTask callback signature

Currently the QIOTaskFunc signature takes an Object * for
the source, and an Error * for any error. We also need to
be able to provide a result pointer. Rather than continue
to add parameters to QIOTaskFunc, remove the existing
ones and simply pass the QIOTask object instead. This
has methods to access all the other data items required
in the callback impl.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>