Message ID | 20230320161959.650841-2-lulu@redhat.com |
---|---|
State | New |
Headers | show |
Series | vhost-vdpa: add support for vIOMMU | expand |
On Tue, Mar 21, 2023 at 12:20 AM Cindy Lu <lulu@redhat.com> wrote: > > To support vIOMMU in vdpa, need to exposed the function > vhost_dev_has_iommu, vdpa will use this function to check > if vIOMMU enable. > > Signed-off-by: Cindy Lu <lulu@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Thanks > --- > hw/virtio/vhost.c | 2 +- > include/hw/virtio/vhost.h | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c > index a266396576..fd746b085b 100644 > --- a/hw/virtio/vhost.c > +++ b/hw/virtio/vhost.c > @@ -107,7 +107,7 @@ static void vhost_dev_sync_region(struct vhost_dev *dev, > } > } > > -static bool vhost_dev_has_iommu(struct vhost_dev *dev) > +bool vhost_dev_has_iommu(struct vhost_dev *dev) > { > VirtIODevice *vdev = dev->vdev; > > diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h > index a52f273347..f7f10c8fb7 100644 > --- a/include/hw/virtio/vhost.h > +++ b/include/hw/virtio/vhost.h > @@ -336,4 +336,5 @@ int vhost_dev_set_inflight(struct vhost_dev *dev, > struct vhost_inflight *inflight); > int vhost_dev_get_inflight(struct vhost_dev *dev, uint16_t queue_size, > struct vhost_inflight *inflight); > +bool vhost_dev_has_iommu(struct vhost_dev *dev); > #endif > -- > 2.34.3 >
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index a266396576..fd746b085b 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -107,7 +107,7 @@ static void vhost_dev_sync_region(struct vhost_dev *dev, } } -static bool vhost_dev_has_iommu(struct vhost_dev *dev) +bool vhost_dev_has_iommu(struct vhost_dev *dev) { VirtIODevice *vdev = dev->vdev; diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index a52f273347..f7f10c8fb7 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio/vhost.h @@ -336,4 +336,5 @@ int vhost_dev_set_inflight(struct vhost_dev *dev, struct vhost_inflight *inflight); int vhost_dev_get_inflight(struct vhost_dev *dev, uint16_t queue_size, struct vhost_inflight *inflight); +bool vhost_dev_has_iommu(struct vhost_dev *dev); #endif
To support vIOMMU in vdpa, need to exposed the function vhost_dev_has_iommu, vdpa will use this function to check if vIOMMU enable. Signed-off-by: Cindy Lu <lulu@redhat.com> --- hw/virtio/vhost.c | 2 +- include/hw/virtio/vhost.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)