Skip to content

Commit 66e2075

Browse files
ZideChen0Peter Zijlstra
authored andcommitted
perf/x86/intel/uncore: Add CBB PMON support for Diamond Rapids
On DMR, PMON units inside the Core Building Block (CBB) are enumerated separately from those in the Integrated Memory and I/O Hub (IMH). A new per-CBB MSR (0x710) is introduced for discovery table enumeration. For counter control registers, the tid_en bit (bit 16) exists on CBO, SBO, and Santa, but it is not used by any events. Mark this bit as reserved. Similarly, disallow extended umask (bits 32–63) on Santa and sNCU. Additionally, ignore broken SB2UCIE unit. 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-6-zide.chen@intel.com
1 parent 6daf2c3 commit 66e2075

4 files changed

Lines changed: 54 additions & 3 deletions

File tree

arch/x86/events/intel/uncore.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,6 +1837,8 @@ static const struct uncore_plat_init dmr_uncore_init __initconst = {
18371837
.domain[0].base_is_pci = true,
18381838
.domain[0].discovery_base = DMR_UNCORE_DISCOVERY_TABLE_DEVICE,
18391839
.domain[0].units_ignore = dmr_uncore_imh_units_ignore,
1840+
.domain[1].discovery_base = CBB_UNCORE_DISCOVERY_MSR,
1841+
.domain[1].units_ignore = dmr_uncore_cbb_units_ignore,
18401842
};
18411843

18421844
static const struct uncore_plat_init generic_uncore_init __initconst = {

arch/x86/events/intel/uncore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ extern struct event_constraint uncore_constraint_empty;
615615
extern int spr_uncore_units_ignore[];
616616
extern int gnr_uncore_units_ignore[];
617617
extern int dmr_uncore_imh_units_ignore[];
618+
extern int dmr_uncore_cbb_units_ignore[];
618619

619620
/* uncore_snb.c */
620621
int snb_uncore_pci_init(void);

arch/x86/events/intel/uncore_discovery.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
/* Store the full address of the global discovery table */
44
#define UNCORE_DISCOVERY_MSR 0x201e
5+
/* Base address of uncore perfmon discovery table for CBB domain */
6+
#define CBB_UNCORE_DISCOVERY_MSR 0x710
57

68
/* Generic device ID of a discovery table device */
79
#define UNCORE_DISCOVERY_TABLE_DEVICE 0x09a7

arch/x86/events/intel/uncore_snbep.c

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6807,13 +6807,49 @@ static struct intel_uncore_type dmr_uncore_hamvf = {
68076807
.attr_update = uncore_alias_groups,
68086808
};
68096809

6810+
static struct intel_uncore_type dmr_uncore_cbo = {
6811+
.name = "cbo",
6812+
.event_mask_ext = DMR_HAMVF_EVENT_MASK_EXT,
6813+
.format_group = &dmr_sca_uncore_format_group,
6814+
.attr_update = uncore_alias_groups,
6815+
};
6816+
6817+
static struct intel_uncore_type dmr_uncore_santa = {
6818+
.name = "santa",
6819+
.attr_update = uncore_alias_groups,
6820+
};
6821+
6822+
static struct intel_uncore_type dmr_uncore_cncu = {
6823+
.name = "cncu",
6824+
.attr_update = uncore_alias_groups,
6825+
};
6826+
6827+
static struct intel_uncore_type dmr_uncore_sncu = {
6828+
.name = "sncu",
6829+
.attr_update = uncore_alias_groups,
6830+
};
6831+
68106832
static struct intel_uncore_type dmr_uncore_ula = {
68116833
.name = "ula",
68126834
.event_mask_ext = DMR_HAMVF_EVENT_MASK_EXT,
68136835
.format_group = &dmr_sca_uncore_format_group,
68146836
.attr_update = uncore_alias_groups,
68156837
};
68166838

6839+
static struct intel_uncore_type dmr_uncore_dda = {
6840+
.name = "dda",
6841+
.event_mask_ext = DMR_HAMVF_EVENT_MASK_EXT,
6842+
.format_group = &dmr_sca_uncore_format_group,
6843+
.attr_update = uncore_alias_groups,
6844+
};
6845+
6846+
static struct intel_uncore_type dmr_uncore_sbo = {
6847+
.name = "sbo",
6848+
.event_mask_ext = DMR_HAMVF_EVENT_MASK_EXT,
6849+
.format_group = &dmr_sca_uncore_format_group,
6850+
.attr_update = uncore_alias_groups,
6851+
};
6852+
68176853
static struct intel_uncore_type dmr_uncore_ubr = {
68186854
.name = "ubr",
68196855
.event_mask_ext = DMR_HAMVF_EVENT_MASK_EXT,
@@ -6902,10 +6938,15 @@ static struct intel_uncore_type *dmr_uncores[UNCORE_DMR_NUM_UNCORE_TYPES] = {
69026938
NULL, NULL, NULL,
69036939
NULL, NULL,
69046940
&dmr_uncore_hamvf,
6905-
NULL,
6906-
NULL, NULL, NULL,
6941+
&dmr_uncore_cbo,
6942+
&dmr_uncore_santa,
6943+
&dmr_uncore_cncu,
6944+
&dmr_uncore_sncu,
69076945
&dmr_uncore_ula,
6908-
NULL, NULL, NULL, NULL,
6946+
&dmr_uncore_dda,
6947+
NULL,
6948+
&dmr_uncore_sbo,
6949+
NULL,
69096950
NULL, NULL, NULL,
69106951
&dmr_uncore_ubr,
69116952
NULL,
@@ -6923,6 +6964,11 @@ int dmr_uncore_imh_units_ignore[] = {
69236964
UNCORE_IGNORE_END
69246965
};
69256966

6967+
int dmr_uncore_cbb_units_ignore[] = {
6968+
0x25, /* SB2UCIE */
6969+
UNCORE_IGNORE_END
6970+
};
6971+
69266972
int dmr_uncore_pci_init(void)
69276973
{
69286974
uncore_pci_uncores = uncore_get_uncores(UNCORE_ACCESS_PCI, 0, NULL,

0 commit comments

Comments
 (0)