deeveedee Posted March 19, 2022 Share Posted March 19, 2022 (edited) 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 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 March 19, 2022 by deeveedee 1 Link to comment Share on other sites More sharing options...
deeveedee Posted March 19, 2022 Author Share Posted March 19, 2022 I'm not certain, but I think this link implies that changing PL2 is an MSR modification (similar to @Brumbaer's CFGLock method here). Link to comment Share on other sites More sharing options...
rafale77 Posted March 20, 2022 Share Posted March 20, 2022 I am also looking into voltage shift: https://github.com/sicreative/VoltageShift/blob/master/voltageshift_1.25.zip but suspect that CFG_Lock needs to disabled for it to work… 1 Link to comment Share on other sites More sharing options...
Slice Posted March 30, 2022 Share Posted March 30, 2022 Look for msrtool. As far as I remember it is able to modify MSR registers. hwtools for Mavericks and better, DirectHW for macOS Big Sur, superiotool, mptable, osxpmem, iwleeprom, ectool, msrtool, ifdtool, inteltool, nvramtool, pciutils-3.7.0 and Flashrom-1.2 1 2 Link to comment Share on other sites More sharing options...
theroadw Posted March 31, 2022 Share Posted March 31, 2022 Maybe this: https://github.com/syscl/CPUTune 1 Link to comment Share on other sites More sharing options...
deeveedee Posted April 23, 2022 Author Share Posted April 23, 2022 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): Disable SIP Download PikeRAlpha's AppleIntelInfo.kext Build AppleIntelInfo.kext with XCode Change AppleIntelInfo.kext ownership and permissions as per PikeRAlpha's instructions Load AppleIntelInfo.kext with sudo kmutil load -p AppleIntelInfo.kext -z Attempting to load AppleIntelInfo.kext will result in a "you must reboot" error the first time. Reboot (still with SIP disabled) Load (again) AppleIntelInfo.kext using command from Step 5 Open Hackintool v3.8.4 Select the Hackintool Utilities tab and tap the Get AppleIntelInfo icon (icon looks like a CPU) Re-enable SIP and reboot 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 More sharing options...
deeveedee Posted May 3, 2022 Author Share Posted May 3, 2022 (edited) 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 Note that PL2 is 85W, only 10W lower than the HP EliteDesk G5 Mini PL2 for the i9-9900. Edited May 3, 2022 by deeveedee Link to comment Share on other sites More sharing options...
deeveedee Posted May 3, 2022 Author Share Posted May 3, 2022 (edited) 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. 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 May 3, 2022 by deeveedee Link to comment Share on other sites More sharing options...
theroadw Posted May 3, 2022 Share Posted May 3, 2022 I believe you may be able to write to any MSR using https://github.com/sicreative/VoltageShift 1 Link to comment Share on other sites More sharing options...
deeveedee Posted May 3, 2022 Author Share Posted May 3, 2022 @theroadw Thank you. I think I'm discovering the hard way that msrtool can only read MSR values. It would have been convenient if it could write, too. Is this the same VoltageShift referenced by @rafale77 here? Link to comment Share on other sites More sharing options...
rafale77 Posted May 3, 2022 Share Posted May 3, 2022 @deeveedee, Yes it is. Did you actually manage to disable CFG-Lock on your G4/G5? One of your posts suggested that you did? Link to comment Share on other sites More sharing options...
deeveedee Posted May 3, 2022 Author Share Posted May 3, 2022 @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. 1 Link to comment Share on other sites More sharing options...
deeveedee Posted May 3, 2022 Author Share Posted May 3, 2022 (edited) 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 Edited May 3, 2022 by deeveedee Link to comment Share on other sites More sharing options...
deeveedee Posted May 3, 2022 Author Share Posted May 3, 2022 (edited) 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 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 May 3, 2022 by deeveedee Link to comment Share on other sites More sharing options...
deeveedee Posted May 3, 2022 Author Share Posted May 3, 2022 (edited) 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 Geekbench 5 CPU benchmarks after reducing PL1 and PL2 to 25W (from 65W and 85W respectively Spoiler Geekbench 5 CPU benchmarks with unmodied PL1 and PL2 (65W and 85W respectively) Spoiler Next step is to experiment with increased package power limits. Edited May 3, 2022 by deeveedee Link to comment Share on other sites More sharing options...
deeveedee Posted May 4, 2022 Author Share Posted May 4, 2022 (edited) 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 Edited May 4, 2022 by deeveedee Link to comment Share on other sites More sharing options...
WhenMusicAttacks Posted May 4, 2022 Share Posted May 4, 2022 Just use voltageshift to undervolt. 9900 sould use around 120w under full load anyway - and that's for perfectly multithreaded workloads, wich is not a real life usage, just benchmarks 1 Link to comment Share on other sites More sharing options...
deeveedee Posted May 4, 2022 Author Share Posted May 4, 2022 @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 More sharing options...
deeveedee Posted May 4, 2022 Author Share Posted May 4, 2022 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 Link to comment Share on other sites More sharing options...
rafale77 Posted May 4, 2022 Share Posted May 4, 2022 (edited) @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 May 4, 2022 by rafale77 Link to comment Share on other sites More sharing options...
deeveedee Posted May 4, 2022 Author Share Posted May 4, 2022 @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 GB5 CPU benchmarks with PL1=15W and PL2=15W Spoiler 1 Link to comment Share on other sites More sharing options...
rafale77 Posted May 4, 2022 Share Posted May 4, 2022 (edited) @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 May 4, 2022 by rafale77 Link to comment Share on other sites More sharing options...
deeveedee Posted May 5, 2022 Author Share Posted May 5, 2022 @rafale77 When you observed your "low power mode" on your P340, did you capture the actual PL1/PL2 with msrtool, Hackintool or VoltageShift? Link to comment Share on other sites More sharing options...
rafale77 Posted May 5, 2022 Share Posted May 5, 2022 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 More sharing options...
deeveedee Posted May 6, 2022 Author Share Posted May 6, 2022 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 More sharing options...
Recommended Posts