+Peter/Laurent
On 9/12/22 15:12, Philippe Mathieu-Daudé wrote:
The watchpoint API is specific to TCG system emulation.
Move it to a new compile unit. The inlined stubs are used
for user-mode and non-TCG accelerators.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
MAINTAINERS | 1 +
include/hw/core/cpu.h | 2 +-
softmmu/meson.build | 3 +-
softmmu/physmem.c | 191 ------------------------------------
softmmu/watchpoint.c | 220 ++++++++++++++++++++++++++++++++++++++++++
5 files changed, 224 insertions(+), 193 deletions(-)
create mode 100644 softmmu/watchpoint.c
diff --git a/MAINTAINERS b/MAINTAINERS
index 6966490c94..979c3e2c3f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -120,6 +120,7 @@ M: Richard Henderson <[email protected]>
R: Paolo Bonzini <[email protected]>
S: Maintained
F: softmmu/cpus.c
+F: softmmu/watchpoint.c
F: cpus-common.c
F: page-vary.c
F: page-vary-common.c
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 8830546121..b490cc80d8 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -943,7 +943,7 @@ static inline bool cpu_breakpoint_test(CPUState *cpu, vaddr
pc, int mask)
return false;
}
-#ifdef CONFIG_USER_ONLY
+#if !defined(CONFIG_TCG) || defined(CONFIG_USER_ONLY)
static inline int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
int flags, CPUWatchpoint **watchpoint)
I guess remember Peter saying watchpoints could be supported in
user-mode but I'm not sure... Anyhow if so this can still be done on top of
this patch, which removes 200 LoC from physmem.c which is the 2000 LoC.