From 49f2413f9b55dd975fb7d874c1fd35cf6a7335c6 Mon Sep 17 00:00:00 2001 From: Besar Wicaksono Date: Mon, 8 Jun 2026 23:41:35 +0000 Subject: perf/arm_pmu: Skip PMCCNTR_EL0 on NVIDIA Olympus The PMCCNTR_EL0 in NVIDIA Olympus CPU may increment while in WFI/WFE, which does not align with counting CPU_CYCLES on a programmable counter. Add a MIDR range entry and refuse PMCCNTR_EL0 for cycle events on affected parts so perf does not mix the two behaviors. Also keep PMCCNTR_EL0 unavailable to EL0 direct counter reads on affected CPUs. When userspace counter access is enabled, avoid setting PMUSERENR_EL0.CR for PMUs that must avoid PMCCNTR_EL0, while still allowing direct reads from programmable event counters. For 64-bit userspace CPU_CYCLES events on PMUs without native long event counters, reject the event if the only valid direct-read path would be PMCCNTR_EL0. Signed-off-by: Besar Wicaksono Signed-off-by: Will Deacon --- include/linux/perf/arm_pmu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/perf/arm_pmu.h b/include/linux/perf/arm_pmu.h index 52b37f7bdbf9..02d2c7f45b52 100644 --- a/include/linux/perf/arm_pmu.h +++ b/include/linux/perf/arm_pmu.h @@ -119,7 +119,7 @@ struct arm_pmu { /* PMUv3 only */ int pmuver; - bool has_smt; + bool avoid_pmccntr; u64 reg_pmmir; u64 reg_brbidr; #define ARMV8_PMUV3_MAX_COMMON_EVENTS 0x40 -- cgit v1.2.3 From cf65b4d765b5f09db46baaa2dadf10fd53708a64 Mon Sep 17 00:00:00 2001 From: Yicong Yang Date: Wed, 8 Jul 2026 16:45:03 +0800 Subject: perf/dwc_pcie: Add support for Picoheart vendor devices Add PCI_VENDOR_ID_PICOHEART in pci_ids.h. Update the DWC PCIe vendor table with Picoheart PCIe Vendor ID to enable the PCIe PMU support. Acked-by: Bjorn Helgaas Reviewed-by: Shuai Xue Signed-off-by: Yicong Yang Signed-off-by: Will Deacon --- include/linux/pci_ids.h | 2 ++ include/linux/pcie-dwc.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'include/linux') diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 1c9d40e09107..2c17239aacea 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2640,6 +2640,8 @@ #define PCI_VENDOR_ID_SUNIX 0x1fd4 #define PCI_DEVICE_ID_SUNIX_1999 0x1999 +#define PCI_VENDOR_ID_PICOHEART 0x20fa + #define PCI_VENDOR_ID_HINT 0x3388 #define PCI_DEVICE_ID_HINT_VXPROII_IDE 0x8013 diff --git a/include/linux/pcie-dwc.h b/include/linux/pcie-dwc.h index 8ff778e7aec0..d3cd701a58e3 100644 --- a/include/linux/pcie-dwc.h +++ b/include/linux/pcie-dwc.h @@ -26,6 +26,8 @@ static const struct dwc_pcie_vsec_id dwc_pcie_rasdes_vsec_ids[] = { .vsec_id = 0x02, .vsec_rev = 0x4 }, { .vendor_id = PCI_VENDOR_ID_AMPERE, .vsec_id = 0x02, .vsec_rev = 0x4 }, + { .vendor_id = PCI_VENDOR_ID_PICOHEART, + .vsec_id = 0x02, .vsec_rev = 0x4 }, { .vendor_id = PCI_VENDOR_ID_QCOM, .vsec_id = 0x02, .vsec_rev = 0x4 }, { .vendor_id = PCI_VENDOR_ID_ROCKCHIP, -- cgit v1.2.3 From 5686f2bed02d98d03e3f38f4b5569804510fba31 Mon Sep 17 00:00:00 2001 From: "Kiryl Shutsemau (Meta)" Date: Mon, 29 Jun 2026 16:07:15 +0100 Subject: firmware: arm_sdei: add sdei_is_present() invoke_sdei_fn() returns -EIO when no SDEI conduit was probed, and the core warns ("Failed to create event ...") on any registration that hits that. An optional consumer that registers an event from an unconditional initcall would therefore make every boot on a non-SDEI system emit that warning for what is simply absent firmware. Expose whether SDEI firmware is present so such a consumer can skip registration -- and the warning -- when there is nothing to talk to. Signed-off-by: Kiryl Shutsemau (Meta) Reviewed-by: Douglas Anderson Tested-by: Yin Fengwei Signed-off-by: Will Deacon --- include/linux/arm_sdei.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/linux') diff --git a/include/linux/arm_sdei.h b/include/linux/arm_sdei.h index f652a5028b59..b07113eeeff7 100644 --- a/include/linux/arm_sdei.h +++ b/include/linux/arm_sdei.h @@ -37,6 +37,9 @@ int sdei_event_unregister(u32 event_num); int sdei_event_enable(u32 event_num); int sdei_event_disable(u32 event_num); +/* Was SDEI firmware probed and usable? */ +bool sdei_is_present(void); + /* GHES register/unregister helpers */ int sdei_register_ghes(struct ghes *ghes, sdei_event_callback *normal_cb, sdei_event_callback *critical_cb); -- cgit v1.2.3 From 9141eda9eec76b538bb64e89185034ec61d341ca Mon Sep 17 00:00:00 2001 From: "Kiryl Shutsemau (Meta)" Date: Mon, 29 Jun 2026 16:07:16 +0100 Subject: firmware: arm_sdei: add SDEI_EVENT_SIGNAL support Add sdei_event_signal(), a thin wrapper over the SDEI_EVENT_SIGNAL call (DEN0054) that makes the software-signalled event (event 0) pending on a target PE -- delivered NMI-like even when that PE has interrupts masked. It takes no locks, so it is safe to call from NMI / crash context. Signed-off-by: Kiryl Shutsemau (Meta) Reviewed-by: Douglas Anderson Tested-by: Yin Fengwei Signed-off-by: Will Deacon --- include/linux/arm_sdei.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux') diff --git a/include/linux/arm_sdei.h b/include/linux/arm_sdei.h index b07113eeeff7..b9dc21c241be 100644 --- a/include/linux/arm_sdei.h +++ b/include/linux/arm_sdei.h @@ -37,6 +37,12 @@ int sdei_event_unregister(u32 event_num); int sdei_event_enable(u32 event_num); int sdei_event_disable(u32 event_num); +/* + * Signal the software-signalled event (event 0) to another PE, NMI-like. + * @mpidr is the target's MPIDR affinity. + */ +int sdei_event_signal(u32 event_num, u64 mpidr); + /* Was SDEI firmware probed and usable? */ bool sdei_is_present(void); -- cgit v1.2.3