Hi,
On i386, EFI may need to map EFI runtime code area as EXEC enabled with
ioremap(). But, I found that the memory are mapped as EXEC disabled when
mapped with ioremap() now. I think we may need a method to map memory
area as EXEC enabled with ioremap_xxx(). Some possible interface schemes
for mapping as EXEC enabled are as follow:
- Interface scheme 1:
ioremap_cache_exec()
ioremap_uncache_exec()
- Interface scheme 2:
enum ioremap_mode {
IOR_MODE_UNCACHED,
IOR_MODE_CACHED,
};
enum ioremap_xmode {
IOR_XMODE_UNEXEC,
IOR_XMODE_EXEC,
};
void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
enum ioremap_mode mode,
enum ioremap_xmode xmode);
Which one do you think is better? Or we should use some other interface
or method?
Best Regards,
Huang Ying
On Wednesday 30 January 2008 10:32, Huang, Ying wrote:
> Hi,
>
> On i386, EFI may need to map EFI runtime code area as EXEC enabled with
> ioremap(). But, I found that the memory are mapped as EXEC disabled when
> mapped with ioremap() now. I think we may need a method to map memory
> area as EXEC enabled with ioremap_xxx(). Some possible interface schemes
> for mapping as EXEC enabled are as follow:
Does __ioremap(..., PAGE_KERNEL_EXEC) not work?
-Andi
On Jan 30, 2008 5:59 PM, Andi Kleen <[email protected]> wrote:
> On Wednesday 30 January 2008 10:32, Huang, Ying wrote:
> > Hi,
> >
> > On i386, EFI may need to map EFI runtime code area as EXEC enabled with
> > ioremap(). But, I found that the memory are mapped as EXEC disabled when
> > mapped with ioremap() now. I think we may need a method to map memory
> > area as EXEC enabled with ioremap_xxx(). Some possible interface schemes
> > for mapping as EXEC enabled are as follow:
>
> Does __ioremap(..., PAGE_KERNEL_EXEC) not work?
The the last parameter of the current implementation of __ioremap() in
x86 git is enum ioremap_mode (IOR_MODE_UNCACHED and IOR_MODE_CACHED),
not the flags like before. So this does not work.
Best Regards,
Huang Ying
> The the last parameter of the current implementation of __ioremap() in
> x86 git is enum ioremap_mode (IOR_MODE_UNCACHED and IOR_MODE_CACHED),
> not the flags like before. So this does not work.
Ah you're right sorry. Looks like a design flaw in the recent git-x86 changes.
-Andi
On Wed, 30 Jan 2008 17:32:10 +0800
"Huang, Ying" <[email protected]> wrote:
> Hi,
>
> On i386, EFI may need to map EFI runtime code area as EXEC enabled
> with ioremap(). But, I found that the memory are mapped as EXEC
> disabled when mapped with ioremap() now. I think we may need a method
> to map memory area as EXEC enabled with ioremap_xxx(). Some possible
> interface schemes for mapping as EXEC enabled are as follow:
>
> - Interface scheme 1:
scheme 3:
set_memory_x(... )
On Wed, Jan 30, 2008 at 07:45:40AM -0800, Arjan van de Ven wrote:
> On Wed, 30 Jan 2008 17:32:10 +0800
> "Huang, Ying" <[email protected]> wrote:
>
> > Hi,
> >
> > On i386, EFI may need to map EFI runtime code area as EXEC enabled
> > with ioremap(). But, I found that the memory are mapped as EXEC
> > disabled when mapped with ioremap() now. I think we may need a method
> > to map memory area as EXEC enabled with ioremap_xxx(). Some possible
> > interface schemes for mapping as EXEC enabled are as follow:
> >
> > - Interface scheme 1:
>
> scheme 3:
>
> set_memory_x(... )
On i386 EFI is unlikely to be in the direct mapping ...
-Andi
On Wed, 30 Jan 2008 18:30:48 +0100
Andi Kleen <[email protected]> wrote:
> On Wed, Jan 30, 2008 at 07:45:40AM -0800, Arjan van de Ven wrote:
> > On Wed, 30 Jan 2008 17:32:10 +0800
> > "Huang, Ying" <[email protected]> wrote:
> >
> > > Hi,
> > >
> > > On i386, EFI may need to map EFI runtime code area as EXEC enabled
> > > with ioremap(). But, I found that the memory are mapped as EXEC
> > > disabled when mapped with ioremap() now. I think we may need a
> > > method to map memory area as EXEC enabled with ioremap_xxx().
> > > Some possible interface schemes for mapping as EXEC enabled are
> > > as follow:
> > >
> > > - Interface scheme 1:
> >
> > scheme 3:
> >
> > set_memory_x(... )
>
> On i386 EFI is unlikely to be in the direct mapping ...
1) 32 bit EFI is totally irrelevant.
2) set_memory_ and set_pages_ API is not restricted to direct mapping. That's why they take a virtual address / struct page
>
> -Andi
>
--
If you want to reach me at my work email, use [email protected]
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
> 1) 32 bit EFI is totally irrelevant.
Apparently not to the original poster. And some Apple x86 users might
also disagree.
On x86-64 BTW while they could still rely on end_pfn_mapped and
it being direct mapped Venki's PAT patchkit removes that so ioremap
would be needed there too
> 2) set_memory_ and set_pages_ API is not restricted to direct mapping.
> That's why they take a virtual address / struct page
If there is no direct mapping what page tables should they change?
Surely you're not suggesting they should walk all vmalloc areas and switch
them over. I don't think this is correct.
-Andi