LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-13-2010, 01:50 PM   #1
kickuindajunk
LQ Newbie
 
Registered: Aug 2010
Posts: 10

Rep: Reputation: 0
KMAP Physical Page to Kernel Virtual Address: unable to handle kernel paging request


Hello everyone,

I have seemed to come across some strange behavior and was hoping to either get a solution or explanation for what I am seeing.

Using kernel 2.6.31.6, I compiled two slightly different 32-bit builds. One build is PAE enabled, one is not. This is the only difference between the two. On my PAE enabled build I can map a physical frame number to a kernel virtual address by using: page = pfn_to_page(phypageaddr); va = kmap(page); Using "va" I can read the contents successfully. However, if I try the same for the non-PAE build I get an error: "unable to handle kernel paging request." The PDE = 00000000.

The memory I am accessing is mapped just below the 2 gb boundary and this is marked as BIOS reserved in the bios memory map. I can successfully map lower memory (e.g. 0xe0000) which is also BIOS reserved without an issue.

At this point I am very stumped on the issue I am having given such a minimal change. I don't believe PAE should effect such a request.

Any help, insight, or direction for solving such a problem would be greatly appreciated. Or suggest a better way to map a physical address area to virtual memory.

Thanks,

J
 
Old 08-13-2010, 02:38 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
Try remap_pfn_range function. Usually, remap_pfn_range is used to map a physical address to virtual address.
 
Old 08-13-2010, 04:17 PM   #3
kickuindajunk
LQ Newbie
 
Registered: Aug 2010
Posts: 10

Original Poster
Rep: Reputation: 0
hey nini09

thanks for the suggestion. unfortunately, it looks like remap_pfn_range is used to map kernel physical memory to userspace. The virtual address returned I believe isn't a kernel virtual address. I simply want to read physical memory in a kernel module, not from userspace.

If you believe I can still use remap_pfn_range, how are you suggest populating the vma struct which contains mm_struct which I believe is not available to a kernel module.

Thanks,

J
 
Old 08-16-2010, 02:22 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
What type address do you access, bus or RAM?
 
Old 08-17-2010, 04:52 AM   #5
kickuindajunk
LQ Newbie
 
Registered: Aug 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Ram. Plus I am positive of the contents at the memory location
 
Old 08-17-2010, 03:18 PM   #6
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
Walk through __get_free_pages function.
 
Old 08-21-2010, 12:17 PM   #7
kickuindajunk
LQ Newbie
 
Registered: Aug 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks nini09 for the suggestion. Have indeed walked through function. The problem is that page_address is returning a valid va when the page table entry is not mapped.

Either way it seems like a bug. I am doing something very straight forward and the paging request can't be handled. All I want to do is map some physical memory to a virtual KERNEL address. Using existing kernel memory functions fail. This only happens for higher range memory locations (above 0x7FB00000).

I gave up on the issue and decided to stick with PAE.
 
  


Reply



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
unable to handle kernel paging request at virtual address skibud2 Linux - Kernel 0 12-10-2009 08:32 AM
Unable to handle kernel paging request at virtual address ff200200 gdkool Linux - Kernel 10 07-22-2009 06:33 AM
Unable to handle kernel paging request at virtual address gdkool Linux - Software 2 01-04-2008 07:21 AM
unable to handle kernel paging request at virtual address 723d4edb mahipal Linux - Kernel 1 03-02-2007 07:05 PM
Unable to handle kernel paging request at virtual address jah3765 Linux - General 6 01-17-2005 09:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:20 AM.

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