syscl/CPUTune

Any version > 1.9 is crashing my MBP

Closed this issue · 14 comments

Hello,
I'm another MBP user with a broken battery. I'm trying to use my old MBP 13" late 2013 without any battery.

@christophe-duc I'm following your suggestion and I'm trying disabling EnableProcHot by setting it to "true". Still no luck.
Screenshot 2020-06-09 at 12 31 07

This is the last message I get before it dies.

Loading version 1.9 works but I cannot get my CPU up to speed. It's extremely slow so I believe it's clock is to 800MHz or similar.

Of course, I remove the IOPlatformPluginFamily.kext before testing
sudo rm -rf /System/Library/Extensions/IOPlatformPluginFamily.kext

and even csrutil disable + csrutil enable --without kext afterwards.

Any clue?

Ok, interesting. so for you 1.9 load, but no real gains. What CPU do you have in that MBP?

I think we may need the AppleIntelInfo kext ( AppleIntelInfo) to verify in what state you are in 1.9, and I need to double check what others modifications where introduced after.

I think we may need a way for us to speak real time on this project so we can figure things out. Do you have any preference in between discord or slack? I have time later this week to do a debug session.

syscl commented

@Mrc527 does version earlier than 1.9.0 can be booted without any problem?

@Mrc527 does version earlier than 1.9.0 can be booted without any problem?

I did not try, I just load them once the machine is booted because it's too much time consuming rebooting in safe mode and removing the kext, without the battery.

Ok, interesting. so for you 1.9 load, but no real gains. What CPU do you have in that MBP?

I think we may need the AppleIntelInfo kext ( AppleIntelInfo) to verify in what state you are in 1.9, and I need to double check what others modifications where introduced after.

I think we may need a way for us to speak real time on this project so we can figure things out. Do you have any preference in between discord or slack? I have time later this week to do a debug session.

I've found this, hope it is of any help.
Model Name: MacBook Pro
Model Identifier: MacBookPro12,1
Processor Name: Dual-Core Intel Core i7
Processor Speed: 3.1 GHz
Number of Processors: 1
Total Number of Cores: 2
L2 Cache (per Core): 256 KB
L3 Cache: 4 MB
Hyper-Threading Technology: Enabled
Memory: 16 GB
Boot ROM Version: 191.0.0.0.0
SMC Version (system): 2.28f7

As for the debug session, maybe Slack is easier but actually Discord is also fine. Just send me a link, I'm sure we can find a good moment.

Thanks for your help.

syscl commented

Thanks @Mrc527 , I'm trying to narrow down the issue. Could you please give this two kext a try and see if the issue resolve?

CPUTune1.8.5.zip
CPUTune1.9.0.zip

Thanks in advance!

Thanks @Mrc527 , I'm trying to narrow down the issue. Could you please give this two kext a try and see if the issue resolve?

CPUTune1.8.5.zip
CPUTune1.9.0.zip

Thanks in advance!

1.9.0 is working for sure, that's what I've loaded now. but I get no CPU speed increase, I've the slowest macbook on the planet I think :)

Shall I also try 1.8.5?

syscl commented

@Mrc527 the reason is because when ProcHot is enabled, turbo boost will disable. And there's a restriction in the code logic that only ProcHot or TurboBoost can be enabled at the same time. And the model you have is Broadwell also does not support the HWP such that the frequency of your laptop is stuck.

Let's try a new version and see if this work.

Even the CPUTune2.1.4.zip you proposed hanged the machine, exactly the same way the other kexts did.

Any other attempt I should do?

@christophe-duc are you still interested in a chat to fix this?

syscl commented

I just fixed a kernel panic on platform that does not support HWP/SpeedShift. The CPUTune (v1.9.9+) reads MSR_IA32_HWP_REQUEST on no HWP CPUs, which cause the issue. Feel free to give CPUTune.kext.zip a try and let me know if it works. Thanks!

Hello @syscl, your kext seems to work!
165 0 0xffffff7f83cc8000 0x7000 0x7000 org.syscl.driver.CPUTune (2.1.6) 05EE8DF8-2E80-3443-9E57-0C557ACA2C04 <8 6 5 3 1>

I see it loaded and the system is still running!

But I've the feeling the CPU is still capped at 1GHz, how could I check?

With AppleIntelInfo I see the following:
`AppleIntelInfo.kext v2.9 Copyright © 2012-2017 Pike R. Alpha. All rights reserved.

Settings:

logMSRs..................................: 1
logIGPU..................................: 1
logCStates...............................: 1
logIPGStyle..............................: 1
InitialTSC...............................: 0x104a54410f8 (36 MHz)
MWAIT C-States...........................: 286531872

Processor Brandstring....................: Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz

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) : 0x5053BF3011F00

  • Maximum Non-Turbo Ratio.............. : 0x1F (3100 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) : 0xF156723F14
IA32_APERF.......................(0xE8) : 0x4CA00E947A

MSR_FLEX_RATIO...................(0x194) : 0x0

MSR_IA32_PERF_STATUS.............(0x198) : 0x164E00000A00

  • Current Performance State Value...... : 0xA00 (1000 MHz)

MSR_IA32_PERF_CONTROL............(0x199) : 0xA00

  • Target performance State Value....... : 0xA00 (1000 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) : 0x882F0800

  • 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...................... : 47
  • 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) : 0x222222222222

  • Maximum Ratio Limit for C01.......... : 22 (3400 MHz)
  • Maximum Ratio Limit for C02.......... : 22 (3400 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) : 0x20EAF7E

  • Total Energy Consumed................ : 2106 Joules (Watt = Joules / seconds)

MSR_PP0_POWER_LIMIT..............(0x638) : 0x0

MSR_PP0_ENERGY_STATUS............(0x639) : 0x1093BE6

  • Total Energy Consumed................ : 1060 Joules (Watt = Joules / seconds)

MSR_PP0_POWER_LIMIT..............(0x638) : 0x0

MSR_PP0_ENERGY_STATUS............(0x639) : 0x1093C52

  • Total Energy Consumed................ : 1060 Joules (Watt = Joules / seconds)

MSR_PP1_POWER_LIMIT..............(0x640) : 0x0

MSR_PP1_ENERGY_STATUS............(0x641) : 0x2C3FDA

  • Total Energy Consumed................ : 176 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) : 0x10D75CFC
MSR_PKG_C3_RESIDENCY.............(0x3f8) : 0x4D16CCC
MSR_PKG_C2_RESIDENCY.............(0x60d) : 0x10D75CFC
MSR_PKG_C3_RESIDENCY.............(0x3f8) : 0x4D16CCC
MSR_PKG_C6_RESIDENCY.............(0x3f9) : 0x0
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) : 0x104B3227C16

CPU Ratio Info:

Base Clock Frequency (BLCK)............. : 100 MHz
Maximum Efficiency Ratio/Frequency.......: 5 ( 500 MHz)
Maximum non-Turbo Ratio/Frequency........: 31 (3100 MHz)
Maximum Ratio/Frequency..................: 31 (3100 MHz)

IGPU Info:

IGPU Current Frequency...................: 300 MHz
IGPU Minimum Frequency...................: 300 MHz
IGPU Maximum Non-Turbo Frequency.........: 300 MHz
IGPU Maximum Turbo Frequency.............: 1100 MHz
IGPU Maximum limit.......................: No Limit

P-State ratio * 100 = Frequency in MHz

CPU P-States [ 9 (10) ] 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 ]`

Just for historical purposes: I get the same result with 2.1.7

syscl commented

As per @Mrc527 in the chat, there's no crash anymore. Feel free to report any issue in the new version.