From 0ee1eb36501d3aab40585e990a19aafa438e2890 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Thu, 22 Jan 2004 16:10:47 -0800 Subject: [PATCH] [PATCH] Restore 2.4 MTRR feature. If the CPU doesn't support MTRRs, don't create a /proc/mtrr --- arch/i386/kernel/cpu/mtrr/if.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c index b5ae16027f55d..c6355055708a1 100644 --- a/arch/i386/kernel/cpu/mtrr/if.c +++ b/arch/i386/kernel/cpu/mtrr/if.c @@ -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) { -- 2.53.0