Page MenuHomeFreeBSD

Bug 212020 - Add powerd(8) support for newer AMD CPUs
ClosedPublic

Authored by Scoobi_doo_yahoo.com on Aug 21 2016, 1:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 9, 1:10 AM
Unknown Object (File)
Tue, Apr 2, 7:43 PM
Unknown Object (File)
Tue, Apr 2, 5:57 PM
Unknown Object (File)
Mar 2 2024, 6:54 PM
Unknown Object (File)
Mar 2 2024, 6:52 PM
Unknown Object (File)
Feb 29 2024, 8:05 AM
Unknown Object (File)
Feb 27 2024, 8:15 AM
Unknown Object (File)
Jan 29 2024, 1:18 AM

Details

Summary

From Bug 212020:

sys/x86/cpufreq/hwpstate.c provides support for AMD CPUs, but only
supports families up to 0x11. The latest AMD CPU family is 0x16. This
patch adds support for newer AMD CPUs. (The patch to
sys/x86/cpufreq/powernow.c is cosmetic/superfluous.)

Test Plan
  1. Boot kernel containing patch.
  2. Try to start powerd(8).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Scoobi_doo_yahoo.com retitled this revision from to Bug 212020 - Add powerd(8) support for newer AMD CPUs.
Scoobi_doo_yahoo.com updated this object.
Scoobi_doo_yahoo.com edited the test plan for this revision. (Show Details)
Scoobi_doo_yahoo.com set the repository for this revision to rS FreeBSD src repository - subversion.
jhb added inline comments.
sys/x86/cpufreq/hwpstate.c
411 ↗(On Diff #19518)

This change seems to be a no-op? Shouldn't both conditions be equivalent?

424 ↗(On Diff #19518)

Is there a manual/datasheet that documents how to interpret the MSR fields for these different families? It seems really odd for only family 0x11 to use the 0x08 offset.

sys/x86/cpufreq/powernow.c
869 ↗(On Diff #19518)

The changes in this file all seem to be debugging?

sys/x86/cpufreq/hwpstate.c
411 ↗(On Diff #19518)

Yes, these are equivalent expressions; I think mine's easier to read.

424 ↗(On Diff #19518)

MainPllOpFreqIdMax: main PLL operating frequency ID maximum. Read-only. Specifies the
maximum main PLL operating frequency supported by the processor. The maximum frequency is 100
MHz * (MainPllOpFreqIdMax + 08h), if MainPllOpFreqIdMax is greater than zero; if
MainPllOpFreqIdMax = 00h, then there is no frequency limit. See F3xD4[MainPllOpFreqId].

sys/x86/cpufreq/powernow.c
869 ↗(On Diff #19518)

True, they're cosmetic/debugging/not-functional.

sys/x86/cpufreq/hwpstate.c
424 ↗(On Diff #19518)

This looks to be correct for 0x12, but the 0x14 manuals do not have a CpuFID in this MSR. Instead, the frequency has to be calculated using a different formula (see page 430 in the Family 14h manual). You have to read from an associated PCI device to determine a "package" frequency and use the values from the MSR as a divisor of the package frequency. However, CpuFID is present in this MSR on 0x15 and 0x16 family CPUs and the frequency is calculated the same as for family 0x10. Given that, I think we should drop 0x14 from this patch unless you have tested this on family 0x14 processors?

This revision was automatically updated to reflect the committed changes.