]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Restore 2.4 MTRR feature.
authorDave Jones <davej@redhat.com>
Fri, 23 Jan 2004 00:10:47 +0000 (16:10 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Fri, 23 Jan 2004 00:10:47 +0000 (16:10 -0800)
If the CPU doesn't support MTRRs, don't create a /proc/mtrr

arch/i386/kernel/cpu/mtrr/if.c

index b5ae16027f55de47a9ccb88b8dfd661ee1cf7adb..c6355055708a1bb30b8084c254cb2e3da0494323 100644 (file)
@@ -352,6 +352,14 @@ static int mtrr_seq_show(struct seq_file *seq, void *offset)
 
 static int __init mtrr_if_init(void)
 {
+       struct cpuinfo_x86 *c = &boot_cpu_data;
+
+       if ((!cpu_has(c, X86_FEATURE_MTRR)) &&
+           (!cpu_has(c, X86_FEATURE_K6_MTRR)) &&
+           (!cpu_has(c, X86_FEATURE_CYRIX_ARR)) &&
+           (!cpu_has(c, X86_FEATURE_CENTAUR_MCR)))
+               return -ENODEV;
+
        proc_root_mtrr =
            create_proc_entry("mtrr", S_IWUSR | S_IRUGO, &proc_root);
        if (proc_root_mtrr) {