Jump to content

Can CPU PL2 be changed with an EFI application (like CFGLock)?


deeveedee
 Share

78 posts in this topic

Recommended Posts

Can CPU PL2 be changed with an EFI application (like CFGLock)?  Details are below...

 

Using PikeRAlpha's AppleIntelInfo.kext and Hackintool v3.8.4, I extracted the Package Power Limits for my rig:

Spoiler

1429617002_ScreenShot2022-03-18at12_54.10PM-2.png.626c82f9c21a4cf57a66ae9b6f9632e6.png

 

As shown in the Hackintool report, HP is programming PL2 to be 95W.  I understand the reduced value because heat dissipation is constrained by the small form factor of my EliteDesk Mini; however, in the event that I am able to improve cooling, I don't believe I will ever be able to achieve increased CPU performance because of the PL2 limit set by HP.

 

Assuming I understand and accept the risks and assuming my rig is able to source enough power, is there a way that I can increase PL2?

 

My system specs are as follows:

  • HP EliteDesk 800 G5 Mini 65W
  • Intel i9-9900 8 Core / 16 Thread, 3.1GHz to 5GHz
  • 32GB DDR4 RAM
  • OC 0.7.9, Big Sur 11.6.5, SMBIOS MacModel MacMini8,1
Edited by deeveedee
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

I had posted this procedure in another forum and am duplicating it here for others who may be interested.  This is how I viewed the PL1 and PL2 configuration for my hack:

 

To view AppleIntelInfo in Big Sur, I did the following (not sure it was all necessary, but this is what I did):

  1. Disable SIP
  2. Download PikeRAlpha's AppleIntelInfo.kext
  3. Build AppleIntelInfo.kext with XCode
  4. Change AppleIntelInfo.kext ownership and permissions as per PikeRAlpha's instructions
  5. Load AppleIntelInfo.kext with 
    sudo kmutil load -p AppleIntelInfo.kext -z

     

  6. Attempting to load AppleIntelInfo.kext will result in a "you must reboot" error the first time. Reboot (still with SIP disabled)
  7. Load (again) AppleIntelInfo.kext using command from Step 5
  8. Open Hackintool v3.8.4
  9. Select the Hackintool Utilities tab and tap the Get AppleIntelInfo icon (icon looks like a CPU)
  10. Re-enable SIP and reboot
  11. To disable SIP, I made the config.plist change on a USB stick and booted with the USB stick. To enable SIP, I removed the USB stick and rebooted.
Link to comment
Share on other sites

  • 2 weeks later...

I have configured an HP EliteDesk 800 G4 Mini (i5-8600) for PL1 / PL2 testing.  I'm currently using a 90W power adapter.  Hackintool v3.8.7 reports the following package power limits:

 

Spoiler

132655055_ScreenShot2022-05-03at9_21_42AM.png.7f62b11343f894c360a9bdc32f61f141.png

 

Note that PL2 is 85W, only 10W lower than the HP EliteDesk G5 Mini PL2 for the i9-9900.

Edited by deeveedee
Link to comment
Share on other sites

UPDATE: Using msrtool, I am able to read MSR at address 0x610 and find that it is consistent with the value reported by Hackintool.  Now I just need to figure out how to write a new MSR value.

 

357206822_ScreenShot2022-05-03at2_09_17PM.png.a3878e419bfb8167b819629061976f6c.png

 

Leaving the content below to record the history of my findings...

 

===========================================

 

@Slice Thank you for your referral to msrtool.  After following the build instructions here, I have successfully built msrtool and am able to run it on my rig running Big Sur 11.6.5.  My first use of msrtool was to run it with arg "-kl" to list all known MSRs and bit fields.

sudo msrtool -kl

Unfortunately, msrtool does not list package power limits in its known MSRs.  I'm still experimenting with msrtool to see if it can be used to adjust package power limits on my CoffeeLake platform.

Edited by deeveedee
Link to comment
Share on other sites

@rafale77 Bit 63 of the MSR is 0, which seems to indicate that this value is unlocked.  I am able to write new values and read the modified values back from address 0x610.  Just starting to run tests to see if I notice any performance differences.

  • Like 1
Link to comment
Share on other sites

For others who want to experiment with package power limits, it does appear that VoltageShift is able to modify MSR at 0x610.  I have determined that the PL1 and PL2 power limits are stored as 8x their value in watts (e.g. 95W is stored as 8*95=760d=0x2F8.

 

My notes are below...

Spoiler

965737586_ScreenShot2022-05-03at4_14_12PM.png.59518cf31764a2e490afdf4f97e020aa.png

 

Edited by deeveedee
Link to comment
Share on other sites

Leaving this for historical purposes, but this is inaccurate - see next post.

 

While I am able to write modified values to MSR address 0x610 and then read those changed values back, I am not able to demonstrate that the modified values affect performance.  For example, I reduced PL2 to 65W (from 85W) on my EliteDesk 800 G4 Mini, but GeekBench 5 CPU results didn't change.  The modified MSR values do not survive reboot, so maybe the changed values have to be read during boot-up and the only way this works is if the change is applied using an EFI tool like CFGLock.  I don't know much about this, so I welcome another explanation.

 

This Hackintool report shows the package power limits after I used VoltageShift to change PL2 to 65W (before a reboot):

Spoiler

594073459_ScreenShot2022-05-03at4_31_05PM.png.573eb719d2facc882ca05ceedf3626b7.png

 

Note that I tried to reduce both PL1 and PL2 to 25W (8*25 = 200d = 0xc8), but I was not able to write 0xc8 to PL1 and PL2.  There appears to be a lower limit of PL1 and PL2 on this G4 Mini.

 

If others want to experiment and report here, that would be great.  I'm finished with my experiments for now.

Edited by deeveedee
Link to comment
Share on other sites

I tried one more time to change PL1 and PL2 to 25W (to demonstrate that I could safely affect performance).  Lowering PL1 and PL2 to 25W does reduce performance of my EliteDesk 800 G4 Mini, so changing the package power limits does affect performance.

 

Hackintool report of 25W package power limits

Spoiler

42151906_ScreenShot2022-05-03at5_29_32PM.png.befbdf17aa0250d84926982ee5e50a49.png

 

Geekbench 5 CPU benchmarks after reducing PL1 and PL2 to 25W (from 65W and 85W respectively

Spoiler

1950214674_ScreenShot2022-05-03at5_34_20PM.png.d491d0467dc0bc91869be2116f15555c.png

 

 

Geekbench 5 CPU benchmarks with unmodied PL1 and PL2 (65W and 85W respectively)

Spoiler

739056144_ScreenShot2022-05-03at4_33_46PM.png.a2c857d9eb2d228e21f07f44dda96ec1.png

 

 

Next step is to experiment with increased package power limits.

 

Edited by deeveedee
Link to comment
Share on other sites

I have not been able to write MSR at address 0x610 after the first couple of writes.  I don't believe that I am doing anything differently and don't understand what changed.  I am not conducting this testing on my production rig and would advise others to perform this experimentation on a test rig if possible.

 

Edit: My ability to write MSRs is inconsistent.  I was able to modify PL1 (changing it from 65W to 75W), but with the i5-8600, the increased PL1 did not affect GB5 CPU benchmarks.  I was also able to disable package clamping limit #1.  I don't know what it does, but I changed it to prove that I could.

Spoiler

1375089199_ScreenShot2022-05-03at10_15_10PM.png.c45b334672871fffb3d19335a74bb1b6.png

 

Edited by deeveedee
Link to comment
Share on other sites

@WhenMusicAttacks Thank you for the feedback.  My experience with the i9-9900 is consistent with your observation.  I was attempting to adjust PL1 and PL2 just to prove that I could, but real applications (like software builds) don't tax the CPU like synthetic benchmarks.  Do you have any suggestions for other tools that can write to MSRs?

Link to comment
Share on other sites

I figured out why my MSR writes were unreliable.  It turns out that I can't have AppleIntelInfo.kext loaded when I do the MSR writes with VoltageShift.  If I first write MSR at 0x610 with VoltageShift and then load AppleIntelInfo.kext (so Hackintool can read it), the write is successful. I was able to change PL2 to 101W and PL1 to 75W on my EliteDesk 800 G4 Mini with i5-8600.  Still testing before I try with my G5 / i9-9900.

 

Spoiler

1354127929_ScreenShot2022-05-04at12_47_55PM.png.bfdae20aca74e54ad43ff41ef041a0f8.png

 

Link to comment
Share on other sites

@deeveedee, congratulations on getting to the PL values! I supposed you have a 150W power brick correct?

My research about the coffee lake i9 lead me to very different conclusions from @WhenMusicAttacks,

Someone ran pretty extensive tests on another forum and concluded the following default power limits:

9900: PL1= 65W, PL2= 225W

9900K: PL1=95W, PL2= 255W

9900T: PL1=35W, PL2= 105W

 

On the Lenovo P330 Vs. M920X, this has explained a number of reports from users experiencing improved CPU performance on the 9900T going from a 90W power brick to 135W. The Lenovo though is able to adjust power limits according to the AC power brick it is plugged to. Not so on the HP. As you know I have switched to the Lenovo P340tiny and have observed a PL2 of 135W on the 10900 which has a default PL2 also of 225W which also explains why there is still a gap in multi core performance between what I am observing and the average for that CPU.

 

That being said, lowering the voltage should also help improve performance by decreasing thermal throttling…

 

Edited by rafale77
Link to comment
Share on other sites

@rafale77 I'm still testing my G4 Mini / i5-8600 with 90W adapter.  I am now confident that I can change PL1 and PL2 at will and can see performance changes resulting from the modified PL1 / PL2 values.  Here, for example, is GB5 when PL1 and PL2 are set to 15W.

 

Hackintool MSR_PKG_POWER_LIMIT

Spoiler

118614265_ScreenShot2022-05-04at1_34_37PM.png.b5c3ea33fd41886d45d98790cc985b5c.png

 

GB5 CPU benchmarks with PL1=15W and PL2=15W

Spoiler

300461188_ScreenShot2022-05-04at1_40_01PM.png.93c213119d6e7ecff52949726c578e40.png

 

  • Like 1
Link to comment
Share on other sites

@deeveedee, I am actually a bit surprised you got such high scores with 15W PL1/PL2. I am saying this because, as I mentioned I in my P340 thread, I accidentally set my machine in low power mode. I used HWMonitor to keep an eye on my power consumption and noticed that under GB5, power consumption would never exceed 15W. I deduced that my machine was likely running at 15W PL1/PL2. The i9 10900 was slow to a crawl scoring 200/1700 Vs 1370/9600 under normal condition of 65W/135W.

 

Your results definitely show something is happening so I am looking forward to see results in the other direction. Lowering voltage may actually help the CPU maintain higher clock while still being under the voltage limit for turbo boost so it’s the other thing to try to improve performance. Based on others experience, you could try decreasing by 40mV and up to 70mV.

Edited by rafale77
Link to comment
Share on other sites

No I did not. I have been strictly using observing the power consumption and temperatures from HWMonitor. It’s a good idea though for me to go check what the MSR says if it happens again. I am travelling at the moment so won’t be able to test for a couple of weeks but I intend on using this fork of Voltageshift: https://github.com/zspherez/VoltageShift

It would allow to keep MacOS “vanilla” and inject the kext in opencore while keeping SIP enabled.

Link to comment
Share on other sites

I thought I had a 150W power adapter for my EliteDesk Minis, but I have nothing more powerful than 90W.  Hopefully there's enough info in this thread to encourage/allow others to pick-up where I left off.

Link to comment
Share on other sites

 Share

×
×
  • Create New...