diff -u b/hw/s390x/meson.build b/hw/s390x/meson.build
--- b/hw/s390x/meson.build
+++ b/hw/s390x/meson.build
@@ -10,7 +10,6 @@
   's390-ccw.c',
   's390-pci-bus.c',
   's390-pci-inst.c',
-  's390-pci-vfio.c',
   's390-skeys.c',
   's390-stattrib.c',
   's390-virtio-hcall.c',
@@ -28,6 +27,7 @@
 ))
 s390x_ss.add(when: 'CONFIG_S390_CCW_VIRTIO', if_true: files('s390-virtio-ccw.c'))
 s390x_ss.add(when: 'CONFIG_TERMINAL3270', if_true: files('3270-ccw.c'))
+s390x_ss.add(when: 'CONFIG_LINUX', if_true: files('s390-pci-vfio.c'))
 
 virtio_ss = ss.source_set()
 virtio_ss.add(files('virtio-ccw.c'))
diff -u b/hw/vfio/common.c b/hw/vfio/common.c
--- b/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -397,7 +397,8 @@
                    BITS_PER_BYTE;
 
     if (bitmap->size > container->max_dirty_bitmap_size) {
-        error_report("UNMAP: Size of bitmap too big 0x%llx", bitmap->size);
+        error_report("UNMAP: Size of bitmap too big 0x%"PRIx64,
+                     (uint64_t)bitmap->size);
         ret = -E2BIG;
         goto unmap_exit;
     }
@@ -410,7 +411,7 @@
 
     ret = ioctl(container->fd, VFIO_IOMMU_UNMAP_DMA, unmap);
     if (!ret) {
-        cpu_physical_memory_set_dirty_lebitmap((uint64_t *)bitmap->data,
+        cpu_physical_memory_set_dirty_lebitmap((unsigned long *)bitmap->data,
                 iotlb->translated_addr, pages);
     } else {
         error_report("VFIO_UNMAP_DMA with DIRTY_BITMAP : %m");
@@ -998,13 +999,13 @@
 
     ret = ioctl(container->fd, VFIO_IOMMU_DIRTY_PAGES, dbitmap);
     if (ret) {
-        error_report("Failed to get dirty bitmap for iova: 0x%llx "
-                "size: 0x%llx err: %d",
-                range->iova, range->size, errno);
+        error_report("Failed to get dirty bitmap for iova: 0x%"PRIx64
+                " size: 0x%"PRIx64" err: %d", (uint64_t)range->iova,
+                (uint64_t)range->size, errno);
         goto err_out;
     }
 
-    cpu_physical_memory_set_dirty_lebitmap((uint64_t *)range->bitmap.data,
+    cpu_physical_memory_set_dirty_lebitmap((unsigned long *)range->bitmap.data,
                                             ram_addr, pages);
 
     trace_vfio_get_dirty_bitmap(container->fd, range->iova, range->size,
diff -u b/hw/vfio/migration.c b/hw/vfio/migration.c
--- b/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -55,8 +55,8 @@
     ret = iswrite ? pwrite(vbasedev->fd, val, count, off) :
                     pread(vbasedev->fd, val, count, off);
     if (ret < count) {
-        error_report("vfio_mig_%s %d byte %s: failed at offset 0x%lx, err: %s",
-                     iswrite ? "write" : "read", count,
+        error_report("vfio_mig_%s %d byte %s: failed at offset 0x%"
+                     HWADDR_PRIx", err: %s", iswrite ? "write" : "read", count,
                      vbasedev->name, off, strerror(errno));
         return (ret < 0) ? ret : -EINVAL;
     }
@@ -734,7 +734,7 @@
     uint32_t value, mask;
     int ret;
 
-    if ((vbasedev->migration->vm_running == running)) {
+    if (vbasedev->migration->vm_running == running) {
         return;
     }
 
diff -u b/include/hw/s390x/s390-pci-vfio.h b/include/hw/s390x/s390-pci-vfio.h
--- b/include/hw/s390x/s390-pci-vfio.h
+++ b/include/hw/s390x/s390-pci-vfio.h
@@ -15,9 +15,24 @@
 #include "hw/s390x/s390-pci-bus.h"
 
+#ifdef CONFIG_LINUX
 bool s390_pci_update_dma_avail(int fd, unsigned int *avail);
 S390PCIDMACount *s390_pci_start_dma_count(S390pciState *s,
                                           S390PCIBusDevice *pbdev);
 void s390_pci_end_dma_count(S390pciState *s, S390PCIDMACount *cnt);
 void s390_pci_get_clp_info(S390PCIBusDevice *pbdev);
+#else
+static inline bool s390_pci_update_dma_avail(int fd, unsigned int *avail)
+{
+    return false;
+}
+static inline S390PCIDMACount *s390_pci_start_dma_count(S390pciState *s,
+                                                        S390PCIBusDevice *pbdev)
+{
+    return NULL;
+}
+static inline void s390_pci_end_dma_count(S390pciState *s,
+                                          S390PCIDMACount *cnt) { }
+static inline void s390_pci_get_clp_info(S390PCIBusDevice *pbdev) { }
+#endif
 
 #endif
diff -u b/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
--- b/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -198,8 +198,6 @@
 void vfio_put_group(VFIOGroup *group);
 int vfio_get_device(VFIOGroup *group, const char *name,
                     VFIODevice *vbasedev, Error **errp);
-bool vfio_get_info_dma_avail(struct vfio_iommu_type1_info *info,
-                             unsigned int *avail);
 
 extern const MemoryRegionOps vfio_region_ops;
 typedef QLIST_HEAD(VFIOGroupList, VFIOGroup) VFIOGroupList;
@@ -216,6 +214,8 @@
 bool vfio_has_region_cap(VFIODevice *vbasedev, int region, uint16_t cap_type);
 struct vfio_info_cap_header *
 vfio_get_region_info_cap(struct vfio_region_info *info, uint16_t id);
+bool vfio_get_info_dma_avail(struct vfio_iommu_type1_info *info,
+                             unsigned int *avail);
 struct vfio_info_cap_header *
 vfio_get_device_info_cap(struct vfio_device_info *info, uint16_t id);
 #endif
