Skip to content

Commit 8f5d41f

Browse files
Kan LiangPeter Zijlstra
authored andcommitted
perf/x86/intel/uncore: Update Ice Lake uncore units
There are some updates for the Icelake model specific uncore performance monitors. (The update can be found at 10th generation intel core processors families specification update Revision 004, ICL068) 1) Counter 0 of ARB uncore unit is not available for software use 2) The global 'enable bit' (bit 29) and 'freeze bit' (bit 31) of MSR_UNC_PERF_GLOBAL_CTRL cannot be used to control counter behavior. Needs to use local enable in event select MSR. Accessing the modified bit/registers will be ignored by HW. Users may observe inaccurate results with the current code. The changes of the MSR_UNC_PERF_GLOBAL_CTRL imply that groups cannot be read atomically anymore. Although the error of the result for a group becomes a bit bigger, it still far lower than not using a group. The group support is still kept. Only Remove the *_box() related implementation. Since the counter 0 of ARB uncore unit is not available, update the MSR address for the ARB uncore unit. There is no change for IMC uncore unit, which only include free-running counters. Fixes: 6e39437 ("perf/x86/intel/uncore: Add Intel Icelake uncore support") Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20200925134905.8839-2-kan.liang@linux.intel.com
1 parent 8abbcfe commit 8f5d41f

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

arch/x86/events/intel/uncore_snb.c

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@
126126
#define ICL_UNC_CBO_0_PER_CTR0 0x702
127127
#define ICL_UNC_CBO_MSR_OFFSET 0x8
128128

129+
/* ICL ARB register */
130+
#define ICL_UNC_ARB_PER_CTR 0x3b1
131+
#define ICL_UNC_ARB_PERFEVTSEL 0x3b3
132+
129133
DEFINE_UNCORE_FORMAT_ATTR(event, event, "config:0-7");
130134
DEFINE_UNCORE_FORMAT_ATTR(umask, umask, "config:8-15");
131135
DEFINE_UNCORE_FORMAT_ATTR(edge, edge, "config:18");
@@ -313,6 +317,12 @@ void skl_uncore_cpu_init(void)
313317
snb_uncore_arb.ops = &skl_uncore_msr_ops;
314318
}
315319

320+
static struct intel_uncore_ops icl_uncore_msr_ops = {
321+
.disable_event = snb_uncore_msr_disable_event,
322+
.enable_event = snb_uncore_msr_enable_event,
323+
.read_counter = uncore_msr_read_counter,
324+
};
325+
316326
static struct intel_uncore_type icl_uncore_cbox = {
317327
.name = "cbox",
318328
.num_counters = 4,
@@ -321,7 +331,7 @@ static struct intel_uncore_type icl_uncore_cbox = {
321331
.event_ctl = SNB_UNC_CBO_0_PERFEVTSEL0,
322332
.event_mask = SNB_UNC_RAW_EVENT_MASK,
323333
.msr_offset = ICL_UNC_CBO_MSR_OFFSET,
324-
.ops = &skl_uncore_msr_ops,
334+
.ops = &icl_uncore_msr_ops,
325335
.format_group = &snb_uncore_format_group,
326336
};
327337

@@ -350,13 +360,25 @@ static struct intel_uncore_type icl_uncore_clockbox = {
350360
.single_fixed = 1,
351361
.event_mask = SNB_UNC_CTL_EV_SEL_MASK,
352362
.format_group = &icl_uncore_clock_format_group,
353-
.ops = &skl_uncore_msr_ops,
363+
.ops = &icl_uncore_msr_ops,
354364
.event_descs = icl_uncore_events,
355365
};
356366

367+
static struct intel_uncore_type icl_uncore_arb = {
368+
.name = "arb",
369+
.num_counters = 1,
370+
.num_boxes = 1,
371+
.perf_ctr_bits = 44,
372+
.perf_ctr = ICL_UNC_ARB_PER_CTR,
373+
.event_ctl = ICL_UNC_ARB_PERFEVTSEL,
374+
.event_mask = SNB_UNC_RAW_EVENT_MASK,
375+
.ops = &icl_uncore_msr_ops,
376+
.format_group = &snb_uncore_format_group,
377+
};
378+
357379
static struct intel_uncore_type *icl_msr_uncores[] = {
358380
&icl_uncore_cbox,
359-
&snb_uncore_arb,
381+
&icl_uncore_arb,
360382
&icl_uncore_clockbox,
361383
NULL,
362384
};
@@ -374,7 +396,6 @@ void icl_uncore_cpu_init(void)
374396
{
375397
uncore_msr_uncores = icl_msr_uncores;
376398
icl_uncore_cbox.num_boxes = icl_get_cbox_num();
377-
snb_uncore_arb.ops = &skl_uncore_msr_ops;
378399
}
379400

380401
static struct intel_uncore_type *tgl_msr_uncores[] = {

0 commit comments

Comments
 (0)