Page MenuHomeFreeBSD

hwpstate: add CPPC support for pstate driver on AMD
AcceptedPublic

Authored by aokblast on Mar 31 2025, 10:04 AM.
Tags
None
Referenced Files
F121007965: D49587.id152917.diff
Sun, Jun 22, 9:16 PM
F120997921: D49587.id156851.diff
Sun, Jun 22, 7:14 PM
F120925011: D49587.id155939.diff
Sun, Jun 22, 4:56 AM
Unknown Object (File)
Sat, Jun 21, 4:28 PM
Unknown Object (File)
Fri, Jun 20, 4:37 PM
Unknown Object (File)
Fri, Jun 20, 12:46 PM
Unknown Object (File)
Thu, Jun 19, 11:21 PM
Unknown Object (File)
Thu, Jun 19, 10:19 PM
Subscribers

Details

Reviewers
cem
markj
olce
khng
Summary

hwpstate: add CPPC support for pstate driver on AMD

Implement CPPC interface for AMD Pstate Driver.
This feature is only enabled when the CPUID shows it support CPPC.

The CPPC is implemneted by the following steps:

  1. Write MSR to enable it.
  2. Read capability registert which indicates binary value of levels

about lowest, best energy efficient, guarantee, and max performance.

  1. Write request register with epp in energy balanced mode. And let

CPU and firmware to enter autonomous mode.

Also, create a sysctl to allow userspace to change epp value

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 64775
Build 61659: arc lint + arc unit

Event Timeline

use wildcard to generate correct number of devices

  • atkbd: fix first keystroke force reset

Reset to the correct version

Use balanced mode as the default epp

In general, please include some summary of the code changes in the review description. This makes reviewing easier: I can quickly understand what the change is supposed to do, and then I can compare the code changes with your description to look for discrepancies.

sys/x86/cpufreq/hwpstate_amd.c
236

The sysctl_handle_int() call doesn't need to be inside the sched_bind() section, it should be moved earlier.

494
714
775–792

There should be an extra newline after local variable declarations.

sys/x86/x86/identcpu.c
1694

The AND is redundant. Is there a typo here?

move set_autonomous mode into attach

This revision is now accepted and ready to land.Thu, Jun 12, 10:42 PM

I'd like the opportunity to review this (next week).

I'd like the opportunity to review this (next week).

Of course. Not hurry. I just want to make more people engage in:).