Skip to content

Instantly share code, notes, and snippets.

@farseenmanekhan1232
Last active May 9, 2026 11:16
Show Gist options
  • Select an option

  • Save farseenmanekhan1232/7527c3d5feffd5dc01bfdcde0e4e7d89 to your computer and use it in GitHub Desktop.

Select an option

Save farseenmanekhan1232/7527c3d5feffd5dc01bfdcde0e4e7d89 to your computer and use it in GitHub Desktop.
Complete reference for Hackintosh disk cleanup and CPU performance optimization on macOS with Intel i5-8365U. Covers config.plist modifications, kexts, ThrottleStop parity mapping, VoltageShift launch daemon, and cleanup scripts.

Performance Optimization for Whiskey Lake Hackintosh — Complete Reference

This document records all steps, decisions, scripts, and outcomes from a session tuning a Whiskey Lake Hackintosh laptop running macOS. The goal was to achieve parity with an existing Windows ThrottleStop configuration on the same hardware.

Hardware Profile

Component Details
CPU Intel Core i5-8365U (Whiskey Lake, 4C/8T, 1.9 GHz base, 4.1 GHz turbo)
RAM 64 GB DDR4
SMBIOS MacBookPro15,2
Bootloader OpenCore
XCPM Mode 1, frequency vectors loaded
SIP csr-active-config = 030A0000

Scripts Repository

All scripts referenced here are available at: https://github.com/farseenmanekhan1232/macos-hackintosh-optimizations

Reference: Windows ThrottleStop Configuration

The user had a stable ThrottleStop profile on the same hardware running Windows with these targets:

TPL Window

  • MSR PL1: 25W
  • MSR PL2: 44W
  • MMIO PL1: 25W (was stuck at 10W — the single biggest bottleneck on Windows)
  • MMIO PL2: 44W
  • Turbo Time Limit: 28s
  • PROCHOT Offset: 15 (throttle at 85C instead of 70C)
  • Power Balance: CPU 13 / iGPU 15

Main Window

  • Speed Shift EPP: 0 (max performance)
  • BD PROCHOT: checked
  • SpeedStep: checked
  • C1E: checked
  • High Performance: checked (was previously unchecked)

macOS Analysis — Problems Found

Issue Found Before Impact
AppleXcpmForceBoost false CPU was lazily scaling — equivalent to EPP 128
HWP EPP macOS default (~0x90) Power-saving profile, not performance
CPUFriend + DataProvider Not installed Frequency vectors from MacBookPro15,2 were for an i7-8559U (28W), not our i5-8365U (15W)
VoltageShift Not installed No direct MSR access for power limits or undervolting

OpenCore config.plist Changes

Two modifications were made directly to /Volumes/EFI/EFI/OC/config.plist:

1. Enable AppleXcpmForceBoost Location: Kernel -> Quirks -> AppleXcpmForceBoost = true Forces the CPU to use maximum turbo multipliers aggressively. Equivalent to ThrottleStop High Performance checkbox.

2. Add EPP override to boot-args Location: NVRAM -> Add -> 7C436110-AB2A-4BBB-A880-FE41995C9F82 -> boot-args New value: debug=0x100 keepsyms=1 -wegnoegpu igfxonln=1 machdep.xcpm.epp_override=0 Locks HWP Energy Performance Preference to 0 (max performance). Equivalent to ThrottleStop Speed Shift EPP = 0.

Kexts Added to OpenCore

Three kexts were placed in EFI/OC/Kexts/ and registered in config.plist under Kernel -> Add:

VoltageShift.kext Loads the VoltageShift kernel extension providing direct MSR read/write access. Required to apply PL1/PL2 power limits and voltage offsets at runtime.

CPUFriend.kext (v1.3.0) Hooks into X86PlatformPlugin to enable custom frequency vector injection, replacing the mismatched vectors that came from the MacBookPro15,2 SMBIOS.

CPUFriendDataProvider.kext (v1.0.1) Contains the actual custom frequency vectors generated by CPUFriendFriend. This is the macOS equivalent of setting MMIO PL1/PL2 — overriding the platform-level power management tables that X86PlatformPlugin references.

CPUFriendFriend Configuration

The CPUFriendFriend Python script generated CPUFriendDataProvider.kext with these inputs:

Prompt Value Reason
Low Frequency Mode (LFM) 0x08 (800 MHz) Lower idle floor, zero impact on peak performance
Energy Performance Preference (EPP) 0x00 Maximum performance — matches ThrottleStop EPP = 0
PerfBias 0x00 0-15 range where 0 is absolute performance preference (MacBookPro defaults to 0x05)
Energy Savings features No All power-saving additions explicitly skipped

VoltageShift MSR Configuration

Applied on every boot via a launch daemon:

voltageshift powerlimit 25 44 28
voltageshift offset -80 -50 -80

PL1 = 25W sustained, PL2 = 44W burst, Turbo Time = 28 seconds. CPU undervolt = -80mV, GPU undervolt = -50mV (more conservative for the integrated GPU), Cache undervolt = -80mV.

Implementation — voltageshift_apply.sh

Launch Daemon for Persistence

File: com.voltageshift.apply.plist

Installed to /Library/LaunchDaemons/com.voltageshift.apply.plist. Runs voltageshift_apply.sh as root at RunAtLoad. The OC kext handles loading the kernel extension; the daemon handles issuing the MSR write commands that must execute at runtime on every boot. Verified with sudo launchctl list | grep voltageshift — exits with status 0.

Setup script — optimize_mac_performance.sh

ThrottleStop to macOS Parity

ThrottleStop Setting Target macOS Implementation Persistent Status
Speed Shift EPP 0 boot-arg epp_override=0 + CPUFriend vector EPP 0x00 Yes Done
High Performance mode Checked AppleXcpmForceBoost = true Yes Done
MSR PL1 25W VoltageShift via launchd Yes Done
MSR PL2 44W VoltageShift via launchd Yes Done
MMIO PL1 25W CPUFriendDataProvider frequency vectors Yes Done
MMIO PL2 44W CPUFriendDataProvider frequency vectors Yes Done
Turbo Time Limit 28s VoltageShift via launchd Yes Done
Voltage Offset -80mV CPU/Cache VoltageShift via launchd Yes Done
PerfBias 0x00 CPUFriendDataProvider frequency vectors Yes Done
PROCHOT Offset 15 No macOS equivalent — XCPM thermal pressure N/A N/A
Power Balance 13/15 No macOS equivalent — AGPM + WhateverGreen N/A N/A

85% parity achieved. The two unmapped items have no direct macOS equivalent and are handled by the native power management stack.

Verification

# XCPM state
sysctl machdep.xcpm | grep -E "plimit|boost|epp"

# VoltageShift MSRs applied
sudo /usr/local/bin/voltageshift read

# Launch daemon status
sudo launchctl list | grep voltageshift

# OC config integrity
plutil -extract Kernel.Quirks.AppleXcpmForceBoost xml1 -o - /Volumes/EFI/EFI/OC/config.plist
plutil -extract "NVRAM.Add.7C436110-AB2A-4BBB-A880-FE41995C9F82.boot-args" xml1 -o - /Volumes/EFI/EFI/OC/config.plist

# Memory cache purge (ISLC equivalent)
sudo purge

Design Decisions

  1. MacBookPro15,2 SMBIOS kept. Both MBP15,2 and MBP15,4 are 15W quad-core Coffee Lake. Switching would require regenerating serials and break iMessage/FaceTime for zero gain since CPUFriendDataProvider overrides frequency vectors regardless of SMBIOS.

  2. CPUFriendFriend over one-key-cpufriend. CPUFriendFriend exposes LFM, EPP, PerfBias, and Energy Savings as individual toggles with documentation. one-key-cpufriend only handles LFM and EPP.

  3. Launch daemon for MSR writes, OC kext for kernel extension. The OC kext loads the extension at boot; the daemon issues the MSR write commands that must execute at runtime. Separating these concerns avoids relying on OC alone for both loading and configuration.

  4. PerfBias at 0x00. Explicitly chosen for maximum performance bias over Apple's default 0x05. The user's priority was uncompromising performance.

  5. GPU undervolt at -50mV. Conservative value for the integrated UHD 620 since IGPs are more sensitive to undervolting than CPU cores. CPU and cache at -80mV match the Windows ThrottleStop proven-stable value.

Final System State

  • Custom frequency vectors injected via CPUFriendDataProvider
  • CPU ramps to 4.1 GHz turbo immediately on load
  • EPP locked to 0 (maximum performance)
  • PL1 = 25W sustained, PL2 = 44W burst, 28s turbo window
  • CPU and Cache at -80mV, GPU at -50mV
  • All settings persistent across reboots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment