Re: [PATCH] Disable APIC on reboot.

From: Mikael Pettersson (mikpe_at_csd.uu.se)
Date: 08/11/03

  • Next message: Mike Galbraith: "Re: [PATCH]O14int"
    Date:	Mon, 11 Aug 2003 18:29:21 +0200
    To: davej@redhat.com
    
    

    davej@redhat.com writes:
    > diff -urpN --exclude-from=/home/davej/.exclude bk-linus/arch/i386/kernel/reboot.c linux-2.5/arch/i386/kernel/reboot.c
    > --- bk-linus/arch/i386/kernel/reboot.c 2003-05-13 11:51:12.000000000 +0100
    > +++ linux-2.5/arch/i386/kernel/reboot.c 2003-07-16 02:54:29.000000000 +0100
    > @@ -8,6 +8,7 @@
    > #include <linux/interrupt.h>
    > #include <linux/mc146818rtc.h>
    > #include <asm/uaccess.h>
    > +#include <asm/apic.h>
    > #include "mach_reboot.h"
    >
    > /*
    > @@ -250,6 +251,19 @@ void machine_restart(char * __unused)
    > */
    > smp_send_stop();
    > disable_IO_APIC();
    > +#else
    > +#ifdef CONFIG_X86_LOCAL_APIC
    > + {
    > + unsigned int l, h;
    > +
    > + local_irq_disable();
    > + disable_local_APIC();
    > + rdmsr(MSR_IA32_APICBASE, l, h);
    > + l &= ~MSR_IA32_APICBASE_ENABLE;
    > + wrmsr(MSR_IA32_APICBASE, l, h);
    > + local_irq_enable();
    > +}
    > +#endif

    I agree we should probably disable the local APIC at reboot if we
    enabled it previously, but this patch is broken. CONFIG_X86_LOCAL_APIC
    doesn't imply that the CPU actually has one, and even if it does, the
    access method may be different (e.g. P5 vs P6/K7/P4, and who knows how
    the future C3 with local APIC will do it).

    Only apic.c knows how the local APIC was initialised (if at all), so the
    "disable it dammit" procedure needs to be in apic.c too.

    Was the original bug report posted to LKML? I don't remember seeing it.

    /Mikael
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Mike Galbraith: "Re: [PATCH]O14int"

    Relevant Pages

    • Re: Linux 2.6.9-rc2
      ... > makes my computer lock up or instantly reboot when I try to do a tv ... > recording with mplayer. ... I think the patch below should be applied before 2.6.9. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: X86_64: 2.6.12-rc3 spontaneous reboot
      ... > I ran it with netconsole, ... I tried starting uml with and without the patch, ... this change up to HEAD, it doesn't always instantly reboot, but ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] MAX_USER_RT_PRIO and MAX_RT_PRIO are wrong!
      ... On Tue, 2005-06-07 at 07:33 +0200, Ingo Molnar wrote: ... >> reboot. ... If this patch does go in, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Linux 2.6.9-rc2
      ... >> makes my computer lock up or instantly reboot when I try to do a tv ... >> recording with mplayer. ... > I think the patch below should be applied before 2.6.9. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: sms 2003 patch management is brutal!
      ... SMS client computer to run this taks. ... >> You don't re-select it when running the Distribute Software Updates>> Wizard. ... SMS patch management is>>>> extremely ... >>>>> requires a reboot is installed without rebooting the patch isn't ...
      (microsoft.public.sms.admin)