Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

virtio: VIRTIO_F_IOMMU_PLATFORM -> VIRTIO_F_ACCESS_PLATFORM

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>

+18 -14
+1 -1
arch/um/drivers/virtio_uml.c
··· 385 385 } 386 386 break; 387 387 case VHOST_USER_SLAVE_IOTLB_MSG: 388 - /* not supported - VIRTIO_F_IOMMU_PLATFORM */ 388 + /* not supported - VIRTIO_F_ACCESS_PLATFORM */ 389 389 case VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG: 390 390 /* not supported - VHOST_USER_PROTOCOL_F_HOST_NOTIFIER */ 391 391 default:
+1 -1
drivers/vdpa/ifcvf/ifcvf_base.h
··· 29 29 (1ULL << VIRTIO_F_VERSION_1) | \ 30 30 (1ULL << VIRTIO_NET_F_STATUS) | \ 31 31 (1ULL << VIRTIO_F_ORDER_PLATFORM) | \ 32 - (1ULL << VIRTIO_F_IOMMU_PLATFORM) | \ 32 + (1ULL << VIRTIO_F_ACCESS_PLATFORM) | \ 33 33 (1ULL << VIRTIO_NET_F_MRG_RXBUF)) 34 34 35 35 /* Only one queue pair for now. */
+2 -2
drivers/vdpa/vdpa_sim/vdpa_sim.c
··· 55 55 56 56 static u64 vdpasim_features = (1ULL << VIRTIO_F_ANY_LAYOUT) | 57 57 (1ULL << VIRTIO_F_VERSION_1) | 58 - (1ULL << VIRTIO_F_IOMMU_PLATFORM); 58 + (1ULL << VIRTIO_F_ACCESS_PLATFORM); 59 59 60 60 /* State of each vdpasim device */ 61 61 struct vdpasim { ··· 450 450 struct vdpasim *vdpasim = vdpa_to_sim(vdpa); 451 451 452 452 /* DMA mapping must be done by driver */ 453 - if (!(features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) 453 + if (!(features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) 454 454 return -EINVAL; 455 455 456 456 vdpasim->features = features & vdpasim_features;
+2 -2
drivers/vhost/net.c
··· 73 73 VHOST_NET_FEATURES = VHOST_FEATURES | 74 74 (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) | 75 75 (1ULL << VIRTIO_NET_F_MRG_RXBUF) | 76 - (1ULL << VIRTIO_F_IOMMU_PLATFORM) 76 + (1ULL << VIRTIO_F_ACCESS_PLATFORM) 77 77 }; 78 78 79 79 enum { ··· 1653 1653 !vhost_log_access_ok(&n->dev)) 1654 1654 goto out_unlock; 1655 1655 1656 - if ((features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) { 1656 + if ((features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) { 1657 1657 if (vhost_init_device_iotlb(&n->dev, true)) 1658 1658 goto out_unlock; 1659 1659 }
+1 -1
drivers/vhost/vdpa.c
··· 31 31 (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) | 32 32 (1ULL << VIRTIO_F_ANY_LAYOUT) | 33 33 (1ULL << VIRTIO_F_VERSION_1) | 34 - (1ULL << VIRTIO_F_IOMMU_PLATFORM) | 34 + (1ULL << VIRTIO_F_ACCESS_PLATFORM) | 35 35 (1ULL << VIRTIO_F_RING_PACKED) | 36 36 (1ULL << VIRTIO_F_ORDER_PLATFORM) | 37 37 (1ULL << VIRTIO_RING_F_INDIRECT_DESC) |
+1 -1
drivers/virtio/virtio_balloon.c
··· 1129 1129 else if (!virtio_has_feature(vdev, VIRTIO_BALLOON_F_PAGE_POISON)) 1130 1130 __virtio_clear_bit(vdev, VIRTIO_BALLOON_F_REPORTING); 1131 1131 1132 - __virtio_clear_bit(vdev, VIRTIO_F_IOMMU_PLATFORM); 1132 + __virtio_clear_bit(vdev, VIRTIO_F_ACCESS_PLATFORM); 1133 1133 return 0; 1134 1134 } 1135 1135
+1 -1
drivers/virtio/virtio_ring.c
··· 2225 2225 break; 2226 2226 case VIRTIO_F_VERSION_1: 2227 2227 break; 2228 - case VIRTIO_F_IOMMU_PLATFORM: 2228 + case VIRTIO_F_ACCESS_PLATFORM: 2229 2229 break; 2230 2230 case VIRTIO_F_RING_PACKED: 2231 2231 break;
+1 -1
include/linux/virtio_config.h
··· 171 171 * Note the reverse polarity of the quirk feature (compared to most 172 172 * other features), this is for compatibility with legacy systems. 173 173 */ 174 - return !virtio_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM); 174 + return !virtio_has_feature(vdev, VIRTIO_F_ACCESS_PLATFORM); 175 175 } 176 176 177 177 static inline
+7 -3
include/uapi/linux/virtio_config.h
··· 67 67 #define VIRTIO_F_VERSION_1 32 68 68 69 69 /* 70 - * If clear - device has the IOMMU bypass quirk feature. 71 - * If set - use platform tools to detect the IOMMU. 70 + * If clear - device has the platform DMA (e.g. IOMMU) bypass quirk feature. 71 + * If set - use platform DMA tools to access the memory. 72 72 * 73 73 * Note the reverse polarity (compared to most other features), 74 74 * this is for compatibility with legacy systems. 75 75 */ 76 - #define VIRTIO_F_IOMMU_PLATFORM 33 76 + #define VIRTIO_F_ACCESS_PLATFORM 33 77 + #ifndef __KERNEL__ 78 + /* Legacy name for VIRTIO_F_ACCESS_PLATFORM (for compatibility with old userspace) */ 79 + #define VIRTIO_F_IOMMU_PLATFORM VIRTIO_F_ACCESS_PLATFORM 80 + #endif /* __KERNEL__ */ 77 81 78 82 /* This feature indicates support for the packed virtqueue layout. */ 79 83 #define VIRTIO_F_RING_PACKED 34
+1 -1
tools/virtio/linux/virtio_config.h
··· 51 51 * Note the reverse polarity of the quirk feature (compared to most 52 52 * other features), this is for compatibility with legacy systems. 53 53 */ 54 - return !virtio_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM); 54 + return !virtio_has_feature(vdev, VIRTIO_F_ACCESS_PLATFORM); 55 55 } 56 56 57 57 static inline bool virtio_is_little_endian(struct virtio_device *vdev)