Skip to contentSkip to conversation

Linux 2.4.11-pre4

DISCUSSION Martin J. Bligh 2 participants 2 messages Oct 5, 2001 – Oct 6, 2001 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 2 lines

1. OK, it fixes the UP UP_IOAPIC compilation problem. System (with preempt-patch) up and runnig.

Good.

Quoted 2 lines

2. Woohu. I have 8 CPUs, now...;-)
--- /proc is somewhat broken

Bugger. Didn't realise that cpu_online_map didn't get initialised to anything sensible under UP. Should be just cosmetic (it's only the output of /proc/cpuinfo, not the sceduler or anything), but try this (I haven't tested it yet - if it doesn't work, just change the 8 to 1 for a second whilst I fix it properly).

===========================

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

===========================

The reason for this hackery is that get_cpuinfo writes to a page without proper bounds on itself. If you have more than about 8 cpus, it tramples merrily all over the next page, corrupting page tables, etc, etc.

The real fix for this overflow was published here a few weeks ago by James Cleverdon (whom I work with). It's in Alan's tree, but not Linus' as yet.

M.

#2 lore raw

Am Freitag, 5. Oktober 2001 23:35 schrieb Martin J. Bligh:

Quoted 5 lines
Quoted 2 lines

1. OK, it fixes the UP UP_IOAPIC compilation problem. System (with preempt-patch) up and runnig.

Good.

Quoted 8 lines
Quoted 2 lines

2. Woohu. I have 8 CPUs, now...;-)
--- /proc is somewhat broken

Bugger. Didn't realise that cpu_online_map didn't get initialised to anything sensible under UP. Should be just cosmetic (it's only the output of /proc/cpuinfo, not the sceduler or anything), but try this (I haven't tested it yet - if it doesn't work, just change the 8 to 1 for a second whilst I fix it properly).

The first version works nice.

Have a nice weekend.

-Dieter

Quoted 26 lines

===========================

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

===========================

The reason for this hackery is that get_cpuinfo writes to a page without proper bounds on itself. If you have more than about 8 cpus, it tramples merrily all over the next page, corrupting page tables, etc, etc.

The real fix for this overflow was published here a few weeks ago by James Cleverdon (whom I work with). It's in Alan's tree, but not Linus' as yet.

M.