History

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.

Michael S. Tsirkin committed 6 years ago

Commit 321bd211 parent bcf876810 files · +18 −14Browse files

Unified · Split

10 files
  1. arch/um/drivers/virtio_uml.c +1 −1
  2. drivers/vdpa/ifcvf/ifcvf_base.h +1 −1
  3. drivers/vdpa/vdpa_sim/vdpa_sim.c +2 −2
  4. drivers/vhost/net.c +2 −2
  5. drivers/vhost/vdpa.c +1 −1
  6. drivers/virtio/virtio_balloon.c +1 −1
  7. drivers/virtio/virtio_ring.c +1 −1
  8. include/linux/virtio_config.h +1 −1
  9. include/uapi/linux/virtio_config.h +7 −3
  10. tools/virtio/linux/virtio_config.h +1 −1
arch/um/drivers/virtio_uml.c+1−1
@@ -385,7 +385,7 @@ static irqreturn_t vu_req_interrupt(int irq, void *data) · 384 unmodified lines
385 }385 }
386 break;386 break;
387 case VHOST_USER_SLAVE_IOTLB_MSG:387 case VHOST_USER_SLAVE_IOTLB_MSG:
388 /* not supported - VIRTIO_F_IOMMU_PLATFORM */388 /* not supported - VIRTIO_F_ACCESS_PLATFORM */
389 case VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG:389 case VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG:
390 /* not supported - VHOST_USER_PROTOCOL_F_HOST_NOTIFIER */390 /* not supported - VHOST_USER_PROTOCOL_F_HOST_NOTIFIER */
391 default:391 default:
drivers/vdpa/ifcvf/ifcvf_base.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29 (1ULL << VIRTIO_F_VERSION_1) | \29 (1ULL << VIRTIO_F_VERSION_1) | \
30 (1ULL << VIRTIO_NET_F_STATUS) | \30 (1ULL << VIRTIO_NET_F_STATUS) | \
31 (1ULL << VIRTIO_F_ORDER_PLATFORM) | \31 (1ULL << VIRTIO_F_ORDER_PLATFORM) | \
32 (1ULL << VIRTIO_F_IOMMU_PLATFORM) | \32 (1ULL << VIRTIO_F_ACCESS_PLATFORM) | \
33 (1ULL << VIRTIO_NET_F_MRG_RXBUF))33 (1ULL << VIRTIO_NET_F_MRG_RXBUF))
34 34
35/* Only one queue pair for now. */35/* Only one queue pair for now. */
drivers/vdpa/vdpa_sim/vdpa_sim.c+2−2
@@ -55,7 +55,7 @@ struct vdpasim_virtqueue { · 54 unmodified lines
55 55
56static u64 vdpasim_features = (1ULL << VIRTIO_F_ANY_LAYOUT) |56static u64 vdpasim_features = (1ULL << VIRTIO_F_ANY_LAYOUT) |
57 (1ULL << VIRTIO_F_VERSION_1) |57 (1ULL << VIRTIO_F_VERSION_1) |
58 (1ULL << VIRTIO_F_IOMMU_PLATFORM);58 (1ULL << VIRTIO_F_ACCESS_PLATFORM);
59 59
60/* State of each vdpasim device */60/* State of each vdpasim device */
61struct vdpasim {61struct vdpasim {
@@ -450,7 +450,7 @@ static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features) · 388 unmodified lines
450 struct vdpasim *vdpasim = vdpa_to_sim(vdpa);450 struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
451 451
452 /* DMA mapping must be done by driver */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 return -EINVAL;454 return -EINVAL;
455 455
456 vdpasim->features = features & vdpasim_features;456 vdpasim->features = features & vdpasim_features;
drivers/vhost/net.c+2−2
@@ -73,7 +73,7 @@ enum { · 72 unmodified lines
73 VHOST_NET_FEATURES = VHOST_FEATURES |73 VHOST_NET_FEATURES = VHOST_FEATURES |
74 (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) |74 (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) |
75 (1ULL << VIRTIO_NET_F_MRG_RXBUF) |75 (1ULL << VIRTIO_NET_F_MRG_RXBUF) |
76 (1ULL << VIRTIO_F_IOMMU_PLATFORM)76 (1ULL << VIRTIO_F_ACCESS_PLATFORM)
77};77};
78 78
79enum {79enum {
@@ -1653,7 +1653,7 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features) · 1573 unmodified lines
1653 !vhost_log_access_ok(&n->dev))1653 !vhost_log_access_ok(&n->dev))
1654 goto out_unlock;1654 goto out_unlock;
1655 1655
1656 if ((features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) {1656 if ((features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) {
1657 if (vhost_init_device_iotlb(&n->dev, true))1657 if (vhost_init_device_iotlb(&n->dev, true))
1658 goto out_unlock;1658 goto out_unlock;
1659 }1659 }
drivers/vhost/vdpa.c+1−1
@@ -31,7 +31,7 @@ enum { · 30 unmodified lines
31 (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) |31 (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) |
32 (1ULL << VIRTIO_F_ANY_LAYOUT) |32 (1ULL << VIRTIO_F_ANY_LAYOUT) |
33 (1ULL << VIRTIO_F_VERSION_1) |33 (1ULL << VIRTIO_F_VERSION_1) |
34 (1ULL << VIRTIO_F_IOMMU_PLATFORM) |34 (1ULL << VIRTIO_F_ACCESS_PLATFORM) |
35 (1ULL << VIRTIO_F_RING_PACKED) |35 (1ULL << VIRTIO_F_RING_PACKED) |
36 (1ULL << VIRTIO_F_ORDER_PLATFORM) |36 (1ULL << VIRTIO_F_ORDER_PLATFORM) |
37 (1ULL << VIRTIO_RING_F_INDIRECT_DESC) |37 (1ULL << VIRTIO_RING_F_INDIRECT_DESC) |
drivers/virtio/virtio_balloon.c+1−1
@@ -1129,7 +1129,7 @@ static int virtballoon_validate(struct virtio_device *vdev) · 1128 unmodified lines
1129 else if (!virtio_has_feature(vdev, VIRTIO_BALLOON_F_PAGE_POISON))1129 else if (!virtio_has_feature(vdev, VIRTIO_BALLOON_F_PAGE_POISON))
1130 __virtio_clear_bit(vdev, VIRTIO_BALLOON_F_REPORTING);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 return 0;1133 return 0;
1134}1134}
1135 1135
drivers/virtio/virtio_ring.c+1−1
@@ -2225,7 +2225,7 @@ void vring_transport_features(struct virtio_device *vdev) · 2224 unmodified lines
2225 break;2225 break;
2226 case VIRTIO_F_VERSION_1:2226 case VIRTIO_F_VERSION_1:
2227 break;2227 break;
2228 case VIRTIO_F_IOMMU_PLATFORM:2228 case VIRTIO_F_ACCESS_PLATFORM:
2229 break;2229 break;
2230 case VIRTIO_F_RING_PACKED:2230 case VIRTIO_F_RING_PACKED:
2231 break;2231 break;
include/linux/virtio_config.h+1−1
@@ -171,7 +171,7 @@ static inline bool virtio_has_iommu_quirk(const struct virtio_device *vdev) · 170 unmodified lines
171 * Note the reverse polarity of the quirk feature (compared to most171 * Note the reverse polarity of the quirk feature (compared to most
172 * other features), this is for compatibility with legacy systems.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
177static inline177static inline
include/uapi/linux/virtio_config.h+7−3
@@ -67,13 +67,17 @@ · 66 unmodified lines
67#define VIRTIO_F_VERSION_1 3267#define VIRTIO_F_VERSION_1 32
68 68
69/*69/*
70 * If clear - device has the IOMMU bypass quirk feature.70 * If clear - device has the platform DMA (e.g. IOMMU) bypass quirk feature.
71 * If set - use platform tools to detect the IOMMU.71 * If set - use platform DMA tools to access the memory.
72 *72 *
73 * Note the reverse polarity (compared to most other features),73 * Note the reverse polarity (compared to most other features),
74 * this is for compatibility with legacy systems.74 * this is for compatibility with legacy systems.
75 */75 */
76#define VIRTIO_F_IOMMU_PLATFORM 3376#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/* This feature indicates support for the packed virtqueue layout. */82/* This feature indicates support for the packed virtqueue layout. */
79#define VIRTIO_F_RING_PACKED 3483#define VIRTIO_F_RING_PACKED 34
tools/virtio/linux/virtio_config.h+1−1
@@ -51,7 +51,7 @@ static inline bool virtio_has_iommu_quirk(const struct virtio_device *vdev) · 50 unmodified lines
51 * Note the reverse polarity of the quirk feature (compared to most51 * Note the reverse polarity of the quirk feature (compared to most
52 * other features), this is for compatibility with legacy systems.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
57static inline bool virtio_is_little_endian(struct virtio_device *vdev)57static inline bool virtio_is_little_endian(struct virtio_device *vdev)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t