Skip to content

Commit ff85509

Browse files
Kan Liangvijay-suman
authored andcommitted
perf/x86/intel/uncore: Fix the scale of IIO free running counters on SPR
commit 506f981ab40f0b03a11a640cfd77f48b09aff330 upstream. 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 <[email protected]> Signed-off-by: Kan Liang <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3d81ec24e7db2be07638b6061f6faff97177a5ba) Signed-off-by: Vijayendra Suman <[email protected]>
1 parent adb0ee0 commit ff85509

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
@@ -6216,69 +6216,13 @@ static struct freerunning_counters spr_iio_freerunning[] = {
62166216
[SPR_IIO_MSR_BW_OUT] = { 0x3808, 0x1, 0x10, 8, 48 },
62176217
};
62186218

6219-
static struct uncore_event_desc spr_uncore_iio_freerunning_events[] = {
6220-
/* Free-Running IIO CLOCKS Counter */
6221-
INTEL_UNCORE_EVENT_DESC(ioclk, "event=0xff,umask=0x10"),
6222-
/* Free-Running IIO BANDWIDTH IN Counters */
6223-
INTEL_UNCORE_EVENT_DESC(bw_in_port0, "event=0xff,umask=0x20"),
6224-
INTEL_UNCORE_EVENT_DESC(bw_in_port0.scale, "3.814697266e-6"),
6225-
INTEL_UNCORE_EVENT_DESC(bw_in_port0.unit, "MiB"),
6226-
INTEL_UNCORE_EVENT_DESC(bw_in_port1, "event=0xff,umask=0x21"),
6227-
INTEL_UNCORE_EVENT_DESC(bw_in_port1.scale, "3.814697266e-6"),
6228-
INTEL_UNCORE_EVENT_DESC(bw_in_port1.unit, "MiB"),
6229-
INTEL_UNCORE_EVENT_DESC(bw_in_port2, "event=0xff,umask=0x22"),
6230-
INTEL_UNCORE_EVENT_DESC(bw_in_port2.scale, "3.814697266e-6"),
6231-
INTEL_UNCORE_EVENT_DESC(bw_in_port2.unit, "MiB"),
6232-
INTEL_UNCORE_EVENT_DESC(bw_in_port3, "event=0xff,umask=0x23"),
6233-
INTEL_UNCORE_EVENT_DESC(bw_in_port3.scale, "3.814697266e-6"),
6234-
INTEL_UNCORE_EVENT_DESC(bw_in_port3.unit, "MiB"),
6235-
INTEL_UNCORE_EVENT_DESC(bw_in_port4, "event=0xff,umask=0x24"),
6236-
INTEL_UNCORE_EVENT_DESC(bw_in_port4.scale, "3.814697266e-6"),
6237-
INTEL_UNCORE_EVENT_DESC(bw_in_port4.unit, "MiB"),
6238-
INTEL_UNCORE_EVENT_DESC(bw_in_port5, "event=0xff,umask=0x25"),
6239-
INTEL_UNCORE_EVENT_DESC(bw_in_port5.scale, "3.814697266e-6"),
6240-
INTEL_UNCORE_EVENT_DESC(bw_in_port5.unit, "MiB"),
6241-
INTEL_UNCORE_EVENT_DESC(bw_in_port6, "event=0xff,umask=0x26"),
6242-
INTEL_UNCORE_EVENT_DESC(bw_in_port6.scale, "3.814697266e-6"),
6243-
INTEL_UNCORE_EVENT_DESC(bw_in_port6.unit, "MiB"),
6244-
INTEL_UNCORE_EVENT_DESC(bw_in_port7, "event=0xff,umask=0x27"),
6245-
INTEL_UNCORE_EVENT_DESC(bw_in_port7.scale, "3.814697266e-6"),
6246-
INTEL_UNCORE_EVENT_DESC(bw_in_port7.unit, "MiB"),
6247-
/* Free-Running IIO BANDWIDTH OUT Counters */
6248-
INTEL_UNCORE_EVENT_DESC(bw_out_port0, "event=0xff,umask=0x30"),
6249-
INTEL_UNCORE_EVENT_DESC(bw_out_port0.scale, "3.814697266e-6"),
6250-
INTEL_UNCORE_EVENT_DESC(bw_out_port0.unit, "MiB"),
6251-
INTEL_UNCORE_EVENT_DESC(bw_out_port1, "event=0xff,umask=0x31"),
6252-
INTEL_UNCORE_EVENT_DESC(bw_out_port1.scale, "3.814697266e-6"),
6253-
INTEL_UNCORE_EVENT_DESC(bw_out_port1.unit, "MiB"),
6254-
INTEL_UNCORE_EVENT_DESC(bw_out_port2, "event=0xff,umask=0x32"),
6255-
INTEL_UNCORE_EVENT_DESC(bw_out_port2.scale, "3.814697266e-6"),
6256-
INTEL_UNCORE_EVENT_DESC(bw_out_port2.unit, "MiB"),
6257-
INTEL_UNCORE_EVENT_DESC(bw_out_port3, "event=0xff,umask=0x33"),
6258-
INTEL_UNCORE_EVENT_DESC(bw_out_port3.scale, "3.814697266e-6"),
6259-
INTEL_UNCORE_EVENT_DESC(bw_out_port3.unit, "MiB"),
6260-
INTEL_UNCORE_EVENT_DESC(bw_out_port4, "event=0xff,umask=0x34"),
6261-
INTEL_UNCORE_EVENT_DESC(bw_out_port4.scale, "3.814697266e-6"),
6262-
INTEL_UNCORE_EVENT_DESC(bw_out_port4.unit, "MiB"),
6263-
INTEL_UNCORE_EVENT_DESC(bw_out_port5, "event=0xff,umask=0x35"),
6264-
INTEL_UNCORE_EVENT_DESC(bw_out_port5.scale, "3.814697266e-6"),
6265-
INTEL_UNCORE_EVENT_DESC(bw_out_port5.unit, "MiB"),
6266-
INTEL_UNCORE_EVENT_DESC(bw_out_port6, "event=0xff,umask=0x36"),
6267-
INTEL_UNCORE_EVENT_DESC(bw_out_port6.scale, "3.814697266e-6"),
6268-
INTEL_UNCORE_EVENT_DESC(bw_out_port6.unit, "MiB"),
6269-
INTEL_UNCORE_EVENT_DESC(bw_out_port7, "event=0xff,umask=0x37"),
6270-
INTEL_UNCORE_EVENT_DESC(bw_out_port7.scale, "3.814697266e-6"),
6271-
INTEL_UNCORE_EVENT_DESC(bw_out_port7.unit, "MiB"),
6272-
{ /* end: all zeroes */ },
6273-
};
6274-
62756219
static struct intel_uncore_type spr_uncore_iio_free_running = {
62766220
.name = "iio_free_running",
62776221
.num_counters = 17,
62786222
.num_freerunning_types = SPR_IIO_FREERUNNING_TYPE_MAX,
62796223
.freerunning = spr_iio_freerunning,
62806224
.ops = &skx_uncore_iio_freerunning_ops,
6281-
.event_descs = spr_uncore_iio_freerunning_events,
6225+
.event_descs = snr_uncore_iio_freerunning_events,
62826226
.format_group = &skx_uncore_iio_freerunning_format_group,
62836227
};
62846228

0 commit comments

Comments
 (0)