[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/29] tcg_funcs: Add tlb_flush_page to TCGModuleOps
From: |
Gerd Hoffmann |
Subject: |
[PATCH 11/29] tcg_funcs: Add tlb_flush_page to TCGModuleOps |
Date: |
Tue, 31 Aug 2021 14:15:27 +0200 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/exec/exec-all.h | 3 ---
include/tcg/tcg-module.h | 3 +++
accel/tcg/cputlb.c | 1 +
accel/tcg/tcg-module.c | 5 +++++
softmmu/physmem.c | 4 ++--
target/arm/helper.c | 4 ++--
6 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index ddb1ab797978..43d89699e989 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -328,9 +328,6 @@ static inline void tlb_init(CPUState *cpu)
static inline void tlb_destroy(CPUState *cpu)
{
}
-static inline void tlb_flush_page(CPUState *cpu, target_ulong addr)
-{
-}
static inline void tlb_flush_page_all_cpus(CPUState *src, target_ulong addr)
{
}
diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h
index b94bfdd362ed..a903e3ee62c0 100644
--- a/include/tcg/tcg-module.h
+++ b/include/tcg/tcg-module.h
@@ -1,8 +1,11 @@
#ifndef TCG_MODULE_H
#define TCG_MODULE_H
+#include "exec/exec-all.h"
+
struct TCGModuleOps {
void (*tlb_flush)(CPUState *cpu);
+ void (*tlb_flush_page)(CPUState *cpu, target_ulong addr);
};
extern struct TCGModuleOps tcg;
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 40c3d1b65ac5..1fcdb71a10a0 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -2771,6 +2771,7 @@ uint64_t cpu_ldq_code(CPUArchState *env, abi_ptr addr)
static void tcg_module_ops_tlb(void)
{
tcg.tlb_flush = tlb_flush;
+ tcg.tlb_flush_page = tlb_flush_page;
}
type_init(tcg_module_ops_tlb);
diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c
index a1e5728c8c1b..4d62160628bd 100644
--- a/accel/tcg/tcg-module.c
+++ b/accel/tcg/tcg-module.c
@@ -5,6 +5,11 @@ static void update_cpu_stub(CPUState *cpu)
{
}
+static void tlb_flush_page_stub(CPUState *cpu, target_ulong addr)
+{
+}
+
struct TCGModuleOps tcg = {
.tlb_flush = update_cpu_stub,
+ .tlb_flush_page = tlb_flush_page_stub,
};
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index dd17f80120dc..8fa5376de1c9 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -794,7 +794,7 @@ int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr
len,
in_page = -(addr | TARGET_PAGE_MASK);
if (len <= in_page) {
- tlb_flush_page(cpu, addr);
+ tcg.tlb_flush_page(cpu, addr);
} else {
tcg.tlb_flush(cpu);
}
@@ -825,7 +825,7 @@ void cpu_watchpoint_remove_by_ref(CPUState *cpu,
CPUWatchpoint *watchpoint)
{
QTAILQ_REMOVE(&cpu->watchpoints, watchpoint, entry);
- tlb_flush_page(cpu, watchpoint->vaddr);
+ tcg.tlb_flush_page(cpu, watchpoint->vaddr);
g_free(watchpoint);
}
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 0da65edd78cd..6aa38cde15fe 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -772,7 +772,7 @@ static void tlbimva_write(CPUARMState *env, const
ARMCPRegInfo *ri,
if (tlb_force_broadcast(env)) {
tlb_flush_page_all_cpus_synced(cs, value);
} else {
- tlb_flush_page(cs, value);
+ tcg.tlb_flush_page(cs, value);
}
}
@@ -799,7 +799,7 @@ static void tlbimvaa_write(CPUARMState *env, const
ARMCPRegInfo *ri,
if (tlb_force_broadcast(env)) {
tlb_flush_page_all_cpus_synced(cs, value);
} else {
- tlb_flush_page(cs, value);
+ tcg.tlb_flush_page(cs, value);
}
}
--
2.31.1
- [PATCH 01/29] build: temporarily disable modular tcg, (continued)
- [PATCH 01/29] build: temporarily disable modular tcg, Gerd Hoffmann, 2021/08/31
- [PATCH 03/29] tcg/module: move hmp.c to module, Gerd Hoffmann, 2021/08/31
- [PATCH 02/29] plugins: register qemu_plugin_opts using opts_init(), Gerd Hoffmann, 2021/08/31
- [PATCH 04/29] tcg/module: move cputlb.c to module, Gerd Hoffmann, 2021/08/31
- [PATCH 05/29] tcg/module: move tcg_ss to module [accel/tcg], Gerd Hoffmann, 2021/08/31
- [PATCH 06/29] tcg/module: move tcg_ss to module [tcg], Gerd Hoffmann, 2021/08/31
- [PATCH 07/29] tcg/module: move files to module [target/i386/tcg], Gerd Hoffmann, 2021/08/31
- [PATCH 08/29] move cpu-exec-common.c from tcg module to core qemu [accel/tcg], Gerd Hoffmann, 2021/08/31
- [PATCH 09/29] tcg/module: add tcg-module.[ch] infrastructure, Gerd Hoffmann, 2021/08/31
- [PATCH 10/29] tcg_funcs: Add tlb_flush to TCGModuleOps, Gerd Hoffmann, 2021/08/31
- [PATCH 11/29] tcg_funcs: Add tlb_flush_page to TCGModuleOps,
Gerd Hoffmann <=
- [PATCH 12/29] tcg_funcs: Add tlb_reset_dirty to TCGModuleOps, Gerd Hoffmann, 2021/08/31
- [PATCH 14/29] tcg_funcs:Add tcg_exec_{realizefn, unrealizefn} to TCGModuleOps, Gerd Hoffmann, 2021/08/31
- [PATCH 13/29] tcg_funcs: Add tlb_plugin_lookup to TCGModuleOps, Gerd Hoffmann, 2021/08/31
- [PATCH 15/29] tcg_funcs: Add tb_flush to TCGModuleOps, Gerd Hoffmann, 2021/08/31
- [PATCH 17/29] tcg: drop tb_invalidate_phys_page_range(), Gerd Hoffmann, 2021/08/31
- [PATCH 16/29] tcg: use tb_page_addr_t for tb_invalidate_phys_range(), Gerd Hoffmann, 2021/08/31
- [PATCH 18/29] tcg_funcs: Add tb_invalidate_phys_range to TCGModuleOps, Gerd Hoffmann, 2021/08/31
- [PATCH 19/29] tcg_funcs: Add tb_check_watchpoint to TCGModuleOps, Gerd Hoffmann, 2021/08/31
- [PATCH 21/29] tcg_funcs: Add curr_cflags to TCGModuleOps, Gerd Hoffmann, 2021/08/31
- [PATCH 20/29] tcg_funcs: Add cpu_restore_state to TCGModuleOps, Gerd Hoffmann, 2021/08/31