From: Max Filippov Date: Sat, 28 Jan 2012 23:15:23 +0000 (+0400) Subject: exec: let cpu_watchpoint_insert accept larger watchpoints X-Git-Tag: v1.1-rc0~286^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0dc23828f1487a3e587f42a0630dd6879ab8f2bb;p=thirdparty%2Fqemu.git 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 --- diff --git a/exec.c b/exec.c index ed091f398d7..80560fad575 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;