stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] perf/x86/intel/uncore: Support extra IMC channel on Ice Lake server
       [not found] <1629991963-102621-1-git-send-email-kan.liang@linux.intel.com>
@ 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
  2021-08-26 15:32 ` [PATCH 3/7] perf/x86/intel/uncore: Fix Intel ICX IIO event constraints kan.liang
  2 siblings, 1 reply; 6+ 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] 6+ messages in thread

* [PATCH 2/7] perf/x86/intel/uncore: Fix invalid unit check
       [not found] <1629991963-102621-1-git-send-email-kan.liang@linux.intel.com>
  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
  2 siblings, 1 reply; 6+ 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] 6+ messages in thread

* [PATCH 3/7] perf/x86/intel/uncore: Fix Intel ICX IIO event constraints
       [not found] <1629991963-102621-1-git-send-email-kan.liang@linux.intel.com>
  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
  2 siblings, 1 reply; 6+ 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] 6+ 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; 6+ 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] 6+ 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; 6+ 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] 6+ 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; 6+ 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] 6+ messages in thread

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1629991963-102621-1-git-send-email-kan.liang@linux.intel.com>
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).