LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* ioremap_xxx() with EXEC enabled
@ 2008-01-30  9:32 Huang, Ying
  2008-01-30  9:59 ` Andi Kleen
  2008-01-30 15:45 ` Arjan van de Ven
  0 siblings, 2 replies; 8+ messages in thread
From: Huang, Ying @ 2008-01-30  9:32 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, Andi Kleen; +Cc: linux-kernel

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ioremap_xxx() with EXEC enabled
  2008-01-30  9:32 ioremap_xxx() with EXEC enabled Huang, Ying
@ 2008-01-30  9:59 ` Andi Kleen
  2008-01-30 13:00   ` huang ying
  2008-01-30 15:45 ` Arjan van de Ven
  1 sibling, 1 reply; 8+ messages in thread
From: Andi Kleen @ 2008-01-30  9:59 UTC (permalink / raw)
  To: Huang, Ying; +Cc: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, linux-kernel

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ioremap_xxx() with EXEC enabled
  2008-01-30  9:59 ` Andi Kleen
@ 2008-01-30 13:00   ` huang ying
  2008-01-30 13:22     ` Andi Kleen
  0 siblings, 1 reply; 8+ messages in thread
From: huang ying @ 2008-01-30 13:00 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Huang, Ying, Ingo Molnar, H. Peter Anvin, Thomas Gleixner, linux-kernel

On Jan 30, 2008 5:59 PM, Andi Kleen <ak@suse.de> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ioremap_xxx() with EXEC enabled
  2008-01-30 13:00   ` huang ying
@ 2008-01-30 13:22     ` Andi Kleen
  0 siblings, 0 replies; 8+ messages in thread
From: Andi Kleen @ 2008-01-30 13:22 UTC (permalink / raw)
  To: huang ying
  Cc: Huang, Ying, Ingo Molnar, H. Peter Anvin, Thomas Gleixner, linux-kernel


> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ioremap_xxx() with EXEC enabled
  2008-01-30  9:32 ioremap_xxx() with EXEC enabled Huang, Ying
  2008-01-30  9:59 ` Andi Kleen
@ 2008-01-30 15:45 ` Arjan van de Ven
  2008-01-30 17:30   ` Andi Kleen
  1 sibling, 1 reply; 8+ messages in thread
From: Arjan van de Ven @ 2008-01-30 15:45 UTC (permalink / raw)
  To: Huang, Ying
  Cc: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, Andi Kleen, linux-kernel

On Wed, 30 Jan 2008 17:32:10 +0800
"Huang, Ying" <ying.huang@intel.com> 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(... )

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ioremap_xxx() with EXEC enabled
  2008-01-30 15:45 ` Arjan van de Ven
@ 2008-01-30 17:30   ` Andi Kleen
  2008-01-30 17:44     ` Arjan van de Ven
  0 siblings, 1 reply; 8+ messages in thread
From: Andi Kleen @ 2008-01-30 17:30 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: Huang, Ying, Ingo Molnar, H. Peter Anvin, Thomas Gleixner,
	Andi Kleen, linux-kernel

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" <ying.huang@intel.com> 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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ioremap_xxx() with EXEC enabled
  2008-01-30 17:30   ` Andi Kleen
@ 2008-01-30 17:44     ` Arjan van de Ven
  2008-01-30 18:35       ` Andi Kleen
  0 siblings, 1 reply; 8+ messages in thread
From: Arjan van de Ven @ 2008-01-30 17:44 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Huang, Ying, Ingo Molnar, H. Peter Anvin, Thomas Gleixner,
	Andi Kleen, linux-kernel

On Wed, 30 Jan 2008 18:30:48 +0100
Andi Kleen <ak@suse.de> 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" <ying.huang@intel.com> 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 arjan@linux.intel.com
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ioremap_xxx() with EXEC enabled
  2008-01-30 17:44     ` Arjan van de Ven
@ 2008-01-30 18:35       ` Andi Kleen
  0 siblings, 0 replies; 8+ messages in thread
From: Andi Kleen @ 2008-01-30 18:35 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: Huang, Ying, Ingo Molnar, H. Peter Anvin, Thomas Gleixner, linux-kernel


> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-01-30 18:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-30  9:32 ioremap_xxx() with EXEC enabled Huang, Ying
2008-01-30  9:59 ` Andi Kleen
2008-01-30 13:00   ` huang ying
2008-01-30 13:22     ` Andi Kleen
2008-01-30 15:45 ` Arjan van de Ven
2008-01-30 17:30   ` Andi Kleen
2008-01-30 17:44     ` Arjan van de Ven
2008-01-30 18:35       ` Andi Kleen

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).