public inbox for virtualization@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Eli Cohen <elic@nvidia.com>
Cc: shahafs@mellanox.com, lulu@redhat.com, mst@redhat.com,
	mhabets@solarflare.com, vmireyno@marvell.com,
	linux-kernel@vger.kernel.org, gdawar@xilinx.com,
	virtualization@lists.linux-foundation.org, eperezma@redhat.com,
	hanand@xilinx.com, zhangweining@ruijie.com.cn, eli@mellanox.com,
	saugatm@xilinx.com, lingshan.zhu@intel.com,
	rob.miller@broadcom.com
Subject: Re: [PATCH V2 2/3] vhost: vdpa: report iova range
Date: Mon, 31 Aug 2020 16:38:40 +0800	[thread overview]
Message-ID: <96f2367e-8b9f-9ee7-a45e-56e9162e92c6@redhat.com> (raw)
In-Reply-To: <20200823064035.GB147797@mtl-vdi-166.wap.labs.mlnx>


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


>
>> +}

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

  parent reply	other threads:[~2020-08-31  8:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21  9:28 [PATCH V2 0/3] vDPA: API for reporting IOVA range Jason Wang
2020-08-21  9:28 ` [PATCH V2 1/3] vdpa: introduce config op to get valid iova range Jason Wang
2020-08-21  9:28 ` [PATCH V2 2/3] vhost: vdpa: report " Jason Wang
     [not found]   ` <20200823064035.GB147797@mtl-vdi-166.wap.labs.mlnx>
2020-08-31  8:38     ` Jason Wang [this message]
2020-08-21  9:28 ` [PATCH V2 3/3] vdpa_sim: implement get_iova_range() Jason Wang
2020-08-21 10:33   ` kernel test robot
2020-08-21 12:20   ` kernel test robot
2020-08-21 12:20   ` [RFC PATCH] vdpa_sim: vdpasim_get_iova_range() can be static kernel test robot
2020-08-21 12:51   ` [PATCH V2 3/3] vdpa_sim: implement get_iova_range() kernel test robot
2020-08-21 12:59   ` kernel test robot

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=96f2367e-8b9f-9ee7-a45e-56e9162e92c6@redhat.com \
    --to=jasowang@redhat.com \
    --cc=eli@mellanox.com \
    --cc=elic@nvidia.com \
    --cc=eperezma@redhat.com \
    --cc=gdawar@xilinx.com \
    --cc=hanand@xilinx.com \
    --cc=lingshan.zhu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lulu@redhat.com \
    --cc=mhabets@solarflare.com \
    --cc=mst@redhat.com \
    --cc=rob.miller@broadcom.com \
    --cc=saugatm@xilinx.com \
    --cc=shahafs@mellanox.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=vmireyno@marvell.com \
    --cc=zhangweining@ruijie.com.cn \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox