@@ -158,7 +158,7 @@ static int __init dmi_matched_7k62_bios_bug(const struct dmi_system_id *dmi)
158
158
* broken BIOS lack of nominal_freq and lowest_freq capabilities
159
159
* definition in ACPI tables
160
160
*/
161
- if (boot_cpu_has (X86_FEATURE_ZEN2 )) {
161
+ if (cpu_feature_enabled (X86_FEATURE_ZEN2 )) {
162
162
quirks = dmi -> driver_data ;
163
163
pr_info ("Overriding nominal and lowest frequencies for %s\n" , dmi -> ident );
164
164
return 1 ;
@@ -200,7 +200,7 @@ static s16 amd_pstate_get_epp(struct amd_cpudata *cpudata, u64 cppc_req_cached)
200
200
u64 epp ;
201
201
int ret ;
202
202
203
- if (boot_cpu_has (X86_FEATURE_CPPC )) {
203
+ if (cpu_feature_enabled (X86_FEATURE_CPPC )) {
204
204
if (!cppc_req_cached ) {
205
205
epp = rdmsrl_on_cpu (cpudata -> cpu , MSR_AMD_CPPC_REQ ,
206
206
& cppc_req_cached );
@@ -253,7 +253,7 @@ static int amd_pstate_set_epp(struct amd_cpudata *cpudata, u32 epp)
253
253
int ret ;
254
254
struct cppc_perf_ctrls perf_ctrls ;
255
255
256
- if (boot_cpu_has (X86_FEATURE_CPPC )) {
256
+ if (cpu_feature_enabled (X86_FEATURE_CPPC )) {
257
257
u64 value = READ_ONCE (cpudata -> cppc_req_cached );
258
258
259
259
value &= ~GENMASK_ULL (31 , 24 );
@@ -752,7 +752,7 @@ static int amd_pstate_get_highest_perf(int cpu, u32 *highest_perf)
752
752
{
753
753
int ret ;
754
754
755
- if (boot_cpu_has (X86_FEATURE_CPPC )) {
755
+ if (cpu_feature_enabled (X86_FEATURE_CPPC )) {
756
756
u64 cap1 ;
757
757
758
758
ret = rdmsrl_safe_on_cpu (cpu , MSR_AMD_CPPC_CAP1 , & cap1 );
@@ -991,7 +991,7 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy)
991
991
/* It will be updated by governor */
992
992
policy -> cur = policy -> cpuinfo .min_freq ;
993
993
994
- if (boot_cpu_has (X86_FEATURE_CPPC ))
994
+ if (cpu_feature_enabled (X86_FEATURE_CPPC ))
995
995
policy -> fast_switch_possible = true;
996
996
997
997
ret = freq_qos_add_request (& policy -> constraints , & cpudata -> req [0 ],
@@ -1224,7 +1224,7 @@ static int amd_pstate_change_mode_without_dvr_change(int mode)
1224
1224
1225
1225
cppc_state = mode ;
1226
1226
1227
- if (boot_cpu_has (X86_FEATURE_CPPC ) || cppc_state == AMD_PSTATE_ACTIVE )
1227
+ if (cpu_feature_enabled (X86_FEATURE_CPPC ) || cppc_state == AMD_PSTATE_ACTIVE )
1228
1228
return 0 ;
1229
1229
1230
1230
for_each_present_cpu (cpu ) {
@@ -1453,7 +1453,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
1453
1453
else
1454
1454
policy -> policy = CPUFREQ_POLICY_POWERSAVE ;
1455
1455
1456
- if (boot_cpu_has (X86_FEATURE_CPPC )) {
1456
+ if (cpu_feature_enabled (X86_FEATURE_CPPC )) {
1457
1457
ret = rdmsrl_on_cpu (cpudata -> cpu , MSR_AMD_CPPC_REQ , & value );
1458
1458
if (ret )
1459
1459
return ret ;
@@ -1543,7 +1543,7 @@ static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
1543
1543
epp = 0 ;
1544
1544
1545
1545
/* Set initial EPP value */
1546
- if (boot_cpu_has (X86_FEATURE_CPPC )) {
1546
+ if (cpu_feature_enabled (X86_FEATURE_CPPC )) {
1547
1547
value &= ~GENMASK_ULL (31 , 24 );
1548
1548
value |= (u64 )epp << 24 ;
1549
1549
}
@@ -1582,7 +1582,7 @@ static void amd_pstate_epp_reenable(struct amd_cpudata *cpudata)
1582
1582
value = READ_ONCE (cpudata -> cppc_req_cached );
1583
1583
max_perf = READ_ONCE (cpudata -> highest_perf );
1584
1584
1585
- if (boot_cpu_has (X86_FEATURE_CPPC )) {
1585
+ if (cpu_feature_enabled (X86_FEATURE_CPPC )) {
1586
1586
wrmsrl_on_cpu (cpudata -> cpu , MSR_AMD_CPPC_REQ , value );
1587
1587
} else {
1588
1588
perf_ctrls .max_perf = max_perf ;
@@ -1616,7 +1616,7 @@ static void amd_pstate_epp_offline(struct cpufreq_policy *policy)
1616
1616
value = READ_ONCE (cpudata -> cppc_req_cached );
1617
1617
1618
1618
mutex_lock (& amd_pstate_limits_lock );
1619
- if (boot_cpu_has (X86_FEATURE_CPPC )) {
1619
+ if (cpu_feature_enabled (X86_FEATURE_CPPC )) {
1620
1620
cpudata -> epp_policy = CPUFREQ_POLICY_UNKNOWN ;
1621
1621
1622
1622
/* Set max perf same as min perf */
@@ -1819,7 +1819,7 @@ static int __init amd_pstate_init(void)
1819
1819
*/
1820
1820
if (amd_pstate_acpi_pm_profile_undefined () ||
1821
1821
amd_pstate_acpi_pm_profile_server () ||
1822
- !boot_cpu_has (X86_FEATURE_CPPC )) {
1822
+ !cpu_feature_enabled (X86_FEATURE_CPPC )) {
1823
1823
pr_info ("driver load is disabled, boot with specific mode to enable this\n" );
1824
1824
return - ENODEV ;
1825
1825
}
@@ -1838,7 +1838,7 @@ static int __init amd_pstate_init(void)
1838
1838
}
1839
1839
1840
1840
/* capability check */
1841
- if (boot_cpu_has (X86_FEATURE_CPPC )) {
1841
+ if (cpu_feature_enabled (X86_FEATURE_CPPC )) {
1842
1842
pr_debug ("AMD CPPC MSR based functionality is supported\n" );
1843
1843
if (cppc_state != AMD_PSTATE_ACTIVE )
1844
1844
current_pstate_driver -> adjust_perf = amd_pstate_adjust_perf ;
0 commit comments