[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/20] accel/tcg: Restrict tlb_init() / destroy() to TCG
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 08/20] accel/tcg: Restrict tlb_init() / destroy() to TCG |
Date: |
Fri, 24 Jan 2025 00:44:02 +0100 |
Move CPU TLB related methods to accel/tcg/ scope,
in "internal-common.h".
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
accel/tcg/internal-common.h | 11 +++++++++++
include/exec/exec-all.h | 16 ----------------
accel/tcg/user-exec-stub.c | 11 +++++++++++
3 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h
index c8d714256cb..d3186721839 100644
--- a/accel/tcg/internal-common.h
+++ b/accel/tcg/internal-common.h
@@ -53,6 +53,17 @@ TranslationBlock *tb_link_page(TranslationBlock *tb);
void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb,
uintptr_t host_pc);
+/**
+ * tlb_init - initialize a CPU's TLB
+ * @cpu: CPU whose TLB should be initialized
+ */
+void tlb_init(CPUState *cpu);
+/**
+ * tlb_destroy - destroy a CPU's TLB
+ * @cpu: CPU whose TLB should be destroyed
+ */
+void tlb_destroy(CPUState *cpu);
+
bool tcg_exec_realizefn(CPUState *cpu, Error **errp);
void tcg_exec_unrealizefn(CPUState *cpu);
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index d9045c9ac4c..8eb0df48f94 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -29,16 +29,6 @@
#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG)
/* cputlb.c */
-/**
- * tlb_init - initialize a CPU's TLB
- * @cpu: CPU whose TLB should be initialized
- */
-void tlb_init(CPUState *cpu);
-/**
- * tlb_destroy - destroy a CPU's TLB
- * @cpu: CPU whose TLB should be destroyed
- */
-void tlb_destroy(CPUState *cpu);
/**
* tlb_flush_page:
* @cpu: CPU whose TLB should be flushed
@@ -223,12 +213,6 @@ void tlb_set_page(CPUState *cpu, vaddr addr,
hwaddr paddr, int prot,
int mmu_idx, vaddr size);
#else
-static inline void tlb_init(CPUState *cpu)
-{
-}
-static inline void tlb_destroy(CPUState *cpu)
-{
-}
static inline void tlb_flush_page(CPUState *cpu, vaddr addr)
{
}
diff --git a/accel/tcg/user-exec-stub.c b/accel/tcg/user-exec-stub.c
index 4fbe2dbdc88..1d52f48226a 100644
--- a/accel/tcg/user-exec-stub.c
+++ b/accel/tcg/user-exec-stub.c
@@ -1,6 +1,7 @@
#include "qemu/osdep.h"
#include "hw/core/cpu.h"
#include "exec/replay-core.h"
+#include "internal-common.h"
void cpu_resume(CPUState *cpu)
{
@@ -18,6 +19,16 @@ void cpu_exec_reset_hold(CPUState *cpu)
{
}
+/* User mode emulation does not support softmmu yet. */
+
+void tlb_init(CPUState *cpu)
+{
+}
+
+void tlb_destroy(CPUState *cpu)
+{
+}
+
/* User mode emulation does not support record/replay yet. */
bool replay_exception(void)
--
2.47.1
- [PATCH 03/20] gdbstub: Check for TCG before calling tb_flush(), (continued)
- [PATCH 03/20] gdbstub: Check for TCG before calling tb_flush(), Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 04/20] cpus: Cache CPUClass early in instance_init() handler, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 05/20] cpus: Keep default fields initialization in cpu_common_initfn(), Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 06/20] accel/kvm: Remove unused 'system/cpus.h' header in kvm-cpus.h, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 07/20] accel/tcg: Build tcg_flags helpers as common code, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 08/20] accel/tcg: Restrict tlb_init() / destroy() to TCG,
Philippe Mathieu-Daudé <=
- [PATCH 09/20] accel/tcg: Restrict 'icount_align_option' global to TCG, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 10/20] accel/tcg: Rename 'hw/core/tcg-cpu-ops.h' -> 'accel/tcg/cpu-ops.h', Philippe Mathieu-Daudé, 2025/01/23
- [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