It is currently Sun, 09 Aug 2020 02:51:52 GMT



 
Author Message
 [2.5-AC] Forced enable/disable local APIC
The DMI stuff should be fine too.

Index: linux-2.5.45-ac1/arch/i386/kernel/apic.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.45-ac1/arch/i386/kernel/apic.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 apic.c
--- linux-2.5.45-ac1/arch/i386/kernel/apic.c    5 Nov 2002 04:47:02 -0000       1.1.1.1
+++ linux-2.5.45-ac1/arch/i386/kernel/apic.c    6 Nov 2002 00:19:38 -0000
@@ -609,11 +609,27 @@

 #endif /* CONFIG_PM */

+int enable_local_apic_flag __initdata = 0; /* 0=probe, 1=force, 2=disable e.g. DMI */
+
+static int __init nolapic_setup(char *str)
+{
+       enable_local_apic_flag = 2;
+       return 1;
+}
+
+static int __init lapic_setup(char *str)
+{
+       enable_local_apic_flag = 1;
+       return 1;
+}
+
+__setup("nolapic", nolapic_setup);
+__setup("lapic", lapic_setup);
+
 /*
  * Detect and enable local APICs on non-SMP boards.
  * Original code written by Keir Fraser.
  */
-int dont_enable_local_apic __initdata = 0;

 static int __init detect_init_APIC (void)
 {
@@ -621,11 +637,14 @@
        extern void get_cpu_vendor(struct cpuinfo_x86*);

        /* Disabled by DMI scan or kernel option? */
-       if (dont_enable_local_apic)
+       if (enable_local_apic_flag == 2)
                return -1;

        /* Workaround for us being called before identify_cpu(). */
        get_cpu_vendor(&boot_cpu_data);
+      
+       if (enable_local_apic_flag == 1)
+               goto force_apic;

        switch (boot_cpu_data.x86_vendor) {
        case X86_VENDOR_AMD:
@@ -642,6 +661,7 @@
                goto no_apic;
        }

+force_apic:
        if (!cpu_has_apic) {
                /*
                 * Some BIOSes disable the local APIC in the
Index: linux-2.5.45-ac1/arch/i386/kernel/dmi_scan.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.45-ac1/arch/i386/kernel/dmi_scan.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 dmi_scan.c
--- linux-2.5.45-ac1/arch/i386/kernel/dmi_scan.c        5 Nov 2002 04:47:02 -0000       1.1.1.1
+++ linux-2.5.45-ac1/arch/i386/kernel/dmi_scan.c        6 Nov 2002 00:22:02 -0000
@@ -314,9 +314,9 @@
 static int __init local_apic_kills_bios(struct dmi_blacklist *d)
 {
 #ifdef CONFIG_X86_LOCAL_APIC
-       extern int dont_enable_local_apic;
-       if (!dont_enable_local_apic) {
-               dont_enable_local_apic = 1;
+       extern int enable_local_apic_flag;
+       if (!enable_local_apic_flag) {
+               enable_local_apic_flag = 2;
                printk(KERN_WARNING "%s with broken BIOS detected. "
                       "Refusing to enable the local APIC.\n",
                       d->ident);
@@ -333,9 +333,9 @@
 static int __init apm_kills_local_apic(struct dmi_blacklist *d)
 {
 #ifdef CONFIG_X86_LOCAL_APIC
-       extern int dont_enable_local_apic;
-       if (apm_info.bios.version && !dont_enable_local_apic) {
-               dont_enable_local_apic = 1;
+       extern int enable_local_apic_flag;
+       if (apm_info.bios.version && !enable_local_apic_flag) {
+               enable_local_apic_flag = 2;
                printk(KERN_WARNING "%s with broken BIOS detected. "
                       "Refusing to enable the local APIC.\n",
                       d->ident);

--
function.linuxpower.ca

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



 Sun, 24 Apr 2005 03:50:08 GMT   
 [2.5-AC] Forced enable/disable local APIC

 The patch looks fine for me.

--
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: ma...@ds2.pg.gda.pl, PGP key available        +

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



 Sun, 24 Apr 2005 13:30:13 GMT   
 [2.5-AC] Forced enable/disable local APIC
 > +int enable_local_apic_flag __initdata = 0; /* 0=probe, 1=force, 2=disable e.g. DMI */
...
 > + if (enable_local_apic_flag == 1)
 > +         goto force_apic;
 >  
 >   switch (boot_cpu_data.x86_vendor) {
 >   case X86_VENDOR_AMD:
 > @@ -642,6 +661,7 @@
 >           goto no_apic;
 >   }
 >  
 > +force_apic:
 >   if (!cpu_has_apic) {
 >           /*
 >            * Some BIOSes disable the local APIC in the

Of what use is the force case? If someone boots with "lapic" on a CPU
where the APIC feature bit is off, then the code will rdmsr/wrmsr on
APICBASE, even though we (the kernel) haven't verified that the CPU
actually has that MSR. This is doubleplusungood.

I have no problem with the disable option.

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



 Mon, 25 Apr 2005 17:20:08 GMT   
 [2.5-AC] Forced enable/disable local APIC

 The assumption is a user knows better what he wants to achieve.  But I'm
not sure we really need it here.  A DMI override with the APICBASE
availability test in place should suffice -- I'd remove the "goto".

--
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: ma...@ds2.pg.gda.pl, PGP key available        +

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



 Mon, 25 Apr 2005 17:30:29 GMT   
 [2.5-AC] Forced enable/disable local APIC

We still honour the APIC feature bit, its just that we bypass the cpuid
checks. Looks sane no?

        Zwane
--
function.linuxpower.ca

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



 Mon, 25 Apr 2005 17:50:11 GMT   
 [2.5-AC] Forced enable/disable local APIC
 > On Thu, 7 Nov 2002, Mikael Pettersson wrote:
 >
 > > Zwane Mwaikambo writes:
 > >  > +int enable_local_apic_flag __initdata = 0; /* 0=probe, 1=force, 2=disable e.g. DMI */
 > > ...
 > >  > +      if (enable_local_apic_flag == 1)
 > >  > +              goto force_apic;
 > >  >  
 > >  >        switch (boot_cpu_data.x86_vendor) {
 > >  >        case X86_VENDOR_AMD:
 > >  > @@ -642,6 +661,7 @@
 > >  >                goto no_apic;
 > >  >        }
 > >  >  
 > >  > +force_apic:
 > >  >        if (!cpu_has_apic) {
 > >  >                /*
 > >  >                 * Some BIOSes disable the local APIC in the
 > >
 > > Of what use is the force case? If someone boots with "lapic" on a CPU
 > > where the APIC feature bit is off, then the code will rdmsr/wrmsr on
 > > APICBASE, even though we (the kernel) haven't verified that the CPU
 > > actually has that MSR. This is doubleplusungood.
 >
 > We still honour the APIC feature bit, its just that we bypass the cpuid
 > checks. Looks sane no?

No. Read what I wrote: if cpu_has_apic is false, the code drops into
the "try the hard way by messing with the APICBASE MSR". Your "force"
goto bypasses the CPU checks, which are there to ensure that the CPU
actually _has_ an APICBASE MSR.

I still see no reason at all for the force.

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



 Mon, 25 Apr 2005 18:00:13 GMT   
 [2.5-AC] Forced enable/disable local APIC

My mistake, i misread.

I agree, in which case the first patch should make everyone happy. If Alan
doesn't take it for his next release i'll resend.

        Zwane
--
function.linuxpower.ca

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



 Mon, 25 Apr 2005 22:50:07 GMT   
 [2.5-AC] Forced enable/disable local APIC

 Well, the "lapic" option should override the DMI setting, not the
APICBASE availability check.  Anyway, I don't insist on this that much --
while I think consistency is good, none of the "*apic" options are
actually a necessity for me.  If one needs the option, one may still cook
an appropriate patch oneself.

--
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: ma...@ds2.pg.gda.pl, PGP key available        +

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



 Tue, 26 Apr 2005 13:30:13 GMT   
 [2.5-AC] Forced enable/disable local APIC

I think the nolapic is definitely needed because i've come across a number
of bug reports where the simplest solution would be to just disable the
local apic.

        Zwane
--
function.linuxpower.ca

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



 Tue, 26 Apr 2005 14:20:08 GMT   
 [2.5-AC] Forced enable/disable local APIC
 > On Fri, 8 Nov 2002, Maciej W. Rozycki wrote:
 >
 > >  Well, the "lapic" option should override the DMI setting, not the
 > > APICBASE availability check.  Anyway, I don't insist on this that much --
 > > while I think consistency is good, none of the "*apic" options are
 > > actually a necessity for me.  If one needs the option, one may still cook
 > > an appropriate patch oneself.
 >
 > I think the nolapic is definitely needed because i've come across a number
 > of bug reports where the simplest solution would be to just disable the
 > local apic.

People with broken boxes should send their DMI data to me so I can add
their boxes to the local APIC blacklist in dmi_scan.c. "nolapic" is
simply a workaround for the absence of this DMI data.

Notice how silent the Inspiron 8k users are now that the DMI black
list is implemented...

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



 Tue, 26 Apr 2005 14:30:12 GMT   
 
   [ 10 post ] 

Similar Threads

1. [2.5-AC] Forced enable/disable local APIC

2. [2.5.73] enable local APIC on P4

3. Local APIC disabled by BIOS -- reenabling.

4. 2.4.1-ac UP-APIC updates

5. 2.5.64p5 No USB support when APIC mode enabled

6. Kernel with enabled APIC hangs on Micronics W6LI

7. I/O-APIC not enabled in 2.4.19-pre8 on UP machines

8. IO-APIC -- lockup on machine if enabled

9. disable apic before first boot?

10. no local P6 APIC


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software