Re: [PATCH v10 10/10] vfio: Don't issue full 2^64 unmap

2020-10-30 Thread Alex Williamson
On Fri, 30 Oct 2020 06:25:34 -0400 "Michael S. Tsirkin" wrote: > On Thu, Oct 08, 2020 at 03:22:14PM -0600, Alex Williamson wrote: > > On Thu, 8 Oct 2020 19:15:58 +0200 > > Jean-Philippe Brucker wrote: > > > > > IOMMUs may declare memory reg

Re: [PATCH] vfio-pci: add Ascend devices passthrough quirks

2020-10-29 Thread Alex Williamson
On Thu, 29 Oct 2020 19:40:48 +0800 Binfeng Wu wrote: > Ascend is a series of SoC processors developed by Huawei. Ascend310/910 > are highly efficient, flexible, and programmable AI processors in this > series and support device passthrough via vfio-pci. Ascends device > xloader update is only

Re: Out-of-Process Device Emulation session at KVM Forum 2020

2020-10-29 Thread Alex Williamson
On Fri, 30 Oct 2020 09:11:23 +0800 Jason Wang wrote: > On 2020/10/29 下午11:46, Alex Williamson wrote: > > On Thu, 29 Oct 2020 23:09:33 +0800 > > Jason Wang wrote: > > > >> On 2020/10/29 下午10:31, Alex Williamson wrote: > >>> On Thu, 29 Oct 2

Re: [PATCH v1] docs/devel: Add VFIO device migration documentation

2020-10-29 Thread Alex Williamson
k. > > >> 2 files changed, 120 insertions(+) > >> create mode 100644 docs/devel/vfio-migration.rst > >> > >> diff --git a/MAINTAINERS b/MAINTAINERS > >> index 6a197bd358d6..6f3fcffc6b3d 100644 > >> --- a/MAINTAINERS > >>

Re: Out-of-Process Device Emulation session at KVM Forum 2020

2020-10-29 Thread Alex Williamson
On Thu, 29 Oct 2020 23:09:33 +0800 Jason Wang wrote: > On 2020/10/29 下午10:31, Alex Williamson wrote: > > On Thu, 29 Oct 2020 21:02:05 +0800 > > Jason Wang wrote: > > > >> On 2020/10/29 下午8:08, Stefan Hajnoczi wrote: > >>> Here are notes from t

Re: Out-of-Process Device Emulation session at KVM Forum 2020

2020-10-29 Thread Alex Williamson
On Thu, 29 Oct 2020 21:02:05 +0800 Jason Wang wrote: > On 2020/10/29 下午8:08, Stefan Hajnoczi wrote: > > Here are notes from the session: > > > > protocol stability: > > * vhost-user already exists for existing third-party applications > > * vfio-user is more general but will take more

[PULL v2 32/32] vfio: fix incorrect print type

2020-10-28 Thread Alex Williamson
From: Zhengui li The type of input variable is unsigned int while the printer type is int. So fix incorrect print type. Signed-off-by: Zhengui li Signed-off-by: Alex Williamson --- hw/vfio/common.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vfio/common.c b

[PULL v2 29/32] vfio: Add routine for finding VFIO_DEVICE_GET_INFO capabilities

2020-10-28 Thread Alex Williamson
From: Matthew Rosato 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 Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio/common.c | 10

[PULL v2 28/32] s390x/pci: use a PCI Function structure

2020-10-28 Thread Alex Williamson
Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/s390x/s390-pci-bus.c | 12 hw/s390x/s390-pci-inst.c|8 ++-- include/hw/s390x/s390-pci-bus.h |1 + 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw

[PULL v2 25/32] s390x/pci: create a header dedicated to PCI CLP

2020-10-28 Thread Alex Williamson
From: Pierre Morel 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 Signed-off-by: Matthew Rosato Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- include/hw

[PULL v2 21/32] vfio: Create shared routine for scanning info capabilities

2020-10-28 Thread Alex Williamson
From: Matthew Rosato Rather than duplicating the same loop in multiple locations, create a static function to do the work. Signed-off-by: Matthew Rosato Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio/common.c | 21

[PULL v2 24/32] s390x/pci: Honor DMA limits set by vfio

2020-10-28 Thread Alex Williamson
runs out. Signed-off-by: Matthew Rosato Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/s390x/s390-pci-bus.c | 16 +- hw/s390x/s390-pci-inst.c | 45 +- hw/s390x/s390-pci-vfio.c | 42

[PULL v2 20/32] s390x/pci: Move header files to include/hw/s390x

2020-10-28 Thread Alex Williamson
From: Matthew Rosato Seems a more appropriate location for them. Signed-off-by: Matthew Rosato Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- MAINTAINERS |1 hw/s390x/s390-pci-bus.c |4 hw/s390x/s390-pci-bus.h | 372

[PULL v2 16/32] vfio: Make vfio-pci device migration capable

2020-10-28 Thread Alex Williamson
and use migration blocker from generic structure of VFIO device. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio/pci.c | 28 hw/vfio/pci.h |1 - 2 files

[PULL v2 23/32] s390x/pci: Add routine to get the vfio dma available count

2020-10-28 Thread Alex Williamson
From: Matthew Rosato 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 Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson

[PULL v2 15/32] vfio: Add ioctl to get dirty pages bitmap during dma unmap

2020-10-28 Thread Alex Williamson
Williamson Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia [aw: llx -> PRIx64, __u64 -> uint64_t cast] Signed-off-by: Alex Williamson --- hw/vfio/common.c | 97 -- 1 file changed, 93 insertions(+), 4 deletions(-) diff --git a/hw/vfio/comm

[PULL v2 22/32] vfio: Find DMA available capability

2020-10-28 Thread Alex Williamson
[aw: vfio_get_info_dma_avail moved inside CONFIG_LINUX] Signed-off-by: Alex Williamson --- hw/vfio/common.c | 31 +++ include/hw/vfio/vfio-common.h |2 ++ 2 files changed, 33 insertions(+) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index

[PULL v2 31/32] hw/vfio: Use lock guard macros

2020-10-28 Thread Alex Williamson
From: Amey Narkhede Use qemu LOCK_GUARD macros in hw/vfio. Saves manual unlock calls Signed-off-by: Amey Narkhede Signed-off-by: Alex Williamson --- hw/vfio/platform.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index

[PULL v2 19/32] linux-headers: update against 5.10-rc1

2020-10-28 Thread Alex Williamson
From: Matthew Rosato commit 3650b228f83adda7e5ee532e2b90429c03f7b9ec Signed-off-by: Matthew Rosato [aw: drop pvrdma_ring.h changes to avoid revert of d73415a31547 ("qemu/atomic.h: rename atomic_ to qatomic_")] Signed-off-by: Alex Williamson --- .../infiniband/hw/vmw_pvrdma/pvrd

[PULL v2 30/32] s390x/pci: get zPCI function info from host

2020-10-28 Thread Alex Williamson
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 Reviewed-by: Cornelia Huck Signed-off-by: Alex

[PULL v2 08/32] vfio: Add save state functions to SaveVMHandlers

2020-10-28 Thread Alex Williamson
Polyakov Suggested-by: Zhi Wang Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Yan Zhao Signed-off-by: Alex Williamson --- hw/vfio/migration.c | 276 + hw/vfio/trace-events |6 + include/hw/vfio/vfio-common.h |1

[PULL v2 17/32] qapi: Add VFIO devices migration stats in Migration stats

2020-10-28 Thread Alex Williamson
From: Kirti Wankhede Added amount of bytes transferred to the VM at destination by all VFIO devices Signed-off-by: Kirti Wankhede Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alex Williamson --- hw/vfio/common.c | 19 +++ hw/vfio/migration.c

[PULL v2 18/32] update-linux-headers: Add vfio_zdev.h

2020-10-28 Thread Alex Williamson
From: Matthew Rosato vfio_zdev.h is used by s390x zPCI support to pass device-specific CLP information between host and userspace. Signed-off-by: Matthew Rosato Acked-by: Cornelia Huck Signed-off-by: Alex Williamson --- scripts/update-linux-headers.sh |2 +- 1 file changed, 1 insertion

[PULL v2 27/32] s390x/pci: clean up s390 PCI groups

2020-10-28 Thread Alex Williamson
From: Matthew Rosato Add a step to remove all stashed PCI groups to avoid stale data between machine resets. Signed-off-by: Matthew Rosato Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/s390x/s390-pci-bus.c | 12 1 file changed, 12 insertions(+) diff --git

[PULL v2 07/32] vfio: Register SaveVMHandlers for VFIO device

2020-10-28 Thread Alex Williamson
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 Reviewed-by: Neo Jia Reviewed-by: Cornelia Huck Reviewed-by: Yan Zhao Signed-off-by:

[PULL v2 14/32] vfio: Dirty page tracking when vIOMMU is enabled

2020-10-28 Thread Alex Williamson
From: Kirti Wankhede 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 Signed-off-by: Kirti Wankhede Reviewed-by: Yan Zhao

[PULL v2 05/32] vfio: Add VM state change handler to know state of VM

2020-10-28 Thread Alex Williamson
-by: Dr. David Alan Gilbert Reviewed-by: Cornelia Huck [aw: lx -> HWADDR_PRIx, remove redundant parens] Signed-off-by: Alex Williamson --- hw/vfio/migration.c | 160 + hw/vfio/trace-events |2 + include/hw/vfio/vfio-common.h |4 +

[PULL v2 26/32] s390x/pci: use a PCI Group structure

2020-10-28 Thread Alex Williamson
-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/s390x/s390-pci-bus.c | 42 +++ hw/s390x/s390-pci-inst.c| 23 + include/hw/s390x/s390-pci-bus.h | 10 + 3 files changed, 66 insertions(+), 9 deletions(-) diff --git

[PULL v2 13/32] vfio: Add vfio_listener_log_sync to mark dirty pages

2020-10-28 Thread Alex Williamson
Reviewed-by: Neo Jia [aw: llx -> PRIx64, __u64 -> uint64_t cast] Signed-off-by: Alex Williamson --- hw/vfio/common.c | 116 ++ hw/vfio/trace-events |1 2 files changed, 117 insertions(+) diff --git a/hw/vfio/common.c b/hw/vfio/common.c

[PULL v2 09/32] vfio: Add load state functions to SaveVMHandlers

2020-10-28 Thread Alex Williamson
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 Reviewed-by: Neo Jia Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Yan Zhao Signed-off-by: Alex Williamson --- hw/vfio

[PULL v2 11/32] vfio: Get migration capability flags for container

2020-10-28 Thread Alex Williamson
Disable migration for devices if IOMMU module doesn't support migration capability. Signed-off-by: Kirti Wankhede Cc: Shameer Kolothum Cc: Eric Auger Signed-off-by: Alex Williamson --- hw/vfio/common.c | 90 + hw/vfio/migration.c

[PULL v2 03/32] vfio: Add save and load functions for VFIO PCI devices

2020-10-28 Thread Alex Williamson
From: Kirti Wankhede Added functions to save and restore PCI device specific data, specifically config space of PCI device. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Signed-off-by: Alex Williamson --- hw/vfio/pci.c | 51

[PULL v2 12/32] vfio: Add function to start and stop dirty pages tracking

2020-10-28 Thread Alex Williamson
From: Kirti Wankhede Call VFIO_IOMMU_DIRTY_PAGES ioctl to start and stop dirty pages tracking for VFIO devices. Signed-off-by: Kirti Wankhede Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alex Williamson --- hw/vfio/migration.c | 36 1 file

[PULL v2 06/32] vfio: Add migration state change notifier

2020-10-28 Thread Alex Williamson
-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio/migration.c | 28 hw/vfio/trace-events |1 + include/hw/vfio/vfio-common.h |2 ++ 3 files changed, 31 insertions(+) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index

[PULL v2 04/32] vfio: Add migration region initialization and finalize function

2020-10-28 Thread Alex Williamson
Reviewed-by: Neo Jia Acked-by: Dr. David Alan Gilbert Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio/meson.build |1 hw/vfio/migration.c | 122 + hw/vfio/trace-events |3 + include/hw/vfio/vfio

[PULL v2 10/32] memory: Set DIRTY_MEMORY_MIGRATION when IOMMU is enabled

2020-10-28 Thread Alex Williamson
nkhede Reviewed-by: Yan Zhao Acked-by: Paolo Bonzini Signed-off-by: Alex Williamson --- softmmu/memory.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/softmmu/memory.c b/softmmu/memory.c index ee4a6bc16859..21d533d8ed84 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -

[PULL v2 01/32] vfio: Add function to unmap VFIO region

2020-10-28 Thread Alex Williamson
From: Kirti Wankhede 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 Reviewed-by: Neo Jia Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio

[PULL v2 02/32] vfio: Add vfio_get_object callback to VFIODeviceOps

2020-10-28 Thread Alex Williamson
From: Kirti Wankhede Hook vfio_get_object callback for PCI devices. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Suggested-by: Cornelia Huck Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio/pci.c |8 include/hw/vfio/vfio-common.h

[PULL v2 00/32] VFIO updates 2020-10-28 (for QEMU 5.2 soft-freeze)

2020-10-28 Thread Alex Williamson
The following changes since commit 33dc9914eac581dea9bdea35dcda4d542531d66a: Revert series: virtiofsd: Announce submounts to the guest (2020-10-28 13:17:32 +) are available in the Git repository at: git://github.com/awilliam/qemu-vfio.git tags/vfio-update-20201028.0 for you to fetch

Re: [PULL 00/32] VFIO updates 2020-10-26 (for QEMU 5.2 soft-freeze)

2020-10-28 Thread Alex Williamson
On Wed, 28 Oct 2020 11:20:36 -0400 Matthew Rosato wrote: > On 10/28/20 11:07 AM, Peter Maydell wrote: > > On Mon, 26 Oct 2020 at 19:39, Alex Williamson > > wrote: > >> > >> The following changes since commit > >> a5fac424c76d6401ecde4ecb7d846e656d

[PATCH] Revert series: virtiofsd: Announce submounts to the guest

2020-10-27 Thread Alex Williamson
quot;linux/fuse.h: Pull in from Linux") Cc: Max Reitz Cc: Stefan Hajnoczi Cc: Dr. David Alan Gilbert Signed-off-by: Alex Williamson --- The following pull request, based on legitimate v5.10-rc1 kernel headers, applies cleanly after this revert: https://lists.nongnu.org/archiv

Re: [PULL 00/32] VFIO updates 2020-10-26 (for QEMU 5.2 soft-freeze)

2020-10-27 Thread Alex Williamson
On Tue, 27 Oct 2020 23:42:57 + Peter Maydell wrote: > On Mon, 26 Oct 2020 at 19:39, Alex Williamson > wrote: > > > > VFIO update 2020-10-26 > > > > * Migration support (Kirti Wankhede) > >

[PULL 32/32] vfio: fix incorrect print type

2020-10-26 Thread Alex Williamson
From: Zhengui li The type of input variable is unsigned int while the printer type is int. So fix incorrect print type. Signed-off-by: Zhengui li Signed-off-by: Alex Williamson --- hw/vfio/common.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vfio/common.c b

[PULL 31/32] hw/vfio: Use lock guard macros

2020-10-26 Thread Alex Williamson
From: Amey Narkhede Use qemu LOCK_GUARD macros in hw/vfio. Saves manual unlock calls Signed-off-by: Amey Narkhede Signed-off-by: Alex Williamson --- hw/vfio/platform.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index

[PULL 25/32] s390x/pci: create a header dedicated to PCI CLP

2020-10-26 Thread Alex Williamson
From: Pierre Morel 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 Signed-off-by: Matthew Rosato Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- include/hw

[PULL 24/32] s390x/pci: Honor DMA limits set by vfio

2020-10-26 Thread Alex Williamson
runs out. Signed-off-by: Matthew Rosato Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/s390x/s390-pci-bus.c | 16 +- hw/s390x/s390-pci-inst.c | 45 +- hw/s390x/s390-pci-vfio.c | 42

[PULL 21/32] vfio: Create shared routine for scanning info capabilities

2020-10-26 Thread Alex Williamson
From: Matthew Rosato Rather than duplicating the same loop in multiple locations, create a static function to do the work. Signed-off-by: Matthew Rosato Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio/common.c | 21

[PULL 19/32] linux-headers: update against 5.10-rc1

2020-10-26 Thread Alex Williamson
From: Matthew Rosato commit 3650b228f83adda7e5ee532e2b90429c03f7b9ec Signed-off-by: Matthew Rosato [aw: drop pvrdma_ring.h changes to avoid revert of d73415a31547 ("qemu/atomic.h: rename atomic_ to qatomic_")] Signed-off-by: Alex Williamson --- .../infiniband/hw/vmw_pvrdma/pvrd

[PULL 23/32] s390x/pci: Add routine to get the vfio dma available count

2020-10-26 Thread Alex Williamson
From: Matthew Rosato 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 Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson

[PULL 22/32] vfio: Find DMA available capability

2020-10-26 Thread Alex Williamson
Signed-off-by: Alex Williamson --- hw/vfio/common.c | 31 +++ include/hw/vfio/vfio-common.h |2 ++ 2 files changed, 33 insertions(+) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 3714f8bcb84e..246adcdcaefa 100644 --- a/hw/vfio/common.c +++ b

[PULL 08/32] vfio: Add save state functions to SaveVMHandlers

2020-10-26 Thread Alex Williamson
Polyakov Suggested-by: Zhi Wang Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Yan Zhao Signed-off-by: Alex Williamson --- hw/vfio/migration.c | 276 + hw/vfio/trace-events |6 + include/hw/vfio/vfio-common.h |1

[PULL 30/32] s390x/pci: get zPCI function info from host

2020-10-26 Thread Alex Williamson
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 Reviewed-by: Cornelia Huck Signed-off-by: Alex

[PULL 14/32] vfio: Dirty page tracking when vIOMMU is enabled

2020-10-26 Thread Alex Williamson
From: Kirti Wankhede 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 Signed-off-by: Kirti Wankhede Reviewed-by: Yan Zhao

[PULL 11/32] vfio: Get migration capability flags for container

2020-10-26 Thread Alex Williamson
Disable migration for devices if IOMMU module doesn't support migration capability. Signed-off-by: Kirti Wankhede Cc: Shameer Kolothum Cc: Eric Auger Signed-off-by: Alex Williamson --- hw/vfio/common.c | 90 + hw/vfio/migration.c

[PULL 13/32] vfio: Add vfio_listener_log_sync to mark dirty pages

2020-10-26 Thread Alex Williamson
Reviewed-by: Neo Jia Signed-off-by: Alex Williamson --- hw/vfio/common.c | 116 ++ hw/vfio/trace-events |1 2 files changed, 117 insertions(+) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index d4959c036dd1..2634387df948 100644 --- a/hw

[PULL 17/32] qapi: Add VFIO devices migration stats in Migration stats

2020-10-26 Thread Alex Williamson
From: Kirti Wankhede Added amount of bytes transferred to the VM at destination by all VFIO devices Signed-off-by: Kirti Wankhede Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alex Williamson --- hw/vfio/common.c | 19 +++ hw/vfio/migration.c

[PULL 15/32] vfio: Add ioctl to get dirty pages bitmap during dma unmap

2020-10-26 Thread Alex Williamson
Williamson Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Signed-off-by: Alex Williamson --- hw/vfio/common.c | 96 -- 1 file changed, 92 insertions(+), 4 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index c0b5b6245a47

[PULL 07/32] vfio: Register SaveVMHandlers for VFIO device

2020-10-26 Thread Alex Williamson
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 Reviewed-by: Neo Jia Reviewed-by: Cornelia Huck Reviewed-by: Yan Zhao Signed-off-by:

[PULL 27/32] s390x/pci: clean up s390 PCI groups

2020-10-26 Thread Alex Williamson
From: Matthew Rosato Add a step to remove all stashed PCI groups to avoid stale data between machine resets. Signed-off-by: Matthew Rosato Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/s390x/s390-pci-bus.c | 12 1 file changed, 12 insertions(+) diff --git

[PULL 10/32] memory: Set DIRTY_MEMORY_MIGRATION when IOMMU is enabled

2020-10-26 Thread Alex Williamson
nkhede Reviewed-by: Yan Zhao Acked-by: Paolo Bonzini Signed-off-by: Alex Williamson --- softmmu/memory.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/softmmu/memory.c b/softmmu/memory.c index 403ff3abc99b..94f606e9d9d9 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -

[PULL 05/32] vfio: Add VM state change handler to know state of VM

2020-10-26 Thread Alex Williamson
-by: Dr. David Alan Gilbert Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio/migration.c | 160 + hw/vfio/trace-events |2 + include/hw/vfio/vfio-common.h |4 + 3 files changed, 166 insertions(+) diff --git a/hw

[PULL 26/32] s390x/pci: use a PCI Group structure

2020-10-26 Thread Alex Williamson
-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/s390x/s390-pci-bus.c | 42 +++ hw/s390x/s390-pci-inst.c| 23 + include/hw/s390x/s390-pci-bus.h | 10 + 3 files changed, 66 insertions(+), 9 deletions(-) diff --git

[PULL 06/32] vfio: Add migration state change notifier

2020-10-26 Thread Alex Williamson
-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio/migration.c | 28 hw/vfio/trace-events |1 + include/hw/vfio/vfio-common.h |2 ++ 3 files changed, 31 insertions(+) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index

[PULL 03/32] vfio: Add save and load functions for VFIO PCI devices

2020-10-26 Thread Alex Williamson
From: Kirti Wankhede Added functions to save and restore PCI device specific data, specifically config space of PCI device. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Signed-off-by: Alex Williamson --- hw/vfio/pci.c | 51

[PULL 29/32] vfio: Add routine for finding VFIO_DEVICE_GET_INFO capabilities

2020-10-26 Thread Alex Williamson
From: Matthew Rosato 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 Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio/common.c | 10

[PULL 20/32] s390x/pci: Move header files to include/hw/s390x

2020-10-26 Thread Alex Williamson
From: Matthew Rosato Seems a more appropriate location for them. Signed-off-by: Matthew Rosato Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- MAINTAINERS |1 hw/s390x/s390-pci-bus.c |4 hw/s390x/s390-pci-bus.h | 372

[PULL 04/32] vfio: Add migration region initialization and finalize function

2020-10-26 Thread Alex Williamson
Reviewed-by: Neo Jia Acked-by: Dr. David Alan Gilbert Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio/meson.build |1 hw/vfio/migration.c | 122 + hw/vfio/trace-events |3 + include/hw/vfio/vfio

[PULL 01/32] vfio: Add function to unmap VFIO region

2020-10-26 Thread Alex Williamson
From: Kirti Wankhede 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 Reviewed-by: Neo Jia Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio

[PULL 18/32] update-linux-headers: Add vfio_zdev.h

2020-10-26 Thread Alex Williamson
From: Matthew Rosato vfio_zdev.h is used by s390x zPCI support to pass device-specific CLP information between host and userspace. Signed-off-by: Matthew Rosato Acked-by: Cornelia Huck Signed-off-by: Alex Williamson --- scripts/update-linux-headers.sh |2 +- 1 file changed, 1 insertion

[PULL 02/32] vfio: Add vfio_get_object callback to VFIODeviceOps

2020-10-26 Thread Alex Williamson
From: Kirti Wankhede Hook vfio_get_object callback for PCI devices. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Suggested-by: Cornelia Huck Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio/pci.c |8 include/hw/vfio/vfio-common.h

[PULL 28/32] s390x/pci: use a PCI Function structure

2020-10-26 Thread Alex Williamson
Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/s390x/s390-pci-bus.c | 12 hw/s390x/s390-pci-inst.c|8 ++-- include/hw/s390x/s390-pci-bus.h |1 + 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw

[PULL 09/32] vfio: Add load state functions to SaveVMHandlers

2020-10-26 Thread Alex Williamson
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 Reviewed-by: Neo Jia Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Yan Zhao Signed-off-by: Alex Williamson --- hw/vfio

[PULL 16/32] vfio: Make vfio-pci device migration capable

2020-10-26 Thread Alex Williamson
and use migration blocker from generic structure of VFIO device. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson --- hw/vfio/pci.c | 28 hw/vfio/pci.h |1 - 2 files

[PULL 00/32] VFIO updates 2020-10-26 (for QEMU 5.2 soft-freeze)

2020-10-26 Thread Alex Williamson
The following changes since commit a5fac424c76d6401ecde4ecb7d846e656d0d6e89: Merge remote-tracking branch 'remotes/stefanha-gitlab/tags/block-pull-request' into staging (2020-10-26 10:33:59 +) are available in the Git repository at: git://github.com/awilliam/qemu-vfio.git

[PULL 12/32] vfio: Add function to start and stop dirty pages tracking

2020-10-26 Thread Alex Williamson
From: Kirti Wankhede Call VFIO_IOMMU_DIRTY_PAGES ioctl to start and stop dirty pages tracking for VFIO devices. Signed-off-by: Kirti Wankhede Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Alex Williamson --- hw/vfio/migration.c | 36 1 file

Re: [PATCH 02/13] linux-headers: update against 5.10-rc1

2020-10-26 Thread Alex Williamson
On Mon, 26 Oct 2020 11:34:30 -0400 Matthew Rosato wrote: > commit 3650b228f83adda7e5ee532e2b90429c03f7b9ec > > Signed-off-by: Matthew Rosato > --- > .../drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h | 14 ++-- > .../infiniband/hw/vmw_pvrdma/pvrdma_verbs.h| 2 +- >

Re: [PATCH 00/13] s390x/pci: s390-pci updates for kernel 5.10-rc1

2020-10-26 Thread Alex Williamson
On Mon, 26 Oct 2020 17:41:24 +0100 Cornelia Huck wrote: > On Mon, 26 Oct 2020 17:19:47 +0100 > Cornelia Huck wrote: > > > On Mon, 26 Oct 2020 11:34:28 -0400 > > Matthew Rosato wrote: > > > > > Combined set of patches that exploit vfio/s390-pci features available in > > > kernel 5.10-rc1.

Re: [PATCH v29 10/17] memory: Set DIRTY_MEMORY_MIGRATION when IOMMU is enabled

2020-10-26 Thread Alex Williamson
Paolo, Any objection to this change? Thanks, Alex On Mon, 26 Oct 2020 15:06:20 +0530 Kirti Wankhede wrote: > 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

Re: [PATCH v29 05/17] vfio: Add VM state change handler to know state of VM

2020-10-26 Thread Alex Williamson
On Mon, 26 Oct 2020 19:18:51 +0530 Kirti Wankhede wrote: > On 10/26/2020 6:30 PM, Alex Williamson wrote: > > On Mon, 26 Oct 2020 15:06:15 +0530 > > Kirti Wankhede wrote: > > > >> VM state change handler is called on change in VM's state. Based on > >

Re: [PATCH v29 05/17] vfio: Add VM state change handler to know state of VM

2020-10-26 Thread Alex Williamson
On Mon, 26 Oct 2020 15:06:15 +0530 Kirti Wankhede wrote: > 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:

Re: [PATCH v28 03/17] vfio: Add save and load functions for VFIO PCI devices

2020-10-24 Thread Alex Williamson
On Sun, 25 Oct 2020 01:18:37 +0530 Kirti Wankhede wrote: > On 10/24/2020 7:46 PM, Alex Williamson wrote: > > On Sat, 24 Oct 2020 19:53:39 +0800 > > Yan Zhao wrote: > > > >> hi > >> when I migrating VFs, the PCI_COMMAND is not properly saved. and th

Re: [PATCH v28 04/17] vfio: Add migration region initialization and finalize function

2020-10-24 Thread Alex Williamson
On Sat, 24 Oct 2020 15:09:14 +0530 Kirti Wankhede wrote: > On 10/23/2020 10:22 PM, Alex Williamson wrote: > > On Fri, 23 Oct 2020 16:10:30 +0530 > > Kirti Wankhede wrote: > > > >> Whether the VFIO device supports migration or not is decided based of > >&g

Re: [PATCH v28 03/17] vfio: Add save and load functions for VFIO PCI devices

2020-10-24 Thread Alex Williamson
On Sat, 24 Oct 2020 19:53:39 +0800 Yan Zhao wrote: > hi > when I migrating VFs, the PCI_COMMAND is not properly saved. and the > target side would meet below bug > root@tester:~# [ 189.360671] ++>> reset starts here: iavf_reset_task > !!! > [ 199.360798] iavf :00:04.0: Reset never

Re: [PATCH v28 04/17] vfio: Add migration region initialization and finalize function

2020-10-23 Thread Alex Williamson
On Fri, 23 Oct 2020 16:10:30 +0530 Kirti Wankhede wrote: > 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

Re: [PATCH v27 17/17] qapi: Add VFIO devices migration stats in Migration stats

2020-10-22 Thread Alex Williamson
On Thu, 22 Oct 2020 16:42:07 +0530 Kirti Wankhede wrote: > Added amount of bytes transferred to the VM at destination by all VFIO > devices > > Signed-off-by: Kirti Wankhede > Reviewed-by: Dr. David Alan Gilbert > --- > hw/vfio/common.c| 20 >

Re: [PATCH v27 00/17] Add migration support for VFIO devices

2020-10-22 Thread Alex Williamson
On Thu, 22 Oct 2020 16:41:50 +0530 Kirti Wankhede wrote: > Hi, > > This Patch set adds migration support for VFIO devices in QEMU. We're cutting it pretty close for the 5.2 soft freeze, but clearly we've seen this series a few times. The key points for me are that I no longer see anything

Re: [PATCH v27 14/17] vfio: Dirty page tracking when vIOMMU is enabled

2020-10-22 Thread Alex Williamson
On Thu, 22 Oct 2020 16:42:04 +0530 Kirti Wankhede wrote: > 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 Willi

Re: [PATCH v27 10/17] memory: Set DIRTY_MEMORY_MIGRATION when IOMMU is enabled

2020-10-22 Thread Alex Williamson
Paolo, I think this would need your ack. Thanks, Alex On Thu, 22 Oct 2020 16:42:00 +0530 Kirti Wankhede wrote: > 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

Re: [PATCH v27 09/17] vfio: Add load state functions to SaveVMHandlers

2020-10-22 Thread Alex Williamson
On Thu, 22 Oct 2020 16:41:59 +0530 Kirti Wankhede wrote: > 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

Re: [PATCH v27 07/17] vfio: Register SaveVMHandlers for VFIO device

2020-10-22 Thread Alex Williamson
On Thu, 22 Oct 2020 16:41:57 +0530 Kirti Wankhede wrote: > 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

Re: [PATCH v27 05/17] vfio: Add VM state change handler to know state of VM

2020-10-22 Thread Alex Williamson
On Thu, 22 Oct 2020 23:11:39 +0530 Kirti Wankhede wrote: > On 10/22/2020 10:05 PM, Alex Williamson wrote: > > On Thu, 22 Oct 2020 16:41:55 +0530 > > Kirti Wankhede wrote: > > > >> VM state change handler is called on change in VM's state. Based on > >

Re: [PATCH v27 05/17] vfio: Add VM state change handler to know state of VM

2020-10-22 Thread Alex Williamson
On Thu, 22 Oct 2020 16:41:55 +0530 Kirti Wankhede wrote: > 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:

Re: [PATCH v27 04/17] vfio: Add migration region initialization and finalize function

2020-10-22 Thread Alex Williamson
On Thu, 22 Oct 2020 16:41:54 +0530 Kirti Wankhede wrote: > 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

Re: [PATCH v27 03/17] vfio: Add save and load functions for VFIO PCI devices

2020-10-22 Thread Alex Williamson
On Thu, 22 Oct 2020 16:41:53 +0530 Kirti Wankhede wrote: > Added functions to save and restore PCI device specific data, > specifically config space of PCI device. > > Signed-off-by: Kirti Wankhede > Reviewed-by: Neo Jia > --- > hw/vfio/pci.c | 48 >

Re: [PATCH v26 03/17] vfio: Add save and load functions for VFIO PCI devices

2020-10-21 Thread Alex Williamson
On Wed, 21 Oct 2020 17:30:04 +0800 Zenghui Yu wrote: > On 2020/9/25 6:49, Alex Williamson wrote: > >> +} else if (interrupt_type == VFIO_INT_MSIX) { > >> +uint16_t offset; > >> + > >> +msix_load(pdev, f); > >>

Re: [PATCH 1/1] Skip flatview_simplify() for cpu vendor zhaoxin

2020-10-21 Thread Alex Williamson
On Wed, 21 Oct 2020 09:37:53 +0200 Paolo Bonzini wrote: > On 21/10/20 00:44, Alex Williamson wrote: > > Do we necessarily need a memory map ioctl for this or could it be the > > QEMU code that compares the old and new maps to trigger map and unmap > > ioctls? For ex

Re: [PATCH 1/1] Skip flatview_simplify() for cpu vendor zhaoxin

2020-10-20 Thread Alex Williamson
On Tue, 20 Oct 2020 11:24:58 +0200 Paolo Bonzini wrote: > On 19/10/20 21:02, Alex Williamson wrote: > >> For KVM we were thinking of changing the whole > >> memory map with a single ioctl, but that's much easier because KVM > >> builds its page tables lazily. It w

Re: [PATCH v26 13/17] vfio: create mapped iova list when vIOMMU is enabled

2020-10-19 Thread Alex Williamson
On Tue, 20 Oct 2020 00:45:28 +0530 Kirti Wankhede wrote: > On 10/19/2020 10:54 PM, Alex Williamson wrote: > > On Mon, 19 Oct 2020 11:31:03 +0530 > > Kirti Wankhede wrote: > > > >> On 9/26/2020 3:53 AM, Alex Williamson wrote: > >>> On Wed, 23 Se

Re: [PATCH 1/1] Skip flatview_simplify() for cpu vendor zhaoxin

2020-10-19 Thread Alex Williamson
On Fri, 16 Oct 2020 13:42:29 +0200 Paolo Bonzini wrote: > On 16/10/20 13:29, FelixCuioc wrote: > > The issue here is that an assinged EHCI device accesses > > an adjacent mapping between the delete and add phases > > of the VFIO MemoryListener. > > We want to skip flatview_simplify() is to

Re: [PATCH v26 06/17] vfio: Add migration state change notifier

2020-10-19 Thread Alex Williamson
On Sun, 18 Oct 2020 02:05:03 +0530 Kirti Wankhede wrote: > On 9/26/2020 1:50 AM, Alex Williamson wrote: > > On Wed, 23 Sep 2020 04:54:08 +0530 > > Kirti Wankhede wrote: > > > >> Added migration state change notifier to get notification on migration > &

<    2   3   4   5   6   7   8   9   10   11   >