Pages of PCI-E Memory mapped with ioremap
Hello,
My background is in FPGA design, not kernel development. I'm pretty new to a lot of the things going on behind the scenes in the kernel. I've been trying to get my head wrapped around various details related to memory management in Linux. I appear to have hit a roadblock and could really use some help.
I'm trying to determine how to obtain the page structures of PCI-E virtual addresses I've mapped with ioremap. I have no problem actually reading or writing to memory so I'm sure that much as been done correctly. I get a virtual address back and was planning to to virt_to_page. However I noticed that virt_addr_valid returns false. Digging more into things two appear to be two kinds of virtual address within the kernel: logical and virtual (this seems like an unfortunate naming convention). Near as I can virt_addr_valid is checking for logical address. The virtual address space is often referred to as the vma_alloc area as well. This area is also where IO is mapped. Digging more I found the is_vmalloc_addr helper. Passing in the address return from ioremap returns true. Great, so now I can use vmalloc_to_page. Unfortunately This returns NULL for my PCI-Express virtual address. Passing in a pointer allocated with vmaalloc does return a page. At this point I've appeared to have exhausted all avenues for actually getting these pages. I may dig more into how ioremap in to get answers but I'm hoping a kind expert will be able to point me in the right direction.
Thanks for any assistance!
|