- tests: bump QOS_PATH_MAX_ELEMENT_SIZE again - softmmu/physmem: fix memory leak in dirty_memory_extend() - crypto: run qcrypto_pbkdf2_count_iters in a new thread - hw/audio/virtio-sound: fix heap buffer overflow - hw/intc/arm_gic: fix spurious level triggered interrupts - ui/sdl2: set swap interval explicitly when OpenGL is enabled - target/riscv/kvm: tolerate KVM disable ext errors - virtio: remove virtio_tswap16s() call in vring_packed_event_read() - block: fix -Werror=maybe-uninitialized false-positive - hw/remote/vfio-user: Fix config space access byte order - hw/loongarch/virt: Fix memory leak - hw/intc/riscv_aplic: APLICs should add child earlier than realize - stdvga: fix screen blanking - ui/gtk: Draw guest frame at refresh cycle - target/i386: fix size of EBP writeback in gen_enter() - virtio-net: drop too short packets early - target/ppc: Fix lxv/stxv MSR facility check - target/ppc: Fix lxvx/stxvx facility check - virtio-snd: add max size bounds check in input cb(CVE-2024-7730) Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com> (cherry picked from commit e2eb79f1867bb8d8d870e758f06d2a32b3a4fc8a)
53 lines
2.1 KiB
Diff
53 lines
2.1 KiB
Diff
From 400e9dbe4dae8efc110a2363590ce35fd11d7d29 Mon Sep 17 00:00:00 2001
|
|
From: Stefano Garzarella <sgarzare@redhat.com>
|
|
Date: Mon, 1 Jul 2024 09:52:08 +0200
|
|
Subject: [PATCH] virtio: remove virtio_tswap16s() call in
|
|
vring_packed_event_read()
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
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: zhujun2 <zhujun2_yewu@cmss.chinamobile.com>
|
|
---
|
|
hw/virtio/virtio.c | 1 -
|
|
1 file changed, 1 deletion(-)
|
|
|
|
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
|
|
index 202aae868e..8c3b6b87aa 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.41.0.windows.1
|
|
|