All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex@shazbot.org>
To: Yishai Hadas <yishaih@nvidia.com>
Cc: "Cédric Le Goater" <clg@redhat.com>,
	"Peter Xu" <peterx@redhat.com>,
	jgg@nvidia.com, kvm@vger.kernel.org, kevin.tian@intel.com,
	joao.m.martins@oracle.com, leonro@nvidia.com, maorg@nvidia.com,
	avihaih@nvidia.com, liulongfang@huawei.com,
	giovanni.cabiddu@intel.com, kwankhede@nvidia.com,
	alex@shazbot.org
Subject: Re: [PATCH vfio 0/6] Add support for PRE_COPY initial bytes re-initialization
Date: Tue, 10 Mar 2026 10:00:02 -0600	[thread overview]
Message-ID: <20260310100002.21f00d61@shazbot.org> (raw)
In-Reply-To: <51f060d7-a7c3-40f3-b8b9-0c4010153b79@nvidia.com>

On Tue, 10 Mar 2026 14:44:04 +0200
Yishai Hadas <yishaih@nvidia.com> wrote:

> On 10/03/2026 12:09, Cédric Le Goater wrote:
> > On 3/10/26 10:46, Yishai Hadas wrote:  
> >> On 01/03/2026 14:43, Yishai Hadas wrote:  
> >>> On 28/02/2026 8:27, Cédric Le Goater wrote:  
> >>>> Hello,
> >>>>
> >>>> On 2/27/26 21:23, Alex Williamson wrote:  
> >>>>>
> >>>>> +Cédric, +Peter, please see what you think of this approach 
> >>>>> relative to
> >>>>> QEMU.  The broken uAPI for flags on the PRECOPY_INFO ioctl is
> >>>>> unfortunate, but we need an opt-in for the driver to enable REINIT
> >>>>> reporting anyway.  Thanks,
> >>>>>
> >>>>> Alex  
> >>>>
> >>>>
> >>>> I took a quick look. The series would be a little cleaner if
> >>>> vfio_check_precopy_ioctl() came first  
> >>>
> >>> The motivation to introduce that core helper and adapt all the 
> >>> drivers to use it, was to centralize the common code and ensures that 
> >>> output flags are cleared on entry.
> >>>
> >>> This can be done only after that we have the previous opt-in patch as 
> >>> we would like to keep the V1 behavior for compatibility reasons.
> >>>  
> >>>> and some parts are little ugly
> >>>> (precopy_info_flags_fix). Will take a closer look when back from PTO.
> >>>>  
> >>>
> >>> I'm open for any better name, any specific suggestion ?  
> >>
> >> How about renaming it to precopy_info_v2, which is closer to the 
> >> feature name ?  
> > 
> > I found the prefix '_fix'  confusing and saw no connection with
> > the names of the new flag (VFIO_PRECOPY_INFO_REINIT) or ioctl
> > VFIO_DEVICE_FEATURE_MIG_PRECOPY_INFOv2.
> > 
> > 
> > Based on how 'precopy_info_flags_fix' is used in mlx5vf_precopy_ioctl() :
> > 
> >    +    /*
> >    +     * opt-in for VFIO_DEVICE_FEATURE_MIG_PRECOPY_INFOv2 serves
> >    +     * as opt-in for VFIO_PRECOPY_INFO_REINIT as well
> >    +     */
> >    +    reinit_state = mvdev->core_device.vdev.precopy_info_flags_fix &&
> >    +            migration_state == 
> > MLX5_QUERY_VHCA_MIG_STATE_OPER_MIGRATION_INIT;
> > 
> > 
> > a name like 'precopy_reinit_allow' seems appropriate to me.  
> 
> The opt-in allows using the 'flags' field not only for the reinit case, 
> but for any further usage.

Yes.  It started out as an opt-in for reinit, but then the failure to
sanitize flags was discovered and it seemed to make sense that if we're
defining a v2 interface where flags is valid, reinit could be a
fundamental part of the new base v2 protocol.

If a driver doesn't want/need to support reinit, it never needs to
raise that flag.  Userspace can also always choose to ignore the flag
and transition to stop-copy at any point.  It didn't seem worth a
separate opt-in beyond v2, but do comment if you have other ideas.

This could have also gone the route of making a new v2 ioctl, but this
seemed slightly cleaner.  Thanks,

Alex

      reply	other threads:[~2026-03-10 16:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24  8:20 [PATCH vfio 0/6] Add support for PRE_COPY initial bytes re-initialization Yishai Hadas
2026-02-24  8:20 ` [PATCH vfio 1/6] vfio: Define uAPI for re-init initial bytes during the PRE_COPY phase Yishai Hadas
2026-02-27 20:42   ` Alex Williamson
2026-02-24  8:20 ` [PATCH vfio 2/6] vfio: Add support for VFIO_DEVICE_FEATURE_MIG_PRECOPY_INFOv2 Yishai Hadas
2026-02-27 20:42   ` Alex Williamson
2026-02-28 19:51     ` Alex Williamson
2026-02-24  8:20 ` [PATCH vfio 3/6] vfio: Adapt drivers to use the core helper vfio_check_precopy_ioctl Yishai Hadas
2026-02-24  8:20 ` [PATCH vfio 4/6] net/mlx5: Add IFC bits for migration state Yishai Hadas
2026-02-24  8:20 ` [PATCH vfio 5/6] vfio/mlx5: consider inflight SAVE during PRE_COPY Yishai Hadas
2026-02-24  8:20 ` [PATCH vfio 6/6] vfio/mlx5: Add REINIT support to VFIO_MIG_GET_PRECOPY_INFO Yishai Hadas
2026-02-27 20:23 ` [PATCH vfio 0/6] Add support for PRE_COPY initial bytes re-initialization Alex Williamson
2026-02-28  6:27   ` Cédric Le Goater
2026-03-01 12:43     ` Yishai Hadas
2026-03-10  9:46       ` Yishai Hadas
2026-03-10 10:09         ` Cédric Le Goater
2026-03-10 12:44           ` Yishai Hadas
2026-03-10 16:00             ` Alex Williamson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260310100002.21f00d61@shazbot.org \
    --to=alex@shazbot.org \
    --cc=avihaih@nvidia.com \
    --cc=clg@redhat.com \
    --cc=giovanni.cabiddu@intel.com \
    --cc=jgg@nvidia.com \
    --cc=joao.m.martins@oracle.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=leonro@nvidia.com \
    --cc=liulongfang@huawei.com \
    --cc=maorg@nvidia.com \
    --cc=peterx@redhat.com \
    --cc=yishaih@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.