All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Boeuf, Sebastien" <sebastien.boeuf@intel.com>
Cc: "eperezma@redhat.com" <eperezma@redhat.com>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>
Subject: Re: [PATCH v2 4/4] vdpa_sim: Implement resume vdpa op
Date: Tue, 18 Oct 2022 02:14:43 -0400	[thread overview]
Message-ID: <20221018021343-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <82ae5fc04bb24019c27552a9cc8a973919f1088d.camel@intel.com>

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

      parent reply	other threads:[~2022-10-18  6:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 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=20221018021343-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=sebastien.boeuf@intel.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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.