Skip to content

Commit 7aa6492

Browse files
stefano-garzarellamstsirkin
authored andcommitted
virtio: remove virtio_tswap16s() call in vring_packed_event_read()
Commit d152cdd ("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: d152cdd ("virtio: use virtio accessor to access packed event") Cc: [email protected] Cc: [email protected] Reported-by: Xoykie <[email protected]> Link: https://lore.kernel.org/qemu-devel/CAFU8RB_pjr77zMLsM0Unf9xPNxfr_--Tjr49F_eX32ZBc5o2zQ@mail.gmail.com Signed-off-by: Stefano Garzarella <[email protected]> Message-Id: <[email protected]> Acked-by: Jason Wang <[email protected]> Reviewed-by: Peter Maydell <[email protected]> Reviewed-by: Eugenio Pérez <[email protected]> Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 5e3cd0a commit 7aa6492

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

hw/virtio/virtio.c

-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ static void vring_packed_event_read(VirtIODevice *vdev,
323323
/* Make sure flags is seen before off_wrap */
324324
smp_rmb();
325325
e->off_wrap = virtio_lduw_phys_cached(vdev, cache, off_off);
326-
virtio_tswap16s(vdev, &e->flags);
327326
}
328327

329328
static void vring_packed_off_wrap_write(VirtIODevice *vdev,

0 commit comments

Comments
 (0)