[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/20] cpus: Restrict cpu_common_post_load() code to TCG
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 16/20] cpus: Restrict cpu_common_post_load() code to TCG |
Date: |
Fri, 24 Jan 2025 00:44:10 +0100 |
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>
---
cpu-target.c | 33 +++++++++++++++++++--------------
1 file changed, 19 insertions(+), 14 deletions(-)
diff --git a/cpu-target.c b/cpu-target.c
index a2999e7c3c0..c05ef1ff096 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -45,22 +45,27 @@
#ifndef CONFIG_USER_ONLY
static int cpu_common_post_load(void *opaque, int version_id)
{
- CPUState *cpu = opaque;
+#ifdef CONFIG_TCG
+ 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);
+ /*
+ * 0x01 was CPU_INTERRUPT_EXIT. This line can be removed when the
+ * version_id is increased.
+ */
+ cpu->interrupt_request &= ~0x01;
- /*
- * 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);
+ 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);
+ }
+#endif
return 0;
}
--
2.47.1
- [PATCH 11/20] accel: Rename 'hw/core/accel-cpu.h' -> 'accel/accel-cpu-target.h', (continued)
- [PATCH 11/20] accel: Rename 'hw/core/accel-cpu.h' -> 'accel/accel-cpu-target.h', Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 12/20] accel/accel-cpu-target.h: Include missing 'cpu.h' header, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 13/20] accel: Forward-declare AccelOpsClass in 'qemu/typedefs.h', Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 14/20] accel/tcg: Move cpu_memory_rw_debug() user implementation to user-exec.c, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 15/20] cpus: Fix style in cpu-target.c, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 16/20] cpus: Restrict cpu_common_post_load() code to TCG,
Philippe Mathieu-Daudé <=
- [PATCH 17/20] cpus: Have cpu_class_init_props() per user / system emulation, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 18/20] cpus: Have cpu_exec_initfn() per user / system emulation, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 19/20] cpus: Register VMState per user / system emulation, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 20/20] cpus: Build cpu_exec_[un]realizefn() methods once, Philippe Mathieu-Daudé, 2025/01/23