Skip to content

Commit 936b664

Browse files
committed
Merge tag 'perf-urgent-2021-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar: "A fix and a hardware-enablement addition: - Robustify uncore_snbep's skx_iio_set_mapping()'s error cleanup - Add cstate event support for Intel ICELAKE_X and ICELAKE_D" * tag 'perf-urgent-2021-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel/uncore: Clean up error handling path of iio mapping perf/x86/cstate: Add ICELAKE_X and ICELAKE_D support
2 parents 301c8b1 + d4ba0b0 commit 936b664

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

arch/x86/events/intel/cstate.c

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* Model specific counters:
4141
* MSR_CORE_C1_RES: CORE C1 Residency Counter
4242
* perf code: 0x00
43-
* Available model: SLM,AMT,GLM,CNL,TNT,ADL
43+
* Available model: SLM,AMT,GLM,CNL,ICX,TNT,ADL
4444
* Scope: Core (each processor core has a MSR)
4545
* MSR_CORE_C3_RESIDENCY: CORE C3 Residency Counter
4646
* perf code: 0x01
@@ -50,8 +50,8 @@
5050
* MSR_CORE_C6_RESIDENCY: CORE C6 Residency Counter
5151
* perf code: 0x02
5252
* Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW,
53-
* SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL,
54-
* TNT,RKL,ADL
53+
* SKL,KNL,GLM,CNL,KBL,CML,ICL,ICX,
54+
* TGL,TNT,RKL,ADL
5555
* Scope: Core
5656
* MSR_CORE_C7_RESIDENCY: CORE C7 Residency Counter
5757
* perf code: 0x03
@@ -61,7 +61,7 @@
6161
* MSR_PKG_C2_RESIDENCY: Package C2 Residency Counter.
6262
* perf code: 0x00
6363
* Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM,CNL,
64-
* KBL,CML,ICL,TGL,TNT,RKL,ADL
64+
* KBL,CML,ICL,ICX,TGL,TNT,RKL,ADL
6565
* Scope: Package (physical package)
6666
* MSR_PKG_C3_RESIDENCY: Package C3 Residency Counter.
6767
* perf code: 0x01
@@ -72,8 +72,8 @@
7272
* MSR_PKG_C6_RESIDENCY: Package C6 Residency Counter.
7373
* perf code: 0x02
7474
* Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW,
75-
* SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL,
76-
* TNT,RKL,ADL
75+
* SKL,KNL,GLM,CNL,KBL,CML,ICL,ICX,
76+
* TGL,TNT,RKL,ADL
7777
* Scope: Package (physical package)
7878
* MSR_PKG_C7_RESIDENCY: Package C7 Residency Counter.
7979
* perf code: 0x03
@@ -566,6 +566,14 @@ static const struct cstate_model icl_cstates __initconst = {
566566
BIT(PERF_CSTATE_PKG_C10_RES),
567567
};
568568

569+
static const struct cstate_model icx_cstates __initconst = {
570+
.core_events = BIT(PERF_CSTATE_CORE_C1_RES) |
571+
BIT(PERF_CSTATE_CORE_C6_RES),
572+
573+
.pkg_events = BIT(PERF_CSTATE_PKG_C2_RES) |
574+
BIT(PERF_CSTATE_PKG_C6_RES),
575+
};
576+
569577
static const struct cstate_model adl_cstates __initconst = {
570578
.core_events = BIT(PERF_CSTATE_CORE_C1_RES) |
571579
BIT(PERF_CSTATE_CORE_C6_RES) |
@@ -664,6 +672,9 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = {
664672

665673
X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_L, &icl_cstates),
666674
X86_MATCH_INTEL_FAM6_MODEL(ICELAKE, &icl_cstates),
675+
X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X, &icx_cstates),
676+
X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_D, &icx_cstates),
677+
667678
X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE_L, &icl_cstates),
668679
X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE, &icl_cstates),
669680
X86_MATCH_INTEL_FAM6_MODEL(ROCKETLAKE, &icl_cstates),

arch/x86/events/intel/uncore_snbep.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3804,11 +3804,11 @@ pmu_iio_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag)
38043804
/* One more for NULL. */
38053805
attrs = kcalloc((uncore_max_dies() + 1), sizeof(*attrs), GFP_KERNEL);
38063806
if (!attrs)
3807-
goto err;
3807+
goto clear_topology;
38083808

38093809
eas = kcalloc(uncore_max_dies(), sizeof(*eas), GFP_KERNEL);
38103810
if (!eas)
3811-
goto err;
3811+
goto clear_attrs;
38123812

38133813
for (die = 0; die < uncore_max_dies(); die++) {
38143814
sprintf(buf, "die%ld", die);
@@ -3829,7 +3829,9 @@ pmu_iio_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag)
38293829
for (; die >= 0; die--)
38303830
kfree(eas[die].attr.attr.name);
38313831
kfree(eas);
3832+
clear_attrs:
38323833
kfree(attrs);
3834+
clear_topology:
38333835
kfree(type->topology);
38343836
clear_attr_update:
38353837
type->attr_update = NULL;

0 commit comments

Comments
 (0)