Re: [Qemu-devel] [PATCH v5 07/15] hw/vfio: Access MemoryRegion with MemOp

2019-07-26 Thread Richard Henderson
On 7/25/19 11:46 PM, tony.ngu...@bt.com wrote:
> No-op SIZE_MEMOP macro allows us to later easily convert
> memory_region_dispatch_{read|write} paramter "unsigned size" into a
> size+sign+endianness encoded "MemOp op".
> 
> Being a no-op macro, this patch does not introduce any logical change.
> 
> Signed-off-by: Tony Nguyen 
> ---
>  hw/vfio/pci-quirks.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson 


r~



[Qemu-devel] [PATCH v5 07/15] hw/vfio: Access MemoryRegion with MemOp

2019-07-26 Thread tony.nguyen
No-op SIZE_MEMOP macro allows us to later easily convert
memory_region_dispatch_{read|write} paramter "unsigned size" into a
size+sign+endianness encoded "MemOp op".

Being a no-op macro, this patch does not introduce any logical change.

Signed-off-by: Tony Nguyen 
---
 hw/vfio/pci-quirks.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
index b35a640..3240afa 100644
--- a/hw/vfio/pci-quirks.c
+++ b/hw/vfio/pci-quirks.c
@@ -1071,7 +1071,7 @@ static void vfio_rtl8168_quirk_address_write(void 
*opaque, hwaddr addr,

 /* Write to the proper guest MSI-X table instead */
 memory_region_dispatch_write(>pdev.msix_table_mmio,
- offset, val, size,
+ offset, val, SIZE_MEMOP(size),
  MEMTXATTRS_UNSPECIFIED);
 }
 return; /* Do not write guest MSI-X data to hardware */
@@ -1102,7 +1102,8 @@ 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(>pdev.msix_table_mmio, offset,
-, size, MEMTXATTRS_UNSPECIFIED);
+, SIZE_MEMOP(size),
+MEMTXATTRS_UNSPECIFIED);
 trace_vfio_quirk_rtl8168_msix_read(vdev->vbasedev.name, offset, data);
 }

--
1.8.3.1