Skip to content

Commit a49e6f5

Browse files
committed
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio/vhost fixes from Michael S. Tsirkin: "Last minute fixes: - ARM DMA fix revert - vhost endian-ness fix - MAINTAINERS: email address change for Amit" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: MAINTAINERS: update email address for Amit Shah vhost: fix initialization for vq->is_le Revert "vring: Force use of DMA API for ARM-based systems with legacy devices"
2 parents e9f7f17 + 79134d1 commit a49e6f5

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13065,7 +13065,7 @@ F: drivers/input/serio/userio.c
1306513065
F: include/uapi/linux/userio.h
1306613066

1306713067
VIRTIO CONSOLE DRIVER
13068-
M: Amit Shah <amit[email protected]>
13068+
M: Amit Shah <amit@kernel.org>
1306913069
1307013070
S: Maintained
1307113071
F: drivers/char/virtio_console.c

drivers/vhost/vhost.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ static long vhost_get_vring_endian(struct vhost_virtqueue *vq, u32 idx,
130130

131131
static void vhost_init_is_le(struct vhost_virtqueue *vq)
132132
{
133-
if (vhost_has_feature(vq, VIRTIO_F_VERSION_1))
134-
vq->is_le = true;
133+
vq->is_le = vhost_has_feature(vq, VIRTIO_F_VERSION_1)
134+
|| virtio_legacy_is_little_endian();
135135
}
136136
#endif /* CONFIG_VHOST_CROSS_ENDIAN_LEGACY */
137137

138138
static void vhost_reset_is_le(struct vhost_virtqueue *vq)
139139
{
140-
vq->is_le = virtio_legacy_is_little_endian();
140+
vhost_init_is_le(vq);
141141
}
142142

143143
struct vhost_flush_struct {
@@ -1714,10 +1714,8 @@ int vhost_vq_init_access(struct vhost_virtqueue *vq)
17141714
int r;
17151715
bool is_le = vq->is_le;
17161716

1717-
if (!vq->private_data) {
1718-
vhost_reset_is_le(vq);
1717+
if (!vq->private_data)
17191718
return 0;
1720-
}
17211719

17221720
vhost_init_is_le(vq);
17231721

drivers/virtio/virtio_ring.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,6 @@ static bool vring_use_dma_api(struct virtio_device *vdev)
159159
if (xen_domain())
160160
return true;
161161

162-
/*
163-
* On ARM-based machines, the DMA ops will do the right thing,
164-
* so always use them with legacy devices.
165-
*/
166-
if (IS_ENABLED(CONFIG_ARM) || IS_ENABLED(CONFIG_ARM64))
167-
return !virtio_has_feature(vdev, VIRTIO_F_VERSION_1);
168-
169162
return false;
170163
}
171164

0 commit comments

Comments
 (0)