diff options
| author | 2014-12-08 11:50:24 +0100 | |
|---|---|---|
| committer | 2014-12-08 11:50:24 +0100 | |
| commit | 2a2662bf88e693d477ef08351d03934f7bc0b51c (patch) | |
| tree | cef243df159cc12ada7e97998a253df7c0abb2a2 /arch/x86/kernel/cpu/amd.c | |
| parent | Linux 3.18 (diff) | |
| parent | perf/x86: Remove get_hbp_len and replace with bp_len (diff) | |
| download | wireguard-linux-2a2662bf88e693d477ef08351d03934f7bc0b51c.tar.xz wireguard-linux-2a2662bf88e693d477ef08351d03934f7bc0b51c.zip | |
Merge branch 'perf/core-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into perf/hw_breakpoints
Pull AMD range breakpoints support from Frederic Weisbecker:
" - Extend breakpoint tools and core to support address range through perf
event with initial backend support for AMD extended breakpoints.
Syntax is:
perf record -e mem:addr/len:type
For example set write breakpoint from 0x1000 to 0x1200 (0x1000 + 512)
perf record -e mem:0x1000/512:w
- Clean up a bit breakpoint code validation
It has been acked by Jiri and Oleg. "
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to '')
| -rw-r--r-- | arch/x86/kernel/cpu/amd.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 813d29d00a17..abe4ec760db3 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -870,3 +870,22 @@ static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum) return false; } + +void set_dr_addr_mask(unsigned long mask, int dr) +{ + if (!cpu_has_bpext) + return; + + switch (dr) { + case 0: + wrmsr(MSR_F16H_DR0_ADDR_MASK, mask, 0); + break; + case 1: + case 2: + case 3: + wrmsr(MSR_F16H_DR1_ADDR_MASK - 1 + dr, mask, 0); + break; + default: + break; + } +} |
