aboutsummaryrefslogtreecommitdiff
path: root/tools/virtio/linux/virtio_config.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2016-08-15 04:50:55 +0300
committerMichael S. Tsirkin <mst@redhat.com>2016-08-15 05:05:51 +0300
commit6be3ffaa0e15c64f560904b025f5c50bef5886f9 (patch)
tree73aab67c5d66b71b6e6ca0a9f38dd37e031b0049 /tools/virtio/linux/virtio_config.h
parent446374d7c7f89603d8151b56824e2cac85ed8e0d (diff)
downloadlinux-stericsson-6be3ffaa0e15c64f560904b025f5c50bef5886f9.tar.gz
tools/virtio: add dma stubs
Fixes build after recent IOMMU-related changes, mustly by adding more stubs. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tools/virtio/linux/virtio_config.h')
-rw-r--r--tools/virtio/linux/virtio_config.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/virtio/linux/virtio_config.h b/tools/virtio/linux/virtio_config.h
index 57a6964a1e35..9ba11815e0a1 100644
--- a/tools/virtio/linux/virtio_config.h
+++ b/tools/virtio/linux/virtio_config.h
@@ -40,6 +40,19 @@ static inline void __virtio_clear_bit(struct virtio_device *vdev,
#define virtio_has_feature(dev, feature) \
(__virtio_test_bit((dev), feature))
+/**
+ * virtio_has_iommu_quirk - determine whether this device has the iommu quirk
+ * @vdev: the device
+ */
+static inline bool virtio_has_iommu_quirk(const struct virtio_device *vdev)
+{
+ /*
+ * Note the reverse polarity of the quirk feature (compared to most
+ * other features), this is for compatibility with legacy systems.
+ */
+ return !virtio_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM);
+}
+
static inline bool virtio_is_little_endian(struct virtio_device *vdev)
{
return virtio_has_feature(vdev, VIRTIO_F_VERSION_1) ||