From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] Prohibit ioremap() on kernel managed RAM
Date: Thu, 8 Apr 2010 10:48:18 +0100 [thread overview]
Message-ID: <20100408094818.GD31407@n2100.arm.linux.org.uk> (raw)
ARMv6 and above have a restriction whereby aliasing virtual:physical
mappings must not have differing memory type and sharability
attributes. Strictly, this covers the memory type (strongly ordered,
device, memory), cache attributes (uncached, write combine, write
through, write back read alloc, write back write alloc) and the
shared bit.
However, using ioremap() and its variants on system RAM results in
mappings which differ in these attributes from the main system RAM
mapping. Other architectures which similar restrictions approch this
problem in the same way - they do not permit ioremap on main system
RAM.
Make ARM behave in the same way, with a WARN_ON() such that users can
be traced and an alternative approach found.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 28c8b95..03f1193 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -268,6 +268,12 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK))
return NULL;
+ /*
+ * Don't allow RAM to be mapped - this causes problems with ARMv6+
+ */
+ if (WARN_ON(pfn_valid(pfn)))
+ return NULL;
+
type = get_mem_type(mtype);
if (!type)
return NULL;
next reply other threads:[~2010-04-08 9:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-08 9:48 Russell King - ARM Linux [this message]
2010-04-23 14:15 ` [RFC] Prohibit ioremap() on kernel managed RAM Catalin Marinas
2010-04-23 14:27 ` Shilimkar, Santosh
-- strict thread matches above, loose matches on Subject: below --
2010-04-23 14:40 Russell King
2010-04-30 16:33 ` George G. Davis
2010-04-30 16:38 ` Catalin Marinas
2010-05-01 6:24 ` Shilimkar, Santosh
2010-05-01 9:19 ` Russell King - ARM Linux
2010-05-03 15:59 ` George G. Davis
2010-05-04 15:29 ` Catalin Marinas
2010-05-05 16:23 ` George G. Davis
2010-05-05 16:30 ` Russell King - ARM Linux
2010-05-05 16:33 ` George G. Davis
2010-04-30 18:19 ` Russell King - ARM Linux
2010-04-30 22:30 ` George G. Davis
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=20100408094818.GD31407@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).