
These two simple assembly modules let you turn on and off the
internal level one cache of i486 (and higher) processors. Since
the %cr0 register can't be accessed to alter the CD and NW bits
from user space (even with iopl) a quick way to do it is via
modules (which run with kernel priv.) You can't execute the two
instructions "invd" and "wbinvd" in user space either....

To make:
========

as l1off.s -o l1off.o
as l1on.s -o l1on.o

Please change the "kernel_version" in each ".s" file to match that
which you are presently using on your system.

To use:
=======

insmod l1off.o ; rmmod l1off

	and/or

insmod l1on.o ; rmmod l1on

to reverse the effect. You rmmod the modules right away, since all
the work is done in the init_module call and you get to reclaim your
4k page of RAM for other things.

You can use the bogomips stand-alone program/package to verify that
your machine is slower with l1off, etc. The following output is
an example for an i486dx2-66.

Paul Gortmaker.

---------------------------------------------------------------------

ratbag:/home/paul/cache_mods# ll *.o
-rw-r--r--   1 root     root          700 Dec 10 18:44 l1off.o
-rw-r--r--   1 root     root          699 Dec 10 18:44 l1on.o
ratbag:/home/paul/cache_mods# bogomips
Calibrating delay loop.. ok - 33.55 BogoMips
ratbag:/home/paul/cache_mods# insmod l1off.o ; rmmod l1off ; bogomips
Calibrating delay loop.. ok - 9.47 BogoMips
ratbag:/home/paul/cache_mods# insmod l1on.o ; rmmod l1on ; bogomips
Calibrating delay loop.. ok - 33.55 BogoMips
ratbag:/home/paul/cache_mods# exit
