2006-11-22 18:04:40

by pledr

[permalink] [raw]
Subject: mapping of pages out of upper 128MB into kernel address space

Hi,
in a kernel module I have to translate user addresses into kernel addresses. The user uses shared memory allocated with shm_open / ftruncate. This shared memory is allocated somewhere in the upmost 128MB of physical memory that is NOT permanently mapped into the kernel ( found in swapper_pg_dir ). How can I "smp_save" map this memory into the kernel address space ?

Kind regards
Peter Lezoch


2006-11-22 18:23:08

by Alan

[permalink] [raw]
Subject: Re: mapping of pages out of upper 128MB into kernel address space

On 22 Nov 2006 18:05 GMT
<[email protected]> wrote:

> Hi,
> in a kernel module I have to translate user addresses into kernel addresses. The user uses shared memory allocated with shm_open / ftruncate. This shared memory is allocated somewhere in the upmost 128MB of physical memory that is NOT permanently mapped into the kernel ( found in swapper_pg_dir ). How can I "smp_save" map this memory into the kernel address space ?

See how copy_highpage and friends are used by copy_to/from_user. The
kmaps are a limited resource so you can only really use them to briefly
map objects in this way.

Alan