diff -urN linux-2.1.103/arch/i386/kernel/mtrr.c linux/arch/i386/kernel/mtrr.c --- linux-2.1.103/arch/i386/kernel/mtrr.c Mon May 4 04:58:36 1998 +++ linux/arch/i386/kernel/mtrr.c Thu May 21 23:00:17 1998 @@ -110,6 +110,10 @@ 19980502 Richard Gooch Documentation improvement: mention Pentium II and AGP. v1.20 + 19980521 Richard Gooch + Only manipulate interrupt enable flag on local CPU. + Allow enclosed uncachable regions. + v1.21 */ #include #include @@ -143,7 +147,7 @@ #include #include -#define MTRR_VERSION "1.20 (19980502)" +#define MTRR_VERSION "1.21 (19980521)" #define TRUE 1 #define FALSE 0 @@ -244,8 +248,8 @@ { unsigned long tmp; - /* disable interrupts */ - save_flags(ctxt->flags); cli(); + /* disable interrupts locally */ + __save_flags (ctxt->flags); __cli (); /* save value of CR4 and clear Page Global Enable (bit 7) */ asm volatile ("movl %%cr4, %0\n\t" @@ -290,8 +294,8 @@ asm volatile ("movl %0, %%cr4" : : "r" (ctxt->cr4val) : "memory"); - /* re-enable interrupts (if enabled previously) */ - restore_flags(ctxt->flags); + /* re-enable interrupts locally (if enabled previously) */ + __restore_flags (ctxt->flags); } /* End Function set_mtrr_done */ @@ -804,8 +808,10 @@ base, size, lbase, lsize); return -EINVAL; } + /* New region is enclosed by an existing region */ if (ltype != type) { + if (type == MTRR_TYPE_UNCACHABLE) continue; spin_unlock (&main_lock); printk ( "mtrr: type mismatch for %lx,%lx old: %s new: %s\n", base, size, attrib_to_str (ltype), attrib_to_str (type) ); @@ -1202,7 +1208,7 @@ if ( !(boot_cpu_data.x86_capability & X86_FEATURE_MTRR) ) return 0; # if !defined(__SMP__) || defined(MODULE) printk("mtrr: v%s Richard Gooch (rgooch@atnf.csiro.au)\n", MTRR_VERSION); -#endif +# endif # ifdef __SMP__ # ifdef MODULE