From: linux@armlinux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/3] asm-generic: io: Add exec versions of ioremap
Date: Thu, 12 May 2016 17:37:59 +0100 [thread overview]
Message-ID: <20160512163759.GW5783@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1462830111-28172-2-git-send-email-d-gerlach@ti.com>
On Mon, May 09, 2016 at 04:41:49PM -0500, Dave Gerlach wrote:
> diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
> index 66a978d05958..c6eef3c98074 100644
> --- a/arch/arm/mm/ioremap.c
> +++ b/arch/arm/mm/ioremap.c
> @@ -400,6 +400,20 @@ EXPORT_SYMBOL(ioremap_wc);
> * clocks that would affect normal memory for example. Please see
> * CONFIG_GENERIC_ALLOCATOR for allocating external memory.
> */
> +void __iomem *ioremap_exec(resource_size_t res_cookie, size_t size)
> +{
> + return arch_ioremap_caller(res_cookie, size, MT_MEMORY_RWX,
> + __builtin_return_address(0));
> +}
> +EXPORT_SYMBOL(ioremap_exec);
> +
> +void __iomem *ioremap_exec_nocache(resource_size_t res_cookie, size_t size)
> +{
> + return arch_ioremap_caller(res_cookie, size, MT_MEMORY_RWX_NONCACHED,
> + __builtin_return_address(0));
> +}
> +EXPORT_SYMBOL(ioremap_exec_nocache);
I think these should be called memremap_exec() and similar. Please
see the description of memremap() in kernel/memremap.c. If you're
going to be executing code, the region must not have I/O side effects
and according to the new definition of memremap() vs ioremap(), the
memremap() interfaces fit better.
Please also get these reviewed by Dan Williams who provided the
memremap() API.
Thanks.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2016-05-12 16:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-09 21:41 [RFC PATCH 0/3] Add ioremap_exec and extend drivers/misc/sram.c Dave Gerlach
2016-05-09 21:41 ` [RFC PATCH 1/3] asm-generic: io: Add exec versions of ioremap Dave Gerlach
2016-05-12 16:37 ` Russell King - ARM Linux [this message]
2016-05-18 14:12 ` Dave Gerlach
2016-05-18 17:51 ` Russell King - ARM Linux
2016-05-18 20:25 ` Arnd Bergmann
2016-05-18 20:57 ` Russell King - ARM Linux
2016-05-25 15:45 ` Dave Gerlach
2016-05-09 21:41 ` [RFC PATCH 2/3] lib: devres: Add exec and exec_nocache versions of devm_ioremap Dave Gerlach
2016-05-09 21:41 ` [RFC PATCH 3/3] misc: SRAM: Add option to map SRAM to allow code execution Dave Gerlach
2016-05-12 16:30 ` [RFC PATCH 0/3] Add ioremap_exec and extend drivers/misc/sram.c Tony Lindgren
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=20160512163759.GW5783@n2100.arm.linux.org.uk \
--to=linux@armlinux.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).