* Re: [RFC PATCH 00/27] vDPA software assisted live migration
[not found] <20201120185105.279030-1-eperezma@redhat.com>
@ 2020-11-25 7:08 ` Jason Wang
[not found] ` <CAJaqyWf+6yoMHJuLv=QGLMP4egmdm722=V2kKJ_aiQAfCCQOFw@mail.gmail.com>
[not found] ` <20201120185105.279030-24-eperezma@redhat.com>
` (15 subsequent siblings)
16 siblings, 1 reply; 29+ messages in thread
From: Jason Wang @ 2020-11-25 7:08 UTC (permalink / raw)
To: Eugenio Pérez, qemu-devel
Cc: kvm, Michael S. Tsirkin, Daniel Daly, virtualization, Liran Alon,
Eli Cohen, Nitin Shrivastav, Alex Barba, Christophe Fontaine,
Lee Ballard, Lars Ganrot, Rob Miller, Howard Cai, Parav Pandit,
vm, Salil Mehta, Stephen Finucane, Xiao W Wang, Sean Mooney,
Stefan Hajnoczi, Jim Harford, Dmytro Kazantsev, Siwei Liu,
Harpreet Singh Anand, Michael Lilja, Max Gurtovoy
On 2020/11/21 上午2:50, Eugenio Pérez wrote:
> This series enable vDPA software assisted live migration for vhost-net
> devices. This is a new method of vhost devices migration: Instead of
> relay on vDPA device's dirty logging capability, SW assisted LM
> intercepts dataplane, forwarding the descriptors between VM and device.
>
> In this migration mode, qemu offers a new vring to the device to
> read and write into, and disable vhost notifiers, processing guest and
> vhost notifications in qemu. On used buffer relay, qemu will mark the
> dirty memory as with plain virtio-net devices. This way, devices does
> not need to have dirty page logging capability.
>
> This series is a POC doing SW LM for vhost-net devices, which already
> have dirty page logging capabilities. None of the changes have actual
> effect with current devices until last two patches (26 and 27) are
> applied, but they can be rebased on top of any other. These checks the
> device to meet all requirements, and disable vhost-net devices logging
> so migration goes through SW LM. This last patch is not meant to be
> applied in the final revision, it is in the series just for testing
> purposes.
>
> For use SW assisted LM these vhost-net devices need to be instantiated:
> * With IOMMU (iommu_platform=on,ats=on)
> * Without event_idx (event_idx=off)
So a question is at what level do we want to implement qemu assisted
live migration. To me it could be done at two levels:
1) generic vhost level which makes it work for both vhost-net/vhost-user
and vhost-vDPA
2) a specific type of vhost
To me, having a generic one looks better but it would be much more
complicated. So what I read from this series is it was a vhost kernel
specific software assisted live migration which is a good start.
Actually it may even have real use case, e.g it can save dirty bitmaps
for guest with large memory. But we need to address the above
limitations first.
So I would like to know what's the reason for mandating iommu platform
and ats? And I think we need to fix case of event idx support.
>
> Just the notification forwarding (with no descriptor relay) can be
> achieved with patches 7 and 9, and starting migration. Partial applies
> between 13 and 24 will not work while migrating on source, and patch
> 25 is needed for the destination to resume network activity.
>
> It is based on the ideas of DPDK SW assisted LM, in the series of
Actually we're better than that since there's no need the trick like
hardcoded IOVA for mediated(shadow) virtqueue.
> DPDK's https://patchwork.dpdk.org/cover/48370/ .
I notice that you do GPA->VA translations and try to establish a VA->VA
(use VA as IOVA) mapping via device IOTLB. This shortcut should work for
vhost-kernel/user but not vhost-vDPA. The reason is that there's no
guarantee that the whole 64bit address range could be used as IOVA. One
example is that for hardware IOMMU like intel, it usually has 47 or 52
bits of address width.
So we probably need an IOVA allocator that can make sure the IOVA is not
overlapped and fit for [1]. We can probably build the IOVA for guest VA
via memory listeners. Then we have
1) IOVA for GPA
2) IOVA for shadow VQ
And advertise IOVA to VA mapping to vhost.
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1b48dc03e575a872404f33b04cd237953c5d7498
>
> Comments are welcome.
>
> Thanks!
>
> Eugenio Pérez (27):
> vhost: Add vhost_dev_can_log
> vhost: Add device callback in vhost_migration_log
> vhost: Move log resize/put to vhost_dev_set_log
> vhost: add vhost_kernel_set_vring_enable
> vhost: Add hdev->dev.sw_lm_vq_handler
> virtio: Add virtio_queue_get_used_notify_split
> vhost: Route guest->host notification through qemu
> vhost: Add a flag for software assisted Live Migration
> vhost: Route host->guest notification through qemu
> vhost: Allocate shadow vring
> virtio: const-ify all virtio_tswap* functions
> virtio: Add virtio_queue_full
> vhost: Send buffers to device
> virtio: Remove virtio_queue_get_used_notify_split
> vhost: Do not invalidate signalled used
> virtio: Expose virtqueue_alloc_element
> vhost: add vhost_vring_set_notification_rcu
> vhost: add vhost_vring_poll_rcu
> vhost: add vhost_vring_get_buf_rcu
> vhost: Return used buffers
> vhost: Add vhost_virtqueue_memory_unmap
> vhost: Add vhost_virtqueue_memory_map
> vhost: unmap qemu's shadow virtqueues on sw live migration
> vhost: iommu changes
> vhost: Do not commit vhost used idx on vhost_virtqueue_stop
> vhost: Add vhost_hdev_can_sw_lm
> vhost: forbid vhost devices logging
>
> hw/virtio/vhost-sw-lm-ring.h | 39 +++
> include/hw/virtio/vhost.h | 5 +
> include/hw/virtio/virtio-access.h | 8 +-
> include/hw/virtio/virtio.h | 4 +
> hw/net/virtio-net.c | 39 ++-
> hw/virtio/vhost-backend.c | 29 ++
> hw/virtio/vhost-sw-lm-ring.c | 268 +++++++++++++++++++
> hw/virtio/vhost.c | 431 +++++++++++++++++++++++++-----
> hw/virtio/virtio.c | 18 +-
> hw/virtio/meson.build | 2 +-
> 10 files changed, 758 insertions(+), 85 deletions(-)
> create mode 100644 hw/virtio/vhost-sw-lm-ring.h
> create mode 100644 hw/virtio/vhost-sw-lm-ring.c
So this looks like a pretty huge patchset which I'm trying to think of
ways to split. An idea is to do this is two steps
1) implement a shadow virtqueue mode for vhost first (w/o live
migration). Then we can test descriptors relay, IOVA allocating, etc.
2) add live migration support on top
And it looks to me it's better to split the shadow virtqueue (virtio
driver part) into an independent file. And use generic name (w/o
"shadow") in order to be reused by other use cases as well.
Thoughts?
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 00/27] vDPA software assisted live migration
[not found] ` <CAJaqyWf+6yoMHJuLv=QGLMP4egmdm722=V2kKJ_aiQAfCCQOFw@mail.gmail.com>
@ 2020-11-26 3:07 ` Jason Wang
0 siblings, 0 replies; 29+ messages in thread
From: Jason Wang @ 2020-11-26 3:07 UTC (permalink / raw)
To: Eugenio Perez Martin
Cc: kvm list, Michael S. Tsirkin, qemu-level, Daniel Daly,
virtualization, Liran Alon, Eli Cohen, Nitin Shrivastav,
Rob Miller, Christophe Fontaine, Lee Ballard, Lars Ganrot,
Alex Barba, Howard Cai, Parav Pandit, vm, Salil Mehta,
Jim Harford, Xiao W Wang, Sean Mooney, Stefan Hajnoczi,
Stephen Finucane, Dmytro Kazantsev, Siwei Liu,
Harpreet Singh Anand, Michael Lilja, Max Gurtovoy
On 2020/11/25 下午8:03, Eugenio Perez Martin wrote:
> On Wed, Nov 25, 2020 at 8:09 AM Jason Wang <jasowang@redhat.com> wrote:
>>
>> On 2020/11/21 上午2:50, Eugenio Pérez wrote:
>>> This series enable vDPA software assisted live migration for vhost-net
>>> devices. This is a new method of vhost devices migration: Instead of
>>> relay on vDPA device's dirty logging capability, SW assisted LM
>>> intercepts dataplane, forwarding the descriptors between VM and device.
>>>
>>> In this migration mode, qemu offers a new vring to the device to
>>> read and write into, and disable vhost notifiers, processing guest and
>>> vhost notifications in qemu. On used buffer relay, qemu will mark the
>>> dirty memory as with plain virtio-net devices. This way, devices does
>>> not need to have dirty page logging capability.
>>>
>>> This series is a POC doing SW LM for vhost-net devices, which already
>>> have dirty page logging capabilities. None of the changes have actual
>>> effect with current devices until last two patches (26 and 27) are
>>> applied, but they can be rebased on top of any other. These checks the
>>> device to meet all requirements, and disable vhost-net devices logging
>>> so migration goes through SW LM. This last patch is not meant to be
>>> applied in the final revision, it is in the series just for testing
>>> purposes.
>>>
>>> For use SW assisted LM these vhost-net devices need to be instantiated:
>>> * With IOMMU (iommu_platform=on,ats=on)
>>> * Without event_idx (event_idx=off)
>>
>> So a question is at what level do we want to implement qemu assisted
>> live migration. To me it could be done at two levels:
>>
>> 1) generic vhost level which makes it work for both vhost-net/vhost-user
>> and vhost-vDPA
>> 2) a specific type of vhost
>>
>> To me, having a generic one looks better but it would be much more
>> complicated. So what I read from this series is it was a vhost kernel
>> specific software assisted live migration which is a good start.
>> Actually it may even have real use case, e.g it can save dirty bitmaps
>> for guest with large memory. But we need to address the above
>> limitations first.
>>
>> So I would like to know what's the reason for mandating iommu platform
>> and ats? And I think we need to fix case of event idx support.
>>
> There is no specific reason for mandating iommu & ats, it was just
> started that way.
>
> I will extend the patch to support those cases too.
>
>>> Just the notification forwarding (with no descriptor relay) can be
>>> achieved with patches 7 and 9, and starting migration. Partial applies
>>> between 13 and 24 will not work while migrating on source, and patch
>>> 25 is needed for the destination to resume network activity.
>>>
>>> It is based on the ideas of DPDK SW assisted LM, in the series of
>>
>> Actually we're better than that since there's no need the trick like
>> hardcoded IOVA for mediated(shadow) virtqueue.
>>
>>
>>> DPDK's https://patchwork.dpdk.org/cover/48370/ .
>>
>> I notice that you do GPA->VA translations and try to establish a VA->VA
>> (use VA as IOVA) mapping via device IOTLB. This shortcut should work for
>> vhost-kernel/user but not vhost-vDPA. The reason is that there's no
>> guarantee that the whole 64bit address range could be used as IOVA. One
>> example is that for hardware IOMMU like intel, it usually has 47 or 52
>> bits of address width.
>>
>> So we probably need an IOVA allocator that can make sure the IOVA is not
>> overlapped and fit for [1]. We can probably build the IOVA for guest VA
>> via memory listeners. Then we have
>>
>> 1) IOVA for GPA
>> 2) IOVA for shadow VQ
>>
>> And advertise IOVA to VA mapping to vhost.
>>
>> [1]
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1b48dc03e575a872404f33b04cd237953c5d7498
>>
> Got it, will control it too.
>
> Maybe for vhost-net we could directly send iotlb miss for [0,~0ULL].
It works but it means vhost-net needs some special care. To me a generic
IOVA allocator looks better.
>
>>> Comments are welcome.
>>>
>>> Thanks!
>>>
>>> Eugenio Pérez (27):
>>> vhost: Add vhost_dev_can_log
>>> vhost: Add device callback in vhost_migration_log
>>> vhost: Move log resize/put to vhost_dev_set_log
>>> vhost: add vhost_kernel_set_vring_enable
>>> vhost: Add hdev->dev.sw_lm_vq_handler
>>> virtio: Add virtio_queue_get_used_notify_split
>>> vhost: Route guest->host notification through qemu
>>> vhost: Add a flag for software assisted Live Migration
>>> vhost: Route host->guest notification through qemu
>>> vhost: Allocate shadow vring
>>> virtio: const-ify all virtio_tswap* functions
>>> virtio: Add virtio_queue_full
>>> vhost: Send buffers to device
>>> virtio: Remove virtio_queue_get_used_notify_split
>>> vhost: Do not invalidate signalled used
>>> virtio: Expose virtqueue_alloc_element
>>> vhost: add vhost_vring_set_notification_rcu
>>> vhost: add vhost_vring_poll_rcu
>>> vhost: add vhost_vring_get_buf_rcu
>>> vhost: Return used buffers
>>> vhost: Add vhost_virtqueue_memory_unmap
>>> vhost: Add vhost_virtqueue_memory_map
>>> vhost: unmap qemu's shadow virtqueues on sw live migration
>>> vhost: iommu changes
>>> vhost: Do not commit vhost used idx on vhost_virtqueue_stop
>>> vhost: Add vhost_hdev_can_sw_lm
>>> vhost: forbid vhost devices logging
>>>
>>> hw/virtio/vhost-sw-lm-ring.h | 39 +++
>>> include/hw/virtio/vhost.h | 5 +
>>> include/hw/virtio/virtio-access.h | 8 +-
>>> include/hw/virtio/virtio.h | 4 +
>>> hw/net/virtio-net.c | 39 ++-
>>> hw/virtio/vhost-backend.c | 29 ++
>>> hw/virtio/vhost-sw-lm-ring.c | 268 +++++++++++++++++++
>>> hw/virtio/vhost.c | 431 +++++++++++++++++++++++++-----
>>> hw/virtio/virtio.c | 18 +-
>>> hw/virtio/meson.build | 2 +-
>>> 10 files changed, 758 insertions(+), 85 deletions(-)
>>> create mode 100644 hw/virtio/vhost-sw-lm-ring.h
>>> create mode 100644 hw/virtio/vhost-sw-lm-ring.c
>>
>> So this looks like a pretty huge patchset which I'm trying to think of
>> ways to split. An idea is to do this is two steps
>>
>> 1) implement a shadow virtqueue mode for vhost first (w/o live
>> migration). Then we can test descriptors relay, IOVA allocating, etc.
> How would that mode be activated if it is not tied to live migration?
> New backend/command line switch?
Either a new cli option or even a qmp command can work.
>
> Maybe it is better to also start with no iommu & ats support and add it on top.
Yes.
>
>> 2) add live migration support on top
>>
>> And it looks to me it's better to split the shadow virtqueue (virtio
>> driver part) into an independent file. And use generic name (w/o
>> "shadow") in order to be reused by other use cases as well.
>>
> I think the same.
>
> Thanks!
>
>> Thoughts?
>>
>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 23/27] vhost: unmap qemu's shadow virtqueues on sw live migration
[not found] ` <20201120185105.279030-24-eperezma@redhat.com>
@ 2020-11-27 15:29 ` Stefano Garzarella
0 siblings, 0 replies; 29+ messages in thread
From: Stefano Garzarella @ 2020-11-27 15:29 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
On Fri, Nov 20, 2020 at 07:51:01PM +0100, Eugenio Pérez wrote:
>Since vhost does not need to access it, it has no sense to keep it
>mapped.
>
>Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
>---
> hw/virtio/vhost.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
>index f640d4edf0..eebfac4455 100644
>--- a/hw/virtio/vhost.c
>+++ b/hw/virtio/vhost.c
>@@ -1124,6 +1124,7 @@ static int vhost_sw_live_migration_start(struct vhost_dev *dev)
>
> dev->sw_lm_shadow_vq[idx] = vhost_sw_lm_shadow_vq(dev, idx);
> event_notifier_set_handler(&vq->masked_notifier, vhost_handle_call);
>+ vhost_virtqueue_memory_unmap(dev, &dev->vqs[idx], true);
IIUC vhost_virtqueue_memory_unmap() is already called at the end of
vhost_virtqueue_stop(), so we can skip this call, right?
>
> vhost_vring_write_addr(dev->sw_lm_shadow_vq[idx], &addr);
> r = dev->vhost_ops->vhost_set_vring_addr(dev, &addr);
>-- 2.18.4
>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 00/27] vDPA software assisted live migration
[not found] <20201120185105.279030-1-eperezma@redhat.com>
2020-11-25 7:08 ` [RFC PATCH 00/27] vDPA software assisted live migration Jason Wang
[not found] ` <20201120185105.279030-24-eperezma@redhat.com>
@ 2020-11-27 15:44 ` Stefano Garzarella
[not found] ` <20201120185105.279030-3-eperezma@redhat.com>
` (13 subsequent siblings)
16 siblings, 0 replies; 29+ messages in thread
From: Stefano Garzarella @ 2020-11-27 15:44 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
On Fri, Nov 20, 2020 at 07:50:38PM +0100, Eugenio Pérez wrote:
>This series enable vDPA software assisted live migration for vhost-net
>devices. This is a new method of vhost devices migration: Instead of
>relay on vDPA device's dirty logging capability, SW assisted LM
>intercepts dataplane, forwarding the descriptors between VM and device.
>
>In this migration mode, qemu offers a new vring to the device to
>read and write into, and disable vhost notifiers, processing guest and
>vhost notifications in qemu. On used buffer relay, qemu will mark the
>dirty memory as with plain virtio-net devices. This way, devices does
>not need to have dirty page logging capability.
>
>This series is a POC doing SW LM for vhost-net devices, which already
>have dirty page logging capabilities. None of the changes have actual
>effect with current devices until last two patches (26 and 27) are
>applied, but they can be rebased on top of any other. These checks the
>device to meet all requirements, and disable vhost-net devices logging
>so migration goes through SW LM. This last patch is not meant to be
>applied in the final revision, it is in the series just for testing
>purposes.
>
>For use SW assisted LM these vhost-net devices need to be instantiated:
>* With IOMMU (iommu_platform=on,ats=on)
>* Without event_idx (event_idx=off)
>
>Just the notification forwarding (with no descriptor relay) can be
>achieved with patches 7 and 9, and starting migration. Partial applies
>between 13 and 24 will not work while migrating on source, and patch
>25 is needed for the destination to resume network activity.
>
>It is based on the ideas of DPDK SW assisted LM, in the series of
>DPDK's https://patchwork.dpdk.org/cover/48370/ .
>
>Comments are welcome.
Hi Eugenio,
I took a look and the idea of the shadow queue I think is the right way.
It's very similar to what we thought with Stefan for io_uring
passthrough and vdpa-blk.
IIUC, when the migrations starts, the notifications from the guest to
vhost are disabled, so QEMU starts to intercept them through the
custom_handler installed in virtio-net (we need to understand how to
generalize this).
At this point QEMU starts to use the shadows queues and exposes them to
vhost.
The opposite is done for vhost to guest notifications, where
vhost_handle_call is installed to masked_notifier to intercept the
notification.
I hope to give better feedback when I get a complete overview ;-)
Anyway, as Jason suggested, we should split this series, so maybe we can
merge some preparations patches (e.g. 1, 11, 21, 22) regardless the
other patches.
Thanks,
Stefano
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 02/27] vhost: Add device callback in vhost_migration_log
[not found] ` <20201120185105.279030-3-eperezma@redhat.com>
@ 2020-12-07 16:19 ` Stefan Hajnoczi
0 siblings, 0 replies; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-07 16:19 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 962 bytes --]
On Fri, Nov 20, 2020 at 07:50:40PM +0100, Eugenio Pérez wrote:
> This allows code to reuse the logic to not to re-enable or re-disable
> migration mechanisms. Code works the same way as before.
>
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
> hw/virtio/vhost.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index 2bd8cdf893..2adb2718c1 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -862,7 +862,9 @@ err_features:
> return r;
> }
>
> -static int vhost_migration_log(MemoryListener *listener, bool enable)
> +static int vhost_migration_log(MemoryListener *listener,
> + bool enable,
> + int (*device_cb)(struct vhost_dev *, bool))
Please document the argument. What is the callback function supposed to
do ("device_cb" is not descriptive so I'm not sure)?
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 04/27] vhost: add vhost_kernel_set_vring_enable
[not found] ` <20201120185105.279030-5-eperezma@redhat.com>
@ 2020-12-07 16:43 ` Stefan Hajnoczi
[not found] ` <CAJaqyWd5oAJ4kJOhyDz+1KNvwzqJi3NO+5Z7X6W5ju2Va=LTMQ@mail.gmail.com>
0 siblings, 1 reply; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-07 16:43 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 1702 bytes --]
On Fri, Nov 20, 2020 at 07:50:42PM +0100, Eugenio Pérez wrote:
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
> hw/virtio/vhost-backend.c | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c
> index 222bbcc62d..317f1f96fa 100644
> --- a/hw/virtio/vhost-backend.c
> +++ b/hw/virtio/vhost-backend.c
> @@ -201,6 +201,34 @@ static int vhost_kernel_get_vq_index(struct vhost_dev *dev, int idx)
> return idx - dev->vq_index;
> }
>
> +static int vhost_kernel_set_vq_enable(struct vhost_dev *dev, unsigned idx,
> + bool enable)
> +{
> + struct vhost_vring_file file = {
> + .index = idx,
> + };
> +
> + if (!enable) {
> + file.fd = -1; /* Pass -1 to unbind from file. */
> + } else {
> + struct vhost_net *vn_dev = container_of(dev, struct vhost_net, dev);
> + file.fd = vn_dev->backend;
> + }
> +
> + return vhost_kernel_net_set_backend(dev, &file);
This is vhost-net specific even though the function appears to be
generic. Is there a plan to extend this to all devices?
> +}
> +
> +static int vhost_kernel_set_vring_enable(struct vhost_dev *dev, int enable)
> +{
> + int i;
> +
> + for (i = 0; i < dev->nvqs; ++i) {
> + vhost_kernel_set_vq_enable(dev, i, enable);
> + }
> +
> + return 0;
> +}
I suggest exposing the per-vq interface (vhost_kernel_set_vq_enable())
in VhostOps so it follows the ioctl interface.
vhost_kernel_set_vring_enable() can be moved to vhost.c can loop over
all vqs if callers find it convenient to loop over all vqs.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 05/27] vhost: Add hdev->dev.sw_lm_vq_handler
[not found] ` <20201120185105.279030-6-eperezma@redhat.com>
@ 2020-12-07 16:52 ` Stefan Hajnoczi
[not found] ` <CAJaqyWfSUHD0MU=1yfU1N6pZ4TU7prxyoG6NY-VyNGt=MO9H4g@mail.gmail.com>
0 siblings, 1 reply; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-07 16:52 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 1710 bytes --]
On Fri, Nov 20, 2020 at 07:50:43PM +0100, Eugenio Pérez wrote:
> Only virtio-net honors it.
>
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
> include/hw/virtio/vhost.h | 1 +
> hw/net/virtio-net.c | 39 ++++++++++++++++++++++++++++-----------
> 2 files changed, 29 insertions(+), 11 deletions(-)
>
> diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h
> index 4a8bc75415..b5b7496537 100644
> --- a/include/hw/virtio/vhost.h
> +++ b/include/hw/virtio/vhost.h
> @@ -83,6 +83,7 @@ struct vhost_dev {
> bool started;
> bool log_enabled;
> uint64_t log_size;
> + VirtIOHandleOutput sw_lm_vq_handler;
sw == software?
lm == live migration?
Maybe there is a name that is clearer. What are these virtqueues called?
Shadow vqs? Logged vqs?
Live migration is a feature that uses dirty memory logging, but other
features may use dirty memory logging too. The name should probably not
be associated with live migration.
> Error *migration_blocker;
> const VhostOps *vhost_ops;
> void *opaque;
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 9179013ac4..9a69ae3598 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -2628,24 +2628,32 @@ static void virtio_net_tx_bh(void *opaque)
> }
> }
>
> -static void virtio_net_add_queue(VirtIONet *n, int index)
> +static void virtio_net_add_queue(VirtIONet *n, int index,
> + VirtIOHandleOutput custom_handler)
> {
We talked about the possibility of moving this into the generic vhost
code so that devices don't need to be modified. It would be nice to hide
this feature inside vhost.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 06/27] virtio: Add virtio_queue_get_used_notify_split
[not found] ` <20201120185105.279030-7-eperezma@redhat.com>
@ 2020-12-07 16:58 ` Stefan Hajnoczi
[not found] ` <CAJaqyWc4oLzL02GKpPSwEGRxK+UxjOGBAPLzrgrgKRZd9C81GA@mail.gmail.com>
0 siblings, 1 reply; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-07 16:58 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 1313 bytes --]
On Fri, Nov 20, 2020 at 07:50:44PM +0100, Eugenio Pérez wrote:
> This function is just used for a few commits, so SW LM is developed
> incrementally, and it is deleted after it is useful.
>
> For a few commits, only the events (irqfd, eventfd) are forwarded.
s/eventfd/ioeventfd/ (irqfd is also an eventfd)
> +bool virtio_queue_get_used_notify_split(VirtQueue *vq)
> +{
> + VRingMemoryRegionCaches *caches;
> + hwaddr pa = offsetof(VRingUsed, flags);
> + uint16_t flags;
> +
> + RCU_READ_LOCK_GUARD();
> +
> + caches = vring_get_region_caches(vq);
> + assert(caches);
> + flags = virtio_lduw_phys_cached(vq->vdev, &caches->used, pa);
> + return !(VRING_USED_F_NO_NOTIFY & flags);
> +}
QEMU stores the notification status:
void virtio_queue_set_notification(VirtQueue *vq, int enable)
{
vq->notification = enable; <---- here
if (!vq->vring.desc) {
return;
}
if (virtio_vdev_has_feature(vq->vdev, VIRTIO_F_RING_PACKED)) {
virtio_queue_packed_set_notification(vq, enable);
} else {
virtio_queue_split_set_notification(vq, enable);
I'm wondering why it's necessary to fetch from guest RAM instead of
using vq->notification? It also works for both split and packed
queues so the code would be simpler.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 07/27] vhost: Route guest->host notification through qemu
[not found] ` <20201120185105.279030-8-eperezma@redhat.com>
@ 2020-12-07 17:42 ` Stefan Hajnoczi
[not found] ` <CAJaqyWfiMsRP9FgSv7cOj=3jHx=DJS7hRJTMbRcTTHHWng0eKg@mail.gmail.com>
0 siblings, 1 reply; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-07 17:42 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 11448 bytes --]
On Fri, Nov 20, 2020 at 07:50:45PM +0100, Eugenio Pérez wrote:
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
> hw/virtio/vhost-sw-lm-ring.h | 26 +++++++++
> include/hw/virtio/vhost.h | 3 ++
> hw/virtio/vhost-sw-lm-ring.c | 60 +++++++++++++++++++++
> hw/virtio/vhost.c | 100 +++++++++++++++++++++++++++++++++--
> hw/virtio/meson.build | 2 +-
> 5 files changed, 187 insertions(+), 4 deletions(-)
> create mode 100644 hw/virtio/vhost-sw-lm-ring.h
> create mode 100644 hw/virtio/vhost-sw-lm-ring.c
>
> diff --git a/hw/virtio/vhost-sw-lm-ring.h b/hw/virtio/vhost-sw-lm-ring.h
> new file mode 100644
> index 0000000000..86dc081b93
> --- /dev/null
> +++ b/hw/virtio/vhost-sw-lm-ring.h
> @@ -0,0 +1,26 @@
> +/*
> + * vhost software live migration ring
> + *
> + * SPDX-FileCopyrightText: Red Hat, Inc. 2020
> + * SPDX-FileContributor: Author: Eugenio Pérez <eperezma@redhat.com>
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#ifndef VHOST_SW_LM_RING_H
> +#define VHOST_SW_LM_RING_H
> +
> +#include "qemu/osdep.h"
> +
> +#include "hw/virtio/virtio.h"
> +#include "hw/virtio/vhost.h"
> +
> +typedef struct VhostShadowVirtqueue VhostShadowVirtqueue;
Here it's called a shadow virtqueue while the file calls it a
sw-lm-ring. Please use a single name.
> +
> +bool vhost_vring_kick(VhostShadowVirtqueue *vq);
vhost_shadow_vq_kick()?
> +
> +VhostShadowVirtqueue *vhost_sw_lm_shadow_vq(struct vhost_dev *dev, int idx);
vhost_dev_get_shadow_vq()? This could be in include/hw/virtio/vhost.h
with the other vhost_dev_*() functions.
> +
> +void vhost_sw_lm_shadow_vq_free(VhostShadowVirtqueue *vq);
Hmm...now I wonder what the lifecycle is. Does vhost_sw_lm_shadow_vq()
allocate it?
Please add doc comments explaining these functions either in this header
file or in vhost-sw-lm-ring.c.
> +
> +#endif
> diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h
> index b5b7496537..93cc3f1ae3 100644
> --- a/include/hw/virtio/vhost.h
> +++ b/include/hw/virtio/vhost.h
> @@ -54,6 +54,8 @@ struct vhost_iommu {
> QLIST_ENTRY(vhost_iommu) iommu_next;
> };
>
> +typedef struct VhostShadowVirtqueue VhostShadowVirtqueue;
> +
> typedef struct VhostDevConfigOps {
> /* Vhost device config space changed callback
> */
> @@ -83,6 +85,7 @@ struct vhost_dev {
> bool started;
> bool log_enabled;
> uint64_t log_size;
> + VhostShadowVirtqueue *sw_lm_shadow_vq[2];
The hardcoded 2 is probably for single-queue virtio-net? I guess this
will eventually become VhostShadowVirtqueue *shadow_vqs or
VhostShadowVirtqueue **shadow_vqs, depending on whether each one should
be allocated individually.
> VirtIOHandleOutput sw_lm_vq_handler;
> Error *migration_blocker;
> const VhostOps *vhost_ops;
> diff --git a/hw/virtio/vhost-sw-lm-ring.c b/hw/virtio/vhost-sw-lm-ring.c
> new file mode 100644
> index 0000000000..0192e77831
> --- /dev/null
> +++ b/hw/virtio/vhost-sw-lm-ring.c
> @@ -0,0 +1,60 @@
> +/*
> + * vhost software live migration ring
> + *
> + * SPDX-FileCopyrightText: Red Hat, Inc. 2020
> + * SPDX-FileContributor: Author: Eugenio Pérez <eperezma@redhat.com>
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#include "hw/virtio/vhost-sw-lm-ring.h"
> +#include "hw/virtio/vhost.h"
> +
> +#include "standard-headers/linux/vhost_types.h"
> +#include "standard-headers/linux/virtio_ring.h"
> +
> +#include "qemu/event_notifier.h"
> +
> +typedef struct VhostShadowVirtqueue {
> + EventNotifier hdev_notifier;
> + VirtQueue *vq;
> +} VhostShadowVirtqueue;
> +
> +static inline bool vhost_vring_should_kick(VhostShadowVirtqueue *vq)
> +{
> + return virtio_queue_get_used_notify_split(vq->vq);
> +}
> +
> +bool vhost_vring_kick(VhostShadowVirtqueue *vq)
> +{
> + return vhost_vring_should_kick(vq) ? event_notifier_set(&vq->hdev_notifier)
> + : true;
> +}
How is the return value used? event_notifier_set() returns -errno so
this function returns false on success, and true when notifications are
disabled or event_notifier_set() failed. I'm not sure this return value
can be used for anything.
> +
> +VhostShadowVirtqueue *vhost_sw_lm_shadow_vq(struct vhost_dev *dev, int idx)
I see now that this function allocates the VhostShadowVirtqueue. Maybe
adding _new() to the name would make that clear?
> +{
> + struct vhost_vring_file file = {
> + .index = idx
> + };
> + VirtQueue *vq = virtio_get_queue(dev->vdev, idx);
> + VhostShadowVirtqueue *svq;
> + int r;
> +
> + svq = g_new0(VhostShadowVirtqueue, 1);
> + svq->vq = vq;
> +
> + r = event_notifier_init(&svq->hdev_notifier, 0);
> + assert(r == 0);
> +
> + file.fd = event_notifier_get_fd(&svq->hdev_notifier);
> + r = dev->vhost_ops->vhost_set_vring_kick(dev, &file);
> + assert(r == 0);
> +
> + return svq;
> +}
I guess there are assumptions about the status of the device? Does the
virtqueue need to be disabled when this function is called?
> +
> +void vhost_sw_lm_shadow_vq_free(VhostShadowVirtqueue *vq)
> +{
> + event_notifier_cleanup(&vq->hdev_notifier);
> + g_free(vq);
> +}
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index 9cbd52a7f1..a55b684b5f 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -13,6 +13,8 @@
> * GNU GPL, version 2 or (at your option) any later version.
> */
>
> +#include "hw/virtio/vhost-sw-lm-ring.h"
> +
> #include "qemu/osdep.h"
> #include "qapi/error.h"
> #include "hw/virtio/vhost.h"
> @@ -61,6 +63,20 @@ bool vhost_has_free_slot(void)
> return slots_limit > used_memslots;
> }
>
> +static struct vhost_dev *vhost_dev_from_virtio(const VirtIODevice *vdev)
> +{
> + struct vhost_dev *hdev;
> +
> + QLIST_FOREACH(hdev, &vhost_devices, entry) {
> + if (hdev->vdev == vdev) {
> + return hdev;
> + }
> + }
> +
> + assert(hdev);
> + return NULL;
> +}
> +
> static bool vhost_dev_can_log(const struct vhost_dev *hdev)
> {
> return hdev->features & (0x1ULL << VHOST_F_LOG_ALL);
> @@ -148,6 +164,12 @@ static int vhost_sync_dirty_bitmap(struct vhost_dev *dev,
> return 0;
> }
>
> +static void vhost_log_sync_nop(MemoryListener *listener,
> + MemoryRegionSection *section)
> +{
> + return;
> +}
> +
> static void vhost_log_sync(MemoryListener *listener,
> MemoryRegionSection *section)
> {
> @@ -928,6 +950,71 @@ static void vhost_log_global_stop(MemoryListener *listener)
> }
> }
>
> +static void handle_sw_lm_vq(VirtIODevice *vdev, VirtQueue *vq)
> +{
> + struct vhost_dev *hdev = vhost_dev_from_virtio(vdev);
If this lookup becomes a performance bottleneck there are other options
for determining the vhost_dev. For example VirtIODevice could have a
field for stashing the vhost_dev pointer.
> + uint16_t idx = virtio_get_queue_index(vq);
> +
> + VhostShadowVirtqueue *svq = hdev->sw_lm_shadow_vq[idx];
> +
> + vhost_vring_kick(svq);
> +}
I'm a confused. Do we need to pop elements from vq and push equivalent
elements onto svq before kicking? Either a todo comment is missing or I
misunderstand how this works.
> +
> +static int vhost_sw_live_migration_stop(struct vhost_dev *dev)
> +{
> + int idx;
> +
> + vhost_dev_enable_notifiers(dev, dev->vdev);
> + for (idx = 0; idx < dev->nvqs; ++idx) {
> + vhost_sw_lm_shadow_vq_free(dev->sw_lm_shadow_vq[idx]);
> + }
> +
> + return 0;
> +}
> +
> +static int vhost_sw_live_migration_start(struct vhost_dev *dev)
> +{
> + int idx;
> +
> + for (idx = 0; idx < dev->nvqs; ++idx) {
> + dev->sw_lm_shadow_vq[idx] = vhost_sw_lm_shadow_vq(dev, idx);
> + }
> +
> + vhost_dev_disable_notifiers(dev, dev->vdev);
There is a race condition if the guest kicks the vq while this is
happening. The shadow vq hdev_notifier needs to be set so the vhost
device checks the virtqueue for requests that slipped in during the
race window.
> +
> + return 0;
> +}
> +
> +static int vhost_sw_live_migration_enable(struct vhost_dev *dev,
> + bool enable_lm)
> +{
> + if (enable_lm) {
> + return vhost_sw_live_migration_start(dev);
> + } else {
> + return vhost_sw_live_migration_stop(dev);
> + }
> +}
> +
> +static void vhost_sw_lm_global_start(MemoryListener *listener)
> +{
> + int r;
> +
> + r = vhost_migration_log(listener, true, vhost_sw_live_migration_enable);
> + if (r < 0) {
> + abort();
> + }
> +}
> +
> +static void vhost_sw_lm_global_stop(MemoryListener *listener)
> +{
> + int r;
> +
> + r = vhost_migration_log(listener, false, vhost_sw_live_migration_enable);
> + if (r < 0) {
> + abort();
> + }
> +}
> +
> static void vhost_log_start(MemoryListener *listener,
> MemoryRegionSection *section,
> int old, int new)
> @@ -1334,9 +1421,14 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
> .region_nop = vhost_region_addnop,
> .log_start = vhost_log_start,
> .log_stop = vhost_log_stop,
> - .log_sync = vhost_log_sync,
> - .log_global_start = vhost_log_global_start,
> - .log_global_stop = vhost_log_global_stop,
> + .log_sync = !vhost_dev_can_log(hdev) ?
> + vhost_log_sync_nop :
> + vhost_log_sync,
Why is this change necessary now? It's not clear to me why it was
previously okay to call vhost_log_sync().
> + .log_global_start = !vhost_dev_can_log(hdev) ?
> + vhost_sw_lm_global_start :
> + vhost_log_global_start,
> + .log_global_stop = !vhost_dev_can_log(hdev) ? vhost_sw_lm_global_stop :
> + vhost_log_global_stop,
> .eventfd_add = vhost_eventfd_add,
> .eventfd_del = vhost_eventfd_del,
> .priority = 10
> @@ -1364,6 +1456,8 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
> error_free(hdev->migration_blocker);
> goto fail_busyloop;
> }
> + } else {
> + hdev->sw_lm_vq_handler = handle_sw_lm_vq;
> }
>
> hdev->mem = g_malloc0(offsetof(struct vhost_memory, regions));
> diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build
> index fbff9bc9d4..17419cb13e 100644
> --- a/hw/virtio/meson.build
> +++ b/hw/virtio/meson.build
> @@ -11,7 +11,7 @@ softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-stub.c'))
>
> virtio_ss = ss.source_set()
> virtio_ss.add(files('virtio.c'))
> -virtio_ss.add(when: 'CONFIG_VHOST', if_true: files('vhost.c', 'vhost-backend.c'))
> +virtio_ss.add(when: 'CONFIG_VHOST', if_true: files('vhost.c', 'vhost-backend.c', 'vhost-sw-lm-ring.c'))
> virtio_ss.add(when: 'CONFIG_VHOST_USER', if_true: files('vhost-user.c'))
> virtio_ss.add(when: 'CONFIG_VHOST_VDPA', if_true: files('vhost-vdpa.c'))
> virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virtio-balloon.c'))
> --
> 2.18.4
>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 08/27] vhost: Add a flag for software assisted Live Migration
[not found] ` <20201120185105.279030-9-eperezma@redhat.com>
@ 2020-12-08 7:20 ` Stefan Hajnoczi
0 siblings, 0 replies; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-08 7:20 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 660 bytes --]
On Fri, Nov 20, 2020 at 07:50:46PM +0100, Eugenio Pérez wrote:
> @@ -1571,6 +1577,13 @@ void vhost_dev_disable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev)
> BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev)));
> int i, r;
>
> + if (hdev->sw_lm_enabled) {
> + /* We've been called after migration is completed, so no need to
> + disable it again
> + */
> + return;
> + }
> +
> for (i = 0; i < hdev->nvqs; ++i) {
> r = virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), hdev->vq_index + i,
> false);
What is the purpose of this?
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 09/27] vhost: Route host->guest notification through qemu
[not found] ` <20201120185105.279030-10-eperezma@redhat.com>
@ 2020-12-08 7:34 ` Stefan Hajnoczi
0 siblings, 0 replies; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-08 7:34 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 2197 bytes --]
On Fri, Nov 20, 2020 at 07:50:47PM +0100, Eugenio Pérez wrote:
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
> hw/virtio/vhost-sw-lm-ring.c | 3 +++
> hw/virtio/vhost.c | 20 ++++++++++++++++++++
> 2 files changed, 23 insertions(+)
I'm not sure I understand what is going here. The guest notifier masking
feature exists to support MSI masking semantics. It looks like this
patch repurposes the notifier to decouple the vhost hdev from the virtio
device's irqfd? But this breaks MSI masking. I think you need to set up
your own eventfd and assign it to the vhost hdev's call fd instead of
using the mask notifier.
>
> diff --git a/hw/virtio/vhost-sw-lm-ring.c b/hw/virtio/vhost-sw-lm-ring.c
> index 0192e77831..cbf53965cd 100644
> --- a/hw/virtio/vhost-sw-lm-ring.c
> +++ b/hw/virtio/vhost-sw-lm-ring.c
> @@ -50,6 +50,9 @@ VhostShadowVirtqueue *vhost_sw_lm_shadow_vq(struct vhost_dev *dev, int idx)
> r = dev->vhost_ops->vhost_set_vring_kick(dev, &file);
> assert(r == 0);
>
> + vhost_virtqueue_mask(dev, dev->vdev, idx, true);
> + vhost_virtqueue_pending(dev, idx);
Why is the mask notifier cleared? Could we lose a guest notification
here?
> +
> return svq;
> }
>
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index 1d55e26d45..9352c56bfa 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -960,12 +960,29 @@ static void handle_sw_lm_vq(VirtIODevice *vdev, VirtQueue *vq)
> vhost_vring_kick(svq);
> }
>
> +static void vhost_handle_call(EventNotifier *n)
> +{
> + struct vhost_virtqueue *hvq = container_of(n,
> + struct vhost_virtqueue,
> + masked_notifier);
> + struct vhost_dev *vdev = hvq->dev;
> + int idx = vdev->vq_index + (hvq == &vdev->vqs[0] ? 0 : 1);
vhost-net-specific hack
> + VirtQueue *vq = virtio_get_queue(vdev->vdev, idx);
> +
> + if (event_notifier_test_and_clear(n)) {
> + virtio_queue_invalidate_signalled_used(vdev->vdev, idx);
> + virtio_notify_irqfd(vdev->vdev, vq);
/* TODO push used elements into vq? */
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 10/27] vhost: Allocate shadow vring
[not found] ` <20201120185105.279030-11-eperezma@redhat.com>
@ 2020-12-08 7:49 ` Stefan Hajnoczi
2020-12-08 8:17 ` Stefan Hajnoczi
1 sibling, 0 replies; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-08 7:49 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 1288 bytes --]
On Fri, Nov 20, 2020 at 07:50:48PM +0100, Eugenio Pérez wrote:
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
> hw/virtio/vhost-sw-lm-ring.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/hw/virtio/vhost-sw-lm-ring.c b/hw/virtio/vhost-sw-lm-ring.c
> index cbf53965cd..cd7b5ba772 100644
> --- a/hw/virtio/vhost-sw-lm-ring.c
> +++ b/hw/virtio/vhost-sw-lm-ring.c
> @@ -16,8 +16,11 @@
> #include "qemu/event_notifier.h"
>
> typedef struct VhostShadowVirtqueue {
> + struct vring vring;
> EventNotifier hdev_notifier;
> VirtQueue *vq;
> +
> + vring_desc_t descs[];
> } VhostShadowVirtqueue;
VhostShadowVirtqueue is starting to look like VirtQueue. Can the shadow
vq code simply use the VirtIODevice's VirtQueues instead of duplicating
this?
What I mean is:
1. Disable the vhost hdev vq and sync the avail index back to the
VirtQueue.
2. Move the irq fd to the VirtQueue as its guest notifier.
3. Install the shadow_vq_handler() as the VirtQueue's handle_output
function.
4. Move the call fd to the VirtQueue as its host notifier.
Now we can process requests from the VirtIODevice's VirtQueue using
virtqueue_pop() and friends. We're also in sync and ready for vmstate
save/load.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 13/27] vhost: Send buffers to device
[not found] ` <20201120185105.279030-14-eperezma@redhat.com>
@ 2020-12-08 8:16 ` Stefan Hajnoczi
[not found] ` <CAJaqyWf13ta5MtzmTUz2N5XnQ+ebqFPYAivdggL64LEQAf=y+A@mail.gmail.com>
0 siblings, 1 reply; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-08 8:16 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 2332 bytes --]
On Fri, Nov 20, 2020 at 07:50:51PM +0100, Eugenio Pérez wrote:
> -static inline bool vhost_vring_should_kick(VhostShadowVirtqueue *vq)
> +static bool vhost_vring_should_kick_rcu(VhostShadowVirtqueue *vq)
"vhost_vring_" is a confusing name. This is not related to
vhost_virtqueue or the vhost_vring_* structs.
vhost_shadow_vq_should_kick_rcu()?
> {
> - return virtio_queue_get_used_notify_split(vq->vq);
> + VirtIODevice *vdev = vq->vdev;
> + vq->num_added = 0;
I'm surprised that a bool function modifies state. Is this assignment
intentional?
> +/* virtqueue_add:
> + * @vq: The #VirtQueue
> + * @elem: The #VirtQueueElement
The copy-pasted doc comment doesn't match this function.
> +int vhost_vring_add(VhostShadowVirtqueue *vq, VirtQueueElement *elem)
> +{
> + int host_head = vhost_vring_add_split(vq, elem);
> + if (vq->ring_id_maps[host_head]) {
> + g_free(vq->ring_id_maps[host_head]);
> + }
VirtQueueElement is freed lazily? Is there a reason for this approach? I
would have expected it to be freed when the used element is process by
the kick fd handler.
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index 9352c56bfa..304e0baa61 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -956,8 +956,34 @@ static void handle_sw_lm_vq(VirtIODevice *vdev, VirtQueue *vq)
> uint16_t idx = virtio_get_queue_index(vq);
>
> VhostShadowVirtqueue *svq = hdev->sw_lm_shadow_vq[idx];
> + VirtQueueElement *elem;
>
> - vhost_vring_kick(svq);
> + /*
> + * Make available all buffers as possible.
> + */
> + do {
> + if (virtio_queue_get_notification(vq)) {
> + virtio_queue_set_notification(vq, false);
> + }
> +
> + while (true) {
> + int r;
> + if (virtio_queue_full(vq)) {
> + break;
> + }
Why is this check necessary? The guest cannot provide more descriptors
than there is ring space. If that happens somehow then it's a driver
error that is already reported in virtqueue_pop() below.
I wonder if you added this because the vring implementation above
doesn't support indirect descriptors? It's easy to exhaust the vhost
hdev vring while there is still room in the VirtIODevice's VirtQueue
vring.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 10/27] vhost: Allocate shadow vring
[not found] ` <20201120185105.279030-11-eperezma@redhat.com>
2020-12-08 7:49 ` [RFC PATCH 10/27] vhost: Allocate shadow vring Stefan Hajnoczi
@ 2020-12-08 8:17 ` Stefan Hajnoczi
1 sibling, 0 replies; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-08 8:17 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 806 bytes --]
On Fri, Nov 20, 2020 at 07:50:48PM +0100, Eugenio Pérez wrote:
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
> hw/virtio/vhost-sw-lm-ring.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/hw/virtio/vhost-sw-lm-ring.c b/hw/virtio/vhost-sw-lm-ring.c
> index cbf53965cd..cd7b5ba772 100644
> --- a/hw/virtio/vhost-sw-lm-ring.c
> +++ b/hw/virtio/vhost-sw-lm-ring.c
> @@ -16,8 +16,11 @@
> #include "qemu/event_notifier.h"
>
> typedef struct VhostShadowVirtqueue {
> + struct vring vring;
> EventNotifier hdev_notifier;
> VirtQueue *vq;
> +
> + vring_desc_t descs[];
> } VhostShadowVirtqueue;
Looking at later patches I see that this is the vhost hdev vring state,
not the VirtIODevice vring state. That makes more sense.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 16/27] virtio: Expose virtqueue_alloc_element
[not found] ` <20201120185105.279030-17-eperezma@redhat.com>
@ 2020-12-08 8:25 ` Stefan Hajnoczi
[not found] ` <CAJaqyWdN7iudf8mDN4k4Fs9j1x+ztZARuBbinPHD3ZQSMH1pyQ@mail.gmail.com>
0 siblings, 1 reply; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-08 8:25 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 666 bytes --]
On Fri, Nov 20, 2020 at 07:50:54PM +0100, Eugenio Pérez wrote:
> Specify VirtQueueElement * as return type makes no harm at this moment.
The reason for the void * return type is that C implicitly converts void
pointers to pointers of any type. The function takes a size_t sz
argument so it can allocate a object of user-defined size. The idea is
that the user's struct embeds a VirtQueueElement field. Changing the
return type to VirtQueueElement * means that callers may need to
explicitly cast to the user's struct type.
It's a question of coding style but I think the void * return type
communicates what is going on better than VirtQueueElement *.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 18/27] vhost: add vhost_vring_poll_rcu
[not found] ` <20201120185105.279030-19-eperezma@redhat.com>
@ 2020-12-08 8:41 ` Stefan Hajnoczi
0 siblings, 0 replies; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-08 8:41 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 299 bytes --]
On Fri, Nov 20, 2020 at 07:50:56PM +0100, Eugenio Pérez wrote:
> @@ -83,6 +89,18 @@ void vhost_vring_set_notification_rcu(VhostShadowVirtqueue *vq, bool enable)
> smp_mb();
> }
>
> +bool vhost_vring_poll_rcu(VhostShadowVirtqueue *vq)
A name like "more_used" is clearer than "poll".
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 20/27] vhost: Return used buffers
[not found] ` <20201120185105.279030-21-eperezma@redhat.com>
@ 2020-12-08 8:50 ` Stefan Hajnoczi
0 siblings, 0 replies; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-08 8:50 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 1069 bytes --]
On Fri, Nov 20, 2020 at 07:50:58PM +0100, Eugenio Pérez wrote:
> @@ -1028,6 +1061,7 @@ static int vhost_sw_live_migration_start(struct vhost_dev *dev)
>
> for (idx = 0; idx < dev->nvqs; ++idx) {
> struct vhost_virtqueue *vq = &dev->vqs[idx];
> + unsigned num = virtio_queue_get_num(dev->vdev, idx);
> struct vhost_vring_addr addr = {
> .index = idx,
> };
> @@ -1044,6 +1078,12 @@ static int vhost_sw_live_migration_start(struct vhost_dev *dev)
> r = dev->vhost_ops->vhost_set_vring_addr(dev, &addr);
> assert(r == 0);
>
> + r = vhost_backend_update_device_iotlb(dev, addr.used_user_addr,
> + addr.used_user_addr,
> + sizeof(vring_used_elem_t) * num,
> + IOMMU_RW);
I don't remember seeing iotlb setup for the rest of the vring or guest
memory. Maybe this should go into a single patch so it's easy to review
the iova space layout.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 24/27] vhost: iommu changes
[not found] ` <20201120185105.279030-25-eperezma@redhat.com>
@ 2020-12-08 9:02 ` Stefan Hajnoczi
0 siblings, 0 replies; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-08 9:02 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 1415 bytes --]
On Fri, Nov 20, 2020 at 07:51:02PM +0100, Eugenio Pérez wrote:
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index eebfac4455..cb44b9997f 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -1109,6 +1109,10 @@ static int vhost_sw_live_migration_start(struct vhost_dev *dev)
>
> assert(dev->vhost_ops->vhost_set_vring_enable);
> dev->vhost_ops->vhost_set_vring_enable(dev, false);
> + if (vhost_dev_has_iommu(dev)) {
> + r = vhost_backend_invalidate_device_iotlb(dev, 0, -1ULL);
> + assert(r == 0);
> + }
>
> for (idx = 0; idx < dev->nvqs; ++idx) {
> struct vhost_virtqueue *vq = &dev->vqs[idx];
> @@ -1269,6 +1273,19 @@ int vhost_device_iotlb_miss(struct vhost_dev *dev, uint64_t iova, int write)
>
> trace_vhost_iotlb_miss(dev, 1);
>
> + if (dev->sw_lm_enabled) {
> + uaddr = iova;
> + len = 4096;
> + ret = vhost_backend_update_device_iotlb(dev, iova, uaddr, len,
> + IOMMU_RW);
It would be nice to look up the available memory so
vhost_backend_update_device_iotlb() can be called with a much bigger
[uaddr, uaddr+len) range. This will reduce the number of iotlb misses.
Will vIOMMU be required for this feature? If not, then the vring needs
to be added to the vhost memory regions because vhost will not send QEMU
iotlb misses.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 00/27] vDPA software assisted live migration
[not found] <20201120185105.279030-1-eperezma@redhat.com>
` (15 preceding siblings ...)
[not found] ` <20201120185105.279030-25-eperezma@redhat.com>
@ 2020-12-08 9:37 ` Stefan Hajnoczi
2020-12-09 9:26 ` Jason Wang
16 siblings, 1 reply; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-08 9:37 UTC (permalink / raw)
To: Eugenio Pérez
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Lars Ganrot, Rob Miller,
Howard Cai, Parav Pandit, vm, Salil Mehta, Stephen Finucane,
Xiao W Wang, Sean Mooney, Stefan Hajnoczi, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 2133 bytes --]
On Fri, Nov 20, 2020 at 07:50:38PM +0100, Eugenio Pérez wrote:
> This series enable vDPA software assisted live migration for vhost-net
> devices. This is a new method of vhost devices migration: Instead of
> relay on vDPA device's dirty logging capability, SW assisted LM
> intercepts dataplane, forwarding the descriptors between VM and device.
Pros:
+ vhost/vDPA devices don't need to implement dirty memory logging
+ Obsoletes ioctl(VHOST_SET_LOG_BASE) and friends
Cons:
- Not generic, relies on vhost-net-specific ioctls
- Doesn't support VIRTIO Shared Memory Regions
https://github.com/oasis-tcs/virtio-spec/blob/master/shared-mem.tex
- Performance (see below)
I think performance will be significantly lower when the shadow vq is
enabled. Imagine a vDPA device with hardware vq doorbell registers
mapped into the guest so the guest driver can directly kick the device.
When the shadow vq is enabled a vmexit is needed to write to the shadow
vq ioeventfd, then the host kernel scheduler switches to a QEMU thread
to read the ioeventfd, the descriptors are translated, QEMU writes to
the vhost hdev kick fd, the host kernel scheduler switches to the vhost
worker thread, vhost/vDPA notifies the virtqueue, and finally the
vDPA driver writes to the hardware vq doorbell register. That is a lot
of overhead compared to writing to an exitless MMIO register!
If the shadow vq was implemented in drivers/vhost/ and QEMU used the
existing ioctl(VHOST_SET_LOG_BASE) approach, then the overhead would be
reduced to just one set of ioeventfd/irqfd. In other words, the QEMU
dirty memory logging happens asynchronously and isn't in the dataplane.
In addition, hardware that supports dirty memory logging as well as
software vDPA devices could completely eliminate the shadow vq for even
better performance.
But performance is a question of "is it good enough?". Maybe this
approach is okay and users don't expect good performance while dirty
memory logging is enabled. I just wanted to share the idea of moving the
shadow vq into the kernel in case you like that approach better.
Stefan
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 00/27] vDPA software assisted live migration
2020-12-08 9:37 ` [RFC PATCH 00/27] vDPA software assisted live migration Stefan Hajnoczi
@ 2020-12-09 9:26 ` Jason Wang
2020-12-09 15:57 ` Stefan Hajnoczi
0 siblings, 1 reply; 29+ messages in thread
From: Jason Wang @ 2020-12-09 9:26 UTC (permalink / raw)
To: Stefan Hajnoczi
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Eugenio Pérez, Lars Ganrot,
Rob Miller, Howard Cai, Parav Pandit, vm, Salil Mehta,
Stephen Finucane, Xiao W Wang, Sean Mooney, Stefan Hajnoczi,
Jim Harford, Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand,
Michael Lilja, Max Gurtovoy
----- Original Message -----
> On Fri, Nov 20, 2020 at 07:50:38PM +0100, Eugenio Pérez wrote:
> > This series enable vDPA software assisted live migration for vhost-net
> > devices. This is a new method of vhost devices migration: Instead of
> > relay on vDPA device's dirty logging capability, SW assisted LM
> > intercepts dataplane, forwarding the descriptors between VM and device.
>
> Pros:
> + vhost/vDPA devices don't need to implement dirty memory logging
> + Obsoletes ioctl(VHOST_SET_LOG_BASE) and friends
>
> Cons:
> - Not generic, relies on vhost-net-specific ioctls
> - Doesn't support VIRTIO Shared Memory Regions
> https://github.com/oasis-tcs/virtio-spec/blob/master/shared-mem.tex
I may miss something but my understanding is that it's the
responsiblity of device to migrate this part?
> - Performance (see below)
>
> I think performance will be significantly lower when the shadow vq is
> enabled. Imagine a vDPA device with hardware vq doorbell registers
> mapped into the guest so the guest driver can directly kick the device.
> When the shadow vq is enabled a vmexit is needed to write to the shadow
> vq ioeventfd, then the host kernel scheduler switches to a QEMU thread
> to read the ioeventfd, the descriptors are translated, QEMU writes to
> the vhost hdev kick fd, the host kernel scheduler switches to the vhost
> worker thread, vhost/vDPA notifies the virtqueue, and finally the
> vDPA driver writes to the hardware vq doorbell register. That is a lot
> of overhead compared to writing to an exitless MMIO register!
I think it's a balance. E.g we can poll the virtqueue to have an
exitless doorbell.
>
> If the shadow vq was implemented in drivers/vhost/ and QEMU used the
> existing ioctl(VHOST_SET_LOG_BASE) approach, then the overhead would be
> reduced to just one set of ioeventfd/irqfd. In other words, the QEMU
> dirty memory logging happens asynchronously and isn't in the dataplane.
>
> In addition, hardware that supports dirty memory logging as well as
> software vDPA devices could completely eliminate the shadow vq for even
> better performance.
Yes. That's our plan. But the interface might require more thought.
E.g is the bitmap a good approach? To me reporting dirty pages via
virqueue is better since it get less footprint and is self throttled.
And we need an address space other than the one used by guest for
either bitmap for virtqueue.
>
> But performance is a question of "is it good enough?". Maybe this
> approach is okay and users don't expect good performance while dirty
> memory logging is enabled.
Yes, and actually such slow down may help for the converge of the
migration.
Note that the whole idea is try to have a generic solution for all
types of devices. It's good to consider the performance but for the
first stage, it should be sufficient to make it work and consider to
optimize on top.
> I just wanted to share the idea of moving the
> shadow vq into the kernel in case you like that approach better.
My understanding is to keep kernel as simple as possible and leave the
polices to userspace as much as possible. E.g it requires us to
disable doorbell mapping and irq offloading, all of which were under
the control of userspace.
Thanks
>
> Stefan
>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 00/27] vDPA software assisted live migration
2020-12-09 9:26 ` Jason Wang
@ 2020-12-09 15:57 ` Stefan Hajnoczi
2020-12-10 9:12 ` Jason Wang
0 siblings, 1 reply; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-09 15:57 UTC (permalink / raw)
To: Jason Wang
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Eugenio Pérez, Lars Ganrot,
Rob Miller, Howard Cai, Parav Pandit, vm, Salil Mehta,
Stephen Finucane, Xiao W Wang, Sean Mooney, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 3983 bytes --]
On Wed, Dec 09, 2020 at 04:26:50AM -0500, Jason Wang wrote:
> ----- Original Message -----
> > On Fri, Nov 20, 2020 at 07:50:38PM +0100, Eugenio Pérez wrote:
> > > This series enable vDPA software assisted live migration for vhost-net
> > > devices. This is a new method of vhost devices migration: Instead of
> > > relay on vDPA device's dirty logging capability, SW assisted LM
> > > intercepts dataplane, forwarding the descriptors between VM and device.
> >
> > Pros:
> > + vhost/vDPA devices don't need to implement dirty memory logging
> > + Obsoletes ioctl(VHOST_SET_LOG_BASE) and friends
> >
> > Cons:
> > - Not generic, relies on vhost-net-specific ioctls
> > - Doesn't support VIRTIO Shared Memory Regions
> > https://github.com/oasis-tcs/virtio-spec/blob/master/shared-mem.tex
>
> I may miss something but my understanding is that it's the
> responsiblity of device to migrate this part?
Good point. You're right.
> > - Performance (see below)
> >
> > I think performance will be significantly lower when the shadow vq is
> > enabled. Imagine a vDPA device with hardware vq doorbell registers
> > mapped into the guest so the guest driver can directly kick the device.
> > When the shadow vq is enabled a vmexit is needed to write to the shadow
> > vq ioeventfd, then the host kernel scheduler switches to a QEMU thread
> > to read the ioeventfd, the descriptors are translated, QEMU writes to
> > the vhost hdev kick fd, the host kernel scheduler switches to the vhost
> > worker thread, vhost/vDPA notifies the virtqueue, and finally the
> > vDPA driver writes to the hardware vq doorbell register. That is a lot
> > of overhead compared to writing to an exitless MMIO register!
>
> I think it's a balance. E.g we can poll the virtqueue to have an
> exitless doorbell.
>
> >
> > If the shadow vq was implemented in drivers/vhost/ and QEMU used the
> > existing ioctl(VHOST_SET_LOG_BASE) approach, then the overhead would be
> > reduced to just one set of ioeventfd/irqfd. In other words, the QEMU
> > dirty memory logging happens asynchronously and isn't in the dataplane.
> >
> > In addition, hardware that supports dirty memory logging as well as
> > software vDPA devices could completely eliminate the shadow vq for even
> > better performance.
>
> Yes. That's our plan. But the interface might require more thought.
>
> E.g is the bitmap a good approach? To me reporting dirty pages via
> virqueue is better since it get less footprint and is self throttled.
>
> And we need an address space other than the one used by guest for
> either bitmap for virtqueue.
>
> >
> > But performance is a question of "is it good enough?". Maybe this
> > approach is okay and users don't expect good performance while dirty
> > memory logging is enabled.
>
> Yes, and actually such slow down may help for the converge of the
> migration.
>
> Note that the whole idea is try to have a generic solution for all
> types of devices. It's good to consider the performance but for the
> first stage, it should be sufficient to make it work and consider to
> optimize on top.
Moving the shadow vq to the kernel later would be quite a big change
requiring rewriting much of the code. That's why I mentioned this now
before a lot of effort is invested in a QEMU implementation.
> > I just wanted to share the idea of moving the
> > shadow vq into the kernel in case you like that approach better.
>
> My understanding is to keep kernel as simple as possible and leave the
> polices to userspace as much as possible. E.g it requires us to
> disable doorbell mapping and irq offloading, all of which were under
> the control of userspace.
If the performance is acceptable with the QEMU approach then I think
that's the best place to implement it. It looks high-overhead though so
maybe one of the first things to do is to run benchmarks to collect data
on how it performs?
Stefan
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 04/27] vhost: add vhost_kernel_set_vring_enable
[not found] ` <CAJaqyWd5oAJ4kJOhyDz+1KNvwzqJi3NO+5Z7X6W5ju2Va=LTMQ@mail.gmail.com>
@ 2020-12-09 16:08 ` Stefan Hajnoczi
0 siblings, 0 replies; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-09 16:08 UTC (permalink / raw)
To: Eugenio Perez Martin
Cc: kvm list, Michael S. Tsirkin, qemu-level, Daniel Daly,
virtualization, Liran Alon, Eli Cohen, Nitin Shrivastav,
Alex Barba, Christophe Fontaine, Lee Ballard, Lars Ganrot,
Rob Miller, Howard Cai, Parav Pandit, vm, Salil Mehta,
Stephen Finucane, Xiao W Wang, Sean Mooney, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 3529 bytes --]
On Wed, Dec 09, 2020 at 01:00:19PM +0100, Eugenio Perez Martin wrote:
> On Mon, Dec 7, 2020 at 5:43 PM Stefan Hajnoczi <stefanha@gmail.com> wrote:
> >
> > On Fri, Nov 20, 2020 at 07:50:42PM +0100, Eugenio Pérez wrote:
> > > Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> > > ---
> > > hw/virtio/vhost-backend.c | 29 +++++++++++++++++++++++++++++
> > > 1 file changed, 29 insertions(+)
> > >
> > > diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c
> > > index 222bbcc62d..317f1f96fa 100644
> > > --- a/hw/virtio/vhost-backend.c
> > > +++ b/hw/virtio/vhost-backend.c
> > > @@ -201,6 +201,34 @@ static int vhost_kernel_get_vq_index(struct vhost_dev *dev, int idx)
> > > return idx - dev->vq_index;
> > > }
> > >
> > > +static int vhost_kernel_set_vq_enable(struct vhost_dev *dev, unsigned idx,
> > > + bool enable)
> > > +{
> > > + struct vhost_vring_file file = {
> > > + .index = idx,
> > > + };
> > > +
> > > + if (!enable) {
> > > + file.fd = -1; /* Pass -1 to unbind from file. */
> > > + } else {
> > > + struct vhost_net *vn_dev = container_of(dev, struct vhost_net, dev);
> > > + file.fd = vn_dev->backend;
> > > + }
> > > +
> > > + return vhost_kernel_net_set_backend(dev, &file);
> >
> > This is vhost-net specific even though the function appears to be
> > generic. Is there a plan to extend this to all devices?
> >
>
> I expected each vhost backend to enable-disable in its own terms, but
> I think it could be 100% virtio-device generic with something like the
> device state capability:
> https://lists.oasis-open.org/archives/virtio-comment/202012/msg00005.html
> .
Great, thanks for the link!
> > > +}
> > > +
> > > +static int vhost_kernel_set_vring_enable(struct vhost_dev *dev, int enable)
> > > +{
> > > + int i;
> > > +
> > > + for (i = 0; i < dev->nvqs; ++i) {
> > > + vhost_kernel_set_vq_enable(dev, i, enable);
> > > + }
> > > +
> > > + return 0;
> > > +}
> >
> > I suggest exposing the per-vq interface (vhost_kernel_set_vq_enable())
> > in VhostOps so it follows the ioctl interface.
>
> It was actually the initial plan, I left as all-or-nothing to make less changes.
>
> > vhost_kernel_set_vring_enable() can be moved to vhost.c can loop over
> > all vqs if callers find it convenient to loop over all vqs.
>
> I'm ok with it. Thinking out loud, I don't know if it is easier for
> some devices to enable/disable all of it (less syscalls? less downtime
> somehow?) but I find more generic and useful the per-virtqueue
> approach.
That's an interesting question, the ability to enable/disable specific
virtqueues seems like it could be useful. For example, guests with vCPU
hotplug may want to enable/disable virtqueues so that multi-queue
adapts as the number of vCPUs changes. A per-vq interface is needed for
that.
I'm a little worried that some device types might not cope well with
quiescing individual vqs. Here "quiesce" means to complete in flight
requests. This would be where two or more vqs have a relationship and
disabling one vq could cause a deadlock when trying to disable the other
one. However, I can't think of a case where this happens.
virtio-vsock is the closest example but luckily we don't need complete
in flight requests, we can just stop the vq immediately. So although
there is a dependency on the other vq it won't deadlock in this case.
Stefan
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 00/27] vDPA software assisted live migration
2020-12-09 15:57 ` Stefan Hajnoczi
@ 2020-12-10 9:12 ` Jason Wang
0 siblings, 0 replies; 29+ messages in thread
From: Jason Wang @ 2020-12-10 9:12 UTC (permalink / raw)
To: Stefan Hajnoczi
Cc: kvm, Michael S. Tsirkin, qemu-devel, Daniel Daly, virtualization,
Liran Alon, Eli Cohen, Nitin Shrivastav, Alex Barba,
Christophe Fontaine, Lee Ballard, Eugenio Pérez, Lars Ganrot,
Rob Miller, Howard Cai, Parav Pandit, vm, Salil Mehta,
Stephen Finucane, Xiao W Wang, Sean Mooney, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
On 2020/12/9 下午11:57, Stefan Hajnoczi wrote:
> On Wed, Dec 09, 2020 at 04:26:50AM -0500, Jason Wang wrote:
>> ----- Original Message -----
>>> On Fri, Nov 20, 2020 at 07:50:38PM +0100, Eugenio Pérez wrote:
>>>> This series enable vDPA software assisted live migration for vhost-net
>>>> devices. This is a new method of vhost devices migration: Instead of
>>>> relay on vDPA device's dirty logging capability, SW assisted LM
>>>> intercepts dataplane, forwarding the descriptors between VM and device.
>>> Pros:
>>> + vhost/vDPA devices don't need to implement dirty memory logging
>>> + Obsoletes ioctl(VHOST_SET_LOG_BASE) and friends
>>>
>>> Cons:
>>> - Not generic, relies on vhost-net-specific ioctls
>>> - Doesn't support VIRTIO Shared Memory Regions
>>> https://github.com/oasis-tcs/virtio-spec/blob/master/shared-mem.tex
>> I may miss something but my understanding is that it's the
>> responsiblity of device to migrate this part?
> Good point. You're right.
>
>>> - Performance (see below)
>>>
>>> I think performance will be significantly lower when the shadow vq is
>>> enabled. Imagine a vDPA device with hardware vq doorbell registers
>>> mapped into the guest so the guest driver can directly kick the device.
>>> When the shadow vq is enabled a vmexit is needed to write to the shadow
>>> vq ioeventfd, then the host kernel scheduler switches to a QEMU thread
>>> to read the ioeventfd, the descriptors are translated, QEMU writes to
>>> the vhost hdev kick fd, the host kernel scheduler switches to the vhost
>>> worker thread, vhost/vDPA notifies the virtqueue, and finally the
>>> vDPA driver writes to the hardware vq doorbell register. That is a lot
>>> of overhead compared to writing to an exitless MMIO register!
>> I think it's a balance. E.g we can poll the virtqueue to have an
>> exitless doorbell.
>>
>>> If the shadow vq was implemented in drivers/vhost/ and QEMU used the
>>> existing ioctl(VHOST_SET_LOG_BASE) approach, then the overhead would be
>>> reduced to just one set of ioeventfd/irqfd. In other words, the QEMU
>>> dirty memory logging happens asynchronously and isn't in the dataplane.
>>>
>>> In addition, hardware that supports dirty memory logging as well as
>>> software vDPA devices could completely eliminate the shadow vq for even
>>> better performance.
>> Yes. That's our plan. But the interface might require more thought.
>>
>> E.g is the bitmap a good approach? To me reporting dirty pages via
>> virqueue is better since it get less footprint and is self throttled.
>>
>> And we need an address space other than the one used by guest for
>> either bitmap for virtqueue.
>>
>>> But performance is a question of "is it good enough?". Maybe this
>>> approach is okay and users don't expect good performance while dirty
>>> memory logging is enabled.
>> Yes, and actually such slow down may help for the converge of the
>> migration.
>>
>> Note that the whole idea is try to have a generic solution for all
>> types of devices. It's good to consider the performance but for the
>> first stage, it should be sufficient to make it work and consider to
>> optimize on top.
> Moving the shadow vq to the kernel later would be quite a big change
> requiring rewriting much of the code. That's why I mentioned this now
> before a lot of effort is invested in a QEMU implementation.
Right.
>
>>> I just wanted to share the idea of moving the
>>> shadow vq into the kernel in case you like that approach better.
>> My understanding is to keep kernel as simple as possible and leave the
>> polices to userspace as much as possible. E.g it requires us to
>> disable doorbell mapping and irq offloading, all of which were under
>> the control of userspace.
> If the performance is acceptable with the QEMU approach then I think
> that's the best place to implement it. It looks high-overhead though so
> maybe one of the first things to do is to run benchmarks to collect data
> on how it performs?
Yes, I agree.
Thanks
>
> Stefan
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 05/27] vhost: Add hdev->dev.sw_lm_vq_handler
[not found] ` <CAJaqyWfSUHD0MU=1yfU1N6pZ4TU7prxyoG6NY-VyNGt=MO9H4g@mail.gmail.com>
@ 2020-12-10 11:30 ` Stefan Hajnoczi
0 siblings, 0 replies; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-10 11:30 UTC (permalink / raw)
To: Eugenio Perez Martin
Cc: kvm list, Michael S. Tsirkin, qemu-level, Daniel Daly,
virtualization, Liran Alon, Eli Cohen, Nitin Shrivastav,
Alex Barba, Christophe Fontaine, Lee Ballard, Lars Ganrot,
Rob Miller, Howard Cai, Parav Pandit, vm, Salil Mehta,
Stephen Finucane, Xiao W Wang, Sean Mooney, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 1258 bytes --]
On Wed, Dec 09, 2020 at 04:02:56PM +0100, Eugenio Perez Martin wrote:
> On Mon, Dec 7, 2020 at 5:52 PM Stefan Hajnoczi <stefanha@gmail.com> wrote:
> > On Fri, Nov 20, 2020 at 07:50:43PM +0100, Eugenio Pérez wrote:
> > > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> > > index 9179013ac4..9a69ae3598 100644
> > > --- a/hw/net/virtio-net.c
> > > +++ b/hw/net/virtio-net.c
> > > @@ -2628,24 +2628,32 @@ static void virtio_net_tx_bh(void *opaque)
> > > }
> > > }
> > >
> > > -static void virtio_net_add_queue(VirtIONet *n, int index)
> > > +static void virtio_net_add_queue(VirtIONet *n, int index,
> > > + VirtIOHandleOutput custom_handler)
> > > {
> >
> > We talked about the possibility of moving this into the generic vhost
> > code so that devices don't need to be modified. It would be nice to hide
> > this feature inside vhost.
>
> I'm thinking of tying it to VirtQueue, allowing the caller to override
> the handler knowing it is not going to be called (I mean, not offering
> race conditions protection, like before of starting processing
> notifications in qemu calling vhost_dev_disable_notifiers).
Yes, I can see how at least part of this belongs to VirtQueue.
Stefan
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 07/27] vhost: Route guest->host notification through qemu
[not found] ` <CAJaqyWfiMsRP9FgSv7cOj=3jHx=DJS7hRJTMbRcTTHHWng0eKg@mail.gmail.com>
@ 2020-12-10 11:50 ` Stefan Hajnoczi
0 siblings, 0 replies; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-10 11:50 UTC (permalink / raw)
To: Eugenio Perez Martin
Cc: kvm list, Michael S. Tsirkin, qemu-level, Daniel Daly,
virtualization, Liran Alon, Eli Cohen, Nitin Shrivastav,
Alex Barba, Christophe Fontaine, Lee Ballard, Lars Ganrot,
Rob Miller, Howard Cai, Parav Pandit, vm, Salil Mehta,
Stephen Finucane, Xiao W Wang, Sean Mooney, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 3450 bytes --]
On Wed, Dec 09, 2020 at 06:08:14PM +0100, Eugenio Perez Martin wrote:
> On Mon, Dec 7, 2020 at 6:42 PM Stefan Hajnoczi <stefanha@gmail.com> wrote:
> > On Fri, Nov 20, 2020 at 07:50:45PM +0100, Eugenio Pérez wrote:
> > > +{
> > > + struct vhost_vring_file file = {
> > > + .index = idx
> > > + };
> > > + VirtQueue *vq = virtio_get_queue(dev->vdev, idx);
> > > + VhostShadowVirtqueue *svq;
> > > + int r;
> > > +
> > > + svq = g_new0(VhostShadowVirtqueue, 1);
> > > + svq->vq = vq;
> > > +
> > > + r = event_notifier_init(&svq->hdev_notifier, 0);
> > > + assert(r == 0);
> > > +
> > > + file.fd = event_notifier_get_fd(&svq->hdev_notifier);
> > > + r = dev->vhost_ops->vhost_set_vring_kick(dev, &file);
> > > + assert(r == 0);
> > > +
> > > + return svq;
> > > +}
> >
> > I guess there are assumptions about the status of the device? Does the
> > virtqueue need to be disabled when this function is called?
> >
>
> Yes. Maybe an assertion checking the notification state?
Sounds good.
> > > +
> > > +static int vhost_sw_live_migration_stop(struct vhost_dev *dev)
> > > +{
> > > + int idx;
> > > +
> > > + vhost_dev_enable_notifiers(dev, dev->vdev);
> > > + for (idx = 0; idx < dev->nvqs; ++idx) {
> > > + vhost_sw_lm_shadow_vq_free(dev->sw_lm_shadow_vq[idx]);
> > > + }
> > > +
> > > + return 0;
> > > +}
> > > +
> > > +static int vhost_sw_live_migration_start(struct vhost_dev *dev)
> > > +{
> > > + int idx;
> > > +
> > > + for (idx = 0; idx < dev->nvqs; ++idx) {
> > > + dev->sw_lm_shadow_vq[idx] = vhost_sw_lm_shadow_vq(dev, idx);
> > > + }
> > > +
> > > + vhost_dev_disable_notifiers(dev, dev->vdev);
> >
> > There is a race condition if the guest kicks the vq while this is
> > happening. The shadow vq hdev_notifier needs to be set so the vhost
> > device checks the virtqueue for requests that slipped in during the
> > race window.
> >
>
> I'm not sure if I follow you. If I understand correctly,
> vhost_dev_disable_notifiers calls virtio_bus_cleanup_host_notifier,
> and the latter calls virtio_queue_host_notifier_read. That's why the
> documentation says "This might actually run the qemu handlers right
> away, so virtio in qemu must be completely setup when this is
> called.". Am I missing something?
There are at least two cases:
1. Virtqueue kicks that come before vhost_dev_disable_notifiers().
vhost_dev_disable_notifiers() notices that and calls
virtio_queue_notify_vq(). Will handle_sw_lm_vq() be invoked or is the
device's vq handler function invoked?
2. Virtqueue kicks that come in after vhost_dev_disable_notifiers()
returns. We hold the QEMU global mutex so the vCPU thread cannot
perform MMIO/PIO dispatch immediately. The vCPU thread's
ioctl(KVM_RUN) has already returned and will dispatch dispatch the
MMIO/PIO access inside QEMU as soon as the global mutex is released.
In other words, we're not taking the kvm.ko ioeventfd path but
memory_region_dispatch_write_eventfds() should signal the ioeventfd
that is registered at the time the dispatch occurs. Is that eventfd
handled by handle_sw_lm_vq()?
Neither of these cases are obvious from the code. At least comments
would help but I suspect restructuring the code so the critical
ioeventfd state changes happen in a sequence would make it even clearer.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 13/27] vhost: Send buffers to device
[not found] ` <CAJaqyWf13ta5MtzmTUz2N5XnQ+ebqFPYAivdggL64LEQAf=y+A@mail.gmail.com>
@ 2020-12-10 11:55 ` Stefan Hajnoczi
0 siblings, 0 replies; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-10 11:55 UTC (permalink / raw)
To: Eugenio Perez Martin
Cc: kvm list, Michael S. Tsirkin, qemu-level, Daniel Daly,
virtualization, Liran Alon, Eli Cohen, Nitin Shrivastav,
Alex Barba, Christophe Fontaine, Lee Ballard, Lars Ganrot,
Rob Miller, Howard Cai, Parav Pandit, vm, Salil Mehta,
Stephen Finucane, Xiao W Wang, Sean Mooney, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 1333 bytes --]
On Wed, Dec 09, 2020 at 07:41:23PM +0100, Eugenio Perez Martin wrote:
> On Tue, Dec 8, 2020 at 9:16 AM Stefan Hajnoczi <stefanha@gmail.com> wrote:
> > On Fri, Nov 20, 2020 at 07:50:51PM +0100, Eugenio Pérez wrote:
> > > + while (true) {
> > > + int r;
> > > + if (virtio_queue_full(vq)) {
> > > + break;
> > > + }
> >
> > Why is this check necessary? The guest cannot provide more descriptors
> > than there is ring space. If that happens somehow then it's a driver
> > error that is already reported in virtqueue_pop() below.
> >
>
> It's just checked because virtqueue_pop prints an error on that case,
> and there is no way to tell the difference between a regular error and
> another caused by other causes. Maybe the right thing to do is just to
> not to print that error? Caller should do the error printing in that
> case. Should we return an error code?
The reason an error is printed today is because it's a guest error that
never happens with correct guest drivers. Something is broken and the
user should know about it.
Why is "virtio_queue_full" (I already forgot what that actually means,
it's not clear whether this is referring to avail elements or used
elements) a condition that should be silently ignored in shadow vqs?
Stefan
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 16/27] virtio: Expose virtqueue_alloc_element
[not found] ` <CAJaqyWdN7iudf8mDN4k4Fs9j1x+ztZARuBbinPHD3ZQSMH1pyQ@mail.gmail.com>
@ 2020-12-10 11:57 ` Stefan Hajnoczi
0 siblings, 0 replies; 29+ messages in thread
From: Stefan Hajnoczi @ 2020-12-10 11:57 UTC (permalink / raw)
To: Eugenio Perez Martin
Cc: kvm list, Michael S. Tsirkin, qemu-level, Daniel Daly,
virtualization, Liran Alon, Eli Cohen, Nitin Shrivastav,
Alex Barba, Christophe Fontaine, Lee Ballard, Lars Ganrot,
Rob Miller, Howard Cai, Parav Pandit, vm, Salil Mehta,
Stephen Finucane, Xiao W Wang, Sean Mooney, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 1476 bytes --]
On Wed, Dec 09, 2020 at 07:46:49PM +0100, Eugenio Perez Martin wrote:
> On Tue, Dec 8, 2020 at 9:26 AM Stefan Hajnoczi <stefanha@gmail.com> wrote:
> >
> > On Fri, Nov 20, 2020 at 07:50:54PM +0100, Eugenio Pérez wrote:
> > > Specify VirtQueueElement * as return type makes no harm at this moment.
> >
> > The reason for the void * return type is that C implicitly converts void
> > pointers to pointers of any type. The function takes a size_t sz
> > argument so it can allocate a object of user-defined size. The idea is
> > that the user's struct embeds a VirtQueueElement field. Changing the
> > return type to VirtQueueElement * means that callers may need to
> > explicitly cast to the user's struct type.
> >
> > It's a question of coding style but I think the void * return type
> > communicates what is going on better than VirtQueueElement *.
>
> Right, what I meant with that is that nobody uses that feature, but I
> just re-check and I saw that contrib/vhost-user-blk actually uses it
> (not checked for more uses). I think it is better just to drop this
> commit.
contrib/vhost-user-blk doesn't use hw/virtio/virtio.c. The code is
similar and copy-pasted, but you are free to change this file without
affecting vontrib/vhost-user-blk :).
I still think it's clearer to make it obvious that this function
allocates an object of generic type or at least the change is purely a
question of style and probably not worth making.
Stefan
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 06/27] virtio: Add virtio_queue_get_used_notify_split
[not found] ` <CAJaqyWc4oLzL02GKpPSwEGRxK+UxjOGBAPLzrgrgKRZd9C81GA@mail.gmail.com>
@ 2021-03-02 11:22 ` Stefan Hajnoczi
[not found] ` <CAJaqyWd0iRUUW5Hu=U3mwQ4f43kA=bse3EkN4+QauFR4BJwObQ@mail.gmail.com>
0 siblings, 1 reply; 29+ messages in thread
From: Stefan Hajnoczi @ 2021-03-02 11:22 UTC (permalink / raw)
To: Eugenio Perez Martin
Cc: kvm list, Michael S. Tsirkin, qemu-level, Daniel Daly,
virtualization, Liran Alon, Eli Cohen, Nitin Shrivastav,
Alex Barba, Christophe Fontaine, Lee Ballard, Lars Ganrot,
Rob Miller, Howard Cai, Parav Pandit, vm, Salil Mehta,
Stephen Finucane, Xiao W Wang, Sean Mooney, Stefan Hajnoczi,
Jim Harford, Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand,
Michael Lilja, Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 2474 bytes --]
On Tue, Jan 12, 2021 at 07:21:27PM +0100, Eugenio Perez Martin wrote:
> On Mon, Dec 7, 2020 at 5:58 PM Stefan Hajnoczi <stefanha@gmail.com> wrote:
> >
> > On Fri, Nov 20, 2020 at 07:50:44PM +0100, Eugenio Pérez wrote:
> > > This function is just used for a few commits, so SW LM is developed
> > > incrementally, and it is deleted after it is useful.
> > >
> > > For a few commits, only the events (irqfd, eventfd) are forwarded.
> >
> > s/eventfd/ioeventfd/ (irqfd is also an eventfd)
> >
>
> Oops, will fix, thanks!
>
> > > +bool virtio_queue_get_used_notify_split(VirtQueue *vq)
> > > +{
> > > + VRingMemoryRegionCaches *caches;
> > > + hwaddr pa = offsetof(VRingUsed, flags);
> > > + uint16_t flags;
> > > +
> > > + RCU_READ_LOCK_GUARD();
> > > +
> > > + caches = vring_get_region_caches(vq);
> > > + assert(caches);
> > > + flags = virtio_lduw_phys_cached(vq->vdev, &caches->used, pa);
> > > + return !(VRING_USED_F_NO_NOTIFY & flags);
> > > +}
> >
> > QEMU stores the notification status:
> >
> > void virtio_queue_set_notification(VirtQueue *vq, int enable)
> > {
> > vq->notification = enable; <---- here
> >
> > if (!vq->vring.desc) {
> > return;
> > }
> >
> > if (virtio_vdev_has_feature(vq->vdev, VIRTIO_F_RING_PACKED)) {
> > virtio_queue_packed_set_notification(vq, enable);
> > } else {
> > virtio_queue_split_set_notification(vq, enable);
> >
> > I'm wondering why it's necessary to fetch from guest RAM instead of
> > using vq->notification? It also works for both split and packed
> > queues so the code would be simpler.
>
> To use vq->notification makes sense at the end of the series.
>
> However, at this stage (just routing notifications, not descriptors),
> vhost device is the one updating that flag, not qemu. Since we cannot
> just migrate used ring memory to qemu without migrating descriptors
> ring too, qemu needs to check guest's memory looking for vhost device
> updates on that flag.
>
> I can see how that deserves better documentation or even a better
> name. Also, this function should be in the shadow vq file, not
> virtio.c.
I can't think of a reason why QEMU needs to know the flag value that the
vhost device has set. This flag is a hint to the guest driver indicating
whether the device wants to receive notifications.
Can you explain why QEMU needs to look at the value of the flag?
Stefan
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [RFC PATCH 06/27] virtio: Add virtio_queue_get_used_notify_split
[not found] ` <CAJaqyWd0iRUUW5Hu=U3mwQ4f43kA=bse3EkN4+QauFR4BJwObQ@mail.gmail.com>
@ 2021-03-08 10:46 ` Stefan Hajnoczi
0 siblings, 0 replies; 29+ messages in thread
From: Stefan Hajnoczi @ 2021-03-08 10:46 UTC (permalink / raw)
To: Eugenio Perez Martin
Cc: kvm list, Michael S. Tsirkin, qemu-level, Daniel Daly,
virtualization, Liran Alon, Eli Cohen, Nitin Shrivastav,
Alex Barba, Christophe Fontaine, Lee Ballard, Lars Ganrot,
Rob Miller, Howard Cai, Parav Pandit, vm, Salil Mehta,
Stephen Finucane, Xiao W Wang, Sean Mooney, Jim Harford,
Dmytro Kazantsev, Siwei Liu, Harpreet Singh Anand, Michael Lilja,
Max Gurtovoy
[-- Attachment #1.1: Type: text/plain, Size: 4131 bytes --]
On Tue, Mar 02, 2021 at 07:34:20PM +0100, Eugenio Perez Martin wrote:
> On Tue, Mar 2, 2021 at 12:22 PM Stefan Hajnoczi <stefanha@gmail.com> wrote:
> >
> > On Tue, Jan 12, 2021 at 07:21:27PM +0100, Eugenio Perez Martin wrote:
> > > On Mon, Dec 7, 2020 at 5:58 PM Stefan Hajnoczi <stefanha@gmail.com> wrote:
> > > >
> > > > On Fri, Nov 20, 2020 at 07:50:44PM +0100, Eugenio Pérez wrote:
> > > > > This function is just used for a few commits, so SW LM is developed
> > > > > incrementally, and it is deleted after it is useful.
> > > > >
> > > > > For a few commits, only the events (irqfd, eventfd) are forwarded.
> > > >
> > > > s/eventfd/ioeventfd/ (irqfd is also an eventfd)
> > > >
> > >
> > > Oops, will fix, thanks!
> > >
> > > > > +bool virtio_queue_get_used_notify_split(VirtQueue *vq)
> > > > > +{
> > > > > + VRingMemoryRegionCaches *caches;
> > > > > + hwaddr pa = offsetof(VRingUsed, flags);
> > > > > + uint16_t flags;
> > > > > +
> > > > > + RCU_READ_LOCK_GUARD();
> > > > > +
> > > > > + caches = vring_get_region_caches(vq);
> > > > > + assert(caches);
> > > > > + flags = virtio_lduw_phys_cached(vq->vdev, &caches->used, pa);
> > > > > + return !(VRING_USED_F_NO_NOTIFY & flags);
> > > > > +}
> > > >
> > > > QEMU stores the notification status:
> > > >
> > > > void virtio_queue_set_notification(VirtQueue *vq, int enable)
> > > > {
> > > > vq->notification = enable; <---- here
> > > >
> > > > if (!vq->vring.desc) {
> > > > return;
> > > > }
> > > >
> > > > if (virtio_vdev_has_feature(vq->vdev, VIRTIO_F_RING_PACKED)) {
> > > > virtio_queue_packed_set_notification(vq, enable);
> > > > } else {
> > > > virtio_queue_split_set_notification(vq, enable);
> > > >
> > > > I'm wondering why it's necessary to fetch from guest RAM instead of
> > > > using vq->notification? It also works for both split and packed
> > > > queues so the code would be simpler.
> > >
> > > To use vq->notification makes sense at the end of the series.
> > >
> > > However, at this stage (just routing notifications, not descriptors),
> > > vhost device is the one updating that flag, not qemu. Since we cannot
> > > just migrate used ring memory to qemu without migrating descriptors
> > > ring too, qemu needs to check guest's memory looking for vhost device
> > > updates on that flag.
> > >
> > > I can see how that deserves better documentation or even a better
> > > name. Also, this function should be in the shadow vq file, not
> > > virtio.c.
> >
> > I can't think of a reason why QEMU needs to know the flag value that the
> > vhost device has set. This flag is a hint to the guest driver indicating
> > whether the device wants to receive notifications.
> >
> > Can you explain why QEMU needs to look at the value of the flag?
> >
> > Stefan
>
> My bad, "need" is not the right word: SVQ could just forward the
> notification at this point without checking the flag. Taking into
> account that it's not used in later series, and it's even removed in
> patch 14/27 of this series, I can see that it just adds noise to the
> entire patchset
>
> This function just allows svq to re-check the flag after the guest
> sends the notification. This way svq is able to drop the kick as a
> (premature?) optimization in case the device sets it just after the
> guest sends the kick.
>
> Until patch 13/27, only notifications are forwarded, not buffers. VM
> guest's drivers and vhost device still read and write at usual
> addresses, but ioeventfd and kvmfd are intercepted by qemu. This
> allows us to test if the notification forwarding part is doing ok.
> From patch 14 of this series, svq offers a new vring to the device in
> qemu's VAS, so the former does not need to check the guest's memory
> anymore, and this function can be dropped.
>
> Is it clearer now? Please let me know if I should add something else.
Thanks for explaining. You could drop it to simplify the code. If you
leave it in, please include a comment explaining the purpose.
Thanks,
Stefan
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2021-03-08 10:46 UTC | newest]
Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20201120185105.279030-1-eperezma@redhat.com>
2020-11-25 7:08 ` [RFC PATCH 00/27] vDPA software assisted live migration Jason Wang
[not found] ` <CAJaqyWf+6yoMHJuLv=QGLMP4egmdm722=V2kKJ_aiQAfCCQOFw@mail.gmail.com>
2020-11-26 3:07 ` Jason Wang
[not found] ` <20201120185105.279030-24-eperezma@redhat.com>
2020-11-27 15:29 ` [RFC PATCH 23/27] vhost: unmap qemu's shadow virtqueues on sw " Stefano Garzarella
2020-11-27 15:44 ` [RFC PATCH 00/27] vDPA software assisted " Stefano Garzarella
[not found] ` <20201120185105.279030-3-eperezma@redhat.com>
2020-12-07 16:19 ` [RFC PATCH 02/27] vhost: Add device callback in vhost_migration_log Stefan Hajnoczi
[not found] ` <20201120185105.279030-5-eperezma@redhat.com>
2020-12-07 16:43 ` [RFC PATCH 04/27] vhost: add vhost_kernel_set_vring_enable Stefan Hajnoczi
[not found] ` <CAJaqyWd5oAJ4kJOhyDz+1KNvwzqJi3NO+5Z7X6W5ju2Va=LTMQ@mail.gmail.com>
2020-12-09 16:08 ` Stefan Hajnoczi
[not found] ` <20201120185105.279030-6-eperezma@redhat.com>
2020-12-07 16:52 ` [RFC PATCH 05/27] vhost: Add hdev->dev.sw_lm_vq_handler Stefan Hajnoczi
[not found] ` <CAJaqyWfSUHD0MU=1yfU1N6pZ4TU7prxyoG6NY-VyNGt=MO9H4g@mail.gmail.com>
2020-12-10 11:30 ` Stefan Hajnoczi
[not found] ` <20201120185105.279030-7-eperezma@redhat.com>
2020-12-07 16:58 ` [RFC PATCH 06/27] virtio: Add virtio_queue_get_used_notify_split Stefan Hajnoczi
[not found] ` <CAJaqyWc4oLzL02GKpPSwEGRxK+UxjOGBAPLzrgrgKRZd9C81GA@mail.gmail.com>
2021-03-02 11:22 ` Stefan Hajnoczi
[not found] ` <CAJaqyWd0iRUUW5Hu=U3mwQ4f43kA=bse3EkN4+QauFR4BJwObQ@mail.gmail.com>
2021-03-08 10:46 ` Stefan Hajnoczi
[not found] ` <20201120185105.279030-8-eperezma@redhat.com>
2020-12-07 17:42 ` [RFC PATCH 07/27] vhost: Route guest->host notification through qemu Stefan Hajnoczi
[not found] ` <CAJaqyWfiMsRP9FgSv7cOj=3jHx=DJS7hRJTMbRcTTHHWng0eKg@mail.gmail.com>
2020-12-10 11:50 ` Stefan Hajnoczi
[not found] ` <20201120185105.279030-9-eperezma@redhat.com>
2020-12-08 7:20 ` [RFC PATCH 08/27] vhost: Add a flag for software assisted Live Migration Stefan Hajnoczi
[not found] ` <20201120185105.279030-10-eperezma@redhat.com>
2020-12-08 7:34 ` [RFC PATCH 09/27] vhost: Route host->guest notification through qemu Stefan Hajnoczi
[not found] ` <20201120185105.279030-14-eperezma@redhat.com>
2020-12-08 8:16 ` [RFC PATCH 13/27] vhost: Send buffers to device Stefan Hajnoczi
[not found] ` <CAJaqyWf13ta5MtzmTUz2N5XnQ+ebqFPYAivdggL64LEQAf=y+A@mail.gmail.com>
2020-12-10 11:55 ` Stefan Hajnoczi
[not found] ` <20201120185105.279030-11-eperezma@redhat.com>
2020-12-08 7:49 ` [RFC PATCH 10/27] vhost: Allocate shadow vring Stefan Hajnoczi
2020-12-08 8:17 ` Stefan Hajnoczi
[not found] ` <20201120185105.279030-17-eperezma@redhat.com>
2020-12-08 8:25 ` [RFC PATCH 16/27] virtio: Expose virtqueue_alloc_element Stefan Hajnoczi
[not found] ` <CAJaqyWdN7iudf8mDN4k4Fs9j1x+ztZARuBbinPHD3ZQSMH1pyQ@mail.gmail.com>
2020-12-10 11:57 ` Stefan Hajnoczi
[not found] ` <20201120185105.279030-19-eperezma@redhat.com>
2020-12-08 8:41 ` [RFC PATCH 18/27] vhost: add vhost_vring_poll_rcu Stefan Hajnoczi
[not found] ` <20201120185105.279030-21-eperezma@redhat.com>
2020-12-08 8:50 ` [RFC PATCH 20/27] vhost: Return used buffers Stefan Hajnoczi
[not found] ` <20201120185105.279030-25-eperezma@redhat.com>
2020-12-08 9:02 ` [RFC PATCH 24/27] vhost: iommu changes Stefan Hajnoczi
2020-12-08 9:37 ` [RFC PATCH 00/27] vDPA software assisted live migration Stefan Hajnoczi
2020-12-09 9:26 ` Jason Wang
2020-12-09 15:57 ` Stefan Hajnoczi
2020-12-10 9:12 ` Jason Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).