Skip to contentSkip to conversation

How to map physical pages into vma

DISCUSSION Boris Bierbaum 1 participant 1 message Jun 6, 2007

lore
Share & tools
lore
#0 lore raw

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

Signature · 5 lines
|  _  RWTH | Boris Bierbaum
|_|_`_     | Lehrstuhl fuer Betriebssysteme
   | |_) _  | RWTH Aachen D-52056 Aachen
     |_)(_` | Tel: +49-241-80-27805
        ._) | Fax: +49-241-80-22339