Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-29 Thread Avihai Horon
On 28/11/2022 23:10, Alex Williamson wrote: External email: Use caution opening links or attachments On Mon, 28 Nov 2022 16:56:39 -0400 Jason Gunthorpe wrote: On Mon, Nov 28, 2022 at 01:36:30PM -0700, Alex Williamson wrote: On Mon, 28 Nov 2022 15:40:23 -0400 Jason Gunthorpe wrote: On

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-28 Thread Alex Williamson
On Mon, 28 Nov 2022 16:56:39 -0400 Jason Gunthorpe wrote: > On Mon, Nov 28, 2022 at 01:36:30PM -0700, Alex Williamson wrote: > > On Mon, 28 Nov 2022 15:40:23 -0400 > > Jason Gunthorpe wrote: > > > > > On Mon, Nov 28, 2022 at 11:50:03AM -0700, Alex Williamson wrote: > > > > > > > There's a

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-28 Thread Jason Gunthorpe
On Mon, Nov 28, 2022 at 01:36:30PM -0700, Alex Williamson wrote: > On Mon, 28 Nov 2022 15:40:23 -0400 > Jason Gunthorpe wrote: > > > On Mon, Nov 28, 2022 at 11:50:03AM -0700, Alex Williamson wrote: > > > > > There's a claim here about added complexity that I'm not really seeing. > > > It looks

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-28 Thread Alex Williamson
On Mon, 28 Nov 2022 15:40:23 -0400 Jason Gunthorpe wrote: > On Mon, Nov 28, 2022 at 11:50:03AM -0700, Alex Williamson wrote: > > > There's a claim here about added complexity that I'm not really seeing. > > It looks like we simply make an ioctl call here and scale our buffer > > based on the

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-28 Thread Jason Gunthorpe
On Mon, Nov 28, 2022 at 11:50:03AM -0700, Alex Williamson wrote: > There's a claim here about added complexity that I'm not really seeing. > It looks like we simply make an ioctl call here and scale our buffer > based on the minimum of the returned device estimate or our upper > bound. I'm not

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-28 Thread Alex Williamson
On Thu, 24 Nov 2022 14:41:00 +0200 Avihai Horon wrote: > On 20/11/2022 11:34, Avihai Horon wrote: > > > > On 17/11/2022 19:38, Alex Williamson wrote: > >> External email: Use caution opening links or attachments > >> > >> > >> On Thu, 17 Nov 2022 19:07:10 +0200 > >> Avihai Horon wrote: >

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-24 Thread Avihai Horon
On 24/11/2022 15:28, Dr. David Alan Gilbert wrote: External email: Use caution opening links or attachments * Avihai Horon (avih...@nvidia.com) wrote: On 23/11/2022 20:59, Dr. David Alan Gilbert wrote: External email: Use caution opening links or attachments * Avihai Horon

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-24 Thread Dr. David Alan Gilbert
* Avihai Horon (avih...@nvidia.com) wrote: > > On 23/11/2022 20:59, Dr. David Alan Gilbert wrote: > > External email: Use caution opening links or attachments > > > > > > * Avihai Horon (avih...@nvidia.com) wrote: > > > > > > > > > +ret = qemu_file_get_to_fd(f, migration->data_fd,

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-24 Thread Avihai Horon
On 20/11/2022 11:34, Avihai Horon wrote: On 17/11/2022 19:38, Alex Williamson wrote: External email: Use caution opening links or attachments On Thu, 17 Nov 2022 19:07:10 +0200 Avihai Horon wrote: On 16/11/2022 20:29, Alex Williamson wrote: On Thu, 3 Nov 2022 18:16:15 +0200 Avihai Horon

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-24 Thread Avihai Horon
On 23/11/2022 20:59, Dr. David Alan Gilbert wrote: External email: Use caution opening links or attachments * Avihai Horon (avih...@nvidia.com) wrote: +ret = qemu_file_get_to_fd(f, migration->data_fd, data_size); +if (!ret) { +

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-23 Thread Dr. David Alan Gilbert
* Avihai Horon (avih...@nvidia.com) wrote: > +ret = qemu_file_get_to_fd(f, migration->data_fd, data_size); > +if (!ret) { > +trace_vfio_load_state_device_data(vbasedev->name, data_size); > + > +} I notice you had a few cases like that; I wouldn't bother making that

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-20 Thread Avihai Horon
On 17/11/2022 19:38, Alex Williamson wrote: External email: Use caution opening links or attachments On Thu, 17 Nov 2022 19:07:10 +0200 Avihai Horon wrote: On 16/11/2022 20:29, Alex Williamson wrote: On Thu, 3 Nov 2022 18:16:15 +0200 Avihai Horon wrote: diff --git a/hw/vfio/migration.c

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-20 Thread Avihai Horon
On 17/11/2022 19:24, Jason Gunthorpe wrote: On Thu, Nov 17, 2022 at 07:07:10PM +0200, Avihai Horon wrote: +} + +if (mig_state->data_fd != -1) { +if (migration->data_fd != -1) { +/* + * This can happen if the device is asynchronously reset and +

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-17 Thread Alex Williamson
On Thu, 17 Nov 2022 19:07:10 +0200 Avihai Horon wrote: > On 16/11/2022 20:29, Alex Williamson wrote: > > On Thu, 3 Nov 2022 18:16:15 +0200 > > Avihai Horon wrote: > >> diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c > >> index e784374453..62afc23a8c 100644 > >> --- a/hw/vfio/migration.c >

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-17 Thread Jason Gunthorpe
On Thu, Nov 17, 2022 at 07:07:10PM +0200, Avihai Horon wrote: > > > +} > > > + > > > +if (mig_state->data_fd != -1) { > > > +if (migration->data_fd != -1) { > > > +/* > > > + * This can happen if the device is asynchronously reset and > > > + *

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-17 Thread Avihai Horon
On 16/11/2022 20:29, Alex Williamson wrote: External email: Use caution opening links or attachments On Thu, 3 Nov 2022 18:16:15 +0200 Avihai Horon wrote: Add implementation of VFIO migration protocol v2. The two protocols, v1 and v2, will co-exist and in next patch v1 protocol will be

Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-16 Thread Alex Williamson
On Thu, 3 Nov 2022 18:16:15 +0200 Avihai Horon wrote: > Add implementation of VFIO migration protocol v2. The two protocols, v1 > and v2, will co-exist and in next patch v1 protocol will be removed. > > There are several main differences between v1 and v2 protocols: > - VFIO device state is now

[PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2

2022-11-03 Thread Avihai Horon
Add implementation of VFIO migration protocol v2. The two protocols, v1 and v2, will co-exist and in next patch v1 protocol will be removed. There are several main differences between v1 and v2 protocols: - VFIO device state is now represented as a finite state machine instead of a bitmap. -