OSDN Git Service

qmiga/qemu.git
6 years agoblock: avoid recursive AioContext acquire in bdrv_inactivate_all()
Paolo Bonzini [Thu, 7 Dec 2017 20:13:15 +0000 (20:13 +0000)]
block: avoid recursive AioContext acquire in bdrv_inactivate_all()

BDRV_POLL_WHILE() does not support recursive AioContext locking.  It
only releases the AioContext lock once regardless of how many times the
caller has acquired it.  This results in a hang since the IOThread does
not make progress while the AioContext is still locked.

The following steps trigger the hang:

  $ qemu-system-x86_64 -M accel=kvm -m 1G -cpu host \
                       -object iothread,id=iothread0 \
                       -device virtio-scsi-pci,iothread=iothread0 \
                       -drive if=none,id=drive0,file=test.img,format=raw \
                       -device scsi-hd,drive=drive0 \
                       -drive if=none,id=drive1,file=test.img,format=raw \
                       -device scsi-hd,drive=drive1
  $ qemu-system-x86_64 ...same options... \
                       -incoming tcp::1234
  (qemu) migrate tcp:127.0.0.1:1234
  ...hang...

Tested-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20171207201320.19284-2-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agovirtio-blk: reject configs with logical block size > physical block size
Mark Kanda [Mon, 11 Dec 2017 15:16:25 +0000 (09:16 -0600)]
virtio-blk: reject configs with logical block size > physical block size

virtio-blk logical block size should never be larger than physical block
size because it doesn't make sense to have such configurations. QEMU doesn't
have a way to effectively express this condition; the best it can do is
report the physical block exponent as 0 - indicating the logical block size
equals the physical block size.

This is identical to commit 3da023b5827543ee4c022986ea2ad9d1274410b2
but applied to virtio-blk (instead of virtio-scsi).

Signed-off-by: Mark Kanda <mark.kanda@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Ameya More <ameya.more@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 773169891f9f2deb4cb7c4ef2655580dbe24c1d1.1513005190.git.mark.kanda@oracle.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agovirtio-blk: make queue size configurable
Mark Kanda [Mon, 11 Dec 2017 15:16:24 +0000 (09:16 -0600)]
virtio-blk: make queue size configurable

Depending on the configuration, it can be beneficial to adjust the virtio-blk
queue size to something other than the current default of 128. Add a new
property to make the queue size configurable.

Signed-off-by: Mark Kanda <mark.kanda@oracle.com>
Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Ameya More <ameya.more@oracle.com>
Message-id: 52e6d742811f10dbd16e996e86cf375b9577c187.1513005190.git.mark.kanda@oracle.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agoqemu-iotests: add 202 external snapshots IOThread test
Stefan Hajnoczi [Wed, 6 Dec 2017 14:45:50 +0000 (14:45 +0000)]
qemu-iotests: add 202 external snapshots IOThread test

QMP 'transaction' blockdev-snapshot-sync with multiple disks in an
IOThread is an untested code path.  Several bugs have been found in
connection with this command.  This patch adds a test case to prevent
future regressions.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20171206144550.22295-10-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agoblockdev: add x-blockdev-set-iothread testing command
Stefan Hajnoczi [Wed, 6 Dec 2017 14:45:49 +0000 (14:45 +0000)]
blockdev: add x-blockdev-set-iothread testing command

Currently there is no easy way for iotests to ensure that a BDS is bound
to a particular IOThread.  Normally the virtio-blk device calls
blk_set_aio_context() when dataplane is enabled during guest driver
initialization.  This never happens in iotests since -machine
accel=qtest means there is no guest activity (including device driver
initialization).

This patch adds a QMP command to explicitly assign IOThreads in test
cases.  See qapi/block-core.json for a description of the command.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20171206144550.22295-9-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agoiothread: add iothread_by_id() API
Stefan Hajnoczi [Wed, 6 Dec 2017 14:45:48 +0000 (14:45 +0000)]
iothread: add iothread_by_id() API

Encapsulate IOThread QOM object lookup so that callers don't need to
know how and where IOThread objects live.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20171206144550.22295-8-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agoblock: drop unused BlockDirtyBitmapState->aio_context field
Stefan Hajnoczi [Wed, 6 Dec 2017 14:45:47 +0000 (14:45 +0000)]
block: drop unused BlockDirtyBitmapState->aio_context field

The dirty bitmap actions in qmp_transaction have not used AioContext
since the dirty bitmap locking discipline was introduced in commit
2119882c7eb7e2c612b24fc0c8d86f5887d6f1c3 ("block: introduce
dirty_bitmap_mutex").  Remove the unused field.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20171206144550.22295-7-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agoblock: don't keep AioContext acquired after internal_snapshot_prepare()
Stefan Hajnoczi [Wed, 6 Dec 2017 14:45:46 +0000 (14:45 +0000)]
block: don't keep AioContext acquired after internal_snapshot_prepare()

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20171206144550.22295-6-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agoblock: don't keep AioContext acquired after blockdev_backup_prepare()
Stefan Hajnoczi [Wed, 6 Dec 2017 14:45:45 +0000 (14:45 +0000)]
block: don't keep AioContext acquired after blockdev_backup_prepare()

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20171206144550.22295-5-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agoblock: don't keep AioContext acquired after drive_backup_prepare()
Stefan Hajnoczi [Wed, 6 Dec 2017 14:45:44 +0000 (14:45 +0000)]
block: don't keep AioContext acquired after drive_backup_prepare()

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20171206144550.22295-4-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agoblock: don't keep AioContext acquired after external_snapshot_prepare()
Stefan Hajnoczi [Wed, 6 Dec 2017 14:45:43 +0000 (14:45 +0000)]
block: don't keep AioContext acquired after external_snapshot_prepare()

It is not necessary to hold AioContext across transactions anymore since
bdrv_drained_begin/end() is used to keep the nodes quiesced.  In fact,
using the AioContext lock for this purpose was always buggy.

This patch reduces the scope of AioContext locked regions.  This is not
just a cleanup but also fixes hangs that occur in BDRV_POLL_WHILE()
because it is unware of recursive locking and does not release the
AioContext the necessary number of times to allow progress to be made.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20171206144550.22295-3-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agoblockdev: hold AioContext for bdrv_unref() in external_snapshot_clean()
Stefan Hajnoczi [Wed, 6 Dec 2017 14:45:42 +0000 (14:45 +0000)]
blockdev: hold AioContext for bdrv_unref() in external_snapshot_clean()

bdrv_unref() requires the AioContext lock because bdrv_flush() uses
BDRV_POLL_WHILE(), which assumes the AioContext is currently held.  If
BDRV_POLL_WHILE() runs without AioContext held the
pthread_mutex_unlock() call in aio_context_release() fails.

This patch moves bdrv_unref() into the AioContext locked region to solve
the following pthread_mutex_unlock() failure:

  #0  0x00007f566181969b in raise () at /lib64/libc.so.6
  #1  0x00007f566181b3b1 in abort () at /lib64/libc.so.6
  #2  0x00005592cd590458 in error_exit (err=<optimized out>, msg=msg@entry=0x5592cdaf6d60 <__func__.23977> "qemu_mutex_unlock") at util/qemu-thread-posix.c:36
  #3  0x00005592cd96e738 in qemu_mutex_unlock (mutex=mutex@entry=0x5592ce9505e0) at util/qemu-thread-posix.c:96
  #4  0x00005592cd969b69 in aio_context_release (ctx=ctx@entry=0x5592ce950580) at util/async.c:507
  #5  0x00005592cd8ead78 in bdrv_flush (bs=bs@entry=0x5592cfa87210) at block/io.c:2478
  #6  0x00005592cd89df30 in bdrv_close (bs=0x5592cfa87210) at block.c:3207
  #7  0x00005592cd89df30 in bdrv_delete (bs=0x5592cfa87210) at block.c:3395
  #8  0x00005592cd89df30 in bdrv_unref (bs=0x5592cfa87210) at block.c:4418
  #9  0x00005592cd6b7f86 in qmp_transaction (dev_list=<optimized out>, has_props=<optimized out>, props=<optimized out>, errp=errp@entry=0x7ffe4a1fc9d8) at blockdev.c:2308

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20171206144550.22295-2-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agoqdev: drop unused #include "sysemu/iothread.h"
Stefan Hajnoczi [Tue, 5 Dec 2017 13:39:54 +0000 (13:39 +0000)]
qdev: drop unused #include "sysemu/iothread.h"

Commit 1351d1ec89eabebc9fdff20451a62c413d7accc1 ("qdev: drop iothread
property type") forgot to remove this include.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20171205133954.31006-1-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agodev-storage: Fix the unusual function name
Mao Zhongyi [Wed, 22 Nov 2017 03:08:46 +0000 (11:08 +0800)]
dev-storage: Fix the unusual function name

The function name of usb_msd_{realize,unrealize}_*,
usb_msd_class_initfn_* are unusual. Rename it to
usb_msd_*_{realize,unrealize}, usb_msd_class_*_initfn.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 11e6003433abce35f3f4970e1acc71ee92dbcf51.1511317952.git.maozy.fnst@cn.fujitsu.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agohw/block: Use errp directly rather than local_err
Mao Zhongyi [Wed, 22 Nov 2017 03:08:45 +0000 (11:08 +0800)]
hw/block: Use errp directly rather than local_err

[Drop virtio_blk_data_plane_create() change that misinterprets return
value when the virtio transport does not support dataplane.
--Stefan]

Cc: John Snow <jsnow@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: e77848d3735ba590f23ffbf8094379c646c33d79.1511317952.git.maozy.fnst@cn.fujitsu.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agohw/block: Fix the return type
Mao Zhongyi [Wed, 22 Nov 2017 03:08:44 +0000 (11:08 +0800)]
hw/block: Fix the return type

When the function no success value to transmit, it usually make the
function return void. It has turned out not to be a success, because
it means that the extra local_err variable and error_propagate() will
be needed. It leads to cumbersome code, therefore, transmit success/
failure in the return value is worth.

So fix the return type of blkconf_apply_backend_options(),
blkconf_geometry() and virtio_blk_data_plane_create() to avoid it.

Cc: John Snow <jsnow@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: ac0edc1fc70c4457e5cec94405eb7d1f89f9c2c1.1511317952.git.maozy.fnst@cn.fujitsu.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agohw/block/nvme: Convert to realize
Mao Zhongyi [Wed, 22 Nov 2017 03:08:43 +0000 (11:08 +0800)]
hw/block/nvme: Convert to realize

Convert nvme_init() to realize and rename it to nvme_realize().

Cc: John Snow <jsnow@redhat.com>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
Message-id: 2882e72d795e04cbe2120f569d551aef2467ac60.1511317952.git.maozy.fnst@cn.fujitsu.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agocoroutine: simplify co_aio_sleep_ns() prototype
Stefan Hajnoczi [Thu, 9 Nov 2017 10:26:52 +0000 (10:26 +0000)]
coroutine: simplify co_aio_sleep_ns() prototype

The AioContext pointer argument to co_aio_sleep_ns() is only used for
the sleep timer.  It does not affect where the caller coroutine is
resumed.

Due to changes to coroutine and AIO APIs it is now possible to drop the
AioContext pointer argument.  This is safe to do since no caller has
specific requirements for which AioContext the timer must run in.

This patch drops the AioContext pointer argument and renames the
function to simplify the API.

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20171109102652.6360-1-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years agoMerge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging
Peter Maydell [Mon, 18 Dec 2017 14:17:42 +0000 (14:17 +0000)]
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging

trivial patches for 2017-12-18

# gpg: Signature made Mon 18 Dec 2017 14:08:51 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: (60 commits)
  misc: drop old i386 dependency
  i386/pc: move vmmouse.c to hw/i386/
  i386/pc: move vmport.c to hw/i386/
  hw/misc/pvpanic: extract public API from i386/pc to "hw/misc/pvpanic.h"
  hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c
  hw/display/vga: extract public API from i386/pc to "hw/display/vga.h"
  hw/display/vga: "vga_int.h" requires "ui/console.h"
  hw/display/vga: "vga.h" only contains registers defs, rename it "vga_regs.h"
  hw/acpi/ich9: extract ACPI_PM_PROP_TCO_ENABLED from i386/pc
  hw/acpi: ACPI_PM_* defines are not restricted to i386 arch
  hw/timer/mc146818: rename rtc_init() -> mc146818_rtc_init()
  hw/timer/i8254: rename pit_init() -> i8254_pit_init()
  hw/unicore32: restrict hw addr defines to source file
  hw/virtio-balloon: remove old i386 dependency
  hw/tpm: remove old i386 dependency
  hw/i2c: remove old i386 dependency
  hw/ipmi: remove old i386 dependency
  hw/ide: remove old i386 dependency
  misc: remove old i386 dependency
  amd_iommu: avoid needless includes in header file
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agomisc: drop old i386 dependency
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:26 +0000 (13:44 -0300)]
misc: drop old i386 dependency

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoi386/pc: move vmmouse.c to hw/i386/
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:25 +0000 (13:44 -0300)]
i386/pc: move vmmouse.c to hw/i386/

It's a x86-only device, so it does not make sense to keep it
in the shared misc folder.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoi386/pc: move vmport.c to hw/i386/
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:24 +0000 (13:44 -0300)]
i386/pc: move vmport.c to hw/i386/

It's a x86-only device, so it does not make sense to keep it
in the shared misc folder.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/misc/pvpanic: extract public API from i386/pc to "hw/misc/pvpanic.h"
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:23 +0000 (13:44 -0300)]
hw/misc/pvpanic: extract public API from i386/pc to "hw/misc/pvpanic.h"

and remove the old i386/pc dependency.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:22 +0000 (13:44 -0300)]
hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c

- add "hw/net/ne2000-isa.h"
- remove the old i386 dependency

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au> [PPC]
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/display/vga: extract public API from i386/pc to "hw/display/vga.h"
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:21 +0000 (13:44 -0300)]
hw/display/vga: extract public API from i386/pc to "hw/display/vga.h"

and remove the old i386/pc dependency.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/display/vga: "vga_int.h" requires "ui/console.h"
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:20 +0000 (13:44 -0300)]
hw/display/vga: "vga_int.h" requires "ui/console.h"

since The VGACommonState struct has a GraphicHwOps *hw_ops member,
then remove the now unnecessary includes.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/display/vga: "vga.h" only contains registers defs, rename it "vga_regs.h"
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:19 +0000 (13:44 -0300)]
hw/display/vga: "vga.h" only contains registers defs, rename it "vga_regs.h"

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/acpi/ich9: extract ACPI_PM_PROP_TCO_ENABLED from i386/pc
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:18 +0000 (13:44 -0300)]
hw/acpi/ich9: extract ACPI_PM_PROP_TCO_ENABLED from i386/pc

enable_tco is specific to i386/pc.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/acpi: ACPI_PM_* defines are not restricted to i386 arch
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:17 +0000 (13:44 -0300)]
hw/acpi: ACPI_PM_* defines are not restricted to i386 arch

this allows to remove the old i386/pc dependency on acpi/core.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/timer/mc146818: rename rtc_init() -> mc146818_rtc_init()
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:16 +0000 (13:44 -0300)]
hw/timer/mc146818: rename rtc_init() -> mc146818_rtc_init()

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/timer/i8254: rename pit_init() -> i8254_pit_init()
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:15 +0000 (13:44 -0300)]
hw/timer/i8254: rename pit_init() -> i8254_pit_init()

and remove the old i386/pc dependency

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/unicore32: restrict hw addr defines to source file
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:14 +0000 (13:44 -0300)]
hw/unicore32: restrict hw addr defines to source file

and drop unused #includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/virtio-balloon: remove old i386 dependency
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:13 +0000 (13:44 -0300)]
hw/virtio-balloon: remove old i386 dependency

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/tpm: remove old i386 dependency
Philippe Mathieu-Daudé [Mon, 18 Dec 2017 01:59:47 +0000 (22:59 -0300)]
hw/tpm: remove old i386 dependency

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/i2c: remove old i386 dependency
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:11 +0000 (13:44 -0300)]
hw/i2c: remove old i386 dependency

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/ipmi: remove old i386 dependency
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:10 +0000 (13:44 -0300)]
hw/ipmi: remove old i386 dependency

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Corey Minyard <cminyard@mvista.com>
Tested-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/ide: remove old i386 dependency
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:09 +0000 (13:44 -0300)]
hw/ide: remove old i386 dependency

and remove a duplicated include

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agomisc: remove old i386 dependency
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:08 +0000 (13:44 -0300)]
misc: remove old i386 dependency

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoamd_iommu: avoid needless includes in header file
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:07 +0000 (13:44 -0300)]
amd_iommu: avoid needless includes in header file

instead move them to the source file

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/ssi/aspeed_smc: remove unused #include
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:06 +0000 (13:44 -0300)]
hw/ssi/aspeed_smc: remove unused #include

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/misc/pvpanic: remove unused #include
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:05 +0000 (13:44 -0300)]
hw/misc/pvpanic: remove unused #include

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/input/vmmouse: remove unused #include
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:04 +0000 (13:44 -0300)]
hw/input/vmmouse: remove unused #include

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agonuma: remove unused #include
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:03 +0000 (13:44 -0300)]
numa: remove unused #include

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agomisc: avoid "include/" in include path
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:02 +0000 (13:44 -0300)]
misc: avoid "include/" in include path

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agonios2: remove duplicated includes (in code commented out)
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:01 +0000 (13:44 -0300)]
nios2: remove duplicated includes (in code commented out)

applied using ./scripts/clean-includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoi386/hax: remove duplicated include
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:44:00 +0000 (13:44 -0300)]
i386/hax: remove duplicated include

this file in include in "target/i386/hax-i386.h":

    #ifdef CONFIG_WIN32
    #include "target/i386/hax-windows.h"
    #endif

which guaranties that sysemu/os-win32.h is previously included (CONFIG_WIN32)

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoi386/hax: remove duplicated includes
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:59 +0000 (13:43 -0300)]
i386/hax: remove duplicated includes

applied using ./scripts/clean-includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoppc: remove duplicated includes
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:58 +0000 (13:43 -0300)]
ppc: remove duplicated includes

applied using ./scripts/clean-includes

not needed since 7ebaf795560

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agomisc: remove duplicated includes
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:57 +0000 (13:43 -0300)]
misc: remove duplicated includes

exec: housekeeping (funny since 02d0e095031)

applied using ./scripts/clean-includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agomisc: remove headers implicitly included
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:56 +0000 (13:43 -0300)]
misc: remove headers implicitly included

applied using ./scripts/clean-includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Ben Warren <ben@skyportsystems.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoblock: remove "qemu/osdep.h" from header file
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:55 +0000 (13:43 -0300)]
block: remove "qemu/osdep.h" from header file

applied using ./scripts/clean-includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw: remove "qemu/osdep.h" from header files
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:54 +0000 (13:43 -0300)]
hw: remove "qemu/osdep.h" from header files

applied using ./scripts/clean-includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Corey Minyard <cminyard@mvista.com>
Tested-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw: use "qemu/osdep.h" as first #include in source files
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:53 +0000 (13:43 -0300)]
hw: use "qemu/osdep.h" as first #include in source files

applied using ./scripts/clean-includes

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoMAINTAINERS: add missing entry for include/hw/net/
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:52 +0000 (13:43 -0300)]
MAINTAINERS: add missing entry for include/hw/net/

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoMAINTAINERS: add entries for timer/m48t59
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:51 +0000 (13:43 -0300)]
MAINTAINERS: add entries for timer/m48t59

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoMAINTAINERS: add an entry for input/pckbd.c
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:50 +0000 (13:43 -0300)]
MAINTAINERS: add an entry for input/pckbd.c

and fix a typo in the "PC Chipset" section

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoMAINTAINERS: add an entry for watchdog/wdt_ib700
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:49 +0000 (13:43 -0300)]
MAINTAINERS: add an entry for watchdog/wdt_ib700

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoMAINTAINERS: add an entry for the i82378 (superio)
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:48 +0000 (13:43 -0300)]
MAINTAINERS: add an entry for the i82378 (superio)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoMAINTAINERS: add an entry for the i8257 (DMA controller)
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:47 +0000 (13:43 -0300)]
MAINTAINERS: add an entry for the i8257 (DMA controller)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoMAINTAINERS: add an entry for the i82374 (southbridge)
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:46 +0000 (13:43 -0300)]
MAINTAINERS: add an entry for the i82374 (southbridge)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoMAINTAINERS: add entries for i2c/ppc4xx
Philippe Mathieu-Daudé [Tue, 17 Oct 2017 16:43:45 +0000 (13:43 -0300)]
MAINTAINERS: add entries for i2c/ppc4xx

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/input/hid: Add support for several keys.
Tao Wu [Thu, 7 Dec 2017 06:56:39 +0000 (22:56 -0800)]
hw/input/hid: Add support for several keys.

Add support for these keys: audiomute volumedown volumeup power.
Tested with "sendkey" command in monitor and verify the behavior
in guest OS.

Signed-off-by: Tao Wu <lepton@google.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/registerfields: add missing include
Philippe Mathieu-Daudé [Wed, 13 Dec 2017 05:17:36 +0000 (02:17 -0300)]
hw/registerfields: add missing include

This allows to use this header in qtests.

This fixes:
    CC      tests/test.o
  include/hw/registerfields.h:32:41: error: implicit declaration of function ‘MAKE_64BIT_MASK’ [-Werror=implicit-function-declaration]
              MAKE_64BIT_MASK(shift, length)};
              ^
  include/hw/registerfields.h:39:5: error: implicit declaration of function ‘extract64’; [-Werror=implicit-function-declaration]
       extract64((storage), R_ ## reg ## _ ## field ## _SHIFT,
       ^

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/registerfields: add 64-bit extract/deposit macros
Philippe Mathieu-Daudé [Wed, 13 Dec 2017 05:17:35 +0000 (02:17 -0300)]
hw/registerfields: add 64-bit extract/deposit macros

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agohw/registerfields: fix a typo in the FIELD() documentation
Philippe Mathieu-Daudé [Wed, 13 Dec 2017 05:17:34 +0000 (02:17 -0300)]
hw/registerfields: fix a typo in the FIELD() documentation

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoMAINTAINERS: add "hw/registerfields.h" in Register API entry
Philippe Mathieu-Daudé [Wed, 13 Dec 2017 05:17:33 +0000 (02:17 -0300)]
MAINTAINERS: add "hw/registerfields.h" in Register API entry

Orphan since afb3141c660

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoMakefile: add more targets to the UNCHECKED_GOALS rule
Philippe Mathieu-Daudé [Tue, 21 Nov 2017 03:22:47 +0000 (00:22 -0300)]
Makefile: add more targets to the UNCHECKED_GOALS rule

These targets don't need a full build of git submodules.
(See b8e535ae8af and eaa2ddbb767).

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoaccel/tcg/cpu-exec-common.c: Remove unnecessary include of memory-internal.h
Peter Maydell [Tue, 21 Nov 2017 15:07:31 +0000 (15:07 +0000)]
accel/tcg/cpu-exec-common.c: Remove unnecessary include of memory-internal.h

The cpu-exec-common.c file includes memory-internal.h, but it doesn't
actually use anything from that header. Remove the unnecessary include.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agobuild: fix typo in error message
Mike Frysinger [Mon, 27 Nov 2017 17:49:44 +0000 (12:49 -0500)]
build: fix typo in error message

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoMakefile: use $(MAKE) variable
Philippe Mathieu-Daudé [Tue, 21 Nov 2017 09:55:10 +0000 (06:55 -0300)]
Makefile: use $(MAKE) variable

For some systems (i.e. FreeBSD) the default 'make' is not compatible with the
GNU extensions used by QEMU makefiles.

Calling the GNU make (gmake) works, however the help displayed refers to the
host 'make' and copy/paste leads to lot of unobvious errors:

  $ gmake check-help
  [...]
   make check                Run all tests

  $ make check
  make: "Makefile" line 28: Missing dependency operator
  make: "Makefile" line 37: Need an operator
  make: "Makefile" line 41: warning: duplicate script for target "git-submodule-update" ignored
  make: "rules.mak" line 70: warning: duplicate script for target "%.o" ignored
  make: Unknown modifier ' '
  make: Unclosed substitution for eval modules (= missing)
  make: "tests/Makefile.include" line 24: Variable/Value missing from "export"
  make: "tests/" line 1: warning: Zero byte read from file, skipping rest of line.
  make: "tests/" line 1: Need an operator
  make: "Makefile" line 660: warning: duplicate script for target "ifneq" ignored
  make: "Makefile" line 78: warning: using previous script for "ifneq" defined here
  make: Fatal errors encountered -- cannot continue

Using the $(MAKE) variable, the help displayed is consistent with the 'make'
program used.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoDocument pretty parameter for mon option
Vicente Jimenez Aguilar [Tue, 14 Nov 2017 08:11:27 +0000 (09:11 +0100)]
Document pretty parameter for mon option

Documentation: document pretty parameter for mon option
that turns on JSON pretty printing

Signed-off-by: Vicente Jimenez Aguilar <googuy@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agomemory: remove unused memory_region_set_global_locking()
Marc-André Lureau [Mon, 6 Nov 2017 18:55:06 +0000 (19:55 +0100)]
memory: remove unused memory_region_set_global_locking()

This was never used since its introduction in commit
196ea13104f8 ("memory: Add global-locking property to memory
regions").

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years ago.gitignore: remove vscclient
Marc-André Lureau [Mon, 6 Nov 2017 18:54:10 +0000 (19:54 +0100)]
.gitignore: remove vscclient

It was removed with libcacard, since:

commit 7b02f5447c64d1854468f758398c9f6fe9e5721f
Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Date:   Sun Aug 30 11:48:40 2015 +0200

    libcacard: use the standalone project

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agommap(2) returns MAP_FAILED, not NULL, on failure
Michael McConville [Fri, 1 Dec 2017 18:31:57 +0000 (11:31 -0700)]
mmap(2) returns MAP_FAILED, not NULL, on failure

Signed-off-by: Michael McConville <mmcco@mykolab.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoconfigure: check $CC available before verifying host CPU
Daniel Henrique Barboza [Thu, 2 Nov 2017 09:09:06 +0000 (07:09 -0200)]
configure: check $CC available before verifying host CPU

When executing 'configure' in a fresh QEMU clone, in a fresh
OS install running in a ppc64le host, this is the error
shown:

-----

../configure --enable-trace-backend=simple --enable-debug
    --target-list=ppc64-softmmu

ERROR: Unsupported CPU = ppc64le, try --enable-tcg-interpreter

-----

This isn't true, ppc64le host CPU is supported. This happens because,
in a fresh install, we don't have a C compiler to autodetect
the $cpu variable to "ppc64".

This patch moves the CC available check up a bit, just before verifying
the host CPU. This ensures that we bail out with a $CC not available
error instead of unsupported CPU (the host CPU detection without
the compiler wouldn't work properly anyway). It also allows --help to
keep working without a C compiler. With this patch, in the same ppc64le
host without gcc:

$ ../configure --enable-trace-backend=simple --enable-debug
    --target-list=ppc64-softmmu

ERROR: "cc" either does not exist or does not work

$ ../configure --help

Usage: configure [options]
Options: [defaults in brackets after descriptions]

Standard options:
  --help                   print this message
  --prefix=PREFIX          install in PREFIX [/usr/local]
  --interp-prefix=PREFIX   where to find shared libraries, etc.
(...)

Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoqht: fix kernel-doc markup in qht.h
Emilio G. Cota [Wed, 18 Oct 2017 22:01:43 +0000 (18:01 -0400)]
qht: fix kernel-doc markup in qht.h

While at it, s/stuct/struct/.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agotranslate-all: fix 'consisits' typo in comment
Emilio G. Cota [Wed, 18 Oct 2017 22:01:42 +0000 (18:01 -0400)]
translate-all: fix 'consisits' typo in comment

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agodisas/arm: fix 'instuction' typo in comment
Emilio G. Cota [Wed, 18 Oct 2017 22:01:40 +0000 (18:01 -0400)]
disas/arm: fix 'instuction' typo in comment

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoRemove empty statements
Ladi Prosek [Tue, 17 Oct 2017 14:40:51 +0000 (16:40 +0200)]
Remove empty statements

Thanks to Laszlo Ersek for spotting the double semicolon in target/i386/kvm.c

I have trivially grepped the tree for ';;' in C files.

Suggested-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoMerge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2017-12-15-1' into...
Peter Maydell [Sun, 17 Dec 2017 15:27:41 +0000 (15:27 +0000)]
Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2017-12-15-1' into staging

Merge tpm 2017/12/15 v1

# gpg: Signature made Fri 15 Dec 2017 04:44:15 GMT
# gpg:                using RSA key 0x75AD65802A0B4211
# gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.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: B818 B9CA DF90 89C2 D5CE  C66B 75AD 6580 2A0B 4211

* remotes/stefanberger/tags/pull-tpm-2017-12-15-1: (32 commits)
  tpm: tpm_passthrough: Fail startup if FE buffer size < BE buffer size
  tpm: tpm_emulator: get and set buffer size of device
  tpm: tpm_passthrough: Read the buffer size from the host device
  tpm: pull tpm_util_request() out of tpm_util_test()
  tpm: Move getting TPM buffer size to backends
  tpm: remove tpm_register_model()
  tpm-tis: use DEFINE_PROP_TPMBE
  qdev: add DEFINE_PROP_TPMBE
  tpm-tis: check that at most one TPM device exists
  tpm-tis: remove redundant 'tpm_tis:' in error messages
  tpm-emulator: add a FIXME comment about blocking cancel
  acpi: change TPM TIS data conditions
  tpm: add tpm_cmd_get_size() to tpm_util
  tpm: add TPM interface to lookup TPM version
  tpm: lookup the the TPM interface instead of TIS device
  tpm: rename qemu_find_tpm() -> qemu_find_tpm_be()
  tpm-tis: simplify header inclusion
  tpm-passthrough: workaround a possible race
  tpm-passthrough: simplify create()
  tpm-passthrough: make it safer to destroy after creation
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/berrange/tags/pull-qio-201712151' into staging
Peter Maydell [Fri, 15 Dec 2017 17:05:26 +0000 (17:05 +0000)]
Merge remote-tracking branch 'remotes/berrange/tags/pull-qio-201712151' into staging

Merge qio 2017/12/15 v1

# gpg: Signature made Fri 15 Dec 2017 15:07:34 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-201712151:
  io: introduce a network socket listener API

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosparc: Make sure we mmap at SHMLBA alignment
Peter Maydell [Fri, 8 Dec 2017 16:57:28 +0000 (16:57 +0000)]
sparc: Make sure we mmap at SHMLBA alignment

SPARC Linux has an oddity that it insists that mmap()
of MAP_FIXED memory must be at an alignment defined by
SHMLBA, which is more aligned than the page size
(typically, SHMLBA alignment is to 16K, and pages are 8K).
This is a relic of ancient hardware that had cache
aliasing constraints, but even on modern hardware the
kernel still insists on the alignment.

To ensure that we get mmap() alignment sufficient to
make the kernel happy, change QEMU_VMALLOC_ALIGN,
qemu_fd_getpagesize() and qemu_mempath_getpagesize()
to use the maximum of getpagesize() and SHMLBA.

In particular, this allows 'make check' to pass on Sparc:
we were previously failing the ivshmem tests.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 1512752248-17857-1-git-send-email-peter.maydell@linaro.org

6 years agoio: introduce a network socket listener API
Daniel P. Berrange [Tue, 19 Jul 2016 12:37:51 +0000 (13:37 +0100)]
io: introduce a network socket listener API

The existing QIOChannelSocket class provides the ability to
listen on a single socket at a time. This patch introduces
a QIONetListener class that provides a higher level API
concept around listening for network services, allowing
for listening on multiple sockets.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
6 years agoMerge remote-tracking branch 'remotes/cohuck/tags/s390x-20171215-v2' into staging
Peter Maydell [Fri, 15 Dec 2017 12:58:17 +0000 (12:58 +0000)]
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20171215-v2' into staging

s390x changes for 2.12:
- Lots of tcg improvements: ccw hotplug is now working and we can run
  a Linux kernel built for z12 under tcg
- zPCI improvements to get virtio-pci working
- get rid of the cssid restrictions for virtual and non-virtual channel
  devices
- we now support 8TB+ systems
- 2.12 compat machine
- fixes and cleanups

# gpg: Signature made Fri 15 Dec 2017 10:57:01 GMT
# gpg:                using RSA key 0xDECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>"
# gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>"
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
# gpg:                 aka "Cornelia Huck <cohuck@kernel.org>"
# gpg:                 aka "Cornelia Huck <cohuck@redhat.com>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20171215-v2: (46 commits)
  s390-ccw-virtio: allow for systems larger that 7.999TB
  s390x: change the QEMU cpu model to a stripped down z12
  s390x/tcg: we already implement the Set-Program-Parameter facility
  s390x/tcg: implement extract-CPU-time facility
  s390x/tcg: Implement SIGNAL ADAPTER instruction
  s390x/tcg: Implement STORE CHANNEL PATH STATUS
  s390x/tcg: wire up SET CHANNEL MONITOR
  s390x/tcg: wire up SET ADDRESS LIMIT
  s390x/tcg: implement Interlocked-Access Facility 2
  s390x/tcg: ASI/ASGI/ALSI/ALSGI are atomic with Interlocked-acccess facility 1
  s390x/tcg: wire up STORE CHANNEL REPORT WORD
  s390x/tcg: indicate value of TODPR in STCKE
  s390x/tcg: implement SET CLOCK PROGRAMMABLE FIELD
  s390x/tcg: fix and cleanup mcck injection
  s390x/kvm: factor out build_channel_report_mcic() into cpu.h
  s390x/css: attach css bridge
  s390x: deprecate s390-squash-mcss machine prop
  s390x/css: unrestrict cssids
  s390x/pci: search for subregion inside the BARs
  s390x/pci: move the memory region write from pcistg
  ...

# Conflicts:
# include/hw/compat.h

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.12-20171215' into staging
Peter Maydell [Fri, 15 Dec 2017 11:13:43 +0000 (11:13 +0000)]
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.12-20171215' into staging

ppc patch queue 2017-12-15

First pull request for qemu-2.12.  This has quite a bit of stuff
accumulated while 2.11 was finalizing.  Highlights are:

  * Some preliminary work towards implementing the "XIVE" POWER9
    interrupt controller
  * Some fixes for problems during reboot with MTTCG
  * A substantial TCG performance improvement via
    tcg_get_lookup_and_goto_ptr
  * Numerous assorted cleanups and bugfixes that weren't urgent enough
    for 2.11

# gpg: Signature made Fri 15 Dec 2017 03:14:12 GMT
# gpg:                using RSA key 0x6C38CACA20D9B392
# gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
# gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>"
# gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
# gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>"
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-2.12-20171215: (24 commits)
  spapr: don't initialize PATB entry if max-cpu-compat < power9
  spapr: Assume msi_nonbroken
  spapr: Rename machine init functions for clarity
  target/ppc: introduce the PPC_BIT() macro
  spapr_events: drop bogus cell from "interrupt-ranges" property
  spapr: fix LSI interrupt specifiers in the device tree
  spapr: replace numa_get_node() with lookup in pc-dimm list
  spapr: introduce a spapr_qirq() helper
  spapr: introduce a spapr_irq_set_lsi() helper
  spapr: move the IRQ allocation routines under the machine
  ppc/xics: assign of the CPU 'intc' pointer under the core
  ppc/xics: introduce an icp_create() helper
  spapr/rtas: do not reset the MSR in stop-self command
  spapr/rtas: fix reboot of a a SMP TCG guest
  spapr/rtas: disable the decrementer interrupt when a CPU is unplugged
  e500: fix pci host bridge class/type
  openpic: debug w/ info_report()
  pcc: define the Power-saving mode Exit Cause Enable bits in PowerPCCPUClass
  nvram: add AT24Cx i2c eeprom
  e500: name openpic and pci host bridge
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agos390-ccw-virtio: allow for systems larger that 7.999TB
Christian Borntraeger [Mon, 11 Dec 2017 12:21:46 +0000 (13:21 +0100)]
s390-ccw-virtio: allow for systems larger that 7.999TB

KVM does not allow memory regions > KVM_MEM_MAX_NR_PAGES, basically
limiting the memory per slot to 8TB-4k. As memory slots on s390/kvm must
be a multiple of 1MB we need start a new memory region if we cross
8TB-1M.

With that (and optimistic overcommitment in the kernel) I was able to
start a 24TB guest on a 1TB system.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-Id: <20171211122146.162430-1-borntraeger@de.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
[CH: 1UL -> 1ULL in KVM_MEM_MAX_NR_PAGES; build fix on 32 bit hosts]
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
6 years agoMerge remote-tracking branch 'remotes/sstabellini/tags/xen-20171214-tag' into staging
Peter Maydell [Fri, 15 Dec 2017 09:52:07 +0000 (09:52 +0000)]
Merge remote-tracking branch 'remotes/sstabellini/tags/xen-20171214-tag' into staging

Xen 2017/12/14

# gpg: Signature made Fri 15 Dec 2017 00:26:26 GMT
# gpg:                using RSA key 0x894F8F4870E1AE90
# gpg: Good signature from "Stefano Stabellini <stefano.stabellini@eu.citrix.com>"
# gpg:                 aka "Stefano Stabellini <sstabellini@kernel.org>"
# Primary key fingerprint: D04E 33AB A51F 67BA 07D3  0AEA 894F 8F48 70E1 AE90

* remotes/sstabellini/tags/xen-20171214-tag:
  xen/pt: Set is_express to avoid out-of-bounds write
  xenfb: activate input handlers for raw pointer devices
  xenfb: Add [feature|request]-raw-pointer
  xenfb: Use Input Handlers directly
  ui: generate qcode to linux mappings
  xen-disk: use an IOThread per instance

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agotpm: tpm_passthrough: Fail startup if FE buffer size < BE buffer size
Stefan Berger [Mon, 6 Nov 2017 00:31:43 +0000 (19:31 -0500)]
tpm: tpm_passthrough: Fail startup if FE buffer size < BE buffer size

If the requested buffer size of the frontend is smaller than the fixed
buffer size of the host's TPM, fail the startup_tpm() interface function,
which will make the device unusable. We fail it because the backend TPM
could produce larger packets than what the frontend could pass to the OS.

The current combination of TIS frontend and either passthrough or emulator
backend will not lead to this case since the TIS can support any size of
buffer.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agotpm: tpm_emulator: get and set buffer size of device
Stefan Berger [Sat, 4 Nov 2017 23:57:15 +0000 (19:57 -0400)]
tpm: tpm_emulator: get and set buffer size of device

Convert the tpm_emulator backend to get the current buffer size
of the external device and set it to the buffer size that the
frontend (TIS) requests.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agotpm: tpm_passthrough: Read the buffer size from the host device
Stefan Berger [Sat, 4 Nov 2017 02:49:23 +0000 (22:49 -0400)]
tpm: tpm_passthrough: Read the buffer size from the host device

Rather than hard coding the buffer size in the tpm_passthrough
backend read the TPM I/O buffer size from the host device.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agotpm: pull tpm_util_request() out of tpm_util_test()
Stefan Berger [Sat, 4 Nov 2017 03:00:36 +0000 (23:00 -0400)]
tpm: pull tpm_util_request() out of tpm_util_test()

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agotpm: Move getting TPM buffer size to backends
Stefan Berger [Fri, 3 Nov 2017 22:10:01 +0000 (18:10 -0400)]
tpm: Move getting TPM buffer size to backends

Rather than setting the size of the TPM buffer in the front-end,
query the backend for the size of the buffer. In this patch we
just move the hard-coded buffer size of 4096 to the backends.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agotpm: remove tpm_register_model()
Marc-André Lureau [Mon, 6 Nov 2017 18:39:25 +0000 (19:39 +0100)]
tpm: remove tpm_register_model()

Query object classes that implements TPMIf instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
6 years agotpm-tis: use DEFINE_PROP_TPMBE
Marc-André Lureau [Mon, 6 Nov 2017 18:39:24 +0000 (19:39 +0100)]
tpm-tis: use DEFINE_PROP_TPMBE

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
6 years agoqdev: add DEFINE_PROP_TPMBE
Marc-André Lureau [Mon, 6 Nov 2017 18:39:23 +0000 (19:39 +0100)]
qdev: add DEFINE_PROP_TPMBE

A property to lookup a tpm backend.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
6 years agotpm-tis: check that at most one TPM device exists
Marc-André Lureau [Mon, 6 Nov 2017 18:39:21 +0000 (19:39 +0100)]
tpm-tis: check that at most one TPM device exists

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
6 years agotpm-tis: remove redundant 'tpm_tis:' in error messages
Marc-André Lureau [Mon, 6 Nov 2017 18:39:20 +0000 (19:39 +0100)]
tpm-tis: remove redundant 'tpm_tis:' in error messages

The reported error message is already prefixed with the -device
name & arguments.

Before:
qemu-system-x86_64: -device tpm-tis,id=foo,tpmdev=foo,irq=21: tpm_tis: IRQ 21 is outside valid range of 0 to 15

After:
qemu-system-x86_64: -device tpm-tis,id=foo,tpmdev=foo,irq=21: IRQ 21 is outside valid range of 0 to 15

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
6 years agotpm-emulator: add a FIXME comment about blocking cancel
Marc-André Lureau [Mon, 6 Nov 2017 18:39:19 +0000 (19:39 +0100)]
tpm-emulator: add a FIXME comment about blocking cancel

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
6 years agoacpi: change TPM TIS data conditions
Marc-André Lureau [Mon, 6 Nov 2017 18:39:18 +0000 (19:39 +0100)]
acpi: change TPM TIS data conditions

The device should be exposed if present. It shouldn't have an
undefined version (or else backend init failed, and device should fail
too). Finally, make the fields specific to TIS device model.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
6 years agotpm: add tpm_cmd_get_size() to tpm_util
Marc-André Lureau [Mon, 6 Nov 2017 18:39:17 +0000 (19:39 +0100)]
tpm: add tpm_cmd_get_size() to tpm_util

The function is generally useful and used in the following patches.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>