This was fixed way back in 2009 with the 1.2 release.
** Changed in: msr-tools (Ubuntu)
Status: New => Fix Released
--
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to msr-tools in Ubuntu.
https://bugs.launchpad.net/bugs/412375
Title:
Fails to read registers on 32 bit
Status in msr-tools package in Ubuntu:
Fix Released
Bug description:
Binary package hint: msr-tools
This is the same exact bug reported in debian:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495445
On a 32-bit ubuntu system, trying to rdmsr 0xc0010041 or 0xc0010042 gives the
following error:
rdmsr:pread: Invalid argument
or sometimes gives a plain old "0"...
Example:
--------------------------------------
root@evrx:/root/drivers/phc# rdmsr 0xc0010042
rdmsr:pread: Invalid argument
root@evrx:/root/drivers/phc# rdmsr 0xc0010041
rdmsr:pread: Invalid argument
root@evrx:/root/drivers/phc# rdmsr c0010042
0
root@evrx:/root/drivers/phc# rdmsr c0010041
0
---------------------------------------
My very basic python script, however, reads the offsets just fine:
---------------------------------------
#!/usr/bin/env python
import os
MSR_FIDVID_CTL=int(0xc0010041)
MSR_FIDVID_STATUS=int(0xc0010042)
msrfile = os.open("/dev/cpu/0/msr", os.O_RDONLY);
os.lseek(msrfile, MSR_FIDVID_STATUS, 0); ##jump to where current
values lie
value = os.read(msrfile, 8) ##read 8 bytes
print "--- MSR_FIDVID_STATUS ---"
for v in value:
print ord(v)
os.lseek(msrfile, MSR_FIDVID_CTL, 0); ##jump to where target values
lie
value = os.read(msrfile, 8) ##read 8 bytes
print "--- MSR_FIDVID_CTL ---"
for v in value:
print ord(v)
os.close(msrfile)
---------------------------------------
Example Output from my python script:
---------------------------------------
root@evrx:/root/drivers/phc# ./test.py
--- MSR_FIDVID_STATUS ---
0
0
8
17
30
30
17
51
--- MSR_FIDVID_CTL ---
0
30
0
0
1
0
0
0
---------------------------------------
msr-tools from the 1.1.2-1 pkg works fine on 64 bit, just not on 32-bit...
However, they work fine (on 32-bit) if compiled from non-debian/non-
ubuntu sources.
Quote, from the previously mentioned debian bug report on same package:
---------------------------------------
The defines are not being set correctly. Building the debian package it
is compiled like this:
gcc -Wall -g -O2 -g -Wall -O2 -o wrmsr wrmsr.c
gcc -Wall -g -O2 -g -Wall -O2 -o rdmsr rdmsr.c
Building without debian patches it is like this:
gcc -Wall -g -O2 -fomit-frame-pointer -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-o wrmsr wrmsr.c
gcc -Wall -g -O2 -fomit-frame-pointer -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-o rdmsr rdmsr.c
I see the debian patch adds #define __USE_UNIX98 to the source, but that
doesn't appear to be sufficient.
---------------------------------------
Hope this helps..
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/msr-tools/+bug/412375/+subscriptions
--
Mailing list: https://launchpad.net/~kernel-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~kernel-packages
More help : https://help.launchpad.net/ListHelp