From: Philippe Mathieu-Daudé <[email protected]>

Inline vfio_arch_wants_loading_config_after_iter() and
replace the compile time check of the TARGET_ARM definition
by a runtime call to target_base_arm().

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Acked-by: Maciej S. Szmigiero <[email protected]>
Link: https://lore.kernel.org/qemu-devel/[email protected]
Signed-off-by: Cédric Le Goater <[email protected]>
---
 hw/vfio/vfio-helpers.h      |  2 --
 hw/vfio/helpers.c           | 17 -----------------
 hw/vfio/migration-multifd.c | 12 +++++++++++-
 3 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/hw/vfio/vfio-helpers.h b/hw/vfio/vfio-helpers.h
index 
ce317580800ac0c96696e8d3769a98c21d2716d0..54a327ffbc04a2df364fdd78bd97fe7e2065b38c
 100644
--- a/hw/vfio/vfio-helpers.h
+++ b/hw/vfio/vfio-helpers.h
@@ -32,6 +32,4 @@ struct vfio_device_info *vfio_get_device_info(int fd);
 int vfio_kvm_device_add_fd(int fd, Error **errp);
 int vfio_kvm_device_del_fd(int fd, Error **errp);
 
-bool vfio_arch_wants_loading_config_after_iter(void);
-
 #endif /* HW_VFIO_VFIO_HELPERS_H */
diff --git a/hw/vfio/helpers.c b/hw/vfio/helpers.c
index 
c595f860cea91398bffce515e8d25bd462c1a20b..f68f8165d091abd7faac778d8c90da27a8f5f5f8
 100644
--- a/hw/vfio/helpers.c
+++ b/hw/vfio/helpers.c
@@ -210,20 +210,3 @@ retry:
 
     return info;
 }
-
-bool vfio_arch_wants_loading_config_after_iter(void)
-{
-    /*
-     * Starting the config load only after all iterables were loaded (during
-     * non-iterables loading phase) is required for ARM64 due to this platform
-     * VFIO dependency on interrupt controller being loaded first.
-     *
-     * See commit d329f5032e17 ("vfio: Move the saving of the config space to
-     * the right place in VFIO migration").
-     */
-#if defined(TARGET_ARM)
-    return true;
-#else
-    return false;
-#endif
-}
diff --git a/hw/vfio/migration-multifd.c b/hw/vfio/migration-multifd.c
index 
4a855f4e1257fd0094d720a1dd0fd2aa25acb25f..a06cbf3c646896d7f87698b0d654b160be995237
 100644
--- a/hw/vfio/migration-multifd.c
+++ b/hw/vfio/migration-multifd.c
@@ -16,6 +16,7 @@
 #include "qemu/error-report.h"
 #include "qemu/lockable.h"
 #include "qemu/main-loop.h"
+#include "qemu/target-info.h"
 #include "qemu/thread.h"
 #include "io/channel-buffer.h"
 #include "migration/qemu-file.h"
@@ -44,7 +45,16 @@ bool vfio_load_config_after_iter(VFIODevice *vbasedev)
     }
 
     assert(vbasedev->migration_load_config_after_iter == ON_OFF_AUTO_AUTO);
-    return vfio_arch_wants_loading_config_after_iter();
+
+    /*
+     * Starting the config load only after all iterables were loaded (during
+     * non-iterables loading phase) is required for ARM64 due to this platform
+     * VFIO dependency on interrupt controller being loaded first.
+     *
+     * See commit d329f5032e17 ("vfio: Move the saving of the config space to
+     * the right place in VFIO migration").
+     */
+    return target_base_arm();
 }
 
 /* type safety */
-- 
2.52.0


Reply via email to