[PATCH v29 15/17] vfio: Add ioctl to get dirty pages bitmap during dma unmap

2020-10-26 Thread Kirti Wankhede
: Kirti Wankhede Reviewed-by: Neo Jia --- 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..49c68a5253ae 100644 --- a/hw/vfio/common.c +++ b/hw/vfio

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

2020-10-26 Thread Kirti Wankhede
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 Reviewed-by: Neo Jia Reviewed-by: Dr. David Alan Gi

[PATCH v29 08/17] vfio: Add save state functions to SaveVMHandlers

2020-10-26 Thread Kirti Wankhede
gested-by: Zhi Wang Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia Reviewed-by: Yan Zhao --- hw/vfio/migration.c | 276 ++ hw/vfio/trace-events | 6 + include/hw/vfio/vfio-common.h | 1 + 3 files changed, 283 insertions(+) d

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

2020-10-26 Thread Kirti Wankhede
on, 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 --- hw/vfio/migration

[PATCH v29 12/17] vfio: Add function to start and stop dirty pages tracking

2020-10-26 Thread 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 --- hw/vfio/migration.c | 36 1 file changed, 36 insertions(+) diff --git a/hw/vfio/migration.c b

[PATCH v29 13/17] vfio: Add vfio_listener_log_sync to mark dirty pages

2020-10-26 Thread Kirti Wankhede
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 Reviewed-by: Neo Jia

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

2020-10-26 Thread Kirti Wankhede
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

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

2020-10-26 Thread Kirti Wankhede
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 Reviewed-by: Neo Jia Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Cornelia Huck --- hw/vfio

[PATCH v29 16/17] vfio: Make vfio-pci device migration capable

2020-10-26 Thread Kirti Wankhede
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 --- hw/vfio/pci.c | 28 hw/vfio/pci.h | 1 - 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/hw

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

2020-10-26 Thread Kirti Wankhede
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 --- hw/vfio/migration.c | 195

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

2020-10-26 Thread 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 --- hw/vfio/common.c | 19 +++ hw/vfio/migration.c | 9 + include/hw/vfio/vfio-common.h | 3

[PATCH v29 11/17] vfio: Get migration capability flags for container

2020-10-26 Thread Kirti Wankhede
if IOMMU module doesn't support migration capability. Signed-off-by: Kirti Wankhede Cc: Shameer Kolothum Cc: Eric Auger --- hw/vfio/common.c | 90 +++ hw/vfio/migration.c | 7 +++- include/hw/vfio/vfio-common.h | 3 ++ 3

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

2020-10-26 Thread 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 --- hw/vfio/common.c

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

2020-10-26 Thread Kirti Wankhede
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 VM state, VFIO device state should be changed. Added read/write helper functions for migration region. Added fun

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

2020-10-26 Thread Kirti Wankhede
On 10/26/2020 7:32 PM, Alex Williamson wrote: 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 VM

Re: [RFC PATCH v2 1/3] vfio: Move the saving of the config space to the right place in VFIO migration

2021-02-18 Thread Kirti Wankhede
On 12/9/2020 1:39 PM, Shenming Lu wrote: On ARM64 the VFIO SET_IRQS ioctl is dependent on the VM interrupt setup, if the restoring of the VFIO PCI device config space is before the VGIC, an error might occur in the kernel. So we move the saving of the config space to the non-iterable process,

Re: [RFC PATCH v2 1/3] vfio: Move the saving of the config space to the right place in VFIO migration

2021-02-18 Thread Kirti Wankhede
On 1/27/2021 3:06 AM, Alex Williamson wrote: On Thu, 10 Dec 2020 10:21:21 +0800 Shenming Lu wrote: On 2020/12/10 2:34, Alex Williamson wrote: On Wed, 9 Dec 2020 13:29:47 +0100 Cornelia Huck wrote: On Wed, 9 Dec 2020 16:09:17 +0800 Shenming Lu wrote: On ARM64 the VFIO SET_IRQS io

[v2 1/1] vfio: Change default dirty pages tracking behavior during migration

2020-11-23 Thread Kirti Wankhede
device, dirty pages tracking during iterative phase will be disabled. Signed-off-by: Kirti Wankhede --- hw/vfio/common.c | 11 +++ hw/vfio/pci.c | 3 +++ include/hw/vfio/vfio-common.h | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/hw/vfi

Re: [v2 1/1] vfio: Change default dirty pages tracking behavior during migration

2020-11-23 Thread Kirti Wankhede
Sorry for spam, resending it again with 'PATCH'in subject. Kirti. On 11/23/2020 7:38 PM, Kirti Wankhede wrote: By default dirty pages tracking is enabled during iterative phase (pre-copy phase). Added per device opt-out option 'pre-copy-dirty-page-tracking' to disable

[PATCH v2 1/1] vfio: Change default dirty pages tracking behavior during migration

2020-11-23 Thread Kirti Wankhede
device, dirty pages tracking during iterative phase will be disabled. Signed-off-by: Kirti Wankhede --- hw/vfio/common.c | 11 +++ hw/vfio/pci.c | 3 +++ include/hw/vfio/vfio-common.h | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/hw/vfi

Re: [PATCH 1/1] Fix to show vfio migration stat in migration status

2020-11-23 Thread Kirti Wankhede
On 11/23/2020 10:03 PM, Alex Williamson wrote: On Thu, 19 Nov 2020 01:58:47 +0530 Kirti Wankhede wrote: Header file where CONFIG_VFIO is defined is not included in migration.c file. Include config devices header file in migration.c. Fixes: 3710586caa5d ("qapi: Add VFIO devices migr

Re: [PATCH 1/1] Fix to show vfio migration stat in migration status

2020-11-25 Thread Kirti Wankhede
On 11/25/2020 3:00 PM, Dr. David Alan Gilbert wrote: * Kirti Wankhede (kwankh...@nvidia.com) wrote: Header file where CONFIG_VFIO is defined is not included in migration.c file. Include config devices header file in migration.c. Fixes: 3710586caa5d ("qapi: Add VFIO devices migration

Re: [PATCH 1/1] Fix to show vfio migration stat in migration status

2020-11-25 Thread Kirti Wankhede
On 11/26/2020 12:33 AM, Dr. David Alan Gilbert wrote: * Kirti Wankhede (kwankh...@nvidia.com) wrote: On 11/25/2020 3:00 PM, Dr. David Alan Gilbert wrote: * Kirti Wankhede (kwankh...@nvidia.com) wrote: Header file where CONFIG_VFIO is defined is not included in migration.c file. Include

[PATCH v2 1/1] Fix to show vfio migration stat in migration status

2020-12-01 Thread Kirti Wankhede
stats") Signed-off-by: Kirti Wankhede --- hw/vfio/common.c | 12 +++- include/hw/vfio/vfio-common.h | 1 - include/hw/vfio/vfio.h| 2 ++ migration/migration.c | 16 +--- stubs/meson.build | 1 + stubs/vfio.c

[Qemu-devel] [PATCH v4 00/13] Add migration support for VFIO device

2019-06-20 Thread Kirti Wankhede
are copied. Thanks, Kirti Kirti Wankhede (13): vfio: KABI for migration interface vfio: Add function to unmap VFIO region vfio: Add save and load functions for VFIO PCI devices vfio: Add migration region initialization and finalize function vfio: Add VM state change handler to know state

[Qemu-devel] [PATCH v4 03/13] vfio: Add save and load functions for VFIO PCI devices

2019-06-20 Thread Kirti Wankhede
These functions save and restore PCI device specific data - config space of PCI device. Tested save and restore with MSI and MSIX type. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/pci.c | 112 ++ hw/vfio/pci.h | 29

[Qemu-devel] [PATCH v4 05/13] vfio: Add VM state change handler to know state of VM

2019-06-20 Thread Kirti Wankhede
mutex that is used to serialize operations on migration data region during saving state. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/migration.c | 45 +++ include/hw/vfio/vfio-common.h | 4 2 files changed, 49 insertions(+)

[Qemu-devel] [PATCH v4 06/13] vfio: Add migration state change notifier

2019-06-20 Thread Kirti Wankhede
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 Reviewed-by: Neo Jia --- hw/vfio/migration.c | 49

[Qemu-devel] [PATCH v4 01/13] vfio: KABI for migration interface

2019-06-20 Thread Kirti Wankhede
is page aligned. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- linux-headers/linux/vfio.h | 71 ++ 1 file changed, 71 insertions(+) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h index 24f505199f83..274ec477eb82 100644 --- a/

[Qemu-devel] [PATCH v4 04/13] vfio: Add migration region initialization and finalize function

2019-06-20 Thread Kirti Wankhede
- Migration functions are implemented for VFIO_DEVICE_TYPE_PCI device in this patch series. - VFIO device supports migration or not is decided based of migration region query. If migration region query is successful then migration is supported else migration is blocked. Signed-off-by: Kirti

[Qemu-devel] [PATCH v4 08/13] vfio: Add save state functions to SaveVMHandlers

2019-06-20 Thread Kirti Wankhede
outside the iothread lock in the migration case, which could race with asynchronous call to get dirty page list causing data corruption in mapped migration region. Mutex added here to serial migration buffer read operation. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/mig

[Qemu-devel] [PATCH v4 07/13] vfio: Register SaveVMHandlers for VFIO device

2019-06-20 Thread Kirti Wankhede
ning 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 --- hw/vfio/migration.c | 76 - 1 fil

[Qemu-devel] [PATCH v4 02/13] vfio: Add function to unmap VFIO region

2019-06-20 Thread Kirti Wankhede
This function is used in follwing patch in this series. Migration region is mmaped when migration starts and will be unmapped when migration is complete. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/common.c | 20 hw/vfio/trace-events

[Qemu-devel] [PATCH v4 10/13] vfio: Add function to get dirty page list

2019-06-20 Thread Kirti Wankhede
itmap from the region or mmaped part of the region. This copy is iterated till page bitmap for all requested pfns are copied. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/migration.c | 119 ++ include/hw/vfio/vfio-common.h

[Qemu-devel] [PATCH v4 12/13] vfio: Make vfio-pci device migration capable.

2019-06-20 Thread Kirti Wankhede
Call vfio_migration_probe() and vfio_migration_finalize() functions for vfio-pci device to enable migration for vfio PCI device. Removed vfio_pci_vmstate structure. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/pci.c | 14 -- 1 file changed, 8 insertions(+), 6

[Qemu-devel] [PATCH v4 09/13] vfio: Add load state functions to SaveVMHandlers

2019-06-20 Thread Kirti Wankhede
. - Repeat above until VFIO_MIG_FLAG_END_OF_STATE. - Unmap migration region. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/migration.c | 153 1 file changed, 153 insertions(+) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c

[Qemu-devel] [PATCH v4 11/13] vfio: Add vfio_listerner_log_sync to mark dirty pages

2019-06-20 Thread Kirti Wankhede
vfio_listerner_log_sync gets list of dirty pages from vendor driver and mark those pages dirty when in _SAVING state. Return early for the RAM block section of mapped MMIO region. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/common.c | 35

[Qemu-devel] [PATCH v4 13/13] vfio: Add trace events in migration code path

2019-06-20 Thread Kirti Wankhede
Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/migration.c | 26 ++ hw/vfio/trace-events | 18 ++ 2 files changed, 44 insertions(+) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 68775b5dec11..70c03f1a969f 100644 --- a/hw

Re: [Qemu-devel] [PATCH v4 01/13] vfio: KABI for migration interface

2019-06-20 Thread Kirti Wankhede
On 6/20/2019 10:48 PM, Alex Williamson wrote: > On Thu, 20 Jun 2019 20:07:29 +0530 > Kirti Wankhede wrote: > >> - Defined MIGRATION region type and sub-type. >> - Used 3 bits to define VFIO device states. >> Bit 0 => _RUNNING >> Bit 1

Re: [Qemu-devel] [PATCH v4 13/13] vfio: Add trace events in migration code path

2019-06-20 Thread Kirti Wankhede
On 6/21/2019 12:20 AM, Dr. David Alan Gilbert wrote: > * Kirti Wankhede (kwankh...@nvidia.com) wrote: >> Signed-off-by: Kirti Wankhede >> Reviewed-by: Neo Jia > > Thanks, adding traces really helps; however, it might be easier > if you just add them in your previ

Re: [Qemu-devel] [PATCH v4 03/13] vfio: Add save and load functions for VFIO PCI devices

2019-06-20 Thread Kirti Wankhede
On 6/21/2019 5:42 AM, Yan Zhao wrote: > On Thu, Jun 20, 2019 at 10:37:31PM +0800, Kirti Wankhede wrote: >> These functions save and restore PCI device specific data - config >> space of PCI device. >> Tested save and restore with MSI and MSIX type. >> >&

Re: [Qemu-devel] [PATCH v4 08/13] vfio: Add save state functions to SaveVMHandlers

2019-06-20 Thread Kirti Wankhede
On 6/21/2019 12:55 AM, Alex Williamson wrote: > On Thu, 20 Jun 2019 20:07:36 +0530 > Kirti Wankhede wrote: > >> Added .save_live_pending, .save_live_iterate and .save_live_complete_precopy >> functions. These functions handles pre-copy and stop-and-copy phase. >> &g

Re: [Qemu-devel] [PATCH v4 00/13] Add migration support for VFIO device

2019-06-21 Thread Kirti Wankhede
On 6/21/2019 6:54 AM, Yan Zhao wrote: > On Fri, Jun 21, 2019 at 08:25:18AM +0800, Yan Zhao wrote: >> On Thu, Jun 20, 2019 at 10:37:28PM +0800, Kirti Wankhede wrote: >>> Add migration support for VFIO device >>> >>> This Patch set include patches as below: &

Re: [Qemu-devel] [PATCH v4 00/13] Add migration support for VFIO device

2019-06-21 Thread Kirti Wankhede
On 6/21/2019 2:16 PM, Yan Zhao wrote: > On Fri, Jun 21, 2019 at 04:02:50PM +0800, Kirti Wankhede wrote: >> >> >> On 6/21/2019 6:54 AM, Yan Zhao wrote: >>> On Fri, Jun 21, 2019 at 08:25:18AM +0800, Yan Zhao wrote: >>>> On Thu, Jun 20, 2019 at 10:37:2

Re: [Qemu-devel] [PATCH v4 01/13] vfio: KABI for migration interface

2019-06-21 Thread Kirti Wankhede
On 6/21/2019 8:33 PM, Alex Williamson wrote: > On Fri, 21 Jun 2019 11:22:15 +0530 > Kirti Wankhede wrote: > >> On 6/20/2019 10:48 PM, Alex Williamson wrote: >>> On Thu, 20 Jun 2019 20:07:29 +0530 >>> Kirti Wankhede wrote: >>> >>>> - D

Re: [Qemu-devel] [PATCH v4 08/13] vfio: Add save state functions to SaveVMHandlers

2019-06-21 Thread Kirti Wankhede
On 6/21/2019 8:46 PM, Alex Williamson wrote: > On Fri, 21 Jun 2019 12:08:26 +0530 > Kirti Wankhede wrote: > >> On 6/21/2019 12:55 AM, Alex Williamson wrote: >>> On Thu, 20 Jun 2019 20:07:36 +0530 >>> Kirti Wankhede wrote: >>> >>>

Re: [Qemu-devel] [PATCH v4 08/13] vfio: Add save state functions to SaveVMHandlers

2019-06-21 Thread Kirti Wankhede
On 6/22/2019 1:32 AM, Alex Williamson wrote: > On Sat, 22 Jun 2019 01:08:40 +0530 > Kirti Wankhede wrote: > >> On 6/21/2019 8:46 PM, Alex Williamson wrote: >>> On Fri, 21 Jun 2019 12:08:26 +0530 >>> Kirti Wankhede wrote: >>> >>>> On

Re: [Qemu-devel] [PATCH v4 01/13] vfio: KABI for migration interface

2019-06-21 Thread Kirti Wankhede
+fk0vx8PkrKv4QYFFD4HjAq czjuZ2V3Kvaekug8J3z1OS19D9qBPPZPy+dLLJUKDP79rwjCt5864jGI5Dw1xrjQZ3 6Zf6qi/eUdohu1DG7YmV7D+UB0qDMO3GW/p9e3KpSIuI6/M7ttLcH0+0fsJ+Cpp0VM HqZfnKLeJgctg== On 6/22/2019 1:30 AM, Alex Williamson wrote: > On Sat, 22 Jun 2019 01:05:48 +0530 > Kirti Wankhede

Re: [Qemu-devel] [PATCH v4 08/13] vfio: Add save state functions to SaveVMHandlers

2019-06-21 Thread Kirti Wankhede
On 6/22/2019 2:02 AM, Alex Williamson wrote: > On Sat, 22 Jun 2019 01:37:47 +0530 > Kirti Wankhede wrote: > >> On 6/22/2019 1:32 AM, Alex Williamson wrote: >>> On Sat, 22 Jun 2019 01:08:40 +0530 >>> Kirti Wankhede wrote: >>> >>>> On 6/

Re: [Qemu-devel] [PATCH v4 08/13] vfio: Add save state functions to SaveVMHandlers

2019-06-24 Thread Kirti Wankhede
>> +static int vfio_save_buffer(QEMUFile *f, VFIODevice *vbasedev) >> +{ >> +VFIOMigration *migration = vbasedev->migration; >> +VFIORegion *region = &migration->region.buffer; >> +uint64_t data_offset = 0, data_size = 0; >> +int ret;

Re: [Qemu-devel] [PATCH v4 01/13] vfio: KABI for migration interface

2019-06-24 Thread Kirti Wankhede
On 6/22/2019 3:31 AM, Alex Williamson wrote: > On Sat, 22 Jun 2019 02:00:08 +0530 > Kirti Wankhede wrote: >> On 6/22/2019 1:30 AM, Alex Williamson wrote: >>> On Sat, 22 Jun 2019 01:05:48 +0530 >>> Kirti Wankhede wrote: >>> >>>> On 6/21/

Re: [Qemu-devel] [PATCH v4 01/13] vfio: KABI for migration interface

2019-06-24 Thread Kirti Wankhede
On 6/24/2019 8:55 PM, Alex Williamson wrote: > On Mon, 24 Jun 2019 20:30:08 +0530 > Kirti Wankhede wrote: > >> On 6/22/2019 3:31 AM, Alex Williamson wrote: >>> On Sat, 22 Jun 2019 02:00:08 +0530 >>> Kirti Wankhede wrote: >>>> On 6/22/2019 1:30

Re: [Qemu-devel] [PATCH v4 01/13] vfio: KABI for migration interface

2019-06-25 Thread Kirti Wankhede
On 6/25/2019 12:31 AM, Alex Williamson wrote: > On Tue, 25 Jun 2019 00:22:16 +0530 > Kirti Wankhede wrote: > >> On 6/24/2019 8:55 PM, Alex Williamson wrote: >>> On Mon, 24 Jun 2019 20:30:08 +0530 >>> Kirti Wankhede wrote: >>> >>>> O

Re: [Qemu-devel] [PATCH v4 07/13] vfio: Register SaveVMHandlers for VFIO device

2019-06-27 Thread Kirti Wankhede
On 6/27/2019 3:31 PM, Dr. David Alan Gilbert wrote: > * Kirti Wankhede (kwankh...@nvidia.com) wrote: >> Define flags to be used as delimeter in migration file stream. >> Added .save_setup and .save_cleanup functions. Mapped & unmapped migration >> region from these f

Re: [Qemu-devel] [PATCH v4 04/13] vfio: Add migration region initialization and finalize function

2019-06-27 Thread Kirti Wankhede
On 6/24/2019 7:30 PM, Cornelia Huck wrote: > On Thu, 20 Jun 2019 20:07:32 +0530 > Kirti Wankhede wrote: > >> - Migration functions are implemented for VFIO_DEVICE_TYPE_PCI device in this >> patch series. >> - VFIO device supports migration or not is decide

[PATCH v9 Kernel 1/5] vfio: KABI for migration interface for device state

2019-11-12 Thread Kirti Wankhede
might not end at offset which is page aligned. Vendor driver should decide whether to partition data section and how to partition the data section. Vendor driver should return data_offset accordingly. For user application, data is opaque. User should write data in the same order as received.

[PATCH v9 Kernel 2/5] vfio iommu: Add ioctl defination to get dirty pages bitmap.

2019-11-12 Thread Kirti Wankhede
All pages pinned by vendor driver through vfio_pin_pages API should be considered as dirty during migration. IOMMU container maintains a list of all such pinned pages. Added an ioctl defination to get bitmap of such pinned pages for requested IO virtual address range. Signed-off-by: Kirti

[PATCH v9 QEMU 02/15] vfio iommu: Add ioctl defination to get dirty pages bitmap.

2019-11-12 Thread Kirti Wankhede
All pages pinned by vendor driver through vfio_pin_pages API should be considered as dirty during migration. IOMMU container maintains a list of all such pinned pages. Added an ioctl defination to get bitmap of such pinned pages for requested IO virtual address range. Signed-off-by: Kirti

[PATCH v9 Kernel 3/5] vfio iommu: Add ioctl defination to unmap IOVA and return dirty bitmap

2019-11-12 Thread Kirti Wankhede
source to destination. IOCTL defination added here add bitmap pointer, size and flag. If flag VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP is set and bitmap memory is allocated and bitmap_size of set, then ioctl will create bitmap of pinned pages and then unmap those. Signed-off-by: Kirti Wankhede Reviewed

[PATCH v9 Kernel 0/5] Add KABIs to support migration for VFIO devices

2019-11-12 Thread Kirti Wankhede
l requested pages are copied. Thanks, Kirti Kirti Wankhede (5): vfio: KABI for migration interface for device state vfio iommu: Add ioctl defination to get dirty pages bitmap. vfio iommu: Add ioctl defination to unmap IOVA and return dirty bitmap vfio iommu: Implementation of ioctl

[PATCH v9 Kernel 5/5] vfio iommu: Implementation of ioctl to get dirty bitmap before unmap

2019-11-12 Thread Kirti Wankhede
. If flag is not set, then it behaves same as VFIO_IOMMU_UNMAP_DMA ioctl. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- drivers/vfio/vfio_iommu_type1.c | 71 +++-- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/drivers/vfio

[PATCH v9 QEMU 03/15] vfio iommu: Add ioctl defination to unmap IOVA and return dirty bitmap

2019-11-12 Thread Kirti Wankhede
source to destination. IOCTL defination added here add bitmap pointer, size and flag. If flag VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP is set and bitmap memory is allocated and bitmap_size of set, then ioctl will create bitmap of pinned pages and then unmap those. Signed-off-by: Kirti Wankhede Reviewed

[PATCH v9 Kernel 4/5] vfio iommu: Implementation of ioctl to get dirty pages bitmap.

2019-11-12 Thread Kirti Wankhede
. This ioctl returns bitmap of dirty pages, its user space application responsibility to copy content of dirty pages from source to destination during migration. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- drivers/vfio/vfio_iommu_type1.c | 92 + 1

[PATCH v9 QEMU 07/15] vfio: Add migration region initialization and finalize function

2019-11-12 Thread Kirti Wankhede
supported else migration is blocked. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/Makefile.objs | 2 +- hw/vfio/migration.c | 137 ++ hw/vfio/trace-events | 3 + include/hw/vfio/vfio-common.h | 10 +++ 4 files

[PATCH v9 QEMU 01/15] vfio: KABI for migration interface for device state

2019-11-12 Thread Kirti Wankhede
driver should decide whether to partition data section and how to partition the data section. Vendor driver should return data_offset accordingly. For user application, data is opaque. User should write data in the same order as received. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --

[PATCH v9 QEMU 11/15] vfio: Add save state functions to SaveVMHandlers

2019-11-12 Thread Kirti Wankhede
offset of data_size before moving to next steps. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/migration.c | 245 ++- hw/vfio/trace-events | 6 ++ 2 files changed, 250 insertions(+), 1 deletion(-) diff --git a/hw/vfio/migration.c b/

[PATCH v9 Qemu 00/15] Add migration support for VFIO devices

2019-11-12 Thread Kirti Wankhede
of migration region. - Added both type of access support, trapped or mmapped, for data section of the region. - Moved PCI device functions to pci file. - Added iteration to get dirty page bitmap until bitmap for all requested pages are copied. Thanks, Kirti Kirti Wankhede (15): vfio: KABI for mig

[PATCH v9 QEMU 08/15] vfio: Add VM state change handler to know state of VM

2019-11-12 Thread Kirti Wankhede
VM state change handler gets called on change in VM's state. This is used to set VFIO device state to _RUNNING. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/migration.c | 69 +++ hw/vfio/trace-events | 2 ++ in

[PATCH v9 QEMU 14/15] vfio: Add ioctl to get dirty pages bitmap during dma unmap.

2019-11-12 Thread Kirti Wankhede
ng to see how I can test this code path. Suggested-by: Alex Williamson Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/common.c | 65 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/hw/vfio/common.c b/hw

[PATCH v9 QEMU 04/15] vfio: Add function to unmap VFIO region

2019-11-12 Thread 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 --- hw/vfio/common.c | 20 hw/vfio

[PATCH v9 QEMU 10/15] vfio: Register SaveVMHandlers for VFIO device

2019-11-12 Thread Kirti Wankhede
ning 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 --- hw/vfio/migration.c | 70 hw/v

[PATCH v9 QEMU 05/15] vfio: Add vfio_get_object callback to VFIODeviceOps

2019-11-12 Thread 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 --- hw/vfio/pci.c | 8 include/hw/vfio/vfio-common.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/vfio

[PATCH v9 QEMU 13/15] vfio: Add vfio_listener_log_sync to mark dirty pages

2019-11-12 Thread Kirti Wankhede
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 Reviewed-by: Neo Jia

[PATCH v9 QEMU 06/15] vfio: Add save and load functions for VFIO PCI devices

2019-11-12 Thread Kirti Wankhede
These functions save and restore PCI device specific data - config space of PCI device. Tested save and restore with MSI and MSIX type. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/pci.c | 168 ++ include/hw/vfio/vfio

[PATCH v9 QEMU 09/15] vfio: Add migration state change notifier

2019-11-12 Thread Kirti Wankhede
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 Reviewed-by: Neo Jia --- hw/vfio/migration.c | 28 hw/vfio

[PATCH v9 QEMU 15/15] vfio: Make vfio-pci device migration capable.

2019-11-12 Thread Kirti Wankhede
and use migration blocker from generic structure of VFIO device. Signed-off-by: Kirti Wankhede Reviewed-by: Neo Jia --- hw/vfio/pci.c | 30 +++--- hw/vfio/pci.h | 1 - 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index

[PATCH v9 QEMU 12/15] vfio: Add load state functions to SaveVMHandlers

2019-11-12 Thread Kirti Wankhede
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 --- hw/vfio/migration.c | 170 +++ hw/vfio/trace-events | 3 + 2 files changed, 173

Re: [PATCH v9 Kernel 1/5] vfio: KABI for migration interface for device state

2019-11-13 Thread Kirti Wankhede
On 11/13/2019 8:53 AM, Yan Zhao wrote: On Wed, Nov 13, 2019 at 06:30:05AM +0800, Alex Williamson wrote: On Tue, 12 Nov 2019 22:33:36 +0530 Kirti Wankhede wrote: - Defined MIGRATION region type and sub-type. - Used 3 bits to define VFIO device states. Bit 0 => _RUNNING Bi

Re: [PATCH v9 Kernel 1/5] vfio: KABI for migration interface for device state

2019-11-13 Thread Kirti Wankhede
On 11/13/2019 11:57 PM, Alex Williamson wrote: On Wed, 13 Nov 2019 11:24:17 +0100 Cornelia Huck wrote: On Tue, 12 Nov 2019 15:30:05 -0700 Alex Williamson wrote: On Tue, 12 Nov 2019 22:33:36 +0530 Kirti Wankhede wrote: - Defined MIGRATION region type and sub-type. - Used 3 bits to

Re: [PATCH v9 Kernel 2/5] vfio iommu: Add ioctl defination to get dirty pages bitmap.

2019-11-13 Thread Kirti Wankhede
On 11/13/2019 4:00 AM, Alex Williamson wrote: On Tue, 12 Nov 2019 22:33:37 +0530 Kirti Wankhede wrote: All pages pinned by vendor driver through vfio_pin_pages API should be considered as dirty during migration. IOMMU container maintains a list of all such pinned pages. Added an ioctl

Re: [PATCH v9 Kernel 3/5] vfio iommu: Add ioctl defination to unmap IOVA and return dirty bitmap

2019-11-13 Thread Kirti Wankhede
On 11/13/2019 4:00 AM, Alex Williamson wrote: On Tue, 12 Nov 2019 22:33:38 +0530 Kirti Wankhede wrote: With vIOMMU, during pre-copy phase of migration, while CPUs are still running, IO virtual address unmap can happen while device still keeping reference of guest pfns. Those pages should

Re: [PATCH v9 Kernel 1/5] vfio: KABI for migration interface for device state

2019-11-13 Thread Kirti Wankhede
On 11/14/2019 1:18 AM, Alex Williamson wrote: On Thu, 14 Nov 2019 00:59:52 +0530 Kirti Wankhede wrote: On 11/13/2019 11:57 PM, Alex Williamson wrote: On Wed, 13 Nov 2019 11:24:17 +0100 Cornelia Huck wrote: On Tue, 12 Nov 2019 15:30:05 -0700 Alex Williamson wrote: On Tue, 12 Nov

Re: [PATCH v9 Kernel 1/5] vfio: KABI for migration interface for device state

2019-11-14 Thread Kirti Wankhede
On 11/14/2019 2:10 AM, Alex Williamson wrote: On Thu, 14 Nov 2019 01:47:04 +0530 Kirti Wankhede wrote: On 11/14/2019 1:18 AM, Alex Williamson wrote: On Thu, 14 Nov 2019 00:59:52 +0530 Kirti Wankhede wrote: On 11/13/2019 11:57 PM, Alex Williamson wrote: On Wed, 13 Nov 2019 11:24:17

Re: [PATCH v9 Kernel 1/5] vfio: KABI for migration interface for device state

2019-11-14 Thread Kirti Wankhede
+ * Vendor driver should decide whether to partition data section and how to + * partition the data section. Vendor driver should return data_offset + * accordingly. + * + * Sequence to be followed for _SAVING|_RUNNING device state or pre-copy phase + * and for _SAVING device state or stop-and-

Re: [PATCH v9 Kernel 2/5] vfio iommu: Add ioctl defination to get dirty pages bitmap.

2019-11-14 Thread Kirti Wankhede
On 11/14/2019 1:37 AM, Alex Williamson wrote: On Thu, 14 Nov 2019 01:07:21 +0530 Kirti Wankhede wrote: On 11/13/2019 4:00 AM, Alex Williamson wrote: On Tue, 12 Nov 2019 22:33:37 +0530 Kirti Wankhede wrote: All pages pinned by vendor driver through vfio_pin_pages API should be

Re: [PATCH v9 Kernel 3/5] vfio iommu: Add ioctl defination to unmap IOVA and return dirty bitmap

2019-11-14 Thread Kirti Wankhede
On 11/14/2019 1:52 AM, Alex Williamson wrote: On Thu, 14 Nov 2019 01:22:39 +0530 Kirti Wankhede wrote: On 11/13/2019 4:00 AM, Alex Williamson wrote: On Tue, 12 Nov 2019 22:33:38 +0530 Kirti Wankhede wrote: With vIOMMU, during pre-copy phase of migration, while CPUs are still running

Re: [Qemu-devel] [PATCH v7 07/13] vfio: Add migration state change notifier

2019-08-20 Thread Kirti Wankhede
On 7/17/2019 7:55 AM, Yan Zhao wrote: > On Tue, Jul 09, 2019 at 05:49:14PM +0800, Kirti Wankhede wrote: >> Added migration state change notifier to get notification on migration state >> change. These states are translated to VFIO device state and conveyed to >> vendor &g

Re: [Qemu-devel] [PATCH v7 09/13] vfio: Add save state functions to SaveVMHandlers

2019-08-20 Thread Kirti Wankhede
On 7/17/2019 8:20 AM, Yan Zhao wrote: > On Tue, Jul 09, 2019 at 05:49:16PM +0800, Kirti Wankhede wrote: >> Added .save_live_pending, .save_live_iterate and .save_live_complete_precopy >> functions. These functions handles pre-copy and stop-and-copy phase. >> >> In _S

Re: [Qemu-devel] [PATCH v7 06/13] vfio: Add VM state change handler to know state of VM

2019-08-20 Thread Kirti Wankhede
On 7/22/2019 1:53 PM, Yan Zhao wrote: > On Fri, Jul 12, 2019 at 03:14:03AM +0800, Kirti Wankhede wrote: >> >> >> On 7/11/2019 5:43 PM, Dr. David Alan Gilbert wrote: >>> * Kirti Wankhede (kwankh...@nvidia.com) wrote: >>>> VM state change handler gets ca

Re: [Qemu-devel] [PATCH v7 06/13] vfio: Add VM state change handler to know state of VM

2019-08-20 Thread Kirti Wankhede
On 7/22/2019 2:07 PM, Yan Zhao wrote: > On Tue, Jul 09, 2019 at 05:49:13PM +0800, Kirti Wankhede wrote: >> VM state change handler gets called on change in VM's state. This is used to >> set >> VFIO device state to _RUNNING. >> VM state change handler, mi

Re: [Qemu-devel] [PATCH v7 11/13] vfio: Add function to get dirty page list

2019-08-20 Thread Kirti Wankhede
On 7/22/2019 2:09 PM, Yan Zhao wrote: > On Tue, Jul 09, 2019 at 05:49:18PM +0800, Kirti Wankhede wrote: >> Dirty page tracking (.log_sync) is part of RAM copying state, where >> vendor driver provides the bitmap of pages which are dirtied by vendor >> driver through migrati

Re: [Qemu-devel] [PATCH v7 08/13] vfio: Register SaveVMHandlers for VFIO device

2019-08-20 Thread Kirti Wankhede
On 7/22/2019 2:04 PM, Yan Zhao wrote: > On Tue, Jul 09, 2019 at 05:49:15PM +0800, Kirti Wankhede wrote: >> Define flags to be used as delimeter in migration file stream. >> Added .save_setup and .save_cleanup functions. Mapped & unmapped migration >> region from these f

Re: [Qemu-devel] [PATCH v7 10/13] vfio: Add load state functions to SaveVMHandlers

2019-08-20 Thread Kirti Wankhede
On 7/23/2019 3:20 AM, Yan Zhao wrote: > On Tue, Jul 23, 2019 at 03:07:13AM +0800, Alex Williamson wrote: >> On Sun, 21 Jul 2019 23:20:28 -0400 >> Yan Zhao wrote: >> >>> On Fri, Jul 19, 2019 at 03:00:13AM +0800, Kirti Wankhede wrote: >>>> >

Re: [Qemu-devel] [PATCH v7 01/13] vfio: KABI for migration interface

2019-08-21 Thread Kirti Wankhede
Sorry for the delay. On 7/17/2019 2:26 AM, Alex Williamson wrote: > On Tue, 9 Jul 2019 15:19:08 +0530 > Kirti Wankhede wrote: > >> - Defined MIGRATION region type and sub-type. >> - Used 3 bits to define VFIO device states. >> Bit 0 => _RUNNING >&g

Re: [Qemu-devel] [PATCH v7 01/13] vfio: KABI for migration interface

2019-08-21 Thread Kirti Wankhede
On 7/23/2019 5:43 PM, Cornelia Huck wrote: > On Tue, 16 Jul 2019 14:56:32 -0600 > Alex Williamson wrote: > >> On Tue, 9 Jul 2019 15:19:08 +0530 >> Kirti Wankhede wrote: > > I'm still a bit unsure about the device_state bit handling as well. >

Re: [Qemu-devel] [PATCH v7 04/13] vfio: Add save and load functions for VFIO PCI devices

2019-08-21 Thread Kirti Wankhede
Sorry for delay to respond. On 7/11/2019 5:37 PM, Dr. David Alan Gilbert wrote: > * Kirti Wankhede (kwankh...@nvidia.com) wrote: >> These functions save and restore PCI device specific data - config >> space of PCI device. >> Tested save and restore with MSI and MSIX type

Re: [Qemu-devel] [PATCH v7 04/13] vfio: Add save and load functions for VFIO PCI devices

2019-08-22 Thread Kirti Wankhede
On 8/22/2019 3:02 PM, Dr. David Alan Gilbert wrote: > * Kirti Wankhede (kwankh...@nvidia.com) wrote: >> Sorry for delay to respond. >> >> On 7/11/2019 5:37 PM, Dr. David Alan Gilbert wrote: >>> * Kirti Wankhede (kwankh...@nvidia.com) wrote: >>>> T

[Qemu-devel] [PATCH v8 00/13] Add migration support for VFIO device

2019-08-26 Thread Kirti Wankhede
ction of the region. - Moved PCI device functions to pci file. - Added iteration to get dirty page bitmap until bitmap for all requested pages are copied. Thanks, Kirti Kirti Wankhede (13): vfio: KABI for migration interface vfio: Add function to unmap VFIO region vfio: Add vfio_get_obje

[Qemu-devel] [PATCH v8 01/13] vfio: KABI for migration interface

2019-08-26 Thread Kirti Wankhede
vice data and dirty pages bitmap. Vendor driver should decide whether to partition data section and how to partition the data section. Vendor driver should return data_offset accordingly. For user application, data is opaque. User should write data in the same order as received. Signed-off-by: Kirt

[Qemu-devel] [PATCH v8 03/13] vfio: Add vfio_get_object callback to VFIODeviceOps

2019-08-26 Thread 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 --- hw/vfio/pci.c | 8 include/hw/vfio/vfio-common.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/vfio

<    2   3   4   5   6   7   8   9   10   >