Re: [PULL 03/30] migration: Split save_live_pending() into state_pending_*

2023-02-08 Thread Avihai Horon
On 07/02/2023 2:56, Juan Quintela wrote: External email: Use caution opening links or attachments We split the function into to: - state_pending_estimate: We estimate the remaining state size without stopping the machine. - state pending_exact: We calculate the exact amount of remaining

Re: [PATCH v9 14/14] docs/devel: Align VFIO migration docs to v2 protocol

2023-02-08 Thread Avihai Horon
On 08/02/2023 19:25, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 2/6/23 13:31, Avihai Horon wrote: Now that VFIO migration protocol v2 has been implemented and v1 protocol has been removed, update the documentation according to v2 protocol. Signed

Re: [PATCH v9 07/14] vfio/migration: Block multiple devices migration

2023-02-08 Thread Avihai Horon
On 08/02/2023 19:22, Alex Williamson wrote: External email: Use caution opening links or attachments On Wed, 8 Feb 2023 15:08:15 +0200 Avihai Horon wrote: On 08/02/2023 0:34, Alex Williamson wrote: External email: Use caution opening links or attachments On Mon, 6 Feb 2023 14:31:30

Re: [PATCH v9 07/14] vfio/migration: Block multiple devices migration

2023-02-08 Thread Avihai Horon
On 08/02/2023 18:44, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 2/8/23 14:08, Avihai Horon wrote: On 08/02/2023 0:34, Alex Williamson wrote: External email: Use caution opening links or attachments On Mon, 6 Feb 2023 14:31:30 +0200 Avihai Horon

Re: [PATCH v9 14/14] docs/devel: Align VFIO migration docs to v2 protocol

2023-02-08 Thread Avihai Horon
On 08/02/2023 1:49, Alex Williamson wrote: External email: Use caution opening links or attachments On Mon, 6 Feb 2023 14:31:37 +0200 Avihai Horon wrote: Now that VFIO migration protocol v2 has been implemented and v1 protocol has been removed, update the documentation according to v2

Re: [PATCH v9 10/14] vfio/migration: Implement VFIO migration protocol v2

2023-02-08 Thread Avihai Horon
On 08/02/2023 1:42, Alex Williamson wrote: External email: Use caution opening links or attachments On Mon, 6 Feb 2023 14:31:33 +0200 Avihai Horon wrote: @@ -523,6 +745,41 @@ static int vfio_save_iterate(QEMUFile *f, void *opaque) return 0; } +static int vfio_save_complete_precopy

Re: [PATCH v9 07/14] vfio/migration: Block multiple devices migration

2023-02-08 Thread Avihai Horon
On 08/02/2023 0:34, Alex Williamson wrote: External email: Use caution opening links or attachments On Mon, 6 Feb 2023 14:31:30 +0200 Avihai Horon wrote: Currently VFIO migration doesn't implement some kind of intermediate quiescent state in which P2P DMAs are quiesced before stopping

[PATCH v9 12/14] vfio/migration: Remove VFIO migration protocol v1

2023-02-06 Thread Avihai Horon
Now that v2 protocol implementation has been added, remove the deprecated v1 implementation. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 5 - hw/vfio/common.c | 17 +- hw/vfio/migration.c | 703

[PATCH v9 10/14] vfio/migration: Implement VFIO migration protocol v2

2023-02-06 Thread Avihai Horon
is made optional in v2 protocol. Support for pre-copy will be added later on. Detailed information about VFIO migration protocol v2 and its difference compared to v1 protocol can be found here [1]. [1] https://lore.kernel.org/all/20220224142024.147653-10-yish...@nvidia.com/ Signed-off-by: Avihai

[PATCH v9 07/14] vfio/migration: Block multiple devices migration

2023-02-06 Thread Avihai Horon
time. Until such support is added, block migration of multiple devices. Signed-off-by: Avihai Horon --- include/hw/vfio/vfio-common.h | 2 ++ hw/vfio/common.c | 51 +++ hw/vfio/migration.c | 6 + 3 files changed, 59 insertions(+) diff

[PATCH v9 11/14] vfio/migration: Optimize vfio_save_pending()

2023-02-06 Thread Avihai Horon
device pending data size. Avoid these unnecessary queries by issuing them in a RAM pre-copy notifier instead of vfio_save_pending(). This way the VFIO device is queried only when RAM pending data is below the threshold, when there is an actual chance for migration to converge. Signed-off-by: Avihai

[PATCH v9 14/14] docs/devel: Align VFIO migration docs to v2 protocol

2023-02-06 Thread Avihai Horon
Now that VFIO migration protocol v2 has been implemented and v1 protocol has been removed, update the documentation according to v2 protocol. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- docs/devel/vfio-migration.rst | 68 --- 1 file changed, 30

[PATCH v9 13/14] vfio: Alphabetize migration section of VFIO trace-events file

2023-02-06 Thread Avihai Horon
Sort the migration section of VFIO trace events file alphabetically and move two misplaced traces to common.c section. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- hw/vfio/trace-events | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git

[PATCH v9 06/14] vfio/common: Change vfio_devices_all_running_and_saving() logic to equivalent one

2023-02-06 Thread Avihai Horon
are in running state [1]. No functional changes intended. [1] Note that checking if migration is in setup or active states and if all VFIO devices are in running state doesn't guarantee that we are in pre-copy phase, thus we check if migration is only in active state. Signed-off-by: Avihai Horon Reviewed

[PATCH v9 08/14] vfio/migration: Move migration v1 logic to vfio_migration_init()

2023-02-06 Thread Avihai Horon
Move vfio_dev_get_region_info() logic from vfio_migration_probe() to vfio_migration_init(). This logic is specific to v1 protocol and moving it will make it easier to add the v2 protocol implementation later. No functional changes intended. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le

[PATCH v9 05/14] migration/qemu-file: Add qemu_file_get_to_fd()

2023-02-06 Thread Avihai Horon
Add new function qemu_file_get_to_fd() that allows reading data from QEMUFile and writing it straight into a given fd. This will be used later in VFIO migration code. Signed-off-by: Avihai Horon Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Cédric Le Goater --- migration/qemu-file.h

[PATCH v9 04/14] vfio/migration: Allow migration without VFIO IOMMU dirty tracking support

2023-02-06 Thread Avihai Horon
compatibility API and prevent migration regressions caused by the lack of VFIO IOMMU dirty tracking support. [1] https://lore.kernel.org/kvm/0-v6-a196d26f289e+11787-iommufd_...@nvidia.com/ Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- hw/vfio/common.c| 20 ++-- hw

[PATCH v9 09/14] vfio/migration: Rename functions/structs related to v1 protocol

2023-02-06 Thread Avihai Horon
To avoid name collisions, rename functions and structs related to VFIO migration protocol v1. This will allow the two protocols to co-exist when v2 protocol is added, until v1 is removed. No functional changes intended. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- include/hw

[PATCH v9 02/14] migration: No save_live_pending() method uses the QEMUFile parameter

2023-02-06 Thread Avihai Horon
From: Juan Quintela So remove it everywhere. Signed-off-by: Juan Quintela Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Dr. David Alan Gilbert --- include/migration/register.h | 3 +-- migration/savevm.h | 3 +-- hw/s390x/s390-stattrib.c | 2 +-

[PATCH v9 03/14] vfio/migration: Fix NULL pointer dereference bug

2023-02-06 Thread Avihai Horon
ration and vfio_vmstate_change() error flow is taken, as MigrationState->to_dst_file is not set at that time. Fix it by checking that MigrationState->to_dst_file is set before using it. Fixes: 02a7e71b1e5b ("vfio: Add VM state change handler to know state of VM") Signed-off-by:

[PATCH v9 00/14] vfio/migration: Implement VFIO migration protocol v2

2023-02-06 Thread Avihai Horon
19072-1-avih...@nvidia.com/ [10] https://lore.kernel.org/qemu-devel/20221003031600.20084-1-quint...@redhat.com/T/ [11] https://lore.kernel.org/all/20221016085752.32740-1-avih...@nvidia.com/ [12] https://lore.kernel.org/all/20220512154320.19697-1-avih...@nvidia.com/ Avihai Horon (13): linux-header

[PATCH v9 01/14] linux-headers: Update to v6.2-rc1

2023-02-06 Thread Avihai Horon
Update to commit 1b929c02afd3 ("Linux 6.2-rc1"). Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater Reviewed-by: Michael S. Tsirkin --- include/standard-headers/drm/drm_fourcc.h | 63 +++- include/standard-headers/linux/ethtool.h | 81 - include/standard-hea

Re: [PATCH v8 09/13] vfio/migration: Implement VFIO migration protocol v2

2023-01-26 Thread Avihai Horon
On 26/01/2023 2:00, Alex Williamson wrote: External email: Use caution opening links or attachments On Sun, 22 Jan 2023 12:31:33 +0200 Avihai Horon wrote: On 21/01/2023 1:07, Alex Williamson wrote: External email: Use caution opening links or attachments On Mon, 16 Jan 2023 16:11:31

Re: [PATCH v8 09/13] vfio/migration: Implement VFIO migration protocol v2

2023-01-22 Thread Avihai Horon
On 21/01/2023 1:07, Alex Williamson wrote: External email: Use caution opening links or attachments On Mon, 16 Jan 2023 16:11:31 +0200 Avihai Horon wrote: Implement the basic mandatory part of VFIO migration protocol v2. This includes all functionality that is necessary to support

Re: [PATCH v8 04/13] vfio/migration: Allow migration without VFIO IOMMU dirty tracking support

2023-01-22 Thread Avihai Horon
On 21/01/2023 1:06, Alex Williamson wrote: External email: Use caution opening links or attachments On Mon, 16 Jan 2023 16:11:26 +0200 Avihai Horon wrote: Currently, if IOMMU of a VFIO container doesn't support dirty page tracking, migration is blocked. This is because a DMA-able VFIO

[PATCH v8 13/13] docs/devel: Align VFIO migration docs to v2 protocol

2023-01-16 Thread Avihai Horon
Now that VFIO migration protocol v2 has been implemented and v1 protocol has been removed, update the documentation according to v2 protocol. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- docs/devel/vfio-migration.rst | 68 --- 1 file changed, 30

[PATCH v8 11/13] vfio/migration: Remove VFIO migration protocol v1

2023-01-16 Thread Avihai Horon
Now that v2 protocol implementation has been added, remove the deprecated v1 implementation. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 5 - hw/vfio/common.c | 19 +- hw/vfio/migration.c | 703

[PATCH v8 10/13] vfio/migration: Optimize vfio_save_pending()

2023-01-16 Thread Avihai Horon
device pending data size. Avoid these unnecessary queries by issuing them in a RAM pre-copy notifier instead of vfio_save_pending(). This way the VFIO device is queried only when RAM pending data is below the threshold, when there is an actual chance for migration to converge. Signed-off-by: Avihai

[PATCH v8 09/13] vfio/migration: Implement VFIO migration protocol v2

2023-01-16 Thread Avihai Horon
is made optional in v2 protocol. Support for pre-copy will be added later on. Detailed information about VFIO migration protocol v2 and its difference compared to v1 protocol can be found here [1]. [1] https://lore.kernel.org/all/20220224142024.147653-10-yish...@nvidia.com/ Signed-off-by: Avihai

[PATCH v8 12/13] vfio: Alphabetize migration section of VFIO trace-events file

2023-01-16 Thread Avihai Horon
Sort the migration section of VFIO trace events file alphabetically and move two misplaced traces to common.c section. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- hw/vfio/trace-events | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git

[PATCH v8 04/13] vfio/migration: Allow migration without VFIO IOMMU dirty tracking support

2023-01-16 Thread Avihai Horon
compatibility API and prevent migration regressions caused by the lack of VFIO IOMMU dirty tracking support. [1] https://lore.kernel.org/kvm/0-v6-a196d26f289e+11787-iommufd_...@nvidia.com/ Signed-off-by: Avihai Horon --- hw/vfio/common.c| 20 ++-- hw/vfio/migration.c | 3 +-- 2

[PATCH v8 02/13] migration: No save_live_pending() method uses the QEMUFile parameter

2023-01-16 Thread Avihai Horon
From: Juan Quintela So remove it everywhere. Signed-off-by: Juan Quintela Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Dr. David Alan Gilbert --- include/migration/register.h | 3 +-- migration/savevm.h | 3 +-- hw/s390x/s390-stattrib.c | 2 +-

[PATCH v8 01/13] linux-headers: Update to v6.2-rc1

2023-01-16 Thread Avihai Horon
Update to commit 1b929c02afd3 ("Linux 6.2-rc1"). Signed-off-by: Avihai Horon --- include/standard-headers/drm/drm_fourcc.h | 63 +++- include/standard-headers/linux/ethtool.h | 81 - include/standard-headers/linux/fuse.h | 20 +- .../linux/input-eve

[PATCH v8 07/13] vfio/migration: Move migration v1 logic to vfio_migration_init()

2023-01-16 Thread Avihai Horon
Move vfio_dev_get_region_info() logic from vfio_migration_probe() to vfio_migration_init(). This logic is specific to v1 protocol and moving it will make it easier to add the v2 protocol implementation later. No functional changes intended. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le

[PATCH v8 03/13] vfio/migration: Fix NULL pointer dereference bug

2023-01-16 Thread Avihai Horon
ration and vfio_vmstate_change() error flow is taken, as MigrationState->to_dst_file is not set at that time. Fix it by checking that MigrationState->to_dst_file is set before using it. Fixes: 02a7e71b1e5b ("vfio: Add VM state change handler to know state of VM") Signed-off-by:

[PATCH v8 05/13] migration/qemu-file: Add qemu_file_get_to_fd()

2023-01-16 Thread Avihai Horon
Add new function qemu_file_get_to_fd() that allows reading data from QEMUFile and writing it straight into a given fd. This will be used later in VFIO migration code. Signed-off-by: Avihai Horon Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Cédric Le Goater --- migration/qemu-file.h

[PATCH v8 08/13] vfio/migration: Rename functions/structs related to v1 protocol

2023-01-16 Thread Avihai Horon
To avoid name collisions, rename functions and structs related to VFIO migration protocol v1. This will allow the two protocols to co-exist when v2 protocol is added, until v1 is removed. No functional changes intended. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- include/hw

[PATCH v8 06/13] vfio/common: Change vfio_devices_all_running_and_saving() logic to equivalent one

2023-01-16 Thread Avihai Horon
are in running state [1]. No functional changes intended. [1] Note that checking if migration is in setup or active states and if all VFIO devices are in running state doesn't guarantee that we are in pre-copy phase, thus we check if migration is only in active state. Signed-off-by: Avihai Horon Reviewed

[PATCH v8 00/13] vfio/migration: Implement VFIO migration protocol v2

2023-01-16 Thread Avihai Horon
kernel.org/all/20221016085752.32740-1-avih...@nvidia.com/ [10] https://lore.kernel.org/all/20220512154320.19697-1-avih...@nvidia.com/ Avihai Horon (12): linux-headers: Update to v6.2-rc1 vfio/migration: Fix NULL pointer dereference bug vfio/migration: Allow migration without VFIO IOMMU dirty tracking

Re: [PATCH v7 09/13] vfio/migration: Implement VFIO migration protocol v2

2023-01-16 Thread Avihai Horon
On 16/01/2023 12:55, Cédric Le Goater wrote: External email: Use caution opening links or attachments Hello Avihai, On 1/15/23 19:35, Avihai Horon wrote: Implement the basic mandatory part of VFIO migration protocol v2. This includes all functionality that is necessary to support

Re: [PATCH v6 09/13] vfio/migration: Implement VFIO migration protocol v2

2023-01-15 Thread Avihai Horon
On 13/01/2023 18:13, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 1/12/23 09:50, Avihai Horon wrote: Implement the basic mandatory part of VFIO migration protocol v2. This includes all functionality that is necessary to support VFIO_MIGRATION_STOP_COPY

[PATCH v7 03/13] vfio/migration: Fix NULL pointer dereference bug

2023-01-15 Thread Avihai Horon
ration and vfio_vmstate_change() error flow is taken, as MigrationState->to_dst_file is not set at that time. Fix it by checking that MigrationState->to_dst_file is set before using it. Fixes: 02a7e71b1e5b ("vfio: Add VM state change handler to know state of VM") Signed-off-by:

[PATCH v7 12/13] vfio: Alphabetize migration section of VFIO trace-events file

2023-01-15 Thread Avihai Horon
Sort the migration section of VFIO trace events file alphabetically and move two misplaced traces to common.c section. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- hw/vfio/trace-events | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git

[PATCH v7 13/13] docs/devel: Align VFIO migration docs to v2 protocol

2023-01-15 Thread Avihai Horon
Now that VFIO migration protocol v2 has been implemented and v1 protocol has been removed, update the documentation according to v2 protocol. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- docs/devel/vfio-migration.rst | 68 --- 1 file changed, 30

[PATCH v7 04/13] vfio/migration: Allow migration without VFIO IOMMU dirty tracking support

2023-01-15 Thread Avihai Horon
compatibility API and prevent migration regressions caused by the lack of VFIO IOMMU dirty tracking support. [1] https://lore.kernel.org/kvm/0-v6-a196d26f289e+11787-iommufd_...@nvidia.com/ Signed-off-by: Avihai Horon --- hw/vfio/common.c| 20 ++-- hw/vfio/migration.c | 3 +-- 2

[PATCH v7 10/13] vfio/migration: Optimize vfio_save_pending()

2023-01-15 Thread Avihai Horon
device pending data size. Avoid these unnecessary queries by issuing them in a RAM pre-copy notifier instead of vfio_save_pending(). This way the VFIO device is queried only when RAM pending data is below the threshold, when there is an actual chance for migration to converge. Signed-off-by: Avihai

[PATCH v7 09/13] vfio/migration: Implement VFIO migration protocol v2

2023-01-15 Thread Avihai Horon
is made optional in v2 protocol. Support for pre-copy will be added later on. Detailed information about VFIO migration protocol v2 and its difference compared to v1 protocol can be found here [1]. [1] https://lore.kernel.org/all/20220224142024.147653-10-yish...@nvidia.com/ Signed-off-by: Avihai

[PATCH v7 07/13] vfio/migration: Move migration v1 logic to vfio_migration_init()

2023-01-15 Thread Avihai Horon
Move vfio_dev_get_region_info() logic from vfio_migration_probe() to vfio_migration_init(). This logic is specific to v1 protocol and moving it will make it easier to add the v2 protocol implementation later. No functional changes intended. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le

[PATCH v7 11/13] vfio/migration: Remove VFIO migration protocol v1

2023-01-15 Thread Avihai Horon
Now that v2 protocol implementation has been added, remove the deprecated v1 implementation. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 5 - hw/vfio/common.c | 19 +- hw/vfio/migration.c | 703

[PATCH v7 08/13] vfio/migration: Rename functions/structs related to v1 protocol

2023-01-15 Thread Avihai Horon
To avoid name collisions, rename functions and structs related to VFIO migration protocol v1. This will allow the two protocols to co-exist when v2 protocol is added, until v1 is removed. No functional changes intended. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- include/hw

[PATCH v7 06/13] vfio/common: Change vfio_devices_all_running_and_saving() logic to equivalent one

2023-01-15 Thread Avihai Horon
are in running state [1]. No functional changes intended. [1] Note that checking if migration is in setup or active states and if all VFIO devices are in running state doesn't guarantee that we are in pre-copy phase, thus we check if migration is only in active state. Signed-off-by: Avihai Horon Reviewed

[PATCH v7 00/13] vfio/migration: Implement VFIO migration protocol v2

2023-01-15 Thread Avihai Horon
-1-avih...@nvidia.com/ [7] https://lore.kernel.org/qemu-devel/20221003031600.20084-1-quint...@redhat.com/T/ [8] https://lore.kernel.org/all/20221016085752.32740-1-avih...@nvidia.com/ [9] https://lore.kernel.org/all/20220512154320.19697-1-avih...@nvidia.com/ Avihai Horon (12): linux-headers: Update to

[PATCH v7 01/13] linux-headers: Update to v6.2-rc1

2023-01-15 Thread Avihai Horon
Update to commit 1b929c02afd3 ("Linux 6.2-rc1"). Signed-off-by: Avihai Horon --- include/standard-headers/drm/drm_fourcc.h | 63 +++- include/standard-headers/linux/ethtool.h | 81 - include/standard-headers/linux/fuse.h | 20 +- .../linux/input-eve

[PATCH v7 05/13] migration/qemu-file: Add qemu_file_get_to_fd()

2023-01-15 Thread Avihai Horon
Add new function qemu_file_get_to_fd() that allows reading data from QEMUFile and writing it straight into a given fd. This will be used later in VFIO migration code. Signed-off-by: Avihai Horon Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Cédric Le Goater --- migration/qemu-file.h

[PATCH v7 02/13] migration: No save_live_pending() method uses the QEMUFile parameter

2023-01-15 Thread Avihai Horon
From: Juan Quintela So remove it everywhere. Signed-off-by: Juan Quintela Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Dr. David Alan Gilbert --- include/migration/register.h | 3 +-- migration/savevm.h | 3 +-- hw/s390x/s390-stattrib.c | 2 +-

[PATCH v6 06/13] vfio/common: Change vfio_devices_all_running_and_saving() logic to equivalent one

2023-01-12 Thread Avihai Horon
are in running state [1]. No functional changes intended. [1] Note that checking if migration is in setup or active states and if all VFIO devices are in running state doesn't guarantee that we are in pre-copy phase, thus we check if migration is only in active state. Signed-off-by: Avihai Horon --- hw

[PATCH v6 03/13] vfio/migration: Fix NULL pointer dereference bug

2023-01-12 Thread Avihai Horon
ration and vfio_vmstate_change() error flow is taken, as MigrationState->to_dst_file is not set at that time. Fix it by checking that MigrationState->to_dst_file is set before using it. Fixes: 02a7e71b1e5b ("vfio: Add VM state change handler to know state of VM") Signed-off-by:

[PATCH v6 08/13] vfio/migration: Rename functions/structs related to v1 protocol

2023-01-12 Thread Avihai Horon
To avoid name collisions, rename functions and structs related to VFIO migration protocol v1. This will allow the two protocols to co-exist when v2 protocol is added, until v1 is removed. No functional changes intended. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- include/hw

[PATCH v6 12/13] vfio: Alphabetize migration section of VFIO trace-events file

2023-01-12 Thread Avihai Horon
Sort the migration section of VFIO trace events file alphabetically and move two misplaced traces to common.c section. Signed-off-by: Avihai Horon --- hw/vfio/trace-events | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/vfio/trace-events b/hw/vfio

[PATCH v6 05/13] migration/qemu-file: Add qemu_file_get_to_fd()

2023-01-12 Thread Avihai Horon
Add new function qemu_file_get_to_fd() that allows reading data from QEMUFile and writing it straight into a given fd. This will be used later in VFIO migration code. Signed-off-by: Avihai Horon Reviewed-by: Vladimir Sementsov-Ogievskiy --- migration/qemu-file.h | 1 + migration/qemu-file.c

[PATCH v6 09/13] vfio/migration: Implement VFIO migration protocol v2

2023-01-12 Thread Avihai Horon
is made optional in v2 protocol. Support for pre-copy will be added later on. Detailed information about VFIO migration protocol v2 and its difference compared to v1 protocol can be found here [1]. [1] https://lore.kernel.org/all/20220224142024.147653-10-yish...@nvidia.com/ Signed-off-by: Avihai

[PATCH v6 04/13] vfio/migration: Allow migration without VFIO IOMMU dirty tracking support

2023-01-12 Thread Avihai Horon
compatibility API and prevent migration regressions caused by the lack of VFIO IOMMU dirty tracking support. [1] https://lore.kernel.org/kvm/0-v6-a196d26f289e+11787-iommufd_...@nvidia.com/ Signed-off-by: Avihai Horon --- hw/vfio/common.c| 20 ++-- hw/vfio/migration.c | 3 +-- 2

[PATCH v6 07/13] vfio/migration: Move migration v1 logic to vfio_migration_init()

2023-01-12 Thread Avihai Horon
Move vfio_dev_get_region_info() logic from vfio_migration_probe() to vfio_migration_init(). This logic is specific to v1 protocol and moving it will make it easier to add the v2 protocol implementation later. No functional changes intended. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le

[PATCH v6 13/13] docs/devel: Align VFIO migration docs to v2 protocol

2023-01-12 Thread Avihai Horon
Now that VFIO migration protocol v2 has been implemented and v1 protocol has been removed, update the documentation according to v2 protocol. Signed-off-by: Avihai Horon --- docs/devel/vfio-migration.rst | 68 --- 1 file changed, 30 insertions(+), 38 deletions

[PATCH v6 10/13] vfio/migration: Optimize vfio_save_pending()

2023-01-12 Thread Avihai Horon
device pending data size. Avoid these unnecessary queries by issuing them in a RAM pre-copy notifier instead of vfio_save_pending(). This way the VFIO device is queried only when RAM pending data is below the threshold, when there is an actual chance for migration to converge. Signed-off-by: Avihai

[PATCH v6 11/13] vfio/migration: Remove VFIO migration protocol v1

2023-01-12 Thread Avihai Horon
Now that v2 protocol implementation has been added, remove the deprecated v1 implementation. Signed-off-by: Avihai Horon --- include/hw/vfio/vfio-common.h | 5 - hw/vfio/common.c | 19 +- hw/vfio/migration.c | 703 +- hw/vfio/trace

[PATCH v6 00/13] vfio/migration: Implement VFIO migration protocol v2

2023-01-12 Thread Avihai Horon
om/ [4] https://lore.kernel.org/qemu-devel/20221103161620.13120-1-avih...@nvidia.com/ [5] https://lore.kernel.org/all/20220530170739.19072-1-avih...@nvidia.com/ [6] https://lore.kernel.org/qemu-devel/20221003031600.20084-1-quint...@redhat.com/T/ [7] https://lore.kernel.org/all/20221016085752.32

[PATCH v6 02/13] migration: No save_live_pending() method uses the QEMUFile parameter

2023-01-12 Thread Avihai Horon
From: Juan Quintela So remove it everywhere. Signed-off-by: Juan Quintela Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Dr. David Alan Gilbert --- include/migration/register.h | 3 +-- migration/savevm.h | 3 +-- hw/s390x/s390-stattrib.c | 2 +-

[PATCH v6 01/13] linux-headers: Update to v6.2-rc1

2023-01-12 Thread Avihai Horon
Update to commit 1b929c02afd3 ("Linux 6.2-rc1"). Signed-off-by: Avihai Horon --- include/standard-headers/drm/drm_fourcc.h | 63 +++- include/standard-headers/linux/ethtool.h | 81 - include/standard-headers/linux/fuse.h | 20 +- .../linux/input-eve

Re: [PATCH v5 10/14] vfio/migration: Implement VFIO migration protocol v2

2023-01-11 Thread Avihai Horon
On 10/01/2023 18:19, Cédric Le Goater wrote: External email: Use caution opening links or attachments Hello Avihai On 1/10/23 15:08, Avihai Horon wrote: On 09/01/2023 20:36, Jason Gunthorpe wrote: On Mon, Jan 09, 2023 at 06:27:21PM +0100, Cédric Le Goater wrote: also

Re: [PATCH v5 10/14] vfio/migration: Implement VFIO migration protocol v2

2023-01-10 Thread Avihai Horon
On 09/01/2023 20:36, Jason Gunthorpe wrote: On Mon, Jan 09, 2023 at 06:27:21PM +0100, Cédric Le Goater wrote: also, in vfio_migration_query_flags() : +static int vfio_migration_query_flags(VFIODevice *vbasedev, uint64_t *mig_flags) +{ +uint64_t buf[DIV_ROUND_UP(sizeof(struct

Re: [PATCH v5 06/14] migration/qemu-file: Add qemu_file_get_to_fd()

2023-01-09 Thread Avihai Horon
On 09/01/2023 13:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 12/29/22 12:03, Avihai Horon wrote: Add new function qemu_file_get_to_fd() that allows reading data from QEMUFile and writing it straight into a given fd. This will be used later

Re: [PATCH v5 10/14] vfio/migration: Implement VFIO migration protocol v2

2023-01-09 Thread Avihai Horon
On 09/01/2023 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments Hello Avihai, On 12/29/22 12:03, Avihai Horon wrote: +static int vfio_save_setup(QEMUFile *f, void *opaque) +{ +    VFIODevice *vbasedev = opaque; +    VFIOMigration *migration

Re: [PATCH v5 05/14] vfio/migration: Allow migration without VFIO IOMMU dirty tracking support

2023-01-08 Thread Avihai Horon
On 06/01/2023 23:56, Alex Williamson wrote: External email: Use caution opening links or attachments On Thu, 29 Dec 2022 13:03:36 +0200 Avihai Horon wrote: Currently, if IOMMU of a VFIO container doesn't support dirty page tracking, migration is blocked. This is because a DMA-able VFIO

Re: [PATCH v5 03/14] migration: Simplify migration_iteration_run()

2023-01-08 Thread Avihai Horon
On 06/01/2023 19:56, Alex Williamson wrote: External email: Use caution opening links or attachments On Thu, 29 Dec 2022 13:03:34 +0200 Avihai Horon wrote: From: Juan Quintela IMHO, there should always be a commit log description. Why is this a simplification? Yes. It just rephrases

Re: [PATCH v5 04/14] vfio/migration: Fix NULL pointer dereference bug

2023-01-03 Thread Avihai Horon
On 03/01/2023 13:13, Dr. David Alan Gilbert wrote: External email: Use caution opening links or attachments * Avihai Horon (avih...@nvidia.com) wrote: As part of its error flow, vfio_vmstate_change() accesses MigrationState->to_dst_file without any checks. This can cause a NULL poin

[PATCH v5 05/14] vfio/migration: Allow migration without VFIO IOMMU dirty tracking support

2022-12-29 Thread Avihai Horon
compatibility API and prevent migration regressions caused by the lack of VFIO IOMMU dirty tracking support. [1] https://lore.kernel.org/kvm/0-v6-a196d26f289e+11787-iommufd_...@nvidia.com/ Signed-off-by: Avihai Horon --- hw/vfio/common.c| 100 ++-- hw

[PATCH v5 14/14] docs/devel: Align VFIO migration docs to v2 protocol

2022-12-29 Thread Avihai Horon
Now that VFIO migration protocol v2 has been implemented and v1 protocol has been removed, update the documentation according to v2 protocol. Signed-off-by: Avihai Horon --- docs/devel/vfio-migration.rst | 68 --- 1 file changed, 30 insertions(+), 38 deletions

[PATCH v5 11/14] vfio/migration: Optimize vfio_save_pending()

2022-12-29 Thread Avihai Horon
device pending data size. Avoid these unnecessary queries by issuing them in a RAM pre-copy notifier instead of vfio_save_pending(). This way the VFIO device is queried only when RAM pending data is below the threshold, when there is an actual chance for migration to converge. Signed-off-by: Avihai

[PATCH v5 12/14] vfio/migration: Remove VFIO migration protocol v1

2022-12-29 Thread Avihai Horon
Now that v2 protocol implementation has been added, remove the deprecated v1 implementation. Signed-off-by: Avihai Horon --- include/hw/vfio/vfio-common.h | 5 - hw/vfio/common.c | 19 +- hw/vfio/migration.c | 701 +- hw/vfio/trace

[PATCH v5 13/14] vfio: Alphabetize migration section of VFIO trace-events file

2022-12-29 Thread Avihai Horon
Sort the migration section of VFIO trace events file alphabetically and move two misplaced traces to common.c section. Signed-off-by: Avihai Horon --- hw/vfio/trace-events | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/vfio/trace-events b/hw/vfio

[PATCH v5 08/14] vfio/migration: Move migration v1 logic to vfio_migration_init()

2022-12-29 Thread Avihai Horon
Move vfio_dev_get_region_info() logic from vfio_migration_probe() to vfio_migration_init(). This logic is specific to v1 protocol and moving it will make it easier to add the v2 protocol implementation later. No functional changes intended. Signed-off-by: Avihai Horon --- hw/vfio/migration.c

[PATCH v5 07/14] vfio/common: Change vfio_devices_all_running_and_saving() logic to equivalent one

2022-12-29 Thread Avihai Horon
are in running state [1]. No functional changes intended. [1] Note that checking if migration is in setup or active states and if all VFIO devices are in running state doesn't guarantee that we are in pre-copy phase, thus we check if migration is only in active state. Signed-off-by: Avihai Horon --- hw

[PATCH v5 10/14] vfio/migration: Implement VFIO migration protocol v2

2022-12-29 Thread Avihai Horon
is made optional in v2 protocol. Support for pre-copy will be added later on. Detailed information about VFIO migration protocol v2 and its difference compared to v1 protocol can be found here [1]. [1] https://lore.kernel.org/all/20220224142024.147653-10-yish...@nvidia.com/ Signed-off-by: Avihai

[PATCH v5 02/14] migration: No save_live_pending() method uses the QEMUFile parameter

2022-12-29 Thread Avihai Horon
From: Juan Quintela So remove it everywhere. Signed-off-by: Juan Quintela Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Dr. David Alan Gilbert --- include/migration/register.h | 3 +-- migration/savevm.h | 3 +-- hw/s390x/s390-stattrib.c | 2 +-

[PATCH v5 01/14] linux-headers: Update to v6.2-rc1

2022-12-29 Thread Avihai Horon
Update to commit 1b929c02afd3 ("Linux 6.2-rc1"). Signed-off-by: Avihai Horon --- include/standard-headers/drm/drm_fourcc.h | 63 +++- include/standard-headers/linux/ethtool.h | 81 - include/standard-headers/linux/fuse.h | 20 +- .../linux/input-eve

[PATCH v5 06/14] migration/qemu-file: Add qemu_file_get_to_fd()

2022-12-29 Thread Avihai Horon
Add new function qemu_file_get_to_fd() that allows reading data from QEMUFile and writing it straight into a given fd. This will be used later in VFIO migration code. Signed-off-by: Avihai Horon Reviewed-by: Vladimir Sementsov-Ogievskiy --- migration/qemu-file.h | 1 + migration/qemu-file.c

[PATCH v5 04/14] vfio/migration: Fix NULL pointer dereference bug

2022-12-29 Thread Avihai Horon
ration and vfio_vmstate_change() error flow is taken, as MigrationState->to_dst_file is not set at that time. Fix it by checking that MigrationState->to_dst_file is set before using it. Fixes: 02a7e71b1e5b ("vfio: Add VM state change handler to know state of VM") Signed-off-by:

[PATCH v5 09/14] vfio/migration: Rename functions/structs related to v1 protocol

2022-12-29 Thread Avihai Horon
To avoid name collisions, rename functions and structs related to VFIO migration protocol v1. This will allow the two protocols to co-exist when v2 protocol is added, until v1 is removed. No functional changes intended. Signed-off-by: Avihai Horon --- include/hw/vfio/vfio-common.h | 2 +- hw

[PATCH v5 03/14] migration: Simplify migration_iteration_run()

2022-12-29 Thread Avihai Horon
From: Juan Quintela Signed-off-by: Juan Quintela Signed-off-by: Avihai Horon --- migration/migration.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 9795d0ec5c..61b9ce0fe8 100644

[PATCH v5 00/14] vfio/migration: Implement VFIO migration protocol v2

2022-12-29 Thread Avihai Horon
1620.13120-1-avih...@nvidia.com/ [5] https://lore.kernel.org/all/20220530170739.19072-1-avih...@nvidia.com/ [6] https://lore.kernel.org/all/20221016085752.32740-1-avih...@nvidia.com/ [7] https://lore.kernel.org/all/20220512154320.19697-1-avih...@nvidia.com/ Avihai Horon (12): linux-headers: Upd

[PATCH v4 07/14] vfio/migration: Move migration v1 logic to vfio_migration_init()

2022-11-30 Thread Avihai Horon
Move vfio_dev_get_region_info() logic from vfio_migration_probe() to vfio_migration_init(). This logic is specific to v1 protocol and moving it will make it easier to add the v2 protocol implementation later. No functional changes intended. Signed-off-by: Avihai Horon --- hw/vfio/migration.c

[PATCH v4 10/14] vfio/migration: Remove VFIO migration protocol v1

2022-11-30 Thread Avihai Horon
Now that v2 protocol implementation has been added, remove the deprecated v1 implementation. Signed-off-by: Avihai Horon --- hw/vfio/common.c | 19 +- hw/vfio/migration.c | 695 +- hw/vfio/trace-events | 8 - include/hw/vfio

[PATCH v4 01/14] migration: No save_live_pending() method uses the QEMUFile parameter

2022-11-30 Thread Avihai Horon
From: Juan Quintela So remove it everywhere. Signed-off-by: Juan Quintela Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Dr. David Alan Gilbert --- hw/s390x/s390-stattrib.c | 2 +- hw/vfio/migration.c| 3 +-- include/migration/register.h | 3 +--

[PATCH v4 14/14] vfio/migration: Optimize vfio_save_pending()

2022-11-30 Thread Avihai Horon
device pending data size. Avoid these unnecessary queries by issuing them in a RAM pre-copy notifier instead of vfio_save_pending(). This way the VFIO device is queried only when RAM pending data is below the threshold, when there is an actual chance for migration to converge. Signed-off-by: Avihai

[PATCH v4 05/14] migration/qemu-file: Add qemu_file_get_to_fd()

2022-11-30 Thread Avihai Horon
Add new function qemu_file_get_to_fd() that allows reading data from QEMUFile and writing it straight into a given fd. This will be used later in VFIO migration code. Signed-off-by: Avihai Horon Reviewed-by: Vladimir Sementsov-Ogievskiy --- migration/qemu-file.c | 34

[PATCH v4 13/14] vfio/migration: Use VFIO_DEVICE_FEATURE_MIG_DATA_SIZE ioctl

2022-11-30 Thread Avihai Horon
Use VFIO_DEVICE_FEATURE_MIG_DATA_SIZE ioctl to query the device stop copy data size and report this value in vfio_save_pending() instead of the hardcoded value that is currently used. Use this ioctl in vfio_save_setup() as well, to adjust the migration data buffer size. Signed-off-by: Avihai

[PATCH v4 08/14] vfio/migration: Rename functions/structs related to v1 protocol

2022-11-30 Thread Avihai Horon
To avoid name collisions, rename functions and structs related to VFIO migration protocol v1. This will allow the two protocols to co-exist when v2 protocol is added, until v1 is removed. No functional changes intended. Signed-off-by: Avihai Horon --- hw/vfio/common.c | 6 +- hw

[PATCH v4 06/14] vfio/common: Change vfio_devices_all_running_and_saving() logic to equivalent one

2022-11-30 Thread Avihai Horon
are in running state [1]. No functional changes intended. [1] Note that checking if migration is in setup or active states and if all VFIO devices are in running state doesn't guarantee that we are in pre-copy phase, thus we check if migration is only in active state. Signed-off-by: Avihai Horon --- hw

[PATCH v4 09/14] vfio/migration: Implement VFIO migration protocol v2

2022-11-30 Thread Avihai Horon
compared to v1 can be found here [1]. [1] https://lore.kernel.org/all/20220224142024.147653-10-yish...@nvidia.com/ Signed-off-by: Avihai Horon --- hw/vfio/common.c | 19 +- hw/vfio/migration.c | 420 +++--- hw/vfio/trace-events | 6

  1   2   >