summaryrefslogtreecommitdiffstats
path: root/hw/vfio/pci-quirks.c
diff options
context:
space:
mode:
authorTony Nguyen2019-08-23 20:36:52 +0200
committerRichard Henderson2019-09-03 17:30:39 +0200
commitd5d680cacc66ef7e3c02c81dc8f3a34eabce6dfe (patch)
treef9738bf1ce601181a99be6c090f597fd6112b117 /hw/vfio/pci-quirks.c
parentexec: Hard code size with MO_{8|16|32|64} (diff)
downloadqemu-d5d680cacc66ef7e3c02c81dc8f3a34eabce6dfe.tar.gz
qemu-d5d680cacc66ef7e3c02c81dc8f3a34eabce6dfe.tar.xz
qemu-d5d680cacc66ef7e3c02c81dc8f3a34eabce6dfe.zip
memory: Access MemoryRegion with endianness
Preparation for collapsing the two byte swaps adjust_endianness and handle_bswap into the former. Call memory_region_dispatch_{read|write} with endianness encoded into the "MemOp op" operand. This patch does not change any behaviour as memory_region_dispatch_{read|write} is yet to handle the endianness. Once it does handle endianness, callers with byte swaps can collapse them into adjust_endianness. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Tony Nguyen <tony.nguyen@bt.com> Message-Id: <8066ab3eb037c0388dfadfe53c5118429dd1de3a.1566466906.git.tony.nguyen@bt.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'hw/vfio/pci-quirks.c')
-rw-r--r--hw/vfio/pci-quirks.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
index a4e1d2abb5..136f3a9ad6 100644
--- a/hw/vfio/pci-quirks.c
+++ b/hw/vfio/pci-quirks.c
@@ -1074,7 +1074,8 @@ static void vfio_rtl8168_quirk_address_write(void *opaque, hwaddr addr,
/* Write to the proper guest MSI-X table instead */
memory_region_dispatch_write(&vdev->pdev.msix_table_mmio,
- offset, val, size_memop(size),
+ offset, val,
+ size_memop(size) | MO_LE,
MEMTXATTRS_UNSPECIFIED);
}
return; /* Do not write guest MSI-X data to hardware */
@@ -1105,7 +1106,7 @@ static uint64_t vfio_rtl8168_quirk_data_read(void *opaque,
if (rtl->enabled && (vdev->pdev.cap_present & QEMU_PCI_CAP_MSIX)) {
hwaddr offset = rtl->addr & 0xfff;
memory_region_dispatch_read(&vdev->pdev.msix_table_mmio, offset,
- &data, size_memop(size),
+ &data, size_memop(size) | MO_LE,
MEMTXATTRS_UNSPECIFIED);
trace_vfio_quirk_rtl8168_msix_read(vdev->vbasedev.name, offset, data);
}