Another Athlon MTRR patch

BOSZORMENYI Zoltan (zboszor@MOL.hu)
Mon, 16 Aug 1999 11:56:02 +0100


This is a multi-part message in MIME format.
--------------0EE1806C407BCAB8E745DF34
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi!

In my previous Athlon patch (mail subject: Two MTRR patches)
I overlooked one thing: there is an Intel PPro revision
check in mtrr_add() which is (of course) only valid for Intel.

By putting the AMD branch before Intel, the code checked the
Athlon revision as well. This patch fixes it by double checking
the vendor.

Zoltan Boszormenyi
--------------0EE1806C407BCAB8E745DF34
Content-Type: text/plain; charset=us-ascii;
name="mtrr.c-Athlon2.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="mtrr.c-Athlon2.diff"

--- mtrr.c-Athlon Sat Aug 14 09:31:44 1999
+++ mtrr.c Sun Aug 15 20:41:12 1999
@@ -218,6 +218,9 @@
Rearrange switch() statements so the driver accomodates to
the fact that the AMD Athlon handles its MTRRs the same way
as Intel does.
+ 19990814 Zoltan Boszormenyi <zboszor@mol.hu>
+ Double check for Intel in mtrr_add()'s big switch() because
+ that revision check is only valid for Intel CPUs.
*/
#include <linux/types.h>
#include <linux/errno.h>
@@ -1104,12 +1107,15 @@
break;
} /* else fall through */
case X86_VENDOR_INTEL:
- /* For Intel PPro stepping <= 7, must be 4 MiB aligned */
- if ( (boot_cpu_data.x86 == 6) && (boot_cpu_data.x86_model == 1) &&
- (boot_cpu_data.x86_mask <= 7) && ( base & ( (1 << 22) - 1 ) ) )
- {
- printk ("mtrr: base(0x%lx) is not 4 MiB aligned\n", base);
- return -EINVAL;
+ /* Double check for Intel, we may run on Athlon. */
+ if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
+ /* For Intel PPro stepping <= 7, must be 4 MiB aligned */
+ if ( (boot_cpu_data.x86 == 6) && (boot_cpu_data.x86_model == 1) &&
+ (boot_cpu_data.x86_mask <= 7) && ( base & ( (1 << 22) - 1 ) ) )
+ {
+ printk ("mtrr: base(0x%lx) is not 4 MiB aligned\n", base);
+ return -EINVAL;
+ }
}
/* Fall through */
case X86_VENDOR_CYRIX:

--------------0EE1806C407BCAB8E745DF34--

-
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/