From patchwork Tue Nov 8 11:58:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Labath X-Patchwork-Id: 81291 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1505066qge; Tue, 8 Nov 2016 04:00:52 -0800 (PST) X-Received: by 10.98.213.7 with SMTP id d7mr22489095pfg.3.1478606452464; Tue, 08 Nov 2016 04:00:52 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id e9si36569884pfk.129.2016.11.08.04.00.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Nov 2016 04:00:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=REJECT dis=NONE) header.from=google.com Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c453y-00056z-Fi; Tue, 08 Nov 2016 11:59:38 +0000 Received: from mail-it0-x22e.google.com ([2607:f8b0:4001:c0b::22e]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c453v-00055C-CK for linux-arm-kernel@lists.infradead.org; Tue, 08 Nov 2016 11:59:35 +0000 Received: by mail-it0-x22e.google.com with SMTP id u205so201950370itc.0 for ; Tue, 08 Nov 2016 03:59:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=QPaBOvXsqNRiElIrpuZ50EYg0zagrjDOqDvgtqPuBd0=; b=nKz8s2PtcejnwwUANk5NmwuHEn6JuyeSo63aGmTh9VLXNsKwmdQecI/hYCv/WOe9wL 0Cxz6jPnYReWw5udBE5UhDIzQ1g5ZB/gyx4XLGZnlfnNQ36VbC/OTyb9iRBOq9ZX3G0g H+M1Y3n6zRO5DpdCd/znyr1EsUr31vUDdHBbGH/k/2V0M+7sRX2JDS3Usm62FYJs5F++ RCiuiiVPaZ0FtbRTMdcXzaGld2crD5TTiTqXM2QSzoe2ePp0tlnzLS1eaNLlYoTyLbcE 0gmj8ere5wd07Fxrt8RGyjsfzvMac4vXYsr0PT3565YwUCDPsYUbZOD1ChvbRkSZ4a7u aAGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=QPaBOvXsqNRiElIrpuZ50EYg0zagrjDOqDvgtqPuBd0=; b=JYUwF0xqIxr5C0vYvljaJ5Sn8Pr1Mdufnrw6Gy2OC2qXvS35sR0eP8ACfHeYrI9xc6 hJu4mIGvQWcRkkk8qXAgeMB3BLm3b2j2ehupdTzpFsAjlfrBaDwDSMFWjJf+dTZfyBeB rh/UlbBxGLxOjy5ryezFbfdBPM9hV7VM3a4DtrBNhyAI14EAUEFztqnG3LGLh7kzypak AhnzEKiSsdN9ECg+5CKz7c+TaxCw95KqS42/95O+QhpQ2EpjdIyR4etKLhjN6wJKj30I HG3q3ohuwZhBy3AwigmSUCTbJSKrZMesqq6Yrj11phMSH3dp7jnJT5xfe+hZ7ZmoU3Kw 0BoQ== X-Gm-Message-State: ABUngvfhBuTnRIvpxRHBPEHmEdqPbkntyKDUeFo1A/FXe4dfGevk3aGbHMBtRXShmUVdoJwJIZxEpOBhw3s1R8Qd X-Received: by 10.107.20.133 with SMTP id 127mr12759394iou.187.1478606353784; Tue, 08 Nov 2016 03:59:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.105.20 with HTTP; Tue, 8 Nov 2016 03:58:53 -0800 (PST) In-Reply-To: <20161108032941.GC20591@arm.com> References: <22f4d20911e39efa0b8a6f7082d6839b80bb16b0.1476941895.git.panand@redhat.com> <20161108032941.GC20591@arm.com> From: Pavel Labath Date: Tue, 8 Nov 2016 11:58:53 +0000 Message-ID: Subject: Re: [PATCH V2 3/5] arm64: hw_breakpoint: Handle inexact watchpoint addresses To: Will Deacon , Pratyush Anand X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161108_035935_500636_A279BC57 X-CRM114-Status: GOOD ( 13.89 ) X-Spam-Score: -4.1 (----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-4.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:4001:c0b:0:0:0:22e listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Pavel Labath , onestero@redhat.com, linux-kernel@vger.kernel.org, Jan Kratochvil , linux-arm-kernel Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org >> >> /* Do we need to handle the stepping? */ >> if (is_default_overflow_handler(wp)) >> step = 1; >> - >> -unlock: >> - rcu_read_unlock(); >> } >> + if (min_dist > 0 && min_dist != -1) { >> + /* No exact match found. */ >> + wp = slots[closest_match]; >> + info = counter_arch_bp(wp); >> + info->trigger = addr; >> + perf_bp_event(wp, regs); >> + } > > Why don't we need to bother with the stepping in the case of a non-exact > match? Good catch. I think we do. I must have dropped that part somehow. Pratyush, could you include the attached fixup in the next batch? regards, pavel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c index 4125c21..852c753 100644 --- a/arch/arm64/kernel/hw_breakpoint.c +++ b/arch/arm64/kernel/hw_breakpoint.c @@ -793,6 +793,10 @@ static int watchpoint_handler(unsigned long addr, unsigned int esr, info = counter_arch_bp(wp); info->trigger = addr; perf_bp_event(wp, regs); + + /* Do we need to handle the stepping? */ + if (is_default_overflow_handler(wp)) + step = 1; } rcu_read_unlock();