From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Linus Torvalds <torvalds@osdl.org>,
Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: [PATCH] ppc64 iommu rewrite part 2/5
Date: Fri, 27 Feb 2004 23:11:02 +1100 [thread overview]
Message-ID: <1077883862.22213.365.camel@gaston> (raw)
Fix /dev/mem idea of what is memory on ppc64
This add a hack to /dev/mem (along with the other ones
already there) to prevent mapping cacheable of the IO hole.
Without this, XFree blows up on machines with enough memory
to go past the IO hole. It also tries to prevent memory from
beeing mapped uncached. Cache paradoxes are evil and can
kill the CPU.
The necessary page_is_ram() call was added by the previous
patch doing the proper IO hole accounting.
Ben.
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/02/27 22:24:36+11:00 benh@kernel.crashing.org
# Fix /dev/mem mmap'ing choice of cacheable attribute on ppc64
# (Fixes XFree on machines with an IO hole)
#
# drivers/char/mem.c
# 2004/02/27 22:24:24+11:00 benh@kernel.crashing.org +8 -0
# Fix /dev/mem mmap'ing choice of cacheable attribute on ppc64
# (Fixes XFree on machines with an IO hole)
#
diff -Nru a/drivers/char/mem.c b/drivers/char/mem.c
--- a/drivers/char/mem.c Fri Feb 27 22:44:02 2004
+++ b/drivers/char/mem.c Fri Feb 27 22:44:02 2004
@@ -67,6 +67,14 @@
* On ia64, we ignore O_SYNC because we cannot tolerate memory attribute aliases.
*/
return !(efi_mem_attributes(addr) & EFI_MEMORY_WB);
+#elif defined(CONFIG_PPC64)
+ /* On PPC64, we always do non-cacheable access to the IO hole and
+ * cacheable elsewhere. Cache paradox can checkstop the CPU and
+ * the high_memory heuristic below is wrong on machines with memory
+ * above the IO hole... Ah, and of course, XFree86 doesn't pass
+ * O_SYNC when mapping us to tap IO space. Surprised ?
+ */
+ return !page_is_ram(addr);
#else
/*
* Accessing memory above the top the kernel knows about or through a file pointer
next reply other threads:[~2004-02-27 12:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-27 12:11 Benjamin Herrenschmidt [this message]
2004-02-27 12:28 ` Christoph Hellwig
2004-02-27 12:22 ` Benjamin Herrenschmidt
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=1077883862.22213.365.camel@gaston \
--to=benh@kernel.crashing.org \
--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®