]> git.baikalelectronics.ru Git - kernel.git/commit
vhost: vdpa: report iova range
authorJason Wang <jasowang@redhat.com>
Fri, 23 Oct 2020 09:00:42 +0000 (17:00 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 23 Oct 2020 15:55:28 +0000 (11:55 -0400)
commit815d702206802837145e006c10ca144d11c6575e
treefe5eef605b984025089f157447ff13c61e5fba94
parent407595b666b9373c09459d3c6f911032b4eea17c
vhost: vdpa: report iova range

This patch introduces a new ioctl for vhost-vdpa device that can
report the iova range by the device.

For device that implements get_iova_range() method, we fetch it from
the vDPA device. If device doesn't implement get_iova_range() but
depends on platform IOMMU, we will query via DOMAIN_ATTR_GEOMETRY,
otherwise [0, ULLONG_MAX] is assumed.

For safety, this patch also rules out the map request which is not in
the valid range.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20201023090043.14430-3-jasowang@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/vdpa.c
include/uapi/linux/vhost.h
include/uapi/linux/vhost_types.h