virtio: VIRTIO_F_IOMMU_PLATFORM -> VIRTIO_F_ACCESS_PLATFORM
Subsystems (8)
Michael S. Tsirkin
maintainerPATCH 1/1 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 <[email protected]>
--- arch/um/drivers/virtio_uml.c | 2 +- drivers/vdpa/ifcvf/ifcvf_base.h | 2 +- drivers/vdpa/vdpa_sim/vdpa_sim.c | 4 ++-- drivers/vhost/net.c | 4 ++-- drivers/vhost/vdpa.c | 2 +- drivers/virtio/virtio_balloon.c | 2 +- drivers/virtio/virtio_ring.c | 2 +- include/linux/virtio_config.h | 2 +- include/uapi/linux/virtio_config.h | 10 +++++++--- tools/virtio/linux/virtio_config.h | 2 +- 10 files changed, 18 insertions(+), 14 deletions(-)
arch/um/drivers/virtio_uml.c +1 -1
@@ -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 :
drivers/vdpa/ifcvf/ifcvf_base.h +1 -1
@@ -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. */
drivers/vdpa/vdpa_sim/vdpa_sim.c +2 -2
@@ -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;
drivers/vhost/net.c +2 -2
@@ -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; }
drivers/vhost/vdpa.c +1 -1
@@ -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) |
drivers/virtio/virtio_balloon.c +1 -1
@@ -1120,7 +1120,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 ; }
drivers/virtio/virtio_ring.c +1 -1
@@ -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 ;
include/linux/virtio_config.h +1 -1
@@ -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
include/uapi/linux/virtio_config.h +7 -3
@@ -67,13 +67,17 @@#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
tools/virtio/linux/virtio_config.h +1 -1
@@ -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)
Signature · 1 line
MST
Quoted 169 lines · Michael S. Tsirkin
Rename the bit to match latest virtio spec.
Add a compat macro to avoid breaking existing userspace.Signed-off-by Michael S. Tsirkin <[email protected]>--- arch/um/drivers/virtio_uml.c | 2 +- drivers/vdpa/ifcvf/ifcvf_base.h | 2 +- drivers/vdpa/vdpa_sim/vdpa_sim.c | 4 ++-- drivers/vhost/net.c | 4 ++-- drivers/vhost/vdpa.c | 2 +- drivers/virtio/virtio_balloon.c | 2 +- drivers/virtio/virtio_ring.c | 2 +- include/linux/virtio_config.h | 2 +- include/uapi/linux/virtio_config.h | 10 +++++++--- tools/virtio/linux/virtio_config.h | 2 +- 10 files changed, 18 insertions(+), 14 deletions(-)arch/um/drivers/virtio_uml.c +1
-1@@ -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 :drivers/vdpa/ifcvf/ifcvf_base.h +1
-1@@ -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. */ drivers/vdpa/vdpa_sim/vdpa_sim.c +2
-2@@ -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;drivers/vhost/net.c +2
-2@@ -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; }drivers/vhost/vdpa.c +1
-1@@ -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) |drivers/virtio/virtio_balloon.c +1
-1@@ -1120,7 +1120,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 ; }drivers/virtio/virtio_ring.c +1
-1@@ -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 ;include/linux/virtio_config.h +1
-1@@ -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 inlineinclude/uapi/linux/virtio_config.h +7
-3@@ -67,13 +67,17 @@#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 34tools/virtio/linux/virtio_config.h +0
-0
tools/virtio/linux/virtio_config.h static inline bool virtio_has_iommu_quirk(const struct virtio_device *vdev) · line 57
Quoted 8 lines
tools/virtio/linux/virtio_config.h +1
-1@@ -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)
Acked-by Jason Wang <[email protected]>