How to create a kernel virtual mapping for physical addresses.

From: brace
Date: Fri Apr 08 2011 - 18:03:26 EST

Given a physical address and a length (which may span contiguous pages), how
does one go about creating a virtual mapping for that address? That address may
be in high memory (above 4GB) in a 32bit system.

ioremap() wants a 32bit physical address on 32bit systems. kmap() and
kmap_atomic() wants a struct page which I am not sure how to get from a physical

If there already is a kernel mapping, then using the existing kernel mapping
would be fine if I could figure out how to get it, but if there is not one,
then I need to make one.

I think setting the DMA mask to 32bit would mean that I do not have to deal
with highmem addresses in my particular case, but I still do not know how to
get a virtual address from a physical.

Any suggestions?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at