qemu.git
7 years agotests/m48t59: Use the m48t59 test on ppc, too
Thomas Huth [Mon, 12 Feb 2018 12:35:41 +0000 (13:35 +0100)]
tests/m48t59: Use the m48t59 test on ppc, too

The ref405ep machine has a memory-mapped m48t59 device, so
we can run the m48t59 test on this machine, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agotests/Makefile: Derive check-qtest-ppc64-y from check-qtest-ppc-y
Thomas Huth [Mon, 12 Feb 2018 12:22:04 +0000 (13:22 +0100)]
tests/Makefile: Derive check-qtest-ppc64-y from check-qtest-ppc-y

ppc64 is a superset of ppc, so the ppc64 tests should include all
the ppc tests.

Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agotests/m48t59: Make the test independent of global_qtest
Thomas Huth [Mon, 12 Feb 2018 11:59:46 +0000 (12:59 +0100)]
tests/m48t59: Make the test independent of global_qtest

Stop using the functions that require global_qtest here and pass
around the QTestState instead (global_qtest should finally get
removed since this causes problems with tests running in parallel).

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agotests/m48t59: Fix and re-enable the test for sparc
Thomas Huth [Mon, 12 Feb 2018 11:13:38 +0000 (12:13 +0100)]
tests/m48t59: Fix and re-enable the test for sparc

The m48t59 test has been disabled in commit baeddded5fe6fa37d13fb94bf8d
("sparc: disable qtest in make check"), likely due to some timing issues
in the bcd_check_time tests which might fail if it gets interrupted for
too long. It should be OK to re-enable this test if we make sure that we
do not run it on timing-sensitive machines, thus it should be OK if we only
run it in the g_test_slow() mode.

Additionally, there are two other issues:

First, the test can not run so easily on sparc64 anymore, since commit
f3b18f35a23c60edbda6420cd ("sun4u: switch m48t59 NVRAM to MMIO access")
moved the m48t59 device to the ebus instead, and for this you first
have to set up the corresponding PCI device (which is currently not
possible from within the m48t59 test). So we can only re-enable this
test on sparc, but not the sparc64 target.

Second, the fuzzing test is executed before the bcd-check-time test
(due to the naming of the tests), without having the base address set
up properly, so the fuzzing test does not really check anything at all.
Fix it by setting up the base address from the main function already
and by moving the qtest_start() to the tests themselves, so that each
test starts with a clean environment (since after the fuzzing, the clock
is unusable for the bcd-check-time test).

Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agotests/boot-serial-test: Add support for the aarch64 virt machine
Wei Huang [Thu, 1 Feb 2018 17:28:09 +0000 (12:28 -0500)]
tests/boot-serial-test: Add support for the aarch64 virt machine

This patch adds a small binary kernel to test aarch64 virt machine's
UART.

Signed-off-by: Wei Huang <wei@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[thuth: Fixed contextual conflicts with the hppa and sdhci patches]
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agotests/boot-serial: Add tests for PowerPC Mac machines
Thomas Huth [Thu, 1 Feb 2018 09:47:42 +0000 (10:47 +0100)]
tests/boot-serial: Add tests for PowerPC Mac machines

OpenBIOS prints out the CPU type on these machine types, so we can use
this string to test whether the CPU detection is working correctly.

Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agotests/boot-serial: Enable the boot-serial test on SPARC machines, too
Thomas Huth [Thu, 1 Feb 2018 09:28:22 +0000 (10:28 +0100)]
tests/boot-serial: Enable the boot-serial test on SPARC machines, too

OpenBIOS prints out the name of the detected CPU here, so looking for
this string is a nice test to verify that the CPU detection is still
working correctly.

Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agowdt_ib700-test: Drop dependence on global_qtest
Eric Blake [Mon, 11 Sep 2017 17:20:09 +0000 (12:20 -0500)]
wdt_ib700-test: Drop dependence on global_qtest

As a general rule, we prefer avoiding implicit global state
because it makes code harder to safely copy and paste without
thinking about the global state.  Improve this test to be
explicit about the state.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agotests/boot-sector: Drop dependence on global_qtest
Eric Blake [Mon, 11 Sep 2017 17:20:07 +0000 (12:20 -0500)]
tests/boot-sector: Drop dependence on global_qtest

As a general rule, we prefer avoiding implicit global state
because it makes code harder to safely copy and paste without
thinking about the global state.  Adjust the helper code to
use explicit state instead, and update all callers.

Fix some trailing whitespace while touching the file.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agoqmp-test: Drop dependence on global_qtest
Eric Blake [Mon, 11 Sep 2017 17:20:06 +0000 (12:20 -0500)]
qmp-test: Drop dependence on global_qtest

As a general rule, we prefer avoiding implicit global state
because it makes code harder to safely copy and paste without
thinking about the global state.  Although qmp-test does not
maintain parallel qtest connections, it was the last test
assigning to global_qtest.  It's just as easy to be explicit
about the state; once all tests have been cleaned up, a later
patch can then get rid of global_qtest and a layer of wrappers
in libqtest.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agolibqos: Use explicit QTestState for remaining libqos operations
Eric Blake [Mon, 11 Sep 2017 17:20:01 +0000 (12:20 -0500)]
libqos: Use explicit QTestState for remaining libqos operations

Drop one more client of global_qtest by teaching all remaining
libqos stragglers to pass in an explicit QTestState.  Change the
setting of global_qtest from being implicit in libqos' call to
qtest_start() to instead be explicit in all clients that are
still relying on global_qtest.

Note that qmp_execute() can be greatly simplified in the process,
and that we also get rid of interpolation of a JSON string into a
temporary variable when qtest_qmp() can do it more reliably.

Signed-off-by: Eric Blake <eblake@redhat.com>
Acked-by: Greg Kurz <groug@kaod.org>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agolibqos: Use explicit QTestState for ahci operations
Eric Blake [Mon, 11 Sep 2017 17:20:00 +0000 (12:20 -0500)]
libqos: Use explicit QTestState for ahci operations

Drop one more client of global_qtest by teaching all ahci test
functionality to pass in an explicit QTestState.  The state was
already available, so no callers had to be adjusted.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agolibqos: Use explicit QTestState for i2c operations
Eric Blake [Mon, 11 Sep 2017 17:19:59 +0000 (12:19 -0500)]
libqos: Use explicit QTestState for i2c operations

Drop one more client of global_qtest by teaching all i2c test
functionality to pass in an explicit QTestState, adjusting all
callers.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agolibqos: Use explicit QTestState for rtas operations
Eric Blake [Mon, 11 Sep 2017 17:19:58 +0000 (12:19 -0500)]
libqos: Use explicit QTestState for rtas operations

Drop one more client of global_qtest by teaching all rtas test
functionality to pass in an explicit QTestState, adjusting all
callers.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
[thuth: Use nicer indentation in rtas.h]
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agolibqos: Use explicit QTestState for fw_cfg operations
Eric Blake [Mon, 11 Sep 2017 17:19:57 +0000 (12:19 -0500)]
libqos: Use explicit QTestState for fw_cfg operations

Drop one more client of global_qtest by teaching all fw_cfg test
functionality (invoked through alloc-pc) to pass in an explicit
QTestState, adjusting all callers.  In particular, fw_cfg-test
had to reorder things to create the test state prior to creating
the fw_cfg (and drop a pointless strdup in the meantime), but that
test now no longer depends on global_qtest.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
[thuth: Fixed conflict wrt pc_alloc_init() in vhost-user-test.c]
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agolibqos: Track QTestState with QPCIBus
Eric Blake [Mon, 11 Sep 2017 17:19:52 +0000 (12:19 -0500)]
libqos: Track QTestState with QPCIBus

When initializing a QPCIBus, track which QTestState the bus is
associated with (so that a later patch can then explicitly use
that test state for all communication on the bus, rather than
blindly relying on global_qtest).  Update the initialization
functions to take another parameter, and update all callers to
pass in state (for now, most callers get away with passing the
current global_qtest as the current state, although this required
fixing the order of initialization to ensure qtest_start() is
called before qpci_init*() in rtl8139-test, and provided an
opportunity to pass in the allocator in e1000e-test).

Touch up some allocations to use g_new0() rather than g_malloc()
while in the area, and simplify some code (all implementations
of QOSOps provide a .init_allocator() that never fails).

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
[thuth: Removed hunk from vhost-user-test.c that is not required anymore,
 fixed conflict in qtest_vboot() and adjusted qpci_init_pc() in sdhci-test]
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agolibqtest: Use qemu_strtoul()
Eric Blake [Mon, 11 Sep 2017 17:19:50 +0000 (12:19 -0500)]
libqtest: Use qemu_strtoul()

This will keep checkpatch happy when the next patch does code motion.
Fix the include order to match HACKING when adding the needed header.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agotests: Clean up wait for event
Markus Armbruster [Mon, 11 Sep 2017 17:19:48 +0000 (12:19 -0500)]
tests: Clean up wait for event

We still use hacks like qmp("") to wait for an event, even though we
have qmp_eventwait() since commit 8fe941f, and qmp_eventwait_ref()
since commit 7ffe312.  Both commits neglected to convert all the
existing hacks.  Make up what they missed.

Bonus: gets rid of empty format strings.  A step towards compile-time
format string checking without triggering -Wformat-zero-length.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
[thuth: dropped the hunks from the usb tests - not needed anymore]
Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agoMerge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Peter Maydell [Tue, 13 Feb 2018 18:24:07 +0000 (18:24 +0000)]
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

* CAN bus (will be under network maintainner)
* scsi-block opblockers (myself)
* Dirty log bitmap cleanup (myself)
* SDHCI improvements and tests (Philippe)
* HAX support for larger guest sizese (Yu Ning)

# gpg: Signature made Tue 13 Feb 2018 15:37:14 GMT
# gpg:                using RSA key BFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream: (48 commits)
  travis: use libgcc-4.8-dev (libgcc-6-dev is not available on Ubuntu 14.04)
  memory: unify loops to sync dirty log bitmap
  memory: hide memory_region_sync_dirty_bitmap behind DirtyBitmapSnapshot
  memory: remove memory_region_test_and_clear_dirty
  g364fb: switch to using DirtyBitmapSnapshot
  sdhci: add Spec v4.2 register definitions
  sdhci: add a check_capab_v3() qtest
  sdhci: check Spec v3 capabilities qtest
  hw/arm/xilinx_zynqmp: enable the UHS-I mode
  hw/arm/xilinx_zynqmp: fix the capabilities/spec version to match the datasheet
  hw/arm/fsl-imx6: implement SDHCI Spec. v3
  hw/arm/bcm2835_peripherals: change maximum block size to 1kB
  hw/arm/bcm2835_peripherals: implement SDHCI Spec v3
  sdhci: implement CMD/DAT[] fields in the Present State register
  sdhci: implement UHS-I voltage switch
  sdbus: add trace events
  sdhci: implement the Host Control 2 register (tuning sequence)
  sdhci: rename the hostctl1 register
  sdhci: add support for v3 capabilities
  hw/arm/xilinx_zynq: fix the capabilities register to match the datasheet
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Peter Maydell [Tue, 13 Feb 2018 16:33:31 +0000 (16:33 +0000)]
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

virtio,vhost,pci,pc: features, fixes and cleanups

- new stats in virtio balloon
- virtio eventfd rework for boot speedup
- vhost memory rework for boot speedup
- fixes and cleanups all over the place

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Tue 13 Feb 2018 16:29:55 GMT
# gpg:                using RSA key 281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream: (22 commits)
  virtio-balloon: include statistics of disk/file caches
  acpi-test: update FADT
  lpc: drop pcie host dependency
  tests: acpi: fix FADT not being compared to reference table
  hw/pci-bridge: fix pcie root port's IO hints capability
  libvhost-user: Support across-memory-boundary access
  libvhost-user: Fix resource leak
  virtio-balloon: unref the memory region before continuing
  pci: removed the is_express field since a uniform interface was inserted
  virtio-blk: enable multiple vectors when using multiple I/O queues
  pci/bus: let it has higher migration priority
  pci-bridge/i82801b11: clear bridge registers on platform reset
  vhost: Move log_dirty check
  vhost: Merge and delete unused callbacks
  vhost: Clean out old vhost_set_memory and friends
  vhost: Regenerate region list from changed sections list
  vhost: Merge sections added to temporary list
  vhost: Simplify ring verification checks
  vhost: Build temporary section list and deref after commit
  virtio: improve virtio devices initialization time
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agovirtio-balloon: include statistics of disk/file caches
Tomáš Golembiovský [Tue, 5 Dec 2017 12:14:46 +0000 (13:14 +0100)]
virtio-balloon: include statistics of disk/file caches

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
7 years agoacpi-test: update FADT
Michael S. Tsirkin [Thu, 8 Feb 2018 17:56:49 +0000 (19:56 +0200)]
acpi-test: update FADT

Previous commit ("tests: acpi: fix FADT not being compared to reference table")
started tracking changes to the FADT. Generate the expected FACP files -
apparently these weren't updated since 2013.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
7 years agolpc: drop pcie host dependency
Michael S. Tsirkin [Thu, 8 Feb 2018 17:40:02 +0000 (19:40 +0200)]
lpc: drop pcie host dependency

Doesn't look like that header is used.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
7 years agotests: acpi: fix FADT not being compared to reference table
Igor Mammedov [Tue, 16 Jan 2018 15:30:26 +0000 (16:30 +0100)]
tests: acpi: fix FADT not being compared to reference table

It turns out that FADT isn't actually tested for changes
against reference table, since it happens to be the 1st
table in RSDT which is currently ignored.
Fix it by making sure that all tables from RSDT are added
to test list.

NOTE: FADT contains guest allocated pointers to FACS/DSDT,
zero them out so that possible FACS/DSDT address change
won't affect test results.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
7 years agohw/pci-bridge: fix pcie root port's IO hints capability
Marcel Apfelbaum [Wed, 17 Jan 2018 19:19:47 +0000 (21:19 +0200)]
hw/pci-bridge: fix pcie root port's IO hints capability

The gen_pcie_root_port mem-reserve and pref32-reserve properties are
defined as size (so uint64_t), but passed as uint32_t when building
the 'IO hints' vendor specific capability.
Passing 4G (or more) gets truncated and passed as a zero reservation.
Is not a huge issue since the guest firmware will always compare the
hints with the default value and take the maximum.

Fix it by passing the values as uint64_t and failing to init the
gen_pcie_root_port id invalid values are used.

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
7 years agolibvhost-user: Support across-memory-boundary access
Yongji Xie [Thu, 18 Jan 2018 16:04:05 +0000 (00:04 +0800)]
libvhost-user: Support across-memory-boundary access

The sg list/indirect descriptor table may be contigious
in GPA but not in HVA address space. But libvhost-user
wasn't aware of that. This would cause out-of-bounds
access. Even a malicious guest could use it to get
information from the vhost-user backend.

Introduce a plen parameter in vu_gpa_to_va() so we can
handle this case, returning the actual mapped length.

Signed-off-by: Yongji Xie <xieyongji@baidu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
7 years agolibvhost-user: Fix resource leak
Yongji Xie [Thu, 18 Jan 2018 15:41:56 +0000 (23:41 +0800)]
libvhost-user: Fix resource leak

Free the mmaped memory when we need to mmap new memory
space on vu_set_mem_table_exec() and vu_set_log_base_exec() to
avoid memory leak.

Also close the corresponding fd after mmap() on
vu_set_log_base_exec() to avoid fd leak.

Signed-off-by: Yongji Xie <xieyongji@baidu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agovirtio-balloon: unref the memory region before continuing
Tiwei Bie [Thu, 25 Jan 2018 07:12:43 +0000 (15:12 +0800)]
virtio-balloon: unref the memory region before continuing

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
7 years agotravis: use libgcc-4.8-dev (libgcc-6-dev is not available on Ubuntu 14.04)
Philippe Mathieu-Daudé [Mon, 12 Feb 2018 18:46:50 +0000 (15:46 -0300)]
travis: use libgcc-4.8-dev (libgcc-6-dev is not available on Ubuntu 14.04)

Travis image is based on Ubuntu Trusty (14.04), since d83414e1fd1 we get:

  $ sudo -E \
    apt-get -yq --no-install-suggests --no-install-recommends --force-yes \
      install \
        libaio-dev libattr1-dev libbrlapi-dev libcap-ng-dev libgcc-6-dev \
        libgnutls-dev libgtk-3-dev libiscsi-dev liblttng-ust-dev \
        libncurses5-dev libnfs-dev libnss3-dev libpixman-1-dev libpng12-dev \
        librados-dev libsdl1.2-dev libseccomp-dev libspice-protocol-dev \
        libspice-server-dev libssh2-1-dev liburcu-dev libusb-1.0-0-dev \
        libvte-2.90-dev sparse uuid-dev
  Reading package lists...
  Building dependency tree...
  Reading state information...
  E: Unable to locate package libgcc-6-dev

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
7 years agomemory: unify loops to sync dirty log bitmap
Paolo Bonzini [Tue, 6 Feb 2018 16:55:27 +0000 (17:55 +0100)]
memory: unify loops to sync dirty log bitmap

Now that memory_region_sync_dirty_bitmap is NULL, we can unify its
loop with memory_global_dirty_log_sync's.  The only difference is
that memory_region_sync_dirty_bitmap will no longer call log_sync on
FlatRanges that do have a zero dirty_log_mask, but this is okay because
video memory is always registered with the dirty page logging mechanism.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agomemory: hide memory_region_sync_dirty_bitmap behind DirtyBitmapSnapshot
Paolo Bonzini [Tue, 6 Feb 2018 17:24:13 +0000 (18:24 +0100)]
memory: hide memory_region_sync_dirty_bitmap behind DirtyBitmapSnapshot

Simplify the users of memory_region_snapshot_and_clear_dirty, so
that they do not have to call memory_region_sync_dirty_bitmap
explicitly.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agomemory: remove memory_region_test_and_clear_dirty
Paolo Bonzini [Tue, 6 Feb 2018 17:30:04 +0000 (18:30 +0100)]
memory: remove memory_region_test_and_clear_dirty

It is unused after g364fb has been converted to use DirtyBitmapSnapshot.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agog364fb: switch to using DirtyBitmapSnapshot
Paolo Bonzini [Tue, 6 Feb 2018 17:28:10 +0000 (18:28 +0100)]
g364fb: switch to using DirtyBitmapSnapshot

This removes the last user of memory_region_test_and_clear_dirty
outside memory.c.

Tested-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agosdhci: add Spec v4.2 register definitions
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:18 +0000 (13:48 -0300)]
sdhci: add Spec v4.2 register definitions

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20180208164818.7961-31-f4bug@amsat.org>

7 years agosdhci: add a check_capab_v3() qtest
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:17 +0000 (13:48 -0300)]
sdhci: add a check_capab_v3() qtest

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20180208164818.7961-30-f4bug@amsat.org>

7 years agosdhci: check Spec v3 capabilities qtest
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:16 +0000 (13:48 -0300)]
sdhci: check Spec v3 capabilities qtest

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-29-f4bug@amsat.org>

7 years agohw/arm/xilinx_zynqmp: enable the UHS-I mode
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:15 +0000 (13:48 -0300)]
hw/arm/xilinx_zynqmp: enable the UHS-I mode

see the Xilinx datasheet "UG1085" (v1.7)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-28-f4bug@amsat.org>

7 years agohw/arm/xilinx_zynqmp: fix the capabilities/spec version to match the datasheet
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:14 +0000 (13:48 -0300)]
hw/arm/xilinx_zynqmp: fix the capabilities/spec version to match the datasheet

checking Xilinx datasheet "UG1085" (v1.7)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-27-f4bug@amsat.org>

7 years agohw/arm/fsl-imx6: implement SDHCI Spec. v3
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:13 +0000 (13:48 -0300)]
hw/arm/fsl-imx6: implement SDHCI Spec. v3

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-26-f4bug@amsat.org>

7 years agohw/arm/bcm2835_peripherals: change maximum block size to 1kB
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:12 +0000 (13:48 -0300)]
hw/arm/bcm2835_peripherals: change maximum block size to 1kB

following the datasheet.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-25-f4bug@amsat.org>

7 years agohw/arm/bcm2835_peripherals: implement SDHCI Spec v3
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:11 +0000 (13:48 -0300)]
hw/arm/bcm2835_peripherals: implement SDHCI Spec v3

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-24-f4bug@amsat.org>

7 years agosdhci: implement CMD/DAT[] fields in the Present State register
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:10 +0000 (13:48 -0300)]
sdhci: implement CMD/DAT[] fields in the Present State register

[based on a patch from Alistair Francis <alistair.francis@xilinx.com>
 from qemu/xilinx tag xilinx-v2015.2]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-23-f4bug@amsat.org>

7 years agosdhci: implement UHS-I voltage switch
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:09 +0000 (13:48 -0300)]
sdhci: implement UHS-I voltage switch

[based on a patch from Alistair Francis <alistair.francis@xilinx.com>
 from qemu/xilinx tag xilinx-v2015.2]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-22-f4bug@amsat.org>

7 years agosdbus: add trace events
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:08 +0000 (13:48 -0300)]
sdbus: add trace events

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-21-f4bug@amsat.org>

7 years agosdhci: implement the Host Control 2 register (tuning sequence)
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:07 +0000 (13:48 -0300)]
sdhci: implement the Host Control 2 register (tuning sequence)

[based on a patch from Alistair Francis <alistair.francis@xilinx.com>
 from qemu/xilinx tag xilinx-v2015.2]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-20-f4bug@amsat.org>

7 years agosdhci: rename the hostctl1 register
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:06 +0000 (13:48 -0300)]
sdhci: rename the hostctl1 register

As per the Spec v3.00

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-19-f4bug@amsat.org>

7 years agosdhci: add support for v3 capabilities
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:05 +0000 (13:48 -0300)]
sdhci: add support for v3 capabilities

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-18-f4bug@amsat.org>

7 years agohw/arm/xilinx_zynq: fix the capabilities register to match the datasheet
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:04 +0000 (13:48 -0300)]
hw/arm/xilinx_zynq: fix the capabilities register to match the datasheet

checking Xilinx datasheet "UG585" (v1.12.1)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-17-f4bug@amsat.org>

7 years agohw/arm/exynos4210: add a comment about a very similar SDHCI (Spec. v2)
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:03 +0000 (13:48 -0300)]
hw/arm/exynos4210: add a comment about a very similar SDHCI (Spec. v2)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-16-f4bug@amsat.org>

7 years agohw/arm/exynos4210: access the 64-bit capareg with qdev_prop_set_uint64()
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:02 +0000 (13:48 -0300)]
hw/arm/exynos4210: access the 64-bit capareg with qdev_prop_set_uint64()

We only set a 32-bit value, but this is a good practice in case this
code is used as reference.

(missed in 5efc9016e52)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-15-f4bug@amsat.org>

7 years agosdhci: check Spec v2 capabilities (DMA and 64-bit bus)
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:48:01 +0000 (13:48 -0300)]
sdhci: check Spec v2 capabilities (DMA and 64-bit bus)

Incorrect value will throw an error.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-14-f4bug@amsat.org>

7 years agosdhci: Fix 64-bit ADMA2
Sai Pavan Boddu [Thu, 8 Feb 2018 16:48:00 +0000 (13:48 -0300)]
sdhci: Fix 64-bit ADMA2

The 64-bit ADMA address is not converted to the cpu endianes correctly.
This patch fixes the issue and uses a valid mask for the attribute data.

Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com>
[AF: Re-write commit message]
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-13-f4bug@amsat.org>

7 years agosdhci: replace DMA magic value by BLOCK_SIZE_MASK
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:47:59 +0000 (13:47 -0300)]
sdhci: replace DMA magic value by BLOCK_SIZE_MASK

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-12-f4bug@amsat.org>

7 years agosdhci: check the Spec v1 capabilities correctness
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:47:58 +0000 (13:47 -0300)]
sdhci: check the Spec v1 capabilities correctness

Incorrect value will throw an error.

Note than Spec v2 is supported by default.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-11-f4bug@amsat.org>

7 years agosdhci: simplify sdhci_get_fifolen()
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:47:57 +0000 (13:47 -0300)]
sdhci: simplify sdhci_get_fifolen()

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-10-f4bug@amsat.org>

7 years agosdhci: use a numeric value for the default CAPAB register
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:47:56 +0000 (13:47 -0300)]
sdhci: use a numeric value for the default CAPAB register

using many #defines is not portable when scaling to different HCI.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-9-f4bug@amsat.org>

7 years agosdhci: add a 'spec_version property' (default to v2)
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:47:55 +0000 (13:47 -0300)]
sdhci: add a 'spec_version property' (default to v2)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-8-f4bug@amsat.org>

7 years agosdhci: add qtest to check the SD Spec version
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:47:54 +0000 (13:47 -0300)]
sdhci: add qtest to check the SD Spec version

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20180208164818.7961-7-f4bug@amsat.org>

7 years agosdhci: add a check_capab_sdma() qtest
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:47:53 +0000 (13:47 -0300)]
sdhci: add a check_capab_sdma() qtest

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20180208164818.7961-6-f4bug@amsat.org>

7 years agosdhci: add a check_capab_baseclock() qtest
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:47:52 +0000 (13:47 -0300)]
sdhci: add a check_capab_baseclock() qtest

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20180208164818.7961-5-f4bug@amsat.org>

7 years agosdhci: add check_capab_readonly() qtest
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:47:51 +0000 (13:47 -0300)]
sdhci: add check_capab_readonly() qtest

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20180208164818.7961-4-f4bug@amsat.org>

7 years agosdhci: add qtest to check the SD capabilities register
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:47:50 +0000 (13:47 -0300)]
sdhci: add qtest to check the SD capabilities register

The PCI model is tested with the pc/x86_64 machine,
the SysBus model with the smdkc210/arm machine.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20180208164818.7961-3-f4bug@amsat.org>

7 years agosdhci: use error_propagate(local_err) in realize()
Philippe Mathieu-Daudé [Thu, 8 Feb 2018 16:47:49 +0000 (13:47 -0300)]
sdhci: use error_propagate(local_err) in realize()

avoid the "errp && *errp" pattern (not recommended in "qapi/error.h" comments).

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-2-f4bug@amsat.org>

7 years agobuild-sys: check static linking of UBSAN
Marc-André Lureau [Thu, 8 Feb 2018 16:23:42 +0000 (17:23 +0100)]
build-sys: check static linking of UBSAN

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180208162343.30809-2-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agobuild-sys: remove useless extra*flags variables
Marc-André Lureau [Thu, 8 Feb 2018 16:23:41 +0000 (17:23 +0100)]
build-sys: remove useless extra*flags variables

Only EXTRA_LDFLAGS seems to be used during configure Xen checks.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180208162343.30809-1-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agohw/net/can: interrupt cleanup
Paolo Bonzini [Mon, 29 Jan 2018 22:30:17 +0000 (23:30 +0100)]
hw/net/can: interrupt cleanup

Define two functions to update the interrupt state, and call them
on loadvm.  This removes the need to migrate the state as part of
vmstate_kvaser_pci.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agonet/can: documentation
Pavel Pisa [Tue, 23 Jan 2018 21:04:22 +0000 (22:04 +0100)]
net/can: documentation

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agohw/net/can: MIOe-3680 PCI (dual SJA1000 channel) emulation
Deniz Eren [Sat, 27 Jan 2018 17:11:01 +0000 (18:11 +0100)]
hw/net/can: MIOe-3680 PCI (dual SJA1000 channel) emulation

Signed-off-by: Deniz Eren <deniz.eren@icloud.com>
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agohw/net/can: PCM-3680I PCI (dual SJA1000 channel) emulation
Deniz Eren [Mon, 29 Jan 2018 21:17:19 +0000 (22:17 +0100)]
hw/net/can: PCM-3680I PCI (dual SJA1000 channel) emulation

Signed-off-by: Deniz Eren <deniz.eren@icloud.com>
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agohw/net/can: Kvaser PCI CAN-S (single SJA1000 channel) emulation
Pavel Pisa [Sat, 27 Jan 2018 17:06:57 +0000 (18:06 +0100)]
hw/net/can: Kvaser PCI CAN-S (single SJA1000 channel) emulation

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agohw/net/can: SJA1000 chip register level emulation for QEMU
Pavel Pisa [Sat, 27 Jan 2018 16:43:21 +0000 (17:43 +0100)]
hw/net/can: SJA1000 chip register level emulation for QEMU

The core SJA1000 support is independent of following
patches which map SJA1000 chip to PCI boards.

The work is based on Jin Yang GSoC 2013 work funded
by Google and mentored in frame of RTEMS project GSoC
slot donated to QEMU.

Rewritten for QEMU-2.0+ versions and architecture cleanup
by Pavel Pisa (Czech Technical University in Prague).

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agonet/can: support for connecting to Linux host SocketCAN interface.
Pavel Pisa [Sat, 27 Jan 2018 16:59:27 +0000 (17:59 +0100)]
net/can: support for connecting to Linux host SocketCAN interface.

Connection to the real host CAN bus network through
SocketCAN network interface is available only for Linux
host system. Mechanism is generic, support for another
CAN API and operating systems can be implemented in future.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agonet/can: simple messages transport implementation for QEMU
Pavel Pisa [Sat, 27 Jan 2018 16:41:07 +0000 (17:41 +0100)]
net/can: simple messages transport implementation for QEMU

The CanBusState state structure is created for each
emulated CAN channel. Individual clients/emulated
CAN interfaces or host interface connection registers
to the bus by CanBusClientState structure.

The CAN core is prepared to support connection to the
real host CAN bus network. The commit with such support
for Linux SocketCAN follows.

Implementation is as simple as possible.  There is no state to be
migrated, and messages prioritization and queuing are not considered
for now.  But it is intended to be extended when need arises.

Development repository and more documentation at

https://gitlab.fel.cvut.cz/canbus/qemu-canbus

The work is based on Jin Yang GSoC 2013 work funded
by Google and mentored in frame of RTEMS project GSoC
slot donated to QEMU.

Rewritten for QEMU-2.0+ versions and architecture cleanup
by Pavel Pisa (Czech Technical University in Prague).

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agohax: Support guest RAM sizes of 4GB or more
Yu Ning [Fri, 12 Jan 2018 10:22:35 +0000 (18:22 +0800)]
hax: Support guest RAM sizes of 4GB or more

Since HAX_VM_IOCTL_ALLOC_RAM takes a 32-bit size, it cannot handle
RAM blocks of 4GB or larger, which is why HAXM can only run guests
with less than 4GB of RAM. Solve this problem by utilizing the new
HAXM API, HAX_VM_IOCTL_ADD_RAMBLOCK, which takes a 64-bit size, to
register RAM blocks with the HAXM kernel module. The new API is
first added in HAXM 7.0.0, and its availablility and be confirmed
by the presence of the HAX_CAP_64BIT_RAMBLOCK capability flag.

When the guest RAM size reaches 7GB, QEMU will ask HAXM to set up a
memory mapping that covers a 4GB region, which will fail, because
HAX_VM_IOCTL_SET_RAM also takes a 32-bit size. Work around this
limitation by splitting the large mapping into small ones and
calling HAX_VM_IOCTL_SET_RAM multiple times.

Bug: https://bugs.launchpad.net/qemu/+bug/1735576

Signed-off-by: Yu Ning <yu.ning@intel.com>
Message-Id: <1515752555-12784-1-git-send-email-yu.ning@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agomake: fix help message reference to bogus V=0 variable
Daniel P. Berrange [Tue, 23 Jan 2018 16:47:18 +0000 (16:47 +0000)]
make: fix help message reference to bogus V=0 variable

The make rules for building QEMU are mostly silent by default. They can
be made verbose by setting the variable V=1. The default state does not
however correspond to a V=0 setting - $(V) must be undefined / empty to
get the default quiet build.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <20180123164718.12714-3-berrange@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agoRevert "build-sys: silence make by default or V=0"
Daniel P. Berrange [Tue, 23 Jan 2018 16:47:17 +0000 (16:47 +0000)]
Revert "build-sys: silence make by default or V=0"

This reverts commit 42a77f1ce4934b243df003f95bda88530631387a.

The primary intention of this change was to silence messages
like

  make[1]: '/home/berrange/src/virt/qemu/capstone/libcapstone.a' is up to date.

which we get when calling make recursively with explicit
targets.

The problem is that this change affected every make target,
not merely the targets that triggered these "is up to date"
messages. As a result any targets that were not invoking
commands via "$(call quiet-command ...)" suddenly become
silent. This is particularly bad for "make install" which
now appears todo nothing.

Rather than go through every make rule and try to identify
places where we now need to explicitly print a message to
show work taking place, just revert the change.

To address the original problem of silencing "is up to date"
messages, we simply add --quiet to the SUBDIR_MAKEVARS
variable, so it only affects us on recursive make calls.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <20180123164718.12714-2-berrange@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7 years agoRevert "tests: use memfd in vhost-user-test"
Peter Maydell [Tue, 13 Feb 2018 09:51:52 +0000 (09:51 +0000)]
Revert "tests: use memfd in vhost-user-test"

This reverts commit 7e49f5e8e508ed020c96798b3f7083e24e0e425b.

This commit seems to break parallel 'make -j4 check';
revert it until we identify the problem.

Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.12-20180212' into staging
Peter Maydell [Mon, 12 Feb 2018 14:52:48 +0000 (14:52 +0000)]
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.12-20180212' into staging

ppc patch queue 2018-02-12

Here's the accumulatead ppc and pseries related patches for the last
while.  Highlights are:
    * A number of Macintosh / CUDA cleanups from Mark Cave-Ayland
    * An important bug fix (missing "break;") for
      H_GET_CPU_CHARACTERISTICS
    * Yet another fix for SMT mode handling
    * Assorted other cleanups and fixes

# gpg: Signature made Mon 12 Feb 2018 03:39:30 GMT
# gpg:                using RSA key 6C38CACA20D9B392
# 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-20180212:
  misc: introduce new mos6522 VIA device and enable it for ppc builds
  cuda: factor out timebase-derived counter value and load time
  cuda: set timer 1 frequency property to CUDA_TIMER_FREQ
  cuda: don't call cuda_update() when writing to ACR register
  cuda: minor cosmetic tidy-ups to get_next_irq_time()
  cuda: rename frequency property to tb_frequency
  cuda: introduce CUDAState parameter to get_counter()
  spapr: set vsmt to MAX(8, smp_threads)
  cuda: don't allow writes to port output pins
  cuda: do not use old_mmio accesses
  hw/ppc: rename functions in comments
  spapr: add missing break in h_get_cpu_characteristics()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging
Peter Maydell [Mon, 12 Feb 2018 13:00:03 +0000 (13:00 +0000)]
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging

trivial patches for 2018-02-10

# gpg: Signature made Sat 10 Feb 2018 07:54:03 GMT
# gpg:                using RSA key 701B4F6B1A693E59
# 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:
  tests/qapi: use ARRAY_SIZE macro
  tests/qapi: use QEMU_IS_ALIGNED macro
  tests/hbitmap: use ARRAY_SIZE macro
  async: use ARRAY_SIZE macro
  qga: use ARRAY_SIZE macro
  MAINTAINERS: Add qemu-binfmt-conf.sh script
  oslib-posix: check for posix_memalign in configure script
  maint: Mention web site maintenance in README
  build: fix typo in error message
  configure: Allow capstone=git only if git update is not disabled
  scripts/make-release: Don't archive .git files
  qemu-options.hx: Remove confusing spaces in parameter listings
  mailmap: set preferred spelling for Daniel Berrangé
  Drop unneeded system header includes
  machine: Polish -machine xxx,help
  scripts/argparse.py: spelling (independant)
  qapi-schema.json: spelling (independant comparation)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-02-09' into staging
Peter Maydell [Mon, 12 Feb 2018 09:36:28 +0000 (09:36 +0000)]
Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-02-09' into staging

nbd patches for 2018-02-09

- Vladimir Sementsov-Ogievskiy: iotests: 205: support luks format
- Eric Blake: block: Simplify bdrv_can_write_zeroes_with_unmap()

# gpg: Signature made Fri 09 Feb 2018 18:34:20 GMT
# gpg:                using RSA key A7A16B4A2527436A
# gpg: Good signature from "Eric Blake <eblake@redhat.com>"
# gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>"
# gpg:                 aka "[jpeg image of size 6874]"
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A

* remotes/ericb/tags/pull-nbd-2018-02-09:
  block: Simplify bdrv_can_write_zeroes_with_unmap()
  iotests: 205: support luks format

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agomisc: introduce new mos6522 VIA device and enable it for ppc builds
Mark Cave-Ayland [Fri, 9 Feb 2018 18:51:39 +0000 (18:51 +0000)]
misc: introduce new mos6522 VIA device and enable it for ppc builds

The MOS6522 VIA forms the bridge part of several Mac devices, including the
Mac via-cuda and via-pmu devices. Introduce a standard mos6522 device that
can be shared amongst multiple implementations.

This is effectively taking the 6522 parts out of cuda.c and turning them
into a separate device whilst also applying some style tidy-ups and including
a conversion to trace-events.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
7 years agocuda: factor out timebase-derived counter value and load time
Mark Cave-Ayland [Fri, 9 Feb 2018 18:51:38 +0000 (18:51 +0000)]
cuda: factor out timebase-derived counter value and load time

Commit b981289c49 "PPC: Cuda: Use cuda timer to expose tbfreq to guest" altered
the timer calculations from those based upon the hardware CUDA clock frequency
to those based upon the CPU timebase frequency.

In fact we can isolate the differences to 2 simple changes: one to the counter
read value and another to the counter load time. Move these changes into
separate functions so the implementation can be swapped later.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
7 years agocuda: set timer 1 frequency property to CUDA_TIMER_FREQ
Mark Cave-Ayland [Fri, 9 Feb 2018 18:51:37 +0000 (18:51 +0000)]
cuda: set timer 1 frequency property to CUDA_TIMER_FREQ

Now that we have successfully decoupled the timebase frequency and the hardware
timer frequency, set the timer 1 frequency property to CUDA_TIMER_FREQ and alter
get_next_irq_time() to use it rather than the hard-coded constant.

In addition to this we must now switch the tb_diff calculation over to use the
timebase frequency now that the hardware clock frequency and the timebase
frequency are different.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
[dwg: Correct a conflict due to a bug in an earlier patch]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
7 years agocuda: don't call cuda_update() when writing to ACR register
Mark Cave-Ayland [Fri, 9 Feb 2018 18:51:33 +0000 (18:51 +0000)]
cuda: don't call cuda_update() when writing to ACR register

The wire protocol for reading data to/from the VIA is triggered by changing
inputs on port B rather than changing the timer configuration via the ACR.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
7 years agocuda: minor cosmetic tidy-ups to get_next_irq_time()
Mark Cave-Ayland [Fri, 9 Feb 2018 18:51:36 +0000 (18:51 +0000)]
cuda: minor cosmetic tidy-ups to get_next_irq_time()

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
7 years agocuda: rename frequency property to tb_frequency
Mark Cave-Ayland [Fri, 9 Feb 2018 18:51:35 +0000 (18:51 +0000)]
cuda: rename frequency property to tb_frequency

This allows us to more easily differentiate between the timebase frequency used
to calibrate the MacOS timers and the actual frequency of the hardware clock as
indicated by CUDA_TIMER_FREQ.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
[dwg: Revert some extraneous changes which break compile]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
7 years agocuda: introduce CUDAState parameter to get_counter()
Mark Cave-Ayland [Fri, 9 Feb 2018 18:51:34 +0000 (18:51 +0000)]
cuda: introduce CUDAState parameter to get_counter()

This will be required shortly and also happens to match nicely with the
corresponding signature for set_counter().

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
7 years agospapr: set vsmt to MAX(8, smp_threads)
Laurent Vivier [Fri, 9 Feb 2018 08:18:58 +0000 (09:18 +0100)]
spapr: set vsmt to MAX(8, smp_threads)

We ignore silently the value of smp_threads when we set
the default VSMT value, and if smp_threads is greater than VSMT
kernel is going into trouble later.

Fixes: 8904e5a750
("spapr: Adjust default VSMT value for better migration compatibility")

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
7 years agotests/qapi: use ARRAY_SIZE macro
Philippe Mathieu-Daudé [Tue, 18 Jul 2017 06:10:05 +0000 (03:10 -0300)]
tests/qapi: use ARRAY_SIZE macro

Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agotests/qapi: use QEMU_IS_ALIGNED macro
Philippe Mathieu-Daudé [Tue, 18 Jul 2017 06:10:04 +0000 (03:10 -0300)]
tests/qapi: use QEMU_IS_ALIGNED macro

Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agotests/hbitmap: use ARRAY_SIZE macro
Philippe Mathieu-Daudé [Tue, 18 Jul 2017 06:10:03 +0000 (03:10 -0300)]
tests/hbitmap: use ARRAY_SIZE macro

Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
7 years agoasync: use ARRAY_SIZE macro
Philippe Mathieu-Daudé [Tue, 18 Jul 2017 06:09:59 +0000 (03:09 -0300)]
async: use ARRAY_SIZE macro

Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agoqga: use ARRAY_SIZE macro
Philippe Mathieu-Daudé [Tue, 18 Jul 2017 06:09:57 +0000 (03:09 -0300)]
qga: use ARRAY_SIZE macro

Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agocuda: don't allow writes to port output pins
Mark Cave-Ayland [Fri, 9 Feb 2018 18:51:32 +0000 (18:51 +0000)]
cuda: don't allow writes to port output pins

Use the direction registers as a mask to ensure that only input pins are
updated upon write.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
7 years agoMAINTAINERS: Add qemu-binfmt-conf.sh script
Thomas Huth [Tue, 2 Jan 2018 16:25:26 +0000 (17:25 +0100)]
MAINTAINERS: Add qemu-binfmt-conf.sh script

qemu-binfmt-conf.sh is used for the Linux usermode emulation, so
let's add this file to that section in the MAINTAINERS file.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
7 years agocuda: do not use old_mmio accesses
Mark Cave-Ayland [Fri, 9 Feb 2018 18:51:31 +0000 (18:51 +0000)]
cuda: do not use old_mmio accesses

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
7 years agooslib-posix: check for posix_memalign in configure script
Andreas Gustafsson [Thu, 4 Jan 2018 17:39:36 +0000 (19:39 +0200)]
oslib-posix: check for posix_memalign in configure script

Check for the presence of posix_memalign() in the configure script,
not using "defined(_POSIX_C_SOURCE) && !defined(__sun__)".  This
lets qemu use posix_memalign() on NetBSD versions that have it,
instead of falling back to valloc() which is wasteful when the
required alignment is smaller than a page.

Signed-off-by: Andreas Gustafsson <gson@gson.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Kamil Rytarowski <n54@gmx.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
7 years agomaint: Mention web site maintenance in README
Eric Blake [Wed, 29 Nov 2017 15:25:10 +0000 (09:25 -0600)]
maint: Mention web site maintenance in README

Now that we have a website that accepts patches on the list, the
main project should make it easier to find information about that
process.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Fam Zheng <famz@redhat.com>
7 years agobuild: fix typo in error message
Laurent Vivier [Fri, 19 Jan 2018 10:32:33 +0000 (11:32 +0100)]
build: fix typo in error message

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Fixes: f62bbee55d503f639ee9498878ebf42ff4f4299a
7 years agoconfigure: Allow capstone=git only if git update is not disabled
Alexey Kardashevskiy [Mon, 15 Jan 2018 02:35:01 +0000 (13:35 +1100)]
configure: Allow capstone=git only if git update is not disabled

Even with --disable-git-update, ./configure tries updating the capstone
submodule instead of marking it "no"; this disables capstone submodule
if git update is disabled.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Thomas Huth <thuth@redhat.com>