Skip to contentSkip to conversation

Where to call L2 cache enabling code from?

DISCUSSION Steve Snyder 4 participants 5 messages Apr 14, 2006

lore
Share & tools
lore
#0 lore raw

I have a machine in which the BIOS does not enable the Pentium3's L2 cache at boot time. At what point in the kernel init process can/should I call the code to enable the cache?

Thanks.

#1 lore raw
Quoted 3 lines · Steve Snyder

I have a machine in which the BIOS does not enable the Pentium3's L2 cache at boot time. At what point in the kernel init process can/should I call the code to enable the cache?

What part of the cache setup is not done correctly ? The mtrr registers or other things ?

#2 lore raw
Quoted 7 lines · Alan Cox
Quoted 3 lines · Steve Snyder

I have a machine in which the BIOS does not enable the Pentium3's L2 cache at boot time. At what point in the kernel init process can/should I call the code to enable the cache?

What part of the cache setup is not done correctly ? The mtrr registers or other things ?

It's not that the kernel is failing in any respect. The BIOS simply does not enable the on-CPU L2 cache at power-on. (The machine originally shipped with a Pentium2, and doesn't know how to enable the L2 cache on the Pentium3 that is now running in it.)

I've got a small device driver that enables the L2 cache. It works fine when build as a module and loaded after booting has completed. My goal is to move the code into the kernel so that it is run early in the kernel init process. I expect that having the L2 cache go from "0KB" to 256KB will improve boot time greatly, as well as informing the kernel from the get-go of the true capabilities of this processor.

Getting the code into the kernel image is a no-brainer. But once it is built into the kernel, at what point should I call it?

Thanks for the response.

#3 lore raw
Quoted 21 lines · Steve Snyder
Quoted 7 lines · Alan Cox
Quoted 3 lines · Steve Snyder

I have a machine in which the BIOS does not enable the Pentium3's L2 cache at boot time. At what point in the kernel init process can/should I call the code to enable the cache?

What part of the cache setup is not done correctly ? The mtrr registers or other things ?

It's not that the kernel is failing in any respect. The BIOS simply does not enable the on-CPU L2 cache at power-on. (The machine originally shipped with a Pentium2, and doesn't know how to enable the L2 cache on the Pentium3 that is now running in it.)

I've got a small device driver that enables the L2 cache. It works fine when build as a module and loaded after booting has completed. My goal is to move the code into the kernel so that it is run early in the kernel init process. I expect that having the L2 cache go from "0KB" to 256KB will improve boot time greatly, as well as informing the kernel from the get-go of the true capabilities of this processor.

Quoted 2 lines

Getting the code into the kernel image is a no-brainer. But once it is built into the kernel, at what point should I call it?

arch/i386/kernel/cpu/intel.c has a bunch of workarounds for various issues. Is there a valid use-case for ever booting with cache disabled though? If so, this should probably be a boot-time option to enable it.

Dave

Signature · 1 line
http://www.codemonkey.org.uk
#4 lore raw

On Fri, 2006-04-14 at 12:00 -0500, Dave Jones wrote:
[snip]

Quoted 3 lines

arch/i386/kernel/cpu/intel.c has a bunch of workarounds for various issues. Is there a valid use-case for ever booting with cache disabled though? If so, this should probably be a boot-time option to enable it.

Yes, disabling the cache is useful to debug bad hardware. If the CPU cache is bad, then disabling it might make things work again and you know what needs to be replaced.

Signature · 1 line
Zan Lynx <[email protected]>