Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
92a0d0f
cpufreq: amd-pstate: Update amd-pstate preferred core ranking dynamic…
Jan 19, 2024
050d0d0
cpufreq: amd-pstate: Document *_limit_* fields in struct amd_cpudata
gautshen Apr 25, 2024
967359b
cpufreq: amd-pstate: Document the units for freq variables in amd_cpu…
gautshen Apr 25, 2024
ba0d96f
cpufreq: amd-pstate: Unify computation of {max,min,nominal,lowest_non…
Apr 25, 2024
eeec5c5
cpufreq: amd-pstate: Remove amd_get_{min,max,nominal,lowest_nonlinear…
gautshen Apr 25, 2024
b260a6c
cpufreq: amd-pstate: Bail out if min/max/nominal_freq is 0
Apr 25, 2024
006c666
cpufreq: amd-pstate: get transition delay and latency value from ACPI…
Apr 25, 2024
10c0170
cpufreq: amd-pstate: Add quirk for the pstate CPPC capabilities missing
Apr 25, 2024
f49c49f
cpufreq: amd-pstate: fix code format problems
Apr 30, 2024
4b85d18
cpufreq: amd-pstate: remove unused variable lowest_nonlinear_freq
Apr 30, 2024
806ebfb
cpufreq: amd-pstate: remove global header file
arndb May 28, 2024
fd7736b
cpufreq: amd-pstate: Allow users to write 'default' EPP string
superm1 Jun 12, 2024
a4c6313
cpufreq: amd-pstate: optimize the initial frequency values verification
Jun 19, 2024
7e3ee27
cpufreq: amd-pstate: remove unused variable nominal_freq
Jun 19, 2024
71a523a
cpufreq: amd-pstate: show CPPC debug message if CPPC is not supported
Jun 19, 2024
aa254b2
cpufreq: amd-pstate: add debug message while CPPC is supported and di…
Jun 19, 2024
f9f9c0b
cpufreq: amd-pstate: switch boot_cpu_has() to cpu_feature_enabled()
Jun 19, 2024
7e31881
cpufreq: amd-pstate: enable shared memory type CPPC by default
Jun 19, 2024
adc0812
cpufreq: amd-pstate: auto-load pstate driver by default
Jun 19, 2024
a89d873
cpufreq/amd-pstate: fix setting policy current frequency value
Feb 27, 2024
c61650d
cpufreq: amd-pstate: Don't create attributes when registration fails
superm1 Jun 23, 2024
62f49bb
cpufreq: amd-pstate: Fix the inconsistency in max frequency units
dhananjay-AMD May 27, 2024
ee86f88
cpufreq: acpi: move MSR_K7_HWCR_CPB_DIS_BIT into msr-index.h
Jun 26, 2024
f4f6d9c
cpufreq: amd-pstate: initialize core precision boost state
Jun 26, 2024
73c76f8
cpufreq: amd-pstate: Cap the CPPC.max_perf to nominal_perf if CPB is off
Jun 26, 2024
d407310
cpufreq: pcc: Remove empty exit() callback
vireshk Jul 4, 2024
3dd9e45
cpufreq/amd-pstate-ut: Convert nominal_freq to khz during comparisons
dhananjay-AMD Jul 2, 2024
ae64370
cpufreq: Make cpufreq_driver->exit() return void
leesagacious Jul 4, 2024
23bde5c
cpufreq: amd-pstate: Fix uninitialized variable in amd_pstate_cpu_boo…
Aug 13, 2024
ca4eace
cpufreq/amd-pstate: Use topology_logical_package_id() instead of logi…
gautshen Aug 13, 2024
69f4bf9
cpufreq/amd-pstate-ut: Don't check for highest perf matching on prefcore
superm1 Jul 2, 2024
d472fae
cpufreq/amd-pstate: Remove warning for X86_FEATURE_CPPC on certain Ze…
gautshen Aug 28, 2024
3a57629
cpufreq/amd-pstate: Add the missing cpufreq_cpu_put()
dhananjay-AMD Aug 9, 2024
a3a30be
cpufreq/amd-pstate: Catch failures for amd_pstate_epp_update_limit()
superm1 Sep 1, 2024
940291f
x86/CPU/AMD: Always inline amd_clear_divider()
mjguzik Jun 13, 2024
20240fa
x86/amd: Move amd_get_highest_perf() from amd.c to cppc.c
superm1 Aug 26, 2024
c6a2561
ACPI: CPPC: Adjust return code for inline functions in !CONFIG_ACPI_C…
superm1 Sep 3, 2024
a2e21cb
x86/amd: Rename amd_get_highest_perf() to amd_get_boost_ratio_numerat…
superm1 Aug 26, 2024
5647e28
x86/amd: Move amd_get_highest_perf() out of amd-pstate
superm1 Aug 26, 2024
2a5c8e2
x86/amd: Detect preferred cores in amd_get_boost_ratio_numerator()
superm1 Aug 26, 2024
6aaa927
cpufreq: amd-pstate: Merge amd_pstate_highest_perf_set() into amd_get…
superm1 Aug 26, 2024
873a7ab
cpufreq: amd-pstate: Optimize amd_pstate_update_limits()
superm1 Aug 26, 2024
e027431
cpufreq/amd-pstate: Export symbols for changing modes
superm1 Sep 1, 2024
70656fd
cpufreq/amd-pstate-ut: Add test case for mode switches
superm1 Sep 1, 2024
abe08e0
cpufreq/amd-pstate-ut: Fix an "Uninitialized variables" issue
Sep 10, 2024
5a68ce0
cpufreq/amd-pstate: Use nominal perf for limits when boost is disabled
superm1 Oct 12, 2024
cade13a
cpufreq/amd-pstate: Rename MSR and shared memory specific functions
dhananjay-AMD Sep 17, 2024
a813f28
cpufreq/amd-pstate: Fix non kerneldoc comment
superm1 Sep 5, 2024
3b0431c
cpufreq/amd-pstate: Don't update CPPC request in amd_pstate_cpu_boost…
superm1 Oct 12, 2024
88a3be8
cpufreq/amd-pstate: Use amd_pstate_update_min_max_limit() for EPP limits
superm1 Oct 12, 2024
ab840fc
cpufreq/amd-pstate: Drop needless EPP initialization
superm1 Oct 12, 2024
d934e44
cpufreq/amd-pstate: Remove the redundant verify() function
dhananjay-AMD Oct 17, 2024
fc80a2d
cpufreq/amd-pstate: Set the initial min_freq to lowest_nonlinear_freq
dhananjay-AMD Oct 17, 2024
768e9da
cpufreq/amd-pstate: Call amd_pstate_register() in amd_pstate_init()
dhananjay-AMD Oct 17, 2024
0878839
cpufreq/amd-pstate: Call amd_pstate_set_driver() in amd_pstate_regist…
dhananjay-AMD Oct 17, 2024
3056def
cpufreq/amd-pstate: Remove the switch case in amd_pstate_init()
dhananjay-AMD Oct 17, 2024
33c2e1a
cpufreq/amd-pstate: Remove the redundant amd_pstate_set_driver() call
dhananjay-AMD Oct 17, 2024
2fae9d9
amd-pstate: Switch to amd-pstate by default on some Server platforms
SSapkal Oct 21, 2024
8df426e
cpufreq/amd-pstate-ut: Add fix for min freq unit test
superm1 Oct 17, 2024
16e85a2
cpufreq/amd-pstate: Rename functions that enable CPPC
dhananjay-AMD Oct 23, 2024
af433dd
cpufreq/amd-pstate: Do not attempt to clear MSR_AMD_CPPC_ENABLE
dhananjay-AMD Oct 23, 2024
24851d2
cpufreq/amd-pstate: Call cppc_set_epp_perf in the reenable function
dhananjay-AMD Oct 23, 2024
d8ac17a
cpufreq/amd-pstate: Align offline flow of shared memory and MSR based…
dhananjay-AMD Oct 23, 2024
d6cc498
cpufreq/amd-pstate: Push adjust_perf vfunc init into cpu_init
superm1 Oct 28, 2024
fa1792b
cpufreq/amd-pstate: Move registration after static function call update
superm1 Oct 28, 2024
f8a1030
cpufreq/amd-pstate: Detect preferred core support before driver regis…
kudureranganath Dec 10, 2024
1429390
cpufreq: amd-pstate: Add documentation for `amd_pstate_hw_prefcore`
superm1 Aug 26, 2024
10949b4
amd-pstate: Add missing documentation for `amd_pstate_prefcore_ranking`
superm1 Sep 3, 2024
34ae2b4
cpufreq/amd-pstate: Store the boost numerator as highest perf again
superm1 Dec 9, 2024
4aac802
cpufreq/amd-pstate: Use boost numerator for upper bound of frequencies
superm1 Dec 9, 2024
b4885c7
cpufreq/amd-pstate: Convert the amd_pstate_get/set_epp() to static calls
dhananjay-AMD Dec 4, 2024
d2aba1a
cpufreq/amd-pstate: Move the invocation of amd_pstate_update_perf()
dhananjay-AMD Dec 4, 2024
b3b7619
cpufreq/amd-pstate: Refactor amd_pstate_epp_reenable() and amd_pstate…
dhananjay-AMD Dec 4, 2024
098858a
cpufreq/amd-pstate: Remove the cppc_state check in offline/online fun…
dhananjay-AMD Dec 4, 2024
be83aaa
cpufreq/amd-pstate: Merge amd_pstate_epp_cpu_offline() and amd_pstate…
dhananjay-AMD Dec 4, 2024
243bf37
cpufreq/amd-pstate: Add trace event for EPP perf updates
superm1 Dec 9, 2024
20842a8
cpufreq/amd-pstate: convert mutex use to guard()
superm1 Dec 9, 2024
c0168b9
cpufreq/amd-pstate: Drop cached epp_policy variable
superm1 Dec 9, 2024
d5a48c1
cpufreq/amd-pstate: Use FIELD_PREP and FIELD_GET macros
superm1 Dec 9, 2024
b9f2722
cpufreq/amd-pstate: Only update the cached value in msr_set_epp() on …
superm1 Dec 9, 2024
edb2ed4
cpufreq/amd-pstate: store all values in cpudata struct in khz
superm1 Dec 9, 2024
87eafbb
cpufreq/amd-pstate: Change amd_pstate_update_perf() to return an int
superm1 Dec 9, 2024
466bc6b
cpufreq/amd-pstate: Move limit updating code
superm1 Dec 9, 2024
9dc6794
cpufreq/amd-pstate: Cache EPP value and use that everywhere
superm1 Dec 9, 2024
0679f70
cpufreq/amd-pstate: Always write EPP value when updating perf
superm1 Dec 9, 2024
f0e4d87
cpufreq/amd-pstate: Drop ret variable from amd_pstate_set_energy_pref…
superm1 Dec 9, 2024
642e960
cpufreq/amd-pstate: Set different default EPP policy for Epyc and Ryzen
superm1 Dec 9, 2024
0d5b956
cpufreq/amd-pstate: Drop boost_state variable
superm1 Dec 9, 2024
2e58110
cpufreq/amd-pstate: Fix prefcore rankings
superm1 Jan 2, 2025
b5d793d
cpufreq/amd-pstate: Refactor max frequency calculation
nsolanki22 Dec 19, 2024
0cac3f7
cpufreq/amd-pstate: Fix per-policy boost flag incorrect when fail
Jan 10, 2025
8eaa4e8
cpufreq/amd-pstate: Remove the goto label in amd_pstate_update_limits
dhananjay-AMD Feb 5, 2025
deed13a
cpufreq/amd-pstate: Fix max_perf updation with schedutil
dhananjay-AMD Feb 5, 2025
70c8fc0
cpufreq/amd-pstate: Fix cpufreq_policy ref counting
dhananjay-AMD Feb 5, 2025
5b70e22
cpufreq: amd-pstate: Remove unnecessary driver_lock in set_boost
dhananjay-AMD Jan 30, 2025
8ef32ae
cpufreq: amd: Set policy->boost_supported
vireshk Jan 23, 2025
84b8259
cpufreq/amd-pstate: Modify the min_perf calculation in adjust_perf ca…
dhananjay-AMD Feb 5, 2025
a09aa95
cpufreq/amd-pstate: Remove the redundant des_perf clamping in adjust_…
dhananjay-AMD Feb 5, 2025
3d06f43
cpufreq/amd-pstate: Pass min/max_limit_perf as min/max_perf to amd_ps…
dhananjay-AMD Feb 5, 2025
c88d90c
cpufreq/amd-pstate: Convert all perf values to u8
dhananjay-AMD Feb 5, 2025
9158c0a
cpufreq/amd-pstate: Modularize perf<->freq conversion
dhananjay-AMD Feb 5, 2025
840f2d8
cpufreq/amd-pstate: Remove the unnecessary cpufreq_update_policy call
dhananjay-AMD Feb 5, 2025
dd94deb
cpufreq/amd-pstate: Add missing NULL ptr check in amd_pstate_update
dhananjay-AMD Feb 5, 2025
5bb1008
cpufreq/amd-pstate: Use scope based cleanup for cpufreq_policy refs
dhananjay-AMD Feb 5, 2025
3309fce
cpufreq/amd-pstate: Remove the unncecessary driver_lock in amd_pstate…
dhananjay-AMD Feb 5, 2025
1369054
cpufreq/amd-pstate: Fix the clamping of perf values
dhananjay-AMD Feb 22, 2025
7b8b4ea
cpufreq/amd-pstate: Invalidate cppc_req_cached during suspend
superm1 Feb 17, 2025
b110e52
cpufreq/amd-pstate: Show a warning when a CPU fails to setup
superm1 Dec 11, 2024
09c7cec
cpufreq/amd-pstate: Drop min and max cached frequencies
superm1 Jan 23, 2025
5d9f190
cpufreq/amd-pstate: Move perf values into a union
superm1 Jan 18, 2025
57e80a7
cpufreq/amd-pstate: Overhaul locking
superm1 Dec 7, 2024
c5e552a
cpufreq/amd-pstate: Drop `cppc_cap1_cached`
superm1 Dec 7, 2024
44cfb92
cpufreq/amd-pstate-ut: Use _free macro to free put policy
superm1 Dec 8, 2024
c8fa6b3
cpufreq/amd-pstate-ut: Allow lowest nonlinear and lowest to be the same
superm1 Feb 14, 2025
e3a3ce2
cpufreq/amd-pstate-ut: Drop SUCCESS and FAIL enums
superm1 Feb 14, 2025
2af7a47
cpufreq/amd-pstate-ut: Run on all of the correct CPUs
superm1 Feb 14, 2025
0c2e8c8
cpufreq/amd-pstate-ut: Adjust variable scope
superm1 Feb 14, 2025
de95f6c
cpufreq/amd-pstate: Replace all AMD_CPPC_* macros with masks
superm1 Dec 8, 2024
124966c
cpufreq/amd-pstate: Cache CPPC request in shared mem case too
superm1 Dec 9, 2024
172dc5b
cpufreq/amd-pstate: Move all EPP tracing into *_update_perf and *_set…
superm1 Dec 9, 2024
872016d
cpufreq/amd-pstate: Update cppc_req_cached for shared mem EPP writes
superm1 Dec 9, 2024
1d285e7
cpufreq/amd-pstate: Drop debug statements for policy setting
superm1 Dec 9, 2024
cf402b0
cpufreq/amd-pstate: Rework CPPC enabling
superm1 Dec 16, 2024
07435bc
cpufreq/amd-pstate: Stop caching EPP
superm1 Jan 19, 2025
386d8a0
cpufreq/amd-pstate: Drop actions in amd_pstate_epp_cpu_offline()
superm1 Feb 19, 2025
7f6bcfd
cpufreq/amd-pstate: Fix min_limit perf and freq updation for performa…
dhananjay-AMD Apr 7, 2025
92be73a
cpufreq: intel_pstate: Set asymmetric CPU capacity on hybrid systems
rafaeljw Sep 4, 2024
97ab1a0
x86/sched: Add basic support for CPU capacity scaling
rafaeljw Aug 28, 2024
eb07797
cpufreq: Consolidate some code in cpufreq_online()
rafaeljw Mar 28, 2025
bf2546d
cpufreq: Split cpufreq_online()
rafaeljw Mar 28, 2025
3e5b0e0
cpufreq: Add and use cpufreq policy locking guards
rafaeljw Mar 28, 2025
4f140b1
cpufreq: intel_pstate: Rearrange max frequency updates handling code
rafaeljw Mar 28, 2025
1ba46a1
cpufreq: Pass policy pointer to ->update_limits()
rafaeljw Mar 28, 2025
7a0718f
cpufreq/amd-pstate: Enable ITMT support after initializing core rankings
kudureranganath Apr 11, 2025
a477f12
sched/topology: Introduce sched_update_asym_prefer_cpu()
kudureranganath Apr 9, 2025
edbe38d
cpufreq/amd-pstate: Update asym_prefer_cpu when core rankings change
kudureranganath Apr 9, 2025
f4799cd
cpufreq/amd-pstate: Move max_perf limiting in amd_pstate_update
dhananjay-AMD Apr 15, 2025
cba08a9
cpufreq/amd-pstate: Add offline, online and suspend callbacks for amd…
dhananjay-AMD Apr 28, 2025
5a9a4fd
cpufreq/amd-pstate: Add support for the "Requested CPU Min frequency"…
dhananjay-AMD Apr 28, 2025
fe99102
amd-pstate-ut: Reset amd-pstate driver mode after running selftests
SSapkal Apr 30, 2025
5ed1a9b
cpufreq/amd-pstate: Avoid shadowing ret in amd_pstate_ut_check_driver()
nathanchance May 12, 2025
3b6db3d
x86/cpufeatures: Add X86_FEATURE_AMD_WORKLOAD_CLASS feature bit
Oct 28, 2024
1b21c6e
cpufreq/amd-pstate: Disable preferred cores on designs with workload …
superm1 Jun 9, 2025
f46be79
amd-pstate: Fix memory leak in amd_pstate_epp_cpu_init()
gautshen Mar 26, 2026
8c90af5
amd-pstate: Update cppc_req_cached in fast_switch case
gautshen Mar 26, 2026
300b448
amd-pstate: Make certain freq_attrs conditionally visible
gautshen Mar 26, 2026
c15f483
x86/cpufeatures: Add AMD CPPC Performance Priority feature.
gautshen Mar 26, 2026
aa0bc36
bitfield: Add FIELD_MODIFY() helper
Apr 17, 2025
b85c0f0
amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF
gautshen Mar 26, 2026
6b6abc8
cpufreq/amd-pstate: Fix a regression leading to EPP 0 after resume
superm1 Aug 26, 2025
a93242d
cpufreq/amd-pstate: Fix a regression leading to EPP 0 after hibernate
superm1 Sep 23, 2025
ba11f5d
amd-pstate: Add sysfs support for floor_freq and floor_count
gautshen Mar 26, 2026
2f38738
amd-pstate: Introduce a tracepoint trace_amd_pstate_cppc_req2()
gautshen Mar 26, 2026
584e8ac
amd-pstate-ut: Add module parameter to select testcases
gautshen Mar 26, 2026
0b96702
amd-pstate-ut: Add a testcase to validate the visibility of driver at…
gautshen Mar 26, 2026
ebe0684
Documentation/amd-pstate: List amd_pstate_hw_prefcore sysfs file
gautshen Mar 26, 2026
0dfc2a4
Documentation/amd-pstate: List amd_pstate_prefcore_ranking sysfs file
gautshen Mar 26, 2026
ccba5af
Documentation/amd-pstate: Add documentation for amd_pstate_floor_{fre…
gautshen Mar 26, 2026
9eb1fe5
cpufreq/amd-pstate: Cache the max frequency in cpudata
superm1 Mar 26, 2026
4aa5436
Documentation: amd-pstate: fix dead links in the reference section
ninadnaik10 Mar 30, 2026
a6862ec
cpufreq/amd-pstate: Use sysfs_match_string() for epp
superm1 Oct 9, 2025
5be7c53
cpufreq/amd-pstate: Add dynamic energy performance preference
superm1 Mar 29, 2026
33f39be
Documentation: amd-pstate: introduce amd-pstate preferred core
Jan 19, 2024
1412ff4
Documentation: introduce amd-pstate preferrd core mode kernel command…
Jan 19, 2024
0f09e33
cpufreq/amd-pstate: add kernel command line to override dynamic epp
superm1 Mar 29, 2026
b1749b2
cpufreq: Pass the policy to cpufreq_driver->adjust_perf()
kudureranganath Mar 16, 2026
a8cbcb4
cpufreq/amd-pstate: Pass the policy to amd_pstate_update()
kudureranganath Mar 16, 2026
1c4b7b5
cpufreq/amd-pstate: Add static asserts for EPP indices
superm1 Oct 9, 2025
5f8c16d
cpufreq/amd-pstate: Add support for raw EPP writes
superm1 Mar 29, 2026
3e8a5b8
cpufreq/amd-pstate-ut: Add a unit test for raw EPP
superm1 Mar 29, 2026
ac2aba5
MAINTAINERS: amd-pstate: Step down as maintainer, add Prateek as revi…
gautshen Apr 2, 2026
e4e4ee0
cpufreq: intel_pstate: Clear hybrid_max_perf_cpu before driver regist…
rafaeljw Nov 4, 2024
f10f699
ACPI: processor: Move arch_init_invariance_cppc() call later
superm1 Nov 4, 2024
4dc8bf6
cpufreq: intel_pstate: Update asym capacity for CPUs that were offlin…
rafaeljw Nov 4, 2024
41fc5a2
cpufreq: intel_pstate: Rearrange locking in hybrid_init_cpu_capacity_…
rafaeljw Nov 7, 2024
06377ee
cpufreq/amd-pstate: Fix setting of CPPC.min_perf in active mode for p…
gautshen Aug 21, 2025
50dbacf
ACPI: CPPC: Detect preferred core availability on online CPUs
gautshen Nov 7, 2025
39a2c4d
cpufreq: intel_pstate: Enable asym capacity only when CPU SMT is not …
Feb 3, 2026
5bf5977
cpufreq: intel_pstate: Rearrange variable declaration involving __free()
rafaeljw Sep 3, 2025
dd1cfb3
cpufreq: intel_pstate: Fix crash during turbo disable
spandruvada Feb 25, 2026
0c825fe
cpufreq/amd-pstate: Add POWER_SUPPLY select for dynamic EPP
superm1 Apr 7, 2026
fd74d89
cpufreq/amd-pstate: Grab "amd_pstate_driver_lock" when toggling dynam…
kudureranganath May 8, 2026
e7b4344
cpufreq/amd-pstate: Allow writes to dynamic_epp when state isn't modi…
kudureranganath May 8, 2026
0515a7a
cpufreq/amd-pstate: Reorder notifier unregistration and floor perf reset
kudureranganath May 8, 2026
362d5f4
cpufreq/amd-pstate: Use "epp_default_dc" as default when dynamic_epp …
kudureranganath May 8, 2026
cbbd573
cpufreq/amd-pstate-ut: Drop policy reference before driver switch
kudureranganath May 8, 2026
05be594
cpufreq/amd-pstate-ut: Disable dynamic_epp after the mode switch
kudureranganath May 23, 2026
b7d53f5
cpufreq/amd-pstate: drop stale @epp_cached kdoc
zhanxusheng1024-os May 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,18 @@
selects a performance level in this range and appropriate
to the current workload.

amd_prefcore=
[X86]
disable
Disable amd-pstate preferred core.

amd_dynamic_epp=
[X86]
disable
Disable amd-pstate dynamic EPP.
enable
Enable amd-pstate dynamic EPP.

amijoy.map= [HW,JOY] Amiga joystick support
Map of devices attached to JOY0DAT and JOY1DAT
Format: <a>,<b>
Expand Down
149 changes: 140 additions & 9 deletions Documentation/admin-guide/pm/amd-pstate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,12 @@ control its functionality at the system level. They are located in the

root@hr-test1:/home/ray# ls /sys/devices/system/cpu/cpufreq/policy0/*amd*
/sys/devices/system/cpu/cpufreq/policy0/amd_pstate_highest_perf
/sys/devices/system/cpu/cpufreq/policy0/amd_pstate_hw_prefcore
/sys/devices/system/cpu/cpufreq/policy0/amd_pstate_lowest_nonlinear_freq
/sys/devices/system/cpu/cpufreq/policy0/amd_pstate_max_freq
/sys/devices/system/cpu/cpufreq/policy0/amd_pstate_floor_freq
/sys/devices/system/cpu/cpufreq/policy0/amd_pstate_floor_count
/sys/devices/system/cpu/cpufreq/policy0/amd_pstate_prefcore_ranking


``amd_pstate_highest_perf / amd_pstate_max_freq``
Expand All @@ -262,28 +266,93 @@ lowest non-linear performance in `AMD CPPC Performance Capability
<perf_cap_>`_.)
This attribute is read-only.

``amd_pstate_hw_prefcore``

Whether the platform supports the preferred core feature and it has
been enabled. This attribute is read-only. This file is only visible
on platforms which support the preferred core feature.

``amd_pstate_prefcore_ranking``

The performance ranking of the core. This number doesn't have any unit, but
larger numbers are preferred at the time of reading. This can change at
runtime based on platform conditions. This attribute is read-only. This file
is only visible on platforms which support the preferred core feature.

``amd_pstate_floor_freq``

The floor frequency associated with each CPU. Userspace can write any
value between ``cpuinfo_min_freq`` and ``scaling_max_freq`` into this
file. When the system is under power or thermal constraints, the
platform firmware will attempt to throttle the CPU frequency to the
value specified in ``amd_pstate_floor_freq`` before throttling it
further. This allows userspace to specify different floor frequencies
to different CPUs. For optimal results, threads of the same core
should have the same floor frequency value. This file is only visible
on platforms that support the CPPC Performance Priority feature.


``amd_pstate_floor_count``

The number of distinct Floor Performance levels supported by the
platform. For example, if this value is 2, then the number of unique
values obtained from the command ``cat
/sys/devices/system/cpu/cpufreq/policy*/amd_pstate_floor_freq |
sort -n | uniq`` should be at most this number for the behavior
described in ``amd_pstate_floor_freq`` to take effect. A zero value
implies that the platform supports unlimited floor performance levels.
This file is only visible on platforms that support the CPPC
Performance Priority feature.

**Note**: When ``amd_pstate_floor_count`` is non-zero, the frequency to
which the CPU is throttled under power or thermal constraints is
undefined when the number of unique values of ``amd_pstate_floor_freq``
across all CPUs in the system exceeds ``amd_pstate_floor_count``.

``energy_performance_available_preferences``

A list of all the supported EPP preferences that could be used for
``energy_performance_preference`` on this system.
These profiles represent different hints that are provided
to the low-level firmware about the user's desired energy vs efficiency
tradeoff. ``default`` represents the epp value is set by platform
firmware. This attribute is read-only.
firmware. ``custom`` designates that integer values 0-255 may be written
as well. This attribute is read-only.

``energy_performance_preference``

The current energy performance preference can be read from this attribute.
and user can change current preference according to energy or performance needs
Please get all support profiles list from
``energy_performance_available_preferences`` attribute, all the profiles are
integer values defined between 0 to 255 when EPP feature is enabled by platform
firmware, if EPP feature is disabled, driver will ignore the written value
Coarse named profiles are available in the attribute
``energy_performance_available_preferences``.
Users can also write individual integer values between 0 to 255.
When dynamic EPP is enabled, writes to energy_performance_preference are blocked
even when EPP feature is enabled by platform firmware. Lower epp values shift the bias
towards improved performance while a higher epp value shifts the bias towards
power-savings. The exact impact can change from one platform to the other.
If a valid integer was last written, then a number will be returned on future reads.
If a valid string was last written then a string will be returned on future reads.
This attribute is read-write.

Other performance and frequency values can be read back from
``/sys/devices/system/cpu/cpuX/acpi_cppc/``, see :ref:`cppc_sysfs`.

Dynamic energy performance profile
==================================
The amd-pstate driver supports dynamically selecting the energy performance
profile based on whether the machine is running on AC or DC power.

Whether this behavior is enabled by default depends on the kernel
config option `CONFIG_X86_AMD_PSTATE_DYNAMIC_EPP`. This behavior can also be overridden
at runtime by the sysfs file ``/sys/devices/system/cpu/cpufreq/policyX/dynamic_epp``.

When set to enabled, the driver will select a different energy performance
profile when the machine is running on battery or AC power.
When set to disabled, the driver will not change the energy performance profile
based on the power source and will not react to user desired power state.

Attempting to manually write to the ``energy_performance_preference`` sysfs
file will fail when ``dynamic_epp`` is enabled.

``amd-pstate`` vs ``acpi-cpufreq``
======================================
Expand All @@ -300,8 +369,8 @@ platforms. The AMD P-States mechanism is the more performance and energy
efficiency frequency management method on AMD processors.


AMD Pstate Driver Operation Modes
=================================
``amd-pstate`` Driver Operation Modes
======================================

``amd_pstate`` CPPC has 3 operation modes: autonomous (active) mode,
non-autonomous (passive) mode and guided autonomous (guided) mode.
Expand Down Expand Up @@ -353,6 +422,55 @@ is activated. In this mode, driver requests minimum and maximum performance
level and the platform autonomously selects a performance level in this range
and appropriate to the current workload.

``amd-pstate`` Preferred Core
=================================

The core frequency is subjected to the process variation in semiconductors.
Not all cores are able to reach the maximum frequency respecting the
infrastructure limits. Consequently, AMD has redefined the concept of
maximum frequency of a part. This means that a fraction of cores can reach
maximum frequency. To find the best process scheduling policy for a given
scenario, OS needs to know the core ordering informed by the platform through
highest performance capability register of the CPPC interface.

``amd-pstate`` preferred core enables the scheduler to prefer scheduling on
cores that can achieve a higher frequency with lower voltage. The preferred
core rankings can dynamically change based on the workload, platform conditions,
thermals and ageing.

The priority metric will be initialized by the ``amd-pstate`` driver. The ``amd-pstate``
driver will also determine whether or not ``amd-pstate`` preferred core is
supported by the platform.

``amd-pstate`` driver will provide an initial core ordering when the system boots.
The platform uses the CPPC interfaces to communicate the core ranking to the
operating system and scheduler to make sure that OS is choosing the cores
with highest performance firstly for scheduling the process. When ``amd-pstate``
driver receives a message with the highest performance change, it will
update the core ranking and set the cpu's priority.

``amd-pstate`` Preferred Core Switch
=================================
Kernel Parameters
-----------------

``amd-pstate`` peferred core`` has two states: enable and disable.
Enable/disable states can be chosen by different kernel parameters.
Default enable ``amd-pstate`` preferred core.

``amd_prefcore=disable``

For systems that support ``amd-pstate`` preferred core, the core rankings will
always be advertised by the platform. But OS can choose to ignore that via the
kernel parameter ``amd_prefcore=disable``.

``amd_dynamic_epp``

When AMD pstate is in auto mode, dynamic EPP will control whether the kernel
autonomously changes the EPP mode. The default is configured by
``CONFIG_X86_AMD_PSTATE_DYNAMIC_EPP`` but can be explicitly enabled with
``amd_dynamic_epp=enable`` or disabled with ``amd_dynamic_epp=disable``.

User Space Interface in ``sysfs`` - General
===========================================

Expand Down Expand Up @@ -385,6 +503,19 @@ control its functionality at the system level. They are located in the
to the operation mode represented by that string - or to be
unregistered in the "disable" case.

``prefcore``
Preferred core state of the driver: "enabled" or "disabled".

"enabled"
Enable the ``amd-pstate`` preferred core.

"disabled"
Disable the ``amd-pstate`` preferred core


This attribute is read-only to check the state of preferred core set
by the kernel parameter.

``cpupower`` tool support for ``amd-pstate``
===============================================

Expand Down Expand Up @@ -708,13 +839,13 @@ Reference
===========

.. [1] AMD64 Architecture Programmer's Manual Volume 2: System Programming,
https://www.amd.com/system/files/TechDocs/24593.pdf
https://docs.amd.com/v/u/en-US/24593_3.44_APM_Vol2

.. [2] Advanced Configuration and Power Interface Specification,
https://uefi.org/sites/default/files/resources/ACPI_Spec_6_4_Jan22.pdf

.. [3] Processor Programming Reference (PPR) for AMD Family 19h Model 51h, Revision A1 Processors
https://www.amd.com/system/files/TechDocs/56569-A1-PUB.zip
https://docs.amd.com/v/u/en-US/56569-A1-PUB_3.03

.. [4] Linux Kernel Selftests,
https://www.kernel.org/doc/html/latest/dev-tools/kselftest.html
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1050,11 +1050,11 @@ F: drivers/gpu/drm/amd/pm/

AMD PSTATE DRIVER
M: Huang Rui <ray.huang@amd.com>
R: K Prateek Nayak <kprateek.nayak@amd.com>
L: linux-pm@vger.kernel.org
S: Supported
F: Documentation/admin-guide/pm/amd-pstate.rst
F: drivers/cpufreq/amd-pstate*
F: include/linux/amd-pstate.h
F: tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py

AMD PTDMA DRIVER
Expand Down
4 changes: 0 additions & 4 deletions arch/arm64/include/asm/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ void update_freq_counters_refs(void);
#define arch_scale_freq_invariant topology_scale_freq_invariant
#define arch_scale_freq_ref topology_get_freq_ref

#ifdef CONFIG_ACPI_CPPC_LIB
#define arch_init_invariance_cppc topology_init_cpu_capacity_cppc
#endif

/* Replace task scheduler's default cpu-invariant accounting */
#define arch_scale_cpu_capacity topology_get_cpu_scale

Expand Down
4 changes: 3 additions & 1 deletion arch/x86/include/asm/cpufeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@
/* AMD-defined CPU features, CPUID level 0x80000007 (EBX), word 17 */
#define X86_FEATURE_OVERFLOW_RECOV (17*32+ 0) /* "overflow_recov" MCA overflow recovery support */
#define X86_FEATURE_SUCCOR (17*32+ 1) /* "succor" Uncorrectable error containment and recovery */
#define X86_FEATURE_CPPC_PERF_PRIO (17*32+ 2) /* CPPC Floor Perf support */
#define X86_FEATURE_SMCA (17*32+ 3) /* "smca" Scalable MCA */

/* Intel-defined CPU features, CPUID level 0x00000007:0 (EDX), word 18 */
Expand Down Expand Up @@ -475,7 +476,8 @@
#define X86_FEATURE_BHI_CTRL (21*32+ 2) /* BHI_DIS_S HW control available */
#define X86_FEATURE_CLEAR_BHB_HW (21*32+ 3) /* BHI_DIS_S HW control enabled */
#define X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT (21*32+ 4) /* Clear branch history at vmexit using SW loop */
#define X86_FEATURE_INDIRECT_THUNK_ITS (21*32 + 5) /* "" Use thunk for indirect branches in lower half of cacheline */
#define X86_FEATURE_AMD_WORKLOAD_CLASS (21*32 + 7) /* Workload Classification */
#define X86_FEATURE_INDIRECT_THUNK_ITS (21*32 + 9) /* "" Use thunk for indirect branches in lower half of cacheline */

#define X86_FEATURE_TSA_SQ_NO (21*32+11) /* "" AMD CPU not vulnerable to TSA-SQ */
#define X86_FEATURE_TSA_L1_NO (21*32+12) /* "" AMD CPU not vulnerable to TSA-L1 */
Expand Down
25 changes: 17 additions & 8 deletions arch/x86/include/asm/msr-index.h
Original file line number Diff line number Diff line change
Expand Up @@ -705,16 +705,23 @@
#define MSR_AMD_CPPC_CAP2 0xc00102b2
#define MSR_AMD_CPPC_REQ 0xc00102b3
#define MSR_AMD_CPPC_STATUS 0xc00102b4
#define MSR_AMD_CPPC_REQ2 0xc00102b5

#define AMD_CPPC_LOWEST_PERF(x) (((x) >> 0) & 0xff)
#define AMD_CPPC_LOWNONLIN_PERF(x) (((x) >> 8) & 0xff)
#define AMD_CPPC_NOMINAL_PERF(x) (((x) >> 16) & 0xff)
#define AMD_CPPC_HIGHEST_PERF(x) (((x) >> 24) & 0xff)
/* Masks for use with MSR_AMD_CPPC_CAP1 */
#define AMD_CPPC_LOWEST_PERF_MASK GENMASK(7, 0)
#define AMD_CPPC_LOWNONLIN_PERF_MASK GENMASK(15, 8)
#define AMD_CPPC_NOMINAL_PERF_MASK GENMASK(23, 16)
#define AMD_CPPC_HIGHEST_PERF_MASK GENMASK(31, 24)
#define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK_ULL(39, 32)

#define AMD_CPPC_MAX_PERF(x) (((x) & 0xff) << 0)
#define AMD_CPPC_MIN_PERF(x) (((x) & 0xff) << 8)
#define AMD_CPPC_DES_PERF(x) (((x) & 0xff) << 16)
#define AMD_CPPC_ENERGY_PERF_PREF(x) (((x) & 0xff) << 24)
/* Masks for use with MSR_AMD_CPPC_REQ */
#define AMD_CPPC_MAX_PERF_MASK GENMASK(7, 0)
#define AMD_CPPC_MIN_PERF_MASK GENMASK(15, 8)
#define AMD_CPPC_DES_PERF_MASK GENMASK(23, 16)
#define AMD_CPPC_EPP_PERF_MASK GENMASK(31, 24)

/* Masks for use with MSR_AMD_CPPC_REQ2 */
#define AMD_CPPC_FLOOR_PERF_MASK GENMASK(7, 0)

/* AMD Performance Counter Global Status and Control MSRs */
#define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS 0xc0000300
Expand Down Expand Up @@ -821,6 +828,8 @@
#define MSR_K7_HWCR_IRPERF_EN BIT_ULL(MSR_K7_HWCR_IRPERF_EN_BIT)
#define MSR_K7_FID_VID_CTL 0xc0010041
#define MSR_K7_FID_VID_STATUS 0xc0010042
#define MSR_K7_HWCR_CPB_DIS_BIT 25
#define MSR_K7_HWCR_CPB_DIS BIT_ULL(MSR_K7_HWCR_CPB_DIS_BIT)

/* K6 MSRs */
#define MSR_K6_WHCR 0xc0000082
Expand Down
13 changes: 10 additions & 3 deletions arch/x86/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -717,11 +717,18 @@ static inline u32 per_cpu_l2c_id(unsigned int cpu)
}

#ifdef CONFIG_CPU_SUP_AMD
extern u32 amd_get_highest_perf(void);
extern void amd_clear_divider(void);
/*
* Issue a DIV 0/1 insn to clear any division data from previous DIV
* operations.
*/
static __always_inline void amd_clear_divider(void)
{
asm volatile(ALTERNATIVE("", "div %2\n\t", X86_BUG_DIV0)
:: "a" (0), "d" (0), "r" (1));
}

extern void amd_check_microcode(void);
#else
static inline u32 amd_get_highest_perf(void) { return 0; }
static inline void amd_clear_divider(void) { }
static inline void amd_check_microcode(void) { }
#endif
Expand Down
18 changes: 13 additions & 5 deletions arch/x86/include/asm/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,19 +282,27 @@ static inline long arch_scale_freq_capacity(int cpu)
}
#define arch_scale_freq_capacity arch_scale_freq_capacity

bool arch_enable_hybrid_capacity_scale(void);
void arch_set_cpu_capacity(int cpu, unsigned long cap, unsigned long max_cap,
unsigned long cap_freq, unsigned long base_freq);

unsigned long arch_scale_cpu_capacity(int cpu);
#define arch_scale_cpu_capacity arch_scale_cpu_capacity

extern void arch_set_max_freq_ratio(bool turbo_disabled);
extern void freq_invariance_set_perf_ratio(u64 ratio, bool turbo_disabled);
#else
static inline bool arch_enable_hybrid_capacity_scale(void) { return false; }
static inline void arch_set_cpu_capacity(int cpu, unsigned long cap,
unsigned long max_cap,
unsigned long cap_freq,
unsigned long base_freq) { }

static inline void arch_set_max_freq_ratio(bool turbo_disabled) { }
static inline void freq_invariance_set_perf_ratio(u64 ratio, bool turbo_disabled) { }
#endif

extern void arch_scale_freq_tick(void);
#define arch_scale_freq_tick arch_scale_freq_tick

#ifdef CONFIG_ACPI_CPPC_LIB
void init_freq_invariance_cppc(void);
#define arch_init_invariance_cppc init_freq_invariance_cppc
#endif

#endif /* _ASM_X86_TOPOLOGY_H */
Loading