Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 May 2013 19:33:14 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        arch@freebsd.org
Subject:   Re: Extending MADV_PROTECT
Message-ID:  <20130514163313.GT3047@kib.kiev.ua>
In-Reply-To: <51914914.805@FreeBSD.org>
References:  <201305071433.27993.jhb@freebsd.org> <201305090814.52166.jhb@freebsd.org> <20130509123147.GT3047@kib.kiev.ua> <201305101535.50633.jhb@freebsd.org> <20130511043606.GE3047@kib.kiev.ua> <51914914.805@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--WRrpaeeXzhhJjPHD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, May 13, 2013 at 04:12:04PM -0400, John Baldwin wrote:
> On 5/11/13 12:36 AM, Konstantin Belousov wrote:
> > Do we need the genericity of the ioctl for procctl ?
> > Ptrace(2) does not need the size encoded.
> >=20
> > I mean, the call is never marshalled to some unknown driver which needs
> > a size of parameters unknown to the generic layer. I suppose that all
> > additions to procctl() would have the size of the control structures
> > pre-defined. Then, you could just do copyin and, if needed, copyout
> > discrimating on the command code, and not on the encoding of the size in
> > the command.
> >=20
> > Also, command could be int and not long then, eliminating the need for
> > compat32 wrapper.
>=20
> Well, the generic-ness of ioctl() seemed useful to me.  Also, I think
> with this model you could make fo_ioctl() for a process fd just do this:
>=20
> proc_ioctl(..., u_long cmd, caddr_t data)
> {
>=20
> 	pid =3D <get pid from f_data>;
> 	return (kern_procctl(td, P_PID, pid, cmd, data));
> }
>=20
> So you could reuse procctl constants as ioctls for proc descriptors.  It
> is true that unlike drivers there is currently no method to provide a
> "hook" to support new commands (they would just have to be added by hand
> into sys_process.c for now).  Also, if we need to "thunk" structures for
> compat32 support in the future it is better if the kern_procctl()
> version takes a KVA rather than a UVA.
>=20
> OTOH, it is more boilerplate code to put in.
Yes, I just do not see much need in it, but this is your call, finally.

>=20
> In terms of a compat32 wrapper: id_t is a uint64_t, so a wrapper would
> be required regardless.
>=20
> --=20
> John Baldwin

--WRrpaeeXzhhJjPHD
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (FreeBSD)

iQIcBAEBAgAGBQJRkmdJAAoJEJDCuSvBvK1Br7cP/1noMtkDD5BBoDI9L8QqI2FC
LSt6ba/2bUswxzg6eqg4p2JectPzSoLD14cap1ju+sz2q3RAg70t7WXDbaWcV5oo
v+5XJ0CsUnxz2Jc93wquEkx9f4nm3uK5TFnra0Pf84ywXahOTcbe51idV1gX1xmS
xvml1nGxlTlFUTZSdwFVX0TUS4gKIfmnhGOYJNjuDCYxiiByZKbOvmAF+RUdqyru
9tiFCo6OCyPsvDGJHEiJ1+hT3Wd8/TEFS/92529xbNXxiqtFmg6fro2DxrwX2mUm
+3lpBxRv5ehtYIKtAg2rDiipQZfM8fYSNevy2fMO0VWJkIUmKdI3+qkjtwxvSZYo
y1rxUW35QKBHLKazvJqVphLDtoinLn+d/tJmopWGMM2cAUVX7ULNuVxWjJxL2y8z
wB/ywLy7VdzZmivR02F5tSgZs1RX557pBKwJv5oO0lahP931sFO1uOvi6N8SMytu
9Y9RayN6LpBdm6JGet1OiiMrNZZGe+mrknJKgOUJQ/3ysmuOTDnT2fXFAfdjCVnx
P2QeddkFNz4d1bL69vs0HNvjpR9hzdgaXIKli0Tqs/J2DEu94864LeJrJ3KejDlJ
0ifiYlgbQQa/NkE8x/TXl/vJELrZQ08/5siUL3tX++PScvpQAU3Qli11TZku4BIc
w5Y7f6FECp6HDR3ky73J
=9HSj
-----END PGP SIGNATURE-----

--WRrpaeeXzhhJjPHD--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130514163313.GT3047>