]> Git Repo - qemu.git/blobdiff - exec.c
exec: flush the whole TLB if a watchpoint crosses a page boundary
[qemu.git] / exec.c
diff --git a/exec.c b/exec.c
index be4be2df3a1f9f23feb3ab14efeb9037f69ecf8d..a0bf9d61c8796586ba2e1e50e4856cb3ada360a3 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -1038,6 +1038,7 @@ int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
                           int flags, CPUWatchpoint **watchpoint)
 {
     CPUWatchpoint *wp;
+    vaddr in_page;
 
     /* forbid ranges which are empty or run off the end of the address space */
     if (len == 0 || (addr + len - 1) < addr) {
@@ -1058,7 +1059,12 @@ int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len,
         QTAILQ_INSERT_TAIL(&cpu->watchpoints, wp, entry);
     }
 
-    tlb_flush_page(cpu, addr);
+    in_page = -(addr | TARGET_PAGE_MASK);
+    if (len <= in_page) {
+        tlb_flush_page(cpu, addr);
+    } else {
+        tlb_flush(cpu);
+    }
 
     if (watchpoint)
         *watchpoint = wp;
This page took 0.023216 seconds and 4 git commands to generate.