]> www.infradead.org Git - users/jedix/linux-maple.git/commit
arch: introduce memremap()
authorDan Williams <dan.j.williams@intel.com>
Tue, 11 Aug 2015 03:07:06 +0000 (23:07 -0400)
committerDan Duval <dan.duval@oracle.com>
Wed, 7 Dec 2016 17:19:21 +0000 (12:19 -0500)
commit54bdd132fd550c98c5dc30d334d31bb9aa3a7452
tree66a2c25d20f6a171cd69c743f981101810852592
parent145b463c4e11fb3a92e7a4062cd627a683d8ae8a
arch: introduce memremap()

Orabug: 22913653

Existing users of ioremap_cache() are mapping memory that is known in
advance to not have i/o side effects.  These users are forced to cast
away the __iomem annotation, or otherwise neglect to fix the sparse
errors thrown when dereferencing pointers to this memory.  Provide
memremap() as a non __iomem annotated ioremap_*() in the case when
ioremap is otherwise a pointer to cacheable memory. Empirically,
ioremap_<cacheable-type>() call sites are seeking memory-like semantics
(e.g.  speculative reads, and prefetching permitted).

memremap() is a break from the ioremap implementation pattern of adding
a new memremap_<type>() for each mapping type and having silent
compatibility fall backs.  Instead, the implementation defines flags
that are passed to the central memremap() and if a mapping type is not
supported by an arch memremap returns NULL.

We introduce a memremap prototype as a trivial wrapper of
ioremap_cache() and ioremap_wt().  Later, once all ioremap_cache() and
ioremap_wt() usage has been removed from drivers we teach archs to
implement arch_memremap() with the ability to strictly enforce the
mapping type.

Cc: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
(cherry picked from commit 92281dee825f6d2eb07c441437e4196a44b0861c)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
arch/ia64/include/asm/io.h
arch/sh/include/asm/io.h
arch/xtensa/include/asm/io.h
include/linux/io.h
kernel/Makefile
kernel/memremap.c [new file with mode: 0644]