Skip to content

Commit f127fa0

Browse files
virtuosoingomolnar
authored andcommitted
perf/x86/intel/pt: Add IP filtering register/CPUID bits
New versions of Intel PT support address range-based filtering. Add the new registers, bit definitions and relevant CPUID bits. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vince Weaver <vincent.weaver@maine.edu> Cc: vince@deater.net Link: http://lkml.kernel.org/r/1461771888-10409-4-git-send-email-alexander.shishkin@linux.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 0dd28e2 commit f127fa0

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

‎arch/x86/events/intel/pt.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,13 @@ static struct pt_cap_desc {
6767
PT_CAP(max_subleaf, 0, CR_EAX, 0xffffffff),
6868
PT_CAP(cr3_filtering, 0, CR_EBX, BIT(0)),
6969
PT_CAP(psb_cyc, 0, CR_EBX, BIT(1)),
70+
PT_CAP(ip_filtering, 0, CR_EBX, BIT(2)),
7071
PT_CAP(mtc, 0, CR_EBX, BIT(3)),
7172
PT_CAP(topa_output, 0, CR_ECX, BIT(0)),
7273
PT_CAP(topa_multiple_entries, 0, CR_ECX, BIT(1)),
7374
PT_CAP(single_range_output, 0, CR_ECX, BIT(2)),
7475
PT_CAP(payloads_lip, 0, CR_ECX, BIT(31)),
76+
PT_CAP(num_address_ranges, 1, CR_EAX, 0x3),
7577
PT_CAP(mtc_periods, 1, CR_EAX, 0xffff0000),
7678
PT_CAP(cycle_thresholds, 1, CR_EBX, 0xffff),
7779
PT_CAP(psb_periods, 1, CR_EBX, 0xffff0000),

‎arch/x86/events/intel/pt.h‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,18 @@
3838
#define RTIT_CTL_CYC_THRESH (0x0full << RTIT_CTL_CYC_THRESH_OFFSET)
3939
#define RTIT_CTL_PSB_FREQ_OFFSET 24
4040
#define RTIT_CTL_PSB_FREQ (0x0full << RTIT_CTL_PSB_FREQ_OFFSET)
41+
#define RTIT_CTL_ADDR0_OFFSET 32
42+
#define RTIT_CTL_ADDR0 (0x0full << RTIT_CTL_ADDR0_OFFSET)
43+
#define RTIT_CTL_ADDR1_OFFSET 36
44+
#define RTIT_CTL_ADDR1 (0x0full << RTIT_CTL_ADDR1_OFFSET)
45+
#define RTIT_CTL_ADDR2_OFFSET 40
46+
#define RTIT_CTL_ADDR2 (0x0full << RTIT_CTL_ADDR2_OFFSET)
47+
#define RTIT_CTL_ADDR3_OFFSET 44
48+
#define RTIT_CTL_ADDR3 (0x0full << RTIT_CTL_ADDR3_OFFSET)
49+
#define RTIT_STATUS_FILTEREN BIT(0)
4150
#define RTIT_STATUS_CONTEXTEN BIT(1)
4251
#define RTIT_STATUS_TRIGGEREN BIT(2)
52+
#define RTIT_STATUS_BUFFOVF BIT(3)
4353
#define RTIT_STATUS_ERROR BIT(4)
4454
#define RTIT_STATUS_STOPPED BIT(5)
4555

@@ -76,11 +86,13 @@ enum pt_capabilities {
7686
PT_CAP_max_subleaf = 0,
7787
PT_CAP_cr3_filtering,
7888
PT_CAP_psb_cyc,
89+
PT_CAP_ip_filtering,
7990
PT_CAP_mtc,
8091
PT_CAP_topa_output,
8192
PT_CAP_topa_multiple_entries,
8293
PT_CAP_single_range_output,
8394
PT_CAP_payloads_lip,
95+
PT_CAP_num_address_ranges,
8496
PT_CAP_mtc_periods,
8597
PT_CAP_cycle_thresholds,
8698
PT_CAP_psb_periods,

‎arch/x86/include/asm/msr-index.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@
9090

9191
#define MSR_IA32_RTIT_CTL 0x00000570
9292
#define MSR_IA32_RTIT_STATUS 0x00000571
93+
#define MSR_IA32_RTIT_STATUS 0x00000571
94+
#define MSR_IA32_RTIT_ADDR0_A 0x00000580
95+
#define MSR_IA32_RTIT_ADDR0_B 0x00000581
96+
#define MSR_IA32_RTIT_ADDR1_A 0x00000582
97+
#define MSR_IA32_RTIT_ADDR1_B 0x00000583
98+
#define MSR_IA32_RTIT_ADDR2_A 0x00000584
99+
#define MSR_IA32_RTIT_ADDR2_B 0x00000585
100+
#define MSR_IA32_RTIT_ADDR3_A 0x00000586
101+
#define MSR_IA32_RTIT_ADDR3_B 0x00000587
93102
#define MSR_IA32_RTIT_CR3_MATCH 0x00000572
94103
#define MSR_IA32_RTIT_OUTPUT_BASE 0x00000560
95104
#define MSR_IA32_RTIT_OUTPUT_MASK 0x00000561

0 commit comments

Comments
 (0)