LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-07-2011, 08:14 PM   #1
leechaotang
LQ Newbie
 
Registered: Aug 2011
Posts: 10

Rep: Reputation: Disabled
When IOMMU is enabled, how to get the Kernel Virtual Address from a Physical address


Hi,

I use dam_alloc_coherent to allocate a DMA memory, I observe that the dma_addr_t (0xFC000000) and the virtual address (0xFFFF8800FC000000) are all under 1G address when the IOMMU is DISABLED. Then I can get the virtual address back in other code by phys_to_virt() with the physical address.

When the IOMMU is ENABLED, I found that the physical address (0xFC000000) is still under 1G address but the virtual address is bigger than 1G (0xFFFF8801FA000000), and the phys_to_virt() can not return the correct virtual address by physical address??????

How can I get the correct virtual address by physical address when IOMMU is on???

Thanks for any comment!
 
Old 11-10-2011, 12:21 AM   #2
prabagaranvt
LQ Newbie
 
Registered: Mar 2011
Posts: 23

Rep: Reputation: 0
If IOMMU is disabled then virtual and physical address will be same.
If IOMMU is enabled , adding the PAGE_OFFSET to the physical address will give the virtual address.

correct me if am wrong.
 
  


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
Converting virtual address to physical address in the kernel DBQ Programming 0 02-07-2010 06:30 PM
how to translate virtual address to physical address in linux application saurin Programming 1 11-18-2009 09:05 PM
how to find physical address of kernel virtual address kushneeraj Programming 0 10-20-2006 07:29 PM
API for mapping Physical Address to Virtual Address Lakshman_smt Linux - Software 2 10-15-2006 09:08 PM
Memory Mapping (same physical address = virtual address) skd.tech Linux - Kernel 7 07-24-2006 11:13 PM

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

All times are GMT -5. The time now is 04:29 PM.

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