qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"David Hildenbrand" <david@redhat.com>,
	"Peter Xu" <peterx@redhat.com>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>
Subject: [PATCH] system: initialize target_page_bits as soon as possible
Date: Sun,  9 Mar 2025 12:37:12 -0700	[thread overview]
Message-ID: <20250309193712.1405766-1-pierrick.bouvier@linaro.org> (raw)

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.bouvier@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	other threads:[~2025-03-09 19:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-09 19:37 Pierrick Bouvier [this message]
2025-03-09 19:39 ` [PATCH] system: initialize target_page_bits as soon as possible Pierrick Bouvier
2025-03-09 23:12 ` Richard Henderson
2025-03-09 23:31   ` Pierrick Bouvier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250309193712.1405766-1-pierrick.bouvier@linaro.org \
    --to=pierrick.bouvier@linaro.org \
    --cc=david@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).