Bug 11074
Summary: | /dev/cpu/*/cpuid malfunctioning | ||
---|---|---|---|
Product: | Platform Specific/Hardware | Reporter: | Peter Ganzhorn (peter.ganzhorn) |
Component: | i386 | Assignee: | platform_i386 |
Status: | CLOSED INVALID | ||
Severity: | normal | CC: | alan |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.25.10 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Peter Ganzhorn
2008-07-12 09:01:36 UTC
I reassigned this to platform_i386@kernel-bugs.osdl.org I have found yet another machine that shows the same erratic behaviour, it's even worse: On the P4 Xeon only cpuid-calls with EAX>=0x80000000h returned random values, on this machine (P4 Prescott) even EAX=0x0h returns random values. I am unable to get one single correct reading from /dev/cpu/0/cpuid on this machine. The testing OS was Knoppix 5.1, running a 2.6.18 kernel. My workstation which returns correct data is running a 2.6.26-rc9 kernel, I'll do some testing with 2.6.25.10 (running on the P4 Xeon) on my workstation, although I doubt this will change too much, as there are no major changes in the kernels cpuid.c since 2.6.25.10. Both machines returning random data have a hyper-threading CPU, my workstation has a multi-core cpu. All CPUs are Intel CPUs, I haven't tested any AMD CPUs so far. Can you please add return value checks to those two functions ? lseek(fd, address, SEEK_SET); read(fd, &data, 16); Thanks, tglx Additionally, to work correct on 32-bit platforms, you need to either compile with -D_FILE_OFFSET_BITS=64 or use open64() and pread64(). In general it is better to use pread() than lseek+read, if not for any other reason than it saves a system call. Oh, and do run strace on your programs for debugging this class of problems. |