[miniPATCH] about cr4 : paging_init

Masahiro Adegawa (adegawa@zerosoft.co.jp)
Thu, 15 Jul 1999 19:09:43 +0900


Hi,

we need setting cr4 only once.
instructions clocks 40% down, but very few times.

--- linux-2.2.10/arch/i386/mm/init.c.original Fri Jan 22 04:28:40 1999
+++ linux-2.2.10/arch/i386/mm/init.c Thu Jul 15 14:46:37 1999

@@ -287,6 +287,13 @@

/* Map whole memory from PAGE_OFFSET */
pg_dir += USER_PGD_PTRS;
+ if (boot_cpu_data.x86_capability & X86_FEATURE_PSE) {
+ set_in_cr4(X86_CR4_PSE);
+ boot_cpu_data.wp_works_ok = 1;
+ if (boot_cpu_data.x86_capability & X86_FEATURE_PGE) {
+ set_in_cr4(X86_CR4_PGE);
+ }
+ }
while (address < end_mem) {
/*
* If we're running on a Pentium CPU, we can use the 4MB
@@ -299,12 +306,9 @@
if (boot_cpu_data.x86_capability & X86_FEATURE_PSE) {
unsigned long __pe;

- set_in_cr4(X86_CR4_PSE);
- boot_cpu_data.wp_works_ok = 1;
__pe = _KERNPG_TABLE + _PAGE_4M + __pa(address);
/* Make it "global" too if supported */
if (boot_cpu_data.x86_capability & X86_FEATURE_PGE) {
- set_in_cr4(X86_CR4_PGE);
__pe += _PAGE_GLOBAL;
}
pgd_val(*pg_dir) = __pe;

--
- Masahiro

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