Hi, Yes, that patch addresses the problem.
The 3.0.4 compiler generates codes that works. The bottom line is that it is a weird combination of `dead code' in the kernel and code generation bug. Thanks to all of you! On Wed, 2002-05-15 at 21:34, Christopher C. Chimelis wrote: > > On 13 May 2002, Frederic Roussel wrote: > > > Package: gcc-2.95 > > Version: 1:2.95.4-9 > > Severity: normal > > > > -- System Information > > Debian Release: 3.0 > > Kernel Version: Linux big2 2.4.19-pre8-30 #1 SMP Mon May 13 18:01:01 PDT > > 2002 alpha unknown > > > > Versions of the packages gcc-2.95 depends on: > > ii binutils 2.12.90.0.1-5 The GNU assembler, linker and binary > > utiliti > > ii cpp-2.95 2.95.4-9 The GNU C preprocessor. > > ii gcc 2.95.4-14 The GNU C compiler. > > ii libc6.1 2.2.5-6 GNU C Library: Shared libraries and > > Timezone > > > > If I compile a kernel 2.4.x (I tried with x >= 17) on a Compaq DS20, the > > newly compiled kernel oopses in the fontion: > > smp_tune_scheduling defined in file arch/alpha/kernel/smp.c > > > > The `switch' statement in that function is where the Oops happens, at > > least I believe so: as an experiment I've hard-coded the `on_chip_cache' > > variable and commented out the whole switch, the kernel booted up fine. > > > > I compiled with gcc-3.0.4 and the problem disappeared. > > Try the patch below to see if it fixes things. There is a code generation > problem in 2.95.4, but it's mostly irrelevent since the kernel code that's > being miscompiled doesn't even need to be used in the 2.4 kernels. I > tried submitting this patch to upstream kernel folks, but it got ignored > several times and I didn't have the time to follow up further. > > C > > Index: arch/alpha/kernel/smp.c > =================================================================== > RCS file: /home/cvs/linux-24/arch/alpha/kernel/smp.c,v > retrieving revision 1.1.1.4 > retrieving revision 1.4 > diff -u -r1.1.1.4 -r1.4 > --- arch/alpha/kernel/smp.c 11 Oct 2001 15:41:35 -0000 1.1.1.4 > +++ arch/alpha/kernel/smp.c 11 Oct 2001 15:51:36 -0000 1.4 > @@ -80,7 +80,6 @@ > int smp_num_probed; /* Internal processor count */ > int smp_num_cpus = 1; /* Number that came online. */ > int smp_threads_ready; /* True once the per process idle is > forked. */ > -cycles_t cacheflush_time; > > int __cpu_number_map[NR_CPUS]; > int __cpu_logical_map[NR_CPUS]; > @@ -212,63 +211,6 @@ > > > /* > - * Rough estimation for SMP scheduling, this is the number of cycles it > - * takes for a fully memory-limited process to flush the SMP-local cache. > - * > - * We are not told how much cache there is, so we have to guess. > - */ > -static void __init > -smp_tune_scheduling (int cpuid) > -{ > - struct percpu_struct *cpu; > - unsigned long on_chip_cache; > - unsigned long freq; > - > - cpu = (struct percpu_struct*)((char*)hwrpb + hwrpb->processor_offset > - + cpuid * hwrpb->processor_size); > - switch (cpu->type) > - { > - case EV45_CPU: > - on_chip_cache = 16 + 16; > - break; > - > - case EV5_CPU: > - case EV56_CPU: > - on_chip_cache = 8 + 8 + 96; > - break; > - > - case PCA56_CPU: > - on_chip_cache = 16 + 8; > - break; > - > - case EV6_CPU: > - case EV67_CPU: > - on_chip_cache = 64 + 64; > - break; > - > - default: > - on_chip_cache = 8 + 8; > - break; > - } > - > - freq = hwrpb->cycle_freq ? : est_cycle_freq; > - > -#if 0 > - /* Magic estimation stolen from x86 port. */ > - cacheflush_time = freq / 1024L * on_chip_cache / 5000L; > - > - printk("Using heuristic of %d cycles.\n", > - cacheflush_time); > -#else > - /* Magic value to force potential preemption of other CPUs. */ > - cacheflush_time = INT_MAX; > - > - printk("Using heuristic of %d cycles.\n", > - cacheflush_time); > -#endif > -} > - > -/* > * Send a message to a secondary's console. "START" is one such > * interesting message. ;-) > */ > @@ -607,7 +549,6 @@ > current->processor = boot_cpuid; > > smp_store_cpu_info(boot_cpuid); > - smp_tune_scheduling(boot_cpuid); > smp_setup_percpu_timer(boot_cpuid); > > init_idle(); -- Frederic.R.Roussel -o) (o- /\\ Join the penguin force (o_ (o_ //\ _\_v The Linux G3N3R47!0N (/)_ (/)_ v_/_ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]