On 2025-03-25 05:57, Jan Beulich wrote:
On 06.03.2025 09:39, Penny Zheng wrote:

+static int cf_check amd_cppc_cpufreq_target(struct cpufreq_policy *policy,
+                                            unsigned int target_freq,
+                                            unsigned int relation)
+{
+    unsigned int cpu = policy->cpu;
+    const struct amd_cppc_drv_data *data = per_cpu(amd_cppc_drv_data, cpu);
+    uint8_t des_perf;
+    int res;
+
+    if ( unlikely(!target_freq) )
+        return 0;

Checking other *_cpufreq_target() functions, none would silently ignore
a zero input. (HWP's ignores the input altogether though; Cc-ing Jason
for possible clarification: I would have expected this driver here and
the HWP one to be similar in this regard.)

Yes, for HWP, the target and relation are ignored. All control is done by writing MSR_HWP_REQUEST which are "continuous, abstract, unit-less performance scale" values. Those are applied by set_hwp_para() from `xenpm set-cpufreq-cppc`.

I think the difference is that this CPPC driver supports both autonomous and active mode. The HWP driver I wrote only supports the equivalent of autonomous mode - write the MSR and let the processor figure it out.

I think Penny's implementation also uses the existing governors, whereas HWP only uses the dedicated hwp_governor.

Hopefully that gives some context.

Regards,
Jason

Reply via email to