virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: "Eugenio Pérez" <eperezma@redhat.com>, qemu-devel@nongnu.org
Cc: Parav Pandit <parav@mellanox.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	virtualization@lists.linux-foundation.org,
	Harpreet Singh Anand <hanand@xilinx.com>,
	Xiao W Wang <xiao.w.wang@intel.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Eli Cohen <eli@mellanox.com>, Eric Blake <eblake@redhat.com>,
	Michael Lilja <ml@napatech.com>
Subject: Re: [RFC v3 15/29] vhost: Add enable_custom_iommu to VhostOps
Date: Mon, 31 May 2021 17:01:48 +0800	[thread overview]
Message-ID: <8ba8f8fa-cab8-24c6-5226-b5ae372cd84b@redhat.com> (raw)
In-Reply-To: <20210519162903.1172366-16-eperezma@redhat.com>


在 2021/5/20 上午12:28, Eugenio Pérez 写道:
> This operation enable the backend-specific IOTLB entries.
>
> If a backend support this, it start managing its own entries, and vhost
> can disable it through this operation and recover control.
>
> Every enable/disable operation must also clear all IOTLB device entries.
>
> At the moment, the only backend that does so is vhost-vdpa. To fully
> support these, vdpa needs also to expose a way for vhost subsystem to
> map and unmap entries. This will be done in future commits.
>
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>


I think there's probably no need to introduce this helper.

Instead, we can introduce ops like shadow_vq_start()/stop(). Then the 
details like this could be hided there.

(And hide the backend deatils (avoid calling vhost_vdpa_dma_map()) 
directly from the vhost.c)

Thanks


> ---
>   include/hw/virtio/vhost-backend.h | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-backend.h
> index bcb112c166..f8eed2ace5 100644
> --- a/include/hw/virtio/vhost-backend.h
> +++ b/include/hw/virtio/vhost-backend.h
> @@ -128,6 +128,9 @@ typedef bool (*vhost_force_iommu_op)(struct vhost_dev *dev);
>   
>   typedef int (*vhost_vring_pause_op)(struct vhost_dev *dev);
>   
> +typedef int (*vhost_enable_custom_iommu_op)(struct vhost_dev *dev,
> +                                            bool enable);
> +
>   typedef int (*vhost_get_iova_range)(struct vhost_dev *dev,
>                                       hwaddr *first, hwaddr *last);
>   
> @@ -177,6 +180,7 @@ typedef struct VhostOps {
>       vhost_get_device_id_op vhost_get_device_id;
>       vhost_vring_pause_op vhost_vring_pause;
>       vhost_force_iommu_op vhost_force_iommu;
> +    vhost_enable_custom_iommu_op vhost_enable_custom_iommu;
>       vhost_get_iova_range vhost_get_iova_range;
>   } VhostOps;
>   

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

  parent reply	other threads:[~2021-05-31  9:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210519162903.1172366-1-eperezma@redhat.com>
2021-05-24  9:38 ` [RFC v3 00/29] vDPA software assisted live migration Michael S. Tsirkin
     [not found]   ` <CAJaqyWcVm55qjaDpQsuLzaY0FCzjW2ARyvOWCdfS9RJNoOM7Aw@mail.gmail.com>
2021-05-24 11:29     ` Michael S. Tsirkin
2021-07-19 14:13       ` Stefan Hajnoczi
2021-05-25  0:09     ` Jason Wang
     [not found] ` <20210519162903.1172366-7-eperezma@redhat.com>
2021-05-26  1:06   ` [RFC v3 06/29] virtio-net: Honor VIRTIO_CONFIG_S_DEVICE_STOPPED Jason Wang
2021-05-26  1:10     ` Jason Wang
     [not found]       ` <CAJaqyWeV+za=xeKHb9vn=Y+0mfekCb8w5dmWNMgzQ6uOtU3jxw@mail.gmail.com>
2021-06-03  3:12         ` Jason Wang
     [not found] ` <20210519162903.1172366-14-eperezma@redhat.com>
2021-05-26  1:14   ` [RFC v3 13/29] vhost: Add vhost_get_iova_range operation Jason Wang
     [not found]     ` <CAJaqyWeL-0KjsBcXs1tYdvn9xLAK-x0Sb+RFuzPgngXxYtF9uw@mail.gmail.com>
2021-05-27  4:51       ` Jason Wang
     [not found]         ` <CAJaqyWf+=-nwOsS=zZEhmiTA_TotVMQibUgE0grCMZgXVDNpxg@mail.gmail.com>
2021-06-03  3:13           ` Jason Wang
     [not found] ` <20210519162903.1172366-16-eperezma@redhat.com>
2021-05-31  9:01   ` Jason Wang [this message]
     [not found] ` <20210519162903.1172366-22-eperezma@redhat.com>
2021-05-31  9:40   ` [RFC v3 21/29] vhost: Add VhostIOVATree Jason Wang
     [not found]     ` <CAJaqyWfKTiKeKLLjB9qDf4qJwL420YRo6FrJgozp_tn0Z57pOA@mail.gmail.com>
2021-07-14  3:04       ` Jason Wang
     [not found]         ` <CAJaqyWdZtvUM0_O1BiZNMkkgJEa_yrOh=XDgjTt2byZwU9J8tQ@mail.gmail.com>
     [not found]           ` <CAJaqyWePZSo8-q=d3fWBGUwgM8EfHHVYgR_KGKxjcgeZn5C=Vw@mail.gmail.com>
2021-07-14  9:33             ` Jason Wang
     [not found] ` <20210519162903.1172366-18-eperezma@redhat.com>
2021-06-02  9:50   ` [RFC v3 17/29] vhost: Shadow virtqueue buffers forwarding Jason Wang
     [not found]     ` <CAJaqyWf7M1fjrd+kr-2bcYj+ibrqZVoREZuTiJ0i+p6dA+Dukw@mail.gmail.com>
2021-06-03  3:34       ` Jason Wang
     [not found] ` <20210519162903.1172366-26-eperezma@redhat.com>
2021-06-02  9:51   ` [RFC v3 25/29] vhost: Add custom IOTLB translations to SVQ Jason Wang
     [not found]     ` <CAJaqyWc7OWeQnXHihY=mYp=N+rRJLcbFUsJA-OszD6tyr6v-FQ@mail.gmail.com>
2021-06-03  3:39       ` Jason Wang
2021-06-02  9:59 ` [RFC v3 00/29] vDPA software assisted live migration Jason Wang

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=8ba8f8fa-cab8-24c6-5226-b5ae372cd84b@redhat.com \
    --to=jasowang@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eli@mellanox.com \
    --cc=eperezma@redhat.com \
    --cc=hanand@xilinx.com \
    --cc=ml@napatech.com \
    --cc=mst@redhat.com \
    --cc=parav@mellanox.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xiao.w.wang@intel.com \
    /path/to/YOUR_REPLY

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

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