qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: anjo@rev.ng, ale@rev.ng, philmd@linaro.org
Subject: [PATCH v2 07/24] accel/tcg: Validate placement of CPUNegativeOffsetState
Date: Wed, 13 Sep 2023 19:44:18 -0700	[thread overview]
Message-ID: <20230914024435.1381329-8-richard.henderson@linaro.org> (raw)
In-Reply-To: <20230914024435.1381329-1-richard.henderson@linaro.org>

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
-- 
2.34.1



  parent reply	other threads:[~2023-09-14  2:46 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14  2:44 [PATCH v2 00/24] Reduce usage of CPUArchState in cputlb.c Richard Henderson
2023-09-14  2:44 ` [PATCH v2 01/24] target/arm: Replace TARGET_PAGE_ENTRY_EXTRA Richard Henderson
2023-09-14  2:44 ` [PATCH v2 02/24] accel/tcg: Move CPUTLB definitions from cpu-defs.h Richard Henderson
2023-09-14 10:47   ` Anton Johansson via
2023-09-14  2:44 ` [PATCH v2 03/24] qom: Propagate alignment through type system Richard Henderson
2023-09-14  5:59   ` Philippe Mathieu-Daudé
2023-09-14  2:44 ` [PATCH v2 04/24] target/*: Use __alignof not __alignof__ Richard Henderson
2023-09-14  6:01   ` Philippe Mathieu-Daudé
2023-09-14  2:44 ` [PATCH v2 05/24] target/arm: Remove size and alignment for cpu subclasses Richard Henderson
2023-09-14  6:02   ` Philippe Mathieu-Daudé
2023-09-14  2:44 ` [PATCH v2 06/24] target/*: Add instance_align to all cpu base classes Richard Henderson
2023-09-14  6:04   ` Philippe Mathieu-Daudé
2023-09-14  2:44 ` Richard Henderson [this message]
2023-09-14 10:19   ` [PATCH v2 07/24] accel/tcg: Validate placement of CPUNegativeOffsetState Anton Johansson via
2023-09-14  2:44 ` [PATCH v2 08/24] accel/tcg: Move CPUNegativeOffsetState into CPUState Richard Henderson
2023-09-14 10:24   ` Anton Johansson via
2023-09-14  2:44 ` [PATCH v2 09/24] accel/tcg: Remove CPUState.icount_decr_ptr Richard Henderson
2023-09-14 10:28   ` Anton Johansson via
2023-09-14  2:44 ` [PATCH v2 10/24] accel/tcg: Move can_do_io to CPUNegativeOffsetState Richard Henderson
2023-09-14  6:08   ` Philippe Mathieu-Daudé
2023-09-14  2:44 ` [PATCH v2 11/24] accel/tcg: Remove cpu_neg() Richard Henderson
2023-09-14  6:08   ` Philippe Mathieu-Daudé
2023-09-14  2:44 ` [PATCH v2 12/24] tcg: Rename cpu_env to tcg_env Richard Henderson
2023-09-14  6:10   ` Philippe Mathieu-Daudé
2023-09-14 15:30     ` Philippe Mathieu-Daudé
2023-09-14  2:44 ` [PATCH v2 13/24] accel/tcg: Replace CPUState.env_ptr with cpu_env() Richard Henderson
2023-09-14 10:38   ` Anton Johansson via
2023-09-14 18:12   ` Philippe Mathieu-Daudé
2023-09-14 18:15     ` Richard Henderson
2023-09-14 18:38       ` Philippe Mathieu-Daudé
2023-09-14 18:53         ` Richard Henderson
2023-09-14  2:44 ` [PATCH v2 14/24] accel/tcg: Remove cpu_set_cpustate_pointers Richard Henderson
2023-09-14  6:12   ` Philippe Mathieu-Daudé
2023-09-14  2:44 ` [PATCH v2 15/24] accel/tcg: Remove env_neg() Richard Henderson
2023-09-14 10:39   ` Anton Johansson via
2023-09-14  2:44 ` [PATCH v2 16/24] tcg: Remove TCGContext.tlb_fast_offset Richard Henderson
2023-09-14 10:43   ` Anton Johansson via
2023-09-14  2:44 ` [PATCH v2 17/24] accel/tcg: Modify tlb_*() to use CPUState Richard Henderson
2023-09-14  2:44 ` [PATCH v2 18/24] accel/tcg: Modify probe_access_internal() " Richard Henderson
2023-09-14  6:15   ` Philippe Mathieu-Daudé
2023-09-14  2:44 ` [PATCH v2 19/24] accel/tcg: Modifies memory access functions " Richard Henderson
2023-09-14  6:18   ` Philippe Mathieu-Daudé
2023-09-14  2:44 ` [PATCH v2 20/24] accel/tcg: Modify atomic_mmu_lookup() " Richard Henderson
2023-09-14  6:20   ` Philippe Mathieu-Daudé
2023-09-14  2:44 ` [PATCH v2 21/24] accel/tcg: Use CPUState in atomicity helpers Richard Henderson
2023-09-14  6:22   ` Philippe Mathieu-Daudé
2023-09-14  2:44 ` [PATCH v2 22/24] accel/tcg: Remove env_tlb() Richard Henderson
2023-09-14 15:44   ` Philippe Mathieu-Daudé
2023-09-14 16:24     ` Anton Johansson via
2023-09-14  2:44 ` [PATCH v2 23/24] accel/tcg: Unify user and softmmu do_[st|ld]*_mmu() Richard Henderson
2023-09-14  2:44 ` [PATCH v2 24/24] accel/tcg: move ld/st helpers to ldst_common.c.inc Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230914024435.1381329-8-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=ale@rev.ng \
    --cc=anjo@rev.ng \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).