Skip to contentSkip to conversation

vfio: Make migration support non experimental by default.

PATCH In review Tarun Gupta 9 participants 10 messages Mar 8, 2021 – Jul 22, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfio: Make migration support non experimental by default.

VFIO migration support in QEMU is experimental as of now, which was done to provide soak time and resolve concerns regarding bit-stream. But, with the patches discussed in
https://www.mail-archive.com/[email protected]/msg784931.html , we have corrected ordering of saving PCI config space and bit-stream.

So, this patch proposes to make vfio migration support in QEMU to be enabled by default. Tested by successfully migrating mdev device.

---
 hw/vfio/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/pci.c +1 -1
index f74be78209..15e26f460b 100644
@@ -3199,7 +3199,7 @@ static Property vfio_pci_dev_properties[] = {
     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),
+                     vbasedev.enable_migration, true),
     DEFINE_PROP_BOOL("x-no-mmap", VFIOPCIDevice, vbasedev.no_mmap, false),
     DEFINE_PROP_BOOL("x-balloon-allowed", VFIOPCIDevice,
                      vbasedev.ram_block_discard_allowed, false),
Signature · 1 line
2.27.0
#1 lore raw
Quoted 20 lines · Tarun Gupta

VFIO migration support in QEMU is experimental as of now, which was done to provide soak time and resolve concerns regarding bit-stream. But, with the patches discussed in
https://www.mail-archive.com/[email protected]/msg784931.html , we have corrected ordering of saving PCI config space and bit-stream.

So, this patch proposes to make vfio migration support in QEMU to be enabled by default. Tested by successfully migrating mdev device.

---
 hw/vfio/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/pci.c +0 -0
index f74be78209..15e26f460b 100644

hw/vfio/pci.c static Property vfio_pci_dev_properties[] = { · line 3202

Quoted 5 lines
hw/vfio/pci.c +1 -1
@@ -3199,7 +3199,7 @@ static Property vfio_pci_dev_properties[] = {
     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),
+                     vbasedev.enable_migration, true),

If it isn't experimental then why do we even need an experimental 'x-' property at all ?

IOW, rather than changing this to "true", shouldn't we just be deleting the x-enable-migration property entirely and have the code just do the right thing.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#2 lore raw
Quoted 30 lines · On Mon, 8 Mar 2021 16:36:34 +0000 Daniel P. Berrangé <[email protected]>…
Quoted 20 lines · Tarun Gupta

VFIO migration support in QEMU is experimental as of now, which was done to provide soak time and resolve concerns regarding bit-stream. But, with the patches discussed in
https://www.mail-archive.com/[email protected]/msg784931.html , we have corrected ordering of saving PCI config space and bit-stream.

So, this patch proposes to make vfio migration support in QEMU to be enabled by default. Tested by successfully migrating mdev device.

---
 hw/vfio/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/pci.c +0 -0
index f74be78209..15e26f460b 100644

hw/vfio/pci.c static Property vfio_pci_dev_properties[] = { · line 3202

Quoted 5 lines
hw/vfio/pci.c +1 -1
@@ -3199,7 +3199,7 @@ static Property vfio_pci_dev_properties[] = {
     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),
+                     vbasedev.enable_migration, true),  

If it isn't experimental then why do we even need an experimental 'x-' property at all ?

Quoted 3 lines

IOW, rather than changing this to "true", shouldn't we just be deleting the x-enable-migration property entirely and have the code just do the right thing.

I don't think it's necessarily invalid to have experimental disables for supported features. We actually have quite a few of those already. Most of them are generally aimed at debugging, for example disabling direct mappings or acceleration paths that might mask an access when trying to trace the behavior of a device. We might want to consider changing the polarity of the option to avoid user confusion, ie. x-disable-migration. I'm not fully convinced that there might not be valid non-experimental use cases for such an option, but it seems like that should be supported at a base device class level rather than per driver, so best to be left experimental here. Thanks,

Alex

#3 lore raw
In reply to Tarun Gupta
Quoted 20 lines · On Mon, 8 Mar 2021 21:39:49 +0530 Tarun Gupta <[email protected]> wrote:

VFIO migration support in QEMU is experimental as of now, which was done to provide soak time and resolve concerns regarding bit-stream. But, with the patches discussed in
https://www.mail-archive.com/[email protected]/msg784931.html , we have corrected ordering of saving PCI config space and bit-stream.

So, this patch proposes to make vfio migration support in QEMU to be enabled by default. Tested by successfully migrating mdev device.

---
 hw/vfio/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/pci.c +0 -0
index f74be78209..15e26f460b 100644

hw/vfio/pci.c static Property vfio_pci_dev_properties[] = { · line 3205

Quoted 8 lines
hw/vfio/pci.c +1 -1
@@ -3199,7 +3199,7 @@ static Property vfio_pci_dev_properties[] = {
     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),
+                     vbasedev.enable_migration, true),
     DEFINE_PROP_BOOL("x-no-mmap", VFIOPCIDevice, vbasedev.no_mmap, false),
     DEFINE_PROP_BOOL("x-balloon-allowed", VFIOPCIDevice,
                      vbasedev.ram_block_discard_allowed, false),

I think we were still expecting some documentation for this feature, and I don't recall any update there.

Also, I don't think we have any vendor driver implementation integrated yet?

Reviewed-by Dr. David Alan Gilbert Acked-by Cornelia Huck on v1 1/1
#4 lore raw
In reply to Tarun Gupta

[Cc +Intel]

Quoted 20 lines · On Mon, 8 Mar 2021 21:39:49 +0530 Tarun Gupta <[email protected]> wrote:

VFIO migration support in QEMU is experimental as of now, which was done to provide soak time and resolve concerns regarding bit-stream. But, with the patches discussed in
https://www.mail-archive.com/[email protected]/msg784931.html , we have corrected ordering of saving PCI config space and bit-stream.

So, this patch proposes to make vfio migration support in QEMU to be enabled by default. Tested by successfully migrating mdev device.

---
 hw/vfio/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/pci.c +0 -0
index f74be78209..15e26f460b 100644

hw/vfio/pci.c static Property vfio_pci_dev_properties[] = { · line 3205

Quoted 8 lines
hw/vfio/pci.c +1 -1
@@ -3199,7 +3199,7 @@ static Property vfio_pci_dev_properties[] = {
     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),
+                     vbasedev.enable_migration, true),
     DEFINE_PROP_BOOL("x-no-mmap", VFIOPCIDevice, vbasedev.no_mmap, false),
     DEFINE_PROP_BOOL("x-balloon-allowed", VFIOPCIDevice,
                      vbasedev.ram_block_discard_allowed, false),

Looking back at the commit where this was added:

commit cf254988a50d4164c86a356c80b8d3ae0ccaa005

Author: Alex Williamson <[email protected]>
Date:   Mon Nov 9 11:56:02 2020 -0700

vfio: Make migration support experimental

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.]

What has tangibly changed since then? I think we have patches on-list to address the known issue of PCI config space (MSI) ordering, which related to enabling migration on ARM platforms. Do we have significantly more confidence in our ability to make compatible enhancement to the migration bitstream? This was a particularly troublesome point for me if we have any hope of calling this supportable. As far as I know, there are still no open source vendor drivers supporting migration for community testing. We're also still missing the documentation that was promised previously, as Connie noted.

Huawei and Intel, what's your confidence level and what can you share regarding support for this implementation? Thanks,

Alex

#5 lore raw
Quoted 80 lines

From: Alex Williamson <[email protected]>
Sent: Tuesday, March 9, 2021 6:51 AM

[Cc +Intel]

Quoted 1 line · On Mon, 8 Mar 2021 21:39:49 +0530 Tarun Gupta <[email protected]> wrote:

VFIO migration support in QEMU is experimental as of now, which was

done to

Quoted 3 lines

provide soak time and resolve concerns regarding bit-stream. But, with the patches discussed in
https://www.mail-archive.com/qemu-

[email protected]/msg784931.html , we have

Quoted 3 lines

corrected ordering of saving PCI config space and bit-stream.

So, this patch proposes to make vfio migration support in QEMU to be

enabled

Quoted 13 lines

by default. Tested by successfully migrating mdev device.

---
 hw/vfio/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/pci.c +0 -0
index f74be78209..15e26f460b 100644

hw/vfio/pci.c static Property vfio_pci_dev_properties[] = { · line 3203

Quoted 6 lines
hw/vfio/pci.c +1 -1
@@ -3199,7 +3199,7 @@ static Property vfio_pci_dev_properties[] = {
     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),
+                     vbasedev.enable_migration, true),
     DEFINE_PROP_BOOL("x-no-mmap", VFIOPCIDevice, vbasedev.no_mmap,

false),

hw/vfio/pci.c static Property vfio_pci_dev_properties[] = { · line 3205

Quoted 2 lines
hw/vfio/pci.c +0 -0
     DEFINE_PROP_BOOL("x-balloon-allowed", VFIOPCIDevice,
                      vbasedev.ram_block_discard_allowed, false),

Looking back at the commit where this was added:

commit cf254988a50d4164c86a356c80b8d3ae0ccaa005

Author: Alex Williamson <[email protected]>
Date:   Mon Nov 9 11:56:02 2020 -0700

vfio: Make migration support experimental

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.]

What has tangibly changed since then? I think we have patches on-list to address the known issue of PCI config space (MSI) ordering, which related to enabling migration on ARM platforms. Do we have significantly more confidence in our ability to make compatible enhancement to the migration bitstream? This was a particularly troublesome point for me if we have any hope of calling this supportable. As far as I know, there are still no open source vendor drivers supporting migration for community testing. We're also still missing the documentation that was promised previously, as Connie noted.

Quoted 3 lines

Huawei and Intel, what's your confidence level and what can you share regarding support for this implementation? Thanks,

Internally our GVT-g live migration support is still experimental, and due to resource/priority adjustment the upstreaming plan for this feature is currently on hold. Timing-wise I'd expect IDXD will be the 1st Intel driver which formally supports live migration (after its core functionalities - mdev/ vSVA are upstreamed). Alternatively once the vfio-pci-core library work is completed I believe many interests will be also arose regarding to VF live migration (e.g. NIC). But none of the options may come in short term...

Thanks
Kevin

#6 lore raw
In reply to Alex Williamson
Quoted 73 lines · Alex Williamson

[Cc +Intel]

Quoted 20 lines · On Mon, 8 Mar 2021 21:39:49 +0530 Tarun Gupta <[email protected]> wrote:

VFIO migration support in QEMU is experimental as of now, which was done to provide soak time and resolve concerns regarding bit-stream. But, with the patches discussed in
https://www.mail-archive.com/[email protected]/msg784931.html , we have corrected ordering of saving PCI config space and bit-stream.

So, this patch proposes to make vfio migration support in QEMU to be enabled by default. Tested by successfully migrating mdev device.

---
 hw/vfio/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/pci.c +0 -0
index f74be78209..15e26f460b 100644

hw/vfio/pci.c static Property vfio_pci_dev_properties[] = { · line 3205

Quoted 8 lines
hw/vfio/pci.c +1 -1
@@ -3199,7 +3199,7 @@ static Property vfio_pci_dev_properties[] = {
     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),
+                     vbasedev.enable_migration, true),
     DEFINE_PROP_BOOL("x-no-mmap", VFIOPCIDevice, vbasedev.no_mmap, false),
     DEFINE_PROP_BOOL("x-balloon-allowed", VFIOPCIDevice,
                      vbasedev.ram_block_discard_allowed, false),

Looking back at the commit where this was added:

commit cf254988a50d4164c86a356c80b8d3ae0ccaa005

Author: Alex Williamson <[email protected]>
Date:   Mon Nov 9 11:56:02 2020 -0700

vfio: Make migration support experimental

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.]

What has tangibly changed since then? I think we have patches on-list to address the known issue of PCI config space (MSI) ordering, which related to enabling migration on ARM platforms. Do we have significantly more confidence in our ability to make compatible enhancement to the migration bitstream? This was a particularly troublesome point for me if we have any hope of calling this supportable. As far as I know, there are still no open source vendor drivers supporting migration for community testing. We're also still missing the documentation that was promised previously, as Connie noted.

Quoted 2 lines

Huawei and Intel, what's your confidence level and what can you share regarding support for this implementation? Thanks,

We have sent a number of patches regarding VFIO migration from our own test (the support for this in our accelerator driver is still in experiment), some of them are still on-list []...

[] https://lore.kernel.org/qemu-devel/[email protected]/
https://lore.kernel.org/linux-arm-kernel/[email protected]/

Thanks,
Shenming

Quoted 5 lines

Alex

.

#7 lore raw
In reply to Tarun Gupta
Quoted 21 lines · Tarun Gupta

VFIO migration support in QEMU is experimental as of now, which was done to provide soak time and resolve concerns regarding bit-stream. But, with the patches discussed in
https://www.mail-archive.com/[email protected]/msg784931.html , we have corrected ordering of saving PCI config space and bit-stream.

So, this patch proposes to make vfio migration support in QEMU to be enabled by default. Tested by successfully migrating mdev device.

---
 hw/vfio/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/pci.c +0 -0
index f74be78209..15e26f460b 100644

hw/vfio/pci.c static Property vfio_pci_dev_properties[] = { · line 3205

Quoted 8 lines
hw/vfio/pci.c +1 -1
@@ -3199,7 +3199,7 @@ static Property vfio_pci_dev_properties[] = {
     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),
+                     vbasedev.enable_migration, true),
     DEFINE_PROP_BOOL("x-no-mmap", VFIOPCIDevice, vbasedev.no_mmap, false),
     DEFINE_PROP_BOOL("x-balloon-allowed", VFIOPCIDevice,
                      vbasedev.ram_block_discard_allowed, false),

Hello,

has plain snapshot been tested?
If I issue the HMP command "savevm", and then "loadvm", will things work fine?

Thanks,

CLaudio

#8 lore raw
Quoted 33 lines · Claudio Fontana
Quoted 21 lines · Tarun Gupta

VFIO migration support in QEMU is experimental as of now, which was done to
provide soak time and resolve concerns regarding bit-stream.
But, with the patches discussed in
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.mail-archive.com%2Fqemu-devel%40nongnu.org%2Fmsg784931.html&amp;data=04%7C01%7Ckwankhede%40nvidia.com%7C98194e8a856f4e6b611c08d943769ab5%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637614998961553398%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=A2EY9LEqGE0BSrT25h2WtWonb5oi0O%2B6%2BQmvhVf8Wd4%3D&amp;reserved=0 , we have corrected ordering of saving PCI config space and bit-stream.

So, this patch proposes to make vfio migration support in QEMU to be enabled by default. Tested by successfully migrating mdev device.

---
  hw/vfio/pci.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/pci.c +0 -0
index f74be78209..15e26f460b 100644

hw/vfio/pci.c static Property vfio_pci_dev_properties[] = { · line 3205

Quoted 8 lines
hw/vfio/pci.c +1 -1
@@ -3199,7 +3199,7 @@ static Property vfio_pci_dev_properties[] = {
      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),
+                     vbasedev.enable_migration, true),
      DEFINE_PROP_BOOL("x-no-mmap", VFIOPCIDevice, vbasedev.no_mmap, false),
      DEFINE_PROP_BOOL("x-balloon-allowed", VFIOPCIDevice,
                       vbasedev.ram_block_discard_allowed, false),

Hello,

Quoted 1 line

has plain snapshot been tested?

Yes.

Quoted 1 line

If I issue the HMP command "savevm", and then "loadvm", will things work fine?

Yes

Thanks,
Kirti

#9 lore raw
Quoted 40 lines · Kirti Wankhede
Quoted 37 lines · Claudio Fontana
Quoted 31 lines · Tarun Gupta

VFIO migration support in QEMU is experimental as of now, which was done to
provide soak time and resolve concerns regarding bit-stream. But, with the patches discussed in
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.mail-archive.com%2Fqemu-devel%40nongnu.org%2Fmsg784931.html&amp;data=04%7C01%7Ckwankhede%40nvidia.com%7C98194e8a856f4e6b611c08d943769ab5%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637614998961553398%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=A2EY9LEqGE0BSrT25h2WtWonb5oi0O%2B6%2BQmvhVf8Wd4%3D&amp;reserved=0
, we have
corrected ordering of saving PCI config space and bit-stream.

So, this patch proposes to make vfio migration support in QEMU to be enabled
by default. Tested by successfully migrating mdev device.

---
  hw/vfio/pci.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/pci.c +1 -1
index f74be78209..15e26f460b 100644
@@ -3199,7 +3199,7 @@ static Property vfio_pci_dev_properties[] = {
       DEFINE_PROP_BIT("x-igd-opregion", VFIOPCIDevice, features,
                       VFIO_FEATURE_ENABLE_IGD_OPREGION_BIT, false),
       DEFINE_PROP_BOOL("", VFIOPCIDevice,
-                     vbasedev.enable_migration, false),
+                     vbasedev.enable_migration, true),
       DEFINE_PROP_BOOL("x-no-mmap", VFIOPCIDevice, vbasedev.no_mmap,
 false),
       DEFINE_PROP_BOOL("x-balloon-allowed", VFIOPCIDevice,
Quoted 2 lines

                       vbasedev.ram_block_discard_allowed, false),

Hello,

Quoted 9 lines
Quoted 1 line

has plain snapshot been tested?

Yes.

Quoted 2 lines

If I issue the HMP command "savevm", and then "loadvm", will things work fine?

Yes

Hello Kirti,

I enabled x-enable-migration and did some hack on failover_pair_id, finally made  "virsh save/restore" and "savevm/loadvm"work through. However, it seems vGPU did not get involved in the real migration process, the qemu trace file confirmed it, there is no vfio section for savevm_section_start at all.

I am using kernel 5.8 and latest qemu, vGPU 12.2 with one V100. I am wondering if there is a version compatible requirement or need extra setup. Could you share your test setup here? Thanks in advance.

Regards,

Liang

Quoted 3 lines

Thanks,
Kirti