Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 04-20-2011, 03:21 AM   #1
Joe Loos
LQ Newbie
Registered: Feb 2011
Posts: 2

Rep: Reputation: 0
Is there a way to insert an arbitrary virtual to physical address mapping?

I have a physical page that is not in the efi mem map. So its not known to linux/not mapped as a kernel page.

I'd like to map it in the hardware tables, from my kernel module, so I can access it from my kernel module.

Is there an interface in linux that can do this?

I see in arch/ia64/mm/init.c the internal interfaces pgd_offset_k(), pud_alloc(), pmd_alloc(), pte_alloc_kernel(), mk_pte(), and set_pte() are used to create mappings.

However, these internal interfaces are not exported for kernel modules to use.

Alternatively, I can pick a page that is reported in the efi mem map and mapped by arch/ia64/kernel/efi.c, for example, one of the PAL pages, then I can access it from my kernel module. However, I'd prefer the ability to insert arbitrary mappings.
Old 04-20-2011, 08:58 PM   #2
Joe Loos
LQ Newbie
Registered: Feb 2011
Posts: 2

Original Poster
Rep: Reputation: 0
The ioremap() interface does what I want. It maps my phys page to a virt addr in the ioremap virt addr range that I can use to access the page from my kernel module.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mapping Kernel virtual address space to Physical memory zones (ZONE_DMA, ZONE_NORMAL) kumart Linux - Newbie 2 04-03-2012 10:11 AM
how to translate virtual address to physical address in linux application saurin Programming 1 11-18-2009 10:05 PM
Find virtual to physical address mapping in Kernel? bkankru Linux - Kernel 2 11-09-2009 03:15 PM
API for mapping Physical Address to Virtual Address Lakshman_smt Linux - Software 2 10-15-2006 10:08 PM
Memory Mapping (same physical address = virtual address) Linux - Kernel 7 07-25-2006 12:13 AM > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration