[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/29] tcg_funcs: Add tb_check_watchpoint to TCGModuleOps
From: |
Gerd Hoffmann |
Subject: |
[PATCH 19/29] tcg_funcs: Add tb_check_watchpoint to TCGModuleOps |
Date: |
Tue, 31 Aug 2021 14:15:35 +0200 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/exec/translate-all.h | 1 -
include/tcg/tcg-module.h | 2 +-
accel/tcg/tcg-module.c | 5 +++++
accel/tcg/translate-all.c | 3 ++-
softmmu/physmem.c | 2 +-
5 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/include/exec/translate-all.h b/include/exec/translate-all.h
index f313542cdae1..fa9cebd56c60 100644
--- a/include/exec/translate-all.h
+++ b/include/exec/translate-all.h
@@ -29,7 +29,6 @@ void page_collection_unlock(struct page_collection *set);
void tb_invalidate_phys_page_fast(struct page_collection *pages,
tb_page_addr_t start, int len,
uintptr_t retaddr);
-void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr);
#ifdef CONFIG_USER_ONLY
int page_unprotect(target_ulong address, uintptr_t pc);
diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h
index 6069b056f91f..645e8eb39e71 100644
--- a/include/tcg/tcg-module.h
+++ b/include/tcg/tcg-module.h
@@ -15,7 +15,7 @@ struct TCGModuleOps {
void (*tcg_exec_realizefn)(CPUState *cpu, Error **errp);
void (*tb_flush)(CPUState *cpu);
void (*tb_invalidate_phys_range)(tb_page_addr_t start, tb_page_addr_t end);
-
+ void (*tb_check_watchpoint)(CPUState *cpu, uintptr_t retaddr);
};
extern struct TCGModuleOps tcg;
diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c
index dfd7d3bbc2e0..ea0c2a160a97 100644
--- a/accel/tcg/tcg-module.c
+++ b/accel/tcg/tcg-module.c
@@ -29,6 +29,10 @@ static void tb_invalidate_phys_range_stub(tb_page_addr_t
start, tb_page_addr_t e
{
}
+static void tb_check_watchpoint_stub(CPUState *cpu, uintptr_t retaddr)
+{
+}
+
struct TCGModuleOps tcg = {
.tlb_flush = update_cpu_stub,
.tlb_flush_page = tlb_flush_page_stub,
@@ -40,4 +44,5 @@ struct TCGModuleOps tcg = {
.tcg_exec_unrealizefn = update_cpu_stub,
.tb_flush = update_cpu_stub,
.tb_invalidate_phys_range = tb_invalidate_phys_range_stub,
+ .tb_check_watchpoint = tb_check_watchpoint_stub,
};
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index e71e58aff9e7..57129bbeb791 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -1910,7 +1910,7 @@ static bool tb_invalidate_phys_page(tb_page_addr_t addr,
uintptr_t pc)
#endif
/* user-mode: call with mmap_lock held */
-void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr)
+static void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr)
{
TranslationBlock *tb;
@@ -2439,6 +2439,7 @@ static void tcg_module_ops_tb(void)
{
tcg.tb_flush = tb_flush;
tcg.tb_invalidate_phys_range = tb_invalidate_phys_range;
+ tcg.tb_check_watchpoint = tb_check_watchpoint;
}
type_init(tcg_module_ops_tb);
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index f2301f4445cc..634500fd3b7b 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -937,7 +937,7 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr
len,
cpu->watchpoint_hit = wp;
mmap_lock();
- tb_check_watchpoint(cpu, ra);
+ tcg.tb_check_watchpoint(cpu, ra);
if (wp->flags & BP_STOP_BEFORE_ACCESS) {
cpu->exception_index = EXCP_DEBUG;
mmap_unlock();
--
2.31.1
- [PATCH 09/29] tcg/module: add tcg-module.[ch] infrastructure, (continued)
- [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, 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 <=
- [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
- [PATCH 24/29] tcg_i386_funcs: Add update_mxcsr_from_sse_status to TCGI386ModuleOps, Gerd Hoffmann, 2021/08/31
- [PATCH 26/29] tcg_i386_funcs: Add cpu_set_ignne to TCGI386ModuleOps, Gerd Hoffmann, 2021/08/31
- [PATCH 25/29] tcg_i386_funcs: Add x86_register_ferr_irq to TCGI386ModuleOps, Gerd Hoffmann, 2021/08/31
- [PATCH 28/29] tcg_i386_funcs: Add cpu_cc_compute_all to TCGI386ModuleOps, Gerd Hoffmann, 2021/08/31
- [PATCH 27/29] tcg_i386_funcs: Add cpu_x86_update_dr7 to TCGI386ModuleOps, Gerd Hoffmann, 2021/08/31