Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Richland Kaveri] IddVal returns false value for highest P-state #8

Open
vinibali opened this issue Feb 20, 2019 · 2 comments
Open

Comments

@vinibali
Copy link

Hello Kevin,

I just found this small bug, this case the calculated Wattage is inaccurate.
You'll find the values returned for Richland:

Voltage ID encodings: SVI (serial)
Detected CPU model 13h, from family 15h with 4 CPU cores.

Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     25      0     28  20.50x 4100MHz  1375mV    166     10  16.60A   22.83W
      1      1     23      0     32  19.50x 3900MHz  1350mV    191     10  19.10A   25.79W
      2      1     21      0     48  18.50x 3700MHz  1250mV    157     10  15.70A   19.62W
      3      1     19      0     58  17.50x 3500MHz  1188mV    118     10  11.80A   14.01W
      4      1     16      0     68  16.00x 3200MHz  1125mV    100     10  10.00A   11.25W
      5      1     11      0     78  13.50x 2700MHz  1062mV     79     10   7.90A    8.39W
current      1     19      0     58  17.50x 3500MHz  1188mV

Core 1 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     25      0     28  20.50x 4100MHz  1375mV    166     10  16.60A   22.83W
      1      1     23      0     32  19.50x 3900MHz  1350mV    191     10  19.10A   25.79W
      2      1     21      0     48  18.50x 3700MHz  1250mV    157     10  15.70A   19.62W
      3      1     19      0     58  17.50x 3500MHz  1188mV    118     10  11.80A   14.01W
      4      1     16      0     68  16.00x 3200MHz  1125mV    100     10  10.00A   11.25W
      5      1     11      0     78  13.50x 2700MHz  1062mV     79     10   7.90A    8.39W
current      1     19      0     58  17.50x 3500MHz  1188mV

Core 2 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     25      0     28  20.50x 4100MHz  1375mV    166     10  16.60A   22.83W
      1      1     23      0     32  19.50x 3900MHz  1350mV    191     10  19.10A   25.79W
      2      1     21      0     48  18.50x 3700MHz  1250mV    157     10  15.70A   19.62W
      3      1     19      0     58  17.50x 3500MHz  1188mV    118     10  11.80A   14.01W
      4      1     16      0     68  16.00x 3200MHz  1125mV    100     10  10.00A   11.25W
      5      1     11      0     78  13.50x 2700MHz  1062mV     79     10   7.90A    8.39W
current      1     19      0     58  17.50x 3500MHz  1188mV

Core 3 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     25      0     28  20.50x 4100MHz  1375mV    166     10  16.60A   22.83W
      1      1     23      0     32  19.50x 3900MHz  1350mV    191     10  19.10A   25.79W
      2      1     21      0     48  18.50x 3700MHz  1250mV    157     10  15.70A   19.62W
      3      1     19      0     58  17.50x 3500MHz  1188mV    118     10  11.80A   14.01W
      4      1     16      0     68  16.00x 3200MHz  1125mV    100     10  10.00A   11.25W
      5      1     11      0     78  13.50x 2700MHz  1062mV     79     10   7.90A    8.39W
current      1     19      0     58  17.50x 3500MHz  1188mV
Northbridge:
P-State 0: 64 (vid),  1150mV, 1600MHz
P-State 1: 66 (vid),  1138mV, 400MHz
P-State 2: 66 (vid),  1138mV, 400MHz
P-State 3: 66 (vid),  1138mV, 400MHz

and Kaveri:

Voltage ID encodings: SVI (serial)
Detected CPU model 30h, from family 15h with 4 CPU cores.

Core 0 | P-State Limits (non-turbo): Highest: 3 ; Lowest 5 | Current P-State: 3
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     22      0     20  19.00x 3800MHz  1425mV    130     10  13.00A   18.52W
      1      1     21      0     24  18.50x 3700MHz  1400mV    215     10  21.50A   30.10W
      2      1     17      0     44  16.50x 3300MHz  1275mV    150     10  15.00A   19.12W
      3      1     15      0     50  15.50x 3100MHz  1238mV    100     10  10.00A   12.38W
      4      1     12      0     62  14.00x 2800MHz  1162mV     87     10   8.70A   10.11W
      5      1      8      0     74  12.00x 2400MHz  1088mV     72     10   7.20A    7.83W
current      1      8      0     74  12.00x 2400MHz  1088mV

Core 1 | P-State Limits (non-turbo): Highest: 3 ; Lowest 5 | Current P-State: 3
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     22      0     20  19.00x 3800MHz  1425mV    130     10  13.00A   18.52W
      1      1     21      0     24  18.50x 3700MHz  1400mV    215     10  21.50A   30.10W
      2      1     17      0     44  16.50x 3300MHz  1275mV    150     10  15.00A   19.12W
      3      1     15      0     50  15.50x 3100MHz  1238mV    100     10  10.00A   12.38W
      4      1     12      0     62  14.00x 2800MHz  1162mV     87     10   8.70A   10.11W
      5      1      8      0     74  12.00x 2400MHz  1088mV     72     10   7.20A    7.83W
current      1      8      0     74  12.00x 2400MHz  1088mV

Core 2 | P-State Limits (non-turbo): Highest: 3 ; Lowest 5 | Current P-State: 3
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     22      0     20  19.00x 3800MHz  1425mV    130     10  13.00A   18.52W
      1      1     21      0     24  18.50x 3700MHz  1400mV    215     10  21.50A   30.10W
      2      1     17      0     44  16.50x 3300MHz  1275mV    150     10  15.00A   19.12W
      3      1     15      0     50  15.50x 3100MHz  1238mV    100     10  10.00A   12.38W
      4      1     12      0     62  14.00x 2800MHz  1162mV     87     10   8.70A   10.11W
      5      1      8      0     74  12.00x 2400MHz  1088mV     72     10   7.20A    7.83W
current      1      8      0     74  12.00x 2400MHz  1088mV

Core 3 | P-State Limits (non-turbo): Highest: 3 ; Lowest 5 | Current P-State: 3
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     22      0     20  19.00x 3800MHz  1425mV    130     10  13.00A   18.52W
      1      1     21      0     24  18.50x 3700MHz  1400mV    215     10  21.50A   30.10W
      2      1     17      0     44  16.50x 3300MHz  1275mV    150     10  15.00A   19.12W
      3      1     15      0     50  15.50x 3100MHz  1238mV    100     10  10.00A   12.38W
      4      1     12      0     62  14.00x 2800MHz  1162mV     87     10   8.70A   10.11W
      5      1      8      0     74  12.00x 2400MHz  1088mV     72     10   7.20A    7.83W
current      1      8      0     74  12.00x 2400MHz  1088mV
Northbridge:
P-State 0: 66 (vid),  1138mV, 1600MHz
P-State 1: 74 (vid),  1088mV, 400MHz
P-State 2: 80 (vid),  1050mV, 400MHz
P-State 3: 96 (vid),   950mV, 400MHz

Unfortunately I couldn't figure out how to convert the "39:32" bits to hex format for reading with rdmsr.
I tried to understand the getDec function, but no success...

Best regards

@vinibali
Copy link
Author

vinibali commented Mar 4, 2019

Running the program with the debug flag, shows the registers :)

A10-7800

Voltage ID encodings: SVI (serial)
Detected CPU model 30h, from family 15h with 4 CPU cores.
DEBUG: Getting data from CPU 0 at register c0010061
DEBUG: Getting data from CPU 0 at register c0010063

Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0DEBUG: Getting data from CPU 0 at register c0010064
      1     23      0     22  19.50x 3900MHz  1412mV    137     10  13.70A   19.35W
      1DEBUG: Getting data from CPU 0 at register c0010065
      1     22      0     26  19.00x 3800MHz  1388mV    220     10  22.00A   30.52W
      2DEBUG: Getting data from CPU 0 at register c0010066
      1     20      0     34  18.00x 3600MHz  1338mV    190     10  19.00A   25.41W
      3DEBUG: Getting data from CPU 0 at register c0010067
      1     19      0     38  17.50x 3500MHz  1312mV    150     10  15.00A   19.69W
      4DEBUG: Getting data from CPU 0 at register c0010068
      1     14      0     64  15.00x 3000MHz  1150mV    105     10  10.50A   12.07W
      5DEBUG: Getting data from CPU 0 at register c0010069
      1      9      0     80  12.50x 2500MHz  1050mV     77     10   7.70A    8.08W
currentDEBUG: Getting data from CPU 0 at register c0010071
      1     19      0     38  17.50x 3500MHz  1312mV
DEBUG: Getting data from CPU 1 at register c0010061
DEBUG: Getting data from CPU 1 at register c0010063

Core 1 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0DEBUG: Getting data from CPU 1 at register c0010064
      1     23      0     22  19.50x 3900MHz  1412mV    137     10  13.70A   19.35W
      1DEBUG: Getting data from CPU 1 at register c0010065
      1     22      0     26  19.00x 3800MHz  1388mV    220     10  22.00A   30.52W
      2DEBUG: Getting data from CPU 1 at register c0010066
      1     20      0     34  18.00x 3600MHz  1338mV    190     10  19.00A   25.41W
      3DEBUG: Getting data from CPU 1 at register c0010067
      1     19      0     38  17.50x 3500MHz  1312mV    150     10  15.00A   19.69W
      4DEBUG: Getting data from CPU 1 at register c0010068
      1     14      0     64  15.00x 3000MHz  1150mV    105     10  10.50A   12.07W
      5DEBUG: Getting data from CPU 1 at register c0010069
      1      9      0     80  12.50x 2500MHz  1050mV     77     10   7.70A    8.08W
currentDEBUG: Getting data from CPU 1 at register c0010071
      1     19      0     38  17.50x 3500MHz  1312mV
DEBUG: Getting data from CPU 2 at register c0010061
DEBUG: Getting data from CPU 2 at register c0010063

Core 2 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0DEBUG: Getting data from CPU 2 at register c0010064
      1     23      0     22  19.50x 3900MHz  1412mV    137     10  13.70A   19.35W
      1DEBUG: Getting data from CPU 2 at register c0010065
      1     22      0     26  19.00x 3800MHz  1388mV    220     10  22.00A   30.52W
      2DEBUG: Getting data from CPU 2 at register c0010066
      1     20      0     34  18.00x 3600MHz  1338mV    190     10  19.00A   25.41W
      3DEBUG: Getting data from CPU 2 at register c0010067
      1     19      0     38  17.50x 3500MHz  1312mV    150     10  15.00A   19.69W
      4DEBUG: Getting data from CPU 2 at register c0010068
      1     14      0     64  15.00x 3000MHz  1150mV    105     10  10.50A   12.07W
      5DEBUG: Getting data from CPU 2 at register c0010069
      1      9      0     80  12.50x 2500MHz  1050mV     77     10   7.70A    8.08W
currentDEBUG: Getting data from CPU 2 at register c0010071
      1     19      0     38  17.50x 3500MHz  1312mV
DEBUG: Getting data from CPU 3 at register c0010061
DEBUG: Getting data from CPU 3 at register c0010063

Core 3 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0DEBUG: Getting data from CPU 3 at register c0010064
      1     23      0     22  19.50x 3900MHz  1412mV    137     10  13.70A   19.35W
      1DEBUG: Getting data from CPU 3 at register c0010065
      1     22      0     26  19.00x 3800MHz  1388mV    220     10  22.00A   30.52W
      2DEBUG: Getting data from CPU 3 at register c0010066
      1     20      0     34  18.00x 3600MHz  1338mV    190     10  19.00A   25.41W
      3DEBUG: Getting data from CPU 3 at register c0010067
      1     19      0     38  17.50x 3500MHz  1312mV    150     10  15.00A   19.69W
      4DEBUG: Getting data from CPU 3 at register c0010068
      1     14      0     64  15.00x 3000MHz  1150mV    105     10  10.50A   12.07W
      5DEBUG: Getting data from CPU 3 at register c0010069
      1      9      0     80  12.50x 2500MHz  1050mV     77     10   7.70A    8.08W
currentDEBUG: Getting data from CPU 3 at register c0010071
      1     19      0     38  17.50x 3500MHz  1312mV
Northbridge:
DEBUG: Getting data from PCI config space address 160 at location /proc/bus/pci/00/18.5
P-State 0: 66 (vid),  1138mV, 1600MHz
DEBUG: Getting data from PCI config space address 164 at location /proc/bus/pci/00/18.5
P-State 1: 74 (vid),  1088mV, 1400MHz
DEBUG: Getting data from PCI config space address 168 at location /proc/bus/pci/00/18.5
P-State 2: 80 (vid),  1050mV, 1200MHz
DEBUG: Getting data from PCI config space address 16c at location /proc/bus/pci/00/18.5
P-State 3: 96 (vid),   950mV, 1100MHz

@vinibali
Copy link
Author

vinibali commented Mar 4, 2019

CPU #3
Register Value
c0010064 8000018900002c17
c0010065 800001dc00003416
c0010066 800001be00004414
c0010067 8000019600004c13
c0010068 800001690000800e
c0010069 8000014d0000a009
c0010071 83ce000636434c13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant