All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 1/4] vdpa: Add resume operation
       [not found] ` <491fb8fe786739958eb9ff3df2250a4188b0bbe5.1665745877.git.sebastien.boeuf@intel.com>
@ 2022-10-17  7:19   ` Jason Wang
  2022-10-18  0:12     ` Si-Wei Liu
  0 siblings, 1 reply; 7+ messages in thread
From: Jason Wang @ 2022-10-17  7:19 UTC (permalink / raw)
  To: sebastien.boeuf; +Cc: eperezma, mst, virtualization

On Fri, Oct 14, 2022 at 7:14 PM <sebastien.boeuf@intel.com> wrote:
>
> From: Sebastien Boeuf <sebastien.boeuf@intel.com>
>
> Add a new operation to allow a vDPA device to be resumed after it has
> been suspended. Trying to resume a device that wasn't suspended will
> result in a no-op.
>
> This operation is optional. If it's not implemented, the associated
> backend feature bit will not be exposed. And if the feature bit is not
> exposed, invoking this operation will return an error.
>
> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>

Acked-by: Jason Wang <jasowang@redhat.com>

> ---
>  include/linux/vdpa.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index 6d0f5e4e82c2..96d308cbf97b 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -219,7 +219,10 @@ struct vdpa_map_file {
>   * @reset:                     Reset device
>   *                             @vdev: vdpa device
>   *                             Returns integer: success (0) or error (< 0)
> - * @suspend:                   Suspend or resume the device (optional)
> + * @suspend:                   Suspend the device (optional)
> + *                             @vdev: vdpa device
> + *                             Returns integer: success (0) or error (< 0)
> + * @resume:                    Resume the device (optional)
>   *                             @vdev: vdpa device
>   *                             Returns integer: success (0) or error (< 0)
>   * @get_config_size:           Get the size of the configuration space includes
> @@ -324,6 +327,7 @@ struct vdpa_config_ops {
>         void (*set_status)(struct vdpa_device *vdev, u8 status);
>         int (*reset)(struct vdpa_device *vdev);
>         int (*suspend)(struct vdpa_device *vdev);
> +       int (*resume)(struct vdpa_device *vdev);
>         size_t (*get_config_size)(struct vdpa_device *vdev);
>         void (*get_config)(struct vdpa_device *vdev, unsigned int offset,
>                            void *buf, unsigned int len);
> --
> 2.34.1
>
> ---------------------------------------------------------------------
> Intel Corporation SAS (French simplified joint stock company)
> Registered headquarters: "Les Montalets"- 2, rue de Paris,
> 92196 Meudon Cedex, France
> Registration Number:  302 456 199 R.C.S. NANTERRE
> Capital: 5 208 026.16 Euros
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* Re: [PATCH v2 2/4] vhost-vdpa: Introduce RESUME backend feature bit
       [not found] ` <df57ddc44ed8950dc79c63597e3091b1da551959.1665745877.git.sebastien.boeuf@intel.com>
@ 2022-10-17  7:20   ` Jason Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Jason Wang @ 2022-10-17  7:20 UTC (permalink / raw)
  To: sebastien.boeuf; +Cc: eperezma, mst, virtualization

On Fri, Oct 14, 2022 at 7:15 PM <sebastien.boeuf@intel.com> wrote:
>
> From: Sebastien Boeuf <sebastien.boeuf@intel.com>
>
> Userspace knows if the device can be resumed or not by checking this
> feature bit.
>
> It's only exposed if the vdpa driver backend implements the resume()
> operation callback. Userspace trying to negotiate this feature when it
> hasn't been exposed will result in an error.
>
> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>

Acked-by: Jason Wang <jasowang@redhat.com>

> ---
>  drivers/vhost/vdpa.c             | 16 +++++++++++++++-
>  include/uapi/linux/vhost_types.h |  2 ++
>  2 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> index 166044642fd5..833617d00ef6 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -355,6 +355,14 @@ static bool vhost_vdpa_can_suspend(const struct vhost_vdpa *v)
>         return ops->suspend;
>  }
>
> +static bool vhost_vdpa_can_resume(const struct vhost_vdpa *v)
> +{
> +       struct vdpa_device *vdpa = v->vdpa;
> +       const struct vdpa_config_ops *ops = vdpa->config;
> +
> +       return ops->resume;
> +}
> +
>  static long vhost_vdpa_get_features(struct vhost_vdpa *v, u64 __user *featurep)
>  {
>         struct vdpa_device *vdpa = v->vdpa;
> @@ -602,11 +610,15 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep,
>                 if (copy_from_user(&features, featurep, sizeof(features)))
>                         return -EFAULT;
>                 if (features & ~(VHOST_VDPA_BACKEND_FEATURES |
> -                                BIT_ULL(VHOST_BACKEND_F_SUSPEND)))
> +                                BIT_ULL(VHOST_BACKEND_F_SUSPEND) |
> +                                BIT_ULL(VHOST_BACKEND_F_RESUME)))
>                         return -EOPNOTSUPP;
>                 if ((features & BIT_ULL(VHOST_BACKEND_F_SUSPEND)) &&
>                      !vhost_vdpa_can_suspend(v))
>                         return -EOPNOTSUPP;
> +               if ((features & BIT_ULL(VHOST_BACKEND_F_RESUME)) &&
> +                    !vhost_vdpa_can_resume(v))
> +                       return -EOPNOTSUPP;
>                 vhost_set_backend_features(&v->vdev, features);
>                 return 0;
>         }
> @@ -658,6 +670,8 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep,
>                 features = VHOST_VDPA_BACKEND_FEATURES;
>                 if (vhost_vdpa_can_suspend(v))
>                         features |= BIT_ULL(VHOST_BACKEND_F_SUSPEND);
> +               if (vhost_vdpa_can_resume(v))
> +                       features |= BIT_ULL(VHOST_BACKEND_F_RESUME);
>                 if (copy_to_user(featurep, &features, sizeof(features)))
>                         r = -EFAULT;
>                 break;
> diff --git a/include/uapi/linux/vhost_types.h b/include/uapi/linux/vhost_types.h
> index 53601ce2c20a..c5690a8992d8 100644
> --- a/include/uapi/linux/vhost_types.h
> +++ b/include/uapi/linux/vhost_types.h
> @@ -163,5 +163,7 @@ struct vhost_vdpa_iova_range {
>  #define VHOST_BACKEND_F_IOTLB_ASID  0x3
>  /* Device can be suspended */
>  #define VHOST_BACKEND_F_SUSPEND  0x4
> +/* Device can be resumed */
> +#define VHOST_BACKEND_F_RESUME  0x5
>
>  #endif
> --
> 2.34.1
>
> ---------------------------------------------------------------------
> Intel Corporation SAS (French simplified joint stock company)
> Registered headquarters: "Les Montalets"- 2, rue de Paris,
> 92196 Meudon Cedex, France
> Registration Number:  302 456 199 R.C.S. NANTERRE
> Capital: 5 208 026.16 Euros
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* Re: [PATCH v2 3/4] vhost-vdpa: uAPI to resume the device
       [not found] ` <d23b16abdc15f5e2aa1430cf48101dd256638809.1665745877.git.sebastien.boeuf@intel.com>
@ 2022-10-17  7:22   ` Jason Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Jason Wang @ 2022-10-17  7:22 UTC (permalink / raw)
  To: sebastien.boeuf; +Cc: eperezma, mst, virtualization

On Fri, Oct 14, 2022 at 7:15 PM <sebastien.boeuf@intel.com> wrote:
>
> From: Sebastien Boeuf <sebastien.boeuf@intel.com>
>
> This new ioctl adds support for resuming the device from userspace.
>
> This is required when trying to restore the device in a functioning
> state after it's been suspended. It is already possible to reset a
> suspended device,

Nit: And should we allow resume a non suspended device? Do we need to
document this requirement somewhere?

> but that means the device must be reconfigured and
> all the IOMMU/IOTLB mappings must be recreated. This new operation
> allows the device to be resumed without going through a full reset.
>
> This is particularly useful when trying to perform offline migration of
> a virtual machine (also known as snapshot/restore) as it allows the VMM
> to resume the virtual machine back to a running state after the snapshot
> is performed.
>
> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>

Acked-by: Jason Wang <jasowang@redhat.com>

> ---
>  drivers/vhost/vdpa.c       | 18 ++++++++++++++++++
>  include/uapi/linux/vhost.h |  8 ++++++++
>  2 files changed, 26 insertions(+)
>
> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> index 833617d00ef6..1db7bd39fb63 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -502,6 +502,21 @@ static long vhost_vdpa_suspend(struct vhost_vdpa *v)
>         return ops->suspend(vdpa);
>  }
>
> +/* After a successful return of this ioctl the device resumes processing
> + * virtqueue descriptors. The device becomes fully operational the same way it
> + * was before it was suspended.
> + */
> +static long vhost_vdpa_resume(struct vhost_vdpa *v)
> +{
> +       struct vdpa_device *vdpa = v->vdpa;
> +       const struct vdpa_config_ops *ops = vdpa->config;
> +
> +       if (!ops->resume)
> +               return -EOPNOTSUPP;
> +
> +       return ops->resume(vdpa);
> +}
> +
>  static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
>                                    void __user *argp)
>  {
> @@ -687,6 +702,9 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep,
>         case VHOST_VDPA_SUSPEND:
>                 r = vhost_vdpa_suspend(v);
>                 break;
> +       case VHOST_VDPA_RESUME:
> +               r = vhost_vdpa_resume(v);
> +               break;
>         default:
>                 r = vhost_dev_ioctl(&v->vdev, cmd, argp);
>                 if (r == -ENOIOCTLCMD)
> diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h
> index f9f115a7c75b..92e1b700b51c 100644
> --- a/include/uapi/linux/vhost.h
> +++ b/include/uapi/linux/vhost.h
> @@ -180,4 +180,12 @@
>   */
>  #define VHOST_VDPA_SUSPEND             _IO(VHOST_VIRTIO, 0x7D)
>
> +/* Resume a device so it can resume processing virtqueue requests
> + *
> + * After the return of this ioctl the device will have restored all the
> + * necessary states and it is fully operational to continue processing the
> + * virtqueue descriptors.
> + */
> +#define VHOST_VDPA_RESUME              _IO(VHOST_VIRTIO, 0x7E)
> +
>  #endif
> --
> 2.34.1
>
> ---------------------------------------------------------------------
> Intel Corporation SAS (French simplified joint stock company)
> Registered headquarters: "Les Montalets"- 2, rue de Paris,
> 92196 Meudon Cedex, France
> Registration Number:  302 456 199 R.C.S. NANTERRE
> Capital: 5 208 026.16 Euros
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* Re: [PATCH v2 4/4] vdpa_sim: Implement resume vdpa op
       [not found] ` <bdbf1921652c93e372b1e283cd9367a9b5f31447.1665745877.git.sebastien.boeuf@intel.com>
@ 2022-10-17  7:26   ` Jason Wang
       [not found]     ` <2f9a1b3a32d35ab6c40a87fe158f55430ebeb2e2.camel@intel.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Jason Wang @ 2022-10-17  7:26 UTC (permalink / raw)
  To: sebastien.boeuf; +Cc: eperezma, mst, virtualization

On Fri, Oct 14, 2022 at 7:15 PM <sebastien.boeuf@intel.com> wrote:
>
> From: Sebastien Boeuf <sebastien.boeuf@intel.com>
>
> Implement resume operation for vdpa_sim devices, so vhost-vdpa will
> offer that backend feature and userspace can effectively resume the
> device.
>
> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
> ---
>  drivers/vdpa/vdpa_sim/vdpa_sim.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> index b071f0d842fb..195dc60bad3c 100644
> --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
> +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> @@ -527,6 +527,17 @@ static int vdpasim_suspend(struct vdpa_device *vdpa)
>         return 0;
>  }
>
> +static int vdpasim_resume(struct vdpa_device *vdpa)
> +{
> +       struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
> +
> +       spin_lock(&vdpasim->lock);
> +       vdpasim->running = true;
> +       spin_unlock(&vdpasim->lock);

Do we need to schedule work here? Or the assumption is that the
individual should take care to make sure no kick is lost during a
suspend/resume?

Thanks

> +
> +       return 0;
> +}
> +
>  static size_t vdpasim_get_config_size(struct vdpa_device *vdpa)
>  {
>         struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
> @@ -717,6 +728,7 @@ static const struct vdpa_config_ops vdpasim_config_ops = {
>         .set_status             = vdpasim_set_status,
>         .reset                  = vdpasim_reset,
>         .suspend                = vdpasim_suspend,
> +       .resume                 = vdpasim_resume,
>         .get_config_size        = vdpasim_get_config_size,
>         .get_config             = vdpasim_get_config,
>         .set_config             = vdpasim_set_config,
> @@ -750,6 +762,7 @@ static const struct vdpa_config_ops vdpasim_batch_config_ops = {
>         .set_status             = vdpasim_set_status,
>         .reset                  = vdpasim_reset,
>         .suspend                = vdpasim_suspend,
> +       .resume                 = vdpasim_resume,
>         .get_config_size        = vdpasim_get_config_size,
>         .get_config             = vdpasim_get_config,
>         .set_config             = vdpasim_set_config,
> --
> 2.34.1
>
> ---------------------------------------------------------------------
> Intel Corporation SAS (French simplified joint stock company)
> Registered headquarters: "Les Montalets"- 2, rue de Paris,
> 92196 Meudon Cedex, France
> Registration Number:  302 456 199 R.C.S. NANTERRE
> Capital: 5 208 026.16 Euros
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* Re: [PATCH v2 1/4] vdpa: Add resume operation
  2022-10-17  7:19   ` [PATCH v2 1/4] vdpa: Add resume operation Jason Wang
@ 2022-10-18  0:12     ` Si-Wei Liu
  2022-10-18  6:13       ` Michael S. Tsirkin
  0 siblings, 1 reply; 7+ messages in thread
From: Si-Wei Liu @ 2022-10-18  0:12 UTC (permalink / raw)
  To: sebastien.boeuf, Jason Wang; +Cc: eperezma, virtualization, mst

Hi,

I don't know why but it looks that this series wasn't showing up in the 
list for some reason. Only the recipients in the To or Cc lines seemed 
able to get it. Would it be possible to fix the mail client or include 
me to the thread for review?

Thanks,
-Siwei


On 10/17/2022 12:19 AM, Jason Wang wrote:
> On Fri, Oct 14, 2022 at 7:14 PM <sebastien.boeuf@intel.com> wrote:
>> From: Sebastien Boeuf <sebastien.boeuf@intel.com>
>>
>> Add a new operation to allow a vDPA device to be resumed after it has
>> been suspended. Trying to resume a device that wasn't suspended will
>> result in a no-op.
>>
>> This operation is optional. If it's not implemented, the associated
>> backend feature bit will not be exposed. And if the feature bit is not
>> exposed, invoking this operation will return an error.
>>
>> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
> Acked-by: Jason Wang <jasowang@redhat.com>
>
>> ---
>>   include/linux/vdpa.h | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
>> index 6d0f5e4e82c2..96d308cbf97b 100644
>> --- a/include/linux/vdpa.h
>> +++ b/include/linux/vdpa.h
>> @@ -219,7 +219,10 @@ struct vdpa_map_file {
>>    * @reset:                     Reset device
>>    *                             @vdev: vdpa device
>>    *                             Returns integer: success (0) or error (< 0)
>> - * @suspend:                   Suspend or resume the device (optional)
>> + * @suspend:                   Suspend the device (optional)
>> + *                             @vdev: vdpa device
>> + *                             Returns integer: success (0) or error (< 0)
>> + * @resume:                    Resume the device (optional)
>>    *                             @vdev: vdpa device
>>    *                             Returns integer: success (0) or error (< 0)
>>    * @get_config_size:           Get the size of the configuration space includes
>> @@ -324,6 +327,7 @@ struct vdpa_config_ops {
>>          void (*set_status)(struct vdpa_device *vdev, u8 status);
>>          int (*reset)(struct vdpa_device *vdev);
>>          int (*suspend)(struct vdpa_device *vdev);
>> +       int (*resume)(struct vdpa_device *vdev);
>>          size_t (*get_config_size)(struct vdpa_device *vdev);
>>          void (*get_config)(struct vdpa_device *vdev, unsigned int offset,
>>                             void *buf, unsigned int len);
>> --
>> 2.34.1
>>
>> ---------------------------------------------------------------------
>> Intel Corporation SAS (French simplified joint stock company)
>> Registered headquarters: "Les Montalets"- 2, rue de Paris,
>> 92196 Meudon Cedex, France
>> Registration Number:  302 456 199 R.C.S. NANTERRE
>> Capital: 5 208 026.16 Euros
>>
>> This e-mail and any attachments may contain confidential material for
>> the sole use of the intended recipient(s). Any review or distribution
>> by others is strictly prohibited. If you are not the intended
>> recipient, please contact the sender and delete all copies.
>>
> _______________________________________________
> Virtualization mailing list
> Virtualization@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/virtualization
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* Re: [PATCH v2 1/4] vdpa: Add resume operation
  2022-10-18  0:12     ` Si-Wei Liu
@ 2022-10-18  6:13       ` Michael S. Tsirkin
  0 siblings, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2022-10-18  6:13 UTC (permalink / raw)
  To: Si-Wei Liu; +Cc: eperezma, sebastien.boeuf, virtualization

On Mon, Oct 17, 2022 at 05:12:42PM -0700, Si-Wei Liu wrote:
> Hi,
> 
> I don't know why but it looks that this series wasn't showing up in the list
> for some reason. Only the recipients in the To or Cc lines seemed able to
> get it. Would it be possible to fix the mail client or include me to the
> thread for review?
> 
> Thanks,
> -Siwei
> 

This is true! I didn't notice.

https://lore.kernel.org/virtualization/491fb8fe786739958eb9ff3df2250a4188b0bbe5.1665745877.git.sebastien.boeuf@intel.com/

Sebastien the fix is not to Cc Si-Wei - please fix your setup and
repost, confirm the patches are on list. I am not merging patches that
were not on the list.

thanks!

> 
> On 10/17/2022 12:19 AM, Jason Wang wrote:
> > On Fri, Oct 14, 2022 at 7:14 PM <sebastien.boeuf@intel.com> wrote:
> > > From: Sebastien Boeuf <sebastien.boeuf@intel.com>
> > > 
> > > Add a new operation to allow a vDPA device to be resumed after it has
> > > been suspended. Trying to resume a device that wasn't suspended will
> > > result in a no-op.
> > > 
> > > This operation is optional. If it's not implemented, the associated
> > > backend feature bit will not be exposed. And if the feature bit is not
> > > exposed, invoking this operation will return an error.
> > > 
> > > Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
> > Acked-by: Jason Wang <jasowang@redhat.com>
> > 
> > > ---
> > >   include/linux/vdpa.h | 6 +++++-
> > >   1 file changed, 5 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> > > index 6d0f5e4e82c2..96d308cbf97b 100644
> > > --- a/include/linux/vdpa.h
> > > +++ b/include/linux/vdpa.h
> > > @@ -219,7 +219,10 @@ struct vdpa_map_file {
> > >    * @reset:                     Reset device
> > >    *                             @vdev: vdpa device
> > >    *                             Returns integer: success (0) or error (< 0)
> > > - * @suspend:                   Suspend or resume the device (optional)
> > > + * @suspend:                   Suspend the device (optional)
> > > + *                             @vdev: vdpa device
> > > + *                             Returns integer: success (0) or error (< 0)
> > > + * @resume:                    Resume the device (optional)
> > >    *                             @vdev: vdpa device
> > >    *                             Returns integer: success (0) or error (< 0)
> > >    * @get_config_size:           Get the size of the configuration space includes
> > > @@ -324,6 +327,7 @@ struct vdpa_config_ops {
> > >          void (*set_status)(struct vdpa_device *vdev, u8 status);
> > >          int (*reset)(struct vdpa_device *vdev);
> > >          int (*suspend)(struct vdpa_device *vdev);
> > > +       int (*resume)(struct vdpa_device *vdev);
> > >          size_t (*get_config_size)(struct vdpa_device *vdev);
> > >          void (*get_config)(struct vdpa_device *vdev, unsigned int offset,
> > >                             void *buf, unsigned int len);
> > > --
> > > 2.34.1
> > > 
> > > ---------------------------------------------------------------------
> > > Intel Corporation SAS (French simplified joint stock company)
> > > Registered headquarters: "Les Montalets"- 2, rue de Paris,
> > > 92196 Meudon Cedex, France
> > > Registration Number:  302 456 199 R.C.S. NANTERRE
> > > Capital: 5 208 026.16 Euros
> > > 
> > > This e-mail and any attachments may contain confidential material for
> > > the sole use of the intended recipient(s). Any review or distribution
> > > by others is strictly prohibited. If you are not the intended
> > > recipient, please contact the sender and delete all copies.
> > > 
> > _______________________________________________
> > Virtualization mailing list
> > Virtualization@lists.linux-foundation.org
> > https://lists.linuxfoundation.org/mailman/listinfo/virtualization
> > 

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* Re: [PATCH v2 4/4] vdpa_sim: Implement resume vdpa op
       [not found]         ` <82ae5fc04bb24019c27552a9cc8a973919f1088d.camel@intel.com>
@ 2022-10-18  6:14           ` Michael S. Tsirkin
  0 siblings, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2022-10-18  6:14 UTC (permalink / raw)
  To: Boeuf, Sebastien; +Cc: eperezma, virtualization

On Mon, Oct 17, 2022 at 11:44:44AM +0000, Boeuf, Sebastien wrote:
> On Mon, 2022-10-17 at 13:05 +0200, Eugenio Perez Martin wrote:
> > On Mon, Oct 17, 2022 at 10:47 AM Boeuf, Sebastien
> > <sebastien.boeuf@intel.com> wrote:
> > > 
> > > On Mon, 2022-10-17 at 15:26 +0800, Jason Wang wrote:
> > > > On Fri, Oct 14, 2022 at 7:15 PM <sebastien.boeuf@intel.com>
> > > > wrote:
> > > > > 
> > > > > From: Sebastien Boeuf <sebastien.boeuf@intel.com>
> > > > > 
> > > > > Implement resume operation for vdpa_sim devices, so vhost-vdpa
> > > > > will
> > > > > offer that backend feature and userspace can effectively resume
> > > > > the
> > > > > device.
> > > > > 
> > > > > Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
> > > > > ---
> > > > >  drivers/vdpa/vdpa_sim/vdpa_sim.c | 13 +++++++++++++
> > > > >  1 file changed, 13 insertions(+)
> > > > > 
> > > > > diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c
> > > > > b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> > > > > index b071f0d842fb..195dc60bad3c 100644
> > > > > --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
> > > > > +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> > > > > @@ -527,6 +527,17 @@ static int vdpasim_suspend(struct
> > > > > vdpa_device
> > > > > *vdpa)
> > > > >         return 0;
> > > > >  }
> > > > > 
> > > > > +static int vdpasim_resume(struct vdpa_device *vdpa)
> > > > > +{
> > > > > +       struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
> > > > > +
> > > > > +       spin_lock(&vdpasim->lock);
> > > > > +       vdpasim->running = true;
> > > > > +       spin_unlock(&vdpasim->lock);
> > > > 
> > > > Do we need to schedule work here? Or the assumption is that the
> > > > individual should take care to make sure no kick is lost during a
> > > > suspend/resume?
> > > 
> > > The guest vCPU should be paused, meaning no kick should come from
> > > the
> > > guest while the backend is suspended. But I don't think it would
> > > cause
> > > any harm to schedule some work when resuming the device as this
> > > would
> > > provide a more permissive implementation.
> > > 
> > > Please let me know what you think about it.
> > > 
> > 
> > We should enable the case where the device is suspended by the VMM
> > but
> > the vCPU continues running in my opinion.
> > 
> > I preemptively scheduled work to accommodate this use case in
> > previous
> > versions of the suspend patch [1].
> > 
> > [1] https://lkml.org/lkml/2022/5/24/768
> > 
> > Thanks!
> > 
> 
> Sounds good, I'm going to update the patch to kick the queues on
> resume.

I am not sure the right thing is to kick on resume, that
will bring all kind of issues around startup.
Save and restore state fully.


> Thanks,
> Sebastien
> ---------------------------------------------------------------------
> Intel Corporation SAS (French simplified joint stock company)
> Registered headquarters: "Les Montalets"- 2, rue de Paris, 
> 92196 Meudon Cedex, France
> Registration Number:  302 456 199 R.C.S. NANTERRE
> Capital: 5 208 026.16 Euros
> 
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

end of thread, other threads:[~2022-10-18  6:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1665745877.git.sebastien.boeuf@intel.com>
     [not found] ` <491fb8fe786739958eb9ff3df2250a4188b0bbe5.1665745877.git.sebastien.boeuf@intel.com>
2022-10-17  7:19   ` [PATCH v2 1/4] vdpa: Add resume operation Jason Wang
2022-10-18  0:12     ` Si-Wei Liu
2022-10-18  6:13       ` Michael S. Tsirkin
     [not found] ` <df57ddc44ed8950dc79c63597e3091b1da551959.1665745877.git.sebastien.boeuf@intel.com>
2022-10-17  7:20   ` [PATCH v2 2/4] vhost-vdpa: Introduce RESUME backend feature bit Jason Wang
     [not found] ` <d23b16abdc15f5e2aa1430cf48101dd256638809.1665745877.git.sebastien.boeuf@intel.com>
2022-10-17  7:22   ` [PATCH v2 3/4] vhost-vdpa: uAPI to resume the device Jason Wang
     [not found] ` <bdbf1921652c93e372b1e283cd9367a9b5f31447.1665745877.git.sebastien.boeuf@intel.com>
2022-10-17  7:26   ` [PATCH v2 4/4] vdpa_sim: Implement resume vdpa op Jason Wang
     [not found]     ` <2f9a1b3a32d35ab6c40a87fe158f55430ebeb2e2.camel@intel.com>
     [not found]       ` <CAJaqyWeLi+mmOFi8-+65XwurFbBcAnCe5XFKjQ=4Gbo4hwhdUw@mail.gmail.com>
     [not found]         ` <82ae5fc04bb24019c27552a9cc8a973919f1088d.camel@intel.com>
2022-10-18  6:14           ` Michael S. Tsirkin

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.