From: <suravee.suthikulpanit@amd.com>
To: <fweisbec@gmail.com>, <mingo@kernel.org>, <mingo@redhat.com>,
<jacob.w.shin@gmail.com>
Cc: <oleg@redhat.com>, <a.p.zijlstra@chello.nl>,
<acme@ghostprotocols.net>, <hpa@zytor.com>,
<linux-kernel@vger.kernel.org>, <sherry.hurwitz@amd.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Subject: [PATCH 4/4] perf/x86: Remove get_hbp_len and replace with bp_len
Date: Wed, 11 Dec 2013 06:28:26 -0600 [thread overview]
Message-ID: <1386764906-1681-5-git-send-email-suravee.suthikulpanit@amd.com> (raw)
In-Reply-To: <1386764906-1681-1-git-send-email-suravee.suthikulpanit@amd.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>
---
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 647b675..4ada2c3 100644
--- a/arch/x86/kernel/hw_breakpoint.c
+++ b/arch/x86/kernel/hw_breakpoint.c
@@ -169,29 +169,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.
*/
@@ -202,7 +179,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);
}
--
1.8.1.2
next prev parent reply other threads:[~2013-12-11 12:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
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 1/4] perf/x86/amd: AMD support for bp_len > HW_BREAKPOINT_LEN_8 suravee.suthikulpanit
2014-01-09 1:24 ` Frederic Weisbecker
2013-12-11 12:28 ` [PATCH 2/4] perf tools: allow user to specify hardware breakpoint bp_len suravee.suthikulpanit
2013-12-11 12:28 ` [PATCH 3/4] perf tools: add hardware breakpoint bp_len test cases suravee.suthikulpanit
2013-12-11 12:28 ` suravee.suthikulpanit [this message]
2014-01-08 19:00 ` [PATCH V6 0/4] perf/x86/amd: AMD Family 16h Data Breakpoint Extensions Suravee Suthikulanit
2014-01-09 1:52 ` Frederic Weisbecker
2014-02-25 15:09 ` Suravee Suthikulanit
2014-02-25 15:49 ` Frederic Weisbecker
2014-04-28 23:01 ` Suravee Suthikulanit
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
2014-09-24 13:45 [PATCH 0/4] perf: Support AMD range breakpoints v2 Frederic Weisbecker
2014-09-24 13:45 ` [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-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
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=1386764906-1681-5-git-send-email-suravee.suthikulpanit@amd.com \
--to=suravee.suthikulpanit@amd.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=jacob.w.shin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=sherry.hurwitz@amd.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®