On 30/04/2025 20.50, 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.
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>
Signed-off-by: Farhan Ali <al...@linux.ibm.com>
---
...
+static inline uint8_t host_pci_ldub_p(const void *ioaddr)
+{
+ uint8_t ret = 0;
+#ifdef __s390x__
+ ret = s390x_pci_mmio_read_8(ioaddr);
+#else
+ ret = ldub_p(ioaddr);
+#endif
+
+ return ret;
+}
...
+static inline void host_pci_stb_le_p(void *ioaddr, uint8_t val)
+{
+#ifdef __s390x__
+ s390x_pci_mmio_write_8(ioaddr, val);
+#else
+ stb_p(ioaddr, val);
+#endif
+}
Cosmetic nit: host_pci_ldub_p() does not have a "_le_" in its name, while
host_pci_stb_le_p() has it. Could be fixed up while picking up the patch, so
no need to respin just because of this.
Reviewed-by: Thomas Huth <th...@redhat.com>