[PATCH] netbsd32 swapctl, round 3

2014-02-01 Thread Emmanuel Dreyfus
Hi Here is my latest attempt at netbsd32 swapctl. I had to make uvm_swap_stats() available to emul code, but that seems to be what it was intented for, according to comments in the code. I kept the stuff #ifdef __amd64__ but I am not convinced of the benefit is worth the ifdef. Perhaps we could

Re: [PATCH] netbsd32 swapctl, round 3

2014-02-01 Thread Martin Husemann
On Sat, Feb 01, 2014 at 08:41:15AM +, Emmanuel Dreyfus wrote: Hi Here is my latest attempt at netbsd32 swapctl. I had to make uvm_swap_stats() available to emul code, but that seems to be what it was intented for, according to comments in the code. Looks good. I kept the stuff #ifdef

Re: [PATCH] netbsd32 swapctl, round 3

2014-02-01 Thread Maxime Villard
Le 01/02/2014 10:51, Martin Husemann a écrit : On Sat, Feb 01, 2014 at 08:41:15AM +, Emmanuel Dreyfus wrote: Hi Here is my latest attempt at netbsd32 swapctl. I had to make uvm_swap_stats() available to emul code, but that seems to be what it was intented for, according to comments in

config(1) ioconf doesn't seem good enough for pseudo-devices?

2014-02-01 Thread Paul Goyette
We have a fairly large number of device driver modules which use the (undocumented?) ioconf statement in config(1) to generate the various data structures needed by the config(9) mechanisms. This seems to work just fine for real devices, but for pseudo-devices the generated files don't quite

Re: [PATCH] netbsd32 swapctl, round 3

2014-02-01 Thread Matt Thomas
On Feb 1, 2014, at 12:41 AM, Emmanuel Dreyfus m...@netbsd.org wrote: + int count = SCARG(uap, misc); + int i, error; + + sep = kmem_alloc(sizeof(*sep) * count, KM_SLEEP); + sep32 = kmem_alloc(sizeof(*sep32) * count, KM_SLEEP); Before using count, one must limit it using:

Re: [PATCH] netbsd32 swapctl, round 3

2014-02-01 Thread David Laight
On Sat, Feb 01, 2014 at 08:41:15AM +, Emmanuel Dreyfus wrote: Hi Here is my latest attempt at netbsd32 swapctl. I had to make uvm_swap_stats() available to emul code, but that seems to be what it was intented for, according to comments in the code. I've just looked at the code in

Re: [PATCH] netbsd32 swapctl, round 3

2014-02-01 Thread Emmanuel Dreyfus
David Laight da...@l8s.co.uk wrote: You are leaking the contents of kernel memory to userspace. How? I do not copy more than the string, and I only copyout filled records. -- Emmanuel Dreyfus http://hcpnet.free.fr/pubz m...@netbsd.org

Re: [PATCH] netbsd32 swapctl, round 3

2014-02-01 Thread Emmanuel Dreyfus
Matt Thomas m...@3am-software.com wrote: You only need one sep32 and then copyout each entry: Isn't there a performance impact to call copyout several times instead of one? -- Emmanuel Dreyfus http://hcpnet.free.fr/pubz m...@netbsd.org

Re: [PATCH] netbsd32 swapctl, round 3

2014-02-01 Thread Matt Thomas
On Feb 1, 2014, at 4:49 PM, Emmanuel Dreyfus m...@netbsd.org wrote: Matt Thomas m...@3am-software.com wrote: You only need one sep32 and then copyout each entry: Isn't there a performance impact to call copyout several times instead of one? Compared to kmem_alloc/kmem_free? Notice we

[PATCH] netbsd32 swapctl, round 4

2014-02-01 Thread Emmanuel Dreyfus
Latest revision of the netbsd32 swapctl patch I noted david@ suggestion to rework uvm_swap_stats() to add a callback, but I am not sure it is worth it. This is just the emulation path for a rarely used code path. I can work on it if the consensus is that it is the way to go, though. Index:

re: [PATCH] netbsd32 swapctl, round 4

2014-02-01 Thread matthew green
Latest revision of the netbsd32 swapctl patch this looks good now. thanks for dealing with this properly! .mrg.