summaryrefslogtreecommitdiffstats
path: root/exec.c
diff options
context:
space:
mode:
authorMax Filippov2012-01-29 00:15:23 +0100
committerMax Filippov2012-02-20 17:07:11 +0100
commit0dc23828f1487a3e587f42a0630dd6879ab8f2bb (patch)
tree80378234097123ce8cb4e8b255a6c3eb1f055fda /exec.c
parentexec: fix check_watchpoint exiting cpu_loop (diff)
downloadqemu-0dc23828f1487a3e587f42a0630dd6879ab8f2bb.tar.gz
qemu-0dc23828f1487a3e587f42a0630dd6879ab8f2bb.tar.xz
qemu-0dc23828f1487a3e587f42a0630dd6879ab8f2bb.zip
exec: let cpu_watchpoint_insert accept larger watchpoints
Make cpu_watchpoint_insert accept watchpoints of any power-of-two size up to the target page size. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/exec.c b/exec.c
index ed091f398d..80560fad57 100644
--- a/exec.c
+++ b/exec.c
@@ -1443,7 +1443,8 @@ int cpu_watchpoint_insert(CPUState *env, target_ulong addr, target_ulong len,
CPUWatchpoint *wp;
/* sanity checks: allow power-of-2 lengths, deny unaligned watchpoints */
- if ((len != 1 && len != 2 && len != 4 && len != 8) || (addr & ~len_mask)) {
+ if ((len & (len - 1)) || (addr & ~len_mask) ||
+ len == 0 || len > TARGET_PAGE_SIZE) {
fprintf(stderr, "qemu: tried to set invalid watchpoint at "
TARGET_FMT_lx ", len=" TARGET_FMT_lu "\n", addr, len);
return -EINVAL;