[PATCH v2 3/7] target-info: Move TARGET_PAGE_BITS sanity check

Richard Henderson posted 7 patches 1 month, 3 weeks ago
Maintainers: Pierrick Bouvier <pierrick.bouvier@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Peter Maydell <peter.maydell@linaro.org>
[PATCH v2 3/7] target-info: Move TARGET_PAGE_BITS sanity check
Posted by Richard Henderson 1 month, 3 weeks ago
Move the check from page-vary-target.c to target-info-stub.c,
in the process of removing page-vary-target.c entirely.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 page-vary-target.c | 4 ----
 target-info-stub.c | 6 ++++++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/page-vary-target.c b/page-vary-target.c
index ab92da4539..7c0565dd8d 100644
--- a/page-vary-target.c
+++ b/page-vary-target.c
@@ -23,10 +23,6 @@
 #include "exec/page-vary.h"
 #include "exec/target_page.h"
 
-#ifndef TARGET_PAGE_BITS_VARY
-QEMU_BUILD_BUG_ON(TARGET_PAGE_BITS < TARGET_PAGE_BITS_MIN);
-#endif
-
 #ifndef CONFIG_USER_ONLY
 #include "exec/tlb-flags.h"
 
diff --git a/target-info-stub.c b/target-info-stub.c
index 896f16e582..f5896a7262 100644
--- a/target-info-stub.c
+++ b/target-info-stub.c
@@ -11,11 +11,17 @@
 #include "qemu/target-info-impl.h"
 #include "hw/core/boards.h"
 #include "cpu.h"
+#include "exec/page-vary.h"
 
 /* Validate correct placement of CPUArchState. */
 QEMU_BUILD_BUG_ON(offsetof(ArchCPU, parent_obj) != 0);
 QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) != sizeof(CPUState));
 
+/* Validate target page size, if invariant. */
+#ifndef TARGET_PAGE_BITS_VARY
+QEMU_BUILD_BUG_ON(TARGET_PAGE_BITS < TARGET_PAGE_BITS_MIN);
+#endif
+
 static const TargetInfo target_info_stub = {
     .target_name = TARGET_NAME,
     .target_arch = glue(SYS_EMU_TARGET_, TARGET_ARCH),
-- 
2.43.0
Re: [PATCH v2 3/7] target-info: Move TARGET_PAGE_BITS sanity check
Posted by Philippe Mathieu-Daudé 1 month, 3 weeks ago
On 17/2/26 10:51, Richard Henderson wrote:
> Move the check from page-vary-target.c to target-info-stub.c,
> in the process of removing page-vary-target.c entirely.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   page-vary-target.c | 4 ----
>   target-info-stub.c | 6 ++++++
>   2 files changed, 6 insertions(+), 4 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>