From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rynpg-0004qp-LR for qemu-devel@nongnu.org; Sat, 18 Feb 2012 12:12:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rynpf-0005rW-JE for qemu-devel@nongnu.org; Sat, 18 Feb 2012 12:12:24 -0500 Received: from mail-bk0-f45.google.com ([209.85.214.45]:63774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rynpe-0005kY-Us for qemu-devel@nongnu.org; Sat, 18 Feb 2012 12:12:23 -0500 Received: by mail-bk0-f45.google.com with SMTP id e19so4291536bku.4 for ; Sat, 18 Feb 2012 09:12:22 -0800 (PST) From: Max Filippov Date: Sat, 18 Feb 2012 21:11:40 +0400 Message-Id: <1329585103-31371-9-git-send-email-jcmvbkbc@gmail.com> In-Reply-To: <1329585103-31371-1-git-send-email-jcmvbkbc@gmail.com> References: <1329564636-29883-1-git-send-email-jcmvbkbc@gmail.com> <1329585103-31371-1-git-send-email-jcmvbkbc@gmail.com> Subject: [Qemu-devel] [PATCH 09/12] exec: let cpu_watchpoint_insert accept larger watchpoints List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: blauwirbel@gmail.com, Max Filippov , aliguori@us.ibm.com, afaerber@suse.de Make cpu_watchpoint_insert accept watchpoints of any power-of-two size up to the target page size. Signed-off-by: Max Filippov --- exec.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/exec.c b/exec.c index ed091f3..80560fa 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; -- 1.7.7.6