How to map physical pages into vma

From: Boris Bierbaum
Date: Wed Jun 06 2007 - 05:55:27 EST


Hi,

inside of a kernel module, I need to re-map a part of a processes'
virtual address space (usually from the heap) to a range of physically
contiguous page frames that another kernel module provides me with (I
get a kernel virtual address to the beginning of the first page frame).

I tried remap_pfn_range(), but as Copy-on-Write is used for the heap's
vma, remap_pfn_range() refuses to do the mapping, because I only want to
re-map some part of the vma, not the whole thing.

Then I tried to use vm_insert_page() for each individual physical page,
but as the count is 0 for these pages, this is refused, too.

I can't use split_vma() to split the heap's vma twice and then use
remap_pfn_range() for the vma that represents the part that is to be
re-mapped, because split_vma() isn't supposed to be called from inside a
module, right?

Is there anything I can do about this?

Thanks in advance
Boris


--
| _ RWTH | Boris Bierbaum
|_|_`_ | Lehrstuhl fuer Betriebssysteme
| |_) _ | RWTH Aachen D-52056 Aachen
|_)(_` | Tel: +49-241-80-27805
._) | Fax: +49-241-80-22339
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/