MacBook9,1 will be the first Mac ever to support HWP

I have updated my freqVectorsEdit.sh script and version 2.0 of it now also dumps the HWP and EPP settings:

MacBook9,1_HWP_EPP

HWP is short for HardWare-controlled Performance states (like legacy ACPI P-States) and EPP is short for Energy Performance Preference. The latter will replace read/writes from/to the perf-bias (IA32_ENERGY_PERF_BIAS MSR 0x1b0) on compatible hardware. HWP is supported on Intel® Broadwell and Skylake processors, though Intel® Speed Shift Technology is only supported by Skylake processors and El Capitan (OS X 10.11). Sure. Windows 10 also supports Intel® Speed Shift Technology, and even earlier than OS X, but I usually only blog about Mac’s and OS X.

The above screen dump shows us that the MacBook9,1 will have HWP enabled (set to 1) and that EPP is set to 146. The default setting is 128 (0x80) and it can go up to 255 (0xff). The higher the value, the more power friendly it will run. A lower value (0 to 128) will give more performance, at the cost of battery life.

In short. The yet to be released MacBook9,1 will be the first Mac ever to support Intel® HWP and that is good news, as it should run longer without AC power, and feels snappier with up to 45% improved responsiveness on a Intel® i5-6200U processor.

You can read more about HWP in the Intel® 64 and IA-32 Architectures Software Developer’s Manual.

Edit: Intel® Hardware Duty Cycling (HDC) may also be used, on certain (low power) processors, but I did not check the kernel code to see if that will be used. Will check that shortly.

Edit-2: I also found a reference in the kernel of El Capitan to HWP:

ffffff8000af7d44 S _xcpm_hwp_enabled
ffffff8000af7d48 S _xcpm_hwp_idle_epp
ffffff80003f5fd0 T _xcpm_is_hwp_enabled
ffffff80003f5100 T _xcpm_hwp_enable

Like I said I before. I checked the kernel of 10.11.4 but now I also checked the kernel of the 10.11.5 beta and found this:

_xcpm_hwp_enable:
ffffff80003f52f0	pushq	%rbp
ffffff80003f52f1	movq	%rsp, %rbp
ffffff80003f52f4	movl	$0x1aa, %ecx
ffffff80003f52f9	rdmsr
ffffff80003f52fb	movl	%edx, %edx
ffffff80003f52fd	movl	%eax, %eax
ffffff80003f52ff	orq	$0x40, %rax
ffffff80003f5303	movl	$0x1aa, %ecx
ffffff80003f5308	wrmsr
ffffff80003f530a	movl	$0x770, %ecx // IA32_PM_ENABLE
ffffff80003f530f	movl	$0x1, %eax
ffffff80003f5314	xorl	%edx, %edx
ffffff80003f5316	wrmsr
ffffff80003f5318	popq	%rbp
ffffff80003f5319	retq
ffffff80003f531a	nopw	(%rax,%rax)

The above piece of code enables HWP, but it isn’t called anywhere. Not yet. There is also code that reads a variable, to see if HWP is enabled:

_xcpm_is_hwp_enabled:
ffffff80003f61c0	pushq	%rbp
ffffff80003f61c1	movq	%rsp, %rbp
ffffff80003f61c4	movl	0x701b7a(%rip), %eax
ffffff80003f61ca	popq	%rbp
ffffff80003f61cb	retq
ffffff80003f61cc	nopl	(%rax)

Next to the warning that once HWP is enabled, that you cannot disable it. Duh!

I also found four wrmsr() calls to IA32_HWP_REQUEST and that conveys OSPM’s control hints – Min, Max, Activity Window, Energy Performance Preference, Desired – for a single logical processor.

And after I enable it myself, from AppleIntelInfo.kext, then I see that power management is working. Even with EIST fully disabled in the BIOS. Even when I use -xcpm_ignore_fv to ignore the FrequencyVectors (see also Xnu CPU Power Management). Oh and I did add the hwp and eep settings to the FrequencyVectors myself.

Skylake iMac17,1 HWP i7-6700

Edit: With Turbo disabled in the BIOS it still reaches all turbo frequencies.

7 thoughts on “MacBook9,1 will be the first Mac ever to support HWP

  1. Pingback: Nei nuovi MacBook 12" arriva Speed Shift, i processori auto-regoleranno la velocità - macitynet.it

  2. Pingback: Accu-optimalisaties in volgende MacBook | Appleweetjes

  3. Pingback: Sui prossimi MacBook arriverà lo Speed Shift di Intel? - SlideToMac Blog

  4. Pingback: Zo kan Speed Shift toekomstige MacBooks sneller maken

  5. Pingback: Le MacBook 2016 se dévoile un peu plus

  6. hi Pike

    I have been running El Capitan on i5 6200U without AICPUPM and SSDT (from your script).
    Still the CPU works nicely with good steps.

    However I have a feeling that El Capitan lacks the Speed Shift support because the clock never falls below 1 GHz even at complete idle with NO apps running.

    By the way I am running with SMBIOS MacBook9,1 with Core m3 serial (If that makes a difference).

    I have all possible parameters in config.plist to put that clock below 1 GHz but no use. Patching the kernel also doesn’t make a difference.

    I hope macOS Sierra will have builtin Speed Shift support.

    Cheers

    • Hi Mikael,

      Have you seen MacBook9,1 will be the first Mac ever to support HWP?

      As in. Speed Shift is supported by your Skylake processor and El Capitan (plus Sierra).

      You can change the value of epp in the FrequencyVectors to get a more power friendly profile – set to 146 by default (if Apple didn’t change it later on).

      More important is the fact that the clock frequency of your processor (2300 MHz) doesn’t match with the frequencies in the plist. You need to change 2200 to 2300 or add one that matches.

Leave a comment