Allow device init functions to use it, which can be convenient in some
cases (like hw/hyperv/hyperv.c).

Signed-off-by: Pierrick Bouvier <pierrick.bouv...@linaro.org>
---
 system/physmem.c | 1 -
 system/vl.c      | 3 +++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/system/physmem.c b/system/physmem.c
index 8df9f30a0bb..c5fb784a9e1 100644
--- a/system/physmem.c
+++ b/system/physmem.c
@@ -3281,7 +3281,6 @@ void cpu_exec_init_all(void)
      * do this much later, rather than requiring board models to state
      * up front what their requirements are.
      */
-    finalize_target_page_bits();
     io_mem_init();
     memory_map_init();
 }
diff --git a/system/vl.c b/system/vl.c
index ec93988a03a..c64f8c8e808 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -2848,6 +2848,9 @@ void qemu_init(int argc, char **argv)
     bool userconfig = true;
     FILE *vmstate_dump_file = NULL;
 
+    /* Set target page info before creating machine and associated devices */
+    finalize_target_page_bits();
+
     qemu_add_opts(&qemu_drive_opts);
     qemu_add_drive_opts(&qemu_legacy_drive_opts);
     qemu_add_drive_opts(&qemu_common_drive_opts);
-- 
2.39.5


Reply via email to