[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] cpufreq/amd-cppc: move epp_init into driver data



commit b8e26d974784a56bb5b438b43017ebe99e8abb13
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Jan 27 10:28:09 2026 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Jan 27 10:28:09 2026 +0100

    cpufreq/amd-cppc: move epp_init into driver data
    
    No reason for it to be a separate per-CPU item; it's connected to a
    struct cpufreq_policy instance just like other driver data.
    
    This further reduces the concern over amd_cppc_cpufreq_cpu_init() being
    called for all CPUs, or a CPU going offline that's recorded in policy->cpu
    (which would result in accesses of per-CPU data of offline CPUs).
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Penny Zheng <penny.zheng@xxxxxxx>
---
 xen/arch/x86/acpi/cpufreq/amd-cppc.c | 7 +++----
 xen/include/acpi/cpufreq/cpufreq.h   | 2 ++
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/amd-cppc.c 
b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
index 4f16045a1c..c034d84767 100644
--- a/xen/arch/x86/acpi/cpufreq/amd-cppc.c
+++ b/xen/arch/x86/acpi/cpufreq/amd-cppc.c
@@ -35,7 +35,6 @@
  * for freq-to-perf transition
  */
 static DEFINE_PER_CPU_READ_MOSTLY(unsigned int, pxfreq_mhz);
-static DEFINE_PER_CPU_READ_MOSTLY(uint8_t, epp_init);
 #ifndef NDEBUG
 static bool __ro_after_init opt_active_mode;
 #else
@@ -248,7 +247,7 @@ static int cf_check amd_cppc_cpufreq_target(struct 
cpufreq_policy *policy,
     amd_cppc_write_request(policy, data->caps.lowest_nonlinear_perf,
                            des_perf, data->caps.highest_perf,
                            /* Pre-defined BIOS value for passive mode */
-                           per_cpu(epp_init, policy->cpu));
+                           data->epp_init);
     return 0;
 }
 
@@ -326,7 +325,7 @@ static void cf_check amd_cppc_init_msrs(void *info)
 
     /* Store pre-defined BIOS value for passive mode */
     rdmsrl(MSR_AMD_CPPC_REQ, val);
-    this_cpu(epp_init) = MASK_EXTR(val, AMD_CPPC_EPP_MASK);
+    data->epp_init = MASK_EXTR(val, AMD_CPPC_EPP_MASK);
 
     return;
 
@@ -465,7 +464,7 @@ static void amd_cppc_prepare_policy(struct cpufreq_policy 
*policy,
         break;
 
     default:
-        *epp = per_cpu(epp_init, policy->cpu);
+        *epp = data->epp_init;
         break;
     }
 }
diff --git a/xen/include/acpi/cpufreq/cpufreq.h 
b/xen/include/acpi/cpufreq/cpufreq.h
index 479cf19b6a..5c39d38c79 100644
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -143,6 +143,8 @@ struct amd_cppc_drv_data {
         };
     } req;
 
+    uint8_t epp_init;
+
     int err;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.