target-info: Add page_bits_{init,vary}
Add two fields that will hold TARGET_PAGE_BITS, TARGET_PAGE_BITS_VARY, TARGET_PAGE_BITS_LEGACY. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20260217095106.598486-3-richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Richard Henderson committed
Feb 17, 2026 at 19:51 UTC
afb94ae3337fb430d2f54c7150df856ccf1ce94f
4 files changed
+22
configs/targets/aarch64-softmmu.c
+3
@@ -10,6 +10,7 @@
10
#include "qemu/target-info-impl.h"
11
#include "hw/arm/machines-qom.h"
12
#include "target/arm/cpu-qom.h"
13
+#include "target/arm/cpu-param.h"
14
15
static const TargetInfo target_info_aarch64_system = {
16
.target_name = "aarch64",
@@ -18,6 +19,8 @@ static const TargetInfo target_info_aarch64_system = {
19
.cpu_type = TYPE_ARM_CPU,
20
.machine_typename = TYPE_TARGET_AARCH64_MACHINE,
21
.endianness = ENDIAN_MODE_LITTLE,
22
+ .page_bits_vary = true,
23
+ .page_bits_init = TARGET_PAGE_BITS_LEGACY,
24
};
25
26
const TargetInfo *target_info(void)
configs/targets/arm-softmmu.c
+3
@@ -10,6 +10,7 @@
10
#include "qemu/target-info-impl.h"
11
#include "hw/arm/machines-qom.h"
12
#include "target/arm/cpu-qom.h"
13
+#include "target/arm/cpu-param.h"
14
15
static const TargetInfo target_info_arm_system = {
16
.target_name = "arm",
@@ -18,6 +19,8 @@ static const TargetInfo target_info_arm_system = {
19
.cpu_type = TYPE_ARM_CPU,
20
.machine_typename = TYPE_TARGET_ARM_MACHINE,
21
.endianness = ENDIAN_MODE_LITTLE,
22
+ .page_bits_vary = true,
23
+ .page_bits_init = TARGET_PAGE_BITS_LEGACY,
24
};
25
26
const TargetInfo *target_info(void)
include/qemu/target-info-impl.h
+7
@@ -25,6 +25,13 @@ typedef struct TargetInfo {
25
const char *machine_typename;
26
/* related to TARGET_BIG_ENDIAN definition */
27
EndianMode endianness;
28
+ /*
29
+ * runtime equivalent of
30
+ * TARGET_PAGE_BITS_VARY ? TARGET_PAGE_BITS_LEGACY : TARGET_PAGE_BITS
31
+ */
32
+ unsigned page_bits_init;
33
+ /* runtime equivalent of TARGET_PAGE_BITS_VARY definition */
34
+ bool page_bits_vary;
35
} TargetInfo;
36
37
/**
target-info-stub.c
+9
@@ -23,6 +23,15 @@ static const TargetInfo target_info_stub = {
23
.cpu_type = CPU_RESOLVING_TYPE,
24
.machine_typename = TYPE_MACHINE,
25
.endianness = TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITTLE,
26
+#ifdef TARGET_PAGE_BITS_VARY
27
+ .page_bits_vary = true,
28
+# ifdef TARGET_PAGE_BITS_LEGACY
29
+ .page_bits_init = TARGET_PAGE_BITS_LEGACY,
30
+# endif
31
+#else
32
+ .page_bits_vary = false,
33
+ .page_bits_init = TARGET_PAGE_BITS,
34
+#endif
35
};
36
37
const TargetInfo *target_info(void)