[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/13] dataplane: fix cross-endian issues
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 01/13] dataplane: fix cross-endian issues |
Date: |
Tue, 7 Jul 2015 15:40:03 +0300 |
From: Greg Kurz <address@hidden>
Accesses to vring_avail_event and vring_used_event must honor the queue
endianness.
This patch allows cross-endian setups to use dataplane (tested with ppc64
on ppc64le, and vice-versa).
Suggested-by: Cornelia Huck <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
---
hw/virtio/dataplane/vring.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c
index 3589185..bed9b11 100644
--- a/hw/virtio/dataplane/vring.c
+++ b/hw/virtio/dataplane/vring.c
@@ -153,7 +153,8 @@ bool vring_should_notify(VirtIODevice *vdev, Vring *vring)
return true;
}
- return vring_need_event(vring_used_event(&vring->vr), new, old);
+ return vring_need_event(virtio_tswap16(vdev, vring_used_event(&vring->vr)),
+ new, old);
}
@@ -407,7 +408,8 @@ int vring_pop(VirtIODevice *vdev, Vring *vring,
/* On success, increment avail index. */
vring->last_avail_idx++;
if (virtio_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX)) {
- vring_avail_event(&vring->vr) = vring->last_avail_idx;
+ vring_avail_event(&vring->vr) =
+ virtio_tswap16(vdev, vring->last_avail_idx);
}
return head;
--
MST
- [Qemu-devel] [PULL 00/13] pc,virtio,pci: fixes and updates, Michael S. Tsirkin, 2015/07/07
- [Qemu-devel] [PULL 01/13] dataplane: fix cross-endian issues,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 02/13] Revert "dataplane: allow virtio-1 devices", Michael S. Tsirkin, 2015/07/07
- [Qemu-devel] [PULL 03/13] acpi: split out ICH ACPI support, Michael S. Tsirkin, 2015/07/07
- [Qemu-devel] [PULL 04/13] ich9: add TCO interface emulation, Michael S. Tsirkin, 2015/07/07
- [Qemu-devel] [PULL 05/13] tests: add testcase for TCO watchdog emulation, Michael S. Tsirkin, 2015/07/07
- [Qemu-devel] [PULL 06/13] ich9: implement strap SPKR pin logic, Michael S. Tsirkin, 2015/07/07
- [Qemu-devel] [PULL 07/13] hw/i386/pc: factor out pc_cmos_init_floppy(), Michael S. Tsirkin, 2015/07/07
- [Qemu-devel] [PULL 08/13] hw/i386/pc: reflect any FDC @ ioport 0x3f0 in the CMOS, Michael S. Tsirkin, 2015/07/07
- [Qemu-devel] [PULL 09/13] hw/i386/pc: don't carry FDC from pc_basic_device_init() to pc_cmos_init(), Michael S. Tsirkin, 2015/07/07
- [Qemu-devel] [PULL 10/13] virtio_net: reuse constants from linux, Michael S. Tsirkin, 2015/07/07
- [Qemu-devel] [PULL 13/13] virtio: define virtio_pci_cfg_cap in header., Michael S. Tsirkin, 2015/07/07