perf/x86/intel/uncore: Various fix for ICX and SPR
Subsystems (3)
cover perf/x86/intel/uncore: Various fix for ICX and SPR
From: Kan Liang <[email protected]>
The fixes in the series are to fix different issues of perf uncore. They can be merged separately. I just want to make them more visible on maintainers' radar. So I put them together.
Patch 1 is to add extra IMC channel for ICX.
Patch 2 is to fix the missing type 0 unit 0 uncore unit. Patch 3-7 are to update the static event constraints table for IIO, CHA, M2PCIE, M3UPI on ICX and SPR.
Kan Liang (7):
perf/x86/intel/uncore: Support extra IMC channel on Ice Lake server perf/x86/intel/uncore: Fix invalid unit check perf/x86/intel/uncore: Fix Intel ICX IIO event constraints perf/x86/intel/uncore: Fix Intel SPR CHA event constraints perf/x86/intel/uncore: Fix Intel SPR IIO event constraints perf/x86/intel/uncore: Fix Intel SPR M2PCIE event constraints perf/x86/intel/uncore: Fix Intel SPR M3UPI event constraints
arch/x86/events/intel/uncore_discovery.h | 2 +- arch/x86/events/intel/uncore_snbep.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/7 perf/x86/intel/uncore: Support extra IMC channel on Ice Lake server
From: Kan Liang <[email protected]>
There are three channels on a Ice Lake server, but only two channels will ever be active. Current perf only enables two channels.
Support the extra IMC channel, which may be activated on some Ice Lake machines. For a non-activated channel, the SW can still access it. The write will be ignored by the HW. 0 is always returned for the reading.
---
The patch is a RESEND patch. The original post can be found at
https://lore.kernel.org/lkml/[email protected]
arch/x86/events/intel/uncore_snbep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/events/intel/uncore_snbep.c +2 -2
@@ -452,7 +452,7 @@#define ICX_M3UPI_PCI_PMON_BOX_CTL 0xa0/* ICX IMC */ -#define ICX_NUMBER_IMC_CHN 2 +#define ICX_NUMBER_IMC_CHN 3#define ICX_IMC_MEM_STRIDE 0x4/* SPR */
@@ -5458,7 +5458,7 @@ static struct intel_uncore_ops icx_uncore_mmio_ops = {static struct intel_uncore_type icx_uncore_imc = { .name ="imc" , .num_counters =4 , - .num_boxes =8 , + .num_boxes =12 , .perf_ctr_bits =48 , .fixed_ctr_bits =48 , .fixed_ctr =SNR_IMC_MMIO_PMON_FIXED_CTR ,
Signature · 1 line
2.7.4
[tip: perf/core] perf/x86/intel/uncore: Support extra IMC channel on Ice Lake server
The following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 496a18f09374ad89b3ab4366019bc3975db90234 Gitweb: https://git.kernel.org/tip/496a18f09374ad89b3ab4366019bc3975db90234 Author: Kan Liang <[email protected]> AuthorDate: Thu, 26 Aug 2021 08:32:37 -07:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Tue, 31 Aug 2021 13:59:35 +02:00
perf/x86/intel/uncore: Support extra IMC channel on Ice Lake server
There are three channels on a Ice Lake server, but only two channels will ever be active. Current perf only enables two channels.
Support the extra IMC channel, which may be activated on some Ice Lake machines. For a non-activated channel, the SW can still access it. The write will be ignored by the HW. 0 is always returned for the reading.
--- arch/x86/events/intel/uncore_snbep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/events/intel/uncore_snbep.c +2 -2
@@ -452,7 +452,7 @@#define ICX_M3UPI_PCI_PMON_BOX_CTL 0xa0/* ICX IMC */ -#define ICX_NUMBER_IMC_CHN 2 +#define ICX_NUMBER_IMC_CHN 3#define ICX_IMC_MEM_STRIDE 0x4/* SPR */
@@ -5463,7 +5463,7 @@ static struct intel_uncore_ops icx_uncore_mmio_ops = {static struct intel_uncore_type icx_uncore_imc = { .name ="imc" , .num_counters =4 , - .num_boxes =8 , + .num_boxes =12 , .perf_ctr_bits =48 , .fixed_ctr_bits =48 , .fixed_ctr =SNR_IMC_MMIO_PMON_FIXED_CTR ,
PATCH 2/7 perf/x86/intel/uncore: Fix invalid unit check
In reply to [email protected]From: Kan Liang <[email protected]>
The uncore unit with the type ID 0 and the unit ID 0 is missed.
The table3 of the uncore unit maybe 0. The uncore_discovery_invalid_unit() mistakenly treated it as an invalid value.
Remove the !unit.table3 check.
---
The patch was posted as a part of the "perf: Add Sapphire Rapids server uncore support" patch set. But it doesn't depend on the other patches in the patch set. The bugfix can be accepted and merged separately.
https://lore.kernel.org/lkml/[email protected]/
arch/x86/events/intel/uncore_discovery.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/uncore_discovery.h +1 -1
@@ -30,7 +30,7 @@#define uncore_discovery_invalid_unit (unit) \ - (!unit.table1 || !unit.ctl || !unit.table3 || \ + (!unit.table1 || !unit.ctl || \ unit.table1 == -1ULL || unit.ctl == -1ULL || \ unit.table3 == -1ULL)
Signature · 1 line
2.7.4
[tip: perf/core] perf/x86/intel/uncore: Fix invalid unit check
The following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: e2bb9fab08cbcc7922050c7eb0bd650807abfa4e Gitweb: https://git.kernel.org/tip/e2bb9fab08cbcc7922050c7eb0bd650807abfa4e Author: Kan Liang <[email protected]> AuthorDate: Thu, 26 Aug 2021 08:32:38 -07:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Tue, 31 Aug 2021 13:59:35 +02:00
perf/x86/intel/uncore: Fix invalid unit check
The uncore unit with the type ID 0 and the unit ID 0 is missed.
The table3 of the uncore unit maybe 0. The uncore_discovery_invalid_unit() mistakenly treated it as an invalid value.
Remove the !unit.table3 check.
--- arch/x86/events/intel/uncore_discovery.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/uncore_discovery.h +1 -1
@@ -30,7 +30,7 @@#define uncore_discovery_invalid_unit (unit) \ - (!unit.table1 || !unit.ctl || !unit.table3 || \ + (!unit.table1 || !unit.ctl || \ unit.table1 == -1ULL || unit.ctl == -1ULL || \ unit.table3 == -1ULL)
PATCH 3/7 perf/x86/intel/uncore: Fix Intel ICX IIO event constraints
In reply to [email protected]From: Kan Liang <[email protected]>
According to the latest uncore document, both NUM_OUTSTANDING_REQ_OF_CPU (0x88) event and COMP_BUF_OCCUPANCY(0xd5) event also have constraints. Add them into the event constraints table.
--- arch/x86/events/intel/uncore_snbep.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/events/intel/uncore_snbep.c +2 -0
@@ -5072,8 +5072,10 @@ static struct event_constraint icx_uncore_iio_constraints[] = {UNCORE_EVENT_CONSTRAINT (0x02 ,0x3 ),UNCORE_EVENT_CONSTRAINT (0x03 ,0x3 ),UNCORE_EVENT_CONSTRAINT (0x83 ,0x3 ), +UNCORE_EVENT_CONSTRAINT (0x88 ,0xc ),UNCORE_EVENT_CONSTRAINT (0xc0 ,0xc ),UNCORE_EVENT_CONSTRAINT (0xc5 ,0xc ), +UNCORE_EVENT_CONSTRAINT (0xd5 ,0xc ), EVENT_CONSTRAINT_END };
Signature · 1 line
2.7.4
[tip: perf/core] perf/x86/intel/uncore: Fix Intel ICX IIO event constraints
The following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: f42e8a603c88f72bf047a710b9fc1d3579f31e71 Gitweb: https://git.kernel.org/tip/f42e8a603c88f72bf047a710b9fc1d3579f31e71 Author: Kan Liang <[email protected]> AuthorDate: Thu, 26 Aug 2021 08:32:39 -07:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Tue, 31 Aug 2021 13:59:36 +02:00
perf/x86/intel/uncore: Fix Intel ICX IIO event constraints
According to the latest uncore document, both NUM_OUTSTANDING_REQ_OF_CPU (0x88) event and COMP_BUF_OCCUPANCY(0xd5) event also have constraints. Add them into the event constraints table.
--- arch/x86/events/intel/uncore_snbep.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/events/intel/uncore_snbep.c +2 -0
@@ -5076,8 +5076,10 @@ static struct event_constraint icx_uncore_iio_constraints[] = {UNCORE_EVENT_CONSTRAINT (0x02 ,0x3 ),UNCORE_EVENT_CONSTRAINT (0x03 ,0x3 ),UNCORE_EVENT_CONSTRAINT (0x83 ,0x3 ), +UNCORE_EVENT_CONSTRAINT (0x88 ,0xc ),UNCORE_EVENT_CONSTRAINT (0xc0 ,0xc ),UNCORE_EVENT_CONSTRAINT (0xc5 ,0xc ), +UNCORE_EVENT_CONSTRAINT (0xd5 ,0xc ), EVENT_CONSTRAINT_END };
PATCH 4/7 perf/x86/intel/uncore: Fix Intel SPR CHA event constraints
In reply to [email protected]From: Kan Liang <[email protected]>
SPR CHA events have the exact same event constraints as SKX, so add the constraints.
--- arch/x86/events/intel/uncore_snbep.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/events/intel/uncore_snbep.c +1 -0
@@ -5644,6 +5644,7 @@ static struct intel_uncore_type spr_uncore_chabox = { .event_mask = SPR_CHA_PMON_EVENT_MASK, .event_mask_ext = SPR_RAW_EVENT_MASK_EXT, .num_shared_regs = 1, + .constraints = skx_uncore_chabox_constraints, .ops = &spr_uncore_chabox_ops, .format_group = &spr_uncore_chabox_format_group, .attr_update = uncore_alias_groups,
Signature · 1 line
2.7.4
[tip: perf/core] perf/x86/intel/uncore: Fix Intel SPR CHA event constraints
The following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 9d756e408e080d40e7916484b00c802026e6d1ad Gitweb: https://git.kernel.org/tip/9d756e408e080d40e7916484b00c802026e6d1ad Author: Kan Liang <[email protected]> AuthorDate: Thu, 26 Aug 2021 08:32:40 -07:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Tue, 31 Aug 2021 13:59:36 +02:00
perf/x86/intel/uncore: Fix Intel SPR CHA event constraints
SPR CHA events have the exact same event constraints as SKX, so add the constraints.
--- arch/x86/events/intel/uncore_snbep.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/events/intel/uncore_snbep.c +1 -0
@@ -5649,6 +5649,7 @@ static struct intel_uncore_type spr_uncore_chabox = { .event_mask = SPR_CHA_PMON_EVENT_MASK, .event_mask_ext = SPR_RAW_EVENT_MASK_EXT, .num_shared_regs = 1, + .constraints = skx_uncore_chabox_constraints, .ops = &spr_uncore_chabox_ops, .format_group = &spr_uncore_chabox_format_group, .attr_update = uncore_alias_groups,
PATCH 5/7 perf/x86/intel/uncore: Fix Intel SPR IIO event constraints
In reply to [email protected]From: Kan Liang <[email protected]>
SPR IIO events have the exact same event constraints as ICX, so add the constraints.
--- arch/x86/events/intel/uncore_snbep.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/events/intel/uncore_snbep.c +1 -0
@@ -5656,6 +5656,7 @@ static struct intel_uncore_type spr_uncore_iio = { .event_mask_ext = SNR_IIO_PMON_RAW_EVENT_MASK_EXT, .format_group = &snr_uncore_iio_format_group, .attr_update = uncore_alias_groups, + .constraints = icx_uncore_iio_constraints, };static struct attribute *spr_uncore_raw_formats_attr[] = {
Signature · 1 line
2.7.4
[tip: perf/core] perf/x86/intel/uncore: Fix Intel SPR IIO event constraints
The following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 67c5d44384f8dc57e1c1b3040423cfce99b578cd Gitweb: https://git.kernel.org/tip/67c5d44384f8dc57e1c1b3040423cfce99b578cd Author: Kan Liang <[email protected]> AuthorDate: Thu, 26 Aug 2021 08:32:41 -07:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Tue, 31 Aug 2021 13:59:36 +02:00
perf/x86/intel/uncore: Fix Intel SPR IIO event constraints
SPR IIO events have the exact same event constraints as ICX, so add the constraints.
--- arch/x86/events/intel/uncore_snbep.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/events/intel/uncore_snbep.c +1 -0
@@ -5661,6 +5661,7 @@ static struct intel_uncore_type spr_uncore_iio = { .event_mask_ext = SNR_IIO_PMON_RAW_EVENT_MASK_EXT, .format_group = &snr_uncore_iio_format_group, .attr_update = uncore_alias_groups, + .constraints = icx_uncore_iio_constraints, };static struct attribute *spr_uncore_raw_formats_attr[] = {
PATCH 6/7 perf/x86/intel/uncore: Fix Intel SPR M2PCIE event constraints
In reply to [email protected]From: Kan Liang <[email protected]>
Similar to the ICX M2PCIE events, some of the SPR M2PCIE events also have constraints. Add the constraints for SPR M2PCIE.
--- arch/x86/events/intel/uncore_snbep.c | 7 +++++++ 1 file changed, 7 insertions(+)
arch/x86/events/intel/uncore_snbep.c +7 -0
@@ -5685,9 +5685,16 @@ static struct intel_uncore_type spr_uncore_irp = { }; +static struct event_constraint spr_uncore_m2pcie_constraints[] = { +UNCORE_EVENT_CONSTRAINT (0x14 ,0x3 ), +UNCORE_EVENT_CONSTRAINT (0x2d ,0x3 ), +EVENT_CONSTRAINT_END +}; +static struct intel_uncore_type spr_uncore_m2pcie = {SPR_UNCORE_COMMON_FORMAT (), .name ="m2pcie" , + .constraints = spr_uncore_m2pcie_constraints, };static struct intel_uncore_type spr_uncore_pcu = {
Signature · 1 line
2.7.4
[tip: perf/core] perf/x86/intel/uncore: Fix Intel SPR M2PCIE event constraints
The following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: f01d7d558e1855d4aa8e927b86111846536dd476 Gitweb: https://git.kernel.org/tip/f01d7d558e1855d4aa8e927b86111846536dd476 Author: Kan Liang <[email protected]> AuthorDate: Thu, 26 Aug 2021 08:32:42 -07:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Tue, 31 Aug 2021 13:59:37 +02:00
perf/x86/intel/uncore: Fix Intel SPR M2PCIE event constraints
Similar to the ICX M2PCIE events, some of the SPR M2PCIE events also have constraints. Add the constraints for SPR M2PCIE.
--- arch/x86/events/intel/uncore_snbep.c | 7 +++++++ 1 file changed, 7 insertions(+)
arch/x86/events/intel/uncore_snbep.c +7 -0
@@ -5690,9 +5690,16 @@ static struct intel_uncore_type spr_uncore_irp = { }; +static struct event_constraint spr_uncore_m2pcie_constraints[] = { +UNCORE_EVENT_CONSTRAINT (0x14 ,0x3 ), +UNCORE_EVENT_CONSTRAINT (0x2d ,0x3 ), +EVENT_CONSTRAINT_END +}; +static struct intel_uncore_type spr_uncore_m2pcie = {SPR_UNCORE_COMMON_FORMAT (), .name ="m2pcie" , + .constraints = spr_uncore_m2pcie_constraints, };static struct intel_uncore_type spr_uncore_pcu = {
PATCH 7/7 perf/x86/intel/uncore: Fix Intel SPR M3UPI event constraints
In reply to [email protected]From: Kan Liang <[email protected]>
SPR M3UPI have the exact same event constraints as ICX, so add the constraints.
--- arch/x86/events/intel/uncore_snbep.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/events/intel/uncore_snbep.c +1 -0
@@ -5771,6 +5771,7 @@ static struct intel_uncore_type spr_uncore_upi = {static struct intel_uncore_type spr_uncore_m3upi = {SPR_UNCORE_PCI_COMMON_FORMAT (), .name ="m3upi" , + .constraints = icx_uncore_m3upi_constraints, };static struct intel_uncore_type spr_uncore_mdf = {
Signature · 1 line
2.7.4
[tip: perf/core] perf/x86/intel/uncore: Fix Intel SPR M3UPI event constraints
The following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 4034fb207e302cc0b1f304084d379640c1fb1436 Gitweb: https://git.kernel.org/tip/4034fb207e302cc0b1f304084d379640c1fb1436 Author: Kan Liang <[email protected]> AuthorDate: Thu, 26 Aug 2021 08:32:43 -07:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Tue, 31 Aug 2021 13:59:37 +02:00
perf/x86/intel/uncore: Fix Intel SPR M3UPI event constraints
SPR M3UPI have the exact same event constraints as ICX, so add the constraints.
--- arch/x86/events/intel/uncore_snbep.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/events/intel/uncore_snbep.c +1 -0
@@ -5776,6 +5776,7 @@ static struct intel_uncore_type spr_uncore_upi = {static struct intel_uncore_type spr_uncore_m3upi = {SPR_UNCORE_PCI_COMMON_FORMAT (), .name ="m3upi" , + .constraints = icx_uncore_m3upi_constraints, };static struct intel_uncore_type spr_uncore_mdf = {