@samitouri / QOSamiQemu / commits / c87bf20b07

page-vary: Build migration_legacy_page_bits as common code

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>

Richard Henderson committed Feb 17, 2026 at 19:51 UTC c87bf20b072ebd26f2c4ff68f802ef0d69f72a46
3 files changed +8 -15
MAINTAINERS
+1 -1
@@ -159,7 +159,7 @@ M: Richard Henderson <richard.henderson@linaro.org>
159 R: Paolo Bonzini <pbonzini@redhat.com>
160 S: Maintained
161 F: system/watchpoint.c
162 -F: page-vary-target.c
162 +F: page-vary-system.c
163 F: page-vary-common.c
164 F: accel/tcg/
165 F: accel/stubs/tcg-stub.c
meson.build
+1 -1
@@ -3833,7 +3833,7 @@ if get_option('b_lto')
3833 pagevary = declare_dependency(link_with: pagevary)
3834 endif
3835 common_ss.add(pagevary)
3836 -specific_ss.add(files('page-vary-target.c'))
3836 +system_ss.add(files('page-vary-system.c'))
3837
3838 common_ss.add(files('target-info.c'))
3839 system_ss.add(files('target-info-qom.c'))
page-vary-system.c renamed
+6 -13
@@ -1,5 +1,5 @@
1 /*
2 - * Variable page size handling -- target specific part.
2 + * Variable page size handling -- system specific part.
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
@@ -17,24 +17,17 @@
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 */
19
20 -#define IN_PAGE_VARY 1
21 -
20 #include "qemu/osdep.h"
21 #include "exec/page-vary.h"
24 -#include "exec/target_page.h"
25 -
26 -#ifndef CONFIG_USER_ONLY
22 #include "exec/tlb-flags.h"
23 +#include "qemu/target-info-impl.h"
24
25 QEMU_BUILD_BUG_ON(TLB_FLAGS_MASK & ((1u < TARGET_PAGE_BITS_MIN) - 1));
26
27 int migration_legacy_page_bits(void)
28 {
33 -#ifdef TARGET_PAGE_BITS_VARY
34 - QEMU_BUILD_BUG_ON(TARGET_PAGE_BITS_LEGACY < TARGET_PAGE_BITS_MIN);
35 - return TARGET_PAGE_BITS_LEGACY;
36 -#else
37 - return TARGET_PAGE_BITS;
38 -#endif
29 + const TargetInfo *ti = target_info();
30 +
31 + assert(ti->page_bits_init >= TARGET_PAGE_BITS_MIN);
32 + return ti->page_bits_init;
33 }
40 -#endif