Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1403023
| From | Dave Gerlach <d-gerlach@ti.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH 1/3] asm-generic: io: Add exec versions of ioremap |
| Date | 2016-05-18 16:20 +0200 |
| Message-ID | <rAaun-3d5-41@gated-at.bofh.it> (permalink) |
| References | <rx1dT-5zE-1@gated-at.bofh.it> <rx1dV-5zE-23@gated-at.bofh.it> <ry1Oy-1bi-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi,
On 05/12/2016 11:37 AM, Russell King - ARM Linux wrote:
> 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.
Ok thank you for the pointer. I agree, the memremap API looks like a
better fit for this. I think it likely makes the most sense to still add
these ioremap_exec and ioremap_exec_nocache and then call them through
the memremap API based on new flags. This will fit into the current use
model for memremap as it currently uses all of the other ioremap calls
internally, and doing it how I just described will let this code evolve
along with memremap.
I will put v2 together this way and send it out.
Regards,
Dave
>
> Thanks.
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [RFC PATCH 1/3] asm-generic: io: Add exec versions of ioremap Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-05-12 18:40 +0200
Re: [RFC PATCH 1/3] asm-generic: io: Add exec versions of ioremap Dave Gerlach <d-gerlach@ti.com> - 2016-05-18 16:20 +0200
Re: [RFC PATCH 1/3] asm-generic: io: Add exec versions of ioremap Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-05-18 20:00 +0200
Re: [RFC PATCH 1/3] asm-generic: io: Add exec versions of ioremap Arnd Bergmann <arnd@arndb.de> - 2016-05-18 22:30 +0200
Re: [RFC PATCH 1/3] asm-generic: io: Add exec versions of ioremap Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-05-18 23:00 +0200
Re: [RFC PATCH 1/3] asm-generic: io: Add exec versions of ioremap Dave Gerlach <d-gerlach@ti.com> - 2016-05-25 17:50 +0200
csiph-web