From: davej@redhat.com
To: linux-kernel@vger.kernel.org
Cc: torvalds@osdl.org, akpm@osdl.org
Subject: Restore 2.4 MTRR feature.
Date: Fri, 23 Jan 2004 06:35:25 +0000 [thread overview]
Message-ID: <E1Ajuub-0000xI-00@hardwired> (raw)
If the CPU doesn't support MTRRs, don't create a /proc/mtrr
Dave
diff -urpN --exclude-from=/home/davej/.exclude bk-linus/arch/i386/kernel/cpu/mtrr/if.c linux-2.5/arch/i386/kernel/cpu/mtrr/if.c
--- bk-linus/arch/i386/kernel/cpu/mtrr/if.c 2003-09-29 19:45:18.000000000 +0100
+++ linux-2.5/arch/i386/kernel/cpu/mtrr/if.c 2003-11-27 17:04:42.000000000 +0000
@@ -352,6 +352,14 @@ static int mtrr_seq_show(struct seq_file
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) {
reply other threads:[~2004-01-23 6:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1Ajuub-0000xI-00@hardwired \
--to=davej@redhat.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®