Message ID | 20230914024435.1381329-8-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | Reduce usage of CPUArchState in cputlb.c | expand |
On 9/14/23 04:44, Richard Henderson wrote: > Verify that the distance between CPUNegativeOffsetState and > CPUArchState is no greater than any alignment requirements. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > include/exec/cpu-all.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h > index c2c62160c6..86a7452b0d 100644 > --- a/include/exec/cpu-all.h > +++ b/include/exec/cpu-all.h > @@ -459,6 +459,12 @@ static inline CPUState *env_cpu(CPUArchState *env) > return &env_archcpu(env)->parent_obj; > } > > +/* > + * Validate placement of CPUNegativeOffsetState. > + */ > +QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) - offsetof(ArchCPU, neg) >= > + sizeof(CPUNegativeOffsetState) + __alignof(CPUArchState)); > + > /** > * env_neg(env) > * @env: The architecture environment Reviewed-by: Anton Johansson <anjo@rev.ng>
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index c2c62160c6..86a7452b0d 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -459,6 +459,12 @@ static inline CPUState *env_cpu(CPUArchState *env) return &env_archcpu(env)->parent_obj; } +/* + * Validate placement of CPUNegativeOffsetState. + */ +QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) - offsetof(ArchCPU, neg) >= + sizeof(CPUNegativeOffsetState) + __alignof(CPUArchState)); + /** * env_neg(env) * @env: The architecture environment
Verify that the distance between CPUNegativeOffsetState and CPUArchState is no greater than any alignment requirements. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- include/exec/cpu-all.h | 6 ++++++ 1 file changed, 6 insertions(+)