From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C39BC33C8C for ; Mon, 6 Jan 2020 17:41:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30FE2207FF for ; Mon, 6 Jan 2020 17:41:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DHGrRnRc"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="OzOCByQJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30FE2207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RAKhRkp7BVYwqdk7Wmahw48jn4QEWvEd0LhZ1u2ov/0=; b=DHGrRnRc7eupHL G1SgqJpNsS0X9wkcn8PE+lJdYwrQkl62kzchNmLQGFs/4FPaaKhdCQBknU+Bfp2gWBmSl+/4V/GOF TyFTeMGfvZMjEWHr/RIquL6/mJ2K8C+CbwRP1J/MXq5/OEzflZ7C/6B5o0Ic9ZPYa4Ol/e9oCaDCU 2qIVpvxTppBskDcNEbs5141mH1Rcyzg/Y9DrF02mGC7e9RIflH6kzK99fXOfXFBy+gUVBC8/MvrKu XmiSuP5KuPa3vdi/uZaX8hk9+3ujdWNilMnggv0QVgB7QRlGm3AD1AVTq637n+nBkyX7yJTbvYCUw MXO/+Tz1w3AOSiwHxWLw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ioWN4-0002zR-7l; Mon, 06 Jan 2020 17:40:54 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ioWN1-0002yp-5m for linux-arm-kernel@lists.infradead.org; Mon, 06 Jan 2020 17:40:52 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 57FC0207FF; Mon, 6 Jan 2020 17:40:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578332450; bh=bIKoVq4hl/ECNJKsDFS86OjWRdm/wDV25FzE9e9dkIE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OzOCByQJUep+YkGdjIFATSvSmNO39GTmt/W4SruqlilzlYqIS9Aox9DpAAXsbXzKK ikAhcBRxSRwBzdq+GuVRk0xvRO5WJ2WuDhSAOARW82MI4ERsA6BNBq19HWvE0bJeeM u0WNumDWCk/3WMSHz79ronZ0Jwb0kcQtSfTnvCzU= Date: Mon, 6 Jan 2020 17:40:46 +0000 From: Will Deacon To: Doug Anderson Subject: Re: [PATCH] ARM: hw_breakpoint: Handle inexact watchpoint addresses Message-ID: <20200106174045.GD9676@willie-the-truck> References: <20191019111216.1.I82eae759ca6dc28a245b043f485ca490e3015321@changeid> <20191120191813.GD4799@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200106_094051_236978_5F07068E X-CRM114-Status: GOOD ( 23.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Pratyush Anand , Pavel Labath , Russell King , LKML , Kazuhiro Inaba , Matthias Kaehlcke , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Dec 02, 2019 at 08:36:19AM -0800, Doug Anderson wrote: > On Wed, Nov 20, 2019 at 11:18 AM Will Deacon wrote: > > > > On Sat, Oct 19, 2019 at 11:12:26AM -0700, Douglas Anderson wrote: > > > This is commit fdfeff0f9e3d ("arm64: hw_breakpoint: Handle inexact > > > watchpoint addresses") but ported to arm32, which has the same > > > problem. > > > > > > This problem was found by Android CTS tests, notably the > > > "watchpoint_imprecise" test [1]. I tested locally against a copycat > > > (simplified) version of the test though. > > > > > > [1] https://android.googlesource.com/platform/bionic/+/master/tests/sys_ptrace_test.cpp > > > > > > Signed-off-by: Douglas Anderson > > > --- > > > > > > arch/arm/kernel/hw_breakpoint.c | 96 ++++++++++++++++++++++++--------- > > > 1 file changed, 70 insertions(+), 26 deletions(-) > > > > Sorry for taking so long to look at this. After wrapping my head around the > > logic again > > Yeah. It was a little weird and (unfortunately) arbitrarily different > in some places compared to the arm64 code. > > > > I think it looks fine, so please put it into the patch system > > with my Ack: > > > > Acked-by: Will Deacon > > Thanks! Submitted as: > > https://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=8944/1 > > > > One interesting difference between the implementation here and the arm64 > > code is that I think if you have multiple watchpoints, all of which fire > > with a distance != 0, then arm32 will actually report them all whereas > > you'd only get one on arm64. > > Are you sure about that? The "/* No exact match found. */" code is > outside the for loop so it should only be able to trigger for exactly > one breakpoint, no? I didn't test it, but I think that we'll convert the first watchpoint into a mismatch breakpoint on arm32 and then when we resume execution, we'll hit the subsequent watchpoint and so on until we actually manage to "step" the instruction. On arm64, we'll use hardware step directly and therefore disable all watchpoints prior to performing the step. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel