[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/29] tcg_funcs: Add tlb_plugin_lookup to TCGModuleOps
From: |
Gerd Hoffmann |
Subject: |
[PATCH 13/29] tcg_funcs: Add tlb_plugin_lookup to TCGModuleOps |
Date: |
Tue, 31 Aug 2021 14:15:29 +0200 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/tcg/tcg-module.h | 2 ++
accel/tcg/cputlb.c | 3 +++
accel/tcg/tcg-module.c | 7 +++++++
plugins/api.c | 4 ++--
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h
index a14dcdb002db..159cbd3e7ce6 100644
--- a/include/tcg/tcg-module.h
+++ b/include/tcg/tcg-module.h
@@ -8,6 +8,8 @@ struct TCGModuleOps {
void (*tlb_flush_page)(CPUState *cpu, target_ulong addr);
#if defined(CONFIG_SOFTMMU)
void (*tlb_reset_dirty)(CPUState *cpu, ram_addr_t start1, ram_addr_t
length);
+ bool (*tlb_plugin_lookup)(CPUState *cpu, target_ulong addr, int mmu_idx,
+ bool is_store, struct qemu_plugin_hwaddr *data);
#endif
};
extern struct TCGModuleOps tcg;
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index fa9c9064848c..6a7872dff488 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -2773,6 +2773,9 @@ static void tcg_module_ops_tlb(void)
tcg.tlb_flush = tlb_flush;
tcg.tlb_flush_page = tlb_flush_page;
tcg.tlb_reset_dirty = tlb_reset_dirty;
+#ifdef CONFIG_PLUGIN
+ tcg.tlb_plugin_lookup = tlb_plugin_lookup;
+#endif
}
type_init(tcg_module_ops_tlb);
diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c
index febf4e49981c..db3d3e9e9318 100644
--- a/accel/tcg/tcg-module.c
+++ b/accel/tcg/tcg-module.c
@@ -13,6 +13,12 @@ static void tlb_flush_page_stub(CPUState *cpu, target_ulong
addr)
static void tlb_reset_dirty_stub(CPUState *cpu, ram_addr_t start1, ram_addr_t
length)
{
}
+
+static bool tlb_plugin_lookup_stub(CPUState *cpu, target_ulong addr, int
mmu_idx,
+ bool is_store, struct qemu_plugin_hwaddr
*data)
+{
+ return false;
+}
#endif
struct TCGModuleOps tcg = {
@@ -20,5 +26,6 @@ struct TCGModuleOps tcg = {
.tlb_flush_page = tlb_flush_page_stub,
#if defined(CONFIG_SOFTMMU)
.tlb_reset_dirty = tlb_reset_dirty_stub,
+ .tlb_plugin_lookup = tlb_plugin_lookup_stub,
#endif
};
diff --git a/plugins/api.c b/plugins/api.c
index 2d521e6ba825..12b4cb914320 100644
--- a/plugins/api.c
+++ b/plugins/api.c
@@ -280,8 +280,8 @@ struct qemu_plugin_hwaddr
*qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info,
unsigned int mmu_idx = info >> TRACE_MEM_MMU_SHIFT;
hwaddr_info.is_store = info & TRACE_MEM_ST;
- if (!tlb_plugin_lookup(cpu, vaddr, mmu_idx,
- info & TRACE_MEM_ST, &hwaddr_info)) {
+ if (!tcg.tlb_plugin_lookup(cpu, vaddr, mmu_idx,
+ info & TRACE_MEM_ST, &hwaddr_info)) {
error_report("invalid use of qemu_plugin_get_hwaddr");
return NULL;
}
--
2.31.1
- [PATCH 05/29] tcg/module: move tcg_ss to module [accel/tcg], (continued)
- [PATCH 05/29] tcg/module: move tcg_ss to module [accel/tcg], Gerd Hoffmann, 2021/08/31
- [PATCH 04/29] tcg/module: move cputlb.c to module, 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, 2021/08/31
- [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 <=
- [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
- [PATCH 23/29] tcg_i386_funcs: Add update_mxcsr_status to TCGI386ModuleOps, Gerd Hoffmann, 2021/08/31
- [PATCH 22/29] tcg_i386_funcs: Add update_fp_status to TCGI386ModuleOps, Gerd Hoffmann, 2021/08/31