qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 0f7a90: vfio: Add function to unmap VFIO regi


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 0f7a90: vfio: Add function to unmap VFIO region
Date: Mon, 02 Nov 2020 02:57:33 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 0f7a903ba3f0f8dfb347fb15b783aade4833826e
      
https://github.com/qemu/qemu/commit/0f7a903ba3f0f8dfb347fb15b783aade4833826e
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/common.c
    M hw/vfio/trace-events
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Add function to unmap VFIO region

This function will be used for migration region.
Migration region is mmaped when migration starts and will be unmapped when
migration is complete.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: e93b733bcf8ee185af14a0f90a217d51cf40e7ea
      
https://github.com/qemu/qemu/commit/e93b733bcf8ee185af14a0f90a217d51cf40e7ea
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/pci.c
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Add vfio_get_object callback to VFIODeviceOps

Hook vfio_get_object callback for PCI devices.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
Suggested-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: c5e2fb3ce4dbb158732420fbd3b963eebbcd85c8
      
https://github.com/qemu/qemu/commit/c5e2fb3ce4dbb158732420fbd3b963eebbcd85c8
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/pci.c
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Add save and load functions for VFIO PCI devices

Added functions to save and restore PCI device specific data,
specifically config space of PCI device.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: a9e271ec9b36ef4c7b5bc3b234c85d93931e192e
      
https://github.com/qemu/qemu/commit/a9e271ec9b36ef4c7b5bc3b234c85d93931e192e
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/meson.build
    A hw/vfio/migration.c
    M hw/vfio/trace-events
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Add migration region initialization and finalize function

Whether the VFIO device supports migration or not is decided based of
migration region query. If migration region query is successful and migration
region initialization is successful then migration is supported else
migration is blocked.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 02a7e71b1e5b1313060927e7c86a10be2d7083a7
      
https://github.com/qemu/qemu/commit/02a7e71b1e5b1313060927e7c86a10be2d7083a7
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/migration.c
    M hw/vfio/trace-events
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Add VM state change handler to know state of VM

VM state change handler is called on change in VM's state. Based on
VM state, VFIO device state should be changed.
Added read/write helper functions for migration region.
Added function to set device_state.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
[aw: lx -> HWADDR_PRIx, remove redundant parens]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 050c588c2ef6edd75769e6c4869d0ad625d5be90
      
https://github.com/qemu/qemu/commit/050c588c2ef6edd75769e6c4869d0ad625d5be90
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/migration.c
    M hw/vfio/trace-events
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Add migration state change notifier

Added migration state change notifier to get notification on migration state
change. These states are translated to VFIO device state and conveyed to
vendor driver.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 7c2f5f75f94a8820023a46169a4369fd8189a23c
      
https://github.com/qemu/qemu/commit/7c2f5f75f94a8820023a46169a4369fd8189a23c
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/migration.c
    M hw/vfio/trace-events

  Log Message:
  -----------
  vfio: Register SaveVMHandlers for VFIO device

Define flags to be used as delimiter in migration stream for VFIO devices.
Added .save_setup and .save_cleanup functions. Map & unmap migration
region from these functions at source during saving or pre-copy phase.

Set VFIO device state depending on VM's state. During live migration, VM is
running when .save_setup is called, _SAVING | _RUNNING state is set for VFIO
device. During save-restore, VM is paused, _SAVING state is set for VFIO device.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 1bc3c535ffbe512126a02b9f588497d5f5b7075b
      
https://github.com/qemu/qemu/commit/1bc3c535ffbe512126a02b9f588497d5f5b7075b
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/migration.c
    M hw/vfio/trace-events
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Add save state functions to SaveVMHandlers

Added .save_live_pending, .save_live_iterate and .save_live_complete_precopy
functions. These functions handles pre-copy and stop-and-copy phase.

In _SAVING|_RUNNING device state or pre-copy phase:
- read pending_bytes. If pending_bytes > 0, go through below steps.
- read data_offset - indicates kernel driver to write data to staging
  buffer.
- read data_size - amount of data in bytes written by vendor driver in
  migration region.
- read data_size bytes of data from data_offset in the migration region.
- Write data packet to file stream as below:
{VFIO_MIG_FLAG_DEV_DATA_STATE, data_size, actual data,
VFIO_MIG_FLAG_END_OF_STATE }

In _SAVING device state or stop-and-copy phase
a. read config space of device and save to migration file stream. This
   doesn't need to be from vendor driver. Any other special config state
   from driver can be saved as data in following iteration.
b. read pending_bytes. If pending_bytes > 0, go through below steps.
c. read data_offset - indicates kernel driver to write data to staging
   buffer.
d. read data_size - amount of data in bytes written by vendor driver in
   migration region.
e. read data_size bytes of data from data_offset in the migration region.
f. Write data packet as below:
   {VFIO_MIG_FLAG_DEV_DATA_STATE, data_size, actual data}
g. iterate through steps b to f while (pending_bytes > 0)
h. Write {VFIO_MIG_FLAG_END_OF_STATE}

When data region is mapped, its user's responsibility to read data from
data_offset of data_size before moving to next steps.

Added fix suggested by Artem Polyakov to reset pending_bytes in
vfio_save_iterate().
Added fix suggested by Zhi Wang to add 0 as data size in migration stream and
add END_OF_STATE delimiter to indicate phase complete.

Suggested-by: Artem Polyakov <artemp@nvidia.com>
Suggested-by: Zhi Wang <zhi.wang.linux@gmail.com>
Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 3336d21710130a3d64c901aeae2dc66c364f93ad
      
https://github.com/qemu/qemu/commit/3336d21710130a3d64c901aeae2dc66c364f93ad
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/migration.c
    M hw/vfio/trace-events

  Log Message:
  -----------
  vfio: Add load state functions to SaveVMHandlers

Sequence  during _RESUMING device state:
While data for this device is available, repeat below steps:
a. read data_offset from where user application should write data.
b. write data of data_size to migration region from data_offset.
c. write data_size which indicates vendor driver that data is written in
   staging buffer.

For user, data is opaque. User should write data in the same order as
received.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 74ee653799f93dfb119de9a248bdf0a85a68904f
      
https://github.com/qemu/qemu/commit/74ee653799f93dfb119de9a248bdf0a85a68904f
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M softmmu/memory.c

  Log Message:
  -----------
  memory: Set DIRTY_MEMORY_MIGRATION when IOMMU is enabled

mr->ram_block is NULL when mr->is_iommu is true, then fr.dirty_log_mask
wasn't set correctly due to which memory listener's log_sync doesn't
get called.
This patch returns log_mask with DIRTY_MEMORY_MIGRATION set when
IOMMU is enabled.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 87ea529c5020124440cd892a038dffe6057fd613
      
https://github.com/qemu/qemu/commit/87ea529c5020124440cd892a038dffe6057fd613
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/common.c
    M hw/vfio/migration.c
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Get migration capability flags for container

Added helper functions to get IOMMU info capability chain.
Added function to get migration capability information from that
capability chain for IOMMU container.

Similar change was proposed earlier:
https://lists.gnu.org/archive/html/qemu-devel/2018-05/msg03759.html

Disable migration for devices if IOMMU module doesn't support migration
capability.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Cc: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Cc: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: e663f516830c61f1dcafd2dda810126c14327b15
      
https://github.com/qemu/qemu/commit/e663f516830c61f1dcafd2dda810126c14327b15
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/migration.c

  Log Message:
  -----------
  vfio: Add function to start and stop dirty pages tracking

Call VFIO_IOMMU_DIRTY_PAGES ioctl to start and stop dirty pages tracking
for VFIO devices.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: b6dd6504e303d4339df2db765433bffa36dfbf8b
      
https://github.com/qemu/qemu/commit/b6dd6504e303d4339df2db765433bffa36dfbf8b
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/common.c
    M hw/vfio/trace-events

  Log Message:
  -----------
  vfio: Add vfio_listener_log_sync to mark dirty pages

vfio_listener_log_sync gets list of dirty pages from container using
VFIO_IOMMU_GET_DIRTY_BITMAP ioctl and mark those pages dirty when all
devices are stopped and saving state.
Return early for the RAM block section of mapped MMIO region.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
[aw: fix error_report types, fix cpu_physical_memory_set_dirty_lebitmap() cast]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 9a04fe09576b0399646e80e57ff2d2324f7cf64d
      
https://github.com/qemu/qemu/commit/9a04fe09576b0399646e80e57ff2d2324f7cf64d
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/common.c
    M hw/vfio/trace-events

  Log Message:
  -----------
  vfio: Dirty page tracking when vIOMMU is enabled

When vIOMMU is enabled, register MAP notifier from log_sync when all
devices in container are in stop and copy phase of migration. Call replay
and get dirty pages from notifier callback.

Suggested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 9e7b0442f23a92c27204d6f81a954f30f3126d33
      
https://github.com/qemu/qemu/commit/9e7b0442f23a92c27204d6f81a954f30f3126d33
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/common.c

  Log Message:
  -----------
  vfio: Add ioctl to get dirty pages bitmap during dma unmap

With vIOMMU, IO virtual address range can get unmapped while in pre-copy
phase of migration. In that case, unmap ioctl should return pages pinned
in that range and QEMU should find its correcponding guest physical
addresses and report those dirty.

Suggested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
[aw: fix error_report types, fix cpu_physical_memory_set_dirty_lebitmap() cast]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: a22651053b59b7d40bf921e8819ea696a3b0a9d2
      
https://github.com/qemu/qemu/commit/a22651053b59b7d40bf921e8819ea696a3b0a9d2
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/pci.c
    M hw/vfio/pci.h

  Log Message:
  -----------
  vfio: Make vfio-pci device migration capable

If the device is not a failover primary device, call
vfio_migration_probe() and vfio_migration_finalize() to enable
migration support for those devices that support it respectively to
tear it down again.
Removed migration blocker from VFIO PCI device specific structure and use
migration blocker from generic structure of  VFIO device.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 3710586caa5d91a52c0cf247e1c829a50f2e7b98
      
https://github.com/qemu/qemu/commit/3710586caa5d91a52c0cf247e1c829a50f2e7b98
  Author: Kirti Wankhede <kwankhede@nvidia.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/common.c
    M hw/vfio/migration.c
    M include/hw/vfio/vfio-common.h
    M migration/migration.c
    M monitor/hmp-cmds.c
    M qapi/migration.json

  Log Message:
  -----------
  qapi: Add VFIO devices migration stats in Migration stats

Added amount of bytes transferred to the VM at destination by all VFIO
devices

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 84567ea763874c633eddfd8c522d48bbe0bc5c8f
      
https://github.com/qemu/qemu/commit/84567ea763874c633eddfd8c522d48bbe0bc5c8f
  Author: Matthew Rosato <mjrosato@linux.ibm.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M scripts/update-linux-headers.sh

  Log Message:
  -----------
  update-linux-headers: Add vfio_zdev.h

vfio_zdev.h is used by s390x zPCI support to pass device-specific
CLP information between host and userspace.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 53ba2eee52bff5a746e96835539a1079f6bcadd1
      
https://github.com/qemu/qemu/commit/53ba2eee52bff5a746e96835539a1079f6bcadd1
  Author: Matthew Rosato <mjrosato@linux.ibm.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h
    M include/standard-headers/linux/ethtool.h
    M include/standard-headers/linux/fuse.h
    M include/standard-headers/linux/input-event-codes.h
    M include/standard-headers/linux/pci_regs.h
    M include/standard-headers/linux/virtio_fs.h
    M include/standard-headers/linux/virtio_gpu.h
    M include/standard-headers/linux/virtio_mmio.h
    M include/standard-headers/linux/virtio_pci.h
    M linux-headers/asm-arm64/kvm.h
    M linux-headers/asm-arm64/mman.h
    M linux-headers/asm-generic/hugetlb_encode.h
    M linux-headers/asm-generic/unistd.h
    M linux-headers/asm-mips/unistd_n32.h
    M linux-headers/asm-mips/unistd_n64.h
    M linux-headers/asm-mips/unistd_o32.h
    M linux-headers/asm-powerpc/unistd_32.h
    M linux-headers/asm-powerpc/unistd_64.h
    M linux-headers/asm-s390/unistd_32.h
    M linux-headers/asm-s390/unistd_64.h
    M linux-headers/asm-x86/kvm.h
    M linux-headers/asm-x86/unistd_32.h
    M linux-headers/asm-x86/unistd_64.h
    M linux-headers/asm-x86/unistd_x32.h
    M linux-headers/linux/kvm.h
    M linux-headers/linux/mman.h
    M linux-headers/linux/vfio.h
    A linux-headers/linux/vfio_zdev.h

  Log Message:
  -----------
  linux-headers: update against 5.10-rc1

commit 3650b228f83adda7e5ee532e2b90429c03f7b9ec

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
[aw: drop pvrdma_ring.h changes to avoid revert of d73415a31547 
("qemu/atomic.h: rename atomic_ to qatomic_")]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 408b55db8be3e3edae041d46ef8786fabc1476aa
      
https://github.com/qemu/qemu/commit/408b55db8be3e3edae041d46ef8786fabc1476aa
  Author: Matthew Rosato <mjrosato@linux.ibm.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M MAINTAINERS
    M hw/s390x/s390-pci-bus.c
    R hw/s390x/s390-pci-bus.h
    M hw/s390x/s390-pci-inst.c
    R hw/s390x/s390-pci-inst.h
    M hw/s390x/s390-virtio-ccw.c
    A include/hw/s390x/s390-pci-bus.h
    A include/hw/s390x/s390-pci-inst.h

  Log Message:
  -----------
  s390x/pci: Move header files to include/hw/s390x

Seems a more appropriate location for them.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 3ab7a0b40d4be5ade3b61d4afd1518193b199423
      
https://github.com/qemu/qemu/commit/3ab7a0b40d4be5ade3b61d4afd1518193b199423
  Author: Matthew Rosato <mjrosato@linux.ibm.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/common.c

  Log Message:
  -----------
  vfio: Create shared routine for scanning info capabilities

Rather than duplicating the same loop in multiple locations,
create a static function to do the work.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 7486a62845b1e12011dd99973e4739f69d57cd38
      
https://github.com/qemu/qemu/commit/7486a62845b1e12011dd99973e4739f69d57cd38
  Author: Matthew Rosato <mjrosato@linux.ibm.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/common.c
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Find DMA available capability

The underlying host may be limiting the number of outstanding DMA
requests for type 1 IOMMU.  Add helper functions to check for the
DMA available capability and retrieve the current number of DMA
mappings allowed.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
[aw: vfio_get_info_dma_avail moved inside CONFIG_LINUX]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: cd7498d07fbb20fa04790ff7ee168a8a8d01cb30
      
https://github.com/qemu/qemu/commit/cd7498d07fbb20fa04790ff7ee168a8a8d01cb30
  Author: Matthew Rosato <mjrosato@linux.ibm.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/s390x/meson.build
    A hw/s390x/s390-pci-vfio.c
    A include/hw/s390x/s390-pci-vfio.h

  Log Message:
  -----------
  s390x/pci: Add routine to get the vfio dma available count

Create new files for separating out vfio-specific work for s390
pci. Add the first such routine, which issues VFIO_IOMMU_GET_INFO
ioctl to collect the current dma available count.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
[aw: Fix non-Linux build with CONFIG_LINUX]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 37fa32de707340f3a93959ad5a1ebc41ba1520ee
      
https://github.com/qemu/qemu/commit/37fa32de707340f3a93959ad5a1ebc41ba1520ee
  Author: Matthew Rosato <mjrosato@linux.ibm.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/s390x/s390-pci-bus.c
    M hw/s390x/s390-pci-inst.c
    M hw/s390x/s390-pci-vfio.c
    M include/hw/s390x/s390-pci-bus.h
    M include/hw/s390x/s390-pci-inst.h
    M include/hw/s390x/s390-pci-vfio.h

  Log Message:
  -----------
  s390x/pci: Honor DMA limits set by vfio

When an s390 guest is using lazy unmapping, it can result in a very
large number of oustanding DMA requests, far beyond the default
limit configured for vfio.  Let's track DMA usage similar to vfio
in the host, and trigger the guest to flush their DMA mappings
before vfio runs out.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
[aw: non-Linux build fixes]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: c04274f49e0dd1f1279c0f74cbb89a902d8372eb
      
https://github.com/qemu/qemu/commit/c04274f49e0dd1f1279c0f74cbb89a902d8372eb
  Author: Pierre Morel <pmorel@linux.ibm.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M include/hw/s390x/s390-pci-bus.h
    A include/hw/s390x/s390-pci-clp.h
    M include/hw/s390x/s390-pci-inst.h

  Log Message:
  -----------
  s390x/pci: create a header dedicated to PCI CLP

To have a clean separation between s390-pci-bus.h and s390-pci-inst.h
headers we export the PCI CLP instructions in a dedicated header.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 28dc86a07299fba784ca2352f95e30fe603e17ab
      
https://github.com/qemu/qemu/commit/28dc86a07299fba784ca2352f95e30fe603e17ab
  Author: Pierre Morel <pmorel@linux.ibm.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/s390x/s390-pci-bus.c
    M hw/s390x/s390-pci-inst.c
    M include/hw/s390x/s390-pci-bus.h

  Log Message:
  -----------
  s390x/pci: use a PCI Group structure

We use a S390PCIGroup structure to hold the information related to a
zPCI Function group.

This allows us to be ready to support multiple groups and to retrieve
the group information from the host.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: b354d5d8049c513444b51ce841bd3136fed2e234
      
https://github.com/qemu/qemu/commit/b354d5d8049c513444b51ce841bd3136fed2e234
  Author: Matthew Rosato <mjrosato@linux.ibm.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/s390x/s390-pci-bus.c

  Log Message:
  -----------
  s390x/pci: clean up s390 PCI groups

Add a step to remove all stashed PCI groups to avoid stale data between
machine resets.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 9670ee752727945d8ce4f76efc0b68364b832f20
      
https://github.com/qemu/qemu/commit/9670ee752727945d8ce4f76efc0b68364b832f20
  Author: Pierre Morel <pmorel@linux.ibm.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/s390x/s390-pci-bus.c
    M hw/s390x/s390-pci-inst.c
    M include/hw/s390x/s390-pci-bus.h

  Log Message:
  -----------
  s390x/pci: use a PCI Function structure

We use a ClpRspQueryPci structure to hold the information related to a
zPCI Function.

This allows us to be ready to support different zPCI functions and to
retrieve the zPCI function information from the host.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 92fe289ace3e559e2d18d0c2e49cdfb4cbd5a59b
      
https://github.com/qemu/qemu/commit/92fe289ace3e559e2d18d0c2e49cdfb4cbd5a59b
  Author: Matthew Rosato <mjrosato@linux.ibm.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/common.c
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Add routine for finding VFIO_DEVICE_GET_INFO capabilities

Now that VFIO_DEVICE_GET_INFO supports capability chains, add a helper
function to find specific capabilities in the chain.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 1e7552ff5c34972a7a17d2b06900a0b66c79a68b
      
https://github.com/qemu/qemu/commit/1e7552ff5c34972a7a17d2b06900a0b66c79a68b
  Author: Matthew Rosato <mjrosato@linux.ibm.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/s390x/s390-pci-bus.c
    M hw/s390x/s390-pci-vfio.c
    M hw/s390x/trace-events
    M include/hw/s390x/s390-pci-bus.h
    M include/hw/s390x/s390-pci-clp.h
    M include/hw/s390x/s390-pci-vfio.h

  Log Message:
  -----------
  s390x/pci: get zPCI function info from host

We use the capability chains of the VFIO_DEVICE_GET_INFO ioctl to retrieve
the CLP information that the kernel exports.

To be compatible with previous kernel versions we fall back on previous
predefined values, same as the emulation values, when the ioctl is found
to not support capability chains. If individual CLP capabilities are not
found, we fall back on default values for only those capabilities missing
from the chain.

This patch is based on work previously done by Pierre Morel.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
[aw: non-Linux build fixes]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 88eef59796f91271e3d288f64457e975dd7c8ac9
      
https://github.com/qemu/qemu/commit/88eef59796f91271e3d288f64457e975dd7c8ac9
  Author: Amey Narkhede <ameynarkhede03@gmail.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/platform.c

  Log Message:
  -----------
  hw/vfio: Use lock guard macros

Use qemu LOCK_GUARD macros in hw/vfio.
Saves manual unlock calls

Signed-off-by: Amey Narkhede <ameynarkhede03@gmail.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: c624b6b312680b76d2a19a4c65cfdb234e875e1b
      
https://github.com/qemu/qemu/commit/c624b6b312680b76d2a19a4c65cfdb234e875e1b
  Author: Zhengui li <lizhengui@huawei.com>
  Date:   2020-11-01 (Sun, 01 Nov 2020)

  Changed paths:
    M hw/vfio/common.c

  Log Message:
  -----------
  vfio: fix incorrect print type

The type of input variable is unsigned int
while the printer type is int. So fix incorrect print type.

Signed-off-by: Zhengui li <lizhengui@huawei.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 2c6605389c1f76973d92b69b85d40d94b8f1092c
      
https://github.com/qemu/qemu/commit/2c6605389c1f76973d92b69b85d40d94b8f1092c
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M MAINTAINERS
    M hw/s390x/meson.build
    M hw/s390x/s390-pci-bus.c
    R hw/s390x/s390-pci-bus.h
    M hw/s390x/s390-pci-inst.c
    R hw/s390x/s390-pci-inst.h
    A hw/s390x/s390-pci-vfio.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/s390x/trace-events
    M hw/vfio/common.c
    M hw/vfio/meson.build
    A hw/vfio/migration.c
    M hw/vfio/pci.c
    M hw/vfio/pci.h
    M hw/vfio/platform.c
    M hw/vfio/trace-events
    A include/hw/s390x/s390-pci-bus.h
    A include/hw/s390x/s390-pci-clp.h
    A include/hw/s390x/s390-pci-inst.h
    A include/hw/s390x/s390-pci-vfio.h
    M include/hw/vfio/vfio-common.h
    M include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h
    M include/standard-headers/linux/ethtool.h
    M include/standard-headers/linux/fuse.h
    M include/standard-headers/linux/input-event-codes.h
    M include/standard-headers/linux/pci_regs.h
    M include/standard-headers/linux/virtio_fs.h
    M include/standard-headers/linux/virtio_gpu.h
    M include/standard-headers/linux/virtio_mmio.h
    M include/standard-headers/linux/virtio_pci.h
    M linux-headers/asm-arm64/kvm.h
    M linux-headers/asm-arm64/mman.h
    M linux-headers/asm-generic/hugetlb_encode.h
    M linux-headers/asm-generic/unistd.h
    M linux-headers/asm-mips/unistd_n32.h
    M linux-headers/asm-mips/unistd_n64.h
    M linux-headers/asm-mips/unistd_o32.h
    M linux-headers/asm-powerpc/unistd_32.h
    M linux-headers/asm-powerpc/unistd_64.h
    M linux-headers/asm-s390/unistd_32.h
    M linux-headers/asm-s390/unistd_64.h
    M linux-headers/asm-x86/kvm.h
    M linux-headers/asm-x86/unistd_32.h
    M linux-headers/asm-x86/unistd_64.h
    M linux-headers/asm-x86/unistd_x32.h
    M linux-headers/linux/kvm.h
    M linux-headers/linux/mman.h
    M linux-headers/linux/vfio.h
    A linux-headers/linux/vfio_zdev.h
    M migration/migration.c
    M monitor/hmp-cmds.c
    M qapi/migration.json
    M scripts/update-linux-headers.sh
    M softmmu/memory.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20201101.0' 
into staging

VFIO update 2020-11-01

 * Migration support (Kirti Wankhede)
 * s390 DMA limiting (Matthew Rosato)
 * zPCI hardware info (Matthew Rosato)
 * Lock guard (Amey Narkhede)
 * Print fixes (Zhengui li)
 * Warning/build fixes

# gpg: Signature made Sun 01 Nov 2020 20:38:10 GMT
# gpg:                using RSA key 239B9B6E3BB08B22
# gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" [full]
# gpg:                 aka "Alex Williamson <alex@shazbot.org>" [full]
# gpg:                 aka "Alex Williamson <alwillia@redhat.com>" [full]
# gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>" 
[full]
# Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22

* remotes/awilliam/tags/vfio-update-20201101.0: (32 commits)
  vfio: fix incorrect print type
  hw/vfio: Use lock guard macros
  s390x/pci: get zPCI function info from host
  vfio: Add routine for finding VFIO_DEVICE_GET_INFO capabilities
  s390x/pci: use a PCI Function structure
  s390x/pci: clean up s390 PCI groups
  s390x/pci: use a PCI Group structure
  s390x/pci: create a header dedicated to PCI CLP
  s390x/pci: Honor DMA limits set by vfio
  s390x/pci: Add routine to get the vfio dma available count
  vfio: Find DMA available capability
  vfio: Create shared routine for scanning info capabilities
  s390x/pci: Move header files to include/hw/s390x
  linux-headers: update against 5.10-rc1
  update-linux-headers: Add vfio_zdev.h
  qapi: Add VFIO devices migration stats in Migration stats
  vfio: Make vfio-pci device migration capable
  vfio: Add ioctl to get dirty pages bitmap during dma unmap
  vfio: Dirty page tracking when vIOMMU is enabled
  vfio: Add vfio_listener_log_sync to mark dirty pages
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/6f2ef80b0ce8...2c6605389c1f



reply via email to

[Prev in Thread] Current Thread [Next in Thread]