[PATCH 2/5] page-vary: Expose TARGET_PAGE_BITS_MIN definition

Philippe Mathieu-Daudé posted 5 patches 1 month, 3 weeks ago
Maintainers: Pierrick Bouvier <pierrick.bouvier@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>
[PATCH 2/5] page-vary: Expose TARGET_PAGE_BITS_MIN definition
Posted by Philippe Mathieu-Daudé 1 month, 3 weeks ago
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>
---
 include/exec/page-vary.h | 14 ++++++++++++++
 page-vary-target.c       | 15 ---------------
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/include/exec/page-vary.h b/include/exec/page-vary.h
index 101c25911c1..3c77689ca52 100644
--- a/include/exec/page-vary.h
+++ b/include/exec/page-vary.h
@@ -20,6 +20,20 @@
 #ifndef EXEC_PAGE_VARY_H
 #define EXEC_PAGE_VARY_H
 
+/*
+ * For system mode, the minimum comes from the number of bits
+ * required for maximum alignment (6) and the number of bits
+ * required for TLB_FLAGS_MASK (3).
+ *
+ * For user mode, TARGET_PAGE_BITS_VARY is a hack to allow the target
+ * page size to match the host page size.  Mostly, this reduces the
+ * ordinary target page size to run on a host with 4KiB pages (i.e. x86).
+ * There is no true minimum required by the implementation, but keep the
+ * same minimum as for system mode for sanity.
+ * See linux-user/mmap.c, mmap_h_lt_g and mmap_h_gt_g.
+ */
+#define TARGET_PAGE_BITS_MIN 9
+
 typedef struct {
     bool decided;
     int bits;
diff --git a/page-vary-target.c b/page-vary-target.c
index 49a32b4fe51..ab92da4539d 100644
--- a/page-vary-target.c
+++ b/page-vary-target.c
@@ -23,21 +23,6 @@
 #include "exec/page-vary.h"
 #include "exec/target_page.h"
 
-
-/*
- * For system mode, the minimum comes from the number of bits
- * required for maximum alignment (6) and the number of bits
- * required for TLB_FLAGS_MASK (3).
- *
- * For user mode, TARGET_PAGE_BITS_VARY is a hack to allow the target
- * page size to match the host page size.  Mostly, this reduces the
- * ordinary target page size to run on a host with 4KiB pages (i.e. x86).
- * There is no true minimum required by the implementation, but keep the
- * same minimum as for system mode for sanity.
- * See linux-user/mmap.c, mmap_h_lt_g and mmap_h_gt_g.
- */
-#define TARGET_PAGE_BITS_MIN 9
-
 #ifndef TARGET_PAGE_BITS_VARY
 QEMU_BUILD_BUG_ON(TARGET_PAGE_BITS < TARGET_PAGE_BITS_MIN);
 #endif
-- 
2.52.0


Re: [PATCH 2/5] page-vary: Expose TARGET_PAGE_BITS_MIN definition
Posted by Pierrick Bouvier 1 month, 3 weeks ago
On 2/13/26 10:27 AM, Philippe Mathieu-Daudé wrote:
> 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>
> ---
>   include/exec/page-vary.h | 14 ++++++++++++++
>   page-vary-target.c       | 15 ---------------
>   2 files changed, 14 insertions(+), 15 deletions(-)
> 

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>