Files
linux-kernelorg-stable/include/linux
Kuppuswamy Sathyanarayanan 7537bae8b6 powercap: intel_rapl: Remove incorrect CPU check in PMU context
The RAPL MSR read path incorrectly validates CPU context when called
from the PMU subsystem:

    if (atomic) {
        if (unlikely(smp_processor_id() != cpu))
            return -EIO;
        rdmsrq(ra->reg.msr, ra->value);
    }

This check fails for package-scoped MSRs like RAPL energy counters,
which are readable from any CPU within the package.

The perf tool avoids hitting this check by validating against
/sys/bus/event_source/devices/power/cpumask before opening events.
However, turbostat does not perform this validation and may attempt
reads from non-lead CPUs, causing the check to fail and return zero
power values.

Since package-scoped MSRs are architecturally accessible from any CPU
in the package, remove the CPU matching check.

Also rename 'atomic' to 'pmu_ctx' to clarify this indicates PMU context
where rdmsrq() can be used directly instead of rdmsrl_safe_on_cpu().

Fixes: 748d6ba43a ("powercap: intel_rapl: Enable MSR-based RAPL PMU support")
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Tested-by: Furquim Ulisses <ulisses.furquim@intel.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://patch.msgid.link/20260209234310.1440722-2-sathyanarayanan.kuppuswamy@linux.intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-02-11 21:03:39 +01:00
..
2026-01-11 06:09:11 -10:00
2025-12-15 14:33:38 +01:00
2026-01-27 15:31:42 +01:00
2025-12-09 23:29:42 -08:00
2025-12-13 20:04:32 +12:00
2025-12-23 11:23:10 -08:00
2026-01-11 06:09:11 -10:00
2026-01-12 16:52:09 +01:00
2026-02-06 07:29:14 -07:00
2026-01-11 06:09:11 -10:00
2026-01-26 19:03:47 -08:00
2026-01-14 11:00:00 +01:00
2026-01-12 10:45:31 -06:00
2026-01-11 06:09:11 -10:00
2026-01-11 06:09:11 -10:00
2026-01-11 06:09:11 -10:00
2026-01-11 06:09:11 -10:00
2025-12-24 08:02:55 -05:00