perf/x86/intel/uncore: Add support for Intel SKL client uncore
Subsystems (2)
PATCH v3 1/2 perf/x86/intel/uncore: Add support for Intel SKL client uncore
From: Kan Liang <[email protected]>
This patch addes full support for Intel SKL client uncore.
- Add support for SKL client cpu uncore, which is similar to BDW client. There are some differences in CBOX number and uncore control MSR.
- Add new support for SkyLake Mobile, include both cpu and pci uncore
---
Changes since V2:
- Rebase to ebccba3fe0a0
Changes since V1:
- Move enable_box to another patch.
- Remove disable_box
arch/x86/events/intel/uncore.c | 2 ++ arch/x86/events/intel/uncore.h | 1 + arch/x86/events/intel/uncore_snb.c | 67 +++++++++++++++++++++++++++++++++++++- 3 files changed, 69 insertions(+), 1 deletion(-)
arch/x86/events/intel/uncore.c +2 -0
@@ -1379,6 +1379,7 @@ static const struct intel_uncore_init_fun knl_uncore_init __initconst = { };static const struct intel_uncore_init_fun skl_uncore_init__initconst = { + .cpu_init = skl_uncore_cpu_init, .pci_init = skl_uncore_pci_init, };
@@ -1403,6 +1404,7 @@ static const struct x86_cpu_id intel_uncore_match[] __initconst = {X86_UNCORE_MODEL_MATCH (INTEL_FAM6_BROADWELL_XEON_D , bdx_uncore_init),X86_UNCORE_MODEL_MATCH (INTEL_FAM6_XEON_PHI_KNL , knl_uncore_init),X86_UNCORE_MODEL_MATCH (INTEL_FAM6_SKYLAKE_DESKTOP ,skl_uncore_init), + X86_UNCORE_MODEL_MATCH(INTEL_FAM6_SKYLAKE_MOBILE, skl_uncore_init), {}, };
arch/x86/events/intel/uncore.h +1 -0
@@ -364,6 +364,7 @@ int bdw_uncore_pci_init(void);int skl_uncore_pci_init (void );void snb_uncore_cpu_init (void );void nhm_uncore_cpu_init (void ); +void skl_uncore_cpu_init (void );int snb_pci2phy_map_init (int devid);/* perf_event_intel_uncore_snbep.c */
arch/x86/events/intel/uncore_snb.c +66 -1
100 lines not on this page · raw message
Signature · 1 line
2.4.0
PATCH v3 2/2 perf/x86/intel/uncore: add enable_box for client msr uncore
From: Kan Liang <[email protected]>
PERF_GLOBAL_CTL could be cleared after Package C7. This patch tries to workaround this issue by re-enable PERF_GLOBAL_CTL in enable_box. The workaround does not cover all cases. It helps for new events after returning from C7.
There is no drawback in letting the thing enabled, so it does not need disable_box here.
--- arch/x86/events/intel/uncore_snb.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
arch/x86/events/intel/uncore_snb.c +14 -0
@@ -100,6 +100,12 @@ static void snb_uncore_msr_init_box(struct intel_uncore_box *box) } } +static void snb_uncore_msr_enable_box (struct intel_uncore_box *box) +{ +wrmsrl (SNB_UNC_PERF_GLOBAL_CTL , +SNB_UNC_GLOBAL_CTL_EN |SNB_UNC_GLOBAL_CTL_CORE_ALL ); +} +static void snb_uncore_msr_exit_box (struct intel_uncore_box *box) {if (box->pmu->pmu_idx ==0 )
@@ -127,6 +133,7 @@ static struct attribute_group snb_uncore_format_group = {static struct intel_uncore_ops snb_uncore_msr_ops = { .init_box = snb_uncore_msr_init_box, + .enable_box = snb_uncore_msr_enable_box, .exit_box = snb_uncore_msr_exit_box, .disable_event = snb_uncore_msr_disable_event, .enable_event = snb_uncore_msr_enable_event,
@@ -192,6 +199,12 @@ static void skl_uncore_msr_init_box(struct intel_uncore_box *box) } } +static void skl_uncore_msr_enable_box (struct intel_uncore_box *box) +{ +wrmsrl (SKL_UNC_PERF_GLOBAL_CTL , +SNB_UNC_GLOBAL_CTL_EN |SKL_UNC_GLOBAL_CTL_CORE_ALL ); +} +static void skl_uncore_msr_exit_box (struct intel_uncore_box *box) {if (box->pmu->pmu_idx ==0 )
@@ -200,6 +213,7 @@ static void skl_uncore_msr_exit_box(struct intel_uncore_box *box)static struct intel_uncore_ops skl_uncore_msr_ops = { .init_box = skl_uncore_msr_init_box, + .enable_box = skl_uncore_msr_enable_box, .exit_box = skl_uncore_msr_exit_box, .disable_event = snb_uncore_msr_disable_event, .enable_event = snb_uncore_msr_enable_event,
Signature · 1 line
2.4.0
Re: [PATCH V3 2/2] perf/x86/intel/uncore: add enable_box for client msr uncore
Quoted 8 lines · * [email protected] <[email protected]> wrote:
From: Kan Liang <[email protected]>
PERF_GLOBAL_CTLcould be cleared after Package C7. This patch tries to workaround this issue by re-enablePERF_GLOBAL_CTLinenable_box. The workaround does not cover all cases. It helps for new events after returning from C7.
There is no drawback in letting the thing enabled, so it does not needdisable_boxhere.
This changelog is very poor for similar reasons as:
Re: [PATCH] perf/x86/intel/uncore: correct uncore num_counters
Please fix the changelog to conform to the standard changelog style:
- first describe the symptoms of the bug - how does a user notice?
- then describe how the code behaves today and how that is causing the bug
- and then only describe how it's fixed.
The first item is the most important one - while developers (naturally) tend to concentrate on the least important point, the last one.
Thanks,
Ingo
tip-bot for Kan Liang
merge bot[tip:perf/core] perf/x86/intel/uncore: Add support for the Intel Skylake client uncore PMU
In reply to [email protected]perf/x86/intel/uncore: Add support for the Intel Skylake client uncore PMU
Commit-ID: 46866b59dfbe9bf99bb1323ce1f3fd2073a81aa3 Gitweb: http://git.kernel.org/tip/46866b59dfbe9bf99bb1323ce1f3fd2073a81aa3 Author: Kan Liang <[email protected]> AuthorDate: Wed, 29 Jun 2016 07:01:51 -0700 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 7 Jul 2016 09:03:29 +0200
perf/x86/intel/uncore: Add support for the Intel Skylake client uncore PMU
This patch adds full support for Intel SKL client uncore PMU:
- Add support for SKL client CPU uncore PMU, which is similar to the BDW client PMU driver. (There are some differences in CBOX numbering and uncore control MSR.)
- Add new support for SkyLake Mobile uncore PMUs, for both CPU and PCI uncore functionality.
--- arch/x86/events/intel/uncore.c | 2 ++ arch/x86/events/intel/uncore.h | 1 + arch/x86/events/intel/uncore_snb.c | 67 +++++++++++++++++++++++++++++++++++++- 3 files changed, 69 insertions(+), 1 deletion(-)
arch/x86/events/intel/uncore.c +2 -0
@@ -1379,6 +1379,7 @@ static const struct intel_uncore_init_fun knl_uncore_init __initconst = { };static const struct intel_uncore_init_fun skl_uncore_init__initconst = { + .cpu_init = skl_uncore_cpu_init, .pci_init = skl_uncore_pci_init, };
@@ -1403,6 +1404,7 @@ static const struct x86_cpu_id intel_uncore_match[] __initconst = {X86_UNCORE_MODEL_MATCH (INTEL_FAM6_BROADWELL_XEON_D , bdx_uncore_init),X86_UNCORE_MODEL_MATCH (INTEL_FAM6_XEON_PHI_KNL , knl_uncore_init),X86_UNCORE_MODEL_MATCH (INTEL_FAM6_SKYLAKE_DESKTOP ,skl_uncore_init), + X86_UNCORE_MODEL_MATCH(INTEL_FAM6_SKYLAKE_MOBILE, skl_uncore_init), {}, };
arch/x86/events/intel/uncore.h +1 -0
@@ -364,6 +364,7 @@ int bdw_uncore_pci_init(void);int skl_uncore_pci_init (void );void snb_uncore_cpu_init (void );void nhm_uncore_cpu_init (void ); +void skl_uncore_cpu_init (void );int snb_pci2phy_map_init (int devid);/* perf_event_intel_uncore_snbep.c */
arch/x86/events/intel/uncore_snb.c +66 -1
100 lines not on this page · raw message