All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio: remove virtio_tswap16s() call in vring_packed_event_read()
@ 2024-07-01  7:52 Stefano Garzarella
  2024-07-01  8:22 ` Jason Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stefano Garzarella @ 2024-07-01  7:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eugenio Perez Martin, jasowang, Peter Maydell, Michael S. Tsirkin,
	qemu-stable, Stefano Garzarella, Xoykie

Commit d152cdd6f6 ("virtio: use virtio accessor to access packed event")
switched using of address_space_read_cached() to virito_lduw_phys_cached()
to access packed descriptor event.

When we used address_space_read_cached(), we needed to call
virtio_tswap16s() to handle the endianess of the field, but
virito_lduw_phys_cached() already handles it internally, so we no longer
need to call virtio_tswap16s() (as the commit had done for `off_wrap`,
but forgot for `flags`).

Fixes: d152cdd6f6 ("virtio: use virtio accessor to access packed event")
Cc: jasowang@redhat.com
Cc: qemu-stable@nongnu.org
Reported-by: Xoykie <xoykie@gmail.com>
Link: https://lore.kernel.org/qemu-devel/CAFU8RB_pjr77zMLsM0Unf9xPNxfr_--Tjr49F_eX32ZBc5o2zQ@mail.gmail.com
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
---
 hw/virtio/virtio.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 893a072c9d..2e5e67bdb9 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -323,7 +323,6 @@ static void vring_packed_event_read(VirtIODevice *vdev,
     /* Make sure flags is seen before off_wrap */
     smp_rmb();
     e->off_wrap = virtio_lduw_phys_cached(vdev, cache, off_off);
-    virtio_tswap16s(vdev, &e->flags);
 }
 
 static void vring_packed_off_wrap_write(VirtIODevice *vdev,
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-07-01 10:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-01  7:52 [PATCH] virtio: remove virtio_tswap16s() call in vring_packed_event_read() Stefano Garzarella
2024-07-01  8:22 ` Jason Wang
2024-07-01  8:58 ` Peter Maydell
2024-07-01  9:53 ` Eugenio Perez Martin
2024-07-01 10:32   ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.