Re: Implement mmap for PUD

2011-09-16 Thread Masao Uebayashi
OK, I've re-read this topic. Your goal is to implement blktap on NetBSD/Xen, right? According to Xen wiki [1], blktap provides an interface for userland to handle block device I/O. I guess blktap gets inter-domain, shared ring memory from hypervisor. Dom0 userland mmaps the ring memory and

Re: Implement mmap for PUD

2011-09-16 Thread Masao Uebayashi
I think mmap can work as follows: - blktap(4) allocates shared ring memory - pud(4) is attached to a parent blktap(4) - userland asks mmap buffer (shared ring memory) - UVM finds a VA range, attaches pud(4) there - touching the buffer causes fault, uvm_fault - udv_fault - pud_mmap are called -

Re: Implement mmap for PUD

2011-09-12 Thread Eduardo Horvath
On Sat, 10 Sep 2011, Masao Uebayashi wrote: On Sat, Sep 10, 2011 at 7:24 PM, Roger Pau Monné roger@entel.upc.edu wrote: PUD is a framework present in NetBSD that allows to implement character and block devices in userspace. I'm trying to implement a blktap [1] driver purely in

Re: Implement mmap for PUD

2011-09-10 Thread Masao Uebayashi
On Sat, Sep 10, 2011 at 7:24 PM, Roger Pau Monné roger@entel.upc.edu wrote: Hello, Thanks for the atop tip, now I'm able to pass the memory around, but the kernel crashes shortly after reading the value from the returned memory region: panic: kernel diagnostic assertion

Re: Implement mmap for PUD

2011-09-10 Thread Roger Pau Monné
It is called pipe(2), isn't it? Thanks for the reply, but I don't understand why pipe could be helpful in this situation, the mmap kernel call needs to return a paddr_t (a memory region), and pipe returns a pair of file descriptors, that I cannot pass to the kernel. The flow of a PUD call is

Re: Implement mmap for PUD

2011-09-09 Thread David Young
On Wed, Sep 07, 2011 at 10:33:54AM +0200, Roger Pau Monné wrote: Hello, Since there is no mmap implementation for PUD devices I began working on one. I would like to make an implementation that avoids copying buffers around user-space and kernel memory, since mmap is usually used for fast

Re: Implement mmap for PUD

2011-09-09 Thread Eduardo Horvath
On Wed, 7 Sep 2011, Roger Pau Monné wrote: Basically we use pud_request to pass the request to the user-space server, and the server returns a memory address, allocated in the user-space memory of it's process. Then I try to read the value of the user space memory from the kernel, which works

Re: Implement mmap for PUD

2011-09-07 Thread Jean-Yves Migeon
On 07.09.2011 10:33, Roger Pau Monné wrote: Since there is no mmap implementation for PUD devices I began working on one. I would like to make an implementation that avoids copying buffers around user-space and kernel memory, since mmap is usually used for fast applications. I began working on