Skip to content

Commit 1d7e454

Browse files
Kan Liangopsiff
authored andcommitted
perf/x86/intel/uncore: Support IIO free-running counters on GNR
ANBZ: #8008 commit 388d761 upstream. The free-running counters for IIO uncore blocks on Granite Rapids are similar to Sapphire Rapids. The key difference is the offset of the registers. The number of the IIO uncore blocks can also be retrieved from the discovery table. Intel-SIG: commit 388d761 perf/x86/intel/uncore: Support IIO free-running counters on GNR Backport GNR/SRF uncore PMU support to kernel v6.6 Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Ammy Yi <ammy.yi@intel.com> Link: https://lore.kernel.org/r/20231117163939.2468007-4-kan.liang@linux.intel.com [ Yunying Sun: amend commit log ] Signed-off-by: Yunying Sun <yunying.sun@intel.com>
1 parent 053901a commit 1d7e454

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

arch/x86/events/intel/uncore_snbep.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6570,11 +6570,21 @@ static struct intel_uncore_type *gnr_uncores[UNCORE_GNR_NUM_UNCORE_TYPES] = {
65706570
NULL,
65716571
};
65726572

6573+
static struct freerunning_counters gnr_iio_freerunning[] = {
6574+
[SPR_IIO_MSR_IOCLK] = { 0x290e, 0x01, 0x10, 1, 48 },
6575+
[SPR_IIO_MSR_BW_IN] = { 0x360e, 0x10, 0x80, 8, 48 },
6576+
[SPR_IIO_MSR_BW_OUT] = { 0x2e0e, 0x10, 0x80, 8, 48 },
6577+
};
6578+
65736579
void gnr_uncore_cpu_init(void)
65746580
{
6575-
uncore_msr_uncores = uncore_get_uncores(UNCORE_ACCESS_MSR, 0, NULL,
6581+
uncore_msr_uncores = uncore_get_uncores(UNCORE_ACCESS_MSR,
6582+
UNCORE_SPR_MSR_EXTRA_UNCORES,
6583+
spr_msr_uncores,
65766584
UNCORE_GNR_NUM_UNCORE_TYPES,
65776585
gnr_uncores);
6586+
spr_uncore_iio_free_running.num_boxes = uncore_type_max_boxes(uncore_msr_uncores, UNCORE_SPR_IIO);
6587+
spr_uncore_iio_free_running.freerunning = gnr_iio_freerunning;
65786588
}
65796589

65806590
int gnr_uncore_pci_init(void)

0 commit comments

Comments
 (0)