Skip to content

Commit cd34cd9

Browse files
kliang2Ingo Molnar
authored andcommitted
perf/x86/intel/uncore: Add Skylake server uncore support
This patch implements the uncore monitoring driver for Skylake server. The uncore subsystem in Skylake server is similar to previous server. There are some differences in config register encoding and pci device IDs. Besides, Skylake introduces many new boxes to reflect the MESH architecture changes. The control registers for IIO and UPI have been extended to 64 bit. This patch also introduces event_mask_ext to handle the high 32 bit mask. The CHA box number could vary for different machines. This patch gets the CHA box number by counting the CHA register space during initialization at runtime. Signed-off-by: Kan Liang <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vince Weaver <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 2668c61 commit cd34cd9

File tree

3 files changed

+600
-1
lines changed

3 files changed

+600
-1
lines changed

arch/x86/events/intel/uncore.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,8 @@ static int uncore_pmu_event_init(struct perf_event *event)
685685
/* fixed counters have event field hardcoded to zero */
686686
hwc->config = 0ULL;
687687
} else {
688-
hwc->config = event->attr.config & pmu->type->event_mask;
688+
hwc->config = event->attr.config &
689+
(pmu->type->event_mask | ((u64)pmu->type->event_mask_ext << 32));
689690
if (pmu->type->ops->hw_config) {
690691
ret = pmu->type->ops->hw_config(box, event);
691692
if (ret)
@@ -1323,6 +1324,11 @@ static const struct intel_uncore_init_fun skl_uncore_init __initconst = {
13231324
.pci_init = skl_uncore_pci_init,
13241325
};
13251326

1327+
static const struct intel_uncore_init_fun skx_uncore_init __initconst = {
1328+
.cpu_init = skx_uncore_cpu_init,
1329+
.pci_init = skx_uncore_pci_init,
1330+
};
1331+
13261332
static const struct x86_cpu_id intel_uncore_match[] __initconst = {
13271333
X86_UNCORE_MODEL_MATCH(INTEL_FAM6_NEHALEM_EP, nhm_uncore_init),
13281334
X86_UNCORE_MODEL_MATCH(INTEL_FAM6_NEHALEM, nhm_uncore_init),
@@ -1345,6 +1351,7 @@ static const struct x86_cpu_id intel_uncore_match[] __initconst = {
13451351
X86_UNCORE_MODEL_MATCH(INTEL_FAM6_XEON_PHI_KNL, knl_uncore_init),
13461352
X86_UNCORE_MODEL_MATCH(INTEL_FAM6_SKYLAKE_DESKTOP,skl_uncore_init),
13471353
X86_UNCORE_MODEL_MATCH(INTEL_FAM6_SKYLAKE_MOBILE, skl_uncore_init),
1354+
X86_UNCORE_MODEL_MATCH(INTEL_FAM6_SKYLAKE_X, skx_uncore_init),
13481355
{},
13491356
};
13501357

arch/x86/events/intel/uncore.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ struct intel_uncore_type {
4444
unsigned perf_ctr;
4545
unsigned event_ctl;
4646
unsigned event_mask;
47+
unsigned event_mask_ext;
4748
unsigned fixed_ctr;
4849
unsigned fixed_ctl;
4950
unsigned box_ctl;
@@ -381,6 +382,8 @@ int bdx_uncore_pci_init(void);
381382
void bdx_uncore_cpu_init(void);
382383
int knl_uncore_pci_init(void);
383384
void knl_uncore_cpu_init(void);
385+
int skx_uncore_pci_init(void);
386+
void skx_uncore_cpu_init(void);
384387

385388
/* perf_event_intel_uncore_nhmex.c */
386389
void nhmex_uncore_cpu_init(void);

0 commit comments

Comments
 (0)