From de31b7bf5df5af545792cbd9959580827bc19b1b Mon Sep 17 00:00:00 2001 From: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com> Date: Sun, 26 Apr 2026 19:44:38 +0200 Subject: [PATCH] Fix PTL voltage (#2351) * Fix PTL voltage * Formatting --- .../Hardware/Cpu/IntelCpu.cs | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/LibreHardwareMonitorLib/Hardware/Cpu/IntelCpu.cs b/LibreHardwareMonitorLib/Hardware/Cpu/IntelCpu.cs index 489704d..2545c56 100644 --- a/LibreHardwareMonitorLib/Hardware/Cpu/IntelCpu.cs +++ b/LibreHardwareMonitorLib/Hardware/Cpu/IntelCpu.cs @@ -712,17 +712,40 @@ internal sealed class IntelCpu : GenericCpu } } - if (_coreVoltage != null && _pawnModule.ReadMsr(IA32_PERF_STATUS, out _, out uint edx)) + if (_coreVoltage != null && _pawnModule.ReadMsr(IA32_PERF_STATUS, out eax, out uint edx)) { - _coreVoltage.Value = ((edx >> 32) & 0xFFFF) / (float)(1 << 13); + uint vidBits = edx & 0xFFFF; + if (vidBits == 0) + vidBits = edx & 0xFFFF; + + if (vidBits > 0) + { + _coreVoltage.Value = vidBits / 8192.0f; + } + else + { + _coreVoltage.Value = 0; + } } for (int i = 0; i < _coreVIDs?.Length; i++) { - if (_pawnModule.ReadMsr(IA32_PERF_STATUS, out _, out edx, _cpuId[i][0].Affinity) && ((edx >> 32) & 0xFFFF) > 0) + + if (_pawnModule.ReadMsr(IA32_PERF_STATUS, out eax, out edx, _cpuId[i][0].Affinity)) { - _coreVIDs[i].Value = ((edx >> 32) & 0xFFFF) / (float)(1 << 13); - ActivateSensor(_coreVIDs[i]); + uint vidBitsLoop = edx & 0xFFFF; + if (vidBitsLoop == 0) + vidBitsLoop = eax & 0xFFFF; + + if (vidBitsLoop > 0) + { + _coreVIDs[i].Value = vidBitsLoop / 8192.0f; + ActivateSensor(_coreVIDs[i]); + } + else + { + DeactivateSensor(_coreVIDs[i]); + } } else {