Re: [PATCH v5 2/3] include: Add a header to define host PCI MMIO functions

2025-04-30 Thread Thomas Huth
On 30/04/2025 20.32, Farhan Ali wrote: On 4/30/2025 10:52 AM, Thomas Huth wrote: On 30/04/2025 18.47, Farhan Ali wrote: ..snip... +static inline uint32_t host_pci_ldl_le_p(const void *ioaddr) +{ +    uint32_t ret = 0; +#ifdef __s390x__ +    ret = le32_to_cpu(s390x_pci_mmio_read_32(ioaddr));

Re: [PATCH v5 2/3] include: Add a header to define host PCI MMIO functions

2025-04-30 Thread Farhan Ali
On 4/30/2025 10:52 AM, Thomas Huth wrote: On 30/04/2025 18.47, Farhan Ali wrote: ..snip... +static inline uint32_t host_pci_ldl_le_p(const void *ioaddr) +{ +    uint32_t ret = 0; +#ifdef __s390x__ +    ret = le32_to_cpu(s390x_pci_mmio_read_32(ioaddr)); +#else +    ret = (uint32_t)ldl_le_p(i

Re: [PATCH v5 2/3] include: Add a header to define host PCI MMIO functions

2025-04-30 Thread Thomas Huth
On 30/04/2025 18.47, Farhan Ali wrote: ..snip... +static inline uint32_t host_pci_ldl_le_p(const void *ioaddr) +{ +    uint32_t ret = 0; +#ifdef __s390x__ +    ret = le32_to_cpu(s390x_pci_mmio_read_32(ioaddr)); +#else +    ret = (uint32_t)ldl_le_p(ioaddr); This is the only spot where you use

Re: [PATCH v5 2/3] include: Add a header to define host PCI MMIO functions

2025-04-30 Thread Farhan Ali
..snip... +static inline uint32_t host_pci_ldl_le_p(const void *ioaddr) +{ +    uint32_t ret = 0; +#ifdef __s390x__ +    ret = le32_to_cpu(s390x_pci_mmio_read_32(ioaddr)); +#else +    ret = (uint32_t)ldl_le_p(ioaddr); This is the only spot where you used a cast. Is it necessary, or could it

Re: [PATCH v5 2/3] include: Add a header to define host PCI MMIO functions

2025-04-25 Thread Thomas Huth
On 17/04/2025 19.38, Farhan Ali wrote: Add a generic API for host PCI MMIO reads/writes (e.g. Linux VFIO BAR accesses). The functions access little endian memory and returns the result in host cpu endianness. Signed-off-by: Farhan Ali --- include/qemu/host-pci-mmio.h | 141 +++

Re: [PATCH v5 2/3] include: Add a header to define host PCI MMIO functions

2025-04-22 Thread Stefan Hajnoczi
On Thu, Apr 17, 2025 at 10:38:00AM -0700, Farhan Ali wrote: > Add a generic API for host PCI MMIO reads/writes > (e.g. Linux VFIO BAR accesses). The functions access > little endian memory and returns the result in > host cpu endianness. > > Signed-off-by: Farhan Ali > --- > include/qemu/host-pc

[PATCH v5 2/3] include: Add a header to define host PCI MMIO functions

2025-04-17 Thread Farhan Ali
Add a generic API for host PCI MMIO reads/writes (e.g. Linux VFIO BAR accesses). The functions access little endian memory and returns the result in host cpu endianness. Signed-off-by: Farhan Ali --- include/qemu/host-pci-mmio.h | 141 +++ 1 file changed, 141 inse