You do not need ioremap() if you use remap_pfn_range() . ioremap() maps the physical address to the virtual address of the kernel. remap_pfn_range() maps physical addresses directly to user space. Just pass your physical address (down to PAGE_SHIFT to create pfn) directly to remap_pfn_range() . Your questions are in order:
- virtual kernel address
- kmalloc returns the kernel virtual but guarantees continuous memory See question 116343
- you could do this if you first call
virt_to_phys() to convert the virtual address of the kernel to physical. But skip the step if you really don't need access to this memory range. - physical address, downcast on PAGE_SHIFT to create pfn
Peter source share