qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

hw/pci/pci_host: Let pci_data_[read/write] use unsigned 'size' argument

Both functions are called by MemoryRegionOps.[read/write] handlers
with unsigned 'size' argument. Both functions call
pci_host_config_[read/write]_common() which expect a uint32_t 'len'
parameter (also unsigned).
Since it is pointless (and confuse) to use a signed value, use a
unsigned type.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20191216002134.18279-3-philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

authored by

Philippe Mathieu-Daudé and committed by
Michael S. Tsirkin
f2a7e8f1 4ce537a7

+4 -4
+2 -2
hw/pci/pci_host.c
··· 106 106 return ret; 107 107 } 108 108 109 - void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len) 109 + void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, unsigned len) 110 110 { 111 111 PCIDevice *pci_dev = pci_dev_find_by_addr(s, addr); 112 112 uint32_t config_addr = addr & (PCI_CONFIG_SPACE_SIZE - 1); ··· 119 119 val, len); 120 120 } 121 121 122 - uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len) 122 + uint32_t pci_data_read(PCIBus *s, uint32_t addr, unsigned len) 123 123 { 124 124 PCIDevice *pci_dev = pci_dev_find_by_addr(s, addr); 125 125 uint32_t config_addr = addr & (PCI_CONFIG_SPACE_SIZE - 1);
+2 -2
include/hw/pci/pci_host.h
··· 62 62 uint32_t pci_host_config_read_common(PCIDevice *pci_dev, uint32_t addr, 63 63 uint32_t limit, uint32_t len); 64 64 65 - void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len); 66 - uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len); 65 + void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, unsigned len); 66 + uint32_t pci_data_read(PCIBus *s, uint32_t addr, unsigned len); 67 67 68 68 extern const MemoryRegionOps pci_host_conf_le_ops; 69 69 extern const MemoryRegionOps pci_host_conf_be_ops;