The first version of OS X to support Haswell CPUs was Mountain Lion 10.8.5. At the same time, for certain CPUs including Haswell, Apple moved CPU power management from AppleIntelCPUPowerManagement.kext to the kernel. This technology is known as XCPM (Xnu CPU Power Management). This technology is enabled for Haswell CPUs automatically and can optionally be use with Ivy Bridge CPUs with the -xcpm kernel flag.
The problem is Apple's computers do not have a locked MSR 0xE2, yet most PC laptops do. When the kernel tries to write to this locked register, it causes a panic. And this panic happens so early in the process that it results in a reboot. Similar to how we must patch AppleIntelCPUPowerManagement.kext for locked CPU MSR 0xE2, the kernel must also be patched for CPUs using XCPM to avoid this reboot.
Background information can be found here: http://www.insanelym...063cl-i7-4700mq
How to patch the kernel
After creating your USB installer, you should have the "vanilla" kernel. Here's how to patch it:
For Yosemite 10.10.x:
# in Terminal, assuming your USB is called Installer cp /Volumes/Installer/System/Library/Kernels/kernel ~/Desktop/kernel_backup cp /Volumes/Installer/System/Library/Kernels/kernel ~/Desktop/kernel cd ~/Desktop # now patch the kernel at ~/Desktop/kernel perl -pi -e 's|\xe2\x00\x00\x00\x02\x00\x00\x00|\x00\x00\x00\x00\x00\x00\x00\x00|g' kernel perl -pi -e 's|\xe2\x00\x00\x00\x4c\x00\x00\x00|\x00\x00\x00\x00\x00\x00\x00\x00|g' kernel perl -pi -e 's|\xe2\x00\x00\x00\x90\x01\x00\x00|\x00\x00\x00\x00\x00\x00\x00\x00|g' kernel # patched kernel is now at ~/Desktop/kernel sudo cp kernel /Volumes/Installer/System/Library/Kernels/kernelAfter you install OS X to your HDD, you will have vanilla kernel on the HDD, leading to the same instant reboot problem. So, you must re-enter the OS X installer, and go into Terminal (using Utilities -> Terminal) and replace the kernel with the patched version:
# in Terminal from the OS X installer, assuming your HDD volume is called "Macintosh HD" cp /System/Library/Kernels/kernel "/Volumes/Macintosh HD/System/Library/Kernels/kernel"After that, you can exit the installer, and boot into the installed partition to finish installation and reach the desktop.
MD5 sums for the kernel
Check your md5 sums with:
md5 /Volumes/Installer/System/Library/Kernels/kernel10.10/10.10.1 kernel
xcpm patched: 1938ebb0bd6cdc00930543025d3df887
xcpm patched: cc46457172315aea68d8e1f957d2746c
xcpm patched: d89759c11c5f434b4434b6fbf0464d6c
A note about Clover
The Clover bootloader has this patch built-in with the config.plist/KernelAndKextPatches/KernelPm option.
Keep in mind if you're not using Clover (and KernelPm), you will have to re-patch the (new) kernel after any OS X update. With Clover, it is automatic provided the code in Clover is updated (if necessary) to patch the (new) kernel.
For details see the blog article: https://racerrehabma...r-early-reboot/