Skip to content

Commit 506f981

Browse files
Kan LiangIngo Molnar
authored andcommitted
perf/x86/intel/uncore: Fix the scale of IIO free running counters on SPR
The scale of IIO bandwidth in free running counters is inherited from the ICX. The counter increments for every 32 bytes rather than 4 bytes. The IIO bandwidth out free running counters don't increment with a consistent size. The increment depends on the requested size. It's impossible to find a fixed increment. Remove it from the event_descs. Fixes: 0378c93 ("perf/x86/intel/uncore: Support IIO free-running counters on Sapphire Rapids server") Reported-by: Tang Jun <dukang.tj@alibaba-inc.com> Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20250416142426.3933977-3-kan.liang@linux.intel.com
1 parent 32c7f11 commit 506f981

File tree

1 file changed

+1
-57
lines changed

1 file changed

+1
-57
lines changed

arch/x86/events/intel/uncore_snbep.c

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6289,69 +6289,13 @@ static struct freerunning_counters spr_iio_freerunning[] = {
62896289
[SPR_IIO_MSR_BW_OUT] = { 0x3808, 0x1, 0x10, 8, 48 },
62906290
};
62916291

6292-
static struct uncore_event_desc spr_uncore_iio_freerunning_events[] = {
6293-
/* Free-Running IIO CLOCKS Counter */
6294-
INTEL_UNCORE_EVENT_DESC(ioclk, "event=0xff,umask=0x10"),
6295-
/* Free-Running IIO BANDWIDTH IN Counters */
6296-
INTEL_UNCORE_EVENT_DESC(bw_in_port0, "event=0xff,umask=0x20"),
6297-
INTEL_UNCORE_EVENT_DESC(bw_in_port0.scale, "3.814697266e-6"),
6298-
INTEL_UNCORE_EVENT_DESC(bw_in_port0.unit, "MiB"),
6299-
INTEL_UNCORE_EVENT_DESC(bw_in_port1, "event=0xff,umask=0x21"),
6300-
INTEL_UNCORE_EVENT_DESC(bw_in_port1.scale, "3.814697266e-6"),
6301-
INTEL_UNCORE_EVENT_DESC(bw_in_port1.unit, "MiB"),
6302-
INTEL_UNCORE_EVENT_DESC(bw_in_port2, "event=0xff,umask=0x22"),
6303-
INTEL_UNCORE_EVENT_DESC(bw_in_port2.scale, "3.814697266e-6"),
6304-
INTEL_UNCORE_EVENT_DESC(bw_in_port2.unit, "MiB"),
6305-
INTEL_UNCORE_EVENT_DESC(bw_in_port3, "event=0xff,umask=0x23"),
6306-
INTEL_UNCORE_EVENT_DESC(bw_in_port3.scale, "3.814697266e-6"),
6307-
INTEL_UNCORE_EVENT_DESC(bw_in_port3.unit, "MiB"),
6308-
INTEL_UNCORE_EVENT_DESC(bw_in_port4, "event=0xff,umask=0x24"),
6309-
INTEL_UNCORE_EVENT_DESC(bw_in_port4.scale, "3.814697266e-6"),
6310-
INTEL_UNCORE_EVENT_DESC(bw_in_port4.unit, "MiB"),
6311-
INTEL_UNCORE_EVENT_DESC(bw_in_port5, "event=0xff,umask=0x25"),
6312-
INTEL_UNCORE_EVENT_DESC(bw_in_port5.scale, "3.814697266e-6"),
6313-
INTEL_UNCORE_EVENT_DESC(bw_in_port5.unit, "MiB"),
6314-
INTEL_UNCORE_EVENT_DESC(bw_in_port6, "event=0xff,umask=0x26"),
6315-
INTEL_UNCORE_EVENT_DESC(bw_in_port6.scale, "3.814697266e-6"),
6316-
INTEL_UNCORE_EVENT_DESC(bw_in_port6.unit, "MiB"),
6317-
INTEL_UNCORE_EVENT_DESC(bw_in_port7, "event=0xff,umask=0x27"),
6318-
INTEL_UNCORE_EVENT_DESC(bw_in_port7.scale, "3.814697266e-6"),
6319-
INTEL_UNCORE_EVENT_DESC(bw_in_port7.unit, "MiB"),
6320-
/* Free-Running IIO BANDWIDTH OUT Counters */
6321-
INTEL_UNCORE_EVENT_DESC(bw_out_port0, "event=0xff,umask=0x30"),
6322-
INTEL_UNCORE_EVENT_DESC(bw_out_port0.scale, "3.814697266e-6"),
6323-
INTEL_UNCORE_EVENT_DESC(bw_out_port0.unit, "MiB"),
6324-
INTEL_UNCORE_EVENT_DESC(bw_out_port1, "event=0xff,umask=0x31"),
6325-
INTEL_UNCORE_EVENT_DESC(bw_out_port1.scale, "3.814697266e-6"),
6326-
INTEL_UNCORE_EVENT_DESC(bw_out_port1.unit, "MiB"),
6327-
INTEL_UNCORE_EVENT_DESC(bw_out_port2, "event=0xff,umask=0x32"),
6328-
INTEL_UNCORE_EVENT_DESC(bw_out_port2.scale, "3.814697266e-6"),
6329-
INTEL_UNCORE_EVENT_DESC(bw_out_port2.unit, "MiB"),
6330-
INTEL_UNCORE_EVENT_DESC(bw_out_port3, "event=0xff,umask=0x33"),
6331-
INTEL_UNCORE_EVENT_DESC(bw_out_port3.scale, "3.814697266e-6"),
6332-
INTEL_UNCORE_EVENT_DESC(bw_out_port3.unit, "MiB"),
6333-
INTEL_UNCORE_EVENT_DESC(bw_out_port4, "event=0xff,umask=0x34"),
6334-
INTEL_UNCORE_EVENT_DESC(bw_out_port4.scale, "3.814697266e-6"),
6335-
INTEL_UNCORE_EVENT_DESC(bw_out_port4.unit, "MiB"),
6336-
INTEL_UNCORE_EVENT_DESC(bw_out_port5, "event=0xff,umask=0x35"),
6337-
INTEL_UNCORE_EVENT_DESC(bw_out_port5.scale, "3.814697266e-6"),
6338-
INTEL_UNCORE_EVENT_DESC(bw_out_port5.unit, "MiB"),
6339-
INTEL_UNCORE_EVENT_DESC(bw_out_port6, "event=0xff,umask=0x36"),
6340-
INTEL_UNCORE_EVENT_DESC(bw_out_port6.scale, "3.814697266e-6"),
6341-
INTEL_UNCORE_EVENT_DESC(bw_out_port6.unit, "MiB"),
6342-
INTEL_UNCORE_EVENT_DESC(bw_out_port7, "event=0xff,umask=0x37"),
6343-
INTEL_UNCORE_EVENT_DESC(bw_out_port7.scale, "3.814697266e-6"),
6344-
INTEL_UNCORE_EVENT_DESC(bw_out_port7.unit, "MiB"),
6345-
{ /* end: all zeroes */ },
6346-
};
6347-
63486292
static struct intel_uncore_type spr_uncore_iio_free_running = {
63496293
.name = "iio_free_running",
63506294
.num_counters = 17,
63516295
.num_freerunning_types = SPR_IIO_FREERUNNING_TYPE_MAX,
63526296
.freerunning = spr_iio_freerunning,
63536297
.ops = &skx_uncore_iio_freerunning_ops,
6354-
.event_descs = spr_uncore_iio_freerunning_events,
6298+
.event_descs = snr_uncore_iio_freerunning_events,
63556299
.format_group = &skx_uncore_iio_freerunning_format_group,
63566300
};
63576301

0 commit comments

Comments
 (0)