From owner-freebsd-arch@FreeBSD.ORG Tue May 14 16:33:17 2013 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CD093ADD; Tue, 14 May 2013 16:33:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6F6DD8C9; Tue, 14 May 2013 16:33:17 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r4EGXEUJ030387; Tue, 14 May 2013 19:33:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r4EGXEUJ030387 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r4EGXEEh030386; Tue, 14 May 2013 19:33:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 14 May 2013 19:33:14 +0300 From: Konstantin Belousov To: John Baldwin Subject: Re: Extending MADV_PROTECT Message-ID: <20130514163313.GT3047@kib.kiev.ua> 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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WRrpaeeXzhhJjPHD" Content-Disposition: inline In-Reply-To: <51914914.805@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 May 2013 16:33:17 -0000 --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 ; > 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--