macOS Sierra 10.12.4 Build 16E175b seeded…

Apple today seeded the fourth beta of an upcoming macOS Sierra 10.12.4 update to developers. Their latest build is 16E175b.

The first thing I spotted was that two of the three new plists, added in Build 16E144f for Kaby Lake processors, will be removed by an installation script:

./S*/L*/Extensions/IOPlatformPluginFamily.kext/C*/P*/X86PlatformPlugin.kext/C*/R*/Mac-CAD6701F7CEA0921.plist
./S*/L*/Extensions/IOPlatformPluginFamily.kext/C*/P*/X86PlatformPlugin.kext/C*/R*/Mac-B4831CEBD52A0C4C.plist

Source: Tools/cleanListSUConstructed (paths shortened).

The third one is still there:

Mac-551B86E5744E2388.plist

Another thing is that /S*/L*/Extensions/eficheck.kext is being removed. Along with all the whitelists at: /usr/libexec/firmwarecheckers/eficheck/whitelists/

The NVRAM variable SkipBluetoothAutomaticFirmwareUpdate is now also removed.

Looks like Apple is preparing for a release…

AppleIntelInfo.kext v2.4

The last time I blogged about an update of AppleIntelInfo.kext was on 14 September 2016 but I haven’t been sitting still and thus you most likely missed a lot of updates. Time for a new blog post. This time we’re at AppleIntelInfo.kext v2.4 and this version is much better. Sorry for all the delays, folks, but such is life.

Anyway. I have compiled it on OS X 10.9.5 with Xcode 6. This to verify that it works with older versions of OS X. And it works fine here with a Intel i5-2500K and Intel i7-2600K on two different motherboards. In short. The long standing bug – Sandy Bridge incompatibility – should now be fixed. At last.

I also compiled it on macOS Sierra 10.12.4 (build 16E163f) with Xcode Version 8.2.1 (8C1002) and there all is fine as well with the Intel i7-6700.

Please note that there may still be incompatibility issues with older processors. In case you do run into a crash, after you have tried to load the kext from a terminal prompt, then start looking for unsupported MSR’s. The easiest thing is to set REPORT_MSRS to 0 (zero) and subsequent MSR routines to locate the spot that is causing you trouble. After that Github issues is your best hope for help.

I hope that you enjoy this update 😉

Update: I made a mistake. Forgot to copy two new lines. Fixed with my latest commit. Thanks to telepati for spotting the error.

Note: AppleIntelInfo.kext was originally developer for Sandy Bridge – and later – processors, so it won’t work on older models, but I have since added a lot new processor checks to stop it from crashing on pre-Sandy Bridge processors. We might not be there, yet, but things are looking much brighter already.

Apple Drops “Late” for 2016 MacBook Pro Models…

I checked for new Mac model serials and found that Apple dropped the “Late” part for the MacBook Pro models. Here is the new data:

GY25 – MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports)
GY6N – MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports)
GYFH – MacBook Pro (13-inch, 2016, Four Thunderbolt 3 Ports)
GYGR – MacBook Pro (13-inch, 2016, Four Thunderbolt 3 Ports)

H03M – MacBook Pro (15-inch, 2016)
H03Q – MacBook Pro (15-inch, 2016)
H03Y – MacBook Pro (15-inch, 2016)
H040 – MacBook Pro (15-inch, 2016)
H03T – MacBook Pro (15-inch, 2016)
HF1R – MacBook Pro (13-inch, 2016, Four Thunderbolt 3 Ports)
HF1P – MacBook Pro (13-inch, 2016, Four Thunderbolt 3 Ports)
HF1Q – MacBook Pro (13-inch, 2016, Four Thunderbolt 3 Ports)
HF1T – MacBook Pro (13-inch, 2016, Four Thunderbolt 3 Ports)
HP49 – MacBook Pro (13-inch, 2016, Four Thunderbolt 3 Ports)
HP4D – MacBook Pro (13-inch, 2016, Four Thunderbolt 3 Ports)
HV5M – MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports)
HV5H – MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports)
HV5J – MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports)
HV5K – MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports)
HV5L – MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports)
HV5G – MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports)
HV5D – MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports)
HV5N – MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports)
HWCH – MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports)
HWH2 – MacBook Pro (13-inch, 2016, Four Thunderbolt 3 Ports)
HXD5 – MacBook Pro (13-inch, 2016, Four Thunderbolt 3 Ports)
HXF8 – MacBook Pro (15-inch, 2016)
HYP5 – MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports)

I have no idea why, and Apple may change it back at any time, but this is a first.

Edit:

The data for About This Mac is cached after it is pulled from the Apple server. You can find it here:

~/Library/Preferences/com.apple.SystemProfiler.plist

See also this screenshot:

late_removed_fromname

New Kaby Lake Based Mac Models…

Mac-B4831CEBD52A0C4C – two models with a maximum Turbo Boost of 3400 and 4000 MHz. This one uses the exact same processor power management data as the new MacBookPro13,1.

Update: Mac-B4831CEBD52A0C4C.plist removed in 10.12.4 Beta (Build 16E175b).

Mac-CAD6701F7CEA0921 – three models with a maximum Turbo Boost of 3500/3700 and 4000 MHz. This one uses the exact same processor power management data as the new MacBookPro13,2.

Update: Mac-CAD6701F7CEA0921.plist removed in 10.12.4 Beta (Build 16E175b).

Mac-551B86E5744E2388 – three models with a maximum Turbo Boost of 3800/3900 and 4100 MHz. This one uses the exact same processor power management data as the new MacBookPro13,3.

Update: Mac-551B86E5744E2388.plist is still there in 10.12.4 Beta (Build 16E175b).

I checked the perf-bias setting (5) and that suggests that the data is not for Mac desktop models. On desktop models like the iMac perf-bias is set to 1 (highest performance).

Here are the Intel processors that could be used. Some are already known. For the rest of them we have to wait for additional data (scroll down to the update).

3400 MHz

i5-7260U with Intel® Iris™ Plus Graphics 640 (15W)
i5-7287U with Intel® Iris™ Plus Graphics 650 (28W)

3500 MHz

i7-7500U with Intel® HD Graphics 620 (15W)
i5-7267U with Intel® Iris™ Plus Graphics 650 (28W)
i5-7300U withIntel® HD Graphics 620 (15W)
i5-7300HQ with Intel® HD Graphics 630 (45W)

3700 MHz

i5-7287U with Intel® Iris™ Plus Graphics 650 (28W)

3800 MHz

i7-7700HQ with Intel® HD Graphics 630 (45W)
i7-7560U with Intel® Iris™ Plus Graphics 640 (15W)
i5-7440HQ with Intel® HD Graphics 630 (45W)

3900 MHz

i7-7820HQ with Intel® HD Graphics 630 (45W)

4000 MHz

i7-7567U with Intel® Iris™ Plus Graphics 650 (28W)
i7-7660U with Intel® Iris™ Plus Graphics 640 (15W)

4100 MHz

i7-7920HQ with Intel® HD Graphics 630 (45W)

The one with board-id Mac-551B86E5744E2388 is already being checked in ApplePlatformEnabler::probe(IOService*, int*)

There is no GPU data defined as of yet, but this may change at a later date.

Ok. I’m now convinced that the board-id’s that I found are for a series of updated MacBook (Pro) models. One note. The data pointing to faster Intel graphics may also be used for a new Mac mini. Just a wild idea of course 😉 Nope. It was too good to be true. Sorry folks.

Hey. I might be wrong, but when was the last time that I completely missed the boat?

Update: Ok. I figured it out. Let’s start with the MacBookPro13,1

Intel Core i5-6360U 2.0 GHz (max Turbo Boost 3.1 GHz) with Intel® Iris™ Graphics 540 (15W)
Will be replaced by the:
Intel Core i5-7260U 2.2GHz (max Turbo Boost 3.4 GHz) with Intel® Iris™ Plus Graphics 640 (15W)

Intel Core i7-6660U 2.4 GHz (max Turbo Boost 3.4 GHz) with Intel® Iris™ Graphics 540 (15W)
Will be replaced by the:
Intel Core i7-7660U 2.5 GHz (max Turbo Boost 4.0 GHz) with Intel® Iris™ Plus Graphics 640 (15W)

MacBookPro13,2

Intel Core i5-6267U 2.9 GHz (max Turbo Boost 3.3 GHz) with Intel® Iris™ Graphics 550 (28W)
Will be replaced by the:
Intel Core i5-7267U 3.1 GHz (max Turbo Boost 3.5 GHz) with Intel® Iris™ Plus Graphics 650 (28W)

Intel Core i5-6287U 3.1 GHz (max Turbo Boost 3.5 GHz) with Intel® Iris™ Graphics 550 (28W)
Will be replaced by the:
Intel Core i5-7287U 3.3 GHz (max Turbo Boost 3.7 GHz) with Intel® Iris™ Plus Graphics 650 (28W)

Intel Core i7-6567U 3.3 GHz (max Turbo Boost 3.6 GHz) with Intel® Iris™ Graphics 550 (28W)
Will be replaced by the:
Intel Core i7-7567U 3.5 GHz (max Turbo Boost 4.0 GHz) with Intel® Iris™ Plus Graphics 650 (28W)

MacBookPro13,3:

Intel Core i7-6700HQ 2.6 GHz (max Turbo Boost 3.5 GHz) with Intel® HD Graphics 530 (45W)
Will be replaced by the:
Intel Core i7-7700HQ 2.8 GHz (max Turbo Boost 3.8 GHz) with Intel® HD Graphics 630 (45W)

Intel Core i7-6820HQ 2.7 GHz (max Turbo Boost 3.6 GHz) with Intel® HD Graphics 530 (45W)
Will be replaced by the:
Intel Core i7-7820HQ 2.9 GHz (max Turbo Boost 3.9 GHz) with Intel® HD Graphics 630 (45W)

Intel Core i7-6920HQ 2.9 GHz (max Turbo Boost 3.8 GHz) with Intel® HD Graphics 530 (45W)
Will be replaced by the:
Intel Core i7-7920HQ 3.1 GHz (max Turbo Boost 4.1 GHz) with Intel® HD Graphics 630 (45W)

The upgrades will be available some time after the official release of macOS Sierra 10.12.4 at the soonest, but I’d like to stress that I have no idea when exactly the new hardware will be released. It may even be in the summer. Who knows. Seriously. You should not wait for the new hardware. It can take months.

Update: Two of the three plists have since been removed.

Edit: We already have two late 2016 models. One 13-inch MacBook Pro and a 15-inch MacBook Pro, and we will buy a second 13-inch MacBook Pro this weekend. We’re not going to wait for a Kaby Lake model. We need an extra one now. Not whenever Apple decides to upgrade the current models.

Update: I visited the AppleStore today and bought another 13-inch MacBook Pro (with function keys) like I said that I would do. Here is a picture of it on top of the box:

NVMe boot args and Dummy kext…

I totally forgot to blog about the nvme boot argument that I found in the 10.12 Beta kext seven months ago:

bit-0: (0x01) enable debug output (calls _kprintf)
bit-1: (0x02) enable self refresh
bit-2: (0x04) enable LBA extend
bit-3: (0x08) enable LPSR support during S3/S4
bit-4: (0x10) PCI only mode
bit-5: (0x20) ignore initialisation errors
bit-6: (0x40) enable enctryption support

Notes:

You may want to run debugMachKernel.sh for bit-0.
For bit-1 setting the “nvme-self-refresh” Number property is required.
For bit-3 setting the “nvme-LPSR-during-S3-S4” Number property is required.
For bit-4 this appears to be the default.

Apple hardware also support: enable-IO-log=1 but that won’t work on other hardware.

Next. I also found a NVRAM variable:

“4d1ede05-38c7-4a6a-9cc6-4bcca8b38c14:PRTCCounter”

Dummy Kext

I received a couple of questions about this and never got to answer it so let’s do that here. In short. Yes. I am using a dummy kext right now. Here’s what I did:

1.) I copied IONVMEfamily.kext to /S*/L*/E*/AppleNVMeFamily.kext
2.) I patched the binary with my patches only
3.) I changed the version info in the Info.plist from 2.1.0 to 9.9.9

The original vanilla IONVMeFamily.kext is still there in /System/Library/Extensions and all is fine. No issues whatsoever. With 1546 power cycles I can call this a rock solid proven method.

Apple NVMe SMART Monitor Under Control…

Apple isn’t sharing any information about their SMART API’s so I had to dig a little and this is the first result (spoiler alert) from my hack:


-----------------------------------------
Smart Log for NVME device...............: disk0
NamespaceID.............................: 1
Critical Warning........................: 0
Temperature.............................: 37 °Celsius
Available Spare.........................: 100%
Available Spare Threshold...............: 10%
Percentage Used.........................: 1%
Data Units Read.........................: 4,292,043,776,000 [4.29 TB]
Data Units Written......................: 2,145,884,672,000 [2.14 TB]
Host Read Commands......................: 151780827
Host Write Commands.....................: 50512740
Controller Busy Time....................: 248 minutes
Power Cycles............................: 1541
Power On Hours..........................: 1156 hours
Unsafe Shutdowns........................: 784
Media and Data Integrity Errors.........: 0
Number of Error Information Log Entries.: 34

Here is an older one from my MacBook Pro:

-----------------------------------------
Smart Log for NVME device...............: disk0
NamespaceID.............................: 1
Critical Warning........................: 0
Temperature.............................: 22 °Celsius
Available Spare.........................: 100%
Available Spare Threshold...............: 10%
Percentage Used.........................: 0%
Data Units Read.........................: 7086678
Data Units Written......................: 4943651
Host Read Commands......................: 11389069
Host Write Commands.....................: 7246825
Controller Busy Time....................: 44 minutes
Power Cycles............................: 431
Power On Hours..........................: 9 hours
Unsafe Shutdowns........................: 15
Media and Data Integrity Errors.........: 0
Number of Error Information Log Entries.: 0

The temperature on my MacBook Pro is lower. Only 22 °Celsius. I was also unpleasantly surprised by the fifteen ‘Unsafe Shutdowns’ on it. This has to be a driver issue. Never had a single freeze, lockdown or sudden reboot.

The high number of ‘Unsafe Shutdowns’ on the hack is easily explainable. As you know, I do a lot of testing and then things can go wrong. And they do go wrong with a couple of beta kernel drivers.

More to come…

Supported Mac models for Night Shift in Sierra 10.12.4

Night Shift was introduced in macOS Sierra 10.12.4 (Build 16E144f and Public Beta-1) and is controlled by the CoreBrightness.framework and you’ll need at least one of the following – or later – Mac models:

MacBookPro9,x
iMac13,x
Macmini6,x
MacBookAir5,x
MacPro6,x
MacBook8,x

Apple did not release any information about this. Not just yet, but I know this because I located the checks for it in said framework, and there it checks for matching Mac model names:

MacBookPro
iMac
Macmini
MacBookAir
MacPro
MacBook

Night Shift is however not supported – by Apple – on older Mac models. No. There are checks for minimum requirements, which I looked up with help of:

nm /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness|grep _ModelMinVersion

000000000001d490 S _ModelMinVersion

Ok. Now we know the offset. Time to dump the data with help of:

xxd -s 0x1D490 -l 24 /S*/L*/PrivateFrameworks/CoreBrightness.framework/CoreBrightness

0001d490: 0900 0000 0d00 0000 0600 0000 0500 0000
0001d4a0: 0600 0000 0800 0000

MacBookPro9,x
iMac13,x
Macmini6,x
MacBookAir5,x
MacPro6,x
MacBook8,x

Now you know how I did it, and in case you happen to own a Mac model that isn’t supported, yet, then you could try to patch the matching value in CoreBrightness.framework as some readers confirmed that it is working for them with older/unsupported hardware. The colors that I used should help you to find the byte that you need to change.

Anyway. This my friends is how it is done. Have fun now.

Edit: The order of the MacBook Pro and iMac was wrong – see comments. Fixed thanks to the heads up from Thomas and Nicolinux.

Update: You need to re-sign the patched framework binary with:
sudo codesign -f -s - /S*/L*/PrivateFrameworks/CoreBrightness.framework/Versions/Current/CoreBrightness

Note: You may only use this patch in your script/software/app if the source code is available, preferable on Github, you are not asking for donations, and clearly state that this is my work. Thank you.