From patchwork Sat Feb 18 17:11:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 142049 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 31A56B6F98 for ; Sun, 19 Feb 2012 05:33:45 +1100 (EST) Received: from localhost ([::1]:56950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rynps-0005DE-Ql for incoming@patchwork.ozlabs.org; Sat, 18 Feb 2012 12:12:36 -0500 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) Received-SPF: pass (google.com: domain of jcmvbkbc@gmail.com designates 10.204.145.210 as permitted sender) client-ip=10.204.145.210; Authentication-Results: mr.google.com; spf=pass (google.com: domain of jcmvbkbc@gmail.com designates 10.204.145.210 as permitted sender) smtp.mail=jcmvbkbc@gmail.com; dkim=pass header.i=jcmvbkbc@gmail.com Received: from mr.google.com ([10.204.145.210]) by 10.204.145.210 with SMTP id e18mr7509419bkv.61.1329585142686 (num_hops = 1); Sat, 18 Feb 2012 09:12:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=TLLpP5oF1kIJBBZxTX0GySblBKZ4qbSCu1hGB0VPnus=; b=bqHCPsycIsg37xhlsXrqMQWMbcksjRbnIqBzOfuNew8vlriQYYl+NP7ICRs1MDTgTj EO8KIYs7hbMVjs+bBI5PMWNv2EPoXFec8ff77b3P03KG1dy6IXEsKGjM1KSnrke4koCD KWSiOTyVNdu/Tlg17xfEDkGVBwRaM4fYG0CL8= Received: by 10.204.145.210 with SMTP id e18mr6086418bkv.61.1329585142608; Sat, 18 Feb 2012 09:12:22 -0800 (PST) Received: from octofox.metropolis ([188.134.19.124]) by mx.google.com with ESMTPS id o7sm28887600bkw.16.2012.02.18.09.12.21 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 18 Feb 2012 09:12:21 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Sat, 18 Feb 2012 21:11:40 +0400 Message-Id: <1329585103-31371-9-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 1.7.7.6 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> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.45 Cc: blauwirbel@gmail.com, Max Filippov , aliguori@us.ibm.com, afaerber@suse.de Subject: [Qemu-devel] [PATCH 09/12] exec: let cpu_watchpoint_insert accept larger watchpoints X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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;