From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Jacob Shin <jacob.w.shin@gmail.com>,
Namhyung Kim <namhyung@kernel.org>,
Oleg Nesterov <oleg@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
xiakaixu <xiakaixu@huawei.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
Jiri Olsa <jolsa@redhat.com>, Ingo Molnar <mingo@kernel.org>
Subject: [PATCH 4/4] perf/x86: Remove get_hbp_len and replace with bp_len
Date: Wed, 24 Sep 2014 15:45:51 +0200 [thread overview]
Message-ID: <1411566351-10987-5-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1411566351-10987-1-git-send-email-fweisbec@gmail.com>
From: Jacob Shin <jacob.w.shin@gmail.com>
Clean up the logic for determining the breakpoint length
Signed-off-by: Jacob Shin <jacob.w.shin@gmail.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: xiakaixu <xiakaixu@huawei.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
arch/x86/kernel/hw_breakpoint.c | 25 +------------------------
1 file changed, 1 insertion(+), 24 deletions(-)
diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c
index 91ce081..edb70e9 100644
--- a/arch/x86/kernel/hw_breakpoint.c
+++ b/arch/x86/kernel/hw_breakpoint.c
@@ -167,29 +167,6 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp)
set_dr_addr_mask(0, i);
}
-static int get_hbp_len(u8 hbp_len)
-{
- unsigned int len_in_bytes = 0;
-
- switch (hbp_len) {
- case X86_BREAKPOINT_LEN_1:
- len_in_bytes = 1;
- break;
- case X86_BREAKPOINT_LEN_2:
- len_in_bytes = 2;
- break;
- case X86_BREAKPOINT_LEN_4:
- len_in_bytes = 4;
- break;
-#ifdef CONFIG_X86_64
- case X86_BREAKPOINT_LEN_8:
- len_in_bytes = 8;
- break;
-#endif
- }
- return len_in_bytes;
-}
-
/*
* Check for virtual address in kernel space.
*/
@@ -200,7 +177,7 @@ int arch_check_bp_in_kernelspace(struct perf_event *bp)
struct arch_hw_breakpoint *info = counter_arch_bp(bp);
va = info->address;
- len = get_hbp_len(info->len);
+ len = bp->attr.bp_len;
return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE);
}
--
2.1.0
next prev parent reply other threads:[~2014-09-24 13:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-24 13:45 [PATCH 0/4] perf: Support AMD range breakpoints v2 Frederic Weisbecker
2014-09-24 13:45 ` [PATCH 1/4] perf/x86/amd: AMD support for bp_len > HW_BREAKPOINT_LEN_8 Frederic Weisbecker
2014-09-24 13:45 ` [PATCH 2/4] perf tools: allow user to specify hardware breakpoint bp_len Frederic Weisbecker
2014-09-24 13:45 ` [PATCH 3/4] perf tools: add hardware breakpoint bp_len test cases Frederic Weisbecker
2014-09-24 13:45 ` Frederic Weisbecker [this message]
2014-09-25 7:55 ` [PATCH 0/4] perf: Support AMD range breakpoints v2 Jiri Olsa
2014-09-26 15:04 ` Oleg Nesterov
-- strict thread matches above, loose matches on Subject: below --
2014-12-04 0:13 [GIT PULL][RESEND] hw_breakpoints: Support AMD range breakpoints Frederic Weisbecker
2014-12-04 0:13 ` [PATCH 4/4] perf/x86: Remove get_hbp_len and replace with bp_len Frederic Weisbecker
2014-10-01 21:37 [GIT PULL] hw_breakpoints: Support AMD range breakpoints Frederic Weisbecker
2014-10-01 21:37 ` [PATCH 4/4] perf/x86: Remove get_hbp_len and replace with bp_len Frederic Weisbecker
2014-05-29 15:26 [PATCH 0/4] perf: Support AMD range breakpoints Frederic Weisbecker
2014-05-29 15:26 ` [PATCH 4/4] perf/x86: Remove get_hbp_len and replace with bp_len Frederic Weisbecker
2013-12-11 12:28 [PATCH V6 0/4] perf/x86/amd: AMD Family 16h Data Breakpoint Extensions suravee.suthikulpanit
2013-12-11 12:28 ` [PATCH 4/4] perf/x86: Remove get_hbp_len and replace with bp_len suravee.suthikulpanit
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=1411566351-10987-5-git-send-email-fweisbec@gmail.com \
--to=fweisbec@gmail.com \
--cc=acme@ghostprotocols.net \
--cc=jacob.w.shin@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=suravee.suthikulpanit@amd.com \
--cc=xiakaixu@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®