]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
page-vary: Build migration_legacy_page_bits as common code
authorRichard Henderson <richard.henderson@linaro.org>
Tue, 17 Feb 2026 09:51:05 +0000 (19:51 +1000)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 25 Feb 2026 23:12:12 +0000 (00:12 +0100)
Use target_info->page_bits_init to implement
migration_legacy_page_bits.  Because this is the last
function within the file, rename page-vary-target.c
to page-vary-system.c and build once for system mode.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20260217095106.598486-7-richard.henderson@linaro.org>
[PMD: Update MAINTAINERS]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
MAINTAINERS
meson.build
page-vary-system.c [moved from page-vary-target.c with 74% similarity]

index 8da0b357fbb57a6951e201fa3a48adae1309b492..606b16762cf2ba24d6bd8bb72421db1325bb1908 100644 (file)
@@ -159,7 +159,7 @@ M: Richard Henderson <richard.henderson@linaro.org>
 R: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
 F: system/watchpoint.c
-F: page-vary-target.c
+F: page-vary-system.c
 F: page-vary-common.c
 F: accel/tcg/
 F: accel/stubs/tcg-stub.c
index d9a17eeefd3a2a04b3b2931e4714a3fcbe4e4347..3cd1d8dbc669021a9e3c284b3bce350b7a2eff75 100644 (file)
@@ -3833,7 +3833,7 @@ if get_option('b_lto')
   pagevary = declare_dependency(link_with: pagevary)
 endif
 common_ss.add(pagevary)
-specific_ss.add(files('page-vary-target.c'))
+system_ss.add(files('page-vary-system.c'))
 
 common_ss.add(files('target-info.c'))
 system_ss.add(files('target-info-qom.c'))
similarity index 74%
rename from page-vary-target.c
rename to page-vary-system.c
index bc4d8931b68e99d82f99801b998a3a4816321b8c..6c49c10e23baca11c6e25a71da5c52d4726ba638 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Variable page size handling -- target specific part.
+ * Variable page size handling -- system specific part.
  *
  *  Copyright (c) 2003 Fabrice Bellard
  *
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#define IN_PAGE_VARY 1
-
 #include "qemu/osdep.h"
 #include "exec/page-vary.h"
-#include "exec/target_page.h"
-
-#ifndef CONFIG_USER_ONLY
 #include "exec/tlb-flags.h"
+#include "qemu/target-info-impl.h"
 
 QEMU_BUILD_BUG_ON(TLB_FLAGS_MASK & ((1u < TARGET_PAGE_BITS_MIN) - 1));
 
 int migration_legacy_page_bits(void)
 {
-#ifdef TARGET_PAGE_BITS_VARY
-    QEMU_BUILD_BUG_ON(TARGET_PAGE_BITS_LEGACY < TARGET_PAGE_BITS_MIN);
-    return TARGET_PAGE_BITS_LEGACY;
-#else
-    return TARGET_PAGE_BITS;
-#endif
+    const TargetInfo *ti = target_info();
+
+    assert(ti->page_bits_init >= TARGET_PAGE_BITS_MIN);
+    return ti->page_bits_init;
 }
-#endif