Skip to content

Enable Intel RAPL / powercap on generic-x86-64 - #4908

Merged
agners merged 2 commits into
devfrom
enable-intel-rapl-powercap
Jul 20, 2026
Merged

agners merged 2 commits into
devfrom
enable-intel-rapl-powercap

Conversation

@agners

@agners agners commented Jul 20, 2026 •

Copy link
Copy Markdown
Member

The changes

Enable the powercap framework and the Intel RAPL driver in the generic-x86-64 kernel:

  • CONFIG_POWERCAP=y
  • CONFIG_INTEL_RAPL=m

This exposes CPU/package energy counters via /sys/class/powercap/intel-rapl:*/energy_uj, allowing Home Assistant to monitor the power consumption of the host it runs on (e.g. via a command_line sensor feeding the Energy dashboard) without any external smart plug.

Previously the merged kernel config had # CONFIG_POWERCAP is not set, so CONFIG_INTEL_RAPL was dropped by kconfig and /sys/class/powercap did not exist.

The intel_rapl_msr driver also covers modern AMD (Zen) CPUs, so this benefits both vendors. energy_uj has been root-readable only since kernel 5.10, so this does not reintroduce the PLATYPUS side-channel concern.

Closes #4907

๐Ÿค– Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added power capping framework support for compatible systems.
    • Enabled Intel RAPL power and energy counters as an optional loadable component.

Enable the powercap framework and the Intel RAPL driver so that CPU and
package energy counters are exposed via /sys/class/powercap. This allows
Home Assistant to monitor the power consumption of the host it runs on
(e.g. via a command_line sensor reading energy_uj) without external
hardware. The intel_rapl_msr driver also covers modern AMD (Zen) CPUs.

energy_uj has been root-readable only since kernel 5.10, so this does not
reintroduce the PLATYPUS side-channel concern.

Closes #4907

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. ๐ŸŽ‰

โ„น๏ธ Recent review info
โš™๏ธ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 645ad00f-4819-4747-b606-0ecd8ba374ae

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 14fdd89 and 8522513.

๐Ÿ“’ Files selected for processing (1)
  • buildroot-external/board/pc/generic-x86-64/kernel.config
๐Ÿ’ค Files with no reviewable changes (1)
  • buildroot-external/board/pc/generic-x86-64/kernel.config

๐Ÿ“ Walkthrough

Walkthrough

The generic x86-64 kernel configuration enables the Linux power-capping framework and Intel RAPL support as a loadable module.

Changes

Powercap kernel support

Layer / File(s) Summary
Enable powercap and Intel RAPL
buildroot-external/board/pc/generic-x86-64/kernel.config
Enables CONFIG_POWERCAP=y and sets CONFIG_INTEL_RAPL=m.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

Iโ€™m a rabbit with power to spare,
RAPL now measures whatโ€™s there.
A kernel switch, a module near,
Energy counts hop into gear! ๐Ÿ‡

๐Ÿšฅ Pre-merge checks | โœ… 5
โœ… Passed checks (5 passed)
Check name Status Explanation
Description Check โœ… Passed Check skipped - CodeRabbitโ€™s high-level summary is enabled.
Title check โœ… Passed The title is concise and accurately describes the main kernel configuration change.
Linked Issues check โœ… Passed The change enables CONFIG_POWERCAP and CONFIG_INTEL_RAPL as requested in issue #4907.
Out of Scope Changes check โœ… Passed No unrelated changes are present beyond the requested kernel config update.
Docstring Coverage โœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
โœจ Finishing Touches
๐Ÿงช Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch enable-intel-rapl-powercap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

โค๏ธ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables the Linux powercap framework and Intel RAPL support in the generic-x86-64 kernel configuration so that CPU/package energy counters are exposed under /sys/class/powercap/ (e.g. intel-rapl:*/energy_uj) for host power monitoring.

Changes:

  • Enable the powercap framework (CONFIG_POWERCAP=y).
  • Build Intel RAPL support as a module (CONFIG_INTEL_RAPL=m) in the generic x86-64 board kernel config.

๐Ÿ’ก Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@agners
agners merged commit aacd5f7 into dev Jul 20, 2026
1 check passed
@agners
agners deleted the enable-intel-rapl-powercap branch July 20, 2026 12:19
@agners agners mentioned this pull request Jul 27, 2026
@agners agners added the board/generic-x86-64 Generic x86-64 Boards (like Intel NUC) label Jul 27, 2026
@agners agners mentioned this pull request Jul 30, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

board/generic-x86-64 Generic x86-64 Boards (like Intel NUC) cla-signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable Intel RAPL / powercap support in the x86-64 kernel (CONFIG_POWERCAP + CONFIG_INTEL_RAPL)

2 participants