Re: [PATCH 2/2] cpufreq: intel_pstate: Support highest performance change interrupt

From: Borislav Petkov
Date: Tue Jun 18 2024 - 06:50:08 EST


On Mon, Jun 17, 2024 at 08:51:21PM -0700, Srinivas Pandruvada wrote:
> + status_mask = HWP_GUARANTEED_PERF_CHANGE_STATUS;
> + if (boot_cpu_has(X86_FEATURE_HWP_HIGHEST_PERF_CHANGE))

s/boot_cpu_has/cpu_feature_enabled/g

> + status_mask |= HWP_HIGHEST_PERF_CHANGE_STATUS;
> +
> rdmsrl_safe(MSR_HWP_STATUS, &value);
> - if (!(value & 0x01))
> + if (!(value & status_mask))
> return;
>
> spin_lock_irqsave(&hwp_notify_lock, flags);
> @@ -1668,17 +1675,25 @@ static void intel_pstate_disable_hwp_interrupt(struct cpudata *cpudata)
> cancel_delayed_work_sync(&cpudata->hwp_notify_work);
> }
>
> +#define HWP_GUARANTEED_PERF_CHANGE_REQ BIT(0)
> +#define HWP_HIGHEST_PERF_CHANGE_REQ BIT(2)
> +
> static void intel_pstate_enable_hwp_interrupt(struct cpudata *cpudata)
> {
> - /* Enable HWP notification interrupt for guaranteed performance change */
> + /* Enable HWP notification interrupt for performance change */
> if (boot_cpu_has(X86_FEATURE_HWP_NOTIFY)) {
> + u64 interrupt_mask = HWP_GUARANTEED_PERF_CHANGE_REQ;
> +
> spin_lock_irq(&hwp_notify_lock);
> INIT_DELAYED_WORK(&cpudata->hwp_notify_work, intel_pstate_notify_work);
> cpumask_set_cpu(cpudata->cpu, &hwp_intr_enable_mask);
> spin_unlock_irq(&hwp_notify_lock);
>
> + if (boot_cpu_has(X86_FEATURE_HWP_HIGHEST_PERF_CHANGE))a

Ditto.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette