All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pratyush Anand <panand@redhat.com>
To: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com,
	Will Deacon <will.deacon@arm.com>
Cc: huawei.libin@huawei.com, Pratyush Anand <panand@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH V2 2/4] arm64: use hw_breakpoint_needs_single_step() to decide if step is needed
Date: Fri,  7 Jul 2017 17:33:58 +0530	[thread overview]
Message-ID: <53c57967c400d44bb0b3b3622d8dbe0108642247.1499416107.git.panand@redhat.com> (raw)
In-Reply-To: <cover.1499416107.git.panand@redhat.com>
In-Reply-To: <cover.1499416107.git.panand@redhat.com>

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 attribute.

Signed-off-by: Pratyush Anand <panand@redhat.com>
---
 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();
-- 
2.9.3

WARNING: multiple messages have this Message-ID (diff)
From: panand@redhat.com (Pratyush Anand)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 2/4] arm64: use hw_breakpoint_needs_single_step() to decide if step is needed
Date: Fri,  7 Jul 2017 17:33:58 +0530	[thread overview]
Message-ID: <53c57967c400d44bb0b3b3622d8dbe0108642247.1499416107.git.panand@redhat.com> (raw)
In-Reply-To: <cover.1499416107.git.panand@redhat.com>

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 attribute.

Signed-off-by: Pratyush Anand <panand@redhat.com>
---
 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();
-- 
2.9.3

  parent reply	other threads:[~2017-07-07 12:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-07 12:03 [PATCH V2 0/4] ARM64: Fix irq generation between breakpoint and step exception Pratyush Anand
2017-07-07 12:03 ` Pratyush Anand
2017-07-07 12:03 ` [PATCH V2 1/4] hw_breakpoint: Add step_needed event attribute Pratyush Anand
2017-07-07 12:03   ` Pratyush Anand
2017-07-25 13:27   ` Will Deacon
2017-07-25 13:27     ` Will Deacon
2017-07-25 14:14     ` Peter Zijlstra
2017-07-25 14:14       ` Peter Zijlstra
2017-07-25 16:04       ` Mark Rutland
2017-07-25 16:04         ` Mark Rutland
2017-07-26  5:42     ` Pratyush Anand
2017-07-26  5:42       ` Pratyush Anand
2017-07-26  7:49       ` Peter Zijlstra
2017-07-26  7:49         ` Peter Zijlstra
2017-07-07 12:03 ` Pratyush Anand [this message]
2017-07-07 12:03   ` [PATCH V2 2/4] arm64: use hw_breakpoint_needs_single_step() to decide if step is needed Pratyush Anand
2017-07-07 12:03 ` [PATCH V2 3/4] hw-breakpoint: sample test: set step_needed bit field Pratyush Anand
2017-07-07 12:03   ` Pratyush Anand
2017-07-07 12:04 ` [PATCH V2 4/4] arm64: disable irq between breakpoint and step exception Pratyush Anand
2017-07-07 12:04   ` Pratyush Anand
2017-07-25 13:25   ` Will Deacon
2017-07-25 13:25     ` Will Deacon
2017-07-26  5:36     ` Pratyush Anand
2017-07-26  5:36       ` Pratyush Anand
2017-07-17  3:21 ` [PATCH V2 0/4] ARM64: Fix irq generation " Pratyush Anand
2017-07-17  3:21   ` Pratyush Anand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53c57967c400d44bb0b3b3622d8dbe0108642247.1499416107.git.panand@redhat.com \
    --to=panand@redhat.com \
    --cc=huawei.libin@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.