[PATCH 3/7] perf/x86/intel: Clear cpuc->pmu on hybrid PMU init failure

From: Dapeng Mi

Date: Fri Jul 10 2026 - 03:00:27 EST


When init_hybrid_pmu() fails at check_hw_exists(), cpuc->pmu may still
point to the default static PMU.

The CPU hotplug rollback then runs intel_pmu_cpu_dead(). On hybrid
systems, that path may call hybrid_pmu(cpuc->pmu), which is not valid
for the static PMU pointer and can result in incorrect hybrid state
access.

Fix this by resetting cpuc->pmu to NULL on hybrid PMU init failure.

Signed-off-by: Dapeng Mi <dapeng1.mi@xxxxxxxxxxxxxxx>
---
arch/x86/events/intel/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index b39c6ce0efb5..9d4774278b50 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -6329,8 +6329,10 @@ static bool init_hybrid_pmu(int cpu)

intel_pmu_check_hybrid_pmus(pmu);

- if (!check_hw_exists(&pmu->pmu, pmu->cntr_mask, pmu->fixed_cntr_mask))
+ if (!check_hw_exists(&pmu->pmu, pmu->cntr_mask, pmu->fixed_cntr_mask)) {
+ cpuc->pmu = NULL;
return false;
+ }

pr_info("%s PMU driver: ", pmu->name);

--
2.34.1