From: Dave Gerlach <d-gerlach@ti.com>
To: Russell King - ARM Linux <linux@armlinux.org.uk>,
Arnd Bergmann <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
Russ Dill <russ.dill@ti.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Shawn Guo <shawnguo@kernel.org>, Tony Lindgren <tony@atomide.com>,
Alexandre Belloni <alexandre.belloni@free-electrons.com>,
Nishanth Menon <nm@ti.com>
Subject: Re: [RFC PATCH 1/3] asm-generic: io: Add exec versions of ioremap
Date: Wed, 25 May 2016 10:45:55 -0500 [thread overview]
Message-ID: <5745C8B3.2050609@ti.com> (raw)
In-Reply-To: <20160518205758.GY5783@n2100.arm.linux.org.uk>
On 05/18/2016 03:57 PM, Russell King - ARM Linux wrote:
> On Wed, May 18, 2016 at 10:25:03PM +0200, Arnd Bergmann wrote:
>> The ARM version of ioremap_exec() that gets added in this patch is cached
>> (like memremap()), but then the asm-generic version is not? This is
>> even more confusing, it should at least do roughly the same thing across
>> architectures.
>>
>> There should also be some documentation about what the expected behavior is, e.g.:
>>
>> - is memremap_exec() by default cached or not? (I assume it would
>> be like memremap())
>> - If we have an interface that does explicit uncached executable mapping,
>> what about architectures on which this is not possible? Should they
>> fall back to cached or non-executable, or cause a link error?
Yes by default memremap_exec is cached, I do plan to add more explicit
documentation.
Well, I dont think that memremap_exec will be called directly but rather
using a flag with memremap as arch_memremap_wb is now, to keep the
memremap API unified, so a link error will prevent this. Also, the
function may be present in code but not actually used in all cases, the
example that comes to mind is the drivers/misc/sram.c code where other
runtime options are perfectly valid for determining how to map memory
even on architectures that can't memremap_exec_nocache.
I think that a remap that can't deliver what you have asked for should
return NULL here because if you are requesting executable, noncached
memory you presumably will try to execute from it and fail, so the
mapping should fail as it isn't actually valid if it can't do what you want.
>
> Another important point is whether atomic instructions / kernel locks
> can be located within the mapped memory.
>
At this point I'd imagine most of the users of this would be copying
small chunks of relocatable code (likely written in assembly) that would
handle low-level tasks without the need for atomic instructions/locks,
but is this something we should explicitly forbid in documentation?
Regards,
Dave
next prev parent reply other threads:[~2016-05-25 15:45 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
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 [this message]
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=5745C8B3.2050609@ti.com \
--to=d-gerlach@ti.com \
--cc=alexandre.belloni@free-electrons.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=nm@ti.com \
--cc=russ.dill@ti.com \
--cc=shawnguo@kernel.org \
--cc=tony@atomide.com \
/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