Skip to content

Commit 388d761

Browse files
Kan LiangPeter Zijlstra
authored andcommitted
perf/x86/intel/uncore: Support IIO free-running counters on GNR
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. 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
1 parent 632c4bf commit 388d761

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
@@ -6648,11 +6648,21 @@ static struct intel_uncore_type *gnr_uncores[UNCORE_GNR_NUM_UNCORE_TYPES] = {
66486648
NULL,
66496649
};
66506650

6651+
static struct freerunning_counters gnr_iio_freerunning[] = {
6652+
[SPR_IIO_MSR_IOCLK] = { 0x290e, 0x01, 0x10, 1, 48 },
6653+
[SPR_IIO_MSR_BW_IN] = { 0x360e, 0x10, 0x80, 8, 48 },
6654+
[SPR_IIO_MSR_BW_OUT] = { 0x2e0e, 0x10, 0x80, 8, 48 },
6655+
};
6656+
66516657
void gnr_uncore_cpu_init(void)
66526658
{
6653-
uncore_msr_uncores = uncore_get_uncores(UNCORE_ACCESS_MSR, 0, NULL,
6659+
uncore_msr_uncores = uncore_get_uncores(UNCORE_ACCESS_MSR,
6660+
UNCORE_SPR_MSR_EXTRA_UNCORES,
6661+
spr_msr_uncores,
66546662
UNCORE_GNR_NUM_UNCORE_TYPES,
66556663
gnr_uncores);
6664+
spr_uncore_iio_free_running.num_boxes = uncore_type_max_boxes(uncore_msr_uncores, UNCORE_SPR_IIO);
6665+
spr_uncore_iio_free_running.freerunning = gnr_iio_freerunning;
66566666
}
66576667

66586668
int gnr_uncore_pci_init(void)

0 commit comments

Comments
 (0)