P8P67-M PRO and El Capitan

I know someone with a small PC budget and he (11 year old youngster) is still using an old Asus P8P67-M PRO motherboard with Intel i7-2600K processor. Works fine with Yosemite, but he would love to use El Capitan so now I am looking for someone with the same kind of hardware…

Do you happen to have El Capitan running with this motherboard? A different processor is fine. He only struggles with the USB part of the installation, and I don’t have a lot of time to help him with this so if you could share the required patches/drivers, then that would be great.

Thanks!

MacBook9,1 serials

I don’t have a lot of time to write something about it, but someone asked for it so here it is:

GTHV – MacBook (Retina, 12-inch, Early 2016)
GTHT – MacBook (Retina, 12-inch, Early 2016)
GTHY – MacBook (Retina, 12-inch, Early 2016)
GTHW – MacBook (Retina, 12-inch, Early 2016)
GTHX – MacBook (Retina, 12-inch, Early 2016)
GTHR – MacBook (Retina, 12-inch, Early 2016)
GTGW – MacBook (Retina, 12-inch, Early 2016)
GTJ0 – MacBook (Retina, 12-inch, Early 2016)
GTJ1 – MacBook (Retina, 12-inch, Early 2016)
GTJ2 – MacBook (Retina, 12-inch, Early 2016)
GTJ3 – MacBook (Retina, 12-inch, Early 2016)
GTJ4 – MacBook (Retina, 12-inch, Early 2016)
GTJ6 – MacBook (Retina, 12-inch, Early 2016)
GTJ7 – MacBook (Retina, 12-inch, Early 2016)
GTJ8 – MacBook (Retina, 12-inch, Early 2016)
GTJ9 – MacBook (Retina, 12-inch, Early 2016)
GTJC – MacBook (Retina, 12-inch, Early 2016)
GTJD – MacBook (Retina, 12-inch, Early 2016)

And there she was… with a bang.

And there she was… with a bang.

I was just on my way to Amsterdam – mid air – as you came into our world. Sightly premature. Still a bit of a surprise, but we are delighted to see you as you are. So beautiful. Your mother did a fantastic job, and your father could not be happier so welcome in our family, little girl.

I can’t wait to bring you home. In our new house, which by the way won’t be finished by the time you two get there, but at least we will have some privacy when we plunge in our pool.

Time for mom and dad to decide what your name will be, but first I need to get back home and hold you, and mom, in my arms…

Call for help for Skylake Power Management

You want Power Management (HWP/Speed Shift) on your Skylake to work?

Then please download/run debugMachKernel.sh after that you should boot with the -cpuid msgbuf=309212 arguments and enter the following command in a terminal window:

cat /var/log/system.log | grep 'cpuid_fn(0x00000006) eax:'

The result that I get here with a Intel i7-6700 is this:

cpuid_fn(0x00000006) eax:0x000007f7 ebx:0x00000002 ecx:0x00000009 edx:0x00000000

If CPUID.06H:EAX[bit 7] is set, then HWP provides several new architectural MSR’s: IA32_PM_ENABLE, IA32_HWP_CAPABILITIES, IA32_HWP_REQUEST and IA32_HWP_STATUS.

If CPUID.06H:EAX[bit 8] is set, then HWP provides IA32_HWP_INTERRUPT MSR to enable interrupt generation due to dynamic Performance changes and excursions.

If CPUID.06H:EAX[bit 9] is set, then HWP allows software to program the activity window in the IA32_HWP_REQUEST MSR.

If CPUID.06H:EAX[bit 10] is set, then HWP allows software to set an energy/performance preference hint in the IA32_HWP_REQUEST MSR. For the yet to be released MacBook9,1 this is set to 146. The default is 128.

If CPUID.06H:EAX[bit 11] is set, then HWP provides the IA32_HWP_REQUEST_PKG MSR to convey OS Power Management’s control hints for all logical processors in the physical package.

If CPUID.06H:EAX[bit 13] is set, then Hardware Duty Cycling is supported and the HDC base registers IA32_PKG_HDC_CTL, IA32_PM_CTL1, IA32_THREAD_STALL MSRs are supported. The primary use of HDC is to enable system software to manage low active workloads, to increase the package level C6 residency. Additionally, HDC can lower the effective average frequency in case or power or thermal limitation.

Edit: Here is the output of a next version of AppleIntelInfo.kext

Skylake iMac17,1 HWP i7-6700

One thing people definitely will have to get used to is the fact that the Most Efficient Performance is dynamically adjusted, and so far I have seen 1200, 1400, 1500 and 1600 MHz, yet CPUFloor is set to 800 MHz. And so is LFM.

And when I change the Energy Performance Preference to a lower or higher value, then I can immediately see the effect of it in the Intel Power Gadget.

Let me know what value you get. Thanks!

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.

nm -s broken in Xcode 7.3

I received an e-mail from someone – a couple already – who told me that some of my scripts are broken. Specifically scripts like debugMachKernel.sh that use nm. It appears that Xcode 7.3 (7D175) no longer supports the -s argument. Or not like it did before:

nm -x -Ps __TEXT __text -arch x86_64 /System/Library/Kernels/kernel

Right. That no longer works, and dumps this error message:

../nm: for the -s option: bad number of arguments (must be two arguments).

Removing the -s __TEXT __text part works:

nm -Px -arch x86_64 /System/Library/Kernels/kernel

And running it like that will only take a few milliseconds longer. Anyway. For the few that ran into this, and were too lazy to report the error… now you know how to work around this bug.

Update: I worked around this problem by moving the -s __TEXT __text arguments to after the filename.

nm -Px -arch x86_64 /System/Library/Kernels/kernel -s __TEXT __text

New version of AppleIntelInfo.kext with Skylake support

Two days ago I blogged about OS X 10.11.4 Build 15E65 and Skylake graphics support and the problem I was having with the output of the Intel® Power Gadget (see below)
IGPUFreqError
Note: The 3.3GHz should have been 1.1GHz.

A day later Patrick Konsor (Intel® rep) added a comment about a new version of the Intel® Power Gadget:

Just a note about Intel® Power Gadget, that version had an issue that reported GPU frequency 3x of the actual value (which was due to a change in the frequency multiplier). So 3.3 GHz really means 1.1 GHz. You can get the updated version with proper support for Skylake here

Thank you Patrick. And I have good news, because I can confirm that the latest version of the Intel® Power Gadget works with my Skylake processor (Intel® i7-6700) and his comment also made me aware of a problem in AppleIntelInfo.kext. Thanks for that. Already fixed and thus the new source code is now available for download.

Oh and previously I had this as output (example):

iGPU P-States [ 2 5 (6) 21 24 27 30 ]

And now this:

iGPU P-States [ 2 7 8 9 10 12 13 14 16 17 20 22 (23) ]

The output is backwards compatible with previous Intel® processors. Meaning that you should read the output as: 23 * 50 MHz = 1150MHz (for example). Which happens to represent the maximum frequency of the IGPU in my Intel i7-6700, so this output is now correct. I still wonder, though, why I see values below 350MHz (7 * 50).

Update: The source code of AppleIntelInfo.kext (version 1.5) is now available for download. This update will properly select Skylake processors, but we appear to have some issue with regards to the graphics configuration register output (they are all 0xffffffff) and that is not good. This may be due to SIP settings/changes, or we may have some error in the MMIO read function. Please test this for me, and if you can help me to fix this, then that would be great (swamped with other work already). Thanks!

Edit: It appears that the output is fine on Haswell based setups with El Capitan so this is something that came with the introduction of Skylake processors. The IOBAR is also enabled so that is not the problem.