OSDN Git Service

qmiga/qemu.git
6 years agomigration: pass MigrationState to migrate_init()
Peter Xu [Thu, 8 Feb 2018 10:31:15 +0000 (18:31 +0800)]
migration: pass MigrationState to migrate_init()

Let the callers take the object, then pass it to migrate_init().

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180208103132.28452-12-peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
6 years agomigration: allow send_rq to fail
Peter Xu [Thu, 8 Feb 2018 10:31:12 +0000 (18:31 +0800)]
migration: allow send_rq to fail

We will not allow failures to happen when sending data from destination
to source via the return path. However it is possible that there can be
errors along the way.  This patch allows the migrate_send_rp_message()
to return error when it happens, and further extended it to
migrate_send_rp_req_pages().

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180208103132.28452-9-peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
6 years agomigration: provide postcopy_fault_thread_notify()
Peter Xu [Thu, 8 Feb 2018 10:31:07 +0000 (18:31 +0800)]
migration: provide postcopy_fault_thread_notify()

A general helper to notify the fault thread.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180208103132.28452-4-peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
6 years agomigration: reuse mis->userfault_quit_fd
Peter Xu [Thu, 8 Feb 2018 10:31:06 +0000 (18:31 +0800)]
migration: reuse mis->userfault_quit_fd

It was only used for quitting the page fault thread before. Let it be
something more useful - now we can use it to notify a "wake" for the
page fault thread (for any reason), and it only means "quit" if the
fault_thread_quit is set.

Since we changed what it does, renaming it to userfault_event_fd.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180208103132.28452-3-peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
6 years agomigration: better error handling with QEMUFile
Peter Xu [Thu, 8 Feb 2018 10:31:05 +0000 (18:31 +0800)]
migration: better error handling with QEMUFile

If the postcopy down due to some reason, we can always see this on dst:

  qemu-system-x86_64: RP: Received invalid message 0x0000 length 0x0000

However in most cases that's not the real issue. The problem is that
qemu_get_be16() has no way to show whether the returned data is valid or
not, and we are _always_ assuming it is valid. That's possibly not wise.

The best approach to solve this would be: refactoring QEMUFile interface
to allow the APIs to return error if there is. However it needs quite a
bit of work and testing. For now, let's explicitly check the validity
first before using the data in all places for qemu_get_*().

This patch tries to fix most of the cases I can see. Only if we are with
this, can we make sure we are processing the valid data, and also can we
make sure we can capture the channel down events correctly.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180208103132.28452-2-peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
6 years agotests/migration: Add test for migration to bad destination
Dr. David Alan Gilbert [Mon, 12 Feb 2018 16:03:40 +0000 (16:03 +0000)]
tests/migration: Add test for migration to bad destination

Check the source survives.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20180212160340.15333-3-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
6 years agomigration: Fix early failure cleanup
Dr. David Alan Gilbert [Mon, 12 Feb 2018 16:03:39 +0000 (16:03 +0000)]
migration: Fix early failure cleanup

Avoid crash in cleanup after a very early migration failure
(possibly due to my 688a3dcba980bf01344a  'Route errors down ...')

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20180212160340.15333-2-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
6 years agotests/migration: Add source to PC boot block
Dr. David Alan Gilbert [Tue, 13 Feb 2018 10:06:06 +0000 (10:06 +0000)]
tests/migration: Add source to PC boot block

The boot block used in the migration test is currently only
shipped as a hex (with the source in the git commit message of ea0c6d62),
change this to actually include the source.

A script is added to rebuild the header but the expectation is that
the generated hex is shipped as well as the .s, so that
there's no requirement to have just the right assembler etc.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20180213100606.5379-1-dgilbert@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  Removed blank line at end of script

6 years agomigration: improve documentation of postcopy-ram
Greg Kurz [Wed, 7 Feb 2018 15:41:43 +0000 (16:41 +0100)]
migration: improve documentation of postcopy-ram

This capability must have the same value on both source and destination,
otherwise migration fails (commit 875fcd013ab6 "migration: incoming
postcopy advise sanity checks").

Let's write it down in various places where postcopy-ram is documented.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <151801810352.29167.4832480228518630626.stgit@bahia.lan>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
6 years agomigration/xen: Check return value of qemu_fclose
Ross Lagerwall [Tue, 6 Feb 2018 16:30:39 +0000 (16:30 +0000)]
migration/xen: Check return value of qemu_fclose

QEMUFile uses buffered IO so when writing small amounts (such as the Xen
device state file), the actual write call and any errors that may occur
only happen as part of qemu_fclose(). Therefore, report IO errors when
saving the device state under Xen by checking the return value of
qemu_fclose().

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Message-Id: <20180206163039.23661-1-ross.lagerwall@citrix.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>

6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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

6 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>
6 years agoscripts/make-release: Don't archive .git files
Cole Robinson [Tue, 30 Jan 2018 19:33:35 +0000 (14:33 -0500)]
scripts/make-release: Don't archive .git files

As was last done in 379e21c25, we don't want .git files for
submodules here, which we aren't presently doing for capstone and
keycodemapdb.

Rather than delete the offending files before archiving, ask tar
to --exclude=.git

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Thomas Huth <thuth@redhat.com>
6 years agoqemu-options.hx: Remove confusing spaces in parameter listings
Thomas Huth [Tue, 30 Jan 2018 09:36:21 +0000 (10:36 +0100)]
qemu-options.hx: Remove confusing spaces in parameter listings

The spaces between the parameters in the chardev and tpmdev sections
are rather confusing than helpful, and prevent that the lists can be
copy-n-pasted easily for real usage. We also don't use such spaces
in other sections in the documentation, e.g. with the -netdev option,
so let's be consistent and remove the spaces in the chardev and tpmdev
sections, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agomailmap: set preferred spelling for Daniel Berrangé
Daniel P. Berrangé [Fri, 2 Feb 2018 18:26:59 +0000 (18:26 +0000)]
mailmap: set preferred spelling for Daniel Berrangé

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoDrop unneeded system header includes
Eric Blake [Wed, 7 Feb 2018 16:03:02 +0000 (10:03 -0600)]
Drop unneeded system header includes

<memory.h> is a non-standard obsolete header that was long ago
replaced by <string.h>.

<malloc.h> is a non-standard header; it is not obsolete (we must
use it for malloc_trim, for example), but generally should not
be used in files that just need malloc() and friends, where
<stdlib.h> is the standard header.

And since osdep.h already guarantees string.h and stdlib.h, we
can drop these unusual system header includes as redundant
rather than replacing them.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
6 years agomachine: Polish -machine xxx,help
Alexey Kardashevskiy [Thu, 26 Oct 2017 01:41:39 +0000 (12:41 +1100)]
machine: Polish -machine xxx,help

The "-machine xxx,help" prints kernel-irqchip possible values as
"OnOffSplit", this adds separators to the printed line.

Also, since only lower case letters are specified in qapi/common.json,
this changes the letter cases too.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
6 years agoscripts/argparse.py: spelling (independant)
Michael Tokarev [Thu, 11 Jan 2018 14:31:06 +0000 (17:31 +0300)]
scripts/argparse.py: spelling (independant)

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
6 years agoqapi-schema.json: spelling (independant comparation)
Michael Tokarev [Thu, 11 Jan 2018 14:20:16 +0000 (17:20 +0300)]
qapi-schema.json: spelling (independant comparation)

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
6 years agohw/ppc: rename functions in comments
Daniel Henrique Barboza [Fri, 9 Feb 2018 18:13:30 +0000 (16:13 -0200)]
hw/ppc: rename functions in comments

Commit bcb5ce08cf ("spapr: Rename machine init functions for clarity")
renamed ppc_spapr_reset to spapr_machine_reset and ppc_spapr_init
to spapr_machine_init. Let's also rename the references in
comments.

Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>