Skip to content

RFC Intel Hardware P-States (HWP) support

Jason Andryuk xen-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest12 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12cpufreq: Allow restricting to internal governors onlyxen/drivers/cpufreq/cpufreq.c xen/include/acpi/cpufreq/cpufreq.h+5 -00 replies
2/12cpufreq: Add perf_freq to cpuinfoxen/arch/x86/acpi/cpufreq/cpufreq.c xen/drivers/cpufreq/utility.c xen/include/acpi/cpufreq/cpufreq.h+5 -10 replies
3/12cpufreq: Export intel_feature_detectxen/arch/x86/acpi/cpufreq/cpufreq.c xen/include/acpi/cpufreq/processor_perf.h+4 -20 replies
4/12cpufreq: Add Hardware P-State (HWP) driverdocs/misc/xen-command-line.pandoc xen/arch/x86/acpi/cpufreq/Makefile xen/arch/x86/acpi/cpufreq/cpufreq.c +4 more+583 -40 replies
5/12xenpm: Change get-cpufreq-para output for internaltools/misc/xenpm.c+29 -160 replies
6/12cpufreq: Export HWP parameters to userspacexen/arch/x86/acpi/cpufreq/hwp.c xen/drivers/acpi/pmstat.c xen/include/acpi/cpufreq/cpufreq.h +1 more+52 -10 replies
7/12libxc: Include hwp_para in definitionstools/include/xenctrl.h+2 -00 replies
8/12xenpm: Print HWP parameterstools/misc/xenpm.c+73 -20 replies
9/12xenpm: Factor out a non-fatal cpuid_parse varianttools/misc/xenpm.c+14 -50 replies
10/12xen: Add SET_CPUFREQ_HWP xen_sysctl_pm_opxen/arch/x86/acpi/cpufreq/hwp.c xen/drivers/acpi/pmstat.c xen/include/acpi/cpufreq/cpufreq.h +1 more+171 -00 replies
11/12libxc: Add xc_set_cpufreq_hwptools/include/xenctrl.h tools/libs/ctrl/xc_pm.c+22 -00 replies
12/12xenpm: Add set-cpufreq-hwp subcommandtools/misc/xenpm.c xen/arch/x86/acpi/cpufreq/hwp.c+241 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 00/12] Intel Hardware P-States (HWP) support

Hi,

This patch series adds Hardware-Controlled Performance States (HWP) for Intel processors to Xen.

With HWP, the processor makes its own determinations for frequency selection depending, though users can set some parameters and preferences. There is also Turbo Boost which pushes the max frequency if possible.

The existing governors don't work with HWP since they select frequencies and HWP doesn't expose those. Therefore a dummy hwp-interal governor is used that doesn't do anything.

xenpm get-cpufreq-para is extended to show HWP parameters, and set-cpufreq-hwp is added to set them.

A lightly loaded OpenXT laptop showed ~1W power savings according to powertop. A mostly idle Fedora system (dom0 only) showed a more modest power savings.

This fir for a 10th gen 6-core 1600 MHz base 4900 MHZ max cpu. In the default balance mode, Turbo Boost doesn't exceed 4GHz. Tweaking the energy_perf preference with xenpm set-cpufreq-hwp balance ene:64, I've seen the CPU hit 4.7GHz before throttling down and bouncing around between 4.3 and 4.5 GHz. Curiously the other cores read ~4GHz when turbo boost takes affect. This was done after pinning all dom0 cores, and using taskset to pin to vCPU/pCPU 11 and running a bash tightloop.

RFC since there are a few open questions:

hwp defaults to enabled and running in balanced mode. Maybe this wants changing?

This series unilaterally enables Hardware Duty Cycling (HDC) which is another feature to autonomously powerdown things. That is enabled if HWP is enabled. Maybe that want to be configurable?

I've only tested on an 8th gen and a 10th gen systems. The don't have fast MSR support, and they do have activity window and energy_perf support. So the respective other modes are untested.

This changes the systcl_pm_op hypercall, so that wants review.

I wanted to get this out since I know Qubes is also interested.

Regards,
Jason

Jason Andryuk (12):
cpufreq: Allow restricting to internal governors only
cpufreq: Add perf_freq to cpuinfo
cpufreq: Export intel_feature_detect
cpufreq: Add Hardware P-State (HWP) driver
xenpm: Change get-cpufreq-para output for internal
cpufreq: Export HWP parameters to userspace
libxc: Include hwp_para in definitions
xenpm: Print HWP parameters
xenpm: Factor out a non-fatal cpuid_parse variant
xen: Add SET_CPUFREQ_HWP xen_sysctl_pm_op
libxc: Add xc_set_cpufreq_hwp
xenpm: Add set-cpufreq-hwp subcommand

 docs/misc/xen-command-line.pandoc         |   9 +
 tools/include/xenctrl.h                   |   6 +
 tools/libs/ctrl/xc_pm.c                   |  18 +
 tools/misc/xenpm.c                        | 375 +++++++++++-
 xen/arch/x86/acpi/cpufreq/Makefile        |   1 +
 xen/arch/x86/acpi/cpufreq/cpufreq.c       |  15 +-
 xen/arch/x86/acpi/cpufreq/hwp.c           | 671 ++++++++++++++++++++++
 xen/drivers/acpi/pmstat.c                 |  30 +
 xen/drivers/cpufreq/cpufreq.c             |   4 +
 xen/drivers/cpufreq/utility.c             |   1 +
 xen/include/acpi/cpufreq/cpufreq.h        |   9 +
 xen/include/acpi/cpufreq/processor_perf.h |   5 +
 xen/include/asm-x86/cpufeature.h          |  11 +-
 xen/include/asm-x86/msr-index.h           |  21 +
 xen/include/public/sysctl.h               |  52 +-
 15 files changed, 1199 insertions(+), 29 deletions(-)
 create mode 100644 xen/arch/x86/acpi/cpufreq/hwp.c
Signature · 1 line
2.29.2