Wierd /proc/cpuinfo with 2.4.11-pre4
Quoted 2 lines
From dmesg:
CPU: Before vendor init, caps: 000001bf 00000000 00000000, vendor = 0 Intel Pentium with F0 0F bug - workaround enabled.
Intel old style machine check architecture supported. Intel old style machine check reporting enabled on CPU#0.
CPU: After vendor init, caps: 000001bf 00000000 00000000 00000000 CPU: After generic, caps: 000001bf 00000000 00000000 00000000 CPU: Common caps: 000001bf 00000000 00000000 00000000 CPU: Intel Pentium 75 - 200 stepping 0b
Checking 'hlt' instruction... OK.
Looks normal. Let's see /proc/cpuinfo...
processor : 0vendor_id : GenuineIntel
cpu family : 5
model : 2
model name : Pentium 75 - 200
stepping : 11
cpu MHz : 132.634fdiv_bug : nohlt_bug : nof00f_bug : yescoma_bug : no
fpu : yesfpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr mce cx8
bogomips : 264.60
processor : 1vendor_id : unknown
cpu family : 0
model : 0
model name : unknown
stepping : 16
cpu MHz : 132.634fdiv_bug : nohlt_bug : nof00f_bug : yescoma_bug : yes
fpu : yesfpu_exception : yes
cpuid level : 0
wp : yes
flags : fpu vme de pse tsc 3dnow lrti
bogomips : 0.02
processor : 2vendor_id : ��0��0�
cpu family : 156
model : 48
model name : �
stepping : 192
cpu MHz : 132.634
cache size : 0 KBfdiv_bug : yeshlt_bug : nof00f_bug : nocoma_bug : no
fpu : yesfpu_exception : yes
cpuid level : 0
wp : yes
flags : fpu de tsc msr pae mce apic pge cmov pat clflush dts ia64 recovery longrun lrti
bogomips : 644790.84
processor : 3vendor_id : L�)�
cpu family : 86
model : 41
model name : ��0���0�
stepping : 192
cache size : 0 KBfdiv_bug : nohlt_bug : yesf00f_bug : nocoma_bug : no
fpu : yesfpu_exception : yes
cpuid level : 1048575
wp : no
flags : syscall 3dnowext 3dnow
bogomips : 0.00
processor : 4vendor_id : ��)���)�}�)�y�)�u�)�p�)�
cpu family : 0
model : 0
model name : u�)�p�)�
stepping : 0
cpu MHz : 132.634fdiv_bug : yeshlt_bug : yesf00f_bug : yescoma_bug : yes
fpu : nofpu_exception : no
cpuid level : 1
wp : no
flags : fpu tsc msr pae mce apic pge cmov pat clflush dts ia64 syscall 3dnowext 3dnow recovery lrti cxmmx centaur_mcr
bogomips : 0.00
processor : 5vendor_id : unknown
cpu family : 0
model : 0
model name : unknown
stepping : 0fdiv_bug : yeshlt_bug : yesf00f_bug : nocoma_bug : yes
fpu : nofpu_exception : no
cpuid level : 0
wp : no
flags : cxmmx k6_mtrr cyrix_arr
bogomips : 0.00
processor : 6vendor_id : unknown
cpu family : 0
model : 0
model name : unknown
stepping : 0
cache size : 0 KBfdiv_bug : nohlt_bug : yesf00f_bug : nocoma_bug : no
fpu : nofpu_exception : no
cpuid level : 0
wp : no
flags :
bogomips : 0.00
processor : 7vendor_id : unknown
cpu family : 0
model : 0
model name : unknown
stepping : 0
cache size : 515 KBfdiv_bug : nohlt_bug : yesf00f_bug : yescoma_bug : yes
fpu : nofpu_exception : no
cpuid level : 0
wp : no
flags :
bogomips : 644464.70
Wow! That's pretty impressive, a new kernel build gives me an additional _7_ CPUs!
Interesting bits of .config:
CONFIG_M586TSC=yCONFIG_X86_MSR=yCONFIG_X86_CPUID=yCONFIG_NOHIGHMEM=y
# CONFIG_HIGHMEM4G is not set
# CONFIG_HIGHMEM64G is not set
# CONFIG_MATH_EMULATION is not setCONFIG_MTRR=y
# CONFIG_SMP is not set
# CONFIG_X86_UP_APIC is not set
# CONFIG_X86_UP_IOAPIC is not set
Won't compile with UP APIC turned on, as others have noted.
Aside from /bin/ps getting confused about the system capabilities, it seems stable.
--Dan
Quoted 15 lines · Dan Merillat
From dmesg:
CPU: Before vendor init, caps:000001bf00000000 00000000, vendor = 0 Intel Pentium with F0 0F bug - workaround enabled.
Intel old style machine check architecture supported. Intel old style machine check reporting enabled on CPU#0.CPU: After vendor init, caps: 000001bf 00000000 00000000 00000000 CPU: After generic, caps: 000001bf 00000000 00000000 00000000 CPU: Common caps: 000001bf 00000000 00000000 00000000 CPU: Intel Pentium 75 - 200 stepping 0bChecking 'hlt' instruction... OK.
Looks normal. Let's see
/proc/cpuinfo...processor : 0
[snip]
Quoted 35 lines
processor : 7
vendor_id: unknown
cpu family : 0
model : 0
model name : unknown
stepping : 0
cache size : 515 KBfdiv_bug: nohlt_bug: yesf00f_bug: yescoma_bug: yes
fpu : nofpu_exception: no
cpuid level : 0
wp : no
flags :
bogomips : 644464.70Wow! That's pretty impressive, a new kernel build gives me an additional _7_ CPUs!
Interesting bits of .config:
CONFIG_M586TSC=yCONFIG_X86_MSR=yCONFIG_X86_CPUID=yCONFIG_NOHIGHMEM=y
#CONFIG_HIGHMEM4Gis not set
#CONFIG_HIGHMEM64Gis not set
#CONFIG_MATH_EMULATIONis not setCONFIG_MTRR=y
#CONFIG_SMPis not set
#CONFIG_X86_UP_APICis not set
#CONFIG_X86_UP_IOAPICis not set
Quoted 4 lines
Won't compile with UP APIC turned on, as others have noted.
Aside from
/bin/psgetting confused about the system capabilities, it seems stable.
Same 8-processor incorrect info on my PIII Dell laptop -
redirecting '/usr/bin/top' stderr gets this:
[asuardi@dolphin linux]$ cat x fscanf failed on /proc/stat for cpu 1 fscanf failed on /proc/stat for cpu 2 fscanf failed on /proc/stat for cpu 3 fscanf failed on /proc/stat for cpu 4 fscanf failed on /proc/stat for cpu 5 fscanf failed on /proc/stat for cpu 6 fscanf failed on /proc/stat for cpu 7 fscanf failed on /proc/stat for cpu 1
So I'd assume anything touching /proc/cpuinfo is hosed.
--alessandro
"this is no time to get cute, it's a mad dog's promenade
so walk tall, or baby don't walk at all"
(Bruce Springsteen, 'New York City Serenade')
Quoted 2 lines
Quoted 2 lines
Wow! That's pretty impressive, a new kernel build gives me an additional _7_ CPUs!
Sorry. Mea culpa
setup.c renamed from setup.c.old +1 -1
@@ -2420,7 +2420,7 @@* WARNING - nasty evil hack ... if we print > 8, it overflows the * page buffer and corrupts memory - this needs fixing properly */ -for (n =0 ; n <8 ; n++, c++) { +for (n =0 ; n < (clustered_apic_mode ?8 :NR_CPUS ); n++, c++) {/* for (n = 0; n < NR_CPUS; n++, c++) { */ int fpu_exception;#ifdef CONFIG_SMP
M.
PS. I just tested this since my last post. It seems to work.
Quoted 18 lines · Martin J. Bligh
Quoted 3 lines
Quoted 3 lines
Wow! That's pretty impressive, a new kernel build gives me an additional _7_ CPUs!
Sorry. Mea culpa
setup.c Fri Oct 5 14:28:51 2001 renamed from setup.c.old Fri Oct 5 14:20:29 2001 +1
-1@@ -2420,7 +2420,7 @@ * WARNING - nasty evil hack ... if we print > 8, it overflows the * page buffer and corrupts memory - this needs fixing properly */ - for (n = 0; n < 8; n++, c++) { + for (n = 0; n < (clustered_apic_mode ? 8 : NR_CPUS); n++, c++) { /* for (n = 0; n < NR_CPUS; n++, c++) { */ int fpu_exception; #ifdef CONFIG_SMP
Quoted 3 lines
M.
PS. I just tested this since my last post. It seems to work.
Doesn't build here...
gcc -D__KERNEL__ -I/share/src/linux-2.4.11-pre4/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=i686 -c -o setup.o setup.csetup.c: In function `get_cpuinfo':
setup.c:2423: `clustered_apic_mode' undeclared (first use in this function)
setup.c:2423: (Each undeclared identifier is reported only once
setup.c:2423: for each function it appears in.)
make[1]: *** [setup.o] Error 1
make[1]: Leaving directory `/share/src/linux-2.4.11-pre4/arch/i386/kernel'
make: *** [_dir_arch/i386/kernel] Error 2
--alessandro
"this is no time to get cute, it's a mad dog's promenade
so walk tall, or baby don't walk at all"
(Bruce Springsteen, 'New York City Serenade')
Quoted 1 line
Doesn't build here...
Looks like you need the other patch I posted here too.
M.
Combined reformated patch below:
arch/i386/kernel/setup.c +1 -1
@@ -2420,7 +2420,7 @@* WARNING - nasty evil hack ... if we print > 8, it overflows the * page buffer and corrupts memory - this needs fixing properly */ -for (n =0 ; n <8 ; n++, c++) { +for (n =0 ; n < (clustered_apic_mode ?8 :NR_CPUS ); n++, c++) {/* for (n = 0; n < NR_CPUS; n++, c++) { */ int fpu_exception;#ifdef CONFIG_SMP
include/asm-i386/smp.h +12 -11
@@ -22,7 +22,7 @@#endif #endif -#if CONFIG_SMP +#ifdef CONFIG_SMP # ifdef CONFIG_MULTIQUAD # define TARGET_CPUS 0xf/* all CPUs in *THIS* quad */ # define INT_DELIVERY_MODE 0/* physical delivery on LOCAL quad */
@@ -31,9 +31,20 @@# define INT_DELIVERY_MODE 1/* logical delivery broadcast to all procs */ # endif #else +# define INT_DELIVERY_MODE 0/* physical delivery on LOCAL quad */ # define TARGET_CPUS 0x01#endif +#ifndef clustered_apic_mode +#ifdef CONFIG_MULTIQUAD +#define clustered_apic_mode (1) +#define esr_disable (1) +#else /* !CONFIG_MULTIQUAD */ +#define clustered_apic_mode (0) +#define esr_disable (0) +#endif /* CONFIG_MULTIQUAD */ +#endif +#ifdef CONFIG_SMP #ifndef ASSEMBLY
@@ -76,16 +87,6 @@extern volatile int physical_apicid_to_cpu[MAX_APICID ];extern volatile int cpu_to_logical_apicid[NR_CPUS ];extern volatile int logical_apicid_to_cpu[MAX_APICID ]; - -#ifndef clustered_apic_mode -#ifdef CONFIG_MULTIQUAD -#define clustered_apic_mode (1) -#define esr_disable (1) -#else /* !CONFIG_MULTIQUAD */ -#define clustered_apic_mode (0) -#define esr_disable (0) -#endif /* CONFIG_MULTIQUAD */ -#endif /* * General functions that each host system must provide.
Quoted 3 lines · Martin J. Bligh
Quoted 1 line
Doesn't build here...
Looks like you need the other patch I posted here too.
Thanks, builds - boots - fixes /proc/cpuinfo on my UP :)
Quoted 55 lines
Combined reformated patch below:
diff -urN
virgin-2.4.11-pre4/arch/i386/kernel/setup.cnuma-2.4.11-pre4/arch/i386/kernel/setup.carch/i386/kernel/setup.c +1
-1@@ -2420,7 +2420,7 @@* WARNING - nasty evil hack ... if we print > 8, it overflows the * page buffer and corrupts memory - this needs fixing properly */ -for (n =0 ; n <8 ; n++, c++) { +for (n =0 ; n < (clustered_apic_mode ?8 :NR_CPUS ); n++, c++) {/* for (n = 0; n < NR_CPUS; n++, c++) { */ int fpu_exception;#ifdef CONFIG_SMP diff -urN
virgin-2.4.11-pre4/include/asm-i386/smp.hnuma-2.4.11-pre4/include/asm-i386/smp.hinclude/asm-i386/smp.h +12
-4@@ -22,7 +22,7 @@#endif #endif -#if CONFIG_SMP +#ifdef CONFIG_SMP # ifdef CONFIG_MULTIQUAD # define TARGET_CPUS 0xf/* all CPUs in *THIS* quad */ # define INT_DELIVERY_MODE 0/* physical delivery on LOCAL quad */ @@ -31,9 +31,20 @@# define INT_DELIVERY_MODE 1/* logical delivery broadcast to all procs */ # endif #else +# define INT_DELIVERY_MODE 0/* physical delivery on LOCAL quad */ # define TARGET_CPUS 0x01#endif +#ifndef clustered_apic_mode +#ifdef CONFIG_MULTIQUAD +#define clustered_apic_mode (1) +#define esr_disable (1) +#else /* !CONFIG_MULTIQUAD */ +#define clustered_apic_mode (0) +#define esr_disable (0) +#endif /* CONFIG_MULTIQUAD */ +#endif +#ifdef CONFIG_SMP #ifndef ASSEMBLY @@ -76,16 +87,6 @@extern volatile int physical_apicid_to_cpu[MAX_APICID ];extern volatile int cpu_to_logical_apicid[NR_CPUS ];extern volatile int logical_apicid_to_cpu[MAX_APICID ]; - -#ifndef clustered_apic_mode -#ifdef CONFIG_MULTIQUAD
include/asm-i386/smp.h line 92
Quoted 10 lines
include/asm-i386/smp.h +0
-7-#define clustered_apic_mode (1) -#define esr_disable (1) -#else /* !CONFIG_MULTIQUAD */ -#define clustered_apic_mode (0) -#define esr_disable (0) -#endif /* CONFIG_MULTIQUAD */ -#endif /* * General functions that each host system must provide.
--alessandro
"this is no time to get cute, it's a mad dog's promenade
so walk tall, or baby don't walk at all"
(Bruce Springsteen, 'New York City Serenade')
Quoted 14 lines · Alessandro Suardi
setup.c Fri Oct 5 14:28:51 2001 line 2426
Quoted 13 lines · Martin J. Bligh
Sorry. Mea culpa
setup.c Fri Oct 5 14:28:51 2001 renamed from setup.c.old Fri Oct 5 14:20:29 2001 +1
-1@@ -2420,7 +2420,7 @@ * WARNING - nasty evil hack ... if we print > 8, it overflows the * page buffer and corrupts memory - this needs fixing properly */ - for (n = 0; n < 8; n++, c++) { + for (n = 0; n < (clustered_apic_mode ? 8 : NR_CPUS); n++, c++) { /* for (n = 0; n < NR_CPUS; n++, c++) { */ int fpu_exception; #ifdef CONFIG_SMP
This will also fail if, for some reason "clustered_apic_mode" is set and you have less than 8 CPUs. What you really want is to have "max(8:NR_CPUS)" in the loop (or make the loop actually work with > 8 CPUs, which is probably the correct solution in the long run).
Cheers, Andreas
--
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert
Quoted 4 lines
This will also fail if, for some reason "
clustered_apic_mode" is set and you have less than 8 CPUs. What you really want is to have "max(8:NR_CPUS)" in the loop (or make the loop actually work with > 8 CPUs, which is probably the correct solution in the long run).
Nope, the cpu_online map should catch this. NR_CPUS is always 32 in SMP mode.
in get_cpuinfo ....
if (!(cpu_online_map & (1<<n)))
continue;I didn't notice that this would only work in SMP mode.
It's a horrible hack, but it's less horrible than corrupting memory randomly ;-)
M.
Quoted 18 lines · Martin J. Bligh
Quoted 3 lines
Quoted 3 lines
Wow! That's pretty impressive, a new kernel build gives me an additional _7_ CPUs!
Sorry. Mea culpa
setup.c Fri Oct 5 14:28:51 2001 renamed from setup.c.old Fri Oct 5 14:20:29 2001 +1
-1@@ -2420,7 +2420,7 @@ * WARNING - nasty evil hack ... if we print > 8, it overflows the * page buffer and corrupts memory - this needs fixing properly */ - for (n = 0; n < 8; n++, c++) { + for (n = 0; n < (clustered_apic_mode ? 8 : NR_CPUS); n++, c++) { /* for (n = 0; n < NR_CPUS; n++, c++) { */ int fpu_exception; #ifdef CONFIG_SMP
Quoted 3 lines
M.
PS. I just tested this since my last post. It seems to work.
It would be more appropriate to do:
for (n = 0; n < min(8, NR_CPUS); n++, c++) {Signature · 1 line
Brian Gerst