[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <96f2367e-8b9f-9ee7-a45e-56e9162e92c6@redhat.com>
Date: Mon, 31 Aug 2020 16:38:40 +0800
From: Jason Wang <jasowang@...hat.com>
To: Eli Cohen <elic@...dia.com>
Cc: mst@...hat.com, virtualization@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org, rob.miller@...adcom.com,
lingshan.zhu@...el.com, eperezma@...hat.com, lulu@...hat.com,
shahafs@...lanox.com, hanand@...inx.com, mhabets@...arflare.com,
gdawar@...inx.com, saugatm@...inx.com, vmireyno@...vell.com,
zhangweining@...jie.com.cn, eli@...lanox.com
Subject: Re: [PATCH V2 2/3] vhost: vdpa: report iova range
On 2020/8/23 下午2:40, Eli Cohen wrote:
>> +static void vhost_vdpa_set_iova_range(struct vhost_vdpa *v)
>> +{
>> + struct vdpa_iova_range *range = &v->range;
>> + struct iommu_domain_geometry geo;
>> + struct vdpa_device *vdpa = v->vdpa;
>> + const struct vdpa_config_ops *ops = vdpa->config;
>> +
>> + if (ops->get_iova_range) {
>> + *range = ops->get_iova_range(vdpa);
>> + } else if (v->domain &&
>> + !iommu_domain_get_attr(v->domain,
>> + DOMAIN_ATTR_GEOMETRY, &geo) &&
>> + geo.force_aperture) {
>> + range->first = geo.aperture_start;
>> + range->last = geo.aperture_end;
>> + } else {
>> + range->first = 0;
>> + range->last = ULLONG_MAX;
>> + }
> Shouldn't we require drivers that publish VIRTIO_F_ACCESS_PLATFORM to
> implement get_iova_range?
Probably not, since ACCESS_PLATFORM does not exclude the device that
depends on the chipset IOMMU to work. So in that case, we should query
IOMMU driver instead of vDPA device driver.
Thanks
>
>> +}
Powered by blists - more mailing lists