Skip to content

Commit e7d5f2e

Browse files
ZideChen0Peter Zijlstra
authored andcommitted
perf/x86/intel/uncore: Add Nova Lake support
Nova Lake uncore PMON largely follows Panther Lake and supports CBOX, iMC, cNCU, SANTA, sNCU, and HBO units. As with Panther Lake, CBOX, cNCU, and SANTA are not enumerated via discovery tables. Their programming model matches Panther Lake, with differences limited to MSR addresses and the number of boxes or counters per box. The remaining units are enumerated via discovery tables using a new base MSR (0x711) and otherwise reuse the Panther Lake implementation. Nova Lake also supports iMC free-running 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-14-zide.chen@intel.com
1 parent 46da08a commit e7d5f2e

4 files changed

Lines changed: 52 additions & 0 deletions

File tree

arch/x86/events/intel/uncore.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,6 +1817,13 @@ static const struct uncore_plat_init ptl_uncore_init __initconst = {
18171817
.domain[0].global_init = uncore_mmio_global_init,
18181818
};
18191819

1820+
static const struct uncore_plat_init nvl_uncore_init __initconst = {
1821+
.cpu_init = nvl_uncore_cpu_init,
1822+
.mmio_init = ptl_uncore_mmio_init,
1823+
.domain[0].discovery_base = PACKAGE_UNCORE_DISCOVERY_MSR,
1824+
.domain[0].global_init = uncore_mmio_global_init,
1825+
};
1826+
18201827
static const struct uncore_plat_init icx_uncore_init __initconst = {
18211828
.cpu_init = icx_uncore_cpu_init,
18221829
.pci_init = icx_uncore_pci_init,
@@ -1916,6 +1923,8 @@ static const struct x86_cpu_id intel_uncore_match[] __initconst = {
19161923
X86_MATCH_VFM(INTEL_LUNARLAKE_M, &lnl_uncore_init),
19171924
X86_MATCH_VFM(INTEL_PANTHERLAKE_L, &ptl_uncore_init),
19181925
X86_MATCH_VFM(INTEL_WILDCATLAKE_L, &ptl_uncore_init),
1926+
X86_MATCH_VFM(INTEL_NOVALAKE, &nvl_uncore_init),
1927+
X86_MATCH_VFM(INTEL_NOVALAKE_L, &nvl_uncore_init),
19191928
X86_MATCH_VFM(INTEL_SAPPHIRERAPIDS_X, &spr_uncore_init),
19201929
X86_MATCH_VFM(INTEL_EMERALDRAPIDS_X, &spr_uncore_init),
19211930
X86_MATCH_VFM(INTEL_GRANITERAPIDS_X, &gnr_uncore_init),

arch/x86/events/intel/uncore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ void adl_uncore_cpu_init(void);
636636
void lnl_uncore_cpu_init(void);
637637
void mtl_uncore_cpu_init(void);
638638
void ptl_uncore_cpu_init(void);
639+
void nvl_uncore_cpu_init(void);
639640
void tgl_uncore_mmio_init(void);
640641
void tgl_l_uncore_mmio_init(void);
641642
void adl_uncore_mmio_init(void);

arch/x86/events/intel/uncore_discovery.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#define UNCORE_DISCOVERY_MSR 0x201e
55
/* Base address of uncore perfmon discovery table for CBB domain */
66
#define CBB_UNCORE_DISCOVERY_MSR 0x710
7+
/* Base address of uncore perfmon discovery table for the package */
8+
#define PACKAGE_UNCORE_DISCOVERY_MSR 0x711
79

810
/* Generic device ID of a discovery table device */
911
#define UNCORE_DISCOVERY_TABLE_DEVICE 0x09a7

arch/x86/events/intel/uncore_snb.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,19 @@
256256
/* PTL cNCU register */
257257
#define PTL_UNC_CNCU_MSR_OFFSET 0x140
258258

259+
/* NVL cNCU register */
260+
#define NVL_UNC_CNCU_BOX_CTL 0x202e
261+
#define NVL_UNC_CNCU_FIXED_CTR 0x2028
262+
#define NVL_UNC_CNCU_FIXED_CTRL 0x2022
263+
264+
/* NVL SANTA register */
265+
#define NVL_UNC_SANTA_CTR0 0x2048
266+
#define NVL_UNC_SANTA_CTRL0 0x2042
267+
268+
/* NVL CBOX register */
269+
#define NVL_UNC_CBOX_PER_CTR0 0x2108
270+
#define NVL_UNC_CBOX_PERFEVTSEL0 0x2102
271+
259272
DEFINE_UNCORE_FORMAT_ATTR(event, event, "config:0-7");
260273
DEFINE_UNCORE_FORMAT_ATTR(umask, umask, "config:8-15");
261274
DEFINE_UNCORE_FORMAT_ATTR(chmask, chmask, "config:8-11");
@@ -1979,3 +1992,30 @@ void ptl_uncore_cpu_init(void)
19791992
}
19801993

19811994
/* end of Panther Lake uncore support */
1995+
1996+
/* Nova Lake uncore support */
1997+
1998+
static struct intel_uncore_type *nvl_msr_uncores[] = {
1999+
&mtl_uncore_cbox,
2000+
&ptl_uncore_santa,
2001+
&mtl_uncore_cncu,
2002+
NULL
2003+
};
2004+
2005+
void nvl_uncore_cpu_init(void)
2006+
{
2007+
mtl_uncore_cbox.num_boxes = 12;
2008+
mtl_uncore_cbox.perf_ctr = NVL_UNC_CBOX_PER_CTR0,
2009+
mtl_uncore_cbox.event_ctl = NVL_UNC_CBOX_PERFEVTSEL0,
2010+
2011+
ptl_uncore_santa.perf_ctr = NVL_UNC_SANTA_CTR0,
2012+
ptl_uncore_santa.event_ctl = NVL_UNC_SANTA_CTRL0,
2013+
2014+
mtl_uncore_cncu.box_ctl = NVL_UNC_CNCU_BOX_CTL;
2015+
mtl_uncore_cncu.fixed_ctr = NVL_UNC_CNCU_FIXED_CTR;
2016+
mtl_uncore_cncu.fixed_ctl = NVL_UNC_CNCU_FIXED_CTRL;
2017+
2018+
uncore_msr_uncores = nvl_msr_uncores;
2019+
}
2020+
2021+
/* end of Nova Lake uncore support */

0 commit comments

Comments
 (0)