@samitouri / QOSamiQemu / commits / 40a5b6745e

page-vary: Expose TARGET_PAGE_BITS_MIN definition

We'll use TARGET_PAGE_BITS_MIN in page-vary-common.c, so expose it via "exec/page-vary.h". Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20260213182713.44924-3-philmd@linaro.org>

Philippe Mathieu-Daudé committed Feb 12, 2026 at 23:42 UTC 40a5b6745ed4b586d9e29c71ac492b1309c3f419
2 files changed +14 -15
include/exec/page-vary.h
+14
@@ -20,6 +20,20 @@
20 #ifndef EXEC_PAGE_VARY_H
21 #define EXEC_PAGE_VARY_H
22
23 +/*
24 + * For system mode, the minimum comes from the number of bits
25 + * required for maximum alignment (6) and the number of bits
26 + * required for TLB_FLAGS_MASK (3).
27 + *
28 + * For user mode, TARGET_PAGE_BITS_VARY is a hack to allow the target
29 + * page size to match the host page size. Mostly, this reduces the
30 + * ordinary target page size to run on a host with 4KiB pages (i.e. x86).
31 + * There is no true minimum required by the implementation, but keep the
32 + * same minimum as for system mode for sanity.
33 + * See linux-user/mmap.c, mmap_h_lt_g and mmap_h_gt_g.
34 + */
35 +#define TARGET_PAGE_BITS_MIN 9
36 +
37 typedef struct {
38 bool decided;
39 int bits;
page-vary-target.c
-15
@@ -23,21 +23,6 @@
23 #include "exec/page-vary.h"
24 #include "exec/target_page.h"
25
26 -
27 -/*
28 - * For system mode, the minimum comes from the number of bits
29 - * required for maximum alignment (6) and the number of bits
30 - * required for TLB_FLAGS_MASK (3).
31 - *
32 - * For user mode, TARGET_PAGE_BITS_VARY is a hack to allow the target
33 - * page size to match the host page size. Mostly, this reduces the
34 - * ordinary target page size to run on a host with 4KiB pages (i.e. x86).
35 - * There is no true minimum required by the implementation, but keep the
36 - * same minimum as for system mode for sanity.
37 - * See linux-user/mmap.c, mmap_h_lt_g and mmap_h_gt_g.
38 - */
39 -#define TARGET_PAGE_BITS_MIN 9
40 -
26 #ifndef TARGET_PAGE_BITS_VARY
27 QEMU_BUILD_BUG_ON(TARGET_PAGE_BITS < TARGET_PAGE_BITS_MIN);
28 #endif