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: 9417205 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 22FB660585 for ; Tue, 8 Nov 2016 12:01:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13C3E28ABA for ; Tue, 8 Nov 2016 12:01:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07CCB28FB1; Tue, 8 Nov 2016 12:01:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BF99628ABA for ; Tue, 8 Nov 2016 12:01:26 +0000 (UTC) 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-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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP >> >> /* 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 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();