LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-18-2006, 12:09 PM   #1
TheNobes
LQ Newbie
 
Registered: Feb 2006
Posts: 4

Rep: Reputation: 0
Need to activate L2 cache on a Celeron A..


Hi, guys,

I need some help on activating an 128 KB L2 cache on a Celeron A processor. The processor is part of a Powerleap Pro/II cpu upgrade pkg. Unfortunately on power up the cache is disabled (32kb L1 only). This was true when I was running Win98, and is still true now, as shown by executing "leafpad \proc\cpuinfo" in my new Zenwalk install. However, in Win98, Powerleap provided a program to enable the L2cache and I had it run on Win98 startup. But no sucg program exists for Linux, at least not from Powerleap directly.

However, a patch has been written to perform the L2 cache enabling in Linux. It works with version 2.2 kernel and was written by Peter Schneider 01/21/00.

Here is the code:


L2enabler_v1.txt version 1.0

#define MODULE
#define __KERNEL__
#include <linux/module.h>

#include <asm/system.h> /* cli(), *_flags */


static inline void disable_cache(void)
{
asm volatile (
"movl %%cr0, %%eax\n\t"
"orl $0x40000000, %%eax\n\t"
"movl %%eax, %%cr0\n\t"
:
:
:"memory", "cc", "eax");
}

/* ... */
static inline void enable_cache(void)
{
asm volatile (
"movl %%cr0, %%eax\n\t"
"andl $0xbfffffff, %%eax\n\t"
"movl %%eax, %%cr0"
:
:
:"memory", "cc", "eax");
}


int init_module(void)
{
unsigned long flags;
printk ("<1>L2Enabler: Will enable L2 cache on a Celeron\n");

save_flags(flags);
cli ();
//Disable L1 Cache
__asm__ ("wbinvd");
disable_cache ();
__asm__ ("wbinvd");
//Read L2 Cache MSR
__asm__ ("mov $0x11E, %ecx");
__asm__ ("rdmsr");
//Enable it
__asm__ ("or $0x00040101, %eax");
//Write to L2 Cache MSR
__asm__ ("mov $0x11E, %ecx");
__asm__ ("wrmsr");
//Enable L1 Cache
__asm__ ("wbinvd");
enable_cache();
__asm__ ("wbinvd");
//__asm__ ("invd");
restore_flags(flags);
printk ("<1>Done enabling L2 cache\n");

return 0;
}

void cleanup_module (void)
{
printk ("<1>Goodbye from the L2Enabler\n");
}



What I need to know is whather this is still valid for the current kernel version, and, if so, how would the "patching" be done?

Thanks for any help you might be able to provide.

Steve

Last edited by TheNobes; 02-18-2006 at 12:16 PM.
 
Old 02-18-2006, 01:06 PM   #2
foolsh
Member
 
Registered: Apr 2005
Location: IL
Distribution: kubuntu
Posts: 56

Rep: Reputation: 15
the cache enable/disable setting is usually found in the BIOS settings of a computer.
most computers give some message when first turned on like "press F1 to enter setup" or "press delete for CMOS"

but then again some computers have "pretty" boot up screens that hide all that stuff. If you don't have the manual to look up such a thing then try restarting your computer and pressing as many different keys starting with delete and go up the F# keys.

once inside your BIOS settings be careful not change important things like harddrive LZ and WPC. just look for your L2 cache setting.

if its something other than that i'm sorry cause im no help.

Last edited by foolsh; 02-18-2006 at 01:07 PM.
 
Old 03-16-2006, 11:51 AM   #3
TheNobes
LQ Newbie
 
Registered: Feb 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks but ...

Thanks but the BIOS is quite old (I am using a Dell Optiplex GXPro, ca 1998). There is no option to control much of anything of importance to any great degree. The CPU I want enabled is a "powerleap upgrade Celeron A" running @ 533MHZ, whereas the original CPU was a Pentium Pro @ 200MHZ.

I need to run some auxiliary program or have some auxiliary code executed in order to activate the L2 cache on the CPU. Otherwise it works at an effective speed of 300MHZ.

Thanks for your help

Steve
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ram wiht suse, cache Disk cache??? fadelhomsi Linux - Newbie 2 02-06-2006 12:29 AM
clearing cache, web cache on linux varunbihani Linux - General 2 12-08-2005 01:02 PM
Error: Caching enabled and local cache: //var/cache/yum/base/primary.xml.gz does... dr_zayus69 Linux - Software 2 07-06-2005 05:32 AM
Celeron <VS> P4 Randvegeta Linux - Hardware 1 05-06-2005 01:13 PM
Celeron L2 cache gabrielbaines Linux - Hardware 0 11-23-2002 11:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration