diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-01-23 23:30:04 +0100 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-03-06 15:46:18 +0100 |
commit | 530c7139f64aa0e45b61ce9abecb7df8c55b3f12 (patch) | |
tree | 9089a1b6157d43673617c792eb47fa098302c91b | |
parent | c90476325cf669d9bba15f4fd8d8637926f272a2 (diff) | |
download | qemu-530c7139f64aa0e45b61ce9abecb7df8c55b3f12.zip qemu-530c7139f64aa0e45b61ce9abecb7df8c55b3f12.tar.gz qemu-530c7139f64aa0e45b61ce9abecb7df8c55b3f12.tar.bz2 |
cpus: Restrict cpu_common_post_load() code to TCG
CPU_INTERRUPT_EXIT was removed in commit 3098dba01c7
("Use a dedicated function to request exit from execution
loop"), tlb_flush() and tb_flush() are related to TCG
accelerator.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250123234415.59850-17-philmd@linaro.org>
-rw-r--r-- | cpu-target.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/cpu-target.c b/cpu-target.c index b925b93..48446c9 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -46,22 +46,25 @@ #ifndef CONFIG_USER_ONLY static int cpu_common_post_load(void *opaque, int version_id) { - CPUState *cpu = opaque; - - /* - * 0x01 was CPU_INTERRUPT_EXIT. This line can be removed when the - * version_id is increased. - */ - cpu->interrupt_request &= ~0x01; - tlb_flush(cpu); - - /* - * loadvm has just updated the content of RAM, bypassing the - * usual mechanisms that ensure we flush TBs for writes to - * memory we've translated code from. So we must flush all TBs, - * which will now be stale. - */ - tb_flush(cpu); + if (tcg_enabled()) { + CPUState *cpu = opaque; + + /* + * 0x01 was CPU_INTERRUPT_EXIT. This line can be removed when the + * version_id is increased. + */ + cpu->interrupt_request &= ~0x01; + + tlb_flush(cpu); + + /* + * loadvm has just updated the content of RAM, bypassing the + * usual mechanisms that ensure we flush TBs for writes to + * memory we've translated code from. So we must flush all TBs, + * which will now be stale. + */ + tb_flush(cpu); + } return 0; } |