Skip to contentSkip to conversation

Intel Sapphire Rapids uncore: umask too big

DISCUSSION Michael Petlan 4 participants 6 messages Jan 30, 2024 – May 29, 2024

lore
Share & tools
lore
#0 lore raw

Hello Ian and others,

we have encountered some issues with uncore events on Sapphire Rapids. There are a couple types of problems. One of them is the following:

    # perf stat -e uncore_cha_55/event=0x35,umask=0x10c0008101/ -a -- ls 
    event syntax error: '..0x35,umask=0x10c0008101/'
                                      \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'uncore_cha_55'

Initial error:
event syntax error: '..0x35,umask=0x10c0008101/'
\___ value too big for format, maximum is 4294967295
Run 'perf list' for a list of valid events

There is a 34bit umask that can handle it, namely umask_ext2, but it is not used for sapphire rapids:

uncore_snbep.c:5958:static struct attribute *spr_uncore_cha_formats_attr[] = {

uncore_snbep.c-5959-    &format_attr_event.attr,
uncore_snbep.c-5960-    &format_attr_umask_ext4.attr,
uncore_snbep.c-5961-    &format_attr_tid_en2.attr,
uncore_snbep.c-5962-    &format_attr_edge.attr,
uncore_snbep.c-5963-    &format_attr_inv.attr,
uncore_snbep.c-5964-    &format_attr_thresh8.attr,
uncore_snbep.c-5965-    &format_attr_filter_tid5.attr,
uncore_snbep.c-5966-    NULL,

uncore_snbep.c-5967-};

(I see umask_ext4 there and means 32bit:
uncore_snbep.c:479:DEFINE_UNCORE_FORMAT_ATTR(umask_ext4, umask, "config:8-15,32-55"); )

What is wrong? The json files specifying umask=0x10c0008101 for the event, or the structure that should rather support umask_ext2 ?

There are a few more issues, I will update when analyzing them deeper.

Thanks.
Michael

#1 lore raw
Quoted 28 lines · Michael Petlan

Hello Ian and others,

we have encountered some issues with uncore events on Sapphire Rapids. There are a couple types of problems. One of them is the following:

    # perf stat -e uncore_cha_55/event=0x35,umask=0x10c0008101/ -a -- ls 
    event syntax error: '..0x35,umask=0x10c0008101/'
                                      \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'uncore_cha_55'

Initial error:
event syntax error: '..0x35,umask=0x10c0008101/'
\___ value too big for format, maximum is 4294967295
Run 'perf list' for a list of valid events

There is a 34bit umask that can handle it, namely umask_ext2, but it is not used for sapphire rapids:

uncore_snbep.c:5958:static struct attribute *spr_uncore_cha_formats_attr[] = {

uncore_snbep.c-5959-    &format_attr_event.attr,
uncore_snbep.c-5960-    &format_attr_umask_ext4.attr,
uncore_snbep.c-5961-    &format_attr_tid_en2.attr,
uncore_snbep.c-5962-    &format_attr_edge.attr,
uncore_snbep.c-5963-    &format_attr_inv.attr,
uncore_snbep.c-5964-    &format_attr_thresh8.attr,
uncore_snbep.c-5965-    &format_attr_filter_tid5.attr,
uncore_snbep.c-5966-    NULL,
Quoted 8 lines

uncore_snbep.c-5967-};

(I see umask_ext4 there and means 32bit:
uncore_snbep.c:479:DEFINE_UNCORE_FORMAT_ATTR(umask_ext4, umask, "config:8-15,32-55"); )

What is wrong? The json files specifying umask=0x10c0008101 for the event, or the structure that should rather support umask_ext2 ?

The 8-15,32-55 is from the SPR uncore spec. But apparently, there is an inconsistency between the event list and the spec. I will check internally and send a fix.

Quoted 2 lines

There are a few more issues, I will update when analyzing them deeper.

Sure, please let me know when you find something.

Thanks,
Kan

Quoted 5 lines

Thanks.
Michael

#2 lore raw
Quoted 46 lines · Kan
Quoted 28 lines · Michael Petlan

Hello Ian and others,

we have encountered some issues with uncore events on Sapphire Rapids. There are a couple types of problems. One of them is the following:

    # perf stat -e uncore_cha_55/event=0x35,umask=0x10c0008101/ -a -- ls
    event syntax error: '..0x35,umask=0x10c0008101/'
                                      \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'uncore_cha_55'

Initial error:
event syntax error: '..0x35,umask=0x10c0008101/'
\___ value too big for format, maximum is 4294967295
Run 'perf list' for a list of valid events

There is a 34bit umask that can handle it, namely umask_ext2, but it is not used for sapphire rapids:

uncore_snbep.c:5958:static struct attribute *spr_uncore_cha_formats_attr[] = {

uncore_snbep.c-5959-    &format_attr_event.attr,
uncore_snbep.c-5960-    &format_attr_umask_ext4.attr,
uncore_snbep.c-5961-    &format_attr_tid_en2.attr,
uncore_snbep.c-5962-    &format_attr_edge.attr,
uncore_snbep.c-5963-    &format_attr_inv.attr,
uncore_snbep.c-5964-    &format_attr_thresh8.attr,
uncore_snbep.c-5965-    &format_attr_filter_tid5.attr,
uncore_snbep.c-5966-    NULL,
Quoted 8 lines

uncore_snbep.c-5967-};

(I see umask_ext4 there and means 32bit:
uncore_snbep.c:479:DEFINE_UNCORE_FORMAT_ATTR(umask_ext4, umask, "config:8-15,32-55"); )

What is wrong? The json files specifying umask=0x10c0008101 for the event, or the structure that should rather support umask_ext2 ?

The 8-15,32-55 is from the SPR uncore spec. But apparently, there is an inconsistency between the event list and the spec. I will check internally and send a fix.

Quoted 1 line
Quoted 9 lines
Quoted 1 line

There are a few more issues, I will update when analyzing them deeper.

Sure, please let me know when you find something.

Thanks,
Kan

Quoted 3 lines

Thanks.
Michael

Thanks Michael, this is a discrepancy between the PMU driver and the json which Kan has in hand. Was this caught by the "perf all PMU test" ?
https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/tests/shell/stat_all_pmu.sh?h=perf-tools-next
I'll try to improve the error message :-)

Thanks,
Ian

Quoted 2 lines
Quoted 2 lines
#3 lore raw
In reply to Michael Petlan

Hello.

Although something has changed so far, the discrepacy between event format accepted by the kernel ( /sys/devices/intel_cha*/format/* ) and what is in the JSONs still applies for Sapphire Lake.

This is found by running the "all PMU" test or a "perf_stat :: test_intel_uncore" from perftool-testsuite on a SPR box. The first seem to stop on first broken event, the second provides a full list of failed events.

Our testing shows that ~112 events are still broken:

unc_cha_tor_inserts.ia_hit_cxl_acc unc_cha_tor_inserts.ia_hit_cxl_acc_local unc_cha_tor_inserts.ia_miss_crdmorph_cxl_acc unc_cha_tor_inserts.ia_miss_cxl_acc unc_cha_tor_inserts.ia_miss_cxl_acc_local unc_cha_tor_inserts.ia_miss_drd_cxl_acc unc_cha_tor_inserts.ia_miss_drd_cxl_acc_local unc_cha_tor_inserts.ia_miss_drdmorph_cxl_acc unc_cha_tor_inserts.ia_miss_drd_opt_cxl_acc_local unc_cha_tor_inserts.ia_miss_drd_opt_pref_cxl_acc_local unc_cha_tor_inserts.ia_miss_drd_pref_cxl_acc unc_cha_tor_inserts.ia_miss_drd_pref_cxl_acc_local unc_cha_tor_inserts.ia_miss_llcprefcode_cxl_acc unc_cha_tor_inserts.ia_miss_llcprefdata_cxl_acc unc_cha_tor_inserts.ia_miss_llcprefdata_cxl_acc_local unc_cha_tor_inserts.ia_miss_llcprefrfo_cxl_acc unc_cha_tor_inserts.ia_miss_llcprefrfo_cxl_acc_local unc_cha_tor_inserts.ia_miss_rfo_cxl_acc unc_cha_tor_inserts.ia_miss_rfo_cxl_acc_local unc_cha_tor_inserts.ia_miss_rfomorph_cxl_acc unc_cha_tor_inserts.ia_miss_rfo_pref_cxl_acc unc_cha_tor_inserts.ia_miss_rfo_pref_cxl_acc_local unc_cha_tor_occupancy.ia_hit_cxl_acc unc_cha_tor_occupancy.ia_hit_cxl_acc_local unc_cha_tor_occupancy.ia_miss_crdmorph_cxl_acc unc_cha_tor_occupancy.ia_miss_cxl_acc unc_cha_tor_occupancy.ia_miss_cxl_acc_local unc_cha_tor_occupancy.ia_miss_drd_cxl_acc unc_cha_tor_occupancy.ia_miss_drd_cxl_acc_local unc_cha_tor_occupancy.ia_miss_drdmorph_cxl_acc unc_cha_tor_occupancy.ia_miss_drd_opt_cxl_acc_local unc_cha_tor_occupancy.ia_miss_drd_opt_pref_cxl_acc_local unc_cha_tor_occupancy.ia_miss_drd_pref_cxl_acc unc_cha_tor_occupancy.ia_miss_drd_pref_cxl_acc_local unc_cha_tor_occupancy.ia_miss_llcprefcode_cxl_acc unc_cha_tor_occupancy.ia_miss_llcprefdata_cxl_acc unc_cha_tor_occupancy.ia_miss_llcprefdata_cxl_acc_local unc_cha_tor_occupancy.ia_miss_llcprefrfo_cxl_acc unc_cha_tor_occupancy.ia_miss_llcprefrfo_cxl_acc_local unc_cha_tor_occupancy.ia_miss_rfo_cxl_acc unc_cha_tor_occupancy.ia_miss_rfo_cxl_acc_local unc_cha_tor_occupancy.ia_miss_rfomorph_cxl_acc unc_cha_tor_occupancy.ia_miss_rfo_pref_cxl_acc unc_cha_tor_occupancy.ia_miss_rfo_pref_cxl_acc_local unc_iio_comp_buf_inserts.cmpd.part0 unc_iio_comp_buf_inserts.cmpd.part1 unc_iio_comp_buf_inserts.cmpd.part2 unc_iio_comp_buf_inserts.cmpd.part3 unc_iio_comp_buf_inserts.cmpd.part4 unc_iio_comp_buf_inserts.cmpd.part5 unc_iio_comp_buf_inserts.cmpd.part6 unc_iio_comp_buf_inserts.cmpd.part7 unc_iio_comp_buf_occupancy.cmpd.part0 unc_iio_comp_buf_occupancy.cmpd.part1 unc_iio_comp_buf_occupancy.cmpd.part2 unc_iio_comp_buf_occupancy.cmpd.part3 unc_iio_comp_buf_occupancy.cmpd.part4 unc_iio_comp_buf_occupancy.cmpd.part5 unc_iio_comp_buf_occupancy.cmpd.part6 unc_iio_comp_buf_occupancy.cmpd.part7 unc_iio_data_req_by_cpu.mem_read.part0 unc_iio_data_req_by_cpu.mem_read.part1 unc_iio_data_req_by_cpu.mem_read.part2 unc_iio_data_req_by_cpu.mem_read.part3 unc_iio_data_req_by_cpu.mem_read.part4 unc_iio_data_req_by_cpu.mem_read.part5 unc_iio_data_req_by_cpu.mem_read.part6 unc_iio_data_req_by_cpu.mem_read.part7 unc_iio_data_req_by_cpu.peer_read.part0 unc_iio_data_req_by_cpu.peer_read.part1 unc_iio_data_req_by_cpu.peer_read.part2 unc_iio_data_req_by_cpu.peer_read.part3 unc_iio_data_req_by_cpu.peer_read.part4 unc_iio_data_req_by_cpu.peer_read.part5 unc_iio_data_req_by_cpu.peer_read.part6 unc_iio_data_req_by_cpu.peer_read.part7 unc_iio_data_req_by_cpu.peer_write.part0 unc_iio_data_req_by_cpu.peer_write.part1 unc_iio_data_req_by_cpu.peer_write.part2 unc_iio_data_req_by_cpu.peer_write.part3 unc_iio_data_req_by_cpu.peer_write.part4 unc_iio_data_req_by_cpu.peer_write.part5 unc_iio_data_req_by_cpu.peer_write.part6 unc_iio_data_req_by_cpu.peer_write.part7 unc_iio_inbound_arb_req.data unc_iio_inbound_arb_req.req_own unc_iio_inbound_arb_req.wr unc_iio_inbound_arb_won.data unc_iio_inbound_arb_won.final_rd_wr unc_iio_inbound_arb_won.iommu_hit unc_iio_inbound_arb_won.iommu_req unc_iio_inbound_arb_won.req_own unc_iio_inbound_arb_won.wr unc_iio_req_from_pcie_cl_cmpl.data unc_iio_req_from_pcie_cl_cmpl.final_rd_wr unc_iio_req_from_pcie_cl_cmpl.req_own unc_iio_req_from_pcie_cl_cmpl.wr unc_iio_req_from_pcie_cmpl.final_rd_wr unc_iio_req_from_pcie_cmpl.iommu_hit unc_iio_req_from_pcie_cmpl.iommu_req unc_iio_req_from_pcie_cmpl.req_own unc_iio_req_from_pcie_pass_cmpl.data unc_iio_req_from_pcie_pass_cmpl.req_own unc_iio_req_from_pcie_pass_cmpl.wr unc_iio_txn_req_by_cpu.peer_write.part0 unc_iio_txn_req_by_cpu.peer_write.part1 unc_iio_txn_req_by_cpu.peer_write.part2 unc_iio_txn_req_by_cpu.peer_write.part3 unc_iio_txn_req_by_cpu.peer_write.part4 unc_iio_txn_req_by_cpu.peer_write.part5 unc_iio_txn_req_by_cpu.peer_write.part6 unc_iio_txn_req_by_cpu.peer_write.part7

Thanks.

Michael

Quoted 44 lines · Michael Petlan

Hello Ian and others,

we have encountered some issues with uncore events on Sapphire Rapids. There are a couple types of problems. One of them is the following:

    # perf stat -e uncore_cha_55/event=0x35,umask=0x10c0008101/ -a -- ls 
    event syntax error: '..0x35,umask=0x10c0008101/'
                                      \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'uncore_cha_55'

Initial error:
event syntax error: '..0x35,umask=0x10c0008101/'
\___ value too big for format, maximum is 4294967295
Run 'perf list' for a list of valid events

There is a 34bit umask that can handle it, namely umask_ext2, but it is not used for sapphire rapids:

uncore_snbep.c:5958:static struct attribute *spr_uncore_cha_formats_attr[] = {

uncore_snbep.c-5959-    &format_attr_event.attr,
uncore_snbep.c-5960-    &format_attr_umask_ext4.attr,
uncore_snbep.c-5961-    &format_attr_tid_en2.attr,
uncore_snbep.c-5962-    &format_attr_edge.attr,
uncore_snbep.c-5963-    &format_attr_inv.attr,
uncore_snbep.c-5964-    &format_attr_thresh8.attr,
uncore_snbep.c-5965-    &format_attr_filter_tid5.attr,
uncore_snbep.c-5966-    NULL,

uncore_snbep.c-5967-};

(I see umask_ext4 there and means 32bit:
uncore_snbep.c:479:DEFINE_UNCORE_FORMAT_ATTR(umask_ext4, umask, "config:8-15,32-55"); )

What is wrong? The json files specifying umask=0x10c0008101 for the event, or the structure that should rather support umask_ext2 ?

There are a few more issues, I will update when analyzing them deeper.

Thanks.
Michael

#4 lore raw
Quoted 9 lines · Michael Petlan

Hello.

Although something has changed so far, the discrepacy between event format accepted by the kernel ( /sys/devices/intel_cha*/format/* ) and what is in the JSONs still applies for Sapphire Lake.

This is found by running the "all PMU" test or a "perf_stat :: test_intel_uncore" from perftool-testsuite on a SPR box. The first seem to stop on first broken event, the second provides a full list of failed events.

The kernel patch seems has not been merged yet.
https://lore.kernel.org/lkml/[email protected]/

I'll ping it again.

Thanks,
Kan

Quoted 166 lines

Our testing shows that ~112 events are still broken:

unc_cha_tor_inserts.ia_hit_cxl_acc unc_cha_tor_inserts.ia_hit_cxl_acc_local unc_cha_tor_inserts.ia_miss_crdmorph_cxl_acc unc_cha_tor_inserts.ia_miss_cxl_acc unc_cha_tor_inserts.ia_miss_cxl_acc_local unc_cha_tor_inserts.ia_miss_drd_cxl_acc unc_cha_tor_inserts.ia_miss_drd_cxl_acc_local unc_cha_tor_inserts.ia_miss_drdmorph_cxl_acc unc_cha_tor_inserts.ia_miss_drd_opt_cxl_acc_local unc_cha_tor_inserts.ia_miss_drd_opt_pref_cxl_acc_local unc_cha_tor_inserts.ia_miss_drd_pref_cxl_acc unc_cha_tor_inserts.ia_miss_drd_pref_cxl_acc_local unc_cha_tor_inserts.ia_miss_llcprefcode_cxl_acc unc_cha_tor_inserts.ia_miss_llcprefdata_cxl_acc unc_cha_tor_inserts.ia_miss_llcprefdata_cxl_acc_local unc_cha_tor_inserts.ia_miss_llcprefrfo_cxl_acc unc_cha_tor_inserts.ia_miss_llcprefrfo_cxl_acc_local unc_cha_tor_inserts.ia_miss_rfo_cxl_acc unc_cha_tor_inserts.ia_miss_rfo_cxl_acc_local unc_cha_tor_inserts.ia_miss_rfomorph_cxl_acc unc_cha_tor_inserts.ia_miss_rfo_pref_cxl_acc unc_cha_tor_inserts.ia_miss_rfo_pref_cxl_acc_local unc_cha_tor_occupancy.ia_hit_cxl_acc unc_cha_tor_occupancy.ia_hit_cxl_acc_local unc_cha_tor_occupancy.ia_miss_crdmorph_cxl_acc unc_cha_tor_occupancy.ia_miss_cxl_acc unc_cha_tor_occupancy.ia_miss_cxl_acc_local unc_cha_tor_occupancy.ia_miss_drd_cxl_acc unc_cha_tor_occupancy.ia_miss_drd_cxl_acc_local unc_cha_tor_occupancy.ia_miss_drdmorph_cxl_acc unc_cha_tor_occupancy.ia_miss_drd_opt_cxl_acc_local unc_cha_tor_occupancy.ia_miss_drd_opt_pref_cxl_acc_local unc_cha_tor_occupancy.ia_miss_drd_pref_cxl_acc unc_cha_tor_occupancy.ia_miss_drd_pref_cxl_acc_local unc_cha_tor_occupancy.ia_miss_llcprefcode_cxl_acc unc_cha_tor_occupancy.ia_miss_llcprefdata_cxl_acc unc_cha_tor_occupancy.ia_miss_llcprefdata_cxl_acc_local unc_cha_tor_occupancy.ia_miss_llcprefrfo_cxl_acc unc_cha_tor_occupancy.ia_miss_llcprefrfo_cxl_acc_local unc_cha_tor_occupancy.ia_miss_rfo_cxl_acc unc_cha_tor_occupancy.ia_miss_rfo_cxl_acc_local unc_cha_tor_occupancy.ia_miss_rfomorph_cxl_acc unc_cha_tor_occupancy.ia_miss_rfo_pref_cxl_acc unc_cha_tor_occupancy.ia_miss_rfo_pref_cxl_acc_local unc_iio_comp_buf_inserts.cmpd.part0 unc_iio_comp_buf_inserts.cmpd.part1 unc_iio_comp_buf_inserts.cmpd.part2 unc_iio_comp_buf_inserts.cmpd.part3 unc_iio_comp_buf_inserts.cmpd.part4 unc_iio_comp_buf_inserts.cmpd.part5 unc_iio_comp_buf_inserts.cmpd.part6 unc_iio_comp_buf_inserts.cmpd.part7 unc_iio_comp_buf_occupancy.cmpd.part0 unc_iio_comp_buf_occupancy.cmpd.part1 unc_iio_comp_buf_occupancy.cmpd.part2 unc_iio_comp_buf_occupancy.cmpd.part3 unc_iio_comp_buf_occupancy.cmpd.part4 unc_iio_comp_buf_occupancy.cmpd.part5 unc_iio_comp_buf_occupancy.cmpd.part6 unc_iio_comp_buf_occupancy.cmpd.part7 unc_iio_data_req_by_cpu.mem_read.part0 unc_iio_data_req_by_cpu.mem_read.part1 unc_iio_data_req_by_cpu.mem_read.part2 unc_iio_data_req_by_cpu.mem_read.part3 unc_iio_data_req_by_cpu.mem_read.part4 unc_iio_data_req_by_cpu.mem_read.part5 unc_iio_data_req_by_cpu.mem_read.part6 unc_iio_data_req_by_cpu.mem_read.part7 unc_iio_data_req_by_cpu.peer_read.part0 unc_iio_data_req_by_cpu.peer_read.part1 unc_iio_data_req_by_cpu.peer_read.part2 unc_iio_data_req_by_cpu.peer_read.part3 unc_iio_data_req_by_cpu.peer_read.part4 unc_iio_data_req_by_cpu.peer_read.part5 unc_iio_data_req_by_cpu.peer_read.part6 unc_iio_data_req_by_cpu.peer_read.part7 unc_iio_data_req_by_cpu.peer_write.part0 unc_iio_data_req_by_cpu.peer_write.part1 unc_iio_data_req_by_cpu.peer_write.part2 unc_iio_data_req_by_cpu.peer_write.part3 unc_iio_data_req_by_cpu.peer_write.part4 unc_iio_data_req_by_cpu.peer_write.part5 unc_iio_data_req_by_cpu.peer_write.part6 unc_iio_data_req_by_cpu.peer_write.part7 unc_iio_inbound_arb_req.data unc_iio_inbound_arb_req.req_own unc_iio_inbound_arb_req.wr unc_iio_inbound_arb_won.data unc_iio_inbound_arb_won.final_rd_wr unc_iio_inbound_arb_won.iommu_hit unc_iio_inbound_arb_won.iommu_req unc_iio_inbound_arb_won.req_own unc_iio_inbound_arb_won.wr unc_iio_req_from_pcie_cl_cmpl.data unc_iio_req_from_pcie_cl_cmpl.final_rd_wr unc_iio_req_from_pcie_cl_cmpl.req_own unc_iio_req_from_pcie_cl_cmpl.wr unc_iio_req_from_pcie_cmpl.final_rd_wr unc_iio_req_from_pcie_cmpl.iommu_hit unc_iio_req_from_pcie_cmpl.iommu_req unc_iio_req_from_pcie_cmpl.req_own unc_iio_req_from_pcie_pass_cmpl.data unc_iio_req_from_pcie_pass_cmpl.req_own unc_iio_req_from_pcie_pass_cmpl.wr unc_iio_txn_req_by_cpu.peer_write.part0 unc_iio_txn_req_by_cpu.peer_write.part1 unc_iio_txn_req_by_cpu.peer_write.part2 unc_iio_txn_req_by_cpu.peer_write.part3 unc_iio_txn_req_by_cpu.peer_write.part4 unc_iio_txn_req_by_cpu.peer_write.part5 unc_iio_txn_req_by_cpu.peer_write.part6 unc_iio_txn_req_by_cpu.peer_write.part7

Thanks.

Michael

Quoted 44 lines · Michael Petlan

Hello Ian and others,

we have encountered some issues with uncore events on Sapphire Rapids. There are a couple types of problems. One of them is the following:

    # perf stat -e uncore_cha_55/event=0x35,umask=0x10c0008101/ -a -- ls 
    event syntax error: '..0x35,umask=0x10c0008101/'
                                      \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'uncore_cha_55'

Initial error:
event syntax error: '..0x35,umask=0x10c0008101/'
\___ value too big for format, maximum is 4294967295
Run 'perf list' for a list of valid events

There is a 34bit umask that can handle it, namely umask_ext2, but it is not used for sapphire rapids:

uncore_snbep.c:5958:static struct attribute *spr_uncore_cha_formats_attr[] = {

uncore_snbep.c-5959-    &format_attr_event.attr,
uncore_snbep.c-5960-    &format_attr_umask_ext4.attr,
uncore_snbep.c-5961-    &format_attr_tid_en2.attr,
uncore_snbep.c-5962-    &format_attr_edge.attr,
uncore_snbep.c-5963-    &format_attr_inv.attr,
uncore_snbep.c-5964-    &format_attr_thresh8.attr,
uncore_snbep.c-5965-    &format_attr_filter_tid5.attr,
uncore_snbep.c-5966-    NULL,

uncore_snbep.c-5967-};

(I see umask_ext4 there and means 32bit:
uncore_snbep.c:479:DEFINE_UNCORE_FORMAT_ATTR(umask_ext4, umask, "config:8-15,32-55"); )

What is wrong? The json files specifying umask=0x10c0008101 for the event, or the structure that should rather support umask_ext2 ?

There are a few more issues, I will update when analyzing them deeper.

Thanks.
Michael

#5 lore raw

Please note the SPR documentation update at: https://cdrdv2.intel.com/v1/dl/getContent/639667

The SPR CHA counter control register extended umask bits are defined as [63:32].

-----Original Message-----
From: Liang, Kan <[email protected]>
Sent: Wednesday, May 29, 2024 6:06 AM
To: Michael Petlan <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; Baker, Edward <[email protected]>; Taylor, Perry <[email protected]>; Alt, Samantha <[email protected]>; Wang, Weilin <[email protected]>; [email protected]; [email protected]
Subject: Re: Intel Sapphire Rapids uncore: umask too big

Quoted 9 lines · Michael Petlan

Hello.

Although something has changed so far, the discrepacy between event format accepted by the kernel ( /sys/devices/intel_cha*/format/* ) and what is in the JSONs still applies for Sapphire Lake.

This is found by running the "all PMU" test or a "perf_stat :: test_intel_uncore" from perftool-testsuite on a SPR box. The first seem to stop on first broken event, the second provides a full list of failed events.

The kernel patch seems has not been merged yet.
https://lore.kernel.org/lkml/[email protected]/

I'll ping it again.

Thanks,
Kan

Quoted 167 lines

Our testing shows that ~112 events are still broken:

unc_cha_tor_inserts.ia_hit_cxl_acc unc_cha_tor_inserts.ia_hit_cxl_acc_local unc_cha_tor_inserts.ia_miss_crdmorph_cxl_acc unc_cha_tor_inserts.ia_miss_cxl_acc unc_cha_tor_inserts.ia_miss_cxl_acc_local unc_cha_tor_inserts.ia_miss_drd_cxl_acc unc_cha_tor_inserts.ia_miss_drd_cxl_acc_local unc_cha_tor_inserts.ia_miss_drdmorph_cxl_acc unc_cha_tor_inserts.ia_miss_drd_opt_cxl_acc_local unc_cha_tor_inserts.ia_miss_drd_opt_pref_cxl_acc_local unc_cha_tor_inserts.ia_miss_drd_pref_cxl_acc unc_cha_tor_inserts.ia_miss_drd_pref_cxl_acc_local unc_cha_tor_inserts.ia_miss_llcprefcode_cxl_acc unc_cha_tor_inserts.ia_miss_llcprefdata_cxl_acc unc_cha_tor_inserts.ia_miss_llcprefdata_cxl_acc_local unc_cha_tor_inserts.ia_miss_llcprefrfo_cxl_acc unc_cha_tor_inserts.ia_miss_llcprefrfo_cxl_acc_local unc_cha_tor_inserts.ia_miss_rfo_cxl_acc unc_cha_tor_inserts.ia_miss_rfo_cxl_acc_local unc_cha_tor_inserts.ia_miss_rfomorph_cxl_acc unc_cha_tor_inserts.ia_miss_rfo_pref_cxl_acc unc_cha_tor_inserts.ia_miss_rfo_pref_cxl_acc_local unc_cha_tor_occupancy.ia_hit_cxl_acc unc_cha_tor_occupancy.ia_hit_cxl_acc_local unc_cha_tor_occupancy.ia_miss_crdmorph_cxl_acc unc_cha_tor_occupancy.ia_miss_cxl_acc unc_cha_tor_occupancy.ia_miss_cxl_acc_local unc_cha_tor_occupancy.ia_miss_drd_cxl_acc unc_cha_tor_occupancy.ia_miss_drd_cxl_acc_local unc_cha_tor_occupancy.ia_miss_drdmorph_cxl_acc unc_cha_tor_occupancy.ia_miss_drd_opt_cxl_acc_local unc_cha_tor_occupancy.ia_miss_drd_opt_pref_cxl_acc_local unc_cha_tor_occupancy.ia_miss_drd_pref_cxl_acc unc_cha_tor_occupancy.ia_miss_drd_pref_cxl_acc_local unc_cha_tor_occupancy.ia_miss_llcprefcode_cxl_acc unc_cha_tor_occupancy.ia_miss_llcprefdata_cxl_acc unc_cha_tor_occupancy.ia_miss_llcprefdata_cxl_acc_local unc_cha_tor_occupancy.ia_miss_llcprefrfo_cxl_acc unc_cha_tor_occupancy.ia_miss_llcprefrfo_cxl_acc_local unc_cha_tor_occupancy.ia_miss_rfo_cxl_acc unc_cha_tor_occupancy.ia_miss_rfo_cxl_acc_local unc_cha_tor_occupancy.ia_miss_rfomorph_cxl_acc unc_cha_tor_occupancy.ia_miss_rfo_pref_cxl_acc unc_cha_tor_occupancy.ia_miss_rfo_pref_cxl_acc_local unc_iio_comp_buf_inserts.cmpd.part0 unc_iio_comp_buf_inserts.cmpd.part1 unc_iio_comp_buf_inserts.cmpd.part2 unc_iio_comp_buf_inserts.cmpd.part3 unc_iio_comp_buf_inserts.cmpd.part4 unc_iio_comp_buf_inserts.cmpd.part5 unc_iio_comp_buf_inserts.cmpd.part6 unc_iio_comp_buf_inserts.cmpd.part7 unc_iio_comp_buf_occupancy.cmpd.part0 unc_iio_comp_buf_occupancy.cmpd.part1 unc_iio_comp_buf_occupancy.cmpd.part2 unc_iio_comp_buf_occupancy.cmpd.part3 unc_iio_comp_buf_occupancy.cmpd.part4 unc_iio_comp_buf_occupancy.cmpd.part5 unc_iio_comp_buf_occupancy.cmpd.part6 unc_iio_comp_buf_occupancy.cmpd.part7 unc_iio_data_req_by_cpu.mem_read.part0 unc_iio_data_req_by_cpu.mem_read.part1 unc_iio_data_req_by_cpu.mem_read.part2 unc_iio_data_req_by_cpu.mem_read.part3 unc_iio_data_req_by_cpu.mem_read.part4 unc_iio_data_req_by_cpu.mem_read.part5 unc_iio_data_req_by_cpu.mem_read.part6 unc_iio_data_req_by_cpu.mem_read.part7 unc_iio_data_req_by_cpu.peer_read.part0 unc_iio_data_req_by_cpu.peer_read.part1 unc_iio_data_req_by_cpu.peer_read.part2 unc_iio_data_req_by_cpu.peer_read.part3 unc_iio_data_req_by_cpu.peer_read.part4 unc_iio_data_req_by_cpu.peer_read.part5 unc_iio_data_req_by_cpu.peer_read.part6 unc_iio_data_req_by_cpu.peer_read.part7 unc_iio_data_req_by_cpu.peer_write.part0 unc_iio_data_req_by_cpu.peer_write.part1 unc_iio_data_req_by_cpu.peer_write.part2 unc_iio_data_req_by_cpu.peer_write.part3 unc_iio_data_req_by_cpu.peer_write.part4 unc_iio_data_req_by_cpu.peer_write.part5 unc_iio_data_req_by_cpu.peer_write.part6 unc_iio_data_req_by_cpu.peer_write.part7 unc_iio_inbound_arb_req.data unc_iio_inbound_arb_req.req_own unc_iio_inbound_arb_req.wr unc_iio_inbound_arb_won.data unc_iio_inbound_arb_won.final_rd_wr unc_iio_inbound_arb_won.iommu_hit unc_iio_inbound_arb_won.iommu_req unc_iio_inbound_arb_won.req_own unc_iio_inbound_arb_won.wr unc_iio_req_from_pcie_cl_cmpl.data unc_iio_req_from_pcie_cl_cmpl.final_rd_wr unc_iio_req_from_pcie_cl_cmpl.req_own unc_iio_req_from_pcie_cl_cmpl.wr unc_iio_req_from_pcie_cmpl.final_rd_wr unc_iio_req_from_pcie_cmpl.iommu_hit unc_iio_req_from_pcie_cmpl.iommu_req unc_iio_req_from_pcie_cmpl.req_own unc_iio_req_from_pcie_pass_cmpl.data unc_iio_req_from_pcie_pass_cmpl.req_own unc_iio_req_from_pcie_pass_cmpl.wr unc_iio_txn_req_by_cpu.peer_write.part0 unc_iio_txn_req_by_cpu.peer_write.part1 unc_iio_txn_req_by_cpu.peer_write.part2 unc_iio_txn_req_by_cpu.peer_write.part3 unc_iio_txn_req_by_cpu.peer_write.part4 unc_iio_txn_req_by_cpu.peer_write.part5 unc_iio_txn_req_by_cpu.peer_write.part6 unc_iio_txn_req_by_cpu.peer_write.part7

Thanks.

Michael

Quoted 45 lines · Michael Petlan

Hello Ian and others,

we have encountered some issues with uncore events on Sapphire Rapids. There are a couple types of problems. One of them is the following:

    # perf stat -e uncore_cha_55/event=0x35,umask=0x10c0008101/ -a -- ls 
    event syntax error: '..0x35,umask=0x10c0008101/'
                                      \___ Bad event or PMU

Unable to find PMU or event on a PMU of 'uncore_cha_55'

Initial error:
event syntax error: '..0x35,umask=0x10c0008101/'
\___ value too big for format, maximum is 4294967295
Run 'perf list' for a list of valid events

There is a 34bit umask that can handle it, namely umask_ext2, but it is not used for sapphire rapids:

uncore_snbep.c:5958:static struct attribute *spr_uncore_cha_formats_attr[] = {

uncore_snbep.c-5959-    &format_attr_event.attr,
uncore_snbep.c-5960-    &format_attr_umask_ext4.attr,
uncore_snbep.c-5961-    &format_attr_tid_en2.attr,
uncore_snbep.c-5962-    &format_attr_edge.attr,
uncore_snbep.c-5963-    &format_attr_inv.attr,
uncore_snbep.c-5964-    &format_attr_thresh8.attr,
uncore_snbep.c-5965-    &format_attr_filter_tid5.attr,
uncore_snbep.c-5966-    NULL,

uncore_snbep.c-5967-};

(I see umask_ext4 there and means 32bit:
uncore_snbep.c:479:DEFINE_UNCORE_FORMAT_ATTR(umask_ext4, umask, "config:8-15,32-55");
)

What is wrong? The json files specifying umask=0x10c0008101 for the event, or the structure that should rather support umask_ext2 ?

There are a few more issues, I will update when analyzing them deeper.

Thanks.
Michael