[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.0.2 24/27] virtio: remove virtio_tswap16s() call in vring_pack
From: |
Michael Tokarev |
Subject: |
[Stable-9.0.2 24/27] virtio: remove virtio_tswap16s() call in vring_packed_event_read() |
Date: |
Mon, 15 Jul 2024 12:34:31 +0300 |
From: Stefano Garzarella <sgarzare@redhat.com>
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>
Message-Id: <20240701075208.19634-1-sgarzare@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eugenio PĂ©rez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 7aa6492401e95fb296dec7cda81e67d91f6037d7)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 871674f9be..fd2dfe3a6b 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -322,7 +322,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.39.2
- [Stable-9.0.2 00/27] Patch Round-up for stable 9.0.2, frozen on 2024-07-14, Michael Tokarev, 2024/07/15
- [Stable-9.0.2 23/27] virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one(), Michael Tokarev, 2024/07/15
- [Stable-9.0.2 25/27] char-stdio: Restore blocking mode of stdout on exit, Michael Tokarev, 2024/07/15
- [Stable-9.0.2 27/27] hw/nvme: fix number of PIDs for FDP RUH update, Michael Tokarev, 2024/07/15
- [Stable-9.0.2 26/27] sphinx/qapidoc: Fix to generate doc for explicit, unboxed arguments, Michael Tokarev, 2024/07/15
- [Stable-9.0.2 24/27] virtio: remove virtio_tswap16s() call in vring_packed_event_read(),
Michael Tokarev <=