Subject: Re: UVM - Kernel & User access question
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 10/16/2003 14:30:21
> I would like to use UVM to allocate large memory in kernel land.  I
> used uao_create, round_page, uvm_map to allocate virtual space.

As I understand it, those allocate userland VM.

> But now I would like to write and read inside those pages still being
> in kernel land.  When I tried with copyout to write buffer inside it
> I got a page fault...

I don't recall what process your code is creating userland memory for.
If it's not the current process - the one in curproc - or something
suitably similar for a multiprocessor kernel, copyout won't work.

> I learnt from der Mouse that at this step no backend physical pages
> are created in relation to my virtual space, how do I have to force a
> page creation?

If the memory is for the current process, I _think_ copyout should do
that.

Of course, I could be wrong.

It sounds to me as though what you really want is pageable kernel
memory.  I don't know whether that exists at present.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B