All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/2] VFIO updates for QEMU 5.2-rc3
@ 2020-11-23 17:56 Alex Williamson
  2020-11-23 17:56 ` [PULL 1/2] vfio: Make migration support experimental Alex Williamson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alex Williamson @ 2020-11-23 17:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kirti Wankhede, Cornelia Huck, Dr. David Alan Gilbert

The following changes since commit 683685e72dccaf8cb9fe8ffa20f5c5aacea72118:

  Merge remote-tracking branch 'remotes/stefanha-gitlab/tags/block-pull-request' into staging (2020-11-23 13:03:13 +0000)

are available in the Git repository at:

  git://github.com/awilliam/qemu-vfio.git tags/vfio-update-20201123.0

for you to fetch changes up to bb0990d1740f6dced5b50a923677034c9399c213:

  vfio: Change default dirty pages tracking behavior during migration (2020-11-23 10:05:58 -0700)

----------------------------------------------------------------
VFIO update 2020-11-23

 * Enable pre-copy dirty page tracking by default (Kirti Wankhede)

 * Mark migration as experimental (Alex Williamson)

----------------------------------------------------------------
Alex Williamson (1):
      vfio: Make migration support experimental

Kirti Wankhede (1):
      vfio: Change default dirty pages tracking behavior during migration

 hw/vfio/common.c              | 11 +++++++----
 hw/vfio/migration.c           |  2 +-
 hw/vfio/pci.c                 |  5 +++++
 include/hw/vfio/vfio-common.h |  2 ++
 4 files changed, 15 insertions(+), 5 deletions(-)



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PULL 1/2] vfio: Make migration support experimental
  2020-11-23 17:56 [PULL 0/2] VFIO updates for QEMU 5.2-rc3 Alex Williamson
@ 2020-11-23 17:56 ` Alex Williamson
  2020-11-23 17:57 ` [PULL 2/2] vfio: Change default dirty pages tracking behavior during migration Alex Williamson
  2020-11-23 22:37 ` [PULL 0/2] VFIO updates for QEMU 5.2-rc3 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Williamson @ 2020-11-23 17:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Cornelia Huck, Dr. David Alan Gilbert

Support for migration of vfio devices is still in flux.  Developers
are attempting to add support for new devices and new architectures,
but none are yet readily available for validation.  We have concerns
whether we're transferring device resources at the right point in the
migration, whether we're guaranteeing that updates during pre-copy are
migrated, and whether we can provide bit-stream compatibility should
any of this change.  Even the question of whether devices should
participate in dirty page tracking during pre-copy seems contentious.
In short, migration support has not had enough soak time and it feels
premature to mark it as supported.

Create an experimental option such that we can continue to develop.

[Retaining previous acks/reviews for a previously identical code
 change with different specifics in the commit log.]

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 hw/vfio/migration.c           |    2 +-
 hw/vfio/pci.c                 |    2 ++
 include/hw/vfio/vfio-common.h |    1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 55261562d4f3..00daa50ed818 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -882,7 +882,7 @@ int vfio_migration_probe(VFIODevice *vbasedev, Error **errp)
     Error *local_err = NULL;
     int ret = -ENOTSUP;
 
-    if (!container->dirty_pages_supported) {
+    if (!vbasedev->enable_migration || !container->dirty_pages_supported) {
         goto add_blocker;
     }
 
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 58c0ce8971e3..1349b900e513 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3194,6 +3194,8 @@ static Property vfio_pci_dev_properties[] = {
                     VFIO_FEATURE_ENABLE_REQ_BIT, true),
     DEFINE_PROP_BIT("x-igd-opregion", VFIOPCIDevice, features,
                     VFIO_FEATURE_ENABLE_IGD_OPREGION_BIT, false),
+    DEFINE_PROP_BOOL("x-enable-migration", VFIOPCIDevice,
+                     vbasedev.enable_migration, false),
     DEFINE_PROP_BOOL("x-no-mmap", VFIOPCIDevice, vbasedev.no_mmap, false),
     DEFINE_PROP_BOOL("x-balloon-allowed", VFIOPCIDevice,
                      vbasedev.ram_block_discard_allowed, false),
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index baeb4dcff102..2119872c8af1 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -123,6 +123,7 @@ typedef struct VFIODevice {
     bool needs_reset;
     bool no_mmap;
     bool ram_block_discard_allowed;
+    bool enable_migration;
     VFIODeviceOps *ops;
     unsigned int num_irqs;
     unsigned int num_regions;



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PULL 2/2] vfio: Change default dirty pages tracking behavior during migration
  2020-11-23 17:56 [PULL 0/2] VFIO updates for QEMU 5.2-rc3 Alex Williamson
  2020-11-23 17:56 ` [PULL 1/2] vfio: Make migration support experimental Alex Williamson
@ 2020-11-23 17:57 ` Alex Williamson
  2020-11-23 22:37 ` [PULL 0/2] VFIO updates for QEMU 5.2-rc3 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Alex Williamson @ 2020-11-23 17:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kirti Wankhede

From: Kirti Wankhede <kwankhede@nvidia.com>

By default dirty pages tracking is enabled during iterative phase
(pre-copy phase).
Added per device opt-out option 'x-pre-copy-dirty-page-tracking' to
disable dirty pages tracking during iterative phase. If the option
'x-pre-copy-dirty-page-tracking=off' is set for any VFIO device, dirty
pages tracking during iterative phase will be disabled.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 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/vfio/common.c b/hw/vfio/common.c
index c1fdbf17f2e6..6ff1daa763f8 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -311,7 +311,7 @@ bool vfio_mig_active(void)
     return true;
 }
 
-static bool vfio_devices_all_stopped_and_saving(VFIOContainer *container)
+static bool vfio_devices_all_saving(VFIOContainer *container)
 {
     VFIOGroup *group;
     VFIODevice *vbasedev;
@@ -329,8 +329,11 @@ static bool vfio_devices_all_stopped_and_saving(VFIOContainer *container)
                 return false;
             }
 
-            if ((migration->device_state & VFIO_DEVICE_STATE_SAVING) &&
-                !(migration->device_state & VFIO_DEVICE_STATE_RUNNING)) {
+            if (migration->device_state & VFIO_DEVICE_STATE_SAVING) {
+                if ((vbasedev->pre_copy_dirty_page_tracking == ON_OFF_AUTO_OFF)
+                    && (migration->device_state & VFIO_DEVICE_STATE_RUNNING)) {
+                        return false;
+                }
                 continue;
             } else {
                 return false;
@@ -1125,7 +1128,7 @@ static void vfio_listerner_log_sync(MemoryListener *listener,
         return;
     }
 
-    if (vfio_devices_all_stopped_and_saving(container)) {
+    if (vfio_devices_all_saving(container)) {
         vfio_sync_dirty_bitmap(container, section);
     }
 }
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 1349b900e513..51dc37369504 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3182,6 +3182,9 @@ static void vfio_instance_init(Object *obj)
 static Property vfio_pci_dev_properties[] = {
     DEFINE_PROP_PCI_HOST_DEVADDR("host", VFIOPCIDevice, host),
     DEFINE_PROP_STRING("sysfsdev", VFIOPCIDevice, vbasedev.sysfsdev),
+    DEFINE_PROP_ON_OFF_AUTO("x-pre-copy-dirty-page-tracking", VFIOPCIDevice,
+                            vbasedev.pre_copy_dirty_page_tracking,
+                            ON_OFF_AUTO_ON),
     DEFINE_PROP_ON_OFF_AUTO("display", VFIOPCIDevice,
                             display, ON_OFF_AUTO_OFF),
     DEFINE_PROP_UINT32("xres", VFIOPCIDevice, display_xres, 0),
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 2119872c8af1..6141162d7aea 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -130,6 +130,7 @@ typedef struct VFIODevice {
     unsigned int flags;
     VFIOMigration *migration;
     Error *migration_blocker;
+    OnOffAuto pre_copy_dirty_page_tracking;
 } VFIODevice;
 
 struct VFIODeviceOps {



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PULL 0/2] VFIO updates for QEMU 5.2-rc3
  2020-11-23 17:56 [PULL 0/2] VFIO updates for QEMU 5.2-rc3 Alex Williamson
  2020-11-23 17:56 ` [PULL 1/2] vfio: Make migration support experimental Alex Williamson
  2020-11-23 17:57 ` [PULL 2/2] vfio: Change default dirty pages tracking behavior during migration Alex Williamson
@ 2020-11-23 22:37 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2020-11-23 22:37 UTC (permalink / raw)
  To: Alex Williamson
  Cc: Kirti Wankhede, Cornelia Huck, QEMU Developers, Dr. David Alan Gilbert

On Mon, 23 Nov 2020 at 17:59, Alex Williamson
<alex.williamson@redhat.com> wrote:
>
> The following changes since commit 683685e72dccaf8cb9fe8ffa20f5c5aacea72118:
>
>   Merge remote-tracking branch 'remotes/stefanha-gitlab/tags/block-pull-request' into staging (2020-11-23 13:03:13 +0000)
>
> are available in the Git repository at:
>
>   git://github.com/awilliam/qemu-vfio.git tags/vfio-update-20201123.0
>
> for you to fetch changes up to bb0990d1740f6dced5b50a923677034c9399c213:
>
>   vfio: Change default dirty pages tracking behavior during migration (2020-11-23 10:05:58 -0700)
>
> ----------------------------------------------------------------
> VFIO update 2020-11-23
>
>  * Enable pre-copy dirty page tracking by default (Kirti Wankhede)
>
>  * Mark migration as experimental (Alex Williamson)
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.2
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-23 22:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23 17:56 [PULL 0/2] VFIO updates for QEMU 5.2-rc3 Alex Williamson
2020-11-23 17:56 ` [PULL 1/2] vfio: Make migration support experimental Alex Williamson
2020-11-23 17:57 ` [PULL 2/2] vfio: Change default dirty pages tracking behavior during migration Alex Williamson
2020-11-23 22:37 ` [PULL 0/2] VFIO updates for QEMU 5.2-rc3 Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.