Re: "Force HWP min perf before offline" triggers unchecked MSR access errors

From: Srinivas Pandruvada
Date: Tue Oct 29 2019 - 18:15:19 EST


On Tue, 2019-10-29 at 15:13 -0700, Srinivas Pandruvada wrote:
> On Tue, 2019-10-29 at 18:01 -0400, Qian Cai wrote:
> > > On Oct 29, 2019, at 5:47 PM, Rafael J. Wysocki <rafael@xxxxxxxxxx
> > > >
> > > wrote:
> > >
> > > The MSR_IA32_ENERGY_PERF_BIAS MSR appears to be not present,
> > > which
> > > should be caught by the X86_FEATURE_EPB check in
> > > intel_pstate_set_epb().
> > >
> > > Do you run this in a guest perchance?
> >
> > No, it is a baremetal HPE server. The dmesg does say something like
> > energy perf bias changed from performance to normal, and the
> > cpuflag
> > contains epb which I thought that would pass the feature check? I
> > could upload the whole dmesg a bit later if that helps.
>
> Try the attached change. You have a Skylake server with no EPP
> support.
> This is odd.
>
Sorry.
Ignore the previous one. It had some unrelated change.

> Thanks,
> Srinivas
>
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 9f02de9a1b47..eab8b048dc9f 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -851,7 +851,7 @@ static void intel_pstate_hwp_force_min_perf(int cpu)
if (boot_cpu_has(X86_FEATURE_HWP_EPP))
value |= HWP_ENERGY_PERF_PREFERENCE(HWP_EPP_POWERSAVE);
else
- intel_pstate_set_epb(cpu, HWP_EPP_BALANCE_POWERSAVE);
+ intel_pstate_set_epb(cpu, 0x0F);

wrmsrl_on_cpu(cpu, MSR_HWP_REQUEST, value);
}