summary refs log tree commit diff stats
path: root/cpu-target.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpu-target.c')
-rw-r--r--cpu-target.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cpu-target.c b/cpu-target.c
index 519b0f8900..7f3b244ed1 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "cpu.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/qemu-print.h"
@@ -29,6 +30,10 @@
 #include "accel/accel-cpu-target.h"
 #include "trace/trace-root.h"
 
+/* Validate correct placement of CPUArchState. */
+QEMU_BUILD_BUG_ON(offsetof(ArchCPU, parent_obj) != 0);
+QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) != sizeof(CPUState));
+
 char *cpu_model_from_type(const char *typename)
 {
     const char *suffix = "-" CPU_RESOLVING_TYPE;