All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] perf/x86/intel/uncore: Various fix for ICX and SPR
@ 2021-08-26 15:32 kan.liang
  2021-08-26 15:32 ` [PATCH 1/7] perf/x86/intel/uncore: Support extra IMC channel on Ice Lake server kan.liang
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: kan.liang @ 2021-08-26 15:32 UTC (permalink / raw)
  To: peterz, mingo, linux-kernel; +Cc: eranian, ak, Kan Liang

From: Kan Liang <kan.liang@linux.intel.com>

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(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/7] perf/x86/intel/uncore: Support extra IMC channel on Ice Lake server
  2021-08-26 15:32 [PATCH 0/7] perf/x86/intel/uncore: Various fix for ICX and SPR kan.liang
@ 2021-08-26 15:32 ` kan.liang
  2021-08-31 12:07   ` [tip: perf/core] " tip-bot2 for Kan Liang
  2021-08-26 15:32 ` [PATCH 2/7] perf/x86/intel/uncore: Fix invalid unit check kan.liang
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: kan.liang @ 2021-08-26 15:32 UTC (permalink / raw)
  To: peterz, mingo, linux-kernel; +Cc: eranian, ak, Kan Liang, stable

From: Kan Liang <kan.liang@linux.intel.com>

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.

Fixes: 2b3b76b5ec67 ("perf/x86/intel/uncore: Add Ice Lake server uncore support")
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Cc: stable@vger.kernel.org
---

The patch is a RESEND patch. The original post can be found at

https://lore.kernel.org/lkml/1625766302-18875-1-git-send-email-kan.liang@linux.intel.com

 arch/x86/events/intel/uncore_snbep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/antler/uncore_snbep.c
index 9a178a9..72a4181 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -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,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/7] perf/x86/intel/uncore: Fix invalid unit check
  2021-08-26 15:32 [PATCH 0/7] perf/x86/intel/uncore: Various fix for ICX and SPR kan.liang
  2021-08-26 15:32 ` [PATCH 1/7] perf/x86/intel/uncore: Support extra IMC channel on Ice Lake server kan.liang
@ 2021-08-26 15:32 ` kan.liang
  2021-08-31 12:07   ` [tip: perf/core] " tip-bot2 for Kan Liang
  2021-08-26 15:32 ` [PATCH 3/7] perf/x86/intel/uncore: Fix Intel ICX IIO event constraints kan.liang
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: kan.liang @ 2021-08-26 15:32 UTC (permalink / raw)
  To: peterz, mingo, linux-kernel; +Cc: eranian, ak, Kan Liang, stable

From: Kan Liang <kan.liang@linux.intel.com>

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.

Fixes: edae1f06c2cd ("perf/x86/intel/uncore: Parse uncore discovery tables")
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Cc: stable@vger.kernel.org
---

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/cb0d2d43-102a-994c-f777-e11d61c77bf5@linux.intel.com/

 arch/x86/events/intel/uncore_discovery.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/uncore_discovery.h b/arch/x86/events/intel/uncore_discovery.h
index 7280c8a..6d735611 100644
--- a/arch/x86/events/intel/uncore_discovery.h
+++ b/arch/x86/events/intel/uncore_discovery.h
@@ -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)
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/7] perf/x86/intel/uncore: Fix Intel ICX IIO event constraints
  2021-08-26 15:32 [PATCH 0/7] perf/x86/intel/uncore: Various fix for ICX and SPR kan.liang
  2021-08-26 15:32 ` [PATCH 1/7] perf/x86/intel/uncore: Support extra IMC channel on Ice Lake server kan.liang
  2021-08-26 15:32 ` [PATCH 2/7] perf/x86/intel/uncore: Fix invalid unit check kan.liang
@ 2021-08-26 15:32 ` kan.liang
  2021-08-31 12:07   ` [tip: perf/core] " tip-bot2 for Kan Liang
  2021-08-26 15:32 ` [PATCH 4/7] perf/x86/intel/uncore: Fix Intel SPR CHA " kan.liang
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: kan.liang @ 2021-08-26 15:32 UTC (permalink / raw)
  To: peterz, mingo, linux-kernel; +Cc: eranian, ak, Kan Liang, stable

From: Kan Liang <kan.liang@linux.intel.com>

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.

Fixes: 2b3b76b5ec67 ("perf/x86/intel/uncore: Add Ice Lake server uncore support")
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Cc: stable@vger.kernel.org
---
 arch/x86/events/intel/uncore_snbep.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 72a4181..865129a 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -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
 };
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 4/7] perf/x86/intel/uncore: Fix Intel SPR CHA event constraints
  2021-08-26 15:32 [PATCH 0/7] perf/x86/intel/uncore: Various fix for ICX and SPR kan.liang
                   ` (2 preceding siblings ...)
  2021-08-26 15:32 ` [PATCH 3/7] perf/x86/intel/uncore: Fix Intel ICX IIO event constraints kan.liang
@ 2021-08-26 15:32 ` kan.liang
  2021-08-31 12:07   ` [tip: perf/core] " tip-bot2 for Kan Liang
  2021-08-26 15:32 ` [PATCH 5/7] perf/x86/intel/uncore: Fix Intel SPR IIO " kan.liang
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: kan.liang @ 2021-08-26 15:32 UTC (permalink / raw)
  To: peterz, mingo, linux-kernel; +Cc: eranian, ak, Kan Liang

From: Kan Liang <kan.liang@linux.intel.com>

SPR CHA events have the exact same event constraints as SKX, so add the
constraints.

Fixes: 949b11381f81 ("perf/x86/intel/uncore: Add Sapphire Rapids server CHA support")
Reported-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
---
 arch/x86/events/intel/uncore_snbep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 865129a..06ad632 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -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,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 5/7] perf/x86/intel/uncore: Fix Intel SPR IIO event constraints
  2021-08-26 15:32 [PATCH 0/7] perf/x86/intel/uncore: Various fix for ICX and SPR kan.liang
                   ` (3 preceding siblings ...)
  2021-08-26 15:32 ` [PATCH 4/7] perf/x86/intel/uncore: Fix Intel SPR CHA " kan.liang
@ 2021-08-26 15:32 ` kan.liang
  2021-08-31 12:07   ` [tip: perf/core] " tip-bot2 for Kan Liang
  2021-08-26 15:32 ` [PATCH 6/7] perf/x86/intel/uncore: Fix Intel SPR M2PCIE " kan.liang
  2021-08-26 15:32 ` [PATCH 7/7] perf/x86/intel/uncore: Fix Intel SPR M3UPI " kan.liang
  6 siblings, 1 reply; 15+ messages in thread
From: kan.liang @ 2021-08-26 15:32 UTC (permalink / raw)
  To: peterz, mingo, linux-kernel; +Cc: eranian, ak, Kan Liang

From: Kan Liang <kan.liang@linux.intel.com>

SPR IIO events have the exact same event constraints as ICX, so add the
constraints.

Fixes: 3ba7095beaec ("perf/x86/intel/uncore: Add Sapphire Rapids server IIO support")
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
---
 arch/x86/events/intel/uncore_snbep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 06ad632..3a49a5a 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -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[] = {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 6/7] perf/x86/intel/uncore: Fix Intel SPR M2PCIE event constraints
  2021-08-26 15:32 [PATCH 0/7] perf/x86/intel/uncore: Various fix for ICX and SPR kan.liang
                   ` (4 preceding siblings ...)
  2021-08-26 15:32 ` [PATCH 5/7] perf/x86/intel/uncore: Fix Intel SPR IIO " kan.liang
@ 2021-08-26 15:32 ` kan.liang
  2021-08-31 12:07   ` [tip: perf/core] " tip-bot2 for Kan Liang
  2021-08-26 15:32 ` [PATCH 7/7] perf/x86/intel/uncore: Fix Intel SPR M3UPI " kan.liang
  6 siblings, 1 reply; 15+ messages in thread
From: kan.liang @ 2021-08-26 15:32 UTC (permalink / raw)
  To: peterz, mingo, linux-kernel; +Cc: eranian, ak, Kan Liang

From: Kan Liang <kan.liang@linux.intel.com>

Similar to the ICX M2PCIE  events, some of the SPR M2PCIE events also
have constraints. Add the constraints for SPR M2PCIE.

Fixes: f85ef898f884 ("perf/x86/intel/uncore: Add Sapphire Rapids server M2PCIe support")
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
---
 arch/x86/events/intel/uncore_snbep.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 3a49a5a..0a8f8a6 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -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 = {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 7/7] perf/x86/intel/uncore: Fix Intel SPR M3UPI event constraints
  2021-08-26 15:32 [PATCH 0/7] perf/x86/intel/uncore: Various fix for ICX and SPR kan.liang
                   ` (5 preceding siblings ...)
  2021-08-26 15:32 ` [PATCH 6/7] perf/x86/intel/uncore: Fix Intel SPR M2PCIE " kan.liang
@ 2021-08-26 15:32 ` kan.liang
  2021-08-31 12:07   ` [tip: perf/core] " tip-bot2 for Kan Liang
  6 siblings, 1 reply; 15+ messages in thread
From: kan.liang @ 2021-08-26 15:32 UTC (permalink / raw)
  To: peterz, mingo, linux-kernel; +Cc: eranian, ak, Kan Liang

From: Kan Liang <kan.liang@linux.intel.com>

SPR M3UPI have the exact same event constraints as ICX, so add the
constraints.

Fixes: 2a8e51eae7c8 ("perf/x86/intel/uncore: Add Sapphire Rapids server M3UPI support")
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
---
 arch/x86/events/intel/uncore_snbep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 0a8f8a6..02b926d 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -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 = {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [tip: perf/core] perf/x86/intel/uncore: Fix Intel SPR M3UPI event constraints
  2021-08-26 15:32 ` [PATCH 7/7] perf/x86/intel/uncore: Fix Intel SPR M3UPI " kan.liang
@ 2021-08-31 12:07   ` tip-bot2 for Kan Liang
  0 siblings, 0 replies; 15+ messages in thread
From: tip-bot2 for Kan Liang @ 2021-08-31 12:07 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Kan Liang, Peter Zijlstra (Intel), x86, linux-kernel

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 <kan.liang@linux.intel.com>
AuthorDate:    Thu, 26 Aug 2021 08:32:43 -07:00
Committer:     Peter Zijlstra <peterz@infradead.org>
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.

Fixes: 2a8e51eae7c8 ("perf/x86/intel/uncore: Add Sapphire Rapids server M3UPI support")
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/1629991963-102621-8-git-send-email-kan.liang@linux.intel.com
---
 arch/x86/events/intel/uncore_snbep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index cd53057..eb2c6ce 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -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 = {

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [tip: perf/core] perf/x86/intel/uncore: Fix Intel SPR M2PCIE event constraints
  2021-08-26 15:32 ` [PATCH 6/7] perf/x86/intel/uncore: Fix Intel SPR M2PCIE " kan.liang
@ 2021-08-31 12:07   ` tip-bot2 for Kan Liang
  0 siblings, 0 replies; 15+ messages in thread
From: tip-bot2 for Kan Liang @ 2021-08-31 12:07 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Kan Liang, Peter Zijlstra (Intel), x86, linux-kernel

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 <kan.liang@linux.intel.com>
AuthorDate:    Thu, 26 Aug 2021 08:32:42 -07:00
Committer:     Peter Zijlstra <peterz@infradead.org>
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.

Fixes: f85ef898f884 ("perf/x86/intel/uncore: Add Sapphire Rapids server M2PCIe support")
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/1629991963-102621-7-git-send-email-kan.liang@linux.intel.com
---
 arch/x86/events/intel/uncore_snbep.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 2d75d21..cd53057 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -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 = {

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [tip: perf/core] perf/x86/intel/uncore: Fix Intel SPR IIO event constraints
  2021-08-26 15:32 ` [PATCH 5/7] perf/x86/intel/uncore: Fix Intel SPR IIO " kan.liang
@ 2021-08-31 12:07   ` tip-bot2 for Kan Liang
  0 siblings, 0 replies; 15+ messages in thread
From: tip-bot2 for Kan Liang @ 2021-08-31 12:07 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Kan Liang, Peter Zijlstra (Intel), x86, linux-kernel

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 <kan.liang@linux.intel.com>
AuthorDate:    Thu, 26 Aug 2021 08:32:41 -07:00
Committer:     Peter Zijlstra <peterz@infradead.org>
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.

Fixes: 3ba7095beaec ("perf/x86/intel/uncore: Add Sapphire Rapids server IIO support")
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/1629991963-102621-6-git-send-email-kan.liang@linux.intel.com
---
 arch/x86/events/intel/uncore_snbep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index ce85ee5..2d75d21 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -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[] = {

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [tip: perf/core] perf/x86/intel/uncore: Fix Intel SPR CHA event constraints
  2021-08-26 15:32 ` [PATCH 4/7] perf/x86/intel/uncore: Fix Intel SPR CHA " kan.liang
@ 2021-08-31 12:07   ` tip-bot2 for Kan Liang
  0 siblings, 0 replies; 15+ messages in thread
From: tip-bot2 for Kan Liang @ 2021-08-31 12:07 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Stephane Eranian, Kan Liang, Peter Zijlstra (Intel), x86, linux-kernel

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 <kan.liang@linux.intel.com>
AuthorDate:    Thu, 26 Aug 2021 08:32:40 -07:00
Committer:     Peter Zijlstra <peterz@infradead.org>
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.

Fixes: 949b11381f81 ("perf/x86/intel/uncore: Add Sapphire Rapids server CHA support")
Reported-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/1629991963-102621-5-git-send-email-kan.liang@linux.intel.com
---
 arch/x86/events/intel/uncore_snbep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index d941854..ce85ee5 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -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,

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [tip: perf/core] perf/x86/intel/uncore: Fix invalid unit check
  2021-08-26 15:32 ` [PATCH 2/7] perf/x86/intel/uncore: Fix invalid unit check kan.liang
@ 2021-08-31 12:07   ` tip-bot2 for Kan Liang
  0 siblings, 0 replies; 15+ messages in thread
From: tip-bot2 for Kan Liang @ 2021-08-31 12:07 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Kan Liang, Peter Zijlstra (Intel), Andi Kleen, stable, x86, linux-kernel

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 <kan.liang@linux.intel.com>
AuthorDate:    Thu, 26 Aug 2021 08:32:38 -07:00
Committer:     Peter Zijlstra <peterz@infradead.org>
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.

Fixes: edae1f06c2cd ("perf/x86/intel/uncore: Parse uncore discovery tables")
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/1629991963-102621-3-git-send-email-kan.liang@linux.intel.com
---
 arch/x86/events/intel/uncore_discovery.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/uncore_discovery.h b/arch/x86/events/intel/uncore_discovery.h
index 7280c8a..6d73561 100644
--- a/arch/x86/events/intel/uncore_discovery.h
+++ b/arch/x86/events/intel/uncore_discovery.h
@@ -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)
 

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [tip: perf/core] perf/x86/intel/uncore: Fix Intel ICX IIO event constraints
  2021-08-26 15:32 ` [PATCH 3/7] perf/x86/intel/uncore: Fix Intel ICX IIO event constraints kan.liang
@ 2021-08-31 12:07   ` tip-bot2 for Kan Liang
  0 siblings, 0 replies; 15+ messages in thread
From: tip-bot2 for Kan Liang @ 2021-08-31 12:07 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Kan Liang, Peter Zijlstra (Intel), stable, x86, linux-kernel

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 <kan.liang@linux.intel.com>
AuthorDate:    Thu, 26 Aug 2021 08:32:39 -07:00
Committer:     Peter Zijlstra <peterz@infradead.org>
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.

Fixes: 2b3b76b5ec67 ("perf/x86/intel/uncore: Add Ice Lake server uncore support")
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/1629991963-102621-4-git-send-email-kan.liang@linux.intel.com
---
 arch/x86/events/intel/uncore_snbep.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index ea29e89..d941854 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -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
 };
 

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [tip: perf/core] perf/x86/intel/uncore: Support extra IMC channel on Ice Lake server
  2021-08-26 15:32 ` [PATCH 1/7] perf/x86/intel/uncore: Support extra IMC channel on Ice Lake server kan.liang
@ 2021-08-31 12:07   ` tip-bot2 for Kan Liang
  0 siblings, 0 replies; 15+ messages in thread
From: tip-bot2 for Kan Liang @ 2021-08-31 12:07 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Kan Liang, Peter Zijlstra (Intel), Andi Kleen, stable, x86, linux-kernel

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 <kan.liang@linux.intel.com>
AuthorDate:    Thu, 26 Aug 2021 08:32:37 -07:00
Committer:     Peter Zijlstra <peterz@infradead.org>
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.

Fixes: 2b3b76b5ec67 ("perf/x86/intel/uncore: Add Ice Lake server uncore support")
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/1629991963-102621-2-git-send-email-kan.liang@linux.intel.com
---
 arch/x86/events/intel/uncore_snbep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 5ddc0f3..ea29e89 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -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,

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-08-31 12:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26 15:32 [PATCH 0/7] perf/x86/intel/uncore: Various fix for ICX and SPR kan.liang
2021-08-26 15:32 ` [PATCH 1/7] perf/x86/intel/uncore: Support extra IMC channel on Ice Lake server kan.liang
2021-08-31 12:07   ` [tip: perf/core] " tip-bot2 for Kan Liang
2021-08-26 15:32 ` [PATCH 2/7] perf/x86/intel/uncore: Fix invalid unit check kan.liang
2021-08-31 12:07   ` [tip: perf/core] " tip-bot2 for Kan Liang
2021-08-26 15:32 ` [PATCH 3/7] perf/x86/intel/uncore: Fix Intel ICX IIO event constraints kan.liang
2021-08-31 12:07   ` [tip: perf/core] " tip-bot2 for Kan Liang
2021-08-26 15:32 ` [PATCH 4/7] perf/x86/intel/uncore: Fix Intel SPR CHA " kan.liang
2021-08-31 12:07   ` [tip: perf/core] " tip-bot2 for Kan Liang
2021-08-26 15:32 ` [PATCH 5/7] perf/x86/intel/uncore: Fix Intel SPR IIO " kan.liang
2021-08-31 12:07   ` [tip: perf/core] " tip-bot2 for Kan Liang
2021-08-26 15:32 ` [PATCH 6/7] perf/x86/intel/uncore: Fix Intel SPR M2PCIE " kan.liang
2021-08-31 12:07   ` [tip: perf/core] " tip-bot2 for Kan Liang
2021-08-26 15:32 ` [PATCH 7/7] perf/x86/intel/uncore: Fix Intel SPR M3UPI " kan.liang
2021-08-31 12:07   ` [tip: perf/core] " tip-bot2 for Kan Liang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.