Re: 2.6.x BUGs at boot time (APIC related)

From: Denis Vlasenko
Date: Thu Dec 23 2004 - 07:59:36 EST


On Thursday 23 December 2004 09:12, William Lee Irwin III wrote:
> On Wednesday 22 December 2004 17:31, Denis Vlasenko wrote:
> >> if (!apic_id_registered())
> >> BUG(); <=========================
>
> On Thu, Dec 23, 2004 at 11:02:09AM +0000, Denis Vlasenko wrote:
> > Tested with noapic nolapic boot params. Still happens.
> > Call chain is init() -> APIC_init_uniprocessor() ->
> > -> setup_local_APIC(). I am a bit suspicious why
> > APIC_init_uniprocessor() does not bail out
> > if enable_local_apic<0 (i.e. if I boot with "nolapic"):
> > int __init APIC_init_uniprocessor (void)
> > {
> > if (enable_local_apic < 0)
> > clear_bit(X86_FEATURE_APIC,
> > boot_cpu_data.x86_capability); <===== missing "return -1"?
> >
> > if (!smp_found_config && !cpu_has_apic)
> > return -1;
> > ...
>
> Sounds pretty serious. What happens if you add the missing return -1?

Just tested that. It booted ok. Patch is in attachment.
--
vda--- linux-2.6.10-rc3.src/arch/i386/kernel/apic.c.old Mon Dec 20 14:13:59 2004
+++ linux-2.6.10-rc3.src/arch/i386/kernel/apic.c Thu Dec 23 08:54:13 2004
@@ -1250,8 +1250,10 @@
*/
int __init APIC_init_uniprocessor (void)
{
- if (enable_local_apic < 0)
+ if (enable_local_apic < 0) {
clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
+ return -1;
+ }

if (!smp_found_config && !cpu_has_apic)
return -1;