From patchwork Mon Jul 31 10:40:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pratyush Anand X-Patchwork-Id: 9871567 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 40084602F0 for ; Mon, 31 Jul 2017 10:42:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31F0828572 for ; Mon, 31 Jul 2017 10:42:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 268132857D; Mon, 31 Jul 2017 10:42:18 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A626928572 for ; Mon, 31 Jul 2017 10:42:14 +0000 (UTC) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=KgSuNwD3RZjF5Ng06+PzIJgyU6UnbTdpKwfJYf+kPcE=; b=Su8v5Zret7gooybu5eJCtzlHpM 3sfmsj0gCkwZ26RATcR5iJtM/8Vt+msgfTaQGOPm9ihXE6O8SJJDfQJ74PTxOreQAlQ9zerlMPpO9 xAz4ZBtHylj61/hOpLegaKV27yokeXn6lU1o8NG4DIPVDhOG4riWHHGuvj/h9XECIgK6pZykD5CzW KPDbmc+35QzVSHhCfVVOhXAAwGaQr0ZYPZGqc5ltgs3fuh3WN4iK83P2L49ggvzghcKnh33U7aA60 WJzOOt+32FIhnPHfAxWOJ7uaAVOnEfW1iQssG2pT05dwp/xC7QrpRDyAJolX027xlCeNduc8X5Ouf h3e785nA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dc89K-0005W1-GH; Mon, 31 Jul 2017 10:42:10 +0000 Received: from mail-pf0-f171.google.com ([209.85.192.171]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dc88j-0004jR-Gg for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2017 10:41:40 +0000 Received: by mail-pf0-f171.google.com with SMTP id q85so119356904pfq.1 for ; Mon, 31 Jul 2017 03:41:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=2/MISTM90H2SbeXav4h54eUgIZstBTs9+3+hpN1ajYI=; b=i4VaF3MeCnj4TNOBRXVumKX+PmuPh4zitHt8zSmDE4mkGtgouhawF9zMQAP2FMgtiS JLIKze3VQouWyuP938CYbMMygek2a5jdWM0LYpRPo/NaCKzN7uKTr6PDlXi+hRipm7Dd 5YAUkdbXMVPVVzM8YNrW9zx4SYmqfFF4PBafFmh8JdYRYqfCCqmII02Gb/2GmjpuYXHW JN1fGPO+uMK8Pk13GMhqjWjhvvs8roXiUUx7h5lJpYkWxPrdVFrJjRgVczoBokYp+3bW g003sSRaUSXLHjlta+e4jZTL1xR4JEYbGT62Xdz4NNLnXgZDkuM06IyS/NKfWDOGZMhE 9HyQ== X-Gm-Message-State: AIVw1132kZgD2WTzRdJOnc0BXI2xBkZTqSHhwe6DXpU8OZQlfPdgPSpx cGezaAOMJ7XS1cawPnk4mQ== X-Received: by 10.99.125.11 with SMTP id y11mr15267076pgc.19.1501497671269; Mon, 31 Jul 2017 03:41:11 -0700 (PDT) Received: from localhost ([171.50.171.30]) by smtp.gmail.com with ESMTPSA id p27sm31984391pfl.23.2017.07.31.03.41.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 Jul 2017 03:41:10 -0700 (PDT) From: Pratyush Anand To: linux-arm-kernel@lists.infradead.org, Will Deacon , Mark Rutland Subject: [PATCH v3 2/5] arm64: use hw_breakpoint_needs_single_step() to decide if step is needed Date: Mon, 31 Jul 2017 16:10:30 +0530 Message-Id: <2d95da25d614b49196c4d7606334fdd062d88d37.1501496603.git.panand@redhat.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170731_034133_756867_CDD51233 X-CRM114-Status: GOOD ( 12.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pratyush Anand , takahiro.akashi@linaro.org, linux-kernel@vger.kernel.org, huawei.libin@huawei.com MIME-Version: 1.0 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 Currently we use is_default_overflow_handler() to decide whether a "step" will be needed or not. However, is_default_overflow_handler() is true only for perf implementation. There can be some custom kernel module tests like samples/hw_breakpoint/data_breakpoint.c which can rely on default step handler. hw_breakpoint_needs_single_step() will be true if any hw_breakpoint user wants to use default step handler and sets step_needed in hw_perf_event. Signed-off-by: Pratyush Anand --- arch/arm64/kernel/hw_breakpoint.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c index 749f81779420..9a73f85ab9ad 100644 --- a/arch/arm64/kernel/hw_breakpoint.c +++ b/arch/arm64/kernel/hw_breakpoint.c @@ -661,7 +661,7 @@ static int breakpoint_handler(unsigned long unused, unsigned int esr, perf_bp_event(bp, regs); /* Do we need to handle the stepping? */ - if (is_default_overflow_handler(bp)) + if (hw_breakpoint_needs_single_step(bp)) step = 1; unlock: rcu_read_unlock(); @@ -789,7 +789,7 @@ static int watchpoint_handler(unsigned long addr, unsigned int esr, perf_bp_event(wp, regs); /* Do we need to handle the stepping? */ - if (is_default_overflow_handler(wp)) + if (hw_breakpoint_needs_single_step(wp)) step = 1; } if (min_dist > 0 && min_dist != -1) { @@ -800,7 +800,7 @@ static int watchpoint_handler(unsigned long addr, unsigned int esr, perf_bp_event(wp, regs); /* Do we need to handle the stepping? */ - if (is_default_overflow_handler(wp)) + if (hw_breakpoint_needs_single_step(wp)) step = 1; } rcu_read_unlock();