qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Thomas Huth
Subject: Re: [PATCH v6 2/3] include: Add a header to define host PCI MMIO functions
Date: Mon, 5 May 2025 11:38:26 +0200
User-agent: Mozilla Thunderbird

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 <stefanha@redhat.com>
Signed-off-by: Farhan Ali <alifm@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 <thuth@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]