Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] Enable local APIC on DELL INSPIRON/LATITUDE
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
mfkr79
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2004
Posts: 143
Location: Italy

PostPosted: Mon Jul 05, 2004 9:48 pm    Post subject: [HOWTO] Enable local APIC on DELL INSPIRON/LATITUDE Reply with quote

Revisions

Initial release --> 5 July 2004
Last Update --> 25 October 2004, added procedure for 2.6.9 kernels and other considerations in my feedback post



Definition

APIC means Advanced Programmable Interrupt Controller, an improved version of PIC.
It is a Programmable Interrupt Controller that can handle interrupts from and for multiple CPUs, and, usually, has more available interrupt lines that a typical PIC.
APIC must not be confused with ACPI, that stands for Advanced Configuration and Power Interface, and is an open industry standard for configuration and power management.


Why ?

APIC is important not only in multi-processor environment, but could be useful in uniprocessor too, in order to resolve resource conflicts and cause is necessary for enabling new features in the PCI specifications.
I see some people complaining about problems with Linux on their Inspiron, they think these problems could be related to the lack of APIC support in the kernel.
I'm quite happy with the Gentoo installation on my Inspiron 8500, but recently, using lastest kernel versions, I find too many components using the same IRQs (the so called IRQ-sharing).
This behaviour sometime brings to strange outputs in dmesg, something like "can't grab IRQ xx". This force me to disable some options/features in order to mantain my system usable.
So I decide to try enabling local APIC on my DELL, to see if this help to solve this kind of problems.
As my attempt was successful, I decide to share it with Gentoo users, hoping this could solve other problems or help us to understand which Inspiron/Latitude models works well with local APIC enabled, and if is better to leave it disabled or not.


Who can/should try this ?

If you're completly satisfied with your Linux config, don't try this procedure; but if you are extremely mad & curious (like me :)) or think local APIC could improve your system config or help solving some kind of problems, continue this reading.

I don't know if ALL Inspiron/Latitude really have problems with handling enabled local APICs.
To my knowledge, kernel devs have blacklisted them because early models have problems.
Googling around I can't find any evidence of the fact that all recent Inspiron (like mine) can't handle correctly APIC, and it seems that someone else has tried to enable it.

Bottom line:
all users with Pentium4, mobile Pentium4 and mobile Pentium4-M can try, cause the Pentium4 processor family has local APIC, my Inspiron is working.
Pentium-M (Centrino) seems to work with local APIC enabled.
Pentium3-based models probably are the cause of the blacklisting of early Inspiron/Latitude.
They have a BIOS bug that can't be worked around, except by refusing to enable the local APIC :(

In particular

  • Inspiron 8600 : has Pentium-M, seems to work with APIC
  • Inspiron 8500 : has mobile Pentium4-M, mine works well with local APIC enabled
  • Inspiron 8200 : has mobile Pentium4-M, probably has problems with APIC
  • Inspiron 51x0 : some have Pentium4, other mobile Pentium4, the early models haven't HyperThreading, on a 5150 equipped with mobile Pentium4 (NO HT) one user reports responsiveness improvements and better IRQ management with local APIC enabled
  • Inspiron xx0m : I believe all have Pentium-M, waiting for feedback...

To my knowledge the commercial brand "Latitude" is targeted to business clients and has the same components of the correspondent Inspiron models, so see above

  • Latitude D600 : has Pentium-M, works
  • Latitude C640 : has mobile Pentium4-M, probably has problems with the local APIC enabled
  • Latitude X200 : has Pentium3, seems fine


Requirements

  • 2.6 kernel tree
  • DELL notebook with this message in dmesg
    Code:
    Dell Inspiron with broken BIOS detected. Refusing to enable the local APIC.

    or this one
    Code:
    Dell Latitude with broken BIOS detected. Refusing to enable the local APIC.


Obviously you won't see this message if you don't select in your kernel config
Code:
Processor type and features  --->  [*] Local APIC support on uniprocessors


---EDIT---
Starting from 2.6.9 kernels the Inspiron/Latitude series is no more blacklisted,
so you won't see the above message if you enable APIC in your config
and conseguently the following part "Instructions" is no more needed :P

You only have to do these simple things:
Enable both Local & IO APIC
Code:
Processor type and features  --->
[*] Local APIC support on uniprocessors
[*]   IO-APIC support on uniprocessors

compile kernel and reboot the machine
If this is not sufficient, you will see something like this in dmesg
Code:
...
No local APIC, or hardware disabled

Then you need a further step, ie you have to pass to your bootloader these parameters
Code:
apic=debug lapic

and reboot
Now you should see something like this in dmesg
Code:
Local APIC disabled by BIOS -- reenabling.
Found and enabled local APIC!
mapped APIC to ffffd000 (fee00000)
...

---/EDIT---


Instructions

[ I will leave this part, even if is no more needed with 2.6.9 kernels, for those who want to play with older kernels 8) ]

Now we are going to force the use of local APIC


  1. Identify the directory containing the kernel source, usually something like /usr/src/"your kernel"

  2. Move to the directory /usr/src/"your kernel"/arch/i386/kernel

  3. With your favourite text editor, open the file named dmi_scan.c

  4. Find the rows corresponding to your notebook model and comment out them using /* */ ...in this way:
    /*
    the part of code you have to disable
    */

    For Inspiron:
    Code:
    { local_apic_kills_bios, "Dell Inspiron", {
             MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
             MATCH(DMI_PRODUCT_NAME, "Inspiron"),
             NO_MATCH, NO_MATCH
             } },


    For Latitude:
    Code:
    { local_apic_kills_bios, "Dell Latitude", {
             MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
             MATCH(DMI_PRODUCT_NAME, "Latitude"),
             NO_MATCH, NO_MATCH
             } },


  5. Save the file dmi_scan.c and compile the modified kernel source. Don't forget you have to select (NOT as modules)
    Code:
    Processor type and features  --->
    [*] Local APIC support on uniprocessors
    [*]   IO-APIC support on uniprocessors
    <*> /dev/cpu/microcode - Intel IA32 CPU microcode support
    <*> /dev/cpu/*/msr - Model-specific register support
    <*> /dev/cpu/*/cpuid - CPU information support


  6. Reboot selecting the recompiled kernel and check dmesg output
    If you find a message like this "No local APIC, or hardware disabled" jump to next step;
    if the local APIC is enabled, the procedure ends here, if you want, go to (12)


  7. Is necessary another change to the kernel source.
    Move to /usr/src/"nome kernel"/arch/i386/kernel

  8. With your favourite text editor, open the file named apic.c

  9. Find the part of source showed here...

    Code:
    goto no_apic;
    case X86_VENDOR_INTEL:
       if (boot_cpu_data.x86 == 6 ||
          (boot_cpu_data.x86 == 15 && (cpu_has_apic ||enable_local_apic > 0)) ||     
          (boot_cpu_data.x86 == 5 && cpu_has_apic))
             break;
       goto no_apic;
    default:
       goto no_apic;
    }


    ...comment out this line with /* code */
    Code:
    (boot_cpu_data.x86 == 15 && (cpu_has_apic || enable_local_apic > 0)) ||


    ...and change it with this one
    Code:
    (boot_cpu_data.x86 == 15 || enable_local_apic > 0) ||


  10. Save the file apic.c and compile the modified kernel source. Don't forget you have to select (NOT as modules)
    Code:
    Processor type and features  --->
    [*] Local APIC support on uniprocessors
    [*]   IO-APIC support on uniprocessors
    <*> /dev/cpu/microcode - Intel IA32 CPU microcode support
    <*> /dev/cpu/*/msr - Model-specific register support
    <*> /dev/cpu/*/cpuid - CPU information support


  11. Reboot selecting the recompiled kernel and check dmesg output

    You should read this
    Code:
    Local APIC disabled by BIOS -- reenabling.
    Found and enabled local APIC!

     ...

    Using local APIC timer interrupts.
    calibrating APIC timer ...
    ..... CPU clock speed is xxxx MHz.
    ..... host bus clock speed is xxx MHz.


  12. Now "apic" is one of the CPU flags, to check this, write
    Code:
    cat /proc/cpuinfo | grep flags


    I obtain
    Code:
    flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid





I'm glad to receive comments and critics too, in particular I'd like some feedback where you say if it works, your laptop model, Cpu type, BIOS version, kernel used, ACPI subsys revision and so on...

Disclaimer: Remember please that these are low level stuffs, I'm not responsible if you damage your config, your data or your laptop following this procedure.
I'm not a kernel developer, nor a coder, these modifications work for me, I don't think they're dangerous, but I can't promise they'll work for you too


Bye

This is the translation of the original italian version

Questa è la traduzione della versione originale in italiano


Last edited by mfkr79 on Mon Oct 25, 2004 10:00 pm; edited 19 times in total
Back to top
View user's profile Send private message
mfkr79
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2004
Posts: 143
Location: Italy

PostPosted: Tue Jul 06, 2004 12:01 am    Post subject: Reply with quote

Meanwhile,

this is my own feedback 8)

Local APIC works well on DELL Inspiron 8500 with BIOS A06

CPU type = mobile Intel Pentium4-M 2.4 GHz (cpu family 15, model 2, stepping 7)

Till now I've tried these kernels :
  • linux-2.6.7-gentoo-r8 (ACPI Subsystem revision 20040326)
  • linux-2.6.7-love5 (ACPI Subsystem revision 20040615)
  • linux-2.6.8-rc2-love3 (ACPI Subsystem revision 20040326)
  • linux-2.6.9-gentoo-r1 (ACPI Subsystem revision 20040816)

No lockups at all, system seems rock solid, all services work as usual... I've played with some games (UT2003/04, RtCW, Doom3), ripped CD & DVD, browsing the web and write this howto without apparent problems :wink:
I don't have immediate death on power unplug, tried several times
No performance enhancements at all.
System responsiveness seems the same...

Only a major annoyance, the shutdown sequence is completed correctly (all services stopped and all partitions unmounted), but at the end the system displays "power down" without turning off, so I have to hold down the power button for 5 secs (this doesn't happen without APIC)

IMHO, on Inspiron 8500, life is better without APIC, until I won't be able to use IO APIC, if implemented, for IRQ routing instead of common PIC

Bye
_________________
Gentoo ~amd64 on DELL XPS M1530


Last edited by mfkr79 on Mon Oct 25, 2004 9:30 pm; edited 3 times in total
Back to top
View user's profile Send private message
hanzotutu
Apprentice
Apprentice


Joined: 10 Apr 2003
Posts: 170

PostPosted: Tue Jul 06, 2004 1:54 am    Post subject: Reply with quote

Code:

hanzo@scimd: pts/2: 37 files 1.5Mb-> dmesg | less
...
Local APIC disabled by BIOS -- reenabling.
Found and enabled local APIC!
...


CPU type P-M 1.4G, Dell D600, kernel mm-sources-2.6.6
_________________
Dell D600, P-M 1.4G, 512M DDR, Radeon M9 32M
Back to top
View user's profile Send private message
smart
Guru
Guru


Joined: 19 Nov 2002
Posts: 455

PostPosted: Tue Jul 06, 2004 5:39 am    Post subject: Reply with quote

Latitude C640, Pentium 4M 1.8G, 15.2.7 , BIOS A10
kernel 2.6.7
no go
immediate death on power unplug test
the disappointment increases due to noticeably snappier response while the system is running with APIC
this is unbelievably weak in my opinion. this is not an old BIOS or old machine. Dell should definitely improve on its support since such problems with dell laptops are obviously known since generation 3 pentiums. cannot recommend buying a dell under these circumstances, apic IS an important feature.
Back to top
View user's profile Send private message
mfkr79
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2004
Posts: 143
Location: Italy

PostPosted: Tue Jul 06, 2004 1:38 pm    Post subject: Reply with quote

@ hanzotutu : Thanks for your feedback

smart wrote:
Latitude C640, Pentium 4M 1.8G, 15.2.7 , BIOS A10
kernel 2.6.7
no go
immediate death on power unplug test

To solve this you can try to pass a custom DSDT (Differentiated System Description Table) to the kernel, cause often that in DELL BIOS is buggy
Look here for more info

Quote:
this is unbelievably weak in my opinion. this is not an old BIOS or old machine. Dell should definitely improve on its support since such problems with dell laptops are obviously known since generation 3 pentiums. cannot recommend buying a dell under these circumstances, apic IS an important feature.

I agree, shame on you, DELL !!!
_________________
Gentoo ~amd64 on DELL XPS M1530


Last edited by mfkr79 on Fri Jul 16, 2004 11:11 am; edited 2 times in total
Back to top
View user's profile Send private message
ercxy
n00b
n00b


Joined: 26 Apr 2004
Posts: 55
Location: MA

PostPosted: Wed Jul 07, 2004 2:42 am    Post subject: Reply with quote

Dell lattitude d600 1.6ghz pentium M worked...
I had some lockups before when I autoload ndiswrapper module.. I will try if enapling APIC fixes this problem..I don't see any particular gain or loss for the time been..
thanks ..

Well it didn't fix ndiswrapper problem.. suggestion , do not delete the code, just comment out that part... So you can easily convert it to original..

commenting :
/*
the part of the code you don't want
*/
Back to top
View user's profile Send private message
mfkr79
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2004
Posts: 143
Location: Italy

PostPosted: Wed Jul 07, 2004 9:50 am    Post subject: Reply with quote

ercxy wrote:
Dell lattitude d600 1.6ghz pentium M worked...
I had some lockups before when I autoload ndiswrapper module.. I will try if enapling APIC fixes this problem..I don't see any particular gain or loss for the time been..

Thanks for your feedback

Quote:
... suggestion , do not delete the code, just comment out that part... So you can easily convert it to original..

Yes, It's better, I'll correct
_________________
Gentoo ~amd64 on DELL XPS M1530
Back to top
View user's profile Send private message
smart
Guru
Guru


Joined: 19 Nov 2002
Posts: 455

PostPosted: Wed Jul 07, 2004 10:24 am    Post subject: Reply with quote

Quote:

To solve this you can try to pass a custom DSDT (Differentiated System Description Table) to the kernel, cause often that in DELL BIOS is buggy (as mine )


nice info, still a heck to learn :)
However, so far i was not lucky with it. I had just warning in the DTDT, fixed that, but it didn't help. Now i'm trying to look deeper into it. One thing i can say alredy.... it's highly windozeish.
Back to top
View user's profile Send private message
liuspider
Apprentice
Apprentice


Joined: 03 Feb 2003
Posts: 237

PostPosted: Wed Jul 07, 2004 6:46 pm    Post subject: Reply with quote

INSPIRON 8600 works!

After step 6, it works ;)

Gcc 3.3.2, kernel 2.6.7-r1

Thanks.

BTW: no noticable performance improvement are observed...
Back to top
View user's profile Send private message
liuspider
Apprentice
Apprentice


Joined: 03 Feb 2003
Posts: 237

PostPosted: Thu Jul 08, 2004 2:27 am    Post subject: Reply with quote

mfkr79 wrote:
Only a minor annoyance, the shutdown sequence is completed correctly (all services stopped and all partitions unmounted), but at the end the system displays "power down" without turning off, so I have to hold down the power button for 5 secs (this doesn't happen without APIC)


Same problem here, hope I can find a solution...
Back to top
View user's profile Send private message
mfkr79
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2004
Posts: 143
Location: Italy

PostPosted: Thu Jul 08, 2004 3:12 pm    Post subject: Reply with quote

liuspider wrote:
Same problem here, hope I can find a solution...


Thanks for the info, I'm working on it...
_________________
Gentoo ~amd64 on DELL XPS M1530
Back to top
View user's profile Send private message
appleboy
n00b
n00b


Joined: 14 Mar 2004
Posts: 61

PostPosted: Tue Jul 13, 2004 1:57 am    Post subject: Reply with quote

great thing you got going there, it worked for me after going through all of the steps (6+)
I'm using :
gentoo-dev-sources 2.6.7-r9
dell inspiron 8500
gcc 3.3.3
I'm also having the problem with it shutting down, when i run 'init 0' it comes to the part where it says 'power down' and then stalls and i have to hold the button, but other then that it works like a charm.
Back to top
View user's profile Send private message
d-fens
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jan 2004
Posts: 92

PostPosted: Thu Jul 15, 2004 12:55 am    Post subject: shut it down .... pls Reply with quote

running 2.6.7-gentoo-r3 and gcc-Version 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7) on a inspiron 8200

well, feels pretty much as before, apart from not shutting down like stated above...

whats that exactly for anyway ... ? :twisted:

[edit1]
chr, tried to unplug and - freeeeeeeze ... so trying to fix this dst whatever stuff ...

[edit2]
my dsts wasn't buggy (just warnings) but kinda old ... BIOS UPDATE ...
Back to top
View user's profile Send private message
mfkr79
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2004
Posts: 143
Location: Italy

PostPosted: Fri Jul 16, 2004 11:17 am    Post subject: Reply with quote

@ d-fens : thanks for the feedback, You got mobile P4-M on your 8200, is it true?
something better after BIOS update?
_________________
Gentoo ~amd64 on DELL XPS M1530
Back to top
View user's profile Send private message
d-fens
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jan 2004
Posts: 92

PostPosted: Fri Jul 16, 2004 12:23 pm    Post subject: Reply with quote

hi,
yes i have the P4m but the bios update (A11) didn't solve anything. still i have only warnings in the DSDT, so no need to fix it.
the freezing / no poweroff is quite annoying, so i think i'll disable it ... any further ideas?
Back to top
View user's profile Send private message
mfkr79
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2004
Posts: 143
Location: Italy

PostPosted: Fri Jul 16, 2004 1:47 pm    Post subject: Reply with quote

sorry, no further ideas...
Probably 8200 is correctly blacklisted in kernel code, It should be a 8200 BIOS related problem, and disabling APIC is a way to workaround... other recent Inspiron models seem to work well with APIC enabled
_________________
Gentoo ~amd64 on DELL XPS M1530
Back to top
View user's profile Send private message
SMoo
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jul 2004
Posts: 140
Location: Leander, TX

PostPosted: Thu Aug 12, 2004 4:52 am    Post subject: Didn't work Reply with quote

I have a Latitude CPx H500GT, using kernel 2.6.7 r13, BIOS rev A14.

I did all the steps and I still get a broken BIOS in #dmesg | less

Any ideas?
Back to top
View user's profile Send private message
mfkr79
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2004
Posts: 143
Location: Italy

PostPosted: Thu Aug 12, 2004 10:34 am    Post subject: Reply with quote

Correct me if I'm wrong, I suppose you have a P3 on your Latitude

The broken BIOS message still looks like previous
Code:
Dell Latitude with broken BIOS detected. Refusing to enable the local APIC

or is different after doing all steps, can you past it?

However, I can say that older INSPIRON/LATITUDE, especially those with P3, seem to have problems working with APIC enabled, so, probably, you should better leave it disabled...
_________________
Gentoo ~amd64 on DELL XPS M1530
Back to top
View user's profile Send private message
teedog
Apprentice
Apprentice


Joined: 09 Mar 2004
Posts: 211

PostPosted: Mon Aug 16, 2004 11:13 pm    Post subject: Reply with quote

What's the best way to bring this to the attention of the kernel developers?
Back to top
View user's profile Send private message
Archangel1
Veteran
Veteran


Joined: 21 Apr 2004
Posts: 1212
Location: Work

PostPosted: Tue Aug 17, 2004 1:37 am    Post subject: Reply with quote

Interestingly enough, I've got a P3 Latitude X200 which seems to do APIC fine.
I'm not sure it's something you take to the kernel developers - more something that should be taken to Dell to get them to fix. Of course, we all know the likelihood of this...
I've been fairly appalled to find out how broken these things are though - the DSDT on mine wasn't quite right. It didn't exactly take a rocket scientist to fix either, so it doesn't give the best impression of Dell's technical ability.
Back to top
View user's profile Send private message
teedog
Apprentice
Apprentice


Joined: 09 Mar 2004
Posts: 211

PostPosted: Tue Aug 17, 2004 7:29 am    Post subject: Reply with quote

I meant to let the kernel developers know that not all Inspirons and Lattitudes should be blacklisted as people seem to find that newer models work fine.
Back to top
View user's profile Send private message
Archangel1
Veteran
Veteran


Joined: 21 Apr 2004
Posts: 1212
Location: Work

PostPosted: Tue Aug 17, 2004 8:01 am    Post subject: Reply with quote

Ah sorry, misunderstood.
I didn't try altering the blacklist until recently - dmesg seems to be okay before and after? Maybe it snuck through somehow - possibly it's got a weird model string or something.
Back to top
View user's profile Send private message
gnasnis
n00b
n00b


Joined: 20 Aug 2004
Posts: 3

PostPosted: Fri Aug 20, 2004 11:58 pm    Post subject: It works for me. Reply with quote

It works for me.

Latitude c810 Pentium III 866 MHz BIOS A12

kernel ; gentoo-dev-sources-2.6.7-r14

I just did the step 1-6.

Thx for good info...
Back to top
View user's profile Send private message
mfkr79
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2004
Posts: 143
Location: Italy

PostPosted: Sat Aug 21, 2004 10:36 am    Post subject: Reply with quote

Thanks guys for feedback...
As you can see in the initial part of the HowTO, I'm trying to create a little and up to date list of working / not-working models

IMHO, the best way to let the kernel developers know about our "experimentations" is to contact, by email for example, the apic code mantainer...
I don't know who mantains this part of code, if anyone gets this info and tells me I'll do the dirty job :wink:

BTW, I'm still playing with local APIC on my Inspiron, I think next step should be enabling, if possible, IO-APIC to manage the IRQ instead of PIC, as dmesg shows
Code:
ACPI: Using PIC for interrupt routing


I'll give a look to the code when I'm less busy

Bye
_________________
Gentoo ~amd64 on DELL XPS M1530
Back to top
View user's profile Send private message
gnasnis
n00b
n00b


Joined: 20 Aug 2004
Posts: 3

PostPosted: Sun Aug 22, 2004 2:00 pm    Post subject: Oops Reply with quote

I posted this works for me but I found a strange thing.

Kernel was compiled, when reboot immediately it worked.

If I turn off my pc, my notebook does not power off.

When booting, machine stops.

Only once working...

Hmm, very starange...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum