Re: Wierd /proc/cpuinfo with 2.4.11-pre4

Andreas Dilger
2001-10-05T23:18:46Z

On Oct 06, 2001 01:10 +0200, Alessandro Suardi wrote:
> "Martin J. Bligh" wrote:
> > Sorry. Mea culpa
> >
> > --- setup.c.old Fri Oct 5 14:20:29 2001
> > +++ setup.c Fri Oct 5 14:28:51 2001
> > @@ -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