Page MenuHomeFreeBSD

hwpstate_amd: Expose node as much as possible
Needs ReviewPublic

Authored by aokblast on Sun, Mar 1, 4:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 21, 3:46 AM
Unknown Object (File)
Fri, Mar 20, 7:48 AM
Unknown Object (File)
Fri, Mar 20, 7:48 AM
Unknown Object (File)
Fri, Mar 20, 7:48 AM
Unknown Object (File)
Thu, Mar 19, 6:07 AM
Unknown Object (File)
Wed, Mar 18, 11:10 PM
Unknown Object (File)
Tue, Mar 17, 6:01 AM
Unknown Object (File)
Sat, Mar 14, 8:46 PM
Subscribers

Details

Reviewers
olce

Diff Detail

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

Event Timeline

olce requested changes to this revision.Mon, Mar 9, 9:34 AM
olce added a subscriber: olce.

Changes themselves look good, except for one mistake (wrong MSR).

We are missing something both to ease configuration and to minimize the disruption due to breaking backwards compatibility: A knob allowing to change the setting of all CPUs at once, to be below dev.hwpstate_amd (instead of under dev.hwpstate_amd.X where X is the CPU number). (That's for a separate revision/commit.) I have been wanting to have a similar change for CPPC, in order to retire machdep.hwpstate_pkg_ctrl for hwpstate_amd(4) (and we would obsolete it for hwpstate_intel(4) by having something similar there).

sys/x86/cpufreq/hwpstate_amd.c
641

Wrong MSR here.

738–739

This code to read the status could be factored out (there is another such call in hwpstate_goto_pstate()).

1236

Style.

1261

msrs seems confusing as a name. Open to other suggestions.

This revision now requires changes to proceed.Mon, Mar 9, 9:34 AM

Some additional tiny changes and this is good to go.

sys/x86/cpufreq/hwpstate_amd.c
591

When using MSR_OP_READ without MSR_OP_SAFE, only 0 can be returned by x86_msr_op(), so I suggest to just change the return type of the function, and also convert the result of the latter explicitly to void with a comment explaining why.

594–595

As explained above (and please add a small comment explaining the why; may be a copy of the above inline comment).

598–603

Same here.