Skip to content

Commit a556974

Browse files
committed
perf/x86/intel/uncore: Add Panther Lake support
JIRA: https://issues.redhat.com/browse/RHEL-47456 upstream ======== commit 64ad6d6 Author: Kan Liang <kan.liang@linux.intel.com> Date: Mon Jul 7 13:17:49 2025 -0700 description =========== The Panther Lake supports CBOX, MC, sNCU, and HBO uncore PMON. The CBOX is similar to Lunar Lake. The only difference is the number of CBOX. The other three uncore PMON can be retrieved from the discovery table. The global control register resides in the sNCU. The global freeze bit is set by default. It must be cleared before monitoring any uncore counters. Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com> Link: https://lore.kernel.org/r/20250707201750.616527-4-kan.liang@linux.intel.com Signed-off-by: Michael Petlan <mpetlan@redhat.com>
1 parent 9e45788 commit a556974

File tree

5 files changed

+85
-1
lines changed

5 files changed

+85
-1
lines changed

arch/x86/events/intel/uncore.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,6 +1821,12 @@ static const struct intel_uncore_init_fun lnl_uncore_init __initconst = {
18211821
.mmio_init = lnl_uncore_mmio_init,
18221822
};
18231823

1824+
static const struct intel_uncore_init_fun ptl_uncore_init __initconst = {
1825+
.cpu_init = ptl_uncore_cpu_init,
1826+
.mmio_init = ptl_uncore_mmio_init,
1827+
.use_discovery = true,
1828+
};
1829+
18241830
static const struct intel_uncore_init_fun icx_uncore_init __initconst = {
18251831
.cpu_init = icx_uncore_cpu_init,
18261832
.pci_init = icx_uncore_pci_init,
@@ -1902,6 +1908,7 @@ static const struct x86_cpu_id intel_uncore_match[] __initconst = {
19021908
X86_MATCH_VFM(INTEL_ARROWLAKE_U, &mtl_uncore_init),
19031909
X86_MATCH_VFM(INTEL_ARROWLAKE_H, &mtl_uncore_init),
19041910
X86_MATCH_VFM(INTEL_LUNARLAKE_M, &lnl_uncore_init),
1911+
X86_MATCH_VFM(INTEL_PANTHERLAKE_L, &ptl_uncore_init),
19051912
X86_MATCH_VFM(INTEL_SAPPHIRERAPIDS_X, &spr_uncore_init),
19061913
X86_MATCH_VFM(INTEL_EMERALDRAPIDS_X, &spr_uncore_init),
19071914
X86_MATCH_VFM(INTEL_GRANITERAPIDS_X, &gnr_uncore_init),

arch/x86/events/intel/uncore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,10 +613,12 @@ void tgl_uncore_cpu_init(void);
613613
void adl_uncore_cpu_init(void);
614614
void lnl_uncore_cpu_init(void);
615615
void mtl_uncore_cpu_init(void);
616+
void ptl_uncore_cpu_init(void);
616617
void tgl_uncore_mmio_init(void);
617618
void tgl_l_uncore_mmio_init(void);
618619
void adl_uncore_mmio_init(void);
619620
void lnl_uncore_mmio_init(void);
621+
void ptl_uncore_mmio_init(void);
620622
int snb_pci2phy_map_init(int devid);
621623

622624
/* uncore_snbep.c */

arch/x86/events/intel/uncore_discovery.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,7 @@ bool intel_generic_uncore_assign_hw_event(struct perf_event *event,
171171
struct intel_uncore_box *box);
172172
void uncore_find_add_unit(struct intel_uncore_discovery_unit *node,
173173
struct rb_root *root, u16 *num_units);
174+
struct intel_uncore_type **
175+
uncore_get_uncores(enum uncore_access_type type_id, int num_extra,
176+
struct intel_uncore_type **extra, int max_num_types,
177+
struct intel_uncore_type **uncores);

arch/x86/events/intel/uncore_snb.c

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,3 +1854,74 @@ void lnl_uncore_mmio_init(void)
18541854
}
18551855

18561856
/* end of Lunar Lake MMIO uncore support */
1857+
1858+
/* Panther Lake uncore support */
1859+
1860+
#define UNCORE_PTL_MAX_NUM_UNCORE_TYPES 42
1861+
#define UNCORE_PTL_TYPE_IMC 6
1862+
#define UNCORE_PTL_TYPE_SNCU 34
1863+
#define UNCORE_PTL_TYPE_HBO 41
1864+
1865+
#define PTL_UNCORE_GLOBAL_CTL_OFFSET 0x380
1866+
1867+
static struct intel_uncore_type ptl_uncore_imc = {
1868+
.name = "imc",
1869+
.mmio_map_size = 0xf00,
1870+
};
1871+
1872+
static void ptl_uncore_sncu_init_box(struct intel_uncore_box *box)
1873+
{
1874+
intel_generic_uncore_mmio_init_box(box);
1875+
1876+
/* Clear the global freeze bit */
1877+
if (box->io_addr)
1878+
writel(0, box->io_addr + PTL_UNCORE_GLOBAL_CTL_OFFSET);
1879+
}
1880+
1881+
static struct intel_uncore_ops ptl_uncore_sncu_ops = {
1882+
.init_box = ptl_uncore_sncu_init_box,
1883+
.exit_box = uncore_mmio_exit_box,
1884+
.disable_box = intel_generic_uncore_mmio_disable_box,
1885+
.enable_box = intel_generic_uncore_mmio_enable_box,
1886+
.disable_event = intel_generic_uncore_mmio_disable_event,
1887+
.enable_event = intel_generic_uncore_mmio_enable_event,
1888+
.read_counter = uncore_mmio_read_counter,
1889+
};
1890+
1891+
static struct intel_uncore_type ptl_uncore_sncu = {
1892+
.name = "sncu",
1893+
.ops = &ptl_uncore_sncu_ops,
1894+
.mmio_map_size = 0xf00,
1895+
};
1896+
1897+
static struct intel_uncore_type ptl_uncore_hbo = {
1898+
.name = "hbo",
1899+
.mmio_map_size = 0xf00,
1900+
};
1901+
1902+
static struct intel_uncore_type *ptl_uncores[UNCORE_PTL_MAX_NUM_UNCORE_TYPES] = {
1903+
[UNCORE_PTL_TYPE_IMC] = &ptl_uncore_imc,
1904+
[UNCORE_PTL_TYPE_SNCU] = &ptl_uncore_sncu,
1905+
[UNCORE_PTL_TYPE_HBO] = &ptl_uncore_hbo,
1906+
};
1907+
1908+
void ptl_uncore_mmio_init(void)
1909+
{
1910+
uncore_mmio_uncores = uncore_get_uncores(UNCORE_ACCESS_MMIO, 0, NULL,
1911+
UNCORE_PTL_MAX_NUM_UNCORE_TYPES,
1912+
ptl_uncores);
1913+
}
1914+
1915+
static struct intel_uncore_type *ptl_msr_uncores[] = {
1916+
&mtl_uncore_cbox,
1917+
NULL
1918+
};
1919+
1920+
void ptl_uncore_cpu_init(void)
1921+
{
1922+
mtl_uncore_cbox.num_boxes = 6;
1923+
mtl_uncore_cbox.ops = &lnl_uncore_msr_ops;
1924+
uncore_msr_uncores = ptl_msr_uncores;
1925+
}
1926+
1927+
/* end of Panther Lake uncore support */

arch/x86/events/intel/uncore_snbep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6499,7 +6499,7 @@ static void uncore_type_customized_copy(struct intel_uncore_type *to_type,
64996499
to_type->mmio_map_size = from_type->mmio_map_size;
65006500
}
65016501

6502-
static struct intel_uncore_type **
6502+
struct intel_uncore_type **
65036503
uncore_get_uncores(enum uncore_access_type type_id, int num_extra,
65046504
struct intel_uncore_type **extra, int max_num_types,
65056505
struct intel_uncore_type **uncores)

0 commit comments

Comments
 (0)