From: "Eugenio Pérez" <eperezma@redhat.com>
To: kvm@vger.kernel.org, Jason Wang <jasowang@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
virtualization@lists.linux-foundation.org
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Longpeng <longpeng2@huawei.com>,
Stefano Garzarella <sgarzare@redhat.com>,
dinang@xilinx.com, Piotr.Uminski@intel.com, martinpo@xilinx.com,
tanuj.kamde@amd.com, Parav Pandit <parav@nvidia.com>,
Zhang Min <zhang.min9@zte.com.cn>,
habetsm.xilinx@gmail.com, Zhu Lingshan <lingshan.zhu@intel.com>,
lulu@redhat.com, hanand@xilinx.com, martinh@xilinx.com,
Si-Wei Liu <si-wei.liu@oracle.com>,
gautam.dawar@amd.com, Xie Yongji <xieyongji@bytedance.com>,
ecree.xilinx@gmail.com, pabloc@xilinx.com, lvivier@redhat.com,
Eli Cohen <elic@nvidia.com>,
Wu Zongyong <wuzongyong@linux.alibaba.com>,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: [PATCH v5 0/4] Implement vdpasim suspend operation
Date: Fri, 3 Jun 2022 12:09:40 +0200 [thread overview]
Message-ID: <20220603100944.871727-1-eperezma@redhat.com> (raw)
Implement suspend operation for vdpa_sim devices, so vhost-vdpa will offer
that backend feature and userspace can effectively suspend the device.
This is a must before getting virtqueue indexes (base) for live migration,
since the device could modify them after userland gets them. There are
individual ways to perform that action for some devices
(VHOST_NET_SET_BACKEND, VHOST_VSOCK_SET_RUNNING, ...) but there was no
way to perform it for any vhost device (and, in particular, vhost-vdpa).
After a successful return of ioctl with suspend = 1, the device must not
process more virtqueue descriptors, and it must not send any config
interrupt. The device can answer to read or writes of config fields as
if it were not suspended. In particular, writing to "queue_enable" with
a value of 1 will not make the device start processing buffers of the
virtqueue until the device is resumed (suspend = 0).
After a successful return of ioctl with suspend = 0, the device will
start processing data of the virtqueues if other expected conditions are
met (queue is enabled, DRIVER_OK has already been set to status, etc.)
If not, the device should be in the same state as if no call to suspend
callback with suspend = 1 has been performed.
In the future, we will provide features similar to
VHOST_USER_GET_INFLIGHT_FD so the device can save pending operations.
Comments are welcome.
v6:
* s/stop/suspend/ to differentiate more from reset.
* Clarify scope of the suspend operation.
v5:
* s/not stop/resume/ in doc.
v4:
* Replace VHOST_STOP to VHOST_VDPA_STOP in vhost ioctl switch case too.
v3:
* s/VHOST_STOP/VHOST_VDPA_STOP/
* Add documentation and requirements of the ioctl above its definition.
v2:
* Replace raw _F_STOP with BIT_ULL(_F_STOP).
* Fix obtaining of stop ioctl arg (it was not obtained but written).
* Add stop to vdpa_sim_blk.
Eugenio Pérez (4):
vdpa: Add suspend operation
vhost-vdpa: introduce SUSPEND backend feature bit
vhost-vdpa: uAPI to suspend the device
vdpa_sim: Implement suspend vdpa op
drivers/vdpa/vdpa_sim/vdpa_sim.c | 21 +++++++++++++
drivers/vdpa/vdpa_sim/vdpa_sim.h | 1 +
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 3 ++
drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 3 ++
drivers/vhost/vdpa.c | 47 +++++++++++++++++++++++++++-
include/linux/vdpa.h | 5 +++
include/uapi/linux/vhost.h | 14 +++++++++
include/uapi/linux/vhost_types.h | 2 ++
8 files changed, 95 insertions(+), 1 deletion(-)
--
2.31.1
next reply other threads:[~2022-06-03 10:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-03 10:09 Eugenio Pérez [this message]
2022-06-03 10:09 ` [PATCH v5 1/4] vdpa: Add suspend operation Eugenio Pérez
2022-06-03 10:09 ` [PATCH v5 2/4] vhost-vdpa: introduce SUSPEND backend feature bit Eugenio Pérez
2022-06-03 10:09 ` [PATCH v5 3/4] vhost-vdpa: uAPI to suspend the device Eugenio Pérez
2022-06-03 10:09 ` [PATCH v5 4/4] vdpa_sim: Implement suspend vdpa op Eugenio Pérez
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=20220603100944.871727-1-eperezma@redhat.com \
--to=eperezma@redhat.com \
--cc=Piotr.Uminski@intel.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dan.carpenter@oracle.com \
--cc=dinang@xilinx.com \
--cc=ecree.xilinx@gmail.com \
--cc=elic@nvidia.com \
--cc=gautam.dawar@amd.com \
--cc=habetsm.xilinx@gmail.com \
--cc=hanand@xilinx.com \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lingshan.zhu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longpeng2@huawei.com \
--cc=lulu@redhat.com \
--cc=lvivier@redhat.com \
--cc=martinh@xilinx.com \
--cc=martinpo@xilinx.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabloc@xilinx.com \
--cc=parav@nvidia.com \
--cc=sgarzare@redhat.com \
--cc=si-wei.liu@oracle.com \
--cc=tanuj.kamde@amd.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=wuzongyong@linux.alibaba.com \
--cc=xieyongji@bytedance.com \
--cc=zhang.min9@zte.com.cn \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox