]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
5 years agox86: define a new MSR based feature word -- FEATURE_WORDS_ARCH_CAPABILITIES
Robert Hoo [Mon, 15 Oct 2018 04:47:25 +0000 (12:47 +0800)]
x86: define a new MSR based feature word -- FEATURE_WORDS_ARCH_CAPABILITIES

Note RSBA is specially treated -- no matter host support it or not, qemu
pretends it is supported.

Signed-off-by: Robert Hoo <robert.hu@linux.intel.com>
Message-Id: <1539578845-37944-4-git-send-email-robert.hu@linux.intel.com>
[ehabkost: removed automatic enabling of RSBA]
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agox86: Data structure changes to support MSR based features
Robert Hoo [Mon, 15 Oct 2018 04:47:24 +0000 (12:47 +0800)]
x86: Data structure changes to support MSR based features

Add FeatureWordType indicator in struct FeatureWordInfo.
Change feature_word_info[] accordingly.
Change existing functions that refer to feature_word_info[] accordingly.

Signed-off-by: Robert Hoo <robert.hu@linux.intel.com>
Message-Id: <1539578845-37944-3-git-send-email-robert.hu@linux.intel.com>
[ehabkost: fixed hvf_enabled() case]
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agokvm: Add support to KVM_GET_MSR_FEATURE_INDEX_LIST and KVM_GET_MSRS system ioctl
Robert Hoo [Mon, 15 Oct 2018 04:47:23 +0000 (12:47 +0800)]
kvm: Add support to KVM_GET_MSR_FEATURE_INDEX_LIST and KVM_GET_MSRS system ioctl

Add kvm_get_supported_feature_msrs() to get supported MSR feature index list.
Add kvm_arch_get_supported_msr_feature() to get each MSR features value.

Signed-off-by: Robert Hoo <robert.hu@linux.intel.com>
Message-Id: <1539578845-37944-2-git-send-email-robert.hu@linux.intel.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agotarget/i386: Remove #ifdeffed-out icebp debugging hack
Peter Maydell [Tue, 9 Oct 2018 18:33:14 +0000 (19:33 +0100)]
target/i386: Remove #ifdeffed-out icebp debugging hack

Remove a debugging hack which could be used to cause the
undocumented 'icebp' instruction to enable QEMU internal
debug logging. This code has always been #ifdeffed out
since it was introduced in commit aba9d61e34b9 in 2005;
judging by the rest of that commit (which is entirely
unrelated) it may have even been committed by accident.

(Note that WANT_ICEBP is not defined by default anyway.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20181009183314.13416-1-peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agoi386: correct cpu_x86_cpuid(0xd)
Sebastian Andrzej Siewior [Fri, 28 Sep 2018 10:43:19 +0000 (12:43 +0200)]
i386: correct cpu_x86_cpuid(0xd)

Intel SDM says for CPUID function 0DH, sub-function 0:

| • ECX enumerates the size (in bytes) required by the XSAVE instruction for an
|   XSAVE area containing all the user state components supported by this
|   processor.
| • EBX enumerates the size (in bytes) required by the XSAVE instruction for an
|   XSAVE area containing all the user state components corresponding to bits
|   currently set in XCR0.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Message-Id: <20180928104319.3296-1-bigeasy@linutronix.de>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/vivier2/tags/qemu-trivial-for-3.1-pull-request...
Peter Maydell [Tue, 30 Oct 2018 15:49:55 +0000 (15:49 +0000)]
Merge remote-tracking branch 'remotes/vivier2/tags/qemu-trivial-for-3.1-pull-request' into staging

QEMU trivial patches collected between June and October 2018
(Thank you to Thomas Huth)

v2: fix 32bit build with updated patch (v3) from Philippe Mathieu-Daudé
    built in a 32bit debian sid chroot

# gpg: Signature made Tue 30 Oct 2018 11:23:01 GMT
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>"
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>"
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/qemu-trivial-for-3.1-pull-request:
  milkymist-minimac2: Use qemu_log_mask(GUEST_ERROR) instead of error_report
  ppc: move at24c to its own CONFIG_ symbol
  hw/intc/gicv3: Remove useless parenthesis around DIV_ROUND_UP macro
  hw/pci-host: Remove useless parenthesis around DIV_ROUND_UP macro
  tests/bios-tables-test: Remove an useless cast
  xen: Use the PCI_DEVICE macro
  qobject: Catch another straggler for use of qdict_put_str()
  configure: Support pkg-config for zlib
  tests: Fix typos in comments and help message (found by codespell)
  cpu.h: fix a typo in comment
  linux-user: fix comment s/atomic_write/atomic_set/
  qemu-iotests: make 218 executable
  scripts/qemu.py: remove trailing quotes on docstring
  scripts/decodetree.py: remove unused imports
  docs/devel/testing.rst: add missing newlines after code block
  qemu-iotests: fix filename containing checks
  tests/tcg/README: fix location for lm32 tests
  memory.h: fix typos in comments
  vga_int: remove unused function protype
  configs/alpha: Remove unused CONFIG_PARALLEL_ISA switch

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/jnsnow/tags/bitmaps-pull-request' into staging
Peter Maydell [Tue, 30 Oct 2018 14:09:25 +0000 (14:09 +0000)]
Merge remote-tracking branch 'remotes/jnsnow/tags/bitmaps-pull-request' into staging

Pull request

# gpg: Signature made Mon 29 Oct 2018 21:24:08 GMT
# gpg:                using RSA key 7DEF8106AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>"
# Primary key fingerprint: FAEB 9711 A12C F475 812F  18F2 88A9 064D 1835 61EB
#      Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76  CBD0 7DEF 8106 AAFC 390E

* remotes/jnsnow/tags/bitmaps-pull-request:
  iotests: 169: add cases for source vm resuming
  iotests: improve 169
  dirty-bitmaps: clean-up bitmaps loading and migration logic
  bitmap: Update count after a merge
  nbd: forbid use of frozen bitmaps
  block/backup: prohibit backup from using in use bitmaps
  block/dirty-bitmaps: prohibit enable/disable on locked/frozen bitmaps
  block/dirty-bitmaps: allow clear on disabled bitmaps
  block/dirty-bitmaps: fix merge permissions
  block/dirty-bitmaps: add user_locked status checker
  bloc/qcow2: drop dirty_bitmaps_loaded state variable
  block/qcow2: improve error message in qcow2_inactivate
  iotests: 169: drop deprecated 'autoload' parameter
  qapi: add transaction support for x-block-dirty-bitmap-merge
  blockdev: rename block-dirty-bitmap-clear transaction handlers
  dirty-bitmap: make it possible to restore bitmap after merge
  dirty-bitmap: rename bdrv_undo_clear_dirty_bitmap
  dirty-bitmap: switch assert-fails to errors in bdrv_merge_dirty_bitmap
  blockdev-backup: add bitmap argument

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/usb-20181029-pull-request' into...
Peter Maydell [Tue, 30 Oct 2018 13:32:38 +0000 (13:32 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/usb-20181029-pull-request' into staging

usb: fixes for ohci and smart card emulation.

# gpg: Signature made Mon 29 Oct 2018 20:02:34 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/usb-20181029-pull-request:
  hw: ccid-card-emulated: cleanup resource when realize in error path
  hw: ccid-card-emulated: introduce clean_event_notifier
  usb: ohci: make num_ports to an unsinged integer

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-october-2018-part...
Peter Maydell [Tue, 30 Oct 2018 10:45:49 +0000 (10:45 +0000)]
Merge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-october-2018-part-4' into staging

MIPS queue for October 2018, part 4

# gpg: Signature made Mon 29 Oct 2018 15:11:32 GMT
# gpg:                using RSA key D4972A8967F75A65
# gpg: Good signature from "Aleksandar Markovic <amarkovic@wavecomp.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: 8526 FBF1 5DA3 811F 4A01  DD75 D497 2A89 67F7 5A65

* remotes/amarkovic/tags/mips-queue-october-2018-part-4: (27 commits)
  linux-user: Add prctl() PR_SET_FP_MODE and PR_GET_FP_MODE implementations
  linux-user: Determine the desired FPU mode from MIPS.abiflags
  linux-user: Read and set FP ABI value from MIPS abiflags
  linux-user: Extract MIPS abiflags from ELF file
  linux-user: Extend image_info struct with MIPS fp_abi and interp_fp_abi fields
  elf: Define MIPS_ABI_FP_UNKNOWN macro
  target/mips: Amend MXU ASE overview note
  target/mips: Move MXU_EN check one level higher
  target/mips: Add emulation of MXU instructions S32LDD and S32LDDR
  target/mips: Add emulation of MXU instructions Q8MUL and Q8MULSU
  target/mips: Add emulation of MXU instruction D16MAC
  target/mips: Add emulation of MXU instruction D16MUL
  target/mips: Add emulation of MXU instruction S8LDD
  target/mips: Move MUL, S32M2I, S32I2M handling out of main MXU switch
  target/mips: Add emulation of MXU instructions S32I2M and S32M2I
  target/mips: Add emulation of non-MXU MULL within MXU decoding engine
  target/mips: Add bit encoding for MXU operand getting pattern 'optn3'
  target/mips: Add bit encoding for MXU operand getting pattern 'optn2'
  target/mips: Add bit encoding for MXU execute add/sub pattern 'eptn2'
  target/mips: Add bit encoding for MXU accumulate add/sub 2-bit pattern 'aptn2'
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agomilkymist-minimac2: Use qemu_log_mask(GUEST_ERROR) instead of error_report
Philippe Mathieu-Daudé [Mon, 29 Oct 2018 13:00:34 +0000 (14:00 +0100)]
milkymist-minimac2: Use qemu_log_mask(GUEST_ERROR) instead of error_report

qemu_log_mask(GUEST_ERROR) is more appropriate:

  $ qemu -d help
  Log items (comma separated):
  guest_errors    log when the guest OS does something invalid (eg accessing a non-existent register)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Michael Walle <michael@walle.cc>
Message-Id: <20181029130034.26750-1-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agoppc: move at24c to its own CONFIG_ symbol
Paolo Bonzini [Tue, 22 May 2018 19:17:43 +0000 (21:17 +0200)]
ppc: move at24c to its own CONFIG_ symbol

AT24c EEPROM is currently gated by CONFIG_I2C, and as such it is
being included in all emulators that use I2C, even if they do not
really need it.  Separate it and, since it was added for the e500
machines, add it to qemu-system-ppc and qemu-system-ppc64.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20180522191743.12872-1-pbonzini@redhat.com>
[lv: rebase]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agoiotests: 169: add cases for source vm resuming
Vladimir Sementsov-Ogievskiy [Mon, 29 Oct 2018 20:23:17 +0000 (16:23 -0400)]
iotests: 169: add cases for source vm resuming

Test that we can resume source vm after [failed] migration, and bitmaps
are ok.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: John Snow <jsnow@redhat.com>
5 years agoiotests: improve 169
Vladimir Sementsov-Ogievskiy [Mon, 29 Oct 2018 20:23:17 +0000 (16:23 -0400)]
iotests: improve 169

Before previous patch, iotest 169 was actually broken for the case
test_persistent__not_migbitmap__offline_shared, while formally
passing.

After migration log of vm_b had message:

    qemu-system-x86_64: Could not reopen qcow2 layer: Bitmap already
    exists: bitmap0

which means that invalidation failed and bs->drv = NULL.

It was because we've loaded bitmap twice: on open and on invalidation.

Add code to 169, to catch such fails.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: John Snow <jsnow@redhat.com>
5 years agodirty-bitmaps: clean-up bitmaps loading and migration logic
Vladimir Sementsov-Ogievskiy [Mon, 29 Oct 2018 20:23:17 +0000 (16:23 -0400)]
dirty-bitmaps: clean-up bitmaps loading and migration logic

This patch aims to bring the following behavior:

1. We don't load bitmaps, when started in inactive mode. It's the case
of incoming migration. In this case we wait for bitmaps migration
through migration channel (if 'dirty-bitmaps' capability is enabled) or
for invalidation (to load bitmaps from the image).

2. We don't remove persistent bitmaps on inactivation. Instead, we only
remove bitmaps after storing. This is the only way to restore bitmaps,
if we decided to resume source after [failed] migration with
'dirty-bitmaps' capability enabled (which means, that bitmaps were not
stored).

3. We load bitmaps on open and any invalidation, it's ok for all cases:
  - normal open
  - migration target invalidation with dirty-bitmaps capability
    (bitmaps are migrating through migration channel, the are not
     stored, so they should have IN_USE flag set and will be skipped
     when loading. However, it would fail if bitmaps are read-only[1])
  - migration target invalidation without dirty-bitmaps capability
    (normal load of the bitmaps, if migrated with shared storage)
  - source invalidation with dirty-bitmaps capability
    (skip because IN_USE)
  - source invalidation without dirty-bitmaps capability
    (bitmaps were dropped, reload them)

[1]: to accurately handle this, migration of read-only bitmaps is
     explicitly forbidden in this patch.

New mechanism for not storing bitmaps when migrate with dirty-bitmaps
capability is introduced: migration filed in BdrvDirtyBitmap.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: John Snow <jsnow@redhat.com>
5 years agobitmap: Update count after a merge
Eric Blake [Mon, 29 Oct 2018 20:23:17 +0000 (16:23 -0400)]
bitmap: Update count after a merge

We need an accurate count of the number of bits set in a bitmap
after a merge. In particular, since the merge operation short-circuits
a merge from an empty source, if you have bitmaps A, B, and C where
B started empty, then merge C into B, and B into A, an inaccurate
count meant that A did not get the contents of C.

In the worst case, we may falsely regard the bitmap as empty when
it has had new writes merged into it.

Fixes: be58721db
CC: qemu-stable@nongnu.org
Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 20181002233314.30159-1-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
5 years agonbd: forbid use of frozen bitmaps
John Snow [Mon, 29 Oct 2018 20:23:16 +0000 (16:23 -0400)]
nbd: forbid use of frozen bitmaps

Whether it's "locked" or "frozen", it's in use and should
not be allowed for the purposes of this operation.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 20181002230218.13949-7-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
5 years agoblock/backup: prohibit backup from using in use bitmaps
John Snow [Mon, 29 Oct 2018 20:23:16 +0000 (16:23 -0400)]
block/backup: prohibit backup from using in use bitmaps

If the bitmap is frozen, we shouldn't touch it.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 20181002230218.13949-6-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
5 years agoblock/dirty-bitmaps: prohibit enable/disable on locked/frozen bitmaps
John Snow [Mon, 29 Oct 2018 20:23:16 +0000 (16:23 -0400)]
block/dirty-bitmaps: prohibit enable/disable on locked/frozen bitmaps

We're not being consistent about this. If it's in use by an operation,
the user should not be able to change the behavior of that bitmap.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 20181002230218.13949-5-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
5 years agoblock/dirty-bitmaps: allow clear on disabled bitmaps
John Snow [Mon, 29 Oct 2018 20:23:16 +0000 (16:23 -0400)]
block/dirty-bitmaps: allow clear on disabled bitmaps

Similarly to merge, it's OK to allow clear operations on disabled
bitmaps, as this condition only means that they are not recording
new writes. We are free to clear it if the user requests it.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 20181002230218.13949-4-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
5 years agoblock/dirty-bitmaps: fix merge permissions
John Snow [Mon, 29 Oct 2018 20:23:16 +0000 (16:23 -0400)]
block/dirty-bitmaps: fix merge permissions

In prior commits that made merge transactionable, we removed the
assertion that merge cannot operate on disabled bitmaps. In addition,
we want to make sure that we are prohibiting merges to "locked" bitmaps.

Use the new user_locked function to check.

Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 20181002230218.13949-3-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
5 years agoblock/dirty-bitmaps: add user_locked status checker
John Snow [Mon, 29 Oct 2018 20:23:16 +0000 (16:23 -0400)]
block/dirty-bitmaps: add user_locked status checker

Instead of both frozen and qmp_locked checks, wrap it into one check.
frozen implies the bitmap is split in two (for backup), and shouldn't
be modified. qmp_locked implies it's being used by another operation,
like being exported over NBD. In both cases it means we shouldn't allow
the user to modify it in any meaningful way.

Replace any usages where we check both frozen and qmp_locked with the
new check.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20181002230218.13949-2-jsnow@redhat.com
[w/edits Suggested-By: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>]
Signed-off-by: John Snow <jsnow@redhat.com>
5 years agobloc/qcow2: drop dirty_bitmaps_loaded state variable
Vladimir Sementsov-Ogievskiy [Mon, 29 Oct 2018 20:23:15 +0000 (16:23 -0400)]
bloc/qcow2: drop dirty_bitmaps_loaded state variable

This variable doesn't work as it should, because it is actually cleared
in qcow2_co_invalidate_cache() by memset(). Drop it, as the following
patch will introduce new behavior.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
5 years agoblock/qcow2: improve error message in qcow2_inactivate
Vladimir Sementsov-Ogievskiy [Mon, 29 Oct 2018 20:23:15 +0000 (16:23 -0400)]
block/qcow2: improve error message in qcow2_inactivate

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
[Maintainer edit -- touched up error message. --js]
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
5 years agoiotests: 169: drop deprecated 'autoload' parameter
Vladimir Sementsov-Ogievskiy [Mon, 29 Oct 2018 20:23:15 +0000 (16:23 -0400)]
iotests: 169: drop deprecated 'autoload' parameter

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
5 years agoqapi: add transaction support for x-block-dirty-bitmap-merge
Vladimir Sementsov-Ogievskiy [Mon, 29 Oct 2018 20:23:15 +0000 (16:23 -0400)]
qapi: add transaction support for x-block-dirty-bitmap-merge

New action is like clean action: do the whole thing in .prepare and
undo in .abort. This behavior for bitmap-changing actions is needed
because backup job actions use bitmap in .prepare.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: John Snow <jsnow@redhat.com>
5 years agoblockdev: rename block-dirty-bitmap-clear transaction handlers
Vladimir Sementsov-Ogievskiy [Mon, 29 Oct 2018 20:23:15 +0000 (16:23 -0400)]
blockdev: rename block-dirty-bitmap-clear transaction handlers

Rename block-dirty-bitmap-clear transaction handlers to reuse them for
x-block-dirty-bitmap-merge transaction in the following patch.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: John Snow <jsnow@redhat.com>
5 years agodirty-bitmap: make it possible to restore bitmap after merge
Vladimir Sementsov-Ogievskiy [Mon, 29 Oct 2018 20:23:15 +0000 (16:23 -0400)]
dirty-bitmap: make it possible to restore bitmap after merge

Add backup parameter to bdrv_merge_dirty_bitmap() to be used then with
bdrv_restore_dirty_bitmap() if it needed to restore the bitmap after
merge operation.

This is needed to implement bitmap merge transaction action in further
commit.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: John Snow <jsnow@redhat.com>
5 years agodirty-bitmap: rename bdrv_undo_clear_dirty_bitmap
Vladimir Sementsov-Ogievskiy [Mon, 29 Oct 2018 20:23:14 +0000 (16:23 -0400)]
dirty-bitmap: rename bdrv_undo_clear_dirty_bitmap

Use more generic names to reuse the function for bitmap merge in the
following commit.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: John Snow <jsnow@redhat.com>
5 years agodirty-bitmap: switch assert-fails to errors in bdrv_merge_dirty_bitmap
Vladimir Sementsov-Ogievskiy [Mon, 29 Oct 2018 20:23:14 +0000 (16:23 -0400)]
dirty-bitmap: switch assert-fails to errors in bdrv_merge_dirty_bitmap

Move checks from qmp_x_block_dirty_bitmap_merge() to
bdrv_merge_dirty_bitmap(), to share them with dirty bitmap merge
transaction action in future commit.

Note: for now, only qmp_x_block_dirty_bitmap_merge() calls
bdrv_merge_dirty_bitmap().

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: John Snow <jsnow@redhat.com>
5 years agoblockdev-backup: add bitmap argument
John Snow [Mon, 29 Oct 2018 20:23:14 +0000 (16:23 -0400)]
blockdev-backup: add bitmap argument

It is only an oversight that we don't allow incremental backup with
blockdev-backup. Add the bitmap argument which enables this.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 20180830211605.13683-2-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/ui-20181029-pull-request' into...
Peter Maydell [Mon, 29 Oct 2018 18:24:11 +0000 (18:24 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20181029-pull-request' into staging

ui: sdl+spice tweaks.

# gpg: Signature made Mon 29 Oct 2018 14:18:21 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20181029-pull-request:
  spice: prepare for upcoming spice-server change
  SDL: set a hint to not bypass the window compositor

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Peter Maydell [Mon, 29 Oct 2018 17:03:27 +0000 (17:03 +0000)]
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

Pull request

No changelog-worthy entries, just small tweaks.

# gpg: Signature made Mon 29 Oct 2018 13:55:54 GMT
# gpg:                using RSA key 9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  nvdimm: Add docs hint for Linux driver name
  util: aio-posix: fix a typo

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/audio-20181029-pull-request' into...
Peter Maydell [Mon, 29 Oct 2018 15:15:14 +0000 (15:15 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/audio-20181029-pull-request' into staging

audio: qom cleanups.

# gpg: Signature made Mon 29 Oct 2018 13:37:09 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/audio-20181029-pull-request:
  audio: use TYPE_MV88W8618_AUDIO instead of hardcoded string
  audio: use object link instead of qdev property to pass wm8750 reference
  audio: use TYPE_WM8750 instead of a hardcoded string
  hw: AC97: make it more QOMconventional

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agolinux-user: Add prctl() PR_SET_FP_MODE and PR_GET_FP_MODE implementations
Stefan Markovic [Fri, 26 Oct 2018 11:17:43 +0000 (13:17 +0200)]
linux-user: Add prctl() PR_SET_FP_MODE and PR_GET_FP_MODE implementations

Implement MIPS specific prctl() PR_SET_FP_MODE and PR_GET_FP_MODE emulation.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Stefan Markovic <smarkovic@wavecomp.com>
5 years agolinux-user: Determine the desired FPU mode from MIPS.abiflags
Stefan Markovic [Tue, 23 Oct 2018 09:44:36 +0000 (11:44 +0200)]
linux-user: Determine the desired FPU mode from MIPS.abiflags

Floating-point mode is calculated from MIPS.abiflags FP ABI value
(based on kernel implementation). Illegal combinations are rejected.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Stefan Markovic <smarkovic@wavecomp.com>
5 years agolinux-user: Read and set FP ABI value from MIPS abiflags
Stefan Markovic [Tue, 23 Oct 2018 07:19:10 +0000 (09:19 +0200)]
linux-user: Read and set FP ABI value from MIPS abiflags

Set fp_abi and interp_fp_abi values to current fp_abi value read from
MIPS.abiflags.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Stefan Markovic <smarkovic@wavecomp.com>
5 years agolinux-user: Extract MIPS abiflags from ELF file
Stefan Markovic [Mon, 22 Oct 2018 14:42:27 +0000 (16:42 +0200)]
linux-user: Extract MIPS abiflags from ELF file

Read MIPS.abiflags section from ELF file into Mips_elf_abiflags_v0 struct.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Stefan Markovic <smarkovic@wavecomp.com>
5 years agolinux-user: Extend image_info struct with MIPS fp_abi and interp_fp_abi fields
Stefan Markovic [Mon, 22 Oct 2018 14:43:40 +0000 (16:43 +0200)]
linux-user: Extend image_info struct with MIPS fp_abi and interp_fp_abi fields

Add MIPS specific image_info struct fields fp_abi and interp_fp_abi
to store executable and interpreter fp_abi values (based on kernel
struct arch_elf_state in mips/include/asm/elf.h).

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Stefan Markovic <smarkovic@wavecomp.com>
5 years agoelf: Define MIPS_ABI_FP_UNKNOWN macro
Stefan Markovic [Fri, 26 Oct 2018 13:28:07 +0000 (15:28 +0200)]
elf: Define MIPS_ABI_FP_UNKNOWN macro

Add MIPS_ABI_FP_UNKNOWN as QEMU internal value to represent
unknown fp_abi (based on kernel mips/include/asm/elf.h definition)

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Stefan Markovic <smarkovic@wavecomp.com>
5 years agospice: prepare for upcoming spice-server change
Gerd Hoffmann [Fri, 12 Oct 2018 11:45:51 +0000 (13:45 +0200)]
spice: prepare for upcoming spice-server change

Future spice-server versions will call the client_monitors_config
callback with the monitors list filtered to only include the monitors
of the given display channel (aka QXLInstance).  Luckily this is easily
detectable at runtime, so we can prepare for that in advance and also
make qemu compatible with both old and new spice-server versions.

While being at it also use the console index instead of head number as
array index.  The later doesn't work correctly in case multiple display
devices are present.

Cc: spice-devel@lists.freedesktop.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Lukáš Hrázký <lhrazky@redhat.com>
Message-id: 20181012114551.28809-1-kraxel@redhat.com

5 years agoSDL: set a hint to not bypass the window compositor
Sebastian Krzyszkowiak [Wed, 24 Oct 2018 14:37:48 +0000 (16:37 +0200)]
SDL: set a hint to not bypass the window compositor

Without that, window effects in KWin get suspended as soon as any
qemu-sdl window becomes visible. While the SDL default makes sense
for games, it's not really suitable for QEMU.

Signed-off-by: Sebastian Krzyszkowiak <dos@dosowisko.net>
Message-id: 20181024143748.4425-1-dos@dosowisko.net
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agonvdimm: Add docs hint for Linux driver name
Kees Cook [Thu, 18 Oct 2018 20:13:51 +0000 (13:13 -0700)]
nvdimm: Add docs hint for Linux driver name

I spent way too much time trying to figure out why the emulated NVDIMM
was missing under Linux. In an effort to help others who might be looking
for these kinds of things in the future, include a hint.

Signed-off-by: Kees Cook <keescook@chromium.org>
Message-id: 20181018201351.GA25286@beast
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
5 years agoutil: aio-posix: fix a typo
Li Qiang [Mon, 8 Oct 2018 02:16:12 +0000 (19:16 -0700)]
util: aio-posix: fix a typo

Cc: qemu-trivial@nongnu.org
Signed-off-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 1538964972-3223-1-git-send-email-liq3ea@gmail.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
5 years agotarget/mips: Amend MXU ASE overview note
Aleksandar Markovic [Wed, 24 Oct 2018 12:12:34 +0000 (14:12 +0200)]
target/mips: Amend MXU ASE overview note

Add prefix, suffix, operation descriptions, and other corrections
and amendments to the comment that describes MXU ASE.

Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Move MXU_EN check one level higher
Aleksandar Markovic [Wed, 24 Oct 2018 11:06:36 +0000 (13:06 +0200)]
target/mips: Move MXU_EN check one level higher

Move MXU_EN check to the main MXU decoding function, to avoid code
repetition.

Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add emulation of MXU instructions S32LDD and S32LDDR
Craig Janeczek [Thu, 18 Oct 2018 20:45:39 +0000 (22:45 +0200)]
target/mips: Add emulation of MXU instructions S32LDD and S32LDDR

Add support for emulating the S32LDD and S32LDDR MXU instructions.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Craig Janeczek <jancraig@amazon.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add emulation of MXU instructions Q8MUL and Q8MULSU
Craig Janeczek [Thu, 18 Oct 2018 20:38:25 +0000 (22:38 +0200)]
target/mips: Add emulation of MXU instructions Q8MUL and Q8MULSU

Adds support for emulating the Q8MUL and Q8MULSU MXU instructions.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Craig Janeczek <jancraig@amazon.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add emulation of MXU instruction D16MAC
Craig Janeczek [Thu, 18 Oct 2018 20:18:03 +0000 (22:18 +0200)]
target/mips: Add emulation of MXU instruction D16MAC

Add support for emulating the D16MAC MXU instruction.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Craig Janeczek <jancraig@amazon.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add emulation of MXU instruction D16MUL
Craig Janeczek [Thu, 18 Oct 2018 20:03:06 +0000 (22:03 +0200)]
target/mips: Add emulation of MXU instruction D16MUL

Add support for emulating the D16MUL MXU instruction.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Craig Janeczek <jancraig@amazon.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add emulation of MXU instruction S8LDD
Craig Janeczek [Thu, 18 Oct 2018 19:45:26 +0000 (21:45 +0200)]
target/mips: Add emulation of MXU instruction S8LDD

Add support for emulating the S8LDD MXU instruction.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Craig Janeczek <jancraig@amazon.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Move MUL, S32M2I, S32I2M handling out of main MXU switch
Aleksandar Markovic [Tue, 23 Oct 2018 15:50:49 +0000 (17:50 +0200)]
target/mips: Move MUL, S32M2I, S32I2M handling out of main MXU switch

Move MUL, S32M2I, S32I2M handling out of switch. These are all
instructions that do not depend on MXU_EN flag of MXU_CR.

Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add emulation of MXU instructions S32I2M and S32M2I
Craig Janeczek [Thu, 18 Oct 2018 19:32:20 +0000 (21:32 +0200)]
target/mips: Add emulation of MXU instructions S32I2M and S32M2I

Add support for emulating the S32I2M and S32M2I MXU instructions.
This commit also contains utility functions for reading/writing
to MXU registers. This is required for overall MXU instruction
support.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Craig Janeczek <jancraig@amazon.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add emulation of non-MXU MULL within MXU decoding engine
Craig Janeczek [Fri, 19 Oct 2018 15:49:19 +0000 (17:49 +0200)]
target/mips: Add emulation of non-MXU MULL within MXU decoding engine

Add emulation of non-MXU MULL within MXU decoding engine.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Craig Janeczek <jancraig@amazon.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add bit encoding for MXU operand getting pattern 'optn3'
Craig Janeczek [Fri, 19 Oct 2018 15:34:28 +0000 (17:34 +0200)]
target/mips: Add bit encoding for MXU operand getting pattern 'optn3'

Add bit encoding for MXU operand getting pattern 'optn3'.

Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com>
Signed-off-by: Craig Janeczek <jancraig@amazon.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add bit encoding for MXU operand getting pattern 'optn2'
Craig Janeczek [Fri, 19 Oct 2018 15:33:36 +0000 (17:33 +0200)]
target/mips: Add bit encoding for MXU operand getting pattern 'optn2'

Add bit encoding for MXU operand getting pattern 'optn2'.

Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com>
Signed-off-by: Craig Janeczek <jancraig@amazon.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add bit encoding for MXU execute add/sub pattern 'eptn2'
Aleksandar Markovic [Tue, 23 Oct 2018 14:42:40 +0000 (16:42 +0200)]
target/mips: Add bit encoding for MXU execute add/sub pattern 'eptn2'

Add bit encoding for MXU execute 2-bit add/subtract pattern 'eptn2'.

Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add bit encoding for MXU accumulate add/sub 2-bit pattern 'aptn2'
Craig Janeczek [Fri, 19 Oct 2018 15:25:26 +0000 (17:25 +0200)]
target/mips: Add bit encoding for MXU accumulate add/sub 2-bit pattern 'aptn2'

Add bit encoding for MXU accumulate add/subtract 2-bit pattern
'aptn2'.

Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com>
Signed-off-by: Craig Janeczek <jancraig@amazon.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add bit encoding for MXU accumulate add/sub 1-bit pattern 'aptn1'
Aleksandar Markovic [Tue, 23 Oct 2018 14:47:58 +0000 (16:47 +0200)]
target/mips: Add bit encoding for MXU accumulate add/sub 1-bit pattern 'aptn1'

Add bit encoding for MXU accumulate add/subtract 1-bit pattern
'aptn1'.

Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add MXU decoding engine
Aleksandar Markovic [Thu, 18 Oct 2018 15:54:48 +0000 (17:54 +0200)]
target/mips: Add MXU decoding engine

Add MXU decoding engine: add handlers for all instruction pools,
and main decode handler. The handlers, for now, for the purpose
of this patch, contain only sceleton in the form of a single
switch statement.

Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add and integrate MXU decoding engine placeholder
Aleksandar Markovic [Thu, 18 Oct 2018 12:40:20 +0000 (14:40 +0200)]
target/mips: Add and integrate MXU decoding engine placeholder

Provide the placeholder and add the invocation logic for MXU
decoding engine.

Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Amend MXU instruction opcodes
Aleksandar Markovic [Tue, 23 Oct 2018 15:26:58 +0000 (17:26 +0200)]
target/mips: Amend MXU instruction opcodes

Amend MXU instruction opcodes. Pool04 is actually only instruction
OPC_MXU_S16MAD. Two cases within S16MAD are recognized by 1-bit
subfield 'aptn1'.

Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Define a bit for MXU in insn_flags
Craig Janeczek [Thu, 18 Oct 2018 12:36:57 +0000 (14:36 +0200)]
target/mips: Define a bit for MXU in insn_flags

Define a bit for MXU in insn_flags. This is the first non-MIPS
(third party) ASE supported in QEMU for MIPS, so it is placed in
the section "bits 56-63: vendor-specific ASEs".

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Craig Janeczek <jancraig@amazon.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Introduce MXU registers
Craig Janeczek [Thu, 18 Oct 2018 12:06:20 +0000 (14:06 +0200)]
target/mips: Introduce MXU registers

Define and initialize the 16 MXU registers - 15 general computational
register, and 1 control register). There is also a zero register, but
it does not have any corresponding variable.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Craig Janeczek <jancraig@amazon.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add two missing breaks for NM_LLWPE and NM_SCWPE decoder cases
Aleksandar Markovic [Mon, 29 Oct 2018 11:09:26 +0000 (12:09 +0100)]
target/mips: Add two missing breaks for NM_LLWPE and NM_SCWPE decoder cases

Coverity found two fallthroughs that miss break statement. Fix them.

Revieved-by: Stefan Markovic <smarkovic@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/vga-20181029-pull-request' into...
Peter Maydell [Mon, 29 Oct 2018 12:59:15 +0000 (12:59 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20181029-pull-request' into staging

vga: two fixes.

# gpg: Signature made Mon 29 Oct 2018 12:46:20 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/vga-20181029-pull-request:
  vga_int: remove unused function protype
  qxl: store channel id in qxl->id

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoaudio: use TYPE_MV88W8618_AUDIO instead of hardcoded string
Mao Zhongyi [Mon, 22 Oct 2018 07:40:50 +0000 (15:40 +0800)]
audio: use TYPE_MV88W8618_AUDIO instead of hardcoded string

Cc: Jan Kiszka <jan.kiszka@web.de>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20181022074050.19638-4-maozhongyi@cmss.chinamobile.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoaudio: use object link instead of qdev property to pass wm8750 reference
Mao Zhongyi [Mon, 22 Oct 2018 07:40:49 +0000 (15:40 +0800)]
audio: use object link instead of qdev property to pass wm8750 reference

According to qdev-properties.h, properties of pointer type should
be avoided, it seems a link type property is a good substitution.

Cc: Jan Kiszka <jan.kiszka@web.de>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20181022074050.19638-3-maozhongyi@cmss.chinamobile.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoaudio: use TYPE_WM8750 instead of a hardcoded string
Mao Zhongyi [Mon, 22 Oct 2018 07:40:48 +0000 (15:40 +0800)]
audio: use TYPE_WM8750 instead of a hardcoded string

Cc: Jan Kiszka <jan.kiszka@web.de>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20181022074050.19638-2-maozhongyi@cmss.chinamobile.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agohw: AC97: make it more QOMconventional
Li Qiang [Sat, 13 Oct 2018 06:08:09 +0000 (23:08 -0700)]
hw: AC97: make it more QOMconventional

Signed-off-by: Li Qiang <liq3ea@163.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20181013060809.52496-1-liq3ea@163.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agohw: ccid-card-emulated: cleanup resource when realize in error path
Li Qiang [Fri, 19 Oct 2018 10:50:36 +0000 (03:50 -0700)]
hw: ccid-card-emulated: cleanup resource when realize in error path

Signed-off-by: Li Qiang <liq3ea@gmail.com>
Message-id: 1539946236-18028-3-git-send-email-liq3ea@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agohw: ccid-card-emulated: introduce clean_event_notifier
Li Qiang [Fri, 19 Oct 2018 10:50:35 +0000 (03:50 -0700)]
hw: ccid-card-emulated: introduce clean_event_notifier

Call it in device unrealize function.

Signed-off-by: Li Qiang <liq3ea@gmail.com>
Message-id: 1539946236-18028-2-git-send-email-liq3ea@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agovga_int: remove unused function protype
yuchenlin [Mon, 22 Oct 2018 08:00:53 +0000 (16:00 +0800)]
vga_int: remove unused function protype

Signed-off-by: yuchenlin <yuchenlin@synology.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20181022080053.9379-1-yuchenlin@synology.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoqxl: store channel id in qxl->id
Gerd Hoffmann [Fri, 12 Oct 2018 11:45:40 +0000 (13:45 +0200)]
qxl: store channel id in qxl->id

See qemu_spice_add_display_interface(), the console index is also used
as channel id.  So put that into the qxl->id field too.

In typical use cases (one primary qxl-vga device, optionally one or more
secondary qxl devices, no non-qxl display devices) this doesn't change
anything.

With this in place the qxl->id can not be used any more to figure
whenever a given device is primary (with vga compat mode) or secondary.
So add a bool to track this.

Cc: spice-devel@lists.freedesktop.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20181012114540.27829-1-kraxel@redhat.com

5 years agousb: ohci: make num_ports to an unsinged integer
Li Qiang [Tue, 23 Oct 2018 03:00:18 +0000 (20:00 -0700)]
usb: ohci: make num_ports to an unsinged integer

This can avoid setting OCHIState.num_ports to a negative num.

Signed-off-by: Li Qiang <liq3ea@gmail.com>
Message-id: 1540263618-18344-1-git-send-email-liq3ea@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/famz/tags/testing-pull-request' into staging
Peter Maydell [Sat, 27 Oct 2018 18:55:08 +0000 (19:55 +0100)]
Merge remote-tracking branch 'remotes/famz/tags/testing-pull-request' into staging

Testing patches

One fix for mingw build and some improvements in VM based testing, many thanks
to Paolo and Phil.

# gpg: Signature made Fri 26 Oct 2018 15:15:13 BST
# gpg:                using RSA key CA35624C6A9171C6
# gpg: Good signature from "Fam Zheng <famz@redhat.com>"
# Primary key fingerprint: 5003 7CB7 9706 0F76 F021  AD56 CA35 624C 6A91 71C6

* remotes/famz/tags/testing-pull-request:
  tests/vm: Do not abuse parallelism when HOST != TARGET architecture
  tests/vm: Do not use -enable-kvm if HOST != TARGET architecture
  tests/vm: Let kvm_available() work in cross environments
  tests/vm: Add a BaseVM::arch property
  tests/vm: Display remaining seconds to wait for a VM to start
  tests/vm: Do not use the -smp option with a single cpu
  tests/vm: Do not abuse parallelism when KVM is not available
  tests/vm: Extract the kvm_available() handy function
  tests: docker: update test-mingw for GTK+ 2.0 removal

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-oct-2018-part-3'...
Peter Maydell [Fri, 26 Oct 2018 19:16:38 +0000 (20:16 +0100)]
Merge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-oct-2018-part-3' into staging

MIPS queue for October 2018 - part 3

# gpg: Signature made Thu 25 Oct 2018 21:14:02 BST
# gpg:                using RSA key D4972A8967F75A65
# gpg: Good signature from "Aleksandar Markovic <amarkovic@wavecomp.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: 8526 FBF1 5DA3 811F 4A01  DD75 D497 2A89 67F7 5A65

* remotes/amarkovic/tags/mips-queue-oct-2018-part-3:
  target/mips: Add disassembler support for nanoMIPS
  target/mips: Implement emulation of nanoMIPS EVA instructions
  target/mips: Add nanoMIPS CRC32 instruction pool

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agohw/intc/gicv3: Remove useless parenthesis around DIV_ROUND_UP macro
Philippe Mathieu-Daudé [Thu, 5 Jul 2018 15:58:11 +0000 (12:58 -0300)]
hw/intc/gicv3: Remove useless parenthesis around DIV_ROUND_UP macro

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/round.cocci \
            --macro-file scripts/cocci-macro-file.h \
            --dir . --in-place

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20180705155811.20366-8-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agohw/pci-host: Remove useless parenthesis around DIV_ROUND_UP macro
Philippe Mathieu-Daudé [Thu, 5 Jul 2018 15:58:10 +0000 (12:58 -0300)]
hw/pci-host: Remove useless parenthesis around DIV_ROUND_UP macro

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/round.cocci \
            --macro-file scripts/cocci-macro-file.h \
            --dir . --in-place

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20180705155811.20366-7-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agotests/bios-tables-test: Remove an useless cast
Philippe Mathieu-Daudé [Thu, 5 Jul 2018 15:58:08 +0000 (12:58 -0300)]
tests/bios-tables-test: Remove an useless cast

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/typecast.cocci \
            --macro-file scripts/cocci-macro-file.h \
            --dir . --in-place

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20180705155811.20366-5-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agoxen: Use the PCI_DEVICE macro
Philippe Mathieu-Daudé [Thu, 5 Jul 2018 15:58:07 +0000 (12:58 -0300)]
xen: Use the PCI_DEVICE macro

TYPE_XEN_PT_DEVICE is a subclass of TYPE_PCI_DEVICE, the clean way
to access the PCIDevice pointer is using the PCI_DEVICE() macro.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20180705155811.20366-4-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agoqobject: Catch another straggler for use of qdict_put_str()
Philippe Mathieu-Daudé [Thu, 5 Jul 2018 15:58:05 +0000 (12:58 -0300)]
qobject: Catch another straggler for use of qdict_put_str()

Patch created mechanically by rerunning:

  $  spatch --sp-file scripts/coccinelle/qobject.cocci \
            --macro-file scripts/cocci-macro-file.h \
            --dir . --in-place

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20180705155811.20366-2-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agoconfigure: Support pkg-config for zlib
Stefan Weil [Thu, 12 Jul 2018 19:26:03 +0000 (21:26 +0200)]
configure: Support pkg-config for zlib

This is needed for builds with the mingw64-* packages from Cygwin,
but also works for Linux.

Move the zlib test also more to the end because users should
get information on the really important missing packages
(which also require zlib) first.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20180712192603.11599-1-sw@weilnetz.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agotests: Fix typos in comments and help message (found by codespell)
Stefan Weil [Fri, 13 Jul 2018 05:47:55 +0000 (07:47 +0200)]
tests: Fix typos in comments and help message (found by codespell)

Fix also a grammar issue.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20180713054755.23323-1-sw@weilnetz.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agocpu.h: fix a typo in comment
Li Qiang [Wed, 5 Sep 2018 12:29:08 +0000 (05:29 -0700)]
cpu.h: fix a typo in comment

Found by reading the code.

Signed-off-by: Li Qiang <liq3ea@gmail.com>
Message-Id: <1536150548-2797-1-git-send-email-liq3ea@gmail.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agolinux-user: fix comment s/atomic_write/atomic_set/
Emilio G. Cota [Sat, 11 Aug 2018 21:10:11 +0000 (17:10 -0400)]
linux-user: fix comment s/atomic_write/atomic_set/

Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <20180811211011.6277-1-cota@braap.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agoqemu-iotests: make 218 executable
Cleber Rosa [Thu, 4 Oct 2018 16:18:45 +0000 (12:18 -0400)]
qemu-iotests: make 218 executable

Commit 990dc39c made all tests executable at the time, but 218 came in
later, and missing those permissions.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Message-Id: <20181004161852.11673-4-crosa@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agoscripts/qemu.py: remove trailing quotes on docstring
Cleber Rosa [Thu, 4 Oct 2018 16:18:52 +0000 (12:18 -0400)]
scripts/qemu.py: remove trailing quotes on docstring

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181004161852.11673-11-crosa@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agoscripts/decodetree.py: remove unused imports
Cleber Rosa [Thu, 4 Oct 2018 16:18:49 +0000 (12:18 -0400)]
scripts/decodetree.py: remove unused imports

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181004161852.11673-8-crosa@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agodocs/devel/testing.rst: add missing newlines after code block
Cleber Rosa [Thu, 4 Oct 2018 16:18:47 +0000 (12:18 -0400)]
docs/devel/testing.rst: add missing newlines after code block

The line immediate following a ".. code::" block is considered
to contains arguments to the "code directive".  The lack of a
new line gives me during at parse time:

   testing.rst:63: (ERROR/3) Error in "code" directive:
   maximum 1 argument(s) allowed, 3 supplied.

   .. code::
     make check-unit V=1

   testing.rst:120: (ERROR/3) Error in "code" directive:
   maximum 1 argument(s) allowed, 3 supplied.

   .. code::
     make check-qtest V=1

Let's add the missing newlines, both for consistency and to
avoid the parsing errors.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-Id: <20181004161852.11673-6-crosa@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agoqemu-iotests: fix filename containing checks
Cleber Rosa [Thu, 4 Oct 2018 16:18:46 +0000 (12:18 -0400)]
qemu-iotests: fix filename containing checks

Commit cce293a2945 moved some functions from common.config to
common.rc, but the error messages still reference the old file
location.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181004161852.11673-5-crosa@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agotests/tcg/README: fix location for lm32 tests
Cleber Rosa [Thu, 4 Oct 2018 16:18:44 +0000 (12:18 -0400)]
tests/tcg/README: fix location for lm32 tests

Point to the right and obvious location for lm32 tests.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20181004161852.11673-3-crosa@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agomemory.h: fix typos in comments
Li Qiang [Tue, 9 Oct 2018 10:21:07 +0000 (03:21 -0700)]
memory.h: fix typos in comments

Signed-off-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <1539080467-2976-1-git-send-email-liq3ea@gmail.com>
[lv: s/types/typos/]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agovga_int: remove unused function protype
yuchenlin [Mon, 22 Oct 2018 08:00:53 +0000 (16:00 +0800)]
vga_int: remove unused function protype

Signed-off-by: yuchenlin <yuchenlin@synology.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181022080053.9379-1-yuchenlin@synology.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agoconfigs/alpha: Remove unused CONFIG_PARALLEL_ISA switch
Thomas Huth [Wed, 24 Oct 2018 10:18:34 +0000 (11:18 +0100)]
configs/alpha: Remove unused CONFIG_PARALLEL_ISA switch

We don't use CONFIG_PARALLEL_ISA in any of our Makefiles, so this
is just a dead config option which can be removed.

Fixes: a4cb773928e047b137c6998209cf2eec857fac6b
Signed-off-by: Thomas Huth <thuth@redhat.com>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <1540376314-5727-1-git-send-email-thuth@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agotests/vm: Do not abuse parallelism when HOST != TARGET architecture
Philippe Mathieu-Daudé [Sat, 13 Oct 2018 00:40:33 +0000 (02:40 +0200)]
tests/vm: Do not abuse parallelism when HOST != TARGET architecture

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20181013004034.6968-9-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
5 years agotests/vm: Do not use -enable-kvm if HOST != TARGET architecture
Philippe Mathieu-Daudé [Sat, 13 Oct 2018 00:40:32 +0000 (02:40 +0200)]
tests/vm: Do not use -enable-kvm if HOST != TARGET architecture

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20181013004034.6968-8-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
5 years agotests/vm: Let kvm_available() work in cross environments
Philippe Mathieu-Daudé [Sat, 13 Oct 2018 00:40:31 +0000 (02:40 +0200)]
tests/vm: Let kvm_available() work in cross environments

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20181013004034.6968-7-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
5 years agotests/vm: Add a BaseVM::arch property
Philippe Mathieu-Daudé [Sat, 13 Oct 2018 00:40:30 +0000 (02:40 +0200)]
tests/vm: Add a BaseVM::arch property

The 'arch' property gives a hint on which architecture the guest image runs.

This can be use to select the correct QEMU binary path.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20181013004034.6968-6-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
5 years agotests/vm: Display remaining seconds to wait for a VM to start
Philippe Mathieu-Daudé [Sat, 13 Oct 2018 00:40:29 +0000 (02:40 +0200)]
tests/vm: Display remaining seconds to wait for a VM to start

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20181013004034.6968-5-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
5 years agotests/vm: Do not use the -smp option with a single cpu
Philippe Mathieu-Daudé [Sat, 13 Oct 2018 00:40:28 +0000 (02:40 +0200)]
tests/vm: Do not use the -smp option with a single cpu

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20181013004034.6968-4-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>