Skip to content

Commit 46da08a

Browse files
ZideChen0Peter Zijlstra
authored andcommitted
perf/x86/intel/uncore: Add missing PMON units for Panther Lake
Besides CBOX, Panther Lake includes several legacy uncore PMON units not enumerated via discovery tables, including cNCU, SANTA, and ia_core_bridge. The cNCU PMON is similar to Meteor Lake but has two boxes with two counters each. SANTA and IA Core Bridge PMON units follow the legacy model used on Lunar Lake, Meteor Lake, and others. Panther Lake implements the Global Control Register; the freeze_all bit must be cleared before programming counters. Signed-off-by: Zide Chen <zide.chen@intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com> Link: https://patch.msgid.link/20251231224233.113839-13-zide.chen@intel.com
1 parent 2246c24 commit 46da08a

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

arch/x86/events/intel/uncore.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,6 +1814,7 @@ static const struct uncore_plat_init ptl_uncore_init __initconst = {
18141814
.cpu_init = ptl_uncore_cpu_init,
18151815
.mmio_init = ptl_uncore_mmio_init,
18161816
.domain[0].discovery_base = UNCORE_DISCOVERY_MSR,
1817+
.domain[0].global_init = uncore_mmio_global_init,
18171818
};
18181819

18191820
static const struct uncore_plat_init icx_uncore_init __initconst = {

arch/x86/events/intel/uncore_snb.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,17 @@
245245
#define MTL_UNC_HBO_CTR 0x2048
246246
#define MTL_UNC_HBO_CTRL 0x2042
247247

248+
/* PTL Low Power Bridge register */
249+
#define PTL_UNC_IA_CORE_BRIDGE_PER_CTR0 0x2028
250+
#define PTL_UNC_IA_CORE_BRIDGE_PERFEVTSEL0 0x2022
251+
252+
/* PTL Santa register */
253+
#define PTL_UNC_SANTA_CTR0 0x2418
254+
#define PTL_UNC_SANTA_CTRL0 0x2412
255+
256+
/* PTL cNCU register */
257+
#define PTL_UNC_CNCU_MSR_OFFSET 0x140
258+
248259
DEFINE_UNCORE_FORMAT_ATTR(event, event, "config:0-7");
249260
DEFINE_UNCORE_FORMAT_ATTR(umask, umask, "config:8-15");
250261
DEFINE_UNCORE_FORMAT_ATTR(chmask, chmask, "config:8-11");
@@ -1921,15 +1932,49 @@ void ptl_uncore_mmio_init(void)
19211932
ptl_uncores);
19221933
}
19231934

1935+
static struct intel_uncore_type ptl_uncore_ia_core_bridge = {
1936+
.name = "ia_core_bridge",
1937+
.num_counters = 2,
1938+
.num_boxes = 1,
1939+
.perf_ctr_bits = 48,
1940+
.perf_ctr = PTL_UNC_IA_CORE_BRIDGE_PER_CTR0,
1941+
.event_ctl = PTL_UNC_IA_CORE_BRIDGE_PERFEVTSEL0,
1942+
.event_mask = ADL_UNC_RAW_EVENT_MASK,
1943+
.ops = &icl_uncore_msr_ops,
1944+
.format_group = &adl_uncore_format_group,
1945+
};
1946+
1947+
static struct intel_uncore_type ptl_uncore_santa = {
1948+
.name = "santa",
1949+
.num_counters = 2,
1950+
.num_boxes = 2,
1951+
.perf_ctr_bits = 48,
1952+
.perf_ctr = PTL_UNC_SANTA_CTR0,
1953+
.event_ctl = PTL_UNC_SANTA_CTRL0,
1954+
.event_mask = ADL_UNC_RAW_EVENT_MASK,
1955+
.msr_offset = SNB_UNC_CBO_MSR_OFFSET,
1956+
.ops = &icl_uncore_msr_ops,
1957+
.format_group = &adl_uncore_format_group,
1958+
};
1959+
19241960
static struct intel_uncore_type *ptl_msr_uncores[] = {
19251961
&mtl_uncore_cbox,
1962+
&ptl_uncore_ia_core_bridge,
1963+
&ptl_uncore_santa,
1964+
&mtl_uncore_cncu,
19261965
NULL
19271966
};
19281967

19291968
void ptl_uncore_cpu_init(void)
19301969
{
19311970
mtl_uncore_cbox.num_boxes = 6;
19321971
mtl_uncore_cbox.ops = &lnl_uncore_msr_ops;
1972+
1973+
mtl_uncore_cncu.num_counters = 2;
1974+
mtl_uncore_cncu.num_boxes = 2;
1975+
mtl_uncore_cncu.msr_offset = PTL_UNC_CNCU_MSR_OFFSET;
1976+
mtl_uncore_cncu.single_fixed = 0;
1977+
19331978
uncore_msr_uncores = ptl_msr_uncores;
19341979
}
19351980

0 commit comments

Comments
 (0)