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

2021-03-26 Thread Shenming Lu
On 2021/3/26 21:18, Tarun Gupta wrote: > Document interfaces used for VFIO device migration. Added flow of state > changes > during live migration with VFIO device. Tested by building docs with the new > vfio-migration.rst file. > > v3: > - Add introductory line about VM migration in general. > -

Re: [PATCH v1 1/1] vfio: Make migration support non experimental by default.

2021-03-11 Thread Shenming Lu
On 2021/3/9 6:51, Alex Williamson wrote: > [Cc +Intel] > > On Mon, 8 Mar 2021 21:39:49 +0530 > Tarun Gupta 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

[PATCH v4 2/3] vfio: Set the priority of the VFIO VM state change handler explicitly

2021-03-09 Thread Shenming Lu
the priority of the VFIO VM state change handler explicitly (like virtio devices) to ensure it is called before the GIC's in saving. Signed-off-by: Shenming Lu Reviewed-by: Kirti Wankhede Reviewed-by: Cornelia Huck --- hw/vfio/migration.c | 3 ++- 1 file changed, 2 insertions(+), 1 del

[PATCH v4 0/3] vfio: Some fixes and optimizations for VFIO migration

2021-03-09 Thread Shenming Lu
h 3. v2 -> v3: - Nit fixes. - Set error in migration stream for migration to fail in Patch 1. - Tested Patch 3 with a Windows guest. Thanks, Shenming Shenming Lu (3): vfio: Move the saving of the config space to the right place in VFIO migration vfio: Set the priority of the VFIO VM

[PATCH v4 3/3] vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration

2021-03-09 Thread Shenming Lu
asked vectors one by one without disabling. Signed-off-by: Shenming Lu --- hw/vfio/pci.c | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index f74be78209..fece8c2504 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -569,6 +

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

2021-03-09 Thread Shenming Lu
according to their priorities. As for the possible dependence of the device specific migration data on it's config space, we can let the vendor driver to include any config info it needs in its own data stream. Signed-off-by: Shenming Lu Reviewed-by: Kirti Wankhede --- hw/vfio/migration.c

Re: [PATCH v3 3/3] vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration

2021-03-08 Thread Shenming Lu
llocated(pdev); nr++) { if (!msix_is_masked(pdev, nr)) { max_vec = nr; } } } Thanks, Shenming > Thanks, > > Alex > > On Tue, 23 Feb 2021 10:22:25 +0800 > Shenming Lu wrote: > >> In VFIO migration resume phase and some guest startups, there are &g

Re: [PATCH v3 0/3] vfio: Some fixes and optimizations for VFIO migration

2021-03-01 Thread Shenming Lu
Hi Alex, Does this series need any further modification? Wish you can pick it up. :-) On 2021/2/23 10:22, Shenming Lu wrote: > This patch set includes two fixes and one optimization for VFIO migration > as blew: > > Patch 1-2: > - Fix two ordering problems in migratio

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

2021-02-22 Thread Shenming Lu
according to their priorities. As for the possible dependence of the device specific migration data on it's config space, we can let the vendor driver to include any config info it needs in its own data stream. Signed-off-by: Shenming Lu --- hw/vfio/migration.c | 25 +++-- 1

[PATCH v3 2/3] vfio: Set the priority of the VFIO VM state change handler explicitly

2021-02-22 Thread Shenming Lu
the priority of the VFIO VM state change handler explicitly (like virtio devices) to ensure it is called before the GIC's in saving. Signed-off-by: Shenming Lu Reviewed-by: Kirti Wankhede Reviewed-by: Cornelia Huck --- hw/vfio/migration.c | 3 ++- 1 file changed, 2 insertions(+), 1 del

[PATCH v3 0/3] vfio: Some fixes and optimizations for VFIO migration

2021-02-22 Thread Shenming Lu
to fail in Patch 1. - Tested Patch 3 with a Windows guest. Thanks, Shenming Shenming Lu (3): vfio: Move the saving of the config space to the right place in VFIO migration vfio: Set the priority of the VFIO VM state change handler explicitly vfio: Avoid disabling and enabling vect

[PATCH v3 3/3] vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration

2021-02-22 Thread Shenming Lu
asked vectors one by one without disabling. Signed-off-by: Shenming Lu --- hw/pci/msix.c | 2 +- hw/vfio/pci.c | 20 +--- include/hw/pci/msix.h | 1 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/hw/pci/msix.c b/hw/pci/msix.c index ae9331cd0b..e0579

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

2021-02-19 Thread Shenming Lu
On 2021/2/18 22:42, Kirti Wankhede wrote: > > > 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 t

Re: [RFC PATCH v2 3/3] vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration

2021-01-31 Thread Shenming Lu
On 2021/1/27 22:21, Alex Williamson wrote: > On Wed, 27 Jan 2021 19:27:35 +0800 > Shenming Lu wrote: > >> On 2021/1/27 5:36, Alex Williamson wrote: >>> On Wed, 9 Dec 2020 16:09:19 +0800 >>> Shenming Lu wrote: >>> >>>> Different f

Re: [RFC PATCH v2 2/3] vfio: Set the priority of the VFIO VM state change handler explicitly

2021-01-27 Thread Shenming Lu
On 2021/1/27 22:20, Alex Williamson wrote: > On Wed, 27 Jan 2021 19:20:06 +0800 > Shenming Lu wrote: > >> On 2021/1/27 5:36, Alex Williamson wrote: >>> On Wed, 9 Dec 2020 16:09:18 +0800 >>> Shenming Lu wrote: >>> >>>> In the VFIO VM state

Re: [RFC PATCH v2 3/3] vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration

2021-01-27 Thread Shenming Lu
On 2021/1/27 5:36, Alex Williamson wrote: > On Wed, 9 Dec 2020 16:09:19 +0800 > Shenming Lu wrote: > >> Different from the normal situation when the guest starts, we can >> know the max unmasked vetctor (at the beginning) after msix_load() >> in VFIO migration. So in o

Re: [RFC PATCH v2 2/3] vfio: Set the priority of the VFIO VM state change handler explicitly

2021-01-27 Thread Shenming Lu
On 2021/1/27 5:36, Alex Williamson wrote: > On Wed, 9 Dec 2020 16:09:18 +0800 > Shenming Lu wrote: > >> In the VFIO VM state change handler, VFIO devices are transitioned >> in the _SAVING state, which should keep them from sending interrupts. > > Is this comment acc

Re: [RFC PATCH v2 0/3] vfio: Some fixes and optimizations for VFIO migration

2021-01-25 Thread Shenming Lu
On 2020/12/9 16:09, Shenming Lu wrote: > This patch set includes two fixes and one optimization for VFIO migration > as blew: > Patch 1-2: > - Fix two ordering problems in migration. > > Patch 3: > - Optimize the enabling process of the MSI-X vectors in migration. > Hi,

Re: [RFC PATCH v2 2/3] vfio: Set the priority of the VFIO VM state change handler explicitly

2020-12-09 Thread Shenming Lu
On 2020/12/9 20:45, Cornelia Huck wrote: > On Wed, 9 Dec 2020 16:09:18 +0800 > Shenming Lu wrote: > >> In the VFIO VM state change handler, VFIO devices are transitioned >> in the _SAVING state, which should keep them from sending interrupts. >> Then we can sav

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

2020-12-09 Thread Shenming Lu
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 ioctl is dependent on the VM interrupt >>> setup, i

[RFC PATCH v2 2/3] vfio: Set the priority of the VFIO VM state change handler explicitly

2020-12-09 Thread Shenming Lu
handler explicitly (like virtio devices) to ensure it is called before the GIC's in saving. Signed-off-by: Shenming Lu Reviewed-by: Kirti Wankhede --- hw/vfio/migration.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c

[RFC PATCH v2 3/3] vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration

2020-12-09 Thread Shenming Lu
these unmasked vectors one by one without disabling. Signed-off-by: Shenming Lu --- hw/pci/msix.c | 17 + hw/vfio/pci.c | 10 -- include/hw/pci/msix.h | 2 ++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/hw/pci/msix.c b/hw/pci/msix.c

[RFC PATCH v2 0/3] vfio: Some fixes and optimizations for VFIO migration

2020-12-09 Thread Shenming Lu
This patch set includes two fixes and one optimization for VFIO migration as blew: Patch 1-2: - Fix two ordering problems in migration. Patch 3: - Optimize the enabling process of the MSI-X vectors in migration. Thanks, Shenming Shenming Lu (3): vfio: Move the saving of the config space to

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

2020-12-09 Thread Shenming Lu
ff-by: Shenming Lu --- hw/vfio/migration.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 00daa50ed8..3b9de1353a 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -575,11 +575,6 @@ stati

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

2020-12-04 Thread Shenming Lu
On 2020/12/2 18:55, Dr. David Alan Gilbert wrote: > * Shenming Lu (lushenm...@huawei.com) wrote: >> Hi, >> >> After reading everyone's opinions, we have a rough idea for this issue. >> >> One key point is whether it is necessary to setup the config space b

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

2020-12-03 Thread Shenming Lu
On 2020/12/2 6:21, Alex Williamson wrote: > On Tue, 1 Dec 2020 14:37:52 +0800 > Shenming Lu wrote: > >> On 2020/12/1 1:03, Alex Williamson wrote: >>> On Thu, 26 Nov 2020 14:56:17 +0800 >>> Shenming Lu wrote: >>> >>>> Hi, >>>>

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

2020-11-30 Thread Shenming Lu
On 2020/12/1 1:03, Alex Williamson wrote: > On Thu, 26 Nov 2020 14:56:17 +0800 > Shenming Lu wrote: > >> Hi, >> >> After reading everyone's opinions, we have a rough idea for this issue. >> >> One key point is whether it is necessary to setup the

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

2020-11-25 Thread Shenming Lu
Hi, After reading everyone's opinions, we have a rough idea for this issue. One key point is whether it is necessary to setup the config space before the device can accept further migration data. I think it is decided by the vendor driver, so we can simply ask the vendor driver about it in .save_

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

2020-11-24 Thread Shenming Lu
On 2020/11/24 3:33, Neo Jia wrote: > On Mon, Nov 23, 2020 at 11:14:38AM +0800, Shenming Lu wrote: >> External email: Use caution opening links or attachments >> >> >> On 2020/11/21 6:01, Alex Williamson wrote: >>> On Fri, 20 Nov 2020 22:05:49 +0800 >>>

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

2020-11-22 Thread Shenming Lu
On 2020/11/21 6:01, Alex Williamson wrote: > On Fri, 20 Nov 2020 22:05:49 +0800 > Shenming Lu wrote: > >> On 2020/11/20 1:41, Alex Williamson wrote: >>> On Thu, 19 Nov 2020 14:13:24 +0530 >>> Kirti Wankhede wrote: >>> >>>> On 11/14/2020

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

2020-11-20 Thread Shenming Lu
On 2020/11/20 1:41, Alex Williamson wrote: > On Thu, 19 Nov 2020 14:13:24 +0530 > Kirti Wankhede wrote: > >> On 11/14/2020 2:47 PM, Shenming Lu wrote: >>> When running VFIO migration, I found that the restoring of VFIO PCI device’s >>> config space is before VG

[PATCH RFC] vfio: Set the priority of VFIO VM state change handler explicitly

2020-11-16 Thread Shenming Lu
(like virtio devices) to ensure it is called before GIC's in saving. Signed-off-by: Shenming Lu --- hw/vfio/migration.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 55261562d4..d0d30864ba 100644 --- a/hw/vfio/migrat

[PATCH RFC] vfio: Move the saving of the config space to the right place in VFIO migration

2020-11-14 Thread Shenming Lu
VGIC according to their priorities. Signed-off-by: Shenming Lu --- hw/vfio/migration.c | 22 ++ 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 3ce285ea39..028da35a25 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio

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

2020-11-03 Thread Shenming Lu
On 6/23/2020 1:58 AM, Alex Williamson wrote: >> +} else if (interrupt_type == VFIO_INT_MSIX) { >> +uint16_t offset; >> + >> +offset = pci_default_read_config(pdev, >> + pdev->msix_cap + PCI_MSIX_FLAGS + 1, >> 2); >> +/* load enable