[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/4] vhost: convert byte order on avail_event read
From: |
Eugenio Pérez |
Subject: |
[PATCH 4/4] vhost: convert byte order on avail_event read |
Date: |
Fri, 28 Oct 2022 18:02:51 +0200 |
This causes errors on virtio modern devices on big endian hosts
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/virtio/vhost-shadow-virtqueue.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow-virtqueue.c
index 18a49e1ecb..3131903edd 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -231,7 +231,8 @@ static void vhost_svq_kick(VhostShadowVirtqueue *svq)
size_t num = svq->vring.num;
uint16_t *avail_event = (uint16_t *)&svq->vring.used->ring[num];
- needs_kick = vring_need_event(*avail_event, svq->shadow_avail_idx,
+ needs_kick = vring_need_event(le16_to_cpu(*avail_event),
+ svq->shadow_avail_idx,
svq->shadow_avail_idx - 1);
} else {
needs_kick = !(svq->vring.used->flags & VRING_USED_F_NO_NOTIFY);
--
2.31.1
- [PATCH 2/4] vhost: convert byte order on SVQ used event write, (continued)
- [PATCH 2/4] vhost: convert byte order on SVQ used event write, Eugenio Pérez, 2022/10/28
- Re: [PATCH 2/4] vhost: convert byte order on SVQ used event write, Philippe Mathieu-Daudé, 2022/10/28
- Re: [PATCH 2/4] vhost: convert byte order on SVQ used event write, Eugenio Perez Martin, 2022/10/31
- Re: [PATCH 2/4] vhost: convert byte order on SVQ used event write, Michael S. Tsirkin, 2022/10/31
- Re: [PATCH 2/4] vhost: convert byte order on SVQ used event write, Eugenio Perez Martin, 2022/10/31
- Re: [PATCH 2/4] vhost: convert byte order on SVQ used event write, Michael S. Tsirkin, 2022/10/31
- Re: [PATCH 2/4] vhost: convert byte order on SVQ used event write, Eugenio Perez Martin, 2022/10/31
- Re: [PATCH 2/4] vhost: convert byte order on SVQ used event write, Michael S. Tsirkin, 2022/10/31
[PATCH 4/4] vhost: convert byte order on avail_event read,
Eugenio Pérez <=
[PATCH 1/4] vhost: Delete useless casting, Eugenio Pérez, 2022/10/28
Re: [PATCH 0/4] Endianess and coding style fixes for SVQ event idx support, Michael S. Tsirkin, 2022/10/29
Re: [PATCH 0/4] Endianess and coding style fixes for SVQ event idx support, Jason Wang, 2022/10/31