syscl / CPUTune

An open source kernel extension enables dynamic CPU performance tuning at runtime for macOS.
161 stars 36 forks source link

BD_PROCHOT option doesn't work #21

Open sooxt98 opened 4 years ago

sooxt98 commented 4 years ago

although memory leak doesn't happen anymore, but the cpu somehow still capped at 1.5 Ghz, BD_PROCHOT option does not effect on my bad battery @christophe-duc plz help me

I did notice that Bi-Directional Processor Hot is disabled by CPUTUNE in the config but does no effect on the throttle

CPU Config ``` AppleIntelInfo.kext v2.9 Copyright © 2012-2017 Pike R. Alpha. All rights reserved. Settings: ------------------------------------------ logMSRs..................................: 1 logIGPU..................................: 1 logCStates...............................: 1 logIPGStyle..............................: 1 InitialTSC...............................: 0x7ae993e4b000 (5875 MHz) MWAIT C-States...........................: 286531872 Processor Brandstring....................: Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz Processor Signature..................... : 0x806E9 ------------------------------------------ - Family............................... : 6 - Stepping............................. : 9 - Model................................ : 0x8E (142) Model Specific Registers (MSRs) ------------------------------------------ MSR_IA32_PLATFORM_ID.............(0x17) : 0x18000000000000 ------------------------------------------ - Processor Flags...................... : 6 MSR_CORE_THREAD_COUNT............(0x35) : 0x20004 ------------------------------------------ - Core Count........................... : 2 - Thread Count......................... : 4 MSR_PLATFORM_INFO................(0xCE) : 0xA04043BF1011700 ------------------------------------------ - Maximum Non-Turbo Ratio.............. : 0x17 (2300 MHz) - Ratio Limit for Turbo Mode........... : 1 (programmable) - TDP Limit for Turbo Mode............. : 1 (programmable) - Low Power Mode Support............... : 1 (LPM supported) - Number of ConfigTDP Levels........... : 1 (additional TDP level(s) available) - Maximum Efficiency Ratio............. : 4 - Minimum Operating Ratio.............. : 4 MSR_PMG_CST_CONFIG_CONTROL.......(0xE2) : 0x7E000008 ------------------------------------------ - I/O MWAIT Redirection Enable......... : 0 (not enabled) - CFG Lock............................. : 0 (MSR not locked) - C3 State Auto Demotion............... : 1 (enabled) - C1 State Auto Demotion............... : 1 (enabled) - C3 State Undemotion.................. : 1 (enabled) - C1 State Undemotion.................. : 1 (enabled) - Package C-State Auto Demotion........ : 1 (enabled) - Package C-State Undemotion........... : 1 (enabled) MSR_PMG_IO_CAPTURE_BASE..........(0xE4) : 0x51814 ------------------------------------------ - LVL_2 Base Address................... : 0x1814 - C-state Range........................ : 5 (C-States not included, I/O MWAIT redirection not enabled) IA32_MPERF.......................(0xE7) : 0x156F5D754345 IA32_APERF.......................(0xE8) : 0xD59F4A4764D MSR_FLEX_RATIO...................(0x194) : 0x110000 ------------------------------------------ MSR_IA32_PERF_STATUS.............(0x198) : 0x166500000F00 ------------------------------------------ - Current Performance State Value...... : 0xF00 (1500 MHz) MSR_IA32_PERF_CONTROL............(0x199) : 0x900 ------------------------------------------ - Target performance State Value....... : 0x900 (900 MHz) - Intel Dynamic Acceleration........... : 0 (IDA engaged) IA32_CLOCK_MODULATION............(0x19A) : 0x0 IA32_THERM_INTERRUPT.............(0x19B) : 0x10 ------------------------------------------ - High-Temperature Interrupt Enable.... : 0 (disabled) - Low-Temperature Interrupt Enable..... : 0 (disabled) - PROCHOT# Interrupt Enable............ : 0 (disabled) - FORCEPR# Interrupt Enable............ : 0 (disabled) - Critical Temperature Interrupt Enable : 1 (enabled) - Threshold #1 Value................... : 0 - Threshold #1 Interrupt Enable........ : 0 (disabled) - Threshold #2 Value................... : 0 - Threshold #2 Interrupt Enable........ : 0 (disabled) - Power Limit Notification Enable...... : 0 (disabled) IA32_THERM_STATUS................(0x19C) : 0x882A0000 ------------------------------------------ - Thermal Status....................... : 0 - Thermal Log.......................... : 0 - PROCHOT # or FORCEPR# event.......... : 0 - PROCHOT # or FORCEPR# log............ : 0 - Critical Temperature Status.......... : 0 - Critical Temperature log............. : 0 - Thermal Threshold #1 Status.......... : 0 - Thermal Threshold #1 log............. : 0 - Thermal Threshold #2 Status.......... : 0 - Thermal Threshold #2 log............. : 0 - Power Limitation Status.............. : 0 - Power Limitation log................. : 0 - Current Limit Status................. : 0 - Current Limit log.................... : 0 - Cross Domain Limit Status............ : 0 - Cross Domain Limit log............... : 0 - Digital Readout...................... : 42 - Resolution in Degrees Celsius........ : 1 - Reading Valid........................ : 1 (valid) MSR_THERM2_CTL...................(0x19D) : 0x0 IA32_MISC_ENABLES................(0x1A0) : 0x4000850089 ------------------------------------------ - Fast-Strings......................... : 1 (enabled) - FOPCODE compatibility mode Enable.... : 0 - Automatic Thermal Control Circuit.... : 1 (enabled) - Split-lock Disable................... : 0 - Performance Monitoring............... : 1 (available) - Bus Lock On Cache Line Splits Disable : 0 - Hardware prefetch Disable............ : 0 - Processor Event Based Sampling....... : 0 (PEBS supported) - GV1/2 legacy Enable.................. : 0 - Enhanced Intel SpeedStep Technology.. : 1 (enabled) - MONITOR FSM.......................... : 1 (MONITOR/MWAIT supported) - Adjacent sector prefetch Disable..... : 0 - CFG Lock............................. : 0 (MSR not locked) - xTPR Message Disable................. : 1 (disabled) MSR_TEMPERATURE_TARGET...........(0x1A2) : 0x640000 ------------------------------------------ - Turbo Attenuation Units.............. : 0 - Temperature Target................... : 100 - TCC Activation Offset................ : 0 MSR_MISC_PWR_MGMT................(0x1AA) : 0x401CC1 ------------------------------------------ - EIST Hardware Coordination........... : 1 (hardware coordination disabled) - Energy/Performance Bias support...... : 1 - Energy/Performance Bias.............. : 0 (disabled/MSR not visible to software) - Thermal Interrupt Coordination Enable : 1 (thermal interrupt routed to all cores) - SpeedShift Technology Enable......... : 1 (enabled) - SpeedShift Interrupt Coordination.... : 1 (enabled) - SpeedShift Energy Efficient Perf..... : 1 (enabled) - SpeedShift Technology Setup for HWP.. : Yes (setup for HWP) MSR_TURBO_RATIO_LIMIT............(0x1AD) : 0x24242424 ------------------------------------------ - Maximum Ratio Limit for C01.......... : 24 (3600 MHz) - Maximum Ratio Limit for C02.......... : 24 (3600 MHz) IA32_ENERGY_PERF_BIAS............(0x1B0) : 0x5 ------------------------------------------ - Power Policy Preference...............: 5 (balanced performance and energy saving) MSR_POWER_CTL....................(0x1FC) : 0x24005E ------------------------------------------ - Bi-Directional Processor Hot..........: 0 (disabled) - C1E Enable............................: 1 (enabled) MSR_RAPL_POWER_UNIT..............(0x606) : 0xA0E03 ------------------------------------------ - Power Units.......................... : 3 (1/8 Watt) - Energy Status Units.................. : 14 (61 micro-Joules) - Time Units .......................... : 10 (976.6 micro-Seconds) MSR_PKG_POWER_LIMIT..............(0x610) : 0x4283E800DD8320 ------------------------------------------ - Package Power Limit #1............... : 100 Watt - Enable Power Limit #1................ : 1 (enabled) - Package Clamping Limitation #1....... : 1 (allow going below OS-requested P/T state during Time Window for Power Limit #1) - Time Window for Power Limit #1....... : 110 (163840 milli-Seconds) - Package Power Limit #2............... : 125 Watt - Enable Power Limit #2................ : 1 (enabled) - Package Clamping Limitation #2....... : 0 (disabled) - Time Window for Power Limit #2....... : 33 (10 milli-Seconds) - Lock................................. : 0 (MSR not locked) MSR_PKG_ENERGY_STATUS............(0x611) : 0x731AB8E1 ------------------------------------------ - Total Energy Consumed................ : 117866 Joules (Watt = Joules / seconds) MSR_PP0_POWER_LIMIT..............(0x638) : 0x0 MSR_PP0_ENERGY_STATUS............(0x639) : 0x206262E3 ------------------------------------------ - Total Energy Consumed................ : 33161 Joules (Watt = Joules / seconds) MSR_PP0_POWER_LIMIT..............(0x638) : 0x0 MSR_PP0_ENERGY_STATUS............(0x639) : 0x206262FD ------------------------------------------ - Total Energy Consumed................ : 33161 Joules (Watt = Joules / seconds) MSR_PP1_POWER_LIMIT..............(0x640) : 0x0 MSR_PP1_ENERGY_STATUS............(0x641) : 0x2276540 ------------------------------------------ - Total Energy Consumed................ : 2205 Joules (Watt = Joules / seconds) MSR_PP1_POLICY...................(0x642) : 0x18 ------------------------------------------ - Priority Level....................... : 24 MSR_CONFIG_TDP_NOMINAL...........(0x648) : 0x17 MSR_CONFIG_TDP_LEVEL1............(0x649) : 0x5004C MSR_CONFIG_TDP_LEVEL2............(0x64a) : 0x0 MSR_CONFIG_TDP_CONTROL...........(0x64b) : 0x0 MSR_TURBO_ACTIVATION_RATIO.......(0x64c) : 0x0 MSR_PKGC3_IRTL...................(0x60a) : 0x884E MSR_PKGC6_IRTL...................(0x60b) : 0x8876 MSR_PKGC7_IRTL...................(0x60c) : 0x8894 MSR_PKG_C2_RESIDENCY.............(0x60d) : 0x4A8AE13ED50 MSR_PKG_C3_RESIDENCY.............(0x3f8) : 0x4478F58BB8CE MSR_PKG_C2_RESIDENCY.............(0x60d) : 0x4A8AE13ED50 MSR_PKG_C3_RESIDENCY.............(0x3f8) : 0x4478F58BB8CE MSR_PKG_C6_RESIDENCY.............(0x3f9) : 0xE86913336A MSR_PKG_C7_RESIDENCY.............(0x3fa) : 0x127B9FA5CD1 MSR_PKG_C8_RESIDENCY.............(0x630) : 0x3300DA561CA MSR_PKG_C9_RESIDENCY.............(0x631) : 0xDCE89DCBA MSR_PKG_C10_RESIDENCY............(0x632) : 0xB124F29B8AF MSR_PKG_C8_LATENCY...............(0x633) : 0x3300DA561CA MSR_PKG_C9_LATENCY...............(0x634) : 0xDCE89DCBA MSR_PKG_C10_LATENCY..............(0x635) : 0xB124F29B8AF MSR_PLATFORM_ENERGY_COUNTER......(0x64D) : 0x0 (not supported by hardware/BIOS) MSR_PPERF........................(0x64E) : 0xBF0A2A1C97F ------------------------------------------ - Hardware workload scalability........ : 13128148568447 MSR_CORE_PERF_LIMIT_REASONS......(0x64F) : 0x0 HDC Supported IA32_PKG_HDC_CTL.................(0xDB0) : 0x0 IA32_PM_CTL1.....................(0xDB1) : 0x1 ------------------------------------------ HDC Allow Block..................(0xDB1) : 1 (HDC blocked) IA32_THREAD_STALL................(0xDB2) : 0x0 MSR_PKG_HDC_CONFIG...............(0x652) : 0x2 ------------------------------------------ Pkg Cx Monitor ..................(0x652) : 2 (count package C3 and deeper) MSR_CORE_HDC_RESIDENCY...........(0x653) : 0x0 MSR_PKG_HDC_SHALLOW_RESIDENCY....(0x655) : 0x0 MSR_PKG_HDC_DEEP_RESIDENCY.......(0x656) : 0x0 IA32_TSC_DEADLINE................(0x6E0) : 0x7AE999330430 MSR_PPERF........................(0x63E) : 0x1 (20) IA32_PM_ENABLE...................(0x770) : 0x1 (HWP Supported and Enabled) IA32_HWP_CAPABILITIES............(0x771) : 0x1081724 ----------------------------------------- - Highest Performance.................. : 36 - Guaranteed Performance............... : 23 - Most Efficient Performance........... : 8 - Lowest Performance................... : 1 IA32_HWP_INTERRUPT...............(0x773) : 0x1 ------------------------------------------ - Guaranteed Performance Change........ : 1 (Interrupt generated on change of) - Excursion Minimum.................... : 0 (Interrupt generation disabled) IA32_HWP_REQUEST................(0x774) : 0x800F0F04 ----------------------------------------- - Minimum Performance................. : 4 - Maximum Performance................. : 15 - Desired Performance................. : 15 - Energy Efficient Performance........ : 128 - Activity Window..................... : 0, 0 - Package Control..................... : 0 IA32_HWP_STATUS..................(0x777) : 0x4 ----------------------------------------- - Guaranteed Performance Change....... : 0 (has not occured) - Excursion To Minimum................ : 1 (has occured) CPU Ratio Info: ------------------------------------------ Base Clock Frequency (BLCK)............. : 100 MHz Maximum Efficiency Ratio/Frequency.......: 4 ( 400 MHz) Maximum non-Turbo Ratio/Frequency........: 23 (2300 MHz) Maximum Ratio/Frequency..................: 23 (2300 MHz) IGPU Info: ------------------------------------------ IGPU Current Frequency...................: 0 MHz IGPU Minimum Frequency...................: 300 MHz IGPU Maximum Non-Turbo Frequency.........: 300 MHz IGPU Maximum Turbo Frequency.............: 1000 MHz IGPU Maximum limit.......................: 1000 MHz P-State ratio * 100 = Frequency in MHz ------------------------------------------ CPU P-States [ (15) ] iGPU P-States [ ] CPU C3-Cores [ 0 1 2 3 ] CPU C7-Cores [ 0 1 2 3 ] CPU P-States [ (15) ] iGPU P-States [ ] CPU P-States [ (13) 15 ] iGPU P-States [ ] CPU P-States [ (13) 15 ] iGPU P-States [ (30) ] CPU P-States [ 13 15 (23) ] iGPU P-States [ 30 ] CPU P-States [ 13 (14) 15 23 ] iGPU P-States [ 30 ] CPU P-States [ (4) 13 14 15 23 ] iGPU P-States [ 30 ] ```

image

syscl commented 4 years ago

cc @schdt899 to take a look

sooxt98 commented 4 years ago

If im not wrong, tweaking BD_PROCHOT wont help for broken battery, the issue persist since https://github.com/syscl/CPUTune/issues/8

As my MBP Current Performance State Value is capped at 1500 MHz without any reason

MSR_IA32_PERF_STATUS.............(0x198) : 0x167200000F00
------------------------------------------
 - Current Performance State Value...... : 0xF00 (1500 MHz)

The only way to make it work is to find out what capped that value, or maybe direct tweaking that value could make it work

sooxt98 commented 4 years ago

I finally figure it out, i read thru this post again and again https://portugnole.blogspot.com/2020/05/running-macbook-without-battery-lets-go.html

The main problem here is IOPlatformPluginFamily.kext, which is the main reason that throttle the speed; So it needs to be removed.

The last step is enable HWP 0x770 & disable BD_PROCHOT 0x1FC & disable turbo boost 0x1A0

./voltageshift write 0x770 0x1
./voltageshift write 0x1FC 0x24005E
./voltageshift write 0x1A0 0x4000850089

But the problem here is after removing IOPlatformPluginFamily.kext, the latest CPUTune will cause KP when load kext which i didn't notice at first that's the reason why CPUTune not working. cc @syscl

So currently i'm using voltageshift to modify MSR value directly

But now Im facing another issue where macbook auto shutoff after 15min of using ....

Update:

I found out that I can direct changing the capped value (Target performance State Value) to 2.3MHZ 0x1700 which allowing us to ignore the last step (enable HWP 0x770 & disable BD_PROCHOT 0x1FC & disable turbo boost 0x1A0)

./voltageshift write 0x199 0x1700

Yeah after 15min, shutoff not happen anymore :3 new method works!

sooxt98 commented 4 years ago

I tried to benchmark with turbo boost on, my mac literally goes off after reaching 87++ celcius ... Not sure why

sooxt98 commented 4 years ago

Another weird situation, I let my Mac sleep for few times, then I use for about 30min and it become more slow and laggy and finally suddently freeze at there. The cpu are all in normal stat, the power consumption becomes not stable anymore, spiking every 3 seconds up and down; my guess is it could probably cause by removing that Intel kext 🤔

sooxt98 commented 4 years ago

updates: This method still works on BIG SUR :3

Spiking solved with BD_PROCHOT disable; If i'm not wrong enable HWP will makes macos crash.

So these two command are the perfect command

./voltageshift write 0x199 0x1700 
# Tweak Target performance State Value to 2.3MHZ 
# (It varies depends on what cpu model are you using, change the `0x1700` according to your CPU model max performance MHz (when turbo off))
./voltageshift write 0x1FC 0x24005E 
# Disable BD_PROCHOT (warning: only for me, please read the guide below)

image

Guide for disable BD_PROCHOT

  1. you need to get default hex with
./voltageshift read 0x1FC
  1. in this case, my hex is 0x24005f , simply replace the last character with 'e', so it would be 0x24005E
  2. apply the changes
./voltageshift write 0x1FC 0x24005E

image

syscl commented 4 years ago

Thanks @sooxt98 for detail procedures, sorry for the late reply due to on call last week. So the correct step is to change the target value first then disable BD_PROCHOT right?

sooxt98 commented 4 years ago

@syscl yes, and also need to remove the IOPlatformPluginFamily.kext to make bd prochot works

davibennun commented 3 years ago

@sooxt98 I think im on the same boat, My CPU is capped at 0.8ghz, it looks like the Bi-Directional Processor Hot is disabled by CPUTUNE but the throttle still persists. I also removed IOPlatformPluginFamily.kext.

AppleIntelInfo.kext AppleIntelInfo.kext v2.9 Copyright © 2012-2017 Pike R. Alpha. All rights reserved. Settings: ------------------------------------------ logMSRs..................................: 1 logIGPU..................................: 1 logCStates...............................: 1 logIPGStyle..............................: 1 InitialTSC...............................: 0x5ca945ade0b (235 MHz) MWAIT C-States...........................: 286531872 Processor Brandstring....................: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz Processor Signature..................... : 0x306D4 ------------------------------------------ - Family............................... : 6 - Stepping............................. : 4 - Model................................ : 0x3D (61) Model Specific Registers (MSRs) ------------------------------------------ MSR_IA32_PLATFORM_ID.............(0x17) : 0x18000000000000 ------------------------------------------ - Processor Flags...................... : 6 MSR_CORE_THREAD_COUNT............(0x35) : 0x20004 ------------------------------------------ - Core Count........................... : 2 - Thread Count......................... : 4 MSR_PLATFORM_INFO................(0xCE) : 0x5053BF3011B00 ------------------------------------------ - Maximum Non-Turbo Ratio.............. : 0x1B (2700 MHz) - Ratio Limit for Turbo Mode........... : 1 (programmable) - TDP Limit for Turbo Mode............. : 1 (programmable) - Low Power Mode Support............... : 1 (LPM supported) - Number of ConfigTDP Levels........... : 1 (additional TDP level(s) available) - Maximum Efficiency Ratio............. : 5 - Minimum Operating Ratio.............. : 5 MSR_PMG_CST_CONFIG_CONTROL.......(0xE2) : 0x7E000008 ------------------------------------------ - I/O MWAIT Redirection Enable......... : 0 (not enabled) - CFG Lock............................. : 0 (MSR not locked) - C3 State Auto Demotion............... : 1 (enabled) - C1 State Auto Demotion............... : 1 (enabled) - C3 State Undemotion.................. : 1 (enabled) - C1 State Undemotion.................. : 1 (enabled) - Package C-State Auto Demotion........ : 1 (enabled) - Package C-State Undemotion........... : 1 (enabled) MSR_PMG_IO_CAPTURE_BASE..........(0xE4) : 0x51814 ------------------------------------------ - LVL_2 Base Address................... : 0x1814 - C-state Range........................ : 5 (C-States not included, I/O MWAIT redirection not enabled) IA32_MPERF.......................(0xE7) : 0x3831D876F30 IA32_APERF.......................(0xE8) : 0x10A6998D73B MSR_FLEX_RATIO...................(0x194) : 0x0 ------------------------------------------ MSR_IA32_PERF_STATUS.............(0x198) : 0x159300000800 ------------------------------------------ - Current Performance State Value...... : 0x800 (800 MHz) MSR_IA32_PERF_CONTROL............(0x199) : 0x500 ------------------------------------------ - Target performance State Value....... : 0x500 (500 MHz) - Intel Dynamic Acceleration........... : 0 (IDA engaged) IA32_CLOCK_MODULATION............(0x19A) : 0x0 IA32_THERM_INTERRUPT.............(0x19B) : 0x10 ------------------------------------------ - High-Temperature Interrupt Enable.... : 0 (disabled) - Low-Temperature Interrupt Enable..... : 0 (disabled) - PROCHOT# Interrupt Enable............ : 0 (disabled) - FORCEPR# Interrupt Enable............ : 0 (disabled) - Critical Temperature Interrupt Enable : 1 (enabled) - Threshold #1 Value................... : 0 - Threshold #1 Interrupt Enable........ : 0 (disabled) - Threshold #2 Value................... : 0 - Threshold #2 Interrupt Enable........ : 0 (disabled) - Power Limit Notification Enable...... : 0 (disabled) IA32_THERM_STATUS................(0x19C) : 0x88300800 ------------------------------------------ - Thermal Status....................... : 0 - Thermal Log.......................... : 0 - PROCHOT # or FORCEPR# event.......... : 0 - PROCHOT # or FORCEPR# log............ : 0 - Critical Temperature Status.......... : 0 - Critical Temperature log............. : 0 - Thermal Threshold #1 Status.......... : 0 - Thermal Threshold #1 log............. : 0 - Thermal Threshold #2 Status.......... : 0 - Thermal Threshold #2 log............. : 0 - Power Limitation Status.............. : 0 - Power Limitation log................. : 1 - Current Limit Status................. : 0 - Current Limit log.................... : 0 - Cross Domain Limit Status............ : 0 - Cross Domain Limit log............... : 0 - Digital Readout...................... : 48 - Resolution in Degrees Celsius........ : 1 - Reading Valid........................ : 1 (valid) MSR_THERM2_CTL...................(0x19D) : 0x0 IA32_MISC_ENABLES................(0x1A0) : 0x4000850089 ------------------------------------------ - Fast-Strings......................... : 1 (enabled) - FOPCODE compatibility mode Enable.... : 0 - Automatic Thermal Control Circuit.... : 1 (enabled) - Split-lock Disable................... : 0 - Performance Monitoring............... : 1 (available) - Bus Lock On Cache Line Splits Disable : 0 - Hardware prefetch Disable............ : 0 - Processor Event Based Sampling....... : 0 (PEBS supported) - GV1/2 legacy Enable.................. : 0 - Enhanced Intel SpeedStep Technology.. : 1 (enabled) - MONITOR FSM.......................... : 1 (MONITOR/MWAIT supported) - Adjacent sector prefetch Disable..... : 0 - CFG Lock............................. : 0 (MSR not locked) - xTPR Message Disable................. : 1 (disabled) MSR_TEMPERATURE_TARGET...........(0x1A2) : 0x690000 ------------------------------------------ - Turbo Attenuation Units.............. : 0 - Temperature Target................... : 105 - TCC Activation Offset................ : 0 MSR_MISC_PWR_MGMT................(0x1AA) : 0x400001 ------------------------------------------ - EIST Hardware Coordination........... : 1 (hardware coordination disabled) - Energy/Performance Bias support...... : 1 - Energy/Performance Bias.............. : 0 (disabled/MSR not visible to software) - Thermal Interrupt Coordination Enable : 1 (thermal interrupt routed to all cores) - SpeedShift Technology Enable......... : 0 (disabled) - SpeedShift Interrupt Coordination.... : 0 (disabled) - SpeedShift Energy Efficient Perf..... : 0 (disabled) - SpeedShift Technology Setup for HWP.. : No (not setup for HWP) MSR_TURBO_RATIO_LIMIT............(0x1AD) : 0x1F1F1F1F1F1F ------------------------------------------ - Maximum Ratio Limit for C01.......... : 1F (3100 MHz) - Maximum Ratio Limit for C02.......... : 1F (3100 MHz) IA32_ENERGY_PERF_BIAS............(0x1B0) : 0xF ------------------------------------------ - Power Policy Preference...............: 15 (maximize energy saving) MSR_POWER_CTL....................(0x1FC) : 0x4005E ------------------------------------------ - Bi-Directional Processor Hot..........: 0 (disabled) - C1E Enable............................: 1 (enabled) MSR_RAPL_POWER_UNIT..............(0x606) : 0xA0E03 ------------------------------------------ - Power Units.......................... : 3 (1/8 Watt) - Energy Status Units.................. : 14 (61 micro-Joules) - Time Units .......................... : 10 (976.6 micro-Seconds) MSR_PKG_POWER_LIMIT..............(0x610) : 0x4283E800DD8320 ------------------------------------------ - Package Power Limit #1............... : 100 Watt - Enable Power Limit #1................ : 1 (enabled) - Package Clamping Limitation #1....... : 1 (allow going below OS-requested P/T state during Time Window for Power Limit #1) - Time Window for Power Limit #1....... : 110 (163840 milli-Seconds) - Package Power Limit #2............... : 125 Watt - Enable Power Limit #2................ : 1 (enabled) - Package Clamping Limitation #2....... : 0 (disabled) - Time Window for Power Limit #2....... : 33 (10 milli-Seconds) - Lock................................. : 0 (MSR not locked) MSR_PKG_ENERGY_STATUS............(0x611) : 0x8FFF6EF ------------------------------------------ - Total Energy Consumed................ : 9215 Joules (Watt = Joules / seconds) MSR_PP0_POWER_LIMIT..............(0x638) : 0x0 MSR_PP0_ENERGY_STATUS............(0x639) : 0x3924438 ------------------------------------------ - Total Energy Consumed................ : 3657 Joules (Watt = Joules / seconds) MSR_PP0_POWER_LIMIT..............(0x638) : 0x0 MSR_PP0_ENERGY_STATUS............(0x639) : 0x3924496 ------------------------------------------ - Total Energy Consumed................ : 3657 Joules (Watt = Joules / seconds) MSR_PP1_POWER_LIMIT..............(0x640) : 0x0 MSR_PP1_ENERGY_STATUS............(0x641) : 0x459E89 ------------------------------------------ - Total Energy Consumed................ : 278 Joules (Watt = Joules / seconds) MSR_PP1_POLICY...................(0x642) : 0x18 ------------------------------------------ - Priority Level....................... : 24 MSR_PKGC3_IRTL...................(0x60a) : 0x8842 MSR_PKGC6_IRTL...................(0x60b) : 0x8873 MSR_PKGC7_IRTL...................(0x60c) : 0x8891 MSR_PKG_C2_RESIDENCY.............(0x60d) : 0x13512E61732 MSR_PKG_C3_RESIDENCY.............(0x3f8) : 0x5418A48770 MSR_PKG_C2_RESIDENCY.............(0x60d) : 0x13512E61732 MSR_PKG_C3_RESIDENCY.............(0x3f8) : 0x5418A48770 MSR_PKG_C6_RESIDENCY.............(0x3f9) : 0x41705B3EC MSR_PKG_C7_RESIDENCY.............(0x3fa) : 0x0 MSR_PKG_C8_RESIDENCY.............(0x630) : 0x0 MSR_PKG_C9_RESIDENCY.............(0x631) : 0x0 MSR_PKG_C10_RESIDENCY............(0x632) : 0x0 MSR_PKG_C8_LATENCY...............(0x633) : 0x0 MSR_PKG_C9_LATENCY...............(0x634) : 0x0 MSR_PKG_C10_LATENCY..............(0x635) : 0x0 IA32_TSC_DEADLINE................(0x6E0) : 0x5CAA0B98B30 CPU Ratio Info: ------------------------------------------ Base Clock Frequency (BLCK)............. : 100 MHz Maximum Efficiency Ratio/Frequency.......: 5 ( 500 MHz) Maximum non-Turbo Ratio/Frequency........: 27 (2700 MHz) Maximum Ratio/Frequency..................: 27 (2700 MHz) IGPU Info: ------------------------------------------ IGPU Current Frequency...................: 300 MHz IGPU Minimum Frequency...................: 300 MHz IGPU Maximum Non-Turbo Frequency.........: 300 MHz IGPU Maximum Turbo Frequency.............: 1050 MHz IGPU Maximum limit.......................: No Limit P-State ratio * 100 = Frequency in MHz ------------------------------------------ CPU P-States [ 7 (8) ] iGPU P-States [ (6) ] CPU C3-Cores [ 0 1 2 3 ] CPU C6-Cores [ 0 1 2 3 ] CPU C7-Cores [ 0 1 2 3 ]

I tried to manually disable BD_PROCHOT using voltageshift as per your instructions but ./voltageshift read 0x1FC gives me only:

(00000000 00000000 00000000 00000000 00000000 00000100 00000000 01011110)

Can you please shed a light on this issue?

sooxt98 commented 3 years ago

@davibennun if im not wrong, the binary is 4005E which shows that u have already disabled the BD_PROCHOT

sooxt98 commented 3 years ago

@davibennun what u need to do now is this, i saw your config, try command below

./voltageshift write 0x199 0x1B00 # Tweak Target performance State Value to 2.3MHZ

so you're now actually tweaking 0x199 to get back normal performance, its like a max speed capped of ur current cpu state (Target performance State Value)

davibennun commented 3 years ago

@sooxt98 I got my CPU back to max performance after running the command you suggested. THANK YOU SO MUCH! I'm battling with this for over a day, I'm so happy to see my CPU working fine again.

mvarie commented 3 years ago

@sooxt98

MacBook usable again.

Amazing, thank you.

sooxt98 commented 3 years ago

btw i did found out that, performing full factory reset on macbook and upgrade to bigsur will solve the throttle problem;

mvarie commented 3 years ago

btw i did found out that, performing full factory reset on macbook and upgrade to bigsur will solve the throttle problem;

@sooxt98 I'm on Big Sur already, with a bad battery. The slightest workload brought the CPU down to 800mhz. Nothing worked, until I tried your solution. The MacBook now runs faster, quieter, cooler.

Moulick commented 2 years ago

Well, this worked for me, but now after several hours of use, somehow the 0x199 keeps going back to 800Mhz every few seconds. I have

  1. IOPlatformPluginFamily.kext removed
  2. NoBatteryNoProblem.kext loaded
  3. BD_PROCHOT disabled via ./voltageshift write 0x1FC 0x24005E
  4. Now I am running a while loop to set ./voltageshift write 0x199 0x2200 every second to even make this comment.

This started after I inserted an external hard drive and since then I am not able to keep 0x199 to higher speeds :( @syscl @sooxt98 Any idea how I can figure out what's resetting 0x199 back to 800Mhz ?

Update: 0x199 is now persisted after I rebooted and it works again. So seems I cannot attach an external drive or else it reverts and then I need to reboot (which of-course takes ages due to no battery) to be able to enable again. That's a bummer :(

hennigarj commented 2 years ago

i'm also having 0x199 revert to ~0.9mhz every few minutes; no external hdd, only peripherals are keyboard+mouse+monitor. im on monterey 12.5.1, so most of this still works up to that version at least; i'm happy to help anyone resolve any issue if they have one!

does anyone have a solution for the reverting 0x199?