Watchpoints are specific to the TCG accelerator. Restrict
the cpu_watchpoint_remove_all() call.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
 target/i386/cpu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 37803cd7249..9831e2bc210 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -9184,7 +9184,9 @@ static void x86_cpu_reset_hold(Object *obj, ResetType 
type)
     env->dr[6] = DR6_FIXED_1;
     env->dr[7] = DR7_FIXED_1;
     cpu_breakpoint_remove_all(cs, BP_CPU);
-    cpu_watchpoint_remove_all(cs, BP_CPU);
+    if (tcg_enabled()) {
+        cpu_watchpoint_remove_all(cs, BP_CPU);
+    }
 
     cr4 = 0;
     xcr0 = XSTATE_FP_MASK;
-- 
2.52.0


Reply via email to