perf/x86/intel/uncore: Add IMC uncore support for ADL
Subsystems (2)
PATCH 1/1 perf/x86/intel/uncore: Add IMC uncore support for ADL
From: Kan Liang <[email protected]>
Current ADL uncore code only supports the legacy IMC (memory controller) free-running counters. Besides the free-running counters, ADL also supports several general purpose-counters.
The general-purpose counters can also be accessed via MMIO but in a different location. Factor out __uncore_imc_init_box() with offset as a parameter. The function can be shared between ADL and TGL.
The event format and the layout of the control registers are a little bit different from other uncore counters.
The intel_generic_uncore_mmio_enable_event() can be shared with client IMC uncore. Expose the function.
Add more PCI IDs for ADL machines.
--- arch/x86/events/intel/uncore.c | 2 +- arch/x86/events/intel/uncore.h | 3 +- arch/x86/events/intel/uncore_discovery.c | 4 +- arch/x86/events/intel/uncore_discovery.h | 2 + arch/x86/events/intel/uncore_snb.c | 214 ++++++++++++++++++++++++++++++- 5 files changed, 220 insertions(+), 5 deletions(-)
arch/x86/events/intel/uncore.c +1 -1
@@ -1762,7 +1762,7 @@ static const struct intel_uncore_init_fun rkl_uncore_init __initconst = {static const struct intel_uncore_init_fun adl_uncore_init__initconst = { .cpu_init = adl_uncore_cpu_init, - .mmio_init = tgl_uncore_mmio_init, + .mmio_init = adl_uncore_mmio_init, };static const struct intel_uncore_init_fun icx_uncore_init__initconst = {
arch/x86/events/intel/uncore.h +2 -1
@@ -584,10 +584,11 @@ void snb_uncore_cpu_init(void);void nhm_uncore_cpu_init (void );void skl_uncore_cpu_init (void );void icl_uncore_cpu_init (void ); -void adl_uncore_cpu_init (void );void tgl_uncore_cpu_init (void ); +void adl_uncore_cpu_init (void );void tgl_uncore_mmio_init (void );void tgl_l_uncore_mmio_init (void ); +void adl_uncore_mmio_init (void );int snb_pci2phy_map_init (int devid);/* uncore_snbep.c */
arch/x86/events/intel/uncore_discovery.c +2 -2
@@ -494,8 +494,8 @@ void intel_generic_uncore_mmio_enable_box(struct intel_uncore_box *box)writel (0 , box->io_addr); } -static void intel_generic_uncore_mmio_enable_event (struct intel_uncore_box *box, -struct perf_event *event) +void intel_generic_uncore_mmio_enable_event (struct intel_uncore_box *box, +struct perf_event *event) {struct hw_perf_event *hwc = &event->hw;
arch/x86/events/intel/uncore_discovery.h +2 -0
@@ -139,6 +139,8 @@ void intel_generic_uncore_mmio_disable_box(struct intel_uncore_box *box);void intel_generic_uncore_mmio_enable_box (struct intel_uncore_box *box);void intel_generic_uncore_mmio_disable_event (struct intel_uncore_box *box,struct perf_event *event); +void intel_generic_uncore_mmio_enable_event (struct intel_uncore_box *box, +struct perf_event *event);void intel_generic_uncore_pci_init_box (struct intel_uncore_box *box);void intel_generic_uncore_pci_disable_box (struct intel_uncore_box *box);
arch/x86/events/intel/uncore_snb.c +213 -1
258 lines not on this page · raw message
Signature · 1 line
2.7.4
The following commit has been merged into the perf/urgent branch of tip:
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: 5a4487f9ef5ef2fdb3215cadf0a9c3e5e8678634 Gitweb: https://git.kernel.org/tip/5a4487f9ef5ef2fdb3215cadf0a9c3e5e8678634 Author: Kan Liang <[email protected]> AuthorDate: Thu, 13 Jan 2022 14:05:54 -08:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Tue, 18 Jan 2022 12:09:49 +01:00
perf/x86/intel/uncore: Add IMC uncore support for ADL
Current ADL uncore code only supports the legacy IMC (memory controller) free-running counters. Besides the free-running counters, ADL also supports several general purpose-counters.
The general-purpose counters can also be accessed via MMIO but in a different location. Factor out __uncore_imc_init_box() with offset as a parameter. The function can be shared between ADL and TGL.
The event format and the layout of the control registers are a little bit different from other uncore counters.
The intel_generic_uncore_mmio_enable_event() can be shared with client IMC uncore. Expose the function.
Add more PCI IDs for ADL machines.
--- arch/x86/events/intel/uncore.c | 2 +- arch/x86/events/intel/uncore.h | 3 +- arch/x86/events/intel/uncore_discovery.c | 4 +- arch/x86/events/intel/uncore_discovery.h | 2 +- arch/x86/events/intel/uncore_snb.c | 214 +++++++++++++++++++++- 5 files changed, 220 insertions(+), 5 deletions(-)
arch/x86/events/intel/uncore.c +1 -1
@@ -1762,7 +1762,7 @@ static const struct intel_uncore_init_fun rkl_uncore_init __initconst = {static const struct intel_uncore_init_fun adl_uncore_init__initconst = { .cpu_init = adl_uncore_cpu_init, - .mmio_init = tgl_uncore_mmio_init, + .mmio_init = adl_uncore_mmio_init, };static const struct intel_uncore_init_fun icx_uncore_init__initconst = {
arch/x86/events/intel/uncore.h +2 -1
@@ -584,10 +584,11 @@ void snb_uncore_cpu_init(void);void nhm_uncore_cpu_init (void );void skl_uncore_cpu_init (void );void icl_uncore_cpu_init (void ); -void adl_uncore_cpu_init (void );void tgl_uncore_cpu_init (void ); +void adl_uncore_cpu_init (void );void tgl_uncore_mmio_init (void );void tgl_l_uncore_mmio_init (void ); +void adl_uncore_mmio_init (void );int snb_pci2phy_map_init (int devid);/* uncore_snbep.c */
arch/x86/events/intel/uncore_discovery.c +2 -2
@@ -494,8 +494,8 @@ void intel_generic_uncore_mmio_enable_box(struct intel_uncore_box *box)writel (0 , box->io_addr); } -static void intel_generic_uncore_mmio_enable_event (struct intel_uncore_box *box, -struct perf_event *event) +void intel_generic_uncore_mmio_enable_event (struct intel_uncore_box *box, +struct perf_event *event) {struct hw_perf_event *hwc = &event->hw;
arch/x86/events/intel/uncore_discovery.h +2 -0
@@ -139,6 +139,8 @@ void intel_generic_uncore_mmio_disable_box(struct intel_uncore_box *box);void intel_generic_uncore_mmio_enable_box (struct intel_uncore_box *box);void intel_generic_uncore_mmio_disable_event (struct intel_uncore_box *box,struct perf_event *event); +void intel_generic_uncore_mmio_enable_event (struct intel_uncore_box *box, +struct perf_event *event);void intel_generic_uncore_pci_init_box (struct intel_uncore_box *box);void intel_generic_uncore_pci_disable_box (struct intel_uncore_box *box);
arch/x86/events/intel/uncore_snb.c +213 -1
258 lines not on this page · raw message