ioremap_xxx() with EXEC enabled - Kernel

This is a discussion on ioremap_xxx() with EXEC enabled - 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 ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: ioremap_xxx() with EXEC enabled

  1. ioremap_xxx() with EXEC enabled

    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

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: ioremap_xxx() with EXEC enabled

    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
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. Re: ioremap_xxx() with EXEC enabled

    On Jan 30, 2008 5:59 PM, Andi Kleen 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
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  4. Re: ioremap_xxx() with EXEC enabled


    > 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
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  5. Re: ioremap_xxx() with EXEC enabled

    On Wed, 30 Jan 2008 17:32:10 +0800
    "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:
    >
    > - Interface scheme 1:


    scheme 3:

    set_memory_x(... )
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  6. Re: ioremap_xxx() with EXEC enabled

    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" 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

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  7. Re: ioremap_xxx() with EXEC enabled

    On Wed, 30 Jan 2008 18:30:48 +0100
    Andi Kleen 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" 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
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  8. Re: ioremap_xxx() with EXEC enabled


    > 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
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread