aboutsummaryrefslogtreecommitdiff
path: root/accel/tcg/translator.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-09-15 15:41:39 -0700
committerRichard Henderson <richard.henderson@linaro.org>2023-10-03 08:01:02 -0700
commit464dacf6090d859a919596ba7452498c7446ced1 (patch)
tree40dff34bf19b1d9282232877d443a43fb4be8217 /accel/tcg/translator.c
parente62de981113350194f9c1f78a6a8fd35c03b1599 (diff)
accel/tcg: Move can_do_io to CPUNegativeOffsetState
Minimize the displacement to can_do_io, since it may be touched at the start of each TranslationBlock. It fits into other padding within the substructure. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'accel/tcg/translator.c')
-rw-r--r--accel/tcg/translator.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
index b3e12d61e9..460bfc4c74 100644
--- a/accel/tcg/translator.c
+++ b/accel/tcg/translator.c
@@ -20,9 +20,11 @@ static void set_can_do_io(DisasContextBase *db, bool val)
{
if (db->saved_can_do_io != val) {
db->saved_can_do_io = val;
- tcg_gen_st_i32(tcg_constant_i32(val), cpu_env,
- offsetof(ArchCPU, parent_obj.can_do_io) -
- offsetof(ArchCPU, env));
+
+ QEMU_BUILD_BUG_ON(sizeof_field(CPUState, neg.can_do_io) != 1);
+ tcg_gen_st8_i32(tcg_constant_i32(val), cpu_env,
+ offsetof(ArchCPU, parent_obj.neg.can_do_io) -
+ offsetof(ArchCPU, env));
}
}
@@ -83,7 +85,7 @@ static TCGOp *gen_tb_start(DisasContextBase *db, uint32_t cflags)
}
/*
- * cpu->can_do_io is set automatically here at the beginning of
+ * cpu->neg.can_do_io is set automatically here at the beginning of
* each translation block. The cost is minimal, plus it would be
* very easy to forget doing it in the translator.
*/