Bug 212020 - Add powerd(8) support for newer AMD CPUs
Summary: Add powerd(8) support for newer AMD CPUs
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-08-21 00:58 UTC by Anthony Jenkins
Modified: 2016-12-13 17:57 UTC (History)
2 users (show)

See Also:


Attachments
Patch to add powerd/cpufreq support for newer AMD CPUs. (2.77 KB, patch)
2016-08-21 00:58 UTC, Anthony Jenkins
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Jenkins 2016-08-21 00:58:34 UTC
Created attachment 173900 [details]
Patch to add powerd/cpufreq support for newer AMD CPUs.

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.)
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-10-27 21:32:24 UTC
A commit references this bug:

Author: jhb
Date: Thu Oct 27 21:31:57 UTC 2016
New revision: 308005
URL: https://svnweb.freebsd.org/changeset/base/308005

Log:
  Add powerd(8) support for several families of AMD CPUs.

  Use the same logic to calculate the nominal CPU frequency from the P-state
  MSRs on family 0x12, 0x15, and 0x16 CPUs as is used for family 0x10.
  Family 0x14 was included in the original patch in the PR but I left that
  out as the BIOS writer's guide for family 0x14 CPUs show a different layout
  for the relevant MSR and include a different formulate for calculating the
  frequency.

  While here, simplify a few expressions and print out the family of
  unsupported CPUs in hex rather than decimal.

  PR:		212020
  Submitted by:	Anthony Jenkins <Scoobi_doo@yahoo.com>
  MFC after:	1 month
  Differential Revision:	https://reviews.freebsd.org/D7587

Changes:
  head/sys/x86/cpufreq/hwpstate.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-12-02 21:35:47 UTC
A commit references this bug:

Author: jhb
Date: Fri Dec  2 21:35:15 UTC 2016
New revision: 309443
URL: https://svnweb.freebsd.org/changeset/base/309443

Log:
  MFC 308005: Add powerd(8) support for several families of AMD CPUs.

  Use the same logic to calculate the nominal CPU frequency from the P-state
  MSRs on family 0x12, 0x15, and 0x16 CPUs as is used for family 0x10.
  Family 0x14 was included in the original patch in the PR but I left that
  out as the BIOS writer's guide for family 0x14 CPUs show a different layout
  for the relevant MSR and include a different formulate for calculating the
  frequency.

  While here, simplify a few expressions and print out the family of
  unsupported CPUs in hex rather than decimal.

  PR:		212020

Changes:
_U  stable/10/
  stable/10/sys/x86/cpufreq/hwpstate.c
_U  stable/11/
  stable/11/sys/x86/cpufreq/hwpstate.c
Comment 3 Anthony Jenkins 2016-12-13 17:57:59 UTC
Sorry for late comment, been ridiculously slammed at work.

Thanks everyone for committing this patch. I looked into adding support for 0x14 AMD CPUs, but the reference manual is too hard for me to follow.