]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
virtio: VIRTIO_F_IOMMU_PLATFORM -> VIRTIO_F_ACCESS_PLATFORM
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 24 Jun 2020 22:24:33 +0000 (18:24 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 3 Aug 2020 20:11:42 +0000 (16:11 -0400)
Rename the bit to match latest virtio spec.
Add a compat macro to avoid breaking existing userspace.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
arch/um/drivers/virtio_uml.c
drivers/vdpa/ifcvf/ifcvf_base.h
drivers/vdpa/vdpa_sim/vdpa_sim.c
drivers/vhost/net.c
drivers/vhost/vdpa.c
drivers/virtio/virtio_balloon.c
drivers/virtio/virtio_ring.c
include/linux/virtio_config.h
include/uapi/linux/virtio_config.h
tools/virtio/linux/virtio_config.h

index 351aee52aca630b28b964fb7e1f5a40c7586dfa2..a6c4bb6c2c012df208eab83d43cfb78a16bd63fe 100644 (file)
@@ -385,7 +385,7 @@ static irqreturn_t vu_req_interrupt(int irq, void *data)
                }
                break;
        case VHOST_USER_SLAVE_IOTLB_MSG:
-               /* not supported - VIRTIO_F_IOMMU_PLATFORM */
+               /* not supported - VIRTIO_F_ACCESS_PLATFORM */
        case VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG:
                /* not supported - VHOST_USER_PROTOCOL_F_HOST_NOTIFIER */
        default:
index f4554412e607fb0d5200363269c0690efae04531..24af422b5a3eeeb97e0eedcd45cbc0c0deedc268 100644 (file)
@@ -29,7 +29,7 @@
                 (1ULL << VIRTIO_F_VERSION_1)                   | \
                 (1ULL << VIRTIO_NET_F_STATUS)                  | \
                 (1ULL << VIRTIO_F_ORDER_PLATFORM)              | \
-                (1ULL << VIRTIO_F_IOMMU_PLATFORM)              | \
+                (1ULL << VIRTIO_F_ACCESS_PLATFORM)             | \
                 (1ULL << VIRTIO_NET_F_MRG_RXBUF))
 
 /* Only one queue pair for now. */
index c7334cc65bb254897438767497b6b77e766ba085..a9bc5e0fb353e41e8bb6db21456d9a219e82af79 100644 (file)
@@ -55,7 +55,7 @@ struct vdpasim_virtqueue {
 
 static u64 vdpasim_features = (1ULL << VIRTIO_F_ANY_LAYOUT) |
                              (1ULL << VIRTIO_F_VERSION_1)  |
-                             (1ULL << VIRTIO_F_IOMMU_PLATFORM);
+                             (1ULL << VIRTIO_F_ACCESS_PLATFORM);
 
 /* State of each vdpasim device */
 struct vdpasim {
@@ -450,7 +450,7 @@ static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features)
        struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
 
        /* DMA mapping must be done by driver */
-       if (!(features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)))
+       if (!(features & (1ULL << VIRTIO_F_ACCESS_PLATFORM)))
                return -EINVAL;
 
        vdpasim->features = features & vdpasim_features;
index e992decfec534a7ed6659b08854ece73f1aa7602..8e0921d3805d418ca98497e22a09c91144bc1c7c 100644 (file)
@@ -73,7 +73,7 @@ enum {
        VHOST_NET_FEATURES = VHOST_FEATURES |
                         (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) |
                         (1ULL << VIRTIO_NET_F_MRG_RXBUF) |
-                        (1ULL << VIRTIO_F_IOMMU_PLATFORM)
+                        (1ULL << VIRTIO_F_ACCESS_PLATFORM)
 };
 
 enum {
@@ -1653,7 +1653,7 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features)
            !vhost_log_access_ok(&n->dev))
                goto out_unlock;
 
-       if ((features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) {
+       if ((features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) {
                if (vhost_init_device_iotlb(&n->dev, true))
                        goto out_unlock;
        }
index a54b60d6623f0716f0b4b1aa6894239f74132b81..18869a35d40840de6385dfa63777be1ce8b1adf2 100644 (file)
@@ -31,7 +31,7 @@ enum {
                (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) |
                (1ULL << VIRTIO_F_ANY_LAYOUT) |
                (1ULL << VIRTIO_F_VERSION_1) |
-               (1ULL << VIRTIO_F_IOMMU_PLATFORM) |
+               (1ULL << VIRTIO_F_ACCESS_PLATFORM) |
                (1ULL << VIRTIO_F_RING_PACKED) |
                (1ULL << VIRTIO_F_ORDER_PLATFORM) |
                (1ULL << VIRTIO_RING_F_INDIRECT_DESC) |
index 8be02f333b7a3b393ab367d8becce8cf5ca71b19..54fd989f93531a43a534cccae951a98c6adb484a 100644 (file)
@@ -1129,7 +1129,7 @@ static int virtballoon_validate(struct virtio_device *vdev)
        else if (!virtio_has_feature(vdev, VIRTIO_BALLOON_F_PAGE_POISON))
                __virtio_clear_bit(vdev, VIRTIO_BALLOON_F_REPORTING);
 
-       __virtio_clear_bit(vdev, VIRTIO_F_IOMMU_PLATFORM);
+       __virtio_clear_bit(vdev, VIRTIO_F_ACCESS_PLATFORM);
        return 0;
 }
 
index 58b96baa8d488a94da858688147c5f9dd6ae4d30..a1a5c2a914263052e95adda449c6fb37d734358a 100644 (file)
@@ -2225,7 +2225,7 @@ void vring_transport_features(struct virtio_device *vdev)
                        break;
                case VIRTIO_F_VERSION_1:
                        break;
-               case VIRTIO_F_IOMMU_PLATFORM:
+               case VIRTIO_F_ACCESS_PLATFORM:
                        break;
                case VIRTIO_F_RING_PACKED:
                        break;
index bb4cc49107503c23c09ad3413189d5de29657a42..f2cc2a0df17421510fa6c9c75945bb8c341fda8b 100644 (file)
@@ -171,7 +171,7 @@ 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);
+       return !virtio_has_feature(vdev, VIRTIO_F_ACCESS_PLATFORM);
 }
 
 static inline
index ff8e7dc9d4dd22f4ce6f98b77fe34142bf2ec63b..b5eda06f0d57f3997a4a1e8dea6bbd7edbd1987d 100644 (file)
 #define VIRTIO_F_VERSION_1             32
 
 /*
- * If clear - device has the IOMMU bypass quirk feature.
- * If set - use platform tools to detect the IOMMU.
+ * If clear - device has the platform DMA (e.g. IOMMU) bypass quirk feature.
+ * If set - use platform DMA tools to access the memory.
  *
  * Note the reverse polarity (compared to most other features),
  * this is for compatibility with legacy systems.
  */
-#define VIRTIO_F_IOMMU_PLATFORM                33
+#define VIRTIO_F_ACCESS_PLATFORM       33
+#ifndef __KERNEL__
+/* Legacy name for VIRTIO_F_ACCESS_PLATFORM (for compatibility with old userspace) */
+#define VIRTIO_F_IOMMU_PLATFORM                VIRTIO_F_ACCESS_PLATFORM
+#endif /* __KERNEL__ */
 
 /* This feature indicates support for the packed virtqueue layout. */
 #define VIRTIO_F_RING_PACKED           34
index dbf14c1e2188d9bcadf200e0ea9e8f33ed569987..f99ae42668e0d53d261541c398f9f3e0b8cbc249 100644 (file)
@@ -51,7 +51,7 @@ 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);
+       return !virtio_has_feature(vdev, VIRTIO_F_ACCESS_PLATFORM);
 }
 
 static inline bool virtio_is_little_endian(struct virtio_device *vdev)