From owner-svn-src-stable-10@freebsd.org Sun Jan 3 17:19:19 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 270DCA60127; Sun, 3 Jan 2016 17:19:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8CFA1988; Sun, 3 Jan 2016 17:19:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03HJIOS075643; Sun, 3 Jan 2016 17:19:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03HJIo7075642; Sun, 3 Jan 2016 17:19:18 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601031719.u03HJIo7075642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 3 Jan 2016 17:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293109 - in stable: 10/share/mk 9/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 17:19:19 -0000 Author: dim Date: Sun Jan 3 17:19:17 2016 New Revision: 293109 URL: https://svnweb.freebsd.org/changeset/base/293109 Log: MFC r293014: Merge r293006 from clang380-import branch: For determining the compiler version, quote the string to be echo'd, otherwise the command might fail. This is because clang -v now results in the following: FreeBSD clang version 3.8.0 (trunk 256633) (based on LLVM 3.8.0svn) The second "3.8.8svn)" string tripped up the shell command. Modified: stable/10/share/mk/bsd.compiler.mk Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/share/mk/bsd.compiler.mk Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/mk/ (props changed) Modified: stable/10/share/mk/bsd.compiler.mk ============================================================================== --- stable/10/share/mk/bsd.compiler.mk Sun Jan 3 16:13:03 2016 (r293108) +++ stable/10/share/mk/bsd.compiler.mk Sun Jan 3 17:19:17 2016 (r293109) @@ -40,7 +40,7 @@ COMPILER_TYPE:= clang . endif .endif .if !defined(COMPILER_VERSION) -COMPILER_VERSION!=echo ${_v:M[1-9].[0-9]*} | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' +COMPILER_VERSION!=echo "${_v:M[1-9].[0-9]*}" | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' .endif .undef _v .endif From owner-svn-src-stable-10@freebsd.org Sun Jan 3 17:23:18 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D294A6036C; Sun, 3 Jan 2016 17:23:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E03611E92; Sun, 3 Jan 2016 17:23:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03HNGHq078406; Sun, 3 Jan 2016 17:23:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03HNG5f078405; Sun, 3 Jan 2016 17:23:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201601031723.u03HNG5f078405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 3 Jan 2016 17:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293110 - in stable: 10/contrib/pf/pflogd 9/contrib/pf/pflogd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 17:23:18 -0000 Author: dim Date: Sun Jan 3 17:23:16 2016 New Revision: 293110 URL: https://svnweb.freebsd.org/changeset/base/293110 Log: MFC r293015: Merge r293013 from clang380-import branch: Fix a clang 3.8.0 warning in pflogd.c: contrib/pf/pflogd/pflogd.c:769:8: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses] if (!if_exists(interface) == -1) { ^ ~~ The if_exists() function does not return -1, and even if it did, it would not be the correct way to check. Just ditch the == -1 instead. Obtained from: OpenBSD's pflogd.c 1.49 Modified: stable/10/contrib/pf/pflogd/pflogd.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/pf/pflogd/pflogd.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/pf/ (props changed) Modified: stable/10/contrib/pf/pflogd/pflogd.c ============================================================================== --- stable/10/contrib/pf/pflogd/pflogd.c Sun Jan 3 17:19:17 2016 (r293109) +++ stable/10/contrib/pf/pflogd/pflogd.c Sun Jan 3 17:23:16 2016 (r293110) @@ -766,7 +766,7 @@ main(int argc, char **argv) np = pcap_dispatch(hpcap, PCAP_NUM_PKTS, phandler, (u_char *)dpcap); if (np < 0) { - if (!if_exists(interface) == -1) { + if (!if_exists(interface)) { logmsg(LOG_NOTICE, "interface %s went away", interface); ret = -1; From owner-svn-src-stable-10@freebsd.org Sun Jan 3 22:50:20 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49203A610E7; Sun, 3 Jan 2016 22:50:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B6C913A0; Sun, 3 Jan 2016 22:50:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03MoJ4n075011; Sun, 3 Jan 2016 22:50:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03MoJbL075010; Sun, 3 Jan 2016 22:50:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601032250.u03MoJbL075010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 3 Jan 2016 22:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293121 - stable/10/sys/cddl/compat/opensolaris/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 22:50:20 -0000 Author: ngie Date: Sun Jan 3 22:50:19 2016 New Revision: 293121 URL: https://svnweb.freebsd.org/changeset/base/293121 Log: MFC r279437,r284107: r279437 (by rstone): Allow Illumos code to co-exist with nv(9) r284107 (by avg): compat nvpair.h: make sure that the names are mangled only for kernel Currently there is no good reason to mangle the userland API. The change was introduced in eac1d566b46edef765754203bef22c75c1699966, r279437. Also see https://reviews.freebsd.org/D1881. I am still convinced that nv should not have introduced intentionally conflicting API. Added: stable/10/sys/cddl/compat/opensolaris/sys/nvpair.h - copied unchanged from r293093, user/ngie/stable-10-libnv/sys/cddl/compat/opensolaris/sys/nvpair.h Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/cddl/compat/opensolaris/sys/nvpair.h (from r293093, user/ngie/stable-10-libnv/sys/cddl/compat/opensolaris/sys/nvpair.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/cddl/compat/opensolaris/sys/nvpair.h Sun Jan 3 22:50:19 2016 (r293121, copy of r293093, user/ngie/stable-10-libnv/sys/cddl/compat/opensolaris/sys/nvpair.h) @@ -0,0 +1,263 @@ +/*- + * Copyright (c) 2014 Sandvine Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_SYS_NVPAIR_H_ +#define _OPENSOLARIS_SYS_NVPAIR_H_ + +#ifdef _KERNEL + +/* + * Some of the symbols in the Illumos nvpair library conflict with symbols + * provided by nv(9), so we use this preprocessor hack to avoid the conflict. + * + * This list was generated by: + * cat nv.h nv_impl.h nvlist_* nvpair_impl.h | \ + * sed -nE 's/^[[:alnum:]_][[:alnum:]_ ]*[[:space:]]+[*]*([[:alnum:]_]+)\(.*$/#define \1 illumos_\1/p' | \ + * sort -u + */ +#define nvlist_add_binary illumos_nvlist_add_binary +#define nvlist_add_bool illumos_nvlist_add_bool +#define nvlist_add_descriptor illumos_nvlist_add_descriptor +#define nvlist_add_null illumos_nvlist_add_null +#define nvlist_add_number illumos_nvlist_add_number +#define nvlist_add_nvlist illumos_nvlist_add_nvlist +#define nvlist_add_nvpair illumos_nvlist_add_nvpair +#define nvlist_add_string illumos_nvlist_add_string +#define nvlist_add_stringf illumos_nvlist_add_stringf +#define nvlist_add_stringv illumos_nvlist_add_stringv +#define nvlist_addf_binary illumos_nvlist_addf_binary +#define nvlist_addf_bool illumos_nvlist_addf_bool +#define nvlist_addf_descriptor illumos_nvlist_addf_descriptor +#define nvlist_addf_null illumos_nvlist_addf_null +#define nvlist_addf_number illumos_nvlist_addf_number +#define nvlist_addf_nvlist illumos_nvlist_addf_nvlist +#define nvlist_addf_string illumos_nvlist_addf_string +#define nvlist_addv_binary illumos_nvlist_addv_binary +#define nvlist_addv_bool illumos_nvlist_addv_bool +#define nvlist_addv_descriptor illumos_nvlist_addv_descriptor +#define nvlist_addv_null illumos_nvlist_addv_null +#define nvlist_addv_number illumos_nvlist_addv_number +#define nvlist_addv_nvlist illumos_nvlist_addv_nvlist +#define nvlist_addv_string illumos_nvlist_addv_string +#define nvlist_check_header illumos_nvlist_check_header +#define nvlist_clone illumos_nvlist_clone +#define nvlist_create illumos_nvlist_create +#define nvlist_descriptors illumos_nvlist_descriptors +#define nvlist_destroy illumos_nvlist_destroy +#define nvlist_dump illumos_nvlist_dump +#define nvlist_empty illumos_nvlist_empty +#define nvlist_error illumos_nvlist_error +#define nvlist_exists illumos_nvlist_exists +#define nvlist_exists_binary illumos_nvlist_exists_binary +#define nvlist_exists_bool illumos_nvlist_exists_bool +#define nvlist_exists_descriptor illumos_nvlist_exists_descriptor +#define nvlist_exists_null illumos_nvlist_exists_null +#define nvlist_exists_number illumos_nvlist_exists_number +#define nvlist_exists_nvlist illumos_nvlist_exists_nvlist +#define nvlist_exists_string illumos_nvlist_exists_string +#define nvlist_exists_type illumos_nvlist_exists_type +#define nvlist_existsf illumos_nvlist_existsf +#define nvlist_existsf_binary illumos_nvlist_existsf_binary +#define nvlist_existsf_bool illumos_nvlist_existsf_bool +#define nvlist_existsf_descriptor illumos_nvlist_existsf_descriptor +#define nvlist_existsf_null illumos_nvlist_existsf_null +#define nvlist_existsf_number illumos_nvlist_existsf_number +#define nvlist_existsf_nvlist illumos_nvlist_existsf_nvlist +#define nvlist_existsf_string illumos_nvlist_existsf_string +#define nvlist_existsf_type illumos_nvlist_existsf_type +#define nvlist_existsv illumos_nvlist_existsv +#define nvlist_existsv_binary illumos_nvlist_existsv_binary +#define nvlist_existsv_bool illumos_nvlist_existsv_bool +#define nvlist_existsv_descriptor illumos_nvlist_existsv_descriptor +#define nvlist_existsv_null illumos_nvlist_existsv_null +#define nvlist_existsv_number illumos_nvlist_existsv_number +#define nvlist_existsv_nvlist illumos_nvlist_existsv_nvlist +#define nvlist_existsv_string illumos_nvlist_existsv_string +#define nvlist_existsv_type illumos_nvlist_existsv_type +#define nvlist_fdump illumos_nvlist_fdump +#define nvlist_first_nvpair illumos_nvlist_first_nvpair +#define nvlist_free illumos_nvlist_free +#define nvlist_free_binary illumos_nvlist_free_binary +#define nvlist_free_bool illumos_nvlist_free_bool +#define nvlist_free_descriptor illumos_nvlist_free_descriptor +#define nvlist_free_null illumos_nvlist_free_null +#define nvlist_free_number illumos_nvlist_free_number +#define nvlist_free_nvlist illumos_nvlist_free_nvlist +#define nvlist_free_nvpair illumos_nvlist_free_nvpair +#define nvlist_free_string illumos_nvlist_free_string +#define nvlist_free_type illumos_nvlist_free_type +#define nvlist_freef illumos_nvlist_freef +#define nvlist_freef_binary illumos_nvlist_freef_binary +#define nvlist_freef_bool illumos_nvlist_freef_bool +#define nvlist_freef_descriptor illumos_nvlist_freef_descriptor +#define nvlist_freef_null illumos_nvlist_freef_null +#define nvlist_freef_number illumos_nvlist_freef_number +#define nvlist_freef_nvlist illumos_nvlist_freef_nvlist +#define nvlist_freef_string illumos_nvlist_freef_string +#define nvlist_freef_type illumos_nvlist_freef_type +#define nvlist_freev illumos_nvlist_freev +#define nvlist_freev_binary illumos_nvlist_freev_binary +#define nvlist_freev_bool illumos_nvlist_freev_bool +#define nvlist_freev_descriptor illumos_nvlist_freev_descriptor +#define nvlist_freev_null illumos_nvlist_freev_null +#define nvlist_freev_number illumos_nvlist_freev_number +#define nvlist_freev_nvlist illumos_nvlist_freev_nvlist +#define nvlist_freev_string illumos_nvlist_freev_string +#define nvlist_freev_type illumos_nvlist_freev_type +#define nvlist_get_binary illumos_nvlist_get_binary +#define nvlist_get_bool illumos_nvlist_get_bool +#define nvlist_get_descriptor illumos_nvlist_get_descriptor +#define nvlist_get_number illumos_nvlist_get_number +#define nvlist_get_nvlist illumos_nvlist_get_nvlist +#define nvlist_get_nvpair illumos_nvlist_get_nvpair +#define nvlist_get_string illumos_nvlist_get_string +#define nvlist_getf_binary illumos_nvlist_getf_binary +#define nvlist_getf_bool illumos_nvlist_getf_bool +#define nvlist_getf_descriptor illumos_nvlist_getf_descriptor +#define nvlist_getf_number illumos_nvlist_getf_number +#define nvlist_getf_nvlist illumos_nvlist_getf_nvlist +#define nvlist_getf_string illumos_nvlist_getf_string +#define nvlist_getv_binary illumos_nvlist_getv_binary +#define nvlist_getv_bool illumos_nvlist_getv_bool +#define nvlist_getv_descriptor illumos_nvlist_getv_descriptor +#define nvlist_getv_number illumos_nvlist_getv_number +#define nvlist_getv_nvlist illumos_nvlist_getv_nvlist +#define nvlist_getv_string illumos_nvlist_getv_string +#define nvlist_move_binary illumos_nvlist_move_binary +#define nvlist_move_descriptor illumos_nvlist_move_descriptor +#define nvlist_move_nvlist illumos_nvlist_move_nvlist +#define nvlist_move_nvpair illumos_nvlist_move_nvpair +#define nvlist_move_string illumos_nvlist_move_string +#define nvlist_movef_binary illumos_nvlist_movef_binary +#define nvlist_movef_descriptor illumos_nvlist_movef_descriptor +#define nvlist_movef_nvlist illumos_nvlist_movef_nvlist +#define nvlist_movef_string illumos_nvlist_movef_string +#define nvlist_movev_binary illumos_nvlist_movev_binary +#define nvlist_movev_descriptor illumos_nvlist_movev_descriptor +#define nvlist_movev_nvlist illumos_nvlist_movev_nvlist +#define nvlist_movev_string illumos_nvlist_movev_string +#define nvlist_ndescriptors illumos_nvlist_ndescriptors +#define nvlist_next illumos_nvlist_next +#define nvlist_next_nvpair illumos_nvlist_next_nvpair +#define nvlist_pack illumos_nvlist_pack +#define nvlist_prev_nvpair illumos_nvlist_prev_nvpair +#define nvlist_recv illumos_nvlist_recv +#define nvlist_remove_nvpair illumos_nvlist_remove_nvpair +#define nvlist_report_missing illumos_nvlist_report_missing +#define nvlist_send illumos_nvlist_send +#define nvlist_set_error illumos_nvlist_set_error +#define nvlist_size illumos_nvlist_size +#define nvlist_take_binary illumos_nvlist_take_binary +#define nvlist_take_bool illumos_nvlist_take_bool +#define nvlist_take_descriptor illumos_nvlist_take_descriptor +#define nvlist_take_number illumos_nvlist_take_number +#define nvlist_take_nvlist illumos_nvlist_take_nvlist +#define nvlist_take_nvpair illumos_nvlist_take_nvpair +#define nvlist_take_string illumos_nvlist_take_string +#define nvlist_takef_binary illumos_nvlist_takef_binary +#define nvlist_takef_bool illumos_nvlist_takef_bool +#define nvlist_takef_descriptor illumos_nvlist_takef_descriptor +#define nvlist_takef_number illumos_nvlist_takef_number +#define nvlist_takef_nvlist illumos_nvlist_takef_nvlist +#define nvlist_takef_string illumos_nvlist_takef_string +#define nvlist_takev_binary illumos_nvlist_takev_binary +#define nvlist_takev_bool illumos_nvlist_takev_bool +#define nvlist_takev_descriptor illumos_nvlist_takev_descriptor +#define nvlist_takev_number illumos_nvlist_takev_number +#define nvlist_takev_nvlist illumos_nvlist_takev_nvlist +#define nvlist_takev_string illumos_nvlist_takev_string +#define nvlist_unpack illumos_nvlist_unpack +#define nvlist_xfer illumos_nvlist_xfer +#define nvlist_xpack illumos_nvlist_xpack +#define nvlist_xunpack illumos_nvlist_xunpack +#define nvpair_allocv illumos_nvpair_allocv +#define nvpair_assert illumos_nvpair_assert +#define nvpair_clone illumos_nvpair_clone +#define nvpair_create_binary illumos_nvpair_create_binary +#define nvpair_create_bool illumos_nvpair_create_bool +#define nvpair_create_descriptor illumos_nvpair_create_descriptor +#define nvpair_create_null illumos_nvpair_create_null +#define nvpair_create_number illumos_nvpair_create_number +#define nvpair_create_nvlist illumos_nvpair_create_nvlist +#define nvpair_create_string illumos_nvpair_create_string +#define nvpair_create_stringf illumos_nvpair_create_stringf +#define nvpair_create_stringv illumos_nvpair_create_stringv +#define nvpair_createf_binary illumos_nvpair_createf_binary +#define nvpair_createf_bool illumos_nvpair_createf_bool +#define nvpair_createf_descriptor illumos_nvpair_createf_descriptor +#define nvpair_createf_null illumos_nvpair_createf_null +#define nvpair_createf_number illumos_nvpair_createf_number +#define nvpair_createf_nvlist illumos_nvpair_createf_nvlist +#define nvpair_createf_string illumos_nvpair_createf_string +#define nvpair_createv_binary illumos_nvpair_createv_binary +#define nvpair_createv_bool illumos_nvpair_createv_bool +#define nvpair_createv_descriptor illumos_nvpair_createv_descriptor +#define nvpair_createv_null illumos_nvpair_createv_null +#define nvpair_createv_number illumos_nvpair_createv_number +#define nvpair_createv_nvlist illumos_nvpair_createv_nvlist +#define nvpair_createv_string illumos_nvpair_createv_string +#define nvpair_free illumos_nvpair_free +#define nvpair_free_structure illumos_nvpair_free_structure +#define nvpair_get_binary illumos_nvpair_get_binary +#define nvpair_get_bool illumos_nvpair_get_bool +#define nvpair_get_descriptor illumos_nvpair_get_descriptor +#define nvpair_get_number illumos_nvpair_get_number +#define nvpair_get_nvlist illumos_nvpair_get_nvlist +#define nvpair_get_string illumos_nvpair_get_string +#define nvpair_header_size illumos_nvpair_header_size +#define nvpair_insert illumos_nvpair_insert +#define nvpair_move_binary illumos_nvpair_move_binary +#define nvpair_move_descriptor illumos_nvpair_move_descriptor +#define nvpair_move_nvlist illumos_nvpair_move_nvlist +#define nvpair_move_string illumos_nvpair_move_string +#define nvpair_movef_binary illumos_nvpair_movef_binary +#define nvpair_movef_descriptor illumos_nvpair_movef_descriptor +#define nvpair_movef_nvlist illumos_nvpair_movef_nvlist +#define nvpair_movef_string illumos_nvpair_movef_string +#define nvpair_movev_binary illumos_nvpair_movev_binary +#define nvpair_movev_descriptor illumos_nvpair_movev_descriptor +#define nvpair_movev_nvlist illumos_nvpair_movev_nvlist +#define nvpair_movev_string illumos_nvpair_movev_string +#define nvpair_name illumos_nvpair_name +#define nvpair_next illumos_nvpair_next +#define nvpair_nvlist illumos_nvpair_nvlist +#define nvpair_pack illumos_nvpair_pack +#define nvpair_pack_descriptor illumos_nvpair_pack_descriptor +#define nvpair_prev illumos_nvpair_prev +#define nvpair_remove illumos_nvpair_remove +#define nvpair_size illumos_nvpair_size +#define nvpair_type illumos_nvpair_type +#define nvpair_type_string illumos_nvpair_type_string +#define nvpair_unpack illumos_nvpair_unpack +#define nvpair_unpack_descriptor illumos_nvpair_unpack_descriptor + +#endif /* _KERNEL */ + +#include_next + +#endif From owner-svn-src-stable-10@freebsd.org Mon Jan 4 03:20:43 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B26FA61B16; Mon, 4 Jan 2016 03:20:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3433C181C; Mon, 4 Jan 2016 03:20:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u043KgSv004892; Mon, 4 Jan 2016 03:20:42 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u043Kglj004888; Mon, 4 Jan 2016 03:20:42 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601040320.u043Kglj004888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 4 Jan 2016 03:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293132 - in stable/10/usr.sbin/cron: cron crontab X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 03:20:43 -0000 Author: pfg Date: Mon Jan 4 03:20:41 2016 New Revision: 293132 URL: https://svnweb.freebsd.org/changeset/base/293132 Log: MFC r292605, r292606, r292607, r292608: cron: bring some fixes for Coverity reports and other issues. crontab: replace malloc + bzero with calloc crontab: properly free an entry cron: Check the return value of pipe(2) CID: 271773, 1009830, Modified: stable/10/usr.sbin/cron/cron/do_command.c stable/10/usr.sbin/cron/cron/popen.c stable/10/usr.sbin/cron/crontab/crontab.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/cron/cron/do_command.c ============================================================================== --- stable/10/usr.sbin/cron/cron/do_command.c Mon Jan 4 03:12:18 2016 (r293131) +++ stable/10/usr.sbin/cron/cron/do_command.c Mon Jan 4 03:20:41 2016 (r293132) @@ -161,8 +161,10 @@ child_process(e, u) /* create some pipes to talk to our future child */ - pipe(stdin_pipe); /* child's stdin */ - pipe(stdout_pipe); /* child's stdout */ + if (pipe(stdin_pipe) != 0 || pipe(stdout_pipe) != 0) { + log_it("CRON", getpid(), "error", "can't pipe"); + exit(ERROR_EXIT); + } /* since we are a forked process, we can diddle the command string * we were passed -- nobody else is going to use it again, right? Modified: stable/10/usr.sbin/cron/cron/popen.c ============================================================================== --- stable/10/usr.sbin/cron/cron/popen.c Mon Jan 4 03:12:18 2016 (r293131) +++ stable/10/usr.sbin/cron/cron/popen.c Mon Jan 4 03:20:41 2016 (r293132) @@ -82,9 +82,8 @@ cron_popen(program, type, e) if (!pids) { if ((fds = getdtablesize()) <= 0) return(NULL); - if (!(pids = (PID_T *)malloc((u_int)(fds * sizeof(PID_T))))) + if (!(pids = calloc(fds, sizeof(PID_T)))) return(NULL); - bzero((char *)pids, fds * sizeof(PID_T)); } if (pipe(pdes) < 0) return(NULL); Modified: stable/10/usr.sbin/cron/crontab/crontab.c ============================================================================== --- stable/10/usr.sbin/cron/crontab/crontab.c Mon Jan 4 03:12:18 2016 (r293131) +++ stable/10/usr.sbin/cron/crontab/crontab.c Mon Jan 4 03:20:41 2016 (r293132) @@ -558,7 +558,7 @@ replace_cmd() { case FALSE: e = load_entry(tmp, check_error, pw, envp); if (e) - free(e); + free_entry(e); break; case TRUE: break; From owner-svn-src-stable-10@freebsd.org Mon Jan 4 06:57:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F27E0A5F862; Mon, 4 Jan 2016 06:57:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFDBE1132; Mon, 4 Jan 2016 06:57:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u046v6T9079357; Mon, 4 Jan 2016 06:57:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u046v6sQ079356; Mon, 4 Jan 2016 06:57:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040657.u046v6sQ079356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 06:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293138 - stable/10/tools/regression/mac/mac_bsdextended X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 06:57:08 -0000 Author: ngie Date: Mon Jan 4 06:57:06 2016 New Revision: 293138 URL: https://svnweb.freebsd.org/changeset/base/293138 Log: MFC r292531,r292532,r292533,r292545: r292531: Make test_matches.sh into a series of TAP testcases Use temporary filesystems / memory disks instead of a hardcoded path which doesn't exist on test systems r292532: Mark `subject matching jailid` testcase as an unexpected failure with TODO to ensure that the testcase isn't marked as a failure PR: 205481 r292533: Skip the testcases if mac_bsdextended(4) isn't detected on the system r292545: Redo the TAP integration so it works with Kyua Kyua needs numbers in the TAP results :/, but prove doesn't Modified: stable/10/tools/regression/mac/mac_bsdextended/test_matches.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/mac/mac_bsdextended/test_matches.sh ============================================================================== --- stable/10/tools/regression/mac/mac_bsdextended/test_matches.sh Mon Jan 4 03:47:31 2016 (r293137) +++ stable/10/tools/regression/mac/mac_bsdextended/test_matches.sh Mon Jan 4 06:57:06 2016 (r293138) @@ -10,158 +10,344 @@ uidoutrange="daemon" gidinrange="nobody" # We expect $uidinrange in this group gidoutrange="daemon" # We expect $uidinrange in this group -playground="/stuff/nobody/" # Must not be on root fs +test_num=1 +pass() +{ + echo "ok $test_num # $@" + : $(( test_num += 1 )) +} + +fail() +{ + echo "not ok $test_num # $@" + : $(( test_num += 1 )) +} # # Setup # -rm -f $playground/test* + +: ${TMPDIR=/tmp} +if [ $(id -u) -ne 0 ]; then + echo "1..0 # SKIP test must be run as root" + exit 0 +fi +if ! sysctl -N security.mac.bsdextended >/dev/null 2>&1; then + echo "1..0 # SKIP mac_bsdextended(4) support isn't available" + exit 0 +fi +if ! playground=$(mktemp -d $TMPDIR/tmp.XXXXXXX); then + echo "1..0 # SKIP failed to create temporary directory" + exit 0 +fi +trap "rmdir $playground" EXIT INT TERM +if ! mdmfs -s 25m md $playground; then + echo "1..0 # SKIP failed to mount md device" + exit 0 +fi +chmod a+rwx $playground +md_device=$(mount -p | grep "$playground" | awk '{ gsub(/^\/dev\//, "", $1); print $1 }') +trap "umount -f $playground; mdconfig -d -u $md_device; rmdir $playground" EXIT INT TERM +if [ -z "$md_device" ]; then + mount -p | grep $playground + echo "1..0 # SKIP md device not properly attached to the system" +fi + ugidfw remove 1 file1=$playground/test-$uidinrange file2=$playground/test-$uidoutrange -cat < $playground/test-script.pl -if (open(F, ">" . shift)) { exit 0; } else { exit 1; } +cat > $playground/test-script.sh <<'EOF' +#!/bin/sh +: > $1 EOF -command1="perl $playground/test-script.pl $file1" -command2="perl $playground/test-script.pl $file2" +if [ $? -ne 0 ]; then + echo "1..0 # SKIP failed to create test script" + exit 0 +fi +echo "1..30" + +command1="sh $playground/test-script.sh $file1" +command2="sh $playground/test-script.sh $file2" + +desc="$uidinrange file" +if su -m $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi -echo -n "$uidinrange file: " -su -m $uidinrange -c "$command1 && echo good" chown "$uidinrange":"$gidinrange" $file1 chmod a+w $file1 -echo -n "$uidoutrange file: " -$command2 && echo good +desc="$uidoutrange file" +if $command2; then + pass $desc +else + fail $desc +fi + chown "$uidoutrange":"$gidoutrange" $file2 chmod a+w $file2 # # No rules # -echo -n "no rules $uidinrange: " -su -fm $uidinrange -c "$command1 && echo good" -echo -n "no rules $uidoutrange: " -su -fm $uidoutrange -c "$command1 && echo good" +desc="no rules $uidinrange" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + +desc="no rules $uidoutrange" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi # # Subject Match on uid # ugidfw set 1 subject uid $uidrange object mode rasx -echo -n "subject uid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "subject uid out range: " -su -fm $uidoutrange -c "$command1 && echo good" +desc="subject uid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="subject uid out range" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi # # Subject Match on gid # ugidfw set 1 subject gid $gidrange object mode rasx -echo -n "subject gid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "subject gid out range: " -su -fm $uidoutrange -c "$command1 && echo good" + +desc="subject gid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="subject gid out range" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi # # Subject Match on jail # -echo -n "subject matching jailid: " rm -f $playground/test-jail -jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 3; touch $playground/test-jail) &"` + +desc="subject matching jailid" +jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` ugidfw set 1 subject jailid $jailid object mode rasx -sleep 6 -if [ ! -f $playground/test-jail ] ; then echo good ; fi +sleep 10 + +if [ -f $playground/test-jail ]; then + fail "TODO $desc: this testcase fails (see bug # 205481)" +else + pass $desc +fi -echo -n "subject nonmatching jailid: " rm -f $playground/test-jail -jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 3; touch $playground/test-jail) &"` -sleep 6 -if [ -f $playground/test-jail ] ; then echo good ; fi +desc="subject nonmatching jailid" +jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` +sleep 10 +if [ -f $playground/test-jail ]; then + pass $desc +else + fail $desc +fi # # Object uid # ugidfw set 1 subject object uid $uidrange mode rasx -echo -n "object uid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "object uid out range: " -su -fm $uidinrange -c "$command2 && echo good" + +desc="object uid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object uid out range" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi ugidfw set 1 subject object uid $uidrange mode rasx -echo -n "object uid in range (differennt subject): " -su -fm $uidoutrange -c "$command1 || echo good" -echo -n "object uid out range (differennt subject): " -su -fm $uidoutrange -c "$command2 && echo good" + +desc="object uid in range (different subject)" +if su -fm $uidoutrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object uid out range (different subject)" +if su -fm $uidoutrange -c "$command2"; then + pass $desc +else + fail $desc +fi # # Object gid # ugidfw set 1 subject object gid $uidrange mode rasx -echo -n "object gid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "object gid out range: " -su -fm $uidinrange -c "$command2 && echo good" -echo -n "object gid in range (differennt subject): " -su -fm $uidoutrange -c "$command1 || echo good" -echo -n "object gid out range (differennt subject): " -su -fm $uidoutrange -c "$command2 && echo good" + +desc="object gid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object gid out range" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi +desc="object gid in range (different subject)" +if su -fm $uidoutrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object gid out range (different subject)" +if su -fm $uidoutrange -c "$command2"; then + pass $desc +else + fail $desc +fi # # Object filesys # ugidfw set 1 subject uid $uidrange object filesys / mode rasx -echo -n "object out of filesys: " -su -fm $uidinrange -c "$command1 && echo good" +desc="object out of filesys" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + ugidfw set 1 subject uid $uidrange object filesys $playground mode rasx -echo -n "object in filesys: " -su -fm $uidinrange -c "$command1 || echo good" +desc="object in filesys" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi # # Object suid # ugidfw set 1 subject uid $uidrange object suid mode rasx -echo -n "object notsuid: " -su -fm $uidinrange -c "$command1 && echo good" +desc="object notsuid" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + chmod u+s $file1 -echo -n "object suid: " -su -fm $uidinrange -c "$command1 || echo good" +desc="object suid" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi chmod u-s $file1 # # Object sgid # ugidfw set 1 subject uid $uidrange object sgid mode rasx -echo -n "object notsgid: " -su -fm $uidinrange -c "$command1 && echo good" +desc="object notsgid" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + chmod g+s $file1 -echo -n "object sgid: " -su -fm $uidinrange -c "$command1 || echo good" +desc="object sgid" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi chmod g-s $file1 # # Object uid matches subject # ugidfw set 1 subject uid $uidrange object uid_of_subject mode rasx -echo -n "object uid notmatches subject: " -su -fm $uidinrange -c "$command2 && echo good" -echo -n "object uid matches subject: " -su -fm $uidinrange -c "$command1 || echo good" + +desc="object uid notmatches subject" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi + +desc="object uid matches subject" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi # # Object gid matches subject # ugidfw set 1 subject uid $uidrange object gid_of_subject mode rasx -echo -n "object gid notmatches subject: " -su -fm $uidinrange -c "$command2 && echo good" -echo -n "object gid matches subject: " -su -fm $uidinrange -c "$command1 || echo good" + +desc="object gid notmatches subject" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi + +desc="object gid matches subject" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi # # Object type # +desc="object not type" ugidfw set 1 subject uid $uidrange object type dbclsp mode rasx -echo -n "object not type: " -su -fm $uidinrange -c "$command1 && echo good" -ugidfw set 1 subject uid $uidrange object type r mode rasx -echo -n "object type: " -su -fm $uidinrange -c "$command1 || echo good" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi +desc="object type" +ugidfw set 1 subject uid $uidrange object type r mode rasx +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi From owner-svn-src-stable-10@freebsd.org Mon Jan 4 07:02:49 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D174AA5FB5F; Mon, 4 Jan 2016 07:02:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A89971830; Mon, 4 Jan 2016 07:02:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0472m74082306; Mon, 4 Jan 2016 07:02:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0472mKv082304; Mon, 4 Jan 2016 07:02:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040702.u0472mKv082304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 07:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293140 - stable/10/tests/sys/aio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:02:49 -0000 Author: ngie Date: Mon Jan 4 07:02:48 2016 New Revision: 293140 URL: https://svnweb.freebsd.org/changeset/base/293140 Log: MFC r292816,r292818,r292819: r292816: Place cancel and error under #ifdef DEBUG to mute -Wunused-but-set-variable warnings reported by gcc 4.9 Remove some trailing whitespace as well Tested with and without -DDEBUG r292818: Fix style(9) a bit and ensure that error from initializing kqueue(2) is sane - Push the kqueue(2) initialization down so the errno will correspond with the failure instead of potentially being stomped on by functions called by `PLAIN_REQUIRE_KERNEL_MODULE` - Delete trailing whitespace - Add spaces between braces for conditional and control blocks (for/if) - Use err/errx instead of perror+printf+exit/printf+exit. - Remove braces for single-line conditionals Tested with and without -DDEBUG r292819: - Fix an improperly sized buffer for `pathname` [1] - Fix a -Wunused-but-set-variable warning [2] Modified: stable/10/tests/sys/aio/aio_kqueue_test.c stable/10/tests/sys/aio/lio_kqueue_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/aio/aio_kqueue_test.c ============================================================================== --- stable/10/tests/sys/aio/aio_kqueue_test.c Mon Jan 4 06:58:39 2016 (r293139) +++ stable/10/tests/sys/aio/aio_kqueue_test.c Mon Jan 4 07:02:48 2016 (r293140) @@ -62,7 +62,10 @@ main (int argc, char *argv[]) struct kevent ke, kq_returned; struct timespec ts; char buffer[32768]; - int cancel, error, failed = 0, fd, kq, pending, result, run; +#ifdef DEBUG + int cancel, error; +#endif + int failed = 0, fd, kq, pending, result, run; int tmp_file = 0; unsigned i, j; @@ -96,19 +99,19 @@ main (int argc, char *argv[]) if (iocb[i] == NULL) err(1, "calloc"); } - - pending = 0; + + pending = 0; for (i = 0; i < nitems(iocb); i++) { pending++; iocb[i]->aio_nbytes = sizeof(buffer); iocb[i]->aio_buf = buffer; iocb[i]->aio_fildes = fd; iocb[i]->aio_offset = iocb[i]->aio_nbytes * i * run; - + iocb[i]->aio_sigevent.sigev_notify_kqueue = kq; iocb[i]->aio_sigevent.sigev_value.sival_ptr = iocb[i]; iocb[i]->aio_sigevent.sigev_notify = SIGEV_KEVENT; - + result = aio_write(iocb[i]); if (result != 0) { perror("aio_write"); @@ -133,7 +136,9 @@ main (int argc, char *argv[]) } } } +#ifdef DEBUG cancel = nitems(iocb) - pending; +#endif i = 0; while (pending) { @@ -144,34 +149,36 @@ main (int argc, char *argv[]) bzero(&kq_returned, sizeof(ke)); ts.tv_sec = 0; ts.tv_nsec = 1; - result = kevent(kq, NULL, 0, + result = kevent(kq, NULL, 0, &kq_returned, 1, &ts); +#ifdef DEBUG error = errno; +#endif if (result < 0) perror("kevent error: "); kq_iocb = kq_returned.udata; #ifdef DEBUG printf("kevent %d %d errno %d return.ident %p " - "return.data %p return.udata %p %p\n", - i, result, error, - kq_returned.ident, kq_returned.data, - kq_returned.udata, + "return.data %p return.udata %p %p\n", + i, result, error, + kq_returned.ident, kq_returned.data, + kq_returned.udata, kq_iocb); #endif - + if (kq_iocb) break; #ifdef DEBUG printf("Try again left %d out of %d %d\n", pending, nitems(iocb), cancel); #endif - } - + } + for (j = 0; j < nitems(iocb) && iocb[j] != kq_iocb; j++) ; #ifdef DEBUG printf("kq_iocb %p\n", kq_iocb); - + printf("Error Result for %d is %d pending %d\n", j, result, pending); #endif @@ -192,7 +199,7 @@ main (int argc, char *argv[]) iocb[j] = NULL; pending--; i++; - } + } for (i = 0; i < nitems(iocb); i++) free(iocb[i]); Modified: stable/10/tests/sys/aio/lio_kqueue_test.c ============================================================================== --- stable/10/tests/sys/aio/lio_kqueue_test.c Mon Jan 4 06:58:39 2016 (r293139) +++ stable/10/tests/sys/aio/lio_kqueue_test.c Mon Jan 4 07:02:48 2016 (r293140) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -57,26 +58,26 @@ #define MAX_RUNS 300 int -main(int argc, char *argv[]){ +main(int argc, char *argv[]) +{ int fd; struct aiocb *iocb[MAX_IOCBS]; - struct aiocb **lio[LIO_MAX], **lio_element, **kq_lio; + struct aiocb **lio[LIO_MAX], **kq_lio; int i, result, run, error, j, k; char buffer[32768]; - int kq = kqueue(); + int kq; struct kevent ke, kq_returned; struct timespec ts; struct sigevent sig; time_t time1, time2; - char *file, pathname[sizeof(PATH_TEMPLATE)-1]; + char *file, pathname[sizeof(PATH_TEMPLATE)]; int tmp_file = 0, failed = 0; PLAIN_REQUIRE_KERNEL_MODULE("aio", 0); - if (kq < 0) { - perror("No kqeueue\n"); - exit(1); - } + kq = kqueue(); + if (kq < 0) + err(1, "kqeueue(2) failed"); if (argc == 1) { strcpy(pathname, PATH_TEMPLATE); @@ -87,34 +88,29 @@ main(int argc, char *argv[]){ file = argv[1]; fd = open(file, O_RDWR|O_CREAT, 0666); } - if (fd < 0){ - fprintf(stderr, "Can't open %s\n", argv[1]); - perror(""); - exit(1); - } + if (fd < 0) + err(1, "can't open %s", argv[1]); #ifdef DEBUG printf("Hello kq %d fd %d\n", kq, fd); #endif - for (run = 0; run < MAX_RUNS; run++){ + for (run = 0; run < MAX_RUNS; run++) { #ifdef DEBUG printf("Run %d\n", run); #endif for (j = 0; j < LIO_MAX; j++) { - lio[j] = (struct aiocb **) + lio[j] = malloc(sizeof(struct aiocb *) * MAX_IOCBS/LIO_MAX); - for(i = 0; i < MAX_IOCBS / LIO_MAX; i++) { + for (i = 0; i < MAX_IOCBS / LIO_MAX; i++) { k = (MAX_IOCBS / LIO_MAX * j) + i; - lio_element = lio[j]; - lio[j][i] = iocb[k] = (struct aiocb *) - malloc(sizeof(struct aiocb)); - bzero(iocb[k], sizeof(struct aiocb)); + lio[j][i] = iocb[k] = + calloc(1, sizeof(struct aiocb)); iocb[k]->aio_nbytes = sizeof(buffer); iocb[k]->aio_buf = buffer; iocb[k]->aio_fildes = fd; - iocb[k]->aio_offset - = iocb[k]->aio_nbytes * k * (run + 1); + iocb[k]->aio_offset + = iocb[k]->aio_nbytes * k * (run + 1); #ifdef DEBUG printf("hello iocb[k] %d\n", @@ -131,27 +127,26 @@ main(int argc, char *argv[]){ error = errno; time(&time2); #ifdef DEBUG - printf("Time %d %d %d result -> %d\n", + printf("Time %d %d %d result -> %d\n", time1, time2, time2-time1, result); #endif if (result != 0) { errno = error; - perror("list_listio"); - printf("FAIL: Result %d iteration %d\n",result, j); - exit(1); + err(1, "FAIL: Result %d iteration %d\n", + result, j); } #ifdef DEBUG printf("write %d is at %p\n", j, lio[j]); #endif } - for(i = 0; i < LIO_MAX; i++) { - for(j = LIO_MAX - 1; j >=0; j--) { + for (i = 0; i < LIO_MAX; i++) { + for (j = LIO_MAX - 1; j >=0; j--) { if (lio[j]) break; } - for(;;) { + for (;;) { bzero(&ke, sizeof(ke)); bzero(&kq_returned, sizeof(ke)); ts.tv_sec = 0; @@ -159,9 +154,9 @@ main(int argc, char *argv[]){ #ifdef DEBUG printf("FOO lio %d -> %p\n", j, lio[j]); #endif - EV_SET(&ke, (uintptr_t)lio[j], + EV_SET(&ke, (uintptr_t)lio[j], EVFILT_LIO, EV_ONESHOT, 0, 0, iocb[j]); - result = kevent(kq, NULL, 0, + result = kevent(kq, NULL, 0, &kq_returned, 1, &ts); error = errno; if (result < 0) { @@ -170,14 +165,14 @@ main(int argc, char *argv[]){ kq_lio = kq_returned.udata; #ifdef DEBUG printf("kevent %d %d errno %d return.ident %p " - "return.data %p return.udata %p %p\n", - i, result, error, - kq_returned.ident, kq_returned.data, - kq_returned.udata, + "return.data %p return.udata %p %p\n", + i, result, error, + kq_returned.ident, kq_returned.data, + kq_returned.udata, lio[j]); #endif - if(kq_lio) + if (kq_lio) break; #ifdef DEBUG printf("Try again\n"); @@ -189,25 +184,21 @@ main(int argc, char *argv[]){ #endif for (j = 0; j < LIO_MAX; j++) { - if (lio[j] == kq_lio) { + if (lio[j] == kq_lio) break; - } - } - if (j == LIO_MAX) { - printf("FAIL:\n"); - exit(1); } + if (j == LIO_MAX) + errx(1, "FAIL: "); #ifdef DEBUG printf("Error Result for %d is %d\n", j, result); #endif if (result < 0) { printf("FAIL: run %d, operation %d result %d \n", run, LIO_MAX - i -1, result); - failed = 1; - } else { + failed++; + } else printf("PASS: run %d, operation %d result %d \n", run, LIO_MAX - i -1, result); - } - for(k = 0; k < MAX_IOCBS / LIO_MAX; k++){ + for (k = 0; k < MAX_IOCBS / LIO_MAX; k++) { result = aio_return(kq_lio[k]); #ifdef DEBUG printf("Return Resulto for %d %d is %d\n", j, k, result); @@ -224,9 +215,8 @@ main(int argc, char *argv[]){ printf("\n"); #endif - for(k = 0; k < MAX_IOCBS / LIO_MAX; k++) { + for (k = 0; k < MAX_IOCBS / LIO_MAX; k++) free(lio[j][k]); - } free(lio[j]); lio[j] = NULL; } @@ -235,15 +225,12 @@ main(int argc, char *argv[]){ printf("Done\n"); #endif - if (tmp_file) { + if (tmp_file) unlink(pathname); - } - if (failed) { - printf("FAIL: Atleast one\n"); - exit(1); - } else { - printf("PASS: All\n"); - exit(0); - } + if (failed) + errx(1, "FAIL: %d testcases failed", failed); + else + errx(0, "PASS: All\n"); + } From owner-svn-src-stable-10@freebsd.org Mon Jan 4 07:03:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B01D7A5FC47; Mon, 4 Jan 2016 07:03:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70C5F1AE2; Mon, 4 Jan 2016 07:03:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0473wp8082560; Mon, 4 Jan 2016 07:03:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0473ww1082558; Mon, 4 Jan 2016 07:03:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040703.u0473ww1082558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 07:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293141 - stable/10/contrib/bsnmp/snmpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:03:59 -0000 Author: ngie Date: Mon Jan 4 07:03:58 2016 New Revision: 293141 URL: https://svnweb.freebsd.org/changeset/base/293141 Log: MFC r292815: Staticize several variables that are used exclusively in bsnmpd/main.c and bsnmpd/trap.c This fixes several -Wmissing-variable-declaration warnings noted by clang Modified: stable/10/contrib/bsnmp/snmpd/main.c stable/10/contrib/bsnmp/snmpd/trap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/main.c Mon Jan 4 07:02:48 2016 (r293140) +++ stable/10/contrib/bsnmp/snmpd/main.c Mon Jan 4 07:03:58 2016 (r293141) @@ -119,26 +119,30 @@ static struct lmodules modules_start = T struct community_list community_list = TAILQ_HEAD_INITIALIZER(community_list); /* list of all known USM users */ -struct usm_userlist usm_userlist = SLIST_HEAD_INITIALIZER(usm_userlist); +static struct usm_userlist usm_userlist = SLIST_HEAD_INITIALIZER(usm_userlist); /* A list of all VACM users configured, including v1, v2c and v3 */ -struct vacm_userlist vacm_userlist = SLIST_HEAD_INITIALIZER(vacm_userlist); +static struct vacm_userlist vacm_userlist = + SLIST_HEAD_INITIALIZER(vacm_userlist); /* A list of all VACM groups */ -struct vacm_grouplist vacm_grouplist = SLIST_HEAD_INITIALIZER(vacm_grouplist); +static struct vacm_grouplist vacm_grouplist = + SLIST_HEAD_INITIALIZER(vacm_grouplist); static struct vacm_group vacm_default_group = { .groupname = "", }; /* The list of configured access entries */ -struct vacm_accesslist vacm_accesslist = TAILQ_HEAD_INITIALIZER(vacm_accesslist); +static struct vacm_accesslist vacm_accesslist = + TAILQ_HEAD_INITIALIZER(vacm_accesslist); /* The list of configured views */ -struct vacm_viewlist vacm_viewlist = SLIST_HEAD_INITIALIZER(vacm_viewlist); +static struct vacm_viewlist vacm_viewlist = + SLIST_HEAD_INITIALIZER(vacm_viewlist); /* The list of configured contexts */ -struct vacm_contextlist vacm_contextlist = +static struct vacm_contextlist vacm_contextlist = SLIST_HEAD_INITIALIZER(vacm_contextlist); /* list of all installed object resources */ Modified: stable/10/contrib/bsnmp/snmpd/trap.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trap.c Mon Jan 4 07:02:48 2016 (r293140) +++ stable/10/contrib/bsnmp/snmpd/trap.c Mon Jan 4 07:03:58 2016 (r293141) @@ -60,15 +60,15 @@ struct trapsink_list trapsink_list = TAILQ_HEAD_INITIALIZER(trapsink_list); /* List of target addresses */ -struct target_addresslist target_addresslist = +static struct target_addresslist target_addresslist = SLIST_HEAD_INITIALIZER(target_addresslist); /* List of target parameters */ -struct target_paramlist target_paramlist = +static struct target_paramlist target_paramlist = SLIST_HEAD_INITIALIZER(target_paramlist); /* List of notification targets */ -struct target_notifylist target_notifylist = +static struct target_notifylist target_notifylist = SLIST_HEAD_INITIALIZER(target_notifylist); static const struct asn_oid oid_begemotTrapSinkTable = From owner-svn-src-stable-10@freebsd.org Mon Jan 4 07:06:48 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 175ABA5FDF8; Mon, 4 Jan 2016 07:06:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB6711DF2; Mon, 4 Jan 2016 07:06:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0476kUU082805; Mon, 4 Jan 2016 07:06:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0476k7j082804; Mon, 4 Jan 2016 07:06:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040706.u0476k7j082804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 07:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293143 - stable/10/tests/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:06:48 -0000 Author: ngie Date: Mon Jan 4 07:06:46 2016 New Revision: 293143 URL: https://svnweb.freebsd.org/changeset/base/293143 Log: MFC r292820: Clean trailing whitespace Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- stable/10/tests/sys/kern/unix_seqpacket_test.c Mon Jan 4 07:04:58 2016 (r293142) +++ stable/10/tests/sys/kern/unix_seqpacket_test.c Mon Jan 4 07:06:46 2016 (r293143) @@ -47,7 +47,7 @@ static void do_socketpair(int *sv) { int s; - + s = socketpair(PF_LOCAL, SOCK_SEQPACKET, 0, sv); ATF_REQUIRE_EQ(0, s); ATF_REQUIRE(sv[0] >= 0); @@ -59,7 +59,7 @@ static void do_socketpair_nonblocking(int *sv) { int s; - + s = socketpair(PF_LOCAL, SOCK_SEQPACKET, 0, sv); ATF_REQUIRE_EQ(0, s); ATF_REQUIRE(sv[0] >= 0); @@ -69,7 +69,7 @@ do_socketpair_nonblocking(int *sv) ATF_REQUIRE(-1 != fcntl(sv[1], F_SETFL, O_NONBLOCK)); } -/* +/* * Returns a pair of sockets made the hard way: bind, listen, connect & accept * @return const char* The path to the socket */ @@ -101,7 +101,7 @@ mk_pair_of_sockets(int *sv) perror("connect"); atf_tc_fail("connect(2) failed"); } - + /* Accept it */ s1 = accept(s, NULL, NULL); if (s1 == -1) { @@ -232,7 +232,7 @@ test_pipe_simulator(size_t sndbufsize, s memset(sndbuf, num_sent, pktsize); ssize = send(sv[0], sndbuf, pktsize, MSG_EOR); if (ssize < 0) { - /* + /* * XXX: This is bug-compatible with the kernel. * The kernel returns EMSGSIZE when it should * return EAGAIN @@ -268,7 +268,7 @@ test_pipe_simulator(size_t sndbufsize, s pktsize, rsize); memset(comparebuf, num_received, pktsize); ATF_CHECK_EQ_MSG(0, memcmp(comparebuf, rcvbuf, - pktsize), + pktsize), "Received data miscompare"); num_received++; } @@ -324,7 +324,7 @@ test_pipe_reader(void* args) "expected %zd=send(...) but got %zd", td->pktsize, rsize); d = memcmp(comparebuf, rcvbuf, td->pktsize); - ATF_CHECK_EQ_MSG(0, d, + ATF_CHECK_EQ_MSG(0, d, "Received data miscompare on packet %d", i); } return (0); @@ -360,7 +360,7 @@ test_pipe(size_t sndbufsize, size_t rcvb reader_data.so = sv[1]; ATF_REQUIRE_EQ(0, pthread_create(&writer, NULL, test_pipe_writer, (void*)&writer_data)); - /* + /* * Give the writer time to start writing, and hopefully block, before * starting the reader. This increases the likelihood of the test case * failing due to PR kern/185812 @@ -539,7 +539,7 @@ ATF_TC_BODY(resize_buffers, tc) ATF_CHECK_EQ(0, getsockopt(s, SOL_SOCKET, SO_SNDBUF, &xs, &sl)); ATF_CHECK_EQ(0, getsockopt(s, SOL_SOCKET, SO_RCVBUF, &xr, &sl)); printf("After changing SNDBUF | %7d | %7d |\n", xs, xr); - + if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(rcvbuf)) != 0){ perror("setsockopt"); atf_tc_fail("setsockopt(SO_RCVBUF) failed"); @@ -676,7 +676,7 @@ ATF_TC_BODY(sendto_recvfrom, tc) } ATF_CHECK_EQ(datalen, rsize); - /* + /* * FreeBSD does not currently provide the source address for SEQ_PACKET * AF_UNIX sockets, and POSIX does not require it, so these two checks * are disabled. If FreeBSD gains that feature in the future, then @@ -686,7 +686,7 @@ ATF_TC_BODY(sendto_recvfrom, tc) /* ATF_CHECK_STREQ(path, ((struct sockaddr_un*)&from)->sun_path); */ } -/* +/* * send(2) and recv(2) a single short record with sockets created the * traditional way, involving bind, listen, connect, and accept */ @@ -782,7 +782,7 @@ ATF_TC_BODY(send_recv_nonblocking, tc) ATF_CHECK_EQ(datalen, rsize); } -/* +/* * We should get EMSGSIZE if we try to send a message larger than the socket * buffer, with blocking sockets */ @@ -809,7 +809,7 @@ ATF_TC_BODY(emsgsize, tc) ATF_CHECK_EQ(-1, ssize); } -/* +/* * We should get EMSGSIZE if we try to send a message larger than the socket * buffer, with nonblocking sockets */ @@ -837,7 +837,7 @@ ATF_TC_BODY(emsgsize_nonblocking, tc) } -/* +/* * We should get EAGAIN if we try to send a message larger than the socket * buffer, with nonblocking sockets. Test with several different sockbuf sizes */ @@ -863,7 +863,7 @@ ATF_TC_BODY(eagain_128k_128k, tc) } -/* +/* * nonblocking send(2) and recv(2) of several records, which should collectively * fill up the send buffer but not the receive buffer */ @@ -888,7 +888,7 @@ ATF_TC_BODY(rcvbuf_oversized, tc) ATF_REQUIRE_EQ(0, setsockopt(sv[1], SOL_SOCKET, SO_RCVBUF, &rcvbufsize, sizeof(rcvbufsize))); - /* + /* * Send and receive packets that are collectively greater than the send * buffer, but less than the receive buffer */ @@ -916,7 +916,7 @@ ATF_TC_BODY(rcvbuf_oversized, tc) "expected %zd=send(...) but got %zd", pktsize, rsize); /* Verify the contents */ - ATF_CHECK_EQ_MSG(0, memcmp(sndbuf, recv_buf, pktsize), + ATF_CHECK_EQ_MSG(0, memcmp(sndbuf, recv_buf, pktsize), "Received data miscompare"); } @@ -926,7 +926,7 @@ ATF_TC_BODY(rcvbuf_oversized, tc) ATF_CHECK_EQ(-1, rsize); } -/* +/* * Simulate the behavior of a blocking pipe. The sender will send until his * buffer fills up, then we'll simulate a scheduler switch that will allow the * receiver to read until his buffer empties. Repeat the process until the @@ -957,7 +957,7 @@ ATF_TC_BODY(pipe_simulator_128k_128k, tc test_pipe_simulator(131072, 131072); } -/* +/* * Test blocking I/O by passing data between two threads. The total amount of * data will be >> buffer size to force blocking. Repeat the test with multiple * send and receive buffer sizes From owner-svn-src-stable-10@freebsd.org Mon Jan 4 07:09:31 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A1F2A5FF22; Mon, 4 Jan 2016 07:09:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE97B1F7B; Mon, 4 Jan 2016 07:09:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0479Uq8083001; Mon, 4 Jan 2016 07:09:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0479UlH083000; Mon, 4 Jan 2016 07:09:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040709.u0479UlH083000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 07:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293144 - stable/10/tests/sys/kern/pipe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:09:31 -0000 Author: ngie Date: Mon Jan 4 07:09:29 2016 New Revision: 293144 URL: https://svnweb.freebsd.org/changeset/base/293144 Log: MFC r292822: Remove retval to fix a -Wunused-but-set-variable warning from gcc 4.9 Modified: stable/10/tests/sys/kern/pipe/pipe_overcommit1_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/pipe/pipe_overcommit1_test.c ============================================================================== --- stable/10/tests/sys/kern/pipe/pipe_overcommit1_test.c Mon Jan 4 07:06:46 2016 (r293143) +++ stable/10/tests/sys/kern/pipe/pipe_overcommit1_test.c Mon Jan 4 07:09:29 2016 (r293144) @@ -40,12 +40,11 @@ int main(void) { - int pipes[10000], returnval; + int pipes[10000]; unsigned int i; - for (i = 0; i < nitems(pipes); i++) { - returnval = pipe(&pipes[i]); - } + for (i = 0; i < nitems(pipes); i++) + (void)pipe(&pipes[i]); printf("PASS\n"); exit(0); From owner-svn-src-stable-10@freebsd.org Mon Jan 4 07:11:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3C9EA600F5; Mon, 4 Jan 2016 07:11:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 644DF129D; Mon, 4 Jan 2016 07:11:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u047BFAA085065; Mon, 4 Jan 2016 07:11:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u047BFV1085064; Mon, 4 Jan 2016 07:11:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601040711.u047BFV1085064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 4 Jan 2016 07:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293145 - stable/10/tools/regression/sockets/unix_passfd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:11:16 -0000 Author: ngie Date: Mon Jan 4 07:11:15 2016 New Revision: 293145 URL: https://svnweb.freebsd.org/changeset/base/293145 Log: MFC r292814: - Explicitly initialize ch to 0 - Delete some spurious whitespace - Use calloc instead of malloc in the last test to ensure that sendspace is properly zero'ed out Submitted by: markj Modified: stable/10/tools/regression/sockets/unix_passfd/unix_passfd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/sockets/unix_passfd/unix_passfd.c ============================================================================== --- stable/10/tools/regression/sockets/unix_passfd/unix_passfd.c Mon Jan 4 07:09:29 2016 (r293144) +++ stable/10/tools/regression/sockets/unix_passfd/unix_passfd.c Mon Jan 4 07:11:15 2016 (r293145) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2005 Robert N. M. Watson + * Copyright (c) 2015 Mark Johnston * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -146,7 +147,7 @@ sendfd_payload(const char *test, int soc static void sendfd(const char *test, int sockfd, int sendfd) { - char ch; + char ch = 0; return (sendfd_payload(test, sockfd, sendfd, &ch, sizeof(ch))); } @@ -199,7 +200,7 @@ recvfd_payload(const char *test, int soc static void recvfd(const char *test, int sockfd, int *recvfd) { - char ch; + char ch = 0; return (recvfd_payload(test, sockfd, recvfd, &ch, sizeof(ch))); } @@ -369,8 +370,8 @@ main(void) err(-1, "%s: sysctlbyname(net.local.stream.sendspace)", test); - if ((buf = malloc(sendspace)) == NULL) - err(-1, "%s: malloc", test); + if ((buf = calloc(1, sendspace)) == NULL) + err(-1, "%s: calloc", test); domainsocketpair(test, fd); if (setsockopt(fd[1], 0, LOCAL_CREDS, &on, sizeof(on)) < 0) @@ -384,6 +385,6 @@ main(void) } printf("%s passed\n", test); - + return (0); } From owner-svn-src-stable-10@freebsd.org Mon Jan 4 07:27:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D473A60552; Mon, 4 Jan 2016 07:27:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DC851E38; Mon, 4 Jan 2016 07:27:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u047RwZi089368; Mon, 4 Jan 2016 07:27:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u047Rw78089367; Mon, 4 Jan 2016 07:27:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040727.u047Rw78089367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 07:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293146 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 07:27:59 -0000 Author: hselasky Date: Mon Jan 4 07:27:58 2016 New Revision: 293146 URL: https://svnweb.freebsd.org/changeset/base/293146 Log: MFC r291199: Fix compile warning about shifting signed negative constant. Modified: stable/10/sys/dev/usb/controller/uhci.h Modified: stable/10/sys/dev/usb/controller/uhci.h ============================================================================== --- stable/10/sys/dev/usb/controller/uhci.h Mon Jan 4 07:11:15 2016 (r293145) +++ stable/10/sys/dev/usb/controller/uhci.h Mon Jan 4 07:27:58 2016 (r293146) @@ -97,7 +97,7 @@ struct uhci_td { #define UHCI_TD_GET_ENDPT(s) (((s) >> 15) & 0xf) #define UHCI_TD_SET_DT(t) ((t) << 19) #define UHCI_TD_GET_DT(s) (((s) >> 19) & 1) -#define UHCI_TD_SET_MAXLEN(l) (((l)-1) << 21) +#define UHCI_TD_SET_MAXLEN(l) (((l)-1U) << 21) #define UHCI_TD_GET_MAXLEN(s) ((((s) >> 21) + 1) & 0x7ff) #define UHCI_TD_MAXLEN_MASK 0xffe00000 volatile uint32_t td_buffer; From owner-svn-src-stable-10@freebsd.org Mon Jan 4 09:37:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88013A61B0E; Mon, 4 Jan 2016 09:37:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 509B119E7; Mon, 4 Jan 2016 09:37:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049b6Lt027115; Mon, 4 Jan 2016 09:37:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049b5hA027108; Mon, 4 Jan 2016 09:37:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040937.u049b5hA027108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293151 - stable/10/sys/ofed/include/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:37:07 -0000 Author: hselasky Date: Mon Jan 4 09:37:05 2016 New Revision: 293151 URL: https://svnweb.freebsd.org/changeset/base/293151 Log: MFC r289563,r291481,r292537,r292538,r292542,r292543,r292544 and r292834: Update the LinuxKPI: - Add more functions and types. - Implement ACCESS_ONCE(), WRITE_ONCE() and READ_ONCE(). - Implement sleepable RCU mechanism using shared exclusive locks. - Minor workqueue cleanup: - Make some functions global instead of inline to ease debugging. - Fix some minor style issues. - In the zero delay case in queue_delayed_work() use the return value from taskqueue_enqueue() instead of reading "ta_pending" unlocked and also ensure the callout is stopped before proceeding. - Implement drain_workqueue() function. - Reduce memory consumption when allocating kobject strings in the LinuxKPI. Compute string length before allocating memory instead of using fixed size allocations. Make kobject_set_name_vargs() global instead of inline to save some bytes when compiling. Sponsored by: Mellanox Technologies Added: stable/10/sys/ofed/include/linux/srcu.h (contents, props changed) Modified: stable/10/sys/ofed/include/linux/compiler.h stable/10/sys/ofed/include/linux/file.h stable/10/sys/ofed/include/linux/kobject.h stable/10/sys/ofed/include/linux/linux_compat.c stable/10/sys/ofed/include/linux/types.h stable/10/sys/ofed/include/linux/workqueue.h Directory Properties: stable/10/ (props changed) stable/10/sys/gnu/dts/ (props changed) Modified: stable/10/sys/ofed/include/linux/compiler.h ============================================================================== --- stable/10/sys/ofed/include/linux/compiler.h Mon Jan 4 08:41:13 2016 (r293150) +++ stable/10/sys/ofed/include/linux/compiler.h Mon Jan 4 09:37:05 2016 (r293151) @@ -2,7 +2,8 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2015 François Tigeot * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,5 +63,28 @@ #define typeof(x) __typeof(x) #define uninitialized_var(x) x = x +#define __read_mostly __attribute__((__section__(".data.read_mostly"))) +#define __always_unused __unused +#define __must_check __result_use_check + +#define __printf(a,b) __printflike(a,b) + +#define barrier() __asm__ __volatile__("": : :"memory") + +#define ACCESS_ONCE(x) (*(volatile __typeof(x) *)&(x)) + +#define WRITE_ONCE(x,v) do { \ + barrier(); \ + ACCESS_ONCE(x) = (v); \ + barrier(); \ +} while (0) + +#define READ_ONCE(x) ({ \ + __typeof(x) __var; \ + barrier(); \ + __var = ACCESS_ONCE(x); \ + barrier(); \ + __var; \ +}) #endif /* _LINUX_COMPILER_H_ */ Modified: stable/10/sys/ofed/include/linux/file.h ============================================================================== --- stable/10/sys/ofed/include/linux/file.h Mon Jan 4 08:41:13 2016 (r293150) +++ stable/10/sys/ofed/include/linux/file.h Mon Jan 4 09:37:05 2016 (r293151) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -119,6 +119,21 @@ get_unused_fd(void) return fd; } +static inline int +get_unused_fd_flags(int flags) +{ + struct file *file; + int error; + int fd; + + error = falloc(curthread, &file, &fd, flags); + if (error) + return -error; + /* drop the extra reference */ + fdrop(file, curthread); + return fd; +} + static inline struct linux_file * alloc_file(int mode, const struct file_operations *fops) { Modified: stable/10/sys/ofed/include/linux/kobject.h ============================================================================== --- stable/10/sys/ofed/include/linux/kobject.h Mon Jan 4 08:41:13 2016 (r293150) +++ stable/10/sys/ofed/include/linux/kobject.h Mon Jan 4 09:37:05 2016 (r293151) @@ -87,29 +87,7 @@ kobject_get(struct kobject *kobj) return kobj; } -static inline int -kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list args) -{ - char *old; - char *name; - - old = kobj->name; - - if (old && !fmt) - return 0; - - name = kzalloc(MAXPATHLEN, GFP_KERNEL); - if (!name) - return -ENOMEM; - vsnprintf(name, MAXPATHLEN, fmt, args); - kobj->name = name; - kfree(old); - for (; *name != '\0'; name++) - if (*name == '/') - *name = '!'; - return (0); -} - +int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list); int kobject_add(struct kobject *kobj, struct kobject *parent, const char *fmt, ...); Modified: stable/10/sys/ofed/include/linux/linux_compat.c ============================================================================== --- stable/10/sys/ofed/include/linux/linux_compat.c Mon Jan 4 08:41:13 2016 (r293150) +++ stable/10/sys/ofed/include/linux/linux_compat.c Mon Jan 4 09:37:05 2016 (r293151) @@ -64,6 +64,8 @@ #include +#include + MALLOC_DEFINE(M_KMALLOC, "linux", "Linux kmalloc compat"); #include @@ -90,7 +92,50 @@ panic_cmp(struct rb_node *one, struct rb } RB_GENERATE(linux_root, rb_node, __entry, panic_cmp); - + +int +kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list args) +{ + va_list tmp_va; + int len; + char *old; + char *name; + char dummy; + + old = kobj->name; + + if (old && fmt == NULL) + return (0); + + /* compute length of string */ + va_copy(tmp_va, args); + len = vsnprintf(&dummy, 0, fmt, tmp_va); + va_end(tmp_va); + + /* account for zero termination */ + len++; + + /* check for error */ + if (len < 1) + return (-EINVAL); + + /* allocate memory for string */ + name = kzalloc(len, GFP_KERNEL); + if (name == NULL) + return (-ENOMEM); + vsnprintf(name, len, fmt, args); + kobj->name = name; + + /* free old string */ + kfree(old); + + /* filter new string */ + for (; *name != '\0'; name++) + if (*name == '/') + *name = '!'; + return (0); +} + int kobject_set_name(struct kobject *kobj, const char *fmt, ...) { @@ -882,6 +927,50 @@ linux_completion_done(struct completion return (isdone); } +void +linux_delayed_work_fn(void *arg) +{ + struct delayed_work *work; + + work = arg; + taskqueue_enqueue(work->work.taskqueue, &work->work.work_task); +} + +void +linux_work_fn(void *context, int pending) +{ + struct work_struct *work; + + work = context; + work->fn(work); +} + +void +linux_flush_fn(void *context, int pending) +{ +} + +struct workqueue_struct * +linux_create_workqueue_common(const char *name, int cpus) +{ + struct workqueue_struct *wq; + + wq = kmalloc(sizeof(*wq), M_WAITOK); + wq->taskqueue = taskqueue_create(name, M_WAITOK, + taskqueue_thread_enqueue, &wq->taskqueue); + atomic_set(&wq->draining, 0); + taskqueue_start_threads(&wq->taskqueue, cpus, PWAIT, "%s", name); + + return (wq); +} + +void +destroy_workqueue(struct workqueue_struct *wq) +{ + taskqueue_free(wq->taskqueue); + kfree(wq); +} + static void linux_compat_init(void *arg) { Added: stable/10/sys/ofed/include/linux/srcu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/ofed/include/linux/srcu.h Mon Jan 4 09:37:05 2016 (r293151) @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2015 Mellanox Technologies, Ltd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _LINUX_SRCU_H_ +#define _LINUX_SRCU_H_ + +#include +#include +#include + +struct srcu_struct { + struct sx sx; +}; + +static inline int +init_srcu_struct(struct srcu_struct *srcu) +{ + sx_init(&srcu->sx, "SleepableRCU"); + return (0); +} + +static inline void +cleanup_srcu_struct(struct srcu_struct *srcu) +{ + sx_destroy(&srcu->sx); +} + +static inline int +srcu_read_lock(struct srcu_struct *srcu) +{ + sx_slock(&srcu->sx); + return (0); +} + +static inline void +srcu_read_unlock(struct srcu_struct *srcu, int key) +{ + sx_sunlock(&srcu->sx); +} + +static inline void +synchronize_srcu(struct srcu_struct *srcu) +{ + sx_xlock(&srcu->sx); + sx_xunlock(&srcu->sx); +} + +#endif /* _LINUX_SRCU_H_ */ Modified: stable/10/sys/ofed/include/linux/types.h ============================================================================== --- stable/10/sys/ofed/include/linux/types.h Mon Jan 4 08:41:13 2016 (r293150) +++ stable/10/sys/ofed/include/linux/types.h Mon Jan 4 09:37:05 2016 (r293151) @@ -36,8 +36,6 @@ #include #include -#define __read_mostly __attribute__((__section__(".data.read_mostly"))) - #ifndef __bitwise__ #ifdef __CHECKER__ #define __bitwise__ __attribute__((bitwise)) Modified: stable/10/sys/ofed/include/linux/workqueue.h ============================================================================== --- stable/10/sys/ofed/include/linux/workqueue.h Mon Jan 4 08:41:13 2016 (r293150) +++ stable/10/sys/ofed/include/linux/workqueue.h Mon Jan 4 09:37:05 2016 (r293151) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,10 +34,13 @@ #include #include +#include + #include struct workqueue_struct { struct taskqueue *taskqueue; + atomic_t draining; }; struct work_struct { @@ -46,11 +49,19 @@ struct work_struct { void (*fn)(struct work_struct *); }; +typedef __typeof(((struct work_struct *)0)->fn) work_func_t; + struct delayed_work { struct work_struct work; struct callout timer; }; +extern void linux_work_fn(void *, int); +extern void linux_flush_fn(void *, int); +extern void linux_delayed_work_fn(void *); +extern struct workqueue_struct *linux_create_workqueue_common(const char *, int); +extern void destroy_workqueue(struct workqueue_struct *); + static inline struct delayed_work * to_delayed_work(struct work_struct *work) { @@ -58,21 +69,11 @@ to_delayed_work(struct work_struct *work return container_of(work, struct delayed_work, work); } - -static inline void -_work_fn(void *context, int pending) -{ - struct work_struct *work; - - work = context; - work->fn(work); -} - #define INIT_WORK(work, func) \ do { \ (work)->fn = (func); \ (work)->taskqueue = NULL; \ - TASK_INIT(&(work)->work_task, 0, _work_fn, (work)); \ + TASK_INIT(&(work)->work_task, 0, linux_work_fn, (work)); \ } while (0) #define INIT_DELAYED_WORK(_work, func) \ @@ -81,7 +82,7 @@ do { \ callout_init(&(_work)->timer, CALLOUT_MPSAFE); \ } while (0) -#define INIT_DEFERRABLE_WORK INIT_DELAYED_WORK +#define INIT_DEFERRABLE_WORK(...) INIT_DELAYED_WORK(__VA_ARGS__) #define schedule_work(work) \ do { \ @@ -91,20 +92,15 @@ do { \ #define flush_scheduled_work() flush_taskqueue(taskqueue_thread) -static inline int queue_work (struct workqueue_struct *q, struct work_struct *work) +static inline int +queue_work(struct workqueue_struct *wq, struct work_struct *work) { - (work)->taskqueue = (q)->taskqueue; - /* Return opposite val to align with Linux logic */ - return !taskqueue_enqueue((q)->taskqueue, &(work)->work_task); -} - -static inline void -_delayed_work_fn(void *arg) -{ - struct delayed_work *work; - - work = arg; - taskqueue_enqueue(work->work.taskqueue, &work->work.work_task); + work->taskqueue = wq->taskqueue; + /* Check for draining */ + if (atomic_read(&wq->draining) != 0) + return (!work->work_task.ta_pending); + /* Return opposite value to align with Linux logic */ + return (!taskqueue_enqueue(wq->taskqueue, &work->work_task)); } static inline int @@ -113,57 +109,44 @@ queue_delayed_work(struct workqueue_stru { int pending; - pending = work->work.work_task.ta_pending; work->work.taskqueue = wq->taskqueue; - if (delay != 0) - callout_reset(&work->timer, delay, _delayed_work_fn, work); - else - _delayed_work_fn((void *)work); - + if (atomic_read(&wq->draining) != 0) { + pending = work->work.work_task.ta_pending; + } else if (delay != 0) { + pending = work->work.work_task.ta_pending; + callout_reset(&work->timer, delay, linux_delayed_work_fn, work); + } else { + callout_stop(&work->timer); + pending = taskqueue_enqueue(work->work.taskqueue, + &work->work.work_task); + } return (!pending); } -static inline bool schedule_delayed_work(struct delayed_work *dwork, - unsigned long delay) -{ - struct workqueue_struct wq; - wq.taskqueue = taskqueue_thread; - return queue_delayed_work(&wq, dwork, delay); -} - -static inline struct workqueue_struct * -_create_workqueue_common(char *name, int cpus) +static inline bool +schedule_delayed_work(struct delayed_work *dwork, + unsigned long delay) { - struct workqueue_struct *wq; + struct workqueue_struct wq; - wq = kmalloc(sizeof(*wq), M_WAITOK); - wq->taskqueue = taskqueue_create((name), M_WAITOK, - taskqueue_thread_enqueue, &wq->taskqueue); - taskqueue_start_threads(&wq->taskqueue, cpus, PWAIT, "%s", name); - - return (wq); + wq.taskqueue = taskqueue_thread; + atomic_set(&wq.draining, 0); + return (queue_delayed_work(&wq, dwork, delay)); } - #define create_singlethread_workqueue(name) \ - _create_workqueue_common(name, 1) + linux_create_workqueue_common(name, 1) #define create_workqueue(name) \ - _create_workqueue_common(name, MAXCPU) + linux_create_workqueue_common(name, MAXCPU) -static inline void -destroy_workqueue(struct workqueue_struct *wq) -{ - taskqueue_free(wq->taskqueue); - kfree(wq); -} +#define alloc_ordered_workqueue(name, flags) \ + linux_create_workqueue_common(name, 1) -#define flush_workqueue(wq) flush_taskqueue((wq)->taskqueue) +#define alloc_workqueue(name, flags, max_active) \ + linux_create_workqueue_common(name, max_active) -static inline void -_flush_fn(void *context, int pending) -{ -} +#define flush_workqueue(wq) flush_taskqueue((wq)->taskqueue) static inline void flush_taskqueue(struct taskqueue *tq) @@ -171,12 +154,20 @@ flush_taskqueue(struct taskqueue *tq) struct task flushtask; PHOLD(curproc); - TASK_INIT(&flushtask, 0, _flush_fn, NULL); + TASK_INIT(&flushtask, 0, linux_flush_fn, NULL); taskqueue_enqueue(tq, &flushtask); taskqueue_drain(tq, &flushtask); PRELE(curproc); } +static inline void +drain_workqueue(struct workqueue_struct *wq) +{ + atomic_inc(&wq->draining); + flush_taskqueue(wq->taskqueue); + atomic_dec(&wq->draining); +} + static inline int cancel_work_sync(struct work_struct *work) { @@ -213,7 +204,7 @@ cancel_delayed_work_sync(struct delayed_ static inline bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork, - unsigned long delay) + unsigned long delay) { cancel_delayed_work(dwork); queue_delayed_work(wq, dwork, delay); From owner-svn-src-stable-10@freebsd.org Mon Jan 4 09:38:34 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEA46A61BAC; Mon, 4 Jan 2016 09:38:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A73541B55; Mon, 4 Jan 2016 09:38:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049cXkR027210; Mon, 4 Jan 2016 09:38:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049cXws027209; Mon, 4 Jan 2016 09:38:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040938.u049cXws027209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:38:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293152 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:38:35 -0000 Author: hselasky Date: Mon Jan 4 09:38:33 2016 New Revision: 293152 URL: https://svnweb.freebsd.org/changeset/base/293152 Log: Add missed mergeinfo. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@freebsd.org Mon Jan 4 09:47:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37193A61E33; Mon, 4 Jan 2016 09:47:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB00A1348; Mon, 4 Jan 2016 09:47:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049lKub030075; Mon, 4 Jan 2016 09:47:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049lKUk030074; Mon, 4 Jan 2016 09:47:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040947.u049lKUk030074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293153 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:47:22 -0000 Author: hselasky Date: Mon Jan 4 09:47:20 2016 New Revision: 293153 URL: https://svnweb.freebsd.org/changeset/base/293153 Log: MFC r292835: Make the eeprom dump function more readable and rename variables for better clarity. Submitted by: Daria Genzel Differential Revision: https://reviews.freebsd.org/D4551 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:38:33 2016 (r293152) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:47:20 2016 (r293153) @@ -319,34 +319,33 @@ mlx5e_get_eeprom(struct mlx5e_priv *priv static void mlx5e_print_eeprom(struct mlx5e_eeprom *eeprom) { - int i, j = 0; - int row = 0; + int row; + int index_in_row; + int byte_to_write = 0; + int line_length = 16; printf("\nOffset\t\tValues\n"); - printf("------\t\t------\n"); - while (row < eeprom->len) { - printf("0x%04x\t\t", row); - for (i = 0; i < 16; i++) { - printf("%02x ", ((u8 *)eeprom->data)[j]); - j++; - row++; + printf("------\t\t------"); + while (byte_to_write < eeprom->len) { + printf("\n0x%04X\t\t", byte_to_write); + for (index_in_row = 0; index_in_row < line_length; index_in_row++) { + printf("%02X ", ((u8 *)eeprom->data)[byte_to_write]); + byte_to_write++; } - printf("\n"); } if (eeprom->page_valid) { row = MLX5E_EEPROM_HIGH_PAGE_OFFSET; - printf("\nUpper Page 0x03\n"); + printf("\n\nUpper Page 0x03\n"); printf("\nOffset\t\tValues\n"); - printf("------\t\t------\n"); + printf("------\t\t------"); while (row < MLX5E_EEPROM_PAGE_LENGTH) { - printf("0x%04x\t\t", row); - for (i = 0; i < 16; i++) { - printf("%02x ", ((u8 *)eeprom->data)[j]); - j++; + printf("\n0x%04X\t\t", row); + for (index_in_row = 0; index_in_row < line_length; index_in_row++) { + printf("%02X ", ((u8 *)eeprom->data)[byte_to_write]); + byte_to_write++; row++; } - printf("\n"); } } } From owner-svn-src-stable-10@freebsd.org Mon Jan 4 09:49:54 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 867B1A61ED8; Mon, 4 Jan 2016 09:49:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CAAC153F; Mon, 4 Jan 2016 09:49:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049nrNh030205; Mon, 4 Jan 2016 09:49:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049nrR9030204; Mon, 4 Jan 2016 09:49:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040949.u049nrR9030204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293154 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:49:54 -0000 Author: hselasky Date: Mon Jan 4 09:49:53 2016 New Revision: 293154 URL: https://svnweb.freebsd.org/changeset/base/293154 Log: MFC r292837: Add support for sysctl tunables to 10-stable and older. Pushed through head first to simplify driver maintenance. MFC after: 1 week Submitted by: Drew Gallatin Differential Revision: https://reviews.freebsd.org/D4552 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:47:20 2016 (r293153) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:49:53 2016 (r293154) @@ -58,13 +58,17 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG PRIV_LOCK(priv); value = priv->params_ethtool.arg[arg2]; - error = sysctl_handle_64(oidp, &value, 0, req); - if (error || req->newptr == NULL || - value == priv->params_ethtool.arg[arg2]) - goto done; + if (req != NULL) { + error = sysctl_handle_64(oidp, &value, 0, req); + if (error || req->newptr == NULL || + value == priv->params_ethtool.arg[arg2]) + goto done; - /* assign new value */ - priv->params_ethtool.arg[arg2] = value; + /* assign new value */ + priv->params_ethtool.arg[arg2] = value; + } else { + error = 0; + } /* check if device is gone */ if (priv->gone) { @@ -483,10 +487,30 @@ mlx5e_create_ethtool(struct mlx5e_priv * CTLFLAG_MPSAFE, priv, x, &mlx5e_ethtool_handler, "QU", mlx5e_params_desc[2 * x + 1]); } else { +#if (__FreeBSD_version < 1100000) + char path[64]; +#endif + /* + * NOTE: In FreeBSD-11 and newer the + * CTLFLAG_RWTUN flag will take care of + * loading default sysctl value from the + * kernel environment, if any: + */ SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(node), OID_AUTO, mlx5e_params_desc[2 * x], CTLTYPE_U64 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, priv, x, &mlx5e_ethtool_handler, "QU", mlx5e_params_desc[2 * x + 1]); + +#if (__FreeBSD_version < 1100000) + /* compute path for sysctl */ + snprintf(path, sizeof(path), "dev.mce.%d.conf.%s", + device_get_unit(priv->mdev->pdev->dev.bsddev), + mlx5e_params_desc[2 * x]); + + /* try to fetch tunable, if any */ + if (TUNABLE_QUAD_FETCH(path, &priv->params_ethtool.arg[x])) + mlx5e_ethtool_handler(NULL, priv, x, NULL); +#endif } } From owner-svn-src-stable-10@freebsd.org Mon Jan 4 09:52:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 117A8A6004F; Mon, 4 Jan 2016 09:52:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA87519CA; Mon, 4 Jan 2016 09:52:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049qfpn032793; Mon, 4 Jan 2016 09:52:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049qe5Y032786; Mon, 4 Jan 2016 09:52:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040952.u049qe5Y032786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293155 - in stable/10/sys/dev/mlx5: . mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:52:42 -0000 Author: hselasky Date: Mon Jan 4 09:52:40 2016 New Revision: 293155 URL: https://svnweb.freebsd.org/changeset/base/293155 Log: MFC r292838: Add support for CQE zipping. CQE zipping reduces PCI overhead by coalescing and zipping multiple CQEs into a single merged CQE. The feature is enabled by default and can be disabled by a sysctl. Implementing this feature mlx5_cqwq_pop() has been separated from mlx5e_get_cqe(). Submitted by: Mark Bloch Differential Revision: https://reviews.freebsd.org/D4598 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/device.h stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/device.h ============================================================================== --- stable/10/sys/dev/mlx5/device.h Mon Jan 4 09:49:53 2016 (r293154) +++ stable/10/sys/dev/mlx5/device.h Mon Jan 4 09:52:40 2016 (r293155) @@ -1042,6 +1042,7 @@ enum { MLX5_ESW_VPORT_ADMIN_STATE_UP = 0x1, MLX5_ESW_VPORT_ADMIN_STATE_AUTO = 0x2, }; + /* MLX5 DEV CAPs */ /* TODO: EAT.ME */ @@ -1219,4 +1220,36 @@ struct mlx5_ifc_mcia_reg_bits { }; #define MLX5_CMD_OP_QUERY_EEPROM 0x93c + +struct mlx5_mini_cqe8 { + union { + u32 rx_hash_result; + u32 checksum; + struct { + u16 wqe_counter; + u8 s_wqe_opcode; + u8 reserved; + } s_wqe_info; + }; + u32 byte_cnt; +}; + +enum { + MLX5_NO_INLINE_DATA, + MLX5_INLINE_DATA32_SEG, + MLX5_INLINE_DATA64_SEG, + MLX5_COMPRESSED, +}; + +enum mlx5_exp_cqe_zip_recv_type { + MLX5_CQE_FORMAT_HASH, + MLX5_CQE_FORMAT_CSUM, +}; + +#define MLX5E_CQE_FORMAT_MASK 0xc +static inline int mlx5_get_cqe_format(const struct mlx5_cqe64 *cqe) +{ + return (cqe->op_own & MLX5E_CQE_FORMAT_MASK) >> 2; +} + #endif /* MLX5_DEVICE_H */ Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Jan 4 09:49:53 2016 (r293154) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Jan 4 09:52:40 2016 (r293155) @@ -372,6 +372,7 @@ struct mlx5e_params { u16 tx_cq_moderation_pkts; u16 min_rx_wqes; bool hw_lro_en; + bool cqe_zipping_en; u32 lro_wqe_sz; u16 rx_hash_log_tbl_sz; }; @@ -392,7 +393,8 @@ struct mlx5e_params { m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ - m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") + m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ + m(+1, u64 cqe_zipping, "cqe_zipping", "0 : CQE zipping disabled") #define MLX5E_PARAMS_NUM (0 MLX5E_PARAMS(MLX5E_STATS_COUNT)) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:49:53 2016 (r293154) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:52:40 2016 (r293155) @@ -204,6 +204,18 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params.hw_lro_en = false; } + if (&priv->params_ethtool.arg[arg2] == + &priv->params_ethtool.cqe_zipping) { + if (priv->params_ethtool.cqe_zipping && + MLX5_CAP_GEN(priv->mdev, cqe_compression)) { + priv->params.cqe_zipping_en = true; + priv->params_ethtool.cqe_zipping = 1; + } else { + priv->params.cqe_zipping_en = false; + priv->params_ethtool.cqe_zipping = 0; + } + } + if (was_opened) mlx5e_open_locked(priv->ifp); done: @@ -472,6 +484,7 @@ mlx5e_create_ethtool(struct mlx5e_priv * priv->params_ethtool.tx_coalesce_usecs = priv->params.tx_cq_moderation_usec; priv->params_ethtool.tx_coalesce_pkts = priv->params.tx_cq_moderation_pkts; priv->params_ethtool.hw_lro = priv->params.hw_lro_en; + priv->params_ethtool.cqe_zipping = priv->params.cqe_zipping_en; /* create root node */ node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:49:53 2016 (r293154) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:52:40 2016 (r293155) @@ -1604,6 +1604,16 @@ mlx5e_build_rx_cq_param(struct mlx5e_pri { void *cqc = param->cqc; + + /* + * TODO The sysctl to control on/off is a bool value for now, which means + * we only support CSUM, once HASH is implemnted we'll need to address that. + */ + if (priv->params.cqe_zipping_en) { + MLX5_SET(cqc, cqc, mini_cqe_res_format, MLX5_CQE_FORMAT_CSUM); + MLX5_SET(cqc, cqc, cqe_compression_en, 1); + } + MLX5_SET(cqc, cqc, log_cq_size, priv->params.log_rq_size); MLX5_SET(cqc, cqc, cq_period, priv->params.rx_cq_moderation_usec); MLX5_SET(cqc, cqc, cq_max_count, priv->params.rx_cq_moderation_pkts); @@ -2571,6 +2581,8 @@ mlx5e_build_ifp_priv(struct mlx5_core_de priv->params.hw_lro_en = false; priv->params.lro_wqe_sz = MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ; + priv->params.cqe_zipping_en = !!MLX5_CAP_GEN(mdev, cqe_compression); + priv->mdev = mdev; priv->params.num_channels = num_comp_vectors; priv->order_base_2_num_channels = order_base_2(num_comp_vectors); Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Jan 4 09:49:53 2016 (r293154) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Jan 4 09:52:40 2016 (r293155) @@ -248,6 +248,69 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *c } } +static inline void +mlx5e_read_cqe_slot(struct mlx5e_cq *cq, u32 cc, void *data) +{ + memcpy(data, mlx5_cqwq_get_wqe(&cq->wq, (cc & cq->wq.sz_m1)), + sizeof(struct mlx5_cqe64)); +} + +static inline void +mlx5e_write_cqe_slot(struct mlx5e_cq *cq, u32 cc, void *data) +{ + memcpy(mlx5_cqwq_get_wqe(&cq->wq, cc & cq->wq.sz_m1), + data, sizeof(struct mlx5_cqe64)); +} + +static inline void +mlx5e_decompress_cqe(struct mlx5e_cq *cq, struct mlx5_cqe64 *title, + struct mlx5_mini_cqe8 *mini, + u16 wqe_counter, int i) +{ + title->byte_cnt = mini->byte_cnt; + title->wqe_counter = cpu_to_be16((wqe_counter + i) & cq->wq.sz_m1); + title->check_sum = mini->checksum; + title->op_own = (title->op_own & 0xf0) | + (((cq->wq.cc + i) >> cq->wq.log_sz) & 1); +} + +#define MLX5E_MINI_ARRAY_SZ 8 +/* Make sure structs are not packet differently */ +CTASSERT(sizeof(struct mlx5_cqe64) == + sizeof(struct mlx5_mini_cqe8) * MLX5E_MINI_ARRAY_SZ); +static void +mlx5e_decompress_cqes(struct mlx5e_cq *cq) +{ + struct mlx5_mini_cqe8 mini_array[MLX5E_MINI_ARRAY_SZ]; + struct mlx5_cqe64 title; + u32 cqe_count; + u32 i = 0; + u16 title_wqe_counter; + + mlx5e_read_cqe_slot(cq, cq->wq.cc, &title); + title_wqe_counter = be16_to_cpu(title.wqe_counter); + cqe_count = be32_to_cpu(title.byte_cnt); + + /* Make sure we won't overflow */ + KASSERT(cqe_count <= cq->wq.sz_m1, + ("%s: cqe_count %u > cq->wq.sz_m1 %u", __func__, + cqe_count, cq->wq.sz_m1)); + + mlx5e_read_cqe_slot(cq, cq->wq.cc + 1, mini_array); + while (true) { + mlx5e_decompress_cqe(cq, &title, + &mini_array[i % MLX5E_MINI_ARRAY_SZ], + title_wqe_counter, i); + mlx5e_write_cqe_slot(cq, cq->wq.cc + i, &title); + i++; + + if (i == cqe_count) + break; + if (i % MLX5E_MINI_ARRAY_SZ == 0) + mlx5e_read_cqe_slot(cq, cq->wq.cc + i, mini_array); + } +} + static int mlx5e_poll_rx_cq(struct mlx5e_rq *rq, int budget) { @@ -268,6 +331,11 @@ mlx5e_poll_rx_cq(struct mlx5e_rq *rq, in if (!cqe) break; + if (mlx5_get_cqe_format(cqe) == MLX5_COMPRESSED) + mlx5e_decompress_cqes(&rq->cq); + + mlx5_cqwq_pop(&rq->cq.wq); + wqe_counter_be = cqe->wqe_counter; wqe_counter = be16_to_cpu(wqe_counter_be); wqe = mlx5_wq_ll_get_wqe(&rq->wq, wqe_counter); Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Mon Jan 4 09:49:53 2016 (r293154) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Mon Jan 4 09:52:40 2016 (r293155) @@ -383,6 +383,8 @@ mlx5e_poll_tx_cq(struct mlx5e_sq *sq, in if (!cqe) break; + mlx5_cqwq_pop(&sq->cq.wq); + ci = sqcc & sq->wq.sz_m1; mb = sq->mbuf[ci].mbuf; sq->mbuf[ci].mbuf = NULL; /* Safety clear */ Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Mon Jan 4 09:49:53 2016 (r293154) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Mon Jan 4 09:52:40 2016 (r293155) @@ -37,8 +37,6 @@ mlx5e_get_cqe(struct mlx5e_cq *cq) if ((cqe->op_own ^ mlx5_cqwq_get_wrap_cnt(&cq->wq)) & MLX5_CQE_OWNER_MASK) return (NULL); - mlx5_cqwq_pop(&cq->wq); - /* ensure cqe content is read after cqe ownership bit */ rmb(); From owner-svn-src-stable-10@freebsd.org Mon Jan 4 09:55:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8CF8A60181; Mon, 4 Jan 2016 09:55:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 869BF1C2A; Mon, 4 Jan 2016 09:55:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049tLv9033047; Mon, 4 Jan 2016 09:55:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049tLqx033045; Mon, 4 Jan 2016 09:55:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040955.u049tLqx033045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293156 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:55:22 -0000 Author: hselasky Date: Mon Jan 4 09:55:21 2016 New Revision: 293156 URL: https://svnweb.freebsd.org/changeset/base/293156 Log: MFC r292946: 10G ER/LR should present itself as LR. MFC after: 1 week Submitted by: Shahar Klein Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Jan 4 09:52:40 2016 (r293155) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Jan 4 09:55:21 2016 (r293156) @@ -700,7 +700,7 @@ enum mlx5e_link_mode { MLX5E_56GBASE_R4 = 8, MLX5E_10GBASE_CR = 12, MLX5E_10GBASE_SR = 13, - MLX5E_10GBASE_ER = 14, + MLX5E_10GBASE_LR = 14, MLX5E_40GBASE_SR4 = 15, MLX5E_40GBASE_LR4 = 16, MLX5E_100GBASE_CR4 = 20, Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:52:40 2016 (r293155) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:55:21 2016 (r293156) @@ -106,8 +106,8 @@ static const struct { .subtype = IFM_10G_SR, .baudrate = IF_Gbps(10ULL), }, - [MLX5E_10GBASE_ER] = { - .subtype = IFM_10G_ER, + [MLX5E_10GBASE_LR] = { + .subtype = IFM_10G_LR, .baudrate = IF_Gbps(10ULL), }, [MLX5E_40GBASE_SR4] = { From owner-svn-src-stable-10@freebsd.org Mon Jan 4 09:56:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55345A60217; Mon, 4 Jan 2016 09:56:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C2B91D98; Mon, 4 Jan 2016 09:56:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049uwSd033146; Mon, 4 Jan 2016 09:56:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049uwwt033145; Mon, 4 Jan 2016 09:56:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040956.u049uwwt033145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293157 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:56:59 -0000 Author: hselasky Date: Mon Jan 4 09:56:57 2016 New Revision: 293157 URL: https://svnweb.freebsd.org/changeset/base/293157 Log: MFC r292948: Allow I2C to read address 0x51 as well as address 0x50. Submitted by: Shahar Klein Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:55:21 2016 (r293156) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:56:57 2016 (r293157) @@ -2298,6 +2298,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long co int size_read = 0; int module_num; int max_mtu; + uint8_t read_addr; priv = ifp->if_softc; @@ -2484,11 +2485,21 @@ out: } /* - * Note that we ignore i2c.addr here. The driver hardcodes - * the address to 0x50, while standard expects it to be 0xA0. + * Currently 0XA0 and 0xA2 are the only addresses permitted. + * The internal conversion is as follows: */ + if (i2c.dev_addr == 0xA0) + read_addr = MLX5E_I2C_ADDR_LOW; + else if (i2c.dev_addr == 0xA2) + read_addr = MLX5E_I2C_ADDR_HIGH; + else { + if_printf(ifp, "Query eeprom failed, " + "Invalid Address: %X\n", i2c.dev_addr); + error = EINVAL; + goto err_i2c; + } error = mlx5_query_eeprom(priv->mdev, - MLX5E_I2C_ADDR_LOW, MLX5E_EEPROM_LOW_PAGE, + read_addr, MLX5E_EEPROM_LOW_PAGE, (uint32_t)i2c.offset, (uint32_t)i2c.len, module_num, (uint32_t *)i2c.data, &size_read); if (error) { @@ -2499,7 +2510,7 @@ out: if (i2c.len > MLX5_EEPROM_MAX_BYTES) { error = mlx5_query_eeprom(priv->mdev, - MLX5E_I2C_ADDR_LOW, MLX5E_EEPROM_LOW_PAGE, + read_addr, MLX5E_EEPROM_LOW_PAGE, (uint32_t)(i2c.offset + size_read), (uint32_t)(i2c.len - size_read), module_num, (uint32_t *)(i2c.data + size_read), &size_read); From owner-svn-src-stable-10@freebsd.org Mon Jan 4 09:58:17 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDA11A602C4; Mon, 4 Jan 2016 09:58:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F4031F2D; Mon, 4 Jan 2016 09:58:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u049wG89033249; Mon, 4 Jan 2016 09:58:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u049wGDq033246; Mon, 4 Jan 2016 09:58:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601040958.u049wGDq033246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Jan 2016 09:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293158 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 09:58:17 -0000 Author: hselasky Date: Mon Jan 4 09:58:16 2016 New Revision: 293158 URL: https://svnweb.freebsd.org/changeset/base/293158 Log: MFC r292949: Add support for modifying coalescing parameters runtime. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Jan 4 09:56:57 2016 (r293157) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Jan 4 09:58:16 2016 (r293158) @@ -789,5 +789,6 @@ void mlx5e_create_stats(struct sysctl_ct struct sysctl_oid_list *, const char *, const char **, unsigned, u64 *); void mlx5e_send_nop(struct mlx5e_sq *, u32, bool); +int mlx5e_refresh_channel_params(struct mlx5e_priv *); #endif /* _MLX5_EN_H_ */ Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:56:57 2016 (r293157) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Jan 4 09:58:16 2016 (r293158) @@ -69,12 +69,49 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG } else { error = 0; } - /* check if device is gone */ if (priv->gone) { error = ENXIO; goto done; } + /* import RX coal time */ + if (priv->params_ethtool.rx_coalesce_usecs < 1) + priv->params_ethtool.rx_coalesce_usecs = 0; + else if (priv->params_ethtool.rx_coalesce_usecs > + MLX5E_FLD_MAX(cqc, cq_period)) { + priv->params_ethtool.rx_coalesce_usecs = + MLX5E_FLD_MAX(cqc, cq_period); + } + priv->params.rx_cq_moderation_usec = priv->params_ethtool.rx_coalesce_usecs; + + /* import RX coal pkts */ + if (priv->params_ethtool.rx_coalesce_pkts < 1) + priv->params_ethtool.rx_coalesce_pkts = 0; + else if (priv->params_ethtool.rx_coalesce_pkts > + MLX5E_FLD_MAX(cqc, cq_max_count)) { + priv->params_ethtool.rx_coalesce_pkts = + MLX5E_FLD_MAX(cqc, cq_max_count); + } + priv->params.rx_cq_moderation_pkts = priv->params_ethtool.rx_coalesce_pkts; + + /* import TX coal time */ + if (priv->params_ethtool.tx_coalesce_usecs < 1) + priv->params_ethtool.tx_coalesce_usecs = 0; + else if (priv->params_ethtool.tx_coalesce_usecs > + MLX5E_FLD_MAX(cqc, cq_period)) { + priv->params_ethtool.tx_coalesce_usecs = + MLX5E_FLD_MAX(cqc, cq_period); + } + priv->params.tx_cq_moderation_usec = priv->params_ethtool.tx_coalesce_usecs; + + /* import TX coal pkts */ + if (priv->params_ethtool.tx_coalesce_pkts < 1) + priv->params_ethtool.tx_coalesce_pkts = 0; + else if (priv->params_ethtool.tx_coalesce_pkts > + MLX5E_FLD_MAX(cqc, cq_max_count)) { + priv->params_ethtool.tx_coalesce_pkts = MLX5E_FLD_MAX(cqc, cq_max_count); + } + priv->params.tx_cq_moderation_pkts = priv->params_ethtool.tx_coalesce_pkts; if (&priv->params_ethtool.arg[arg2] == &priv->params_ethtool.rx_pauseframe_control || &priv->params_ethtool.arg[arg2] == &priv->params_ethtool.tx_pauseframe_control) { @@ -92,9 +129,19 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG } was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state); - if (was_opened) - mlx5e_close_locked(priv->ifp); + if (was_opened) { + u64 *xarg = priv->params_ethtool.arg + arg2; + if (xarg == &priv->params_ethtool.tx_coalesce_pkts || + xarg == &priv->params_ethtool.rx_coalesce_pkts || + xarg == &priv->params_ethtool.tx_coalesce_usecs || + xarg == &priv->params_ethtool.rx_coalesce_usecs) { + /* avoid downing and upping the network interface */ + error = mlx5e_refresh_channel_params(priv); + goto done; + } + mlx5e_close_locked(priv->ifp); + } /* import TX queue size */ if (priv->params_ethtool.tx_queue_size < (1 << MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE)) { @@ -145,45 +192,6 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params_ethtool.tx_coalesce_mode = 1; priv->params.tx_cq_moderation_mode = priv->params_ethtool.tx_coalesce_mode; - /* import RX coal time */ - if (priv->params_ethtool.rx_coalesce_usecs < 1) - priv->params_ethtool.rx_coalesce_usecs = 0; - else if (priv->params_ethtool.rx_coalesce_usecs > - MLX5E_FLD_MAX(cqc, cq_period)) { - priv->params_ethtool.rx_coalesce_usecs = - MLX5E_FLD_MAX(cqc, cq_period); - } - priv->params.rx_cq_moderation_usec = priv->params_ethtool.rx_coalesce_usecs; - - /* import RX coal pkts */ - if (priv->params_ethtool.rx_coalesce_pkts < 1) - priv->params_ethtool.rx_coalesce_pkts = 0; - else if (priv->params_ethtool.rx_coalesce_pkts > - MLX5E_FLD_MAX(cqc, cq_max_count)) { - priv->params_ethtool.rx_coalesce_pkts = - MLX5E_FLD_MAX(cqc, cq_max_count); - } - priv->params.rx_cq_moderation_pkts = priv->params_ethtool.rx_coalesce_pkts; - - /* import TX coal time */ - if (priv->params_ethtool.tx_coalesce_usecs < 1) - priv->params_ethtool.tx_coalesce_usecs = 0; - else if (priv->params_ethtool.tx_coalesce_usecs > - MLX5E_FLD_MAX(cqc, cq_period)) { - priv->params_ethtool.tx_coalesce_usecs = - MLX5E_FLD_MAX(cqc, cq_period); - } - priv->params.tx_cq_moderation_usec = priv->params_ethtool.tx_coalesce_usecs; - - /* import TX coal pkts */ - if (priv->params_ethtool.tx_coalesce_pkts < 1) - priv->params_ethtool.tx_coalesce_pkts = 0; - else if (priv->params_ethtool.tx_coalesce_pkts > - MLX5E_FLD_MAX(cqc, cq_max_count)) { - priv->params_ethtool.tx_coalesce_pkts = MLX5E_FLD_MAX(cqc, cq_max_count); - } - priv->params.tx_cq_moderation_pkts = priv->params_ethtool.tx_coalesce_pkts; - /* we always agree to turn off HW LRO - but not always to turn on */ if (priv->params_ethtool.hw_lro) { if (priv->params_ethtool.hw_lro != 1) { Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:56:57 2016 (r293157) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jan 4 09:58:16 2016 (r293158) @@ -1712,6 +1712,62 @@ mlx5e_close_channels(struct mlx5e_priv * } static int +mlx5e_refresh_sq_params(struct mlx5e_priv *priv, struct mlx5e_sq *sq) +{ + return (mlx5_core_modify_cq_moderation(priv->mdev, &sq->cq.mcq, + priv->params.tx_cq_moderation_usec, + priv->params.tx_cq_moderation_pkts)); +} + +static int +mlx5e_refresh_rq_params(struct mlx5e_priv *priv, struct mlx5e_rq *rq) +{ + return (mlx5_core_modify_cq_moderation(priv->mdev, &rq->cq.mcq, + priv->params.rx_cq_moderation_usec, + priv->params.rx_cq_moderation_pkts)); +} + +static int +mlx5e_refresh_channel_params_sub(struct mlx5e_priv *priv, struct mlx5e_channel *c) +{ + int err; + int i; + + if (c == NULL) + return (EINVAL); + + err = mlx5e_refresh_rq_params(priv, &c->rq); + if (err) + goto done; + + for (i = 0; i != c->num_tc; i++) { + err = mlx5e_refresh_sq_params(priv, &c->sq[i]); + if (err) + goto done; + } +done: + return (err); +} + +int +mlx5e_refresh_channel_params(struct mlx5e_priv *priv) +{ + int i; + + if (priv->channel == NULL) + return (EINVAL); + + for (i = 0; i < priv->params.num_channels; i++) { + int err; + + err = mlx5e_refresh_channel_params_sub(priv, priv->channel[i]); + if (err) + return (err); + } + return (0); +} + +static int mlx5e_open_tis(struct mlx5e_priv *priv, int tc) { struct mlx5_core_dev *mdev = priv->mdev; From owner-svn-src-stable-10@freebsd.org Mon Jan 4 16:32:29 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1896A62234; Mon, 4 Jan 2016 16:32:28 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDCBA1999; Mon, 4 Jan 2016 16:32:28 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04GWRqa060043; Mon, 4 Jan 2016 16:32:27 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04GWLwB059976; Mon, 4 Jan 2016 16:32:21 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201601041632.u04GWLwB059976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 4 Jan 2016 16:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293161 - in stable/10: contrib/openbsm contrib/openbsm/bin contrib/openbsm/bin/audit contrib/openbsm/bin/auditd contrib/openbsm/bin/auditdistd contrib/openbsm/bin/auditfilterd contrib/... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 16:32:29 -0000 Author: brueffer Date: Mon Jan 4 16:32:21 2016 New Revision: 293161 URL: https://svnweb.freebsd.org/changeset/base/293161 Log: MFH: 292432,r292433,r292434 - Merge OpenBSM 1.2 alpha 4. - Regenerate config.h for OpenBSM 1.2 alpha 4. - Add au_notify.2 and MLINKs (added in OpenBSM 1.2 alpha 4). Relnotes: yes Added: stable/10/contrib/openbsm/.travis.yml - copied unchanged from r292434, head/contrib/openbsm/.travis.yml stable/10/contrib/openbsm/libbsm/au_notify.3 - copied unchanged from r292434, head/contrib/openbsm/libbsm/au_notify.3 Modified: stable/10/contrib/openbsm/INSTALL stable/10/contrib/openbsm/LICENSE stable/10/contrib/openbsm/Makefile.am stable/10/contrib/openbsm/Makefile.in stable/10/contrib/openbsm/NEWS stable/10/contrib/openbsm/README stable/10/contrib/openbsm/TODO stable/10/contrib/openbsm/VERSION stable/10/contrib/openbsm/autogen.sh stable/10/contrib/openbsm/bin/Makefile.am stable/10/contrib/openbsm/bin/audit/Makefile.am stable/10/contrib/openbsm/bin/audit/audit.8 stable/10/contrib/openbsm/bin/audit/audit.c stable/10/contrib/openbsm/bin/auditd/Makefile.am stable/10/contrib/openbsm/bin/auditd/audit_triggers.defs stable/10/contrib/openbsm/bin/auditd/audit_warn.c stable/10/contrib/openbsm/bin/auditd/auditd.8 stable/10/contrib/openbsm/bin/auditd/auditd.c stable/10/contrib/openbsm/bin/auditd/auditd.h stable/10/contrib/openbsm/bin/auditd/auditd_control.defs stable/10/contrib/openbsm/bin/auditd/auditd_darwin.c stable/10/contrib/openbsm/bin/auditd/auditd_fbsd.c stable/10/contrib/openbsm/bin/auditdistd/Makefile.am stable/10/contrib/openbsm/bin/auditdistd/auditdistd.8 stable/10/contrib/openbsm/bin/auditdistd/auditdistd.c stable/10/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 stable/10/contrib/openbsm/bin/auditdistd/auditdistd.h stable/10/contrib/openbsm/bin/auditdistd/faccessat.h stable/10/contrib/openbsm/bin/auditdistd/fstatat.h stable/10/contrib/openbsm/bin/auditdistd/openat.h stable/10/contrib/openbsm/bin/auditdistd/parse.y stable/10/contrib/openbsm/bin/auditdistd/pjdlog.c stable/10/contrib/openbsm/bin/auditdistd/pjdlog.h stable/10/contrib/openbsm/bin/auditdistd/proto.c stable/10/contrib/openbsm/bin/auditdistd/proto.h stable/10/contrib/openbsm/bin/auditdistd/proto_common.c stable/10/contrib/openbsm/bin/auditdistd/proto_impl.h stable/10/contrib/openbsm/bin/auditdistd/proto_socketpair.c stable/10/contrib/openbsm/bin/auditdistd/proto_tcp.c stable/10/contrib/openbsm/bin/auditdistd/proto_tls.c stable/10/contrib/openbsm/bin/auditdistd/proto_uds.c stable/10/contrib/openbsm/bin/auditdistd/receiver.c stable/10/contrib/openbsm/bin/auditdistd/renameat.h stable/10/contrib/openbsm/bin/auditdistd/sandbox.c stable/10/contrib/openbsm/bin/auditdistd/sandbox.h stable/10/contrib/openbsm/bin/auditdistd/sender.c stable/10/contrib/openbsm/bin/auditdistd/sigtimedwait.h stable/10/contrib/openbsm/bin/auditdistd/strndup.h stable/10/contrib/openbsm/bin/auditdistd/subr.c stable/10/contrib/openbsm/bin/auditdistd/subr.h stable/10/contrib/openbsm/bin/auditdistd/synch.h stable/10/contrib/openbsm/bin/auditdistd/token.l stable/10/contrib/openbsm/bin/auditdistd/trail.c stable/10/contrib/openbsm/bin/auditdistd/trail.h stable/10/contrib/openbsm/bin/auditdistd/unlinkat.h stable/10/contrib/openbsm/bin/auditfilterd/Makefile.am stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.8 stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.c stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.h stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd_conf.c stable/10/contrib/openbsm/bin/auditreduce/Makefile.am stable/10/contrib/openbsm/bin/auditreduce/auditreduce.1 stable/10/contrib/openbsm/bin/auditreduce/auditreduce.c stable/10/contrib/openbsm/bin/auditreduce/auditreduce.h stable/10/contrib/openbsm/bin/praudit/Makefile.am stable/10/contrib/openbsm/bin/praudit/praudit.1 stable/10/contrib/openbsm/bin/praudit/praudit.c stable/10/contrib/openbsm/bsm/Makefile.am stable/10/contrib/openbsm/bsm/audit_filter.h stable/10/contrib/openbsm/bsm/audit_uevents.h stable/10/contrib/openbsm/bsm/auditd_lib.h stable/10/contrib/openbsm/bsm/libbsm.h stable/10/contrib/openbsm/compat/clock_gettime.h stable/10/contrib/openbsm/compat/closefrom.h stable/10/contrib/openbsm/compat/compat.h stable/10/contrib/openbsm/compat/endian.h stable/10/contrib/openbsm/compat/endian_enc.h stable/10/contrib/openbsm/compat/flopen.h stable/10/contrib/openbsm/compat/pidfile.h stable/10/contrib/openbsm/compat/queue.h stable/10/contrib/openbsm/compat/strlcat.h stable/10/contrib/openbsm/compat/strlcpy.h stable/10/contrib/openbsm/config/config.h stable/10/contrib/openbsm/configure stable/10/contrib/openbsm/configure.ac stable/10/contrib/openbsm/etc/audit_class stable/10/contrib/openbsm/etc/audit_control stable/10/contrib/openbsm/etc/audit_event stable/10/contrib/openbsm/etc/audit_filter stable/10/contrib/openbsm/etc/audit_user stable/10/contrib/openbsm/etc/audit_warn stable/10/contrib/openbsm/libauditd/Makefile.am stable/10/contrib/openbsm/libauditd/auditd_lib.c stable/10/contrib/openbsm/libauditd/libauditd.3 stable/10/contrib/openbsm/libbsm/Makefile.am stable/10/contrib/openbsm/libbsm/Makefile.in stable/10/contrib/openbsm/libbsm/au_class.3 stable/10/contrib/openbsm/libbsm/au_control.3 stable/10/contrib/openbsm/libbsm/au_domain.3 stable/10/contrib/openbsm/libbsm/au_errno.3 stable/10/contrib/openbsm/libbsm/au_event.3 stable/10/contrib/openbsm/libbsm/au_fcntl_cmd.3 stable/10/contrib/openbsm/libbsm/au_free_token.3 stable/10/contrib/openbsm/libbsm/au_io.3 stable/10/contrib/openbsm/libbsm/au_mask.3 stable/10/contrib/openbsm/libbsm/au_open.3 stable/10/contrib/openbsm/libbsm/au_socket_type.3 stable/10/contrib/openbsm/libbsm/au_token.3 stable/10/contrib/openbsm/libbsm/au_user.3 stable/10/contrib/openbsm/libbsm/audit_submit.3 stable/10/contrib/openbsm/libbsm/bsm_audit.c stable/10/contrib/openbsm/libbsm/bsm_class.c stable/10/contrib/openbsm/libbsm/bsm_control.c stable/10/contrib/openbsm/libbsm/bsm_domain.c stable/10/contrib/openbsm/libbsm/bsm_errno.c stable/10/contrib/openbsm/libbsm/bsm_event.c stable/10/contrib/openbsm/libbsm/bsm_fcntl.c stable/10/contrib/openbsm/libbsm/bsm_flags.c stable/10/contrib/openbsm/libbsm/bsm_io.c stable/10/contrib/openbsm/libbsm/bsm_mask.c stable/10/contrib/openbsm/libbsm/bsm_notify.c stable/10/contrib/openbsm/libbsm/bsm_socket_type.c stable/10/contrib/openbsm/libbsm/bsm_token.c stable/10/contrib/openbsm/libbsm/bsm_user.c stable/10/contrib/openbsm/libbsm/bsm_wrappers.c stable/10/contrib/openbsm/libbsm/libbsm.3 stable/10/contrib/openbsm/man/Makefile.am stable/10/contrib/openbsm/man/Makefile.in stable/10/contrib/openbsm/man/audit.2 stable/10/contrib/openbsm/man/audit.log.5 stable/10/contrib/openbsm/man/audit_class.5 stable/10/contrib/openbsm/man/audit_control.5 stable/10/contrib/openbsm/man/audit_event.5 stable/10/contrib/openbsm/man/audit_user.5 stable/10/contrib/openbsm/man/audit_warn.5 stable/10/contrib/openbsm/man/auditctl.2 stable/10/contrib/openbsm/man/auditon.2 stable/10/contrib/openbsm/man/getaudit.2 stable/10/contrib/openbsm/man/getauid.2 stable/10/contrib/openbsm/man/setaudit.2 stable/10/contrib/openbsm/man/setauid.2 stable/10/contrib/openbsm/modules/Makefile.am stable/10/contrib/openbsm/modules/auditfilter_noop/Makefile.am stable/10/contrib/openbsm/modules/auditfilter_noop/auditfilter_noop.c stable/10/contrib/openbsm/sys/Makefile.am stable/10/contrib/openbsm/sys/bsm/Makefile.am stable/10/contrib/openbsm/sys/bsm/audit.h stable/10/contrib/openbsm/sys/bsm/audit_domain.h stable/10/contrib/openbsm/sys/bsm/audit_errno.h stable/10/contrib/openbsm/sys/bsm/audit_fcntl.h stable/10/contrib/openbsm/sys/bsm/audit_internal.h stable/10/contrib/openbsm/sys/bsm/audit_kevents.h stable/10/contrib/openbsm/sys/bsm/audit_record.h stable/10/contrib/openbsm/sys/bsm/audit_socket_type.h stable/10/contrib/openbsm/test/Makefile.am stable/10/contrib/openbsm/test/bsm/Makefile.am stable/10/contrib/openbsm/test/bsm/generate.c stable/10/contrib/openbsm/tools/Makefile.am stable/10/contrib/openbsm/tools/audump.c stable/10/lib/libbsm/Makefile Directory Properties: stable/10/ (props changed) Copied: stable/10/contrib/openbsm/.travis.yml (from r292434, head/contrib/openbsm/.travis.yml) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/openbsm/.travis.yml Mon Jan 4 16:32:21 2016 (r293161, copy of r292434, head/contrib/openbsm/.travis.yml) @@ -0,0 +1,18 @@ +language: c + +compiler: + - clang + - gcc + +os: + - linux + - osx + +before_install: + - if [ $TRAVIS_OS_NAME == "linux" ]; then + sudo apt-get -qq update; + sudo apt-get -qq install byacc flex; + elif [ $TRAVIS_OS_NAME == "osx" ]; then + brew update; + brew install byacc flex; + fi Modified: stable/10/contrib/openbsm/INSTALL ============================================================================== --- stable/10/contrib/openbsm/INSTALL Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/INSTALL Mon Jan 4 16:32:21 2016 (r293161) @@ -3,7 +3,7 @@ OpenBSM Build and Installation Instructi OpenBSM is currently built using autoconf and automake, which should allow for building on a range of operating systems, including FreeBSD, Mac OS X, and Linux. Some components are built only if appropriate kernel audit -suppport is found. Typical builds will be performed using: +support is found. Typical builds will be performed using: ./configure make @@ -31,7 +31,7 @@ not configurable. You may wish to specify that the OpenBSM components not be installed in the base system, rather in a specific directory. This may be done using the --prefix argument to configure. If installing to a specific directory, -remember to update your library path so that running tools from that +remember to update your library path so that when running tools from that directory the correct libbsm is used: ./configure --prefix=/home/rwatson/openbsm Modified: stable/10/contrib/openbsm/LICENSE ============================================================================== --- stable/10/contrib/openbsm/LICENSE Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/LICENSE Mon Jan 4 16:32:21 2016 (r293161) @@ -34,5 +34,3 @@ as a whole: The TrustedBSD Project would appreciate the contribution of fixes and enhancements under an identical license in order to avoid potentially confusing license proliferation. - -$P4: //depot/projects/trustedbsd/openbsm/LICENSE#6 $ Modified: stable/10/contrib/openbsm/Makefile.am ============================================================================== --- stable/10/contrib/openbsm/Makefile.am Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/Makefile.am Mon Jan 4 16:32:21 2016 (r293161) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/Makefile.am#5 $ -## - SUBDIRS = \ bsm Modified: stable/10/contrib/openbsm/Makefile.in ============================================================================== --- stable/10/contrib/openbsm/Makefile.in Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/Makefile.in Mon Jan 4 16:32:21 2016 (r293161) @@ -59,9 +59,9 @@ DIST_COMMON = README $(am__configure_dep $(top_srcdir)/config/config.sub \ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ $(top_srcdir)/config/missing $(top_srcdir)/configure INSTALL \ - NEWS TODO config/config.guess config/config.sub config/depcomp \ - config/install-sh config/ltmain.sh config/missing \ - config/ylwrap + NEWS TODO config/compile config/config.guess config/config.sub \ + config/depcomp config/install-sh config/ltmain.sh \ + config/missing config/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ Modified: stable/10/contrib/openbsm/NEWS ============================================================================== --- stable/10/contrib/openbsm/NEWS Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/NEWS Mon Jan 4 16:32:21 2016 (r293161) @@ -1,5 +1,16 @@ OpenBSM Version History +OpenBSM 1.2 alpha 4 + +- Fix praudit to emit correct XML. +- Fix auditdistd bugs related to IPv6 support, locking, and a kqueue-related + descriptor leak. +- Add audit event definitions for Capsicum-related syscalls, as well as + AUE_BINDAT and AUE_CONNECTAT. +- Manpage symlinks for all libbsm functions are installed again after the + move to autotools in OpenBSM 1.0 Alpha 5. +- A variety of minor documentation cleanups. + OpenBSM 1.2 alpha 3 - Various minor tweaks to the auditdistd build to make it fit the FreeBSD @@ -494,5 +505,3 @@ OpenBSM 1.0 alpha 1 - auditd(8), audit(8) added to the OpenBSM distribution. auditd extended to support reloading of kernel event table. - Allow comments in /etc/security configuration files. - -$P4: //depot/projects/trustedbsd/openbsm/NEWS#55 $ Modified: stable/10/contrib/openbsm/README ============================================================================== --- stable/10/contrib/openbsm/README Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/README Mon Jan 4 16:32:21 2016 (r293161) @@ -1,4 +1,4 @@ -OpenBSM 1.2a2 +OpenBSM Introduction @@ -10,7 +10,7 @@ of several organizations. OpenBSM includes several command line tools, including auditreduce(8) and praudit(8) for reducing and printing audit trails, as well as the libbsm(3) library to manage configuration files, generate audit records, and parse and -print audit trils. +print audit trails. Coupled with a kernel audit implementation, OpenBSM can be used to maintain system audit streams, and is a foundation for a full audit-enabled system. @@ -64,5 +64,3 @@ Information on OpenBSM may be found on t Information on TrustedBSD may be found on the TrustedBSD home page: http://www.TrustedBSD.org/ - -$P4: //depot/projects/trustedbsd/openbsm/README#41 $ Modified: stable/10/contrib/openbsm/TODO ============================================================================== --- stable/10/contrib/openbsm/TODO Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/TODO Mon Jan 4 16:32:21 2016 (r293161) @@ -7,8 +7,6 @@ OpenBSM TODO - Document contents of libbsm "public" data structures in libbsm man pages. - The audit.log.5 man page is incomplete, as it does not describe all token types. -- With the move to autoconf/automake, man page symlinks are no longer - installed. This needs to be fixed. - It might be desirable to be able to provide EOPNOTSUPP system call stubs on systems that don't have the necessary audit system calls; that would allow the full libbsm and tool set to build, just not run. @@ -23,5 +21,3 @@ OpenBSM TODO not available on the local OS platform. - Support for client certificates in auditdistd, to include certificate chain validation. - -$P4: //depot/projects/trustedbsd/openbsm/TODO#14 $ Modified: stable/10/contrib/openbsm/VERSION ============================================================================== --- stable/10/contrib/openbsm/VERSION Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/VERSION Mon Jan 4 16:32:21 2016 (r293161) @@ -1 +1 @@ -OPENBSM_1_2_alpha3 +OPENBSM_1_2_alpha4 Modified: stable/10/contrib/openbsm/autogen.sh ============================================================================== --- stable/10/contrib/openbsm/autogen.sh Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/autogen.sh Mon Jan 4 16:32:21 2016 (r293161) @@ -1,7 +1,4 @@ #!/bin/sh -# -# $P4: //depot/projects/trustedbsd/openbsm/autogen.sh#2 $ -# libtoolize --copy --force aclocal Modified: stable/10/contrib/openbsm/bin/Makefile.am ============================================================================== --- stable/10/contrib/openbsm/bin/Makefile.am Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/Makefile.am Mon Jan 4 16:32:21 2016 (r293161) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/Makefile.am#4 $ -## - SUBDIRS = \ auditdistd \ auditfilterd \ Modified: stable/10/contrib/openbsm/bin/audit/Makefile.am ============================================================================== --- stable/10/contrib/openbsm/bin/audit/Makefile.am Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/audit/Makefile.am Mon Jan 4 16:32:21 2016 (r293161) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/audit/Makefile.am#7 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: stable/10/contrib/openbsm/bin/audit/audit.8 ============================================================================== --- stable/10/contrib/openbsm/bin/audit/audit.8 Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/audit/audit.8 Mon Jan 4 16:32:21 2016 (r293161) @@ -25,9 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/audit/audit.8#16 $ -.\" -.Dd January 29, 2009 +.Dd July 25, 2015 .Dt AUDIT 8 .Os .Sh NAME @@ -88,7 +86,7 @@ Audit policy file used to configure the .Xr audit 4 , .Xr audit_control 5 , .Xr auditd 8 , -.Xr launchd 8 +.Xr launchd 8 (Mac OS X) .Sh HISTORY The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc.\& in 2004. Modified: stable/10/contrib/openbsm/bin/audit/audit.c ============================================================================== --- stable/10/contrib/openbsm/bin/audit/audit.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/audit/audit.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/audit/audit.c#15 $ */ /* * Program to trigger the audit daemon with a message that is either: Modified: stable/10/contrib/openbsm/bin/auditd/Makefile.am ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/Makefile.am Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/Makefile.am Mon Jan 4 16:32:21 2016 (r293161) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/Makefile.am#6 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: stable/10/contrib/openbsm/bin/auditd/audit_triggers.defs ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/audit_triggers.defs Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/audit_triggers.defs Mon Jan 4 16:32:21 2016 (r293161) @@ -1,5 +1 @@ -/* - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/audit_triggers.defs#1 $ - */ - #include Modified: stable/10/contrib/openbsm/bin/auditd/audit_warn.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/audit_warn.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/audit_warn.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/audit_warn.c#11 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditd/auditd.8 ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/auditd.8 Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/auditd.8 Mon Jan 4 16:32:21 2016 (r293161) @@ -25,9 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#19 $ -.\" -.Dd December 11, 2008 +.Dd July 25, 2015 .Dt AUDITD 8 .Os .Sh NAME @@ -123,7 +121,7 @@ and are no longer available as arguments .Xr audit_warn 5 , .Xr audit 8 , .Xr auditdistd 8 , -.Xr launchd 8 +.Xr launchd 8 (Mac OS X) .Sh HISTORY The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc.\& in 2004. Modified: stable/10/contrib/openbsm/bin/auditd/auditd.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/auditd.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/auditd.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#50 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditd/auditd.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/auditd.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/auditd.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.h#13 $ */ #ifndef _AUDITD_H_ Modified: stable/10/contrib/openbsm/bin/auditd/auditd_control.defs ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/auditd_control.defs Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/auditd_control.defs Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_control.defs#2 $ */ /* Modified: stable/10/contrib/openbsm/bin/auditd/auditd_darwin.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/auditd_darwin.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/auditd_darwin.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_darwin.c#5 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditd/auditd_fbsd.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditd/auditd_fbsd.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditd/auditd_fbsd.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_fbsd.c#4 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/Makefile.am ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/Makefile.am Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/Makefile.am Mon Jan 4 16:32:21 2016 (r293161) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/Makefile.am#1 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: stable/10/contrib/openbsm/bin/auditdistd/auditdistd.8 ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/auditdistd.8 Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/auditdistd.8 Mon Jan 4 16:32:21 2016 (r293161) @@ -41,7 +41,7 @@ .Sh DESCRIPTION The .Nm -daemon is responsible for distributing audit trail files over TCP/IP network in +daemon is responsible for distributing audit trail files over a TCP/IP network in a secure and reliable way. .Pp The @@ -49,7 +49,7 @@ The daemon can be started with the following command line arguments: .Bl -tag -width ".Fl P Ar pidfile" .It Fl c Ar config -Specify alternative location of the configuration file. +Specify an alternative location of the configuration file. The default location is .Pa /etc/security/auditdistd.conf . Note: the configuration file may contain passwords. @@ -74,7 +74,7 @@ usage message. Start in a launchd-friendly mode, ie. do not use .Xr daemon 3 . .It Fl P Ar pidfile -Specify alternative location of a file where main process PID will be +Specify an alternative location of a file where main process PID will be stored. The default location is .Pa /var/run/auditdistd.pid . Modified: stable/10/contrib/openbsm/bin/auditdistd/auditdistd.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/auditdistd.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/auditdistd.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/auditdistd.c#3 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 Mon Jan 4 16:32:21 2016 (r293161) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 22, 2011 +.Dd July 1, 2015 .Dt AUDITDISTD.CONF 5 .Os .Sh NAME @@ -37,19 +37,21 @@ daemon. .Sh DESCRIPTION Note: the configuration file may contain passwords. -Care should be taken to configure proper permissions on this file -.Li ( eg. 0600 ) . +Care should be taken to configure proper permissions for this file +.Li ( e.g., 0600 ) . .Pp -Every line starting with # is treated as comment and ignored. +Every line starting with +.Li # +gets treated as a comment and is ignored. .Sh CONFIGURATION FILE SYNTAX -General syntax of the +The general syntax of the .Nm -file is following: -.Bd -literal -offset +file is as follows: +.Bd -literal ## Global section. # Our name. -# The default is first part of the hostname. +# The default is the first part of the hostname. name "" # Connection timeout. @@ -71,11 +73,11 @@ sender { # The default is /var/audit/dist. directory "" .\" -.\" # Checksum algorithm for data send over the wire. +.\" # Checksum algorithm for data sent over the wire. .\" # The default is none. .\" checksum "" .\" -.\" # Compression algorithm for data send over the wire. +.\" # Compression algorithm for data sent over the wire. .\" # The default is none. .\" compression "" @@ -86,7 +88,7 @@ sender { # Optional. source "" - # Address of auditdistd receiver. + # Address of the auditdistd receiver. # No default. Obligatory. remote "" @@ -95,7 +97,7 @@ sender { directory "" # Fingerprint of the receiver's public key when using TLS - # for connection. + # for connections. # Example fingerprint: # SHA256=8F:0A:FC:8A:3D:09:80:AF:D9:AA:38:CC:8A:86:53:E6:8F:B6:1C:55:30:14:D7:F9:AA:8B:3E:73:CD:F5:76:2B fingerprint "" @@ -103,37 +105,37 @@ sender { # Password used to authenticate in front of the receiver. password "" .\" -.\" # Checksum algorithm for data send over the wire. +.\" # Checksum algorithm for data sent over the wire. .\" # The default is none. .\" checksum "" .\" -.\" # Compression algorithm for data send over the wire. +.\" # Compression algorithm for data sent over the wire. .\" # The default is none. .\" compression "" } - # Currently local audit trail files can be send only to one remote + # Currently local audit trail files can be sent only to one remote # auditdistd receiver, but this can change in the future. } receiver { ## Receiver section. - # Address to listen on. Multiple listen addresses might be specified. + # Address to listen on. Multiple listen addresses may be specified. # The defaults are "tcp4://0.0.0.0:7878" and "tcp6://[::]:7878". listen "" # Base directory. - # If directory in host section is no absolute, it will be concatenated - # with this base directory. + # If the directory in the host section is not absolute, it will be + # concatenated with this base directory. # The default is "/var/audit/remote". directory "" - # Path to receiver's certificate file. + # Path to the receiver's certificate file. # The default is "/etc/security/auditdistd.cert.pem". certfile "" - # Path to receiver's private key file. + # Path to the receiver's private key file. # The default is "/etc/security/auditdistd.key.pem". keyfile "" @@ -158,7 +160,7 @@ receiver { .Ed .Pp Most of the various available configuration parameters are optional. -If parameter is not defined in the particular section, it will be +If a parameter is not defined in the particular section, it will be inherited from the parent section if possible. For example, if the .Ic source @@ -172,14 +174,14 @@ In case the section does not define the .Ic source parameter at all, the default value will be used. -.Sh CONFIGURATION FILE DESCRIPTION +.Sh CONFIGURATION OPTION DESCRIPTION The following statements are available: .Bl -tag -width ".Ic xxxx" .It Ic name Aq name .Pp This host's name. -It is send to the receiver, so it can properly recognize us if there are -more than one sender coming from the same IP address. +It is sent to the receiver, so it can properly recognize us if there are +multiple senders coming from the same IP address. .It Ic timeout Aq seconds .Pp Connection timeout in seconds. @@ -198,17 +200,17 @@ The default value is Local address to bind to before connecting to the remote .Nm auditdistd daemon. -Format is the same as for the +The format is the same as for the .Ic listen statement. .It Ic directory Aq path .Pp -Directory where to look for audit trail files in case of sender mode or -directory where to store received audit trail files. +The directory where to look for audit trail files in case of sender mode, or +the directory where to store received audit trail files. The provided path has to be an absolute path. -The only exception is when directory is provided in the +The only exception is when the directory is provided in the .Ic receiver -section, then path provided in the +section; then the path provided in the .Ic host subsections can be relative to the directory in the .Ic receiver @@ -229,13 +231,13 @@ subsections in the .Ic receiver section where .Aq name -is host's name. +is the host's name. .\".It Ic checksum Aq algorithm .\".Pp .\"Checksum algorithm should be one of the following: .\".Bl -tag -width ".Ic sha256" .\".It Ic none -.\"No checksum will be calculated for the data being send over the network. +.\"No checksum will be calculated for the data being sent over the network. .\"This is the default setting. .\".It Ic crc32 .\"CRC32 checksum will be calculated. @@ -247,30 +249,30 @@ is host's name. .\"Compression algorithm should be one of the following: .\".Bl -tag -width ".Ic none" .\".It Ic none -.\"Data send over the network will not be compressed. +.\"Data sent over the network will not be compressed. .\"This is the default setting. .\".It Ic lzf .\"The .\".Nm LZF .\"algorithm by .\".An Marc Alexander Lehmann -.\"will be used to compress the data send over the network. +.\"will be used to compress the data sent over the network. .\".Nm LZF -.\"is very fast, general purpose compression algorithm. +.\"is a very fast, general purpose compression algorithm. .\".El .It Ic remote Aq addr .Pp Address of the remote .Nm auditdistd daemon. -Format is the same as for the +The format is the same as for the .Ic listen statement. -When operating in the +When operating in .Ic sender mode this address will be used to connect to the .Ic receiver . -When operating in the +When operating in .Ic receiver mode only connections from this address will be accepted. .It Ic listen Aq addr @@ -296,21 +298,22 @@ By default listens on .Pa tcp4://0.0.0.0:7878 and -.Pa tcp6://[::]:7878 -if kernel supports IPv4 and IPv6 respectively. +.Pa tcp6://[::]:7878 , +if the kernel supports IPv4 and IPv6 respectively. .It Ic keyfile Aq path .Pp -Path to a file that contains private key for TLS communication. +Path to a file that contains the private key for TLS communication. .It Ic certfile Aq path .Pp -Path to a file that contains certificate for TLS communication. +Path to a file that contains the certificate for TLS communication. .It Ic fingerprint Aq algo=hash .Pp -Finger print of the receiver's public key. -Currently only SHA256 algorithm is supported. -Certificate public key's fingerprint ready to be pasted into auditdistd +Fingerprint of the receiver's public key. +Currently only the SHA256 algorithm is supported. +The certificate public key's fingerprint ready to be pasted into the +.Nm auditdistd configuration file can be obtained by running: -.Bd -literal -offset +.Bd -literal # openssl x509 -in /etc/security/auditdistd.cert.pem -noout -fingerprint -sha256 | awk -F '[ =]' '{printf("%s=%s\\n", $1, $3)}' .Ed .It Ic password Aq password @@ -352,10 +355,10 @@ receiver { .Ed .Sh SEE ALSO .Xr audit 4 , -.Xr auditdistd 8 . +.Xr auditdistd 8 .Sh AUTHORS The .Nm auditdistd -was developed by +daemon was developed by .An Pawel Jakub Dawidek Aq pawel@dawidek.net under sponsorship of the FreeBSD Foundation. Modified: stable/10/contrib/openbsm/bin/auditdistd/auditdistd.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/auditdistd.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/auditdistd.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/auditdistd.h#2 $ */ #ifndef _AUDITDISTD_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/faccessat.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/faccessat.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/faccessat.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/faccessat.h#1 $ */ #ifndef _FACCESSAT_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/fstatat.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/fstatat.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/fstatat.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/fstatat.h#1 $ */ #ifndef _FSTATAT_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/openat.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/openat.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/openat.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/openat.h#1 $ */ #ifndef _OPENAT_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/parse.y ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/parse.y Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/parse.y Mon Jan 4 16:32:21 2016 (r293161) @@ -26,8 +26,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/parse.y#5 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/pjdlog.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/pjdlog.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/pjdlog.c Mon Jan 4 16:32:21 2016 (r293161) @@ -26,8 +26,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/pjdlog.c#1 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/pjdlog.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/pjdlog.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/pjdlog.h Mon Jan 4 16:32:21 2016 (r293161) @@ -26,8 +26,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/pjdlog.h#1 $ */ #ifndef _PJDLOG_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/proto.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto.c#1 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/proto.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto.h#1 $ */ #ifndef _PROTO_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/proto_common.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto_common.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto_common.c Mon Jan 4 16:32:21 2016 (r293161) @@ -26,8 +26,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_common.c#1 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/proto_impl.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto_impl.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto_impl.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_impl.h#1 $ */ #ifndef _PROTO_IMPL_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/proto_socketpair.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto_socketpair.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto_socketpair.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_socketpair.c#1 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/proto_tcp.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto_tcp.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto_tcp.c Mon Jan 4 16:32:21 2016 (r293161) @@ -26,8 +26,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_tcp.c#2 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/proto_tls.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto_tls.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto_tls.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_tls.c#2 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/proto_uds.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/proto_uds.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/proto_uds.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_uds.c#2 $ */ /* UDS - UNIX Domain Socket */ Modified: stable/10/contrib/openbsm/bin/auditdistd/receiver.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/receiver.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/receiver.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/receiver.c#3 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/renameat.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/renameat.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/renameat.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/renameat.h#1 $ */ #ifndef _RENAMEAT_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/sandbox.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/sandbox.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/sandbox.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sandbox.c#3 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/sandbox.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/sandbox.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/sandbox.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sandbox.h#1 $ */ #ifndef _SANDBOX_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/sender.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/sender.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/sender.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sender.c#3 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/sigtimedwait.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/sigtimedwait.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/sigtimedwait.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sigtimedwait.h#2 $ */ #ifndef _SIGTIMEDWAIT_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/strndup.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/strndup.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/strndup.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/strndup.h#1 $ */ #ifndef _STRNDUP_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/subr.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/subr.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/subr.c Mon Jan 4 16:32:21 2016 (r293161) @@ -22,8 +22,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/subr.c#3 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/subr.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/subr.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/subr.h Mon Jan 4 16:32:21 2016 (r293161) @@ -22,8 +22,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/subr.h#1 $ */ #ifndef _AUDITDISTD_SUBR_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/synch.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/synch.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/synch.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/synch.h#3 $ */ #ifndef _SYNCH_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/token.l ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/token.l Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/token.l Mon Jan 4 16:32:21 2016 (r293161) @@ -26,8 +26,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/token.l#2 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/trail.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/trail.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/trail.c Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/trail.c#3 $ */ #include Modified: stable/10/contrib/openbsm/bin/auditdistd/trail.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/trail.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/trail.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/trail.h#1 $ */ #ifndef _AUDITDISTD_TRAIL_H_ Modified: stable/10/contrib/openbsm/bin/auditdistd/unlinkat.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditdistd/unlinkat.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditdistd/unlinkat.h Mon Jan 4 16:32:21 2016 (r293161) @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/unlinkat.h#1 $ */ #ifndef _UNLINKAT_H_ Modified: stable/10/contrib/openbsm/bin/auditfilterd/Makefile.am ============================================================================== --- stable/10/contrib/openbsm/bin/auditfilterd/Makefile.am Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditfilterd/Makefile.am Mon Jan 4 16:32:21 2016 (r293161) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/auditfilterd/Makefile.am#4 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.8 ============================================================================== --- stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.8 Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.8 Mon Jan 4 16:32:21 2016 (r293161) @@ -23,8 +23,6 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditfilterd/auditfilterd.8#6 $ -.\" .Dd October 3, 2006 .Dt AUDITFILTERD 8 .Os Modified: stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.c Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.c Mon Jan 4 16:32:21 2016 (r293161) @@ -24,8 +24,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditfilterd/auditfilterd.c#13 $ */ /* @@ -131,7 +129,7 @@ present_rawrecord(struct timespec *ts, u } /* - * Parse the BSM into a set of tokens, which will be pased to registered + * Parse the BSM into a set of tokens, which will be passed to registered * and interested filters. */ #define MAX_TOKENS 128 /* Maximum tokens we handle per record. */ Modified: stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.h ============================================================================== --- stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.h Mon Jan 4 15:50:10 2016 (r293160) +++ stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd.h Mon Jan 4 16:32:21 2016 (r293161) @@ -24,8 +24,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditfilterd/auditfilterd.h#5 $ */ #define AUDITFILTERD_CONFFILE "/etc/security/audit_filter" Modified: stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd_conf.c ============================================================================== --- stable/10/contrib/openbsm/bin/auditfilterd/auditfilterd_conf.c Mon Jan 4 15:50:10 2016 (r293160) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Mon Jan 4 16:33:55 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DA45A622D0; Mon, 4 Jan 2016 16:33:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AFFC1B2A; Mon, 4 Jan 2016 16:33:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04GXsfI060195; Mon, 4 Jan 2016 16:33:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04GXsU3060194; Mon, 4 Jan 2016 16:33:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601041633.u04GXsU3060194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 4 Jan 2016 16:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293162 - stable/10/sys/boot/amd64/efi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 16:33:55 -0000 Author: emaste Date: Mon Jan 4 16:33:54 2016 New Revision: 293162 URL: https://svnweb.freebsd.org/changeset/base/293162 Log: MFC r280351: Stop calling x86_efi_copyin and x86_efi_getdev directly In HEAD this is to help port loader.efi to both 32 and 64-bit ARM where we can use this file with minimal changes. Merged to stable/10 to simplify MFCs of later EFI commits. Modified: stable/10/sys/boot/amd64/efi/bootinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/amd64/efi/bootinfo.c ============================================================================== --- stable/10/sys/boot/amd64/efi/bootinfo.c Mon Jan 4 16:32:21 2016 (r293161) +++ stable/10/sys/boot/amd64/efi/bootinfo.c Mon Jan 4 16:33:54 2016 (r293162) @@ -114,24 +114,24 @@ bi_copyenv(vm_offset_t start) /* Traverse the environment. */ for (ep = environ; ep != NULL; ep = ep->ev_next) { len = strlen(ep->ev_name); - if (x86_efi_copyin(ep->ev_name, addr, len) != len) + if (archsw.arch_copyin(ep->ev_name, addr, len) != len) break; addr += len; - if (x86_efi_copyin("=", addr, 1) != 1) + if (archsw.arch_copyin("=", addr, 1) != 1) break; addr++; if (ep->ev_value != NULL) { len = strlen(ep->ev_value); - if (x86_efi_copyin(ep->ev_value, addr, len) != len) + if (archsw.arch_copyin(ep->ev_value, addr, len) != len) break; addr += len; } - if (x86_efi_copyin("", addr, 1) != 1) + if (archsw.arch_copyin("", addr, 1) != 1) break; last = ++addr; } - if (x86_efi_copyin("", last++, 1) != 1) + if (archsw.arch_copyin("", last++, 1) != 1) last = start; return(last); } @@ -155,7 +155,7 @@ bi_copyenv(vm_offset_t start) #define COPY32(v, a, c) { \ uint32_t x = (v); \ if (c) \ - x86_efi_copyin(&x, a, sizeof(x)); \ + archsw.arch_copyin(&x, a, sizeof(x)); \ a += sizeof(x); \ } @@ -163,8 +163,8 @@ bi_copyenv(vm_offset_t start) COPY32(t, a, c); \ COPY32(strlen(s) + 1, a, c); \ if (c) \ - x86_efi_copyin(s, a, strlen(s) + 1); \ - a += roundup(strlen(s) + 1, sizeof(uint64_t)); \ + archsw.arch_copyin(s, a, strlen(s) + 1); \ + a += roundup(strlen(s) + 1, sizeof(u_long)); \ } #define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) @@ -175,8 +175,8 @@ bi_copyenv(vm_offset_t start) COPY32(t, a, c); \ COPY32(sizeof(s), a, c); \ if (c) \ - x86_efi_copyin(&s, a, sizeof(s)); \ - a += roundup(sizeof(s), sizeof(uint64_t)); \ + archsw.arch_copyin(&s, a, sizeof(s)); \ + a += roundup(sizeof(s), sizeof(u_long)); \ } #define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) @@ -186,8 +186,8 @@ bi_copyenv(vm_offset_t start) COPY32(MODINFO_METADATA | mm->md_type, a, c); \ COPY32(mm->md_size, a, c); \ if (c) \ - x86_efi_copyin(mm->md_data, a, mm->md_size); \ - a += roundup(mm->md_size, sizeof(uint64_t)); \ + archsw.arch_copyin(mm->md_data, a, mm->md_size); \ + a += roundup(mm->md_size, sizeof(u_long)); \ } #define MOD_END(a, c) { \ @@ -315,7 +315,7 @@ bi_load(char *args, vm_offset_t *modulep * tested/set by MI code before launching the kernel. */ rootdevname = getenv("rootdev"); - x86_efi_getdev((void**)(&rootdev), rootdevname, NULL); + archsw.arch_getdev((void**)(&rootdev), rootdevname, NULL); if (rootdev == NULL) { printf("Can't determine root device.\n"); return(EINVAL); From owner-svn-src-stable-10@freebsd.org Mon Jan 4 16:51:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E575A62956; Mon, 4 Jan 2016 16:51:59 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1D521A2D; Mon, 4 Jan 2016 16:51:58 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04GpvZu066101; Mon, 4 Jan 2016 16:51:57 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04Gpuc5066087; Mon, 4 Jan 2016 16:51:56 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201601041651.u04Gpuc5066087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 4 Jan 2016 16:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293163 - in stable/10/sys: bsm security/audit X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 16:51:59 -0000 Author: brueffer Date: Mon Jan 4 16:51:56 2016 New Revision: 293163 URL: https://svnweb.freebsd.org/changeset/base/293163 Log: MFH: r292522 Merge from contrib/openbsm to bring the kernel audit bits up to date with OpenBSM 1.2 alpha 4: - remove $P4$ - fix a comment Modified: stable/10/sys/bsm/audit.h stable/10/sys/bsm/audit_domain.h stable/10/sys/bsm/audit_errno.h stable/10/sys/bsm/audit_fcntl.h stable/10/sys/bsm/audit_internal.h stable/10/sys/bsm/audit_kevents.h stable/10/sys/bsm/audit_record.h stable/10/sys/bsm/audit_socket_type.h stable/10/sys/security/audit/bsm_domain.c stable/10/sys/security/audit/bsm_errno.c stable/10/sys/security/audit/bsm_fcntl.c stable/10/sys/security/audit/bsm_socket_type.c stable/10/sys/security/audit/bsm_token.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/bsm/audit.h ============================================================================== --- stable/10/sys/bsm/audit.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit.h Mon Jan 4 16:51:56 2016 (r293163) @@ -26,7 +26,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit.h#10 * $FreeBSD$ */ Modified: stable/10/sys/bsm/audit_domain.h ============================================================================== --- stable/10/sys/bsm/audit_domain.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit_domain.h Mon Jan 4 16:51:56 2016 (r293163) @@ -26,7 +26,6 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_domain.h#2 * $FreeBSD$ */ Modified: stable/10/sys/bsm/audit_errno.h ============================================================================== --- stable/10/sys/bsm/audit_errno.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit_errno.h Mon Jan 4 16:51:56 2016 (r293163) @@ -26,7 +26,6 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_errno.h#7 * $FreeBSD$ */ Modified: stable/10/sys/bsm/audit_fcntl.h ============================================================================== --- stable/10/sys/bsm/audit_fcntl.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit_fcntl.h Mon Jan 4 16:51:56 2016 (r293163) @@ -26,7 +26,6 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_fcntl.h#2 * $FreeBSD$ */ Modified: stable/10/sys/bsm/audit_internal.h ============================================================================== --- stable/10/sys/bsm/audit_internal.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit_internal.h Mon Jan 4 16:51:56 2016 (r293163) @@ -30,7 +30,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_internal.h#6 * $FreeBSD$ */ Modified: stable/10/sys/bsm/audit_kevents.h ============================================================================== --- stable/10/sys/bsm/audit_kevents.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit_kevents.h Mon Jan 4 16:51:56 2016 (r293163) @@ -26,7 +26,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_kevents.h#7 * $FreeBSD$ */ @@ -34,7 +33,7 @@ #define _BSM_AUDIT_KEVENTS_H_ /* - * The reserved event numbers for kernel events are 1...2047 and 43001..44900. + * The reserved event numbers for kernel events are 1...2047 and 43001..44999. */ #define AUE_IS_A_KEVENT(e) (((e) > 0 && (e) < 2048) || \ ((e) > 43000 && (e) < 45000)) Modified: stable/10/sys/bsm/audit_record.h ============================================================================== --- stable/10/sys/bsm/audit_record.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit_record.h Mon Jan 4 16:51:56 2016 (r293163) @@ -26,7 +26,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_record.h#10 * $FreeBSD$ */ Modified: stable/10/sys/bsm/audit_socket_type.h ============================================================================== --- stable/10/sys/bsm/audit_socket_type.h Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/bsm/audit_socket_type.h Mon Jan 4 16:51:56 2016 (r293163) @@ -26,7 +26,6 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_socket_type.h#1 * $FreeBSD$ */ Modified: stable/10/sys/security/audit/bsm_domain.c ============================================================================== --- stable/10/sys/security/audit/bsm_domain.c Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/security/audit/bsm_domain.c Mon Jan 4 16:51:56 2016 (r293163) @@ -25,8 +25,6 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_domain.c#3 */ #include Modified: stable/10/sys/security/audit/bsm_errno.c ============================================================================== --- stable/10/sys/security/audit/bsm_errno.c Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/security/audit/bsm_errno.c Mon Jan 4 16:51:56 2016 (r293163) @@ -25,8 +25,6 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#22 */ #include Modified: stable/10/sys/security/audit/bsm_fcntl.c ============================================================================== --- stable/10/sys/security/audit/bsm_fcntl.c Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/security/audit/bsm_fcntl.c Mon Jan 4 16:51:56 2016 (r293163) @@ -25,8 +25,6 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_fcntl.c#2 */ #include Modified: stable/10/sys/security/audit/bsm_socket_type.c ============================================================================== --- stable/10/sys/security/audit/bsm_socket_type.c Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/security/audit/bsm_socket_type.c Mon Jan 4 16:51:56 2016 (r293163) @@ -25,8 +25,6 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_socket_type.c#1 */ #include Modified: stable/10/sys/security/audit/bsm_token.c ============================================================================== --- stable/10/sys/security/audit/bsm_token.c Mon Jan 4 16:33:54 2016 (r293162) +++ stable/10/sys/security/audit/bsm_token.c Mon Jan 4 16:51:56 2016 (r293163) @@ -29,8 +29,6 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#99 */ #include From owner-svn-src-stable-10@freebsd.org Mon Jan 4 20:05:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AE89A6215A; Mon, 4 Jan 2016 20:05:42 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE8191B27; Mon, 4 Jan 2016 20:05:41 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04K5eHd027378; Mon, 4 Jan 2016 20:05:40 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04K5evA027370; Mon, 4 Jan 2016 20:05:40 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201601042005.u04K5evA027370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 4 Jan 2016 20:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293174 - in stable/10: contrib/bmake contrib/bmake/mk usr.bin/bmake X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 20:05:42 -0000 Author: sjg Date: Mon Jan 4 20:05:40 2016 New Revision: 293174 URL: https://svnweb.freebsd.org/changeset/base/293174 Log: bmake 20151220 Modified: stable/10/contrib/bmake/ChangeLog stable/10/contrib/bmake/Makefile stable/10/contrib/bmake/mk/ChangeLog stable/10/contrib/bmake/mk/auto.obj.mk stable/10/contrib/bmake/mk/install-mk stable/10/contrib/bmake/os.sh stable/10/contrib/bmake/suff.c stable/10/usr.bin/bmake/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bmake/ChangeLog ============================================================================== --- stable/10/contrib/bmake/ChangeLog Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/contrib/bmake/ChangeLog Mon Jan 4 20:05:40 2016 (r293174) @@ -1,3 +1,9 @@ +2015-12-20 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151220 + Merge with NetBSD make, pick up + o suff.c: re-initialize suffNull when clearing suffixes. + 2015-12-01 Simon J. Gerraty * Makefile (MAKE_VERSION): 20151201 Modified: stable/10/contrib/bmake/Makefile ============================================================================== --- stable/10/contrib/bmake/Makefile Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/contrib/bmake/Makefile Mon Jan 4 20:05:40 2016 (r293174) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.48 2015/12/02 00:36:42 sjg Exp $ +# $Id: Makefile,v 1.49 2015/12/20 22:54:40 sjg Exp $ # Base version on src date -MAKE_VERSION= 20151201 +MAKE_VERSION= 20151220 PROG= bmake Modified: stable/10/contrib/bmake/mk/ChangeLog ============================================================================== --- stable/10/contrib/bmake/mk/ChangeLog Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/contrib/bmake/mk/ChangeLog Mon Jan 4 20:05:40 2016 (r293174) @@ -1,3 +1,9 @@ +2015-12-12 Simon J. Gerraty + + * install-mk (MK_VERSION): 20151212 + * auto.obj.mk: do not require MAKEOBJDIRPREFIX to exist. + only apply :tA to __objdir when comparing to .OBJDIR + 2015-11-14 Simon J. Gerraty * install-mk (MK_VERSION): 20151111 Modified: stable/10/contrib/bmake/mk/auto.obj.mk ============================================================================== --- stable/10/contrib/bmake/mk/auto.obj.mk Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/contrib/bmake/mk/auto.obj.mk Mon Jan 4 20:05:40 2016 (r293174) @@ -1,4 +1,4 @@ -# $Id: auto.obj.mk,v 1.11 2015/06/16 06:28:21 sjg Exp $ +# $Id: auto.obj.mk,v 1.12 2015/12/16 01:57:06 sjg Exp $ # # @(#) Copyright (c) 2004, Simon J. Gerraty # @@ -40,12 +40,12 @@ MKOBJDIRS= auto .if !defined(NOOBJ) && !defined(NO_OBJ) && ${MKOBJDIRS:Uno} == auto # Use __objdir here so it is easier to tweak without impacting # the logic. -.if !empty(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}) +.if !empty(MAKEOBJDIRPREFIX) __objdir?= ${MAKEOBJDIRPREFIX}${.CURDIR} .endif __objdir?= ${MAKEOBJDIR:Uobj} -__objdir:= ${__objdir:tA} -.if ${.OBJDIR} != ${__objdir} +__objdir:= ${__objdir} +.if ${.OBJDIR:tA} != ${__objdir:tA} # We need to chdir, make the directory if needed .if !exists(${__objdir}/) && \ (${.TARGETS} == "" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} != "") @@ -53,11 +53,10 @@ __objdir:= ${__objdir:tA} __objdir_made != echo ${__objdir}/; umask ${OBJDIR_UMASK:U002}; \ ${ECHO_TRACE} "[Creating objdir ${__objdir}...]" >&2; \ ${Mkdirs}; Mkdirs ${__objdir} -__objdir:= ${__objdir:tA} .endif # This causes make to use the specified directory as .OBJDIR .OBJDIR: ${__objdir} -.if ${.OBJDIR} != ${__objdir} && ${__objdir_made:Uno:M${__objdir}/*} != "" +.if ${.OBJDIR:tA} != ${__objdir:tA} && ${__objdir_made:Uno:M${__objdir}/*} != "" .error could not use ${__objdir}: .OBJDIR=${.OBJDIR} .endif .endif Modified: stable/10/contrib/bmake/mk/install-mk ============================================================================== --- stable/10/contrib/bmake/mk/install-mk Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/contrib/bmake/mk/install-mk Mon Jan 4 20:05:40 2016 (r293174) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.117 2015/11/14 18:09:57 sjg Exp $ +# $Id: install-mk,v 1.118 2015/12/16 01:57:06 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20151111 +MK_VERSION=20151212 OWNER= GROUP= MODE=444 Modified: stable/10/contrib/bmake/os.sh ============================================================================== --- stable/10/contrib/bmake/os.sh Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/contrib/bmake/os.sh Mon Jan 4 20:05:40 2016 (r293174) @@ -17,7 +17,7 @@ # Simon J. Gerraty # RCSid: -# $Id: os.sh,v 1.49 2015/10/25 00:05:40 sjg Exp $ +# $Id: os.sh,v 1.50 2015/12/17 17:06:29 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -56,10 +56,10 @@ Which() { case "$1" in /*) test $t $1 && echo $1;; *) - # some shells cannot correctly handle `IFS` - # in conjunction with the for loop. - _dirs=`IFS=:; echo ${2:-$PATH}` - for d in $_dirs + # some shells cannot correctly handle `IFS` + # in conjunction with the for loop. + _dirs=`IFS=:; echo ${2:-$PATH}` + for d in $_dirs do test $t $d/$1 && { echo $d/$1; break; } done @@ -70,11 +70,11 @@ Which() { # tr is insanely non-portable wrt char classes, so we need to # spell out the alphabet. sed y/// would work too. toUpper() { - ${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ + ${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ } toLower() { - ${TR:-tr} ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz + ${TR:-tr} ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz } K= @@ -91,7 +91,7 @@ SunOS) export CHOWN # Great! Solaris keeps moving arch(1) - # should just bite the bullet and use uname -p + # should just bite the bullet and use uname -p arch=`Which arch /usr/bin:/usr/ucb` MAILER=/usr/ucb/Mail @@ -105,8 +105,8 @@ SunOS) MACHINE=$MACHINE_ARCH ;; 4*) - MACHINE_ARCH=`arch` - ;; + MACHINE_ARCH=`arch` + ;; 5*) K=-k LOCAL_FS=ufs @@ -116,8 +116,8 @@ SunOS) # overwriting an existing file!!!!! We want one that works! test -x /usr/xpg4/bin/ln && LN=${LN:-/usr/xpg4/bin/ln} # wonderful, 5.8's tr again require's []'s - # but /usr/xpg4/bin/tr causes problems if LC_COLLATE is set! - # use toUpper/toLower instead. + # but /usr/xpg4/bin/tr causes problems if LC_COLLATE is set! + # use toUpper/toLower instead. ;; esac case "$OS/$MACHINE_ARCH" in @@ -142,9 +142,9 @@ SunOS) SHARE_ARCH=$OS/$HOST ;; OpenBSD) - arch=`Which arch /usr/bin:/usr/ucb:$PATH` - MACHINE_ARCH=`$arch -s` - ;; + arch=`Which arch /usr/bin:/usr/ucb:$PATH` + MACHINE_ARCH=`$arch -s` + ;; esac NAWK=awk export NAWK @@ -218,17 +218,25 @@ export HOST_TARGET case `echo -n .` in -n*) N=; C="\c";; *) N=-n; C=;; esac -export HOSTNAME HOST +Echo() { + case "$1" in + -n) _n=$N _c=$C; shift;; + *) _n= _c=;; + esac + echo $_n "$@" $_c +} + +export HOSTNAME HOST export OS MACHINE MACHINE_ARCH OSREL OSMAJOR LOCAL_FS TMP_DIRS MAILER N C K PS_AXC export LN SHARE_ARCH TR case /$0 in */os.sh) - for v in $* + for v in $* do - eval vv=\$$v - echo "$v='$vv'" + eval vv=\$$v + echo "$v='$vv'" done - ;; + ;; esac Modified: stable/10/contrib/bmake/suff.c ============================================================================== --- stable/10/contrib/bmake/suff.c Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/contrib/bmake/suff.c Mon Jan 4 20:05:40 2016 (r293174) @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $"); +__RCSID("$NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -553,7 +553,20 @@ Suff_ClearSuffixes(void) #endif sufflist = Lst_Init(FALSE); sNum = 0; - suffNull = emptySuff; + if (suffNull) + SuffFree(suffNull); + emptySuff = suffNull = bmake_malloc(sizeof(Suff)); + + suffNull->name = bmake_strdup(""); + suffNull->nameLen = 0; + suffNull->searchPath = Lst_Init(FALSE); + Dir_Concat(suffNull->searchPath, dirSearchPath); + suffNull->children = Lst_Init(FALSE); + suffNull->parents = Lst_Init(FALSE); + suffNull->ref = Lst_Init(FALSE); + suffNull->sNum = sNum++; + suffNull->flags = SUFF_NULL; + suffNull->refCount = 1; } /*- @@ -2524,32 +2537,18 @@ Suff_SetNull(char *name) void Suff_Init(void) { - sufflist = Lst_Init(FALSE); #ifdef CLEANUP suffClean = Lst_Init(FALSE); #endif srclist = Lst_Init(FALSE); transforms = Lst_Init(FALSE); - sNum = 0; /* * Create null suffix for single-suffix rules (POSIX). The thing doesn't * actually go on the suffix list or everyone will think that's its * suffix. */ - emptySuff = suffNull = bmake_malloc(sizeof(Suff)); - - suffNull->name = bmake_strdup(""); - suffNull->nameLen = 0; - suffNull->searchPath = Lst_Init(FALSE); - Dir_Concat(suffNull->searchPath, dirSearchPath); - suffNull->children = Lst_Init(FALSE); - suffNull->parents = Lst_Init(FALSE); - suffNull->ref = Lst_Init(FALSE); - suffNull->sNum = sNum++; - suffNull->flags = SUFF_NULL; - suffNull->refCount = 1; - + Suff_ClearSuffixes(); } Modified: stable/10/usr.bin/bmake/Makefile ============================================================================== --- stable/10/usr.bin/bmake/Makefile Mon Jan 4 19:38:44 2016 (r293173) +++ stable/10/usr.bin/bmake/Makefile Mon Jan 4 20:05:40 2016 (r293174) @@ -14,10 +14,10 @@ CFLAGS+= -I${.CURDIR} CLEANDIRS+= FreeBSD CLEANFILES+= bootstrap -# $Id: Makefile,v 1.48 2015/12/02 00:36:42 sjg Exp $ +# $Id: Makefile,v 1.49 2015/12/20 22:54:40 sjg Exp $ # Base version on src date -MAKE_VERSION= 20151201 +MAKE_VERSION= 20151220 PROG?= ${.CURDIR:T} From owner-svn-src-stable-10@freebsd.org Tue Jan 5 03:22:11 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CA40A6107E; Tue, 5 Jan 2016 03:22:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BA321723; Tue, 5 Jan 2016 03:22:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u053MAGd055282; Tue, 5 Jan 2016 03:22:10 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u053MAO2055281; Tue, 5 Jan 2016 03:22:10 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601050322.u053MAO2055281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 5 Jan 2016 03:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293189 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 03:22:11 -0000 Author: glebius Date: Tue Jan 5 03:22:10 2016 New Revision: 293189 URL: https://svnweb.freebsd.org/changeset/base/293189 Log: Merge from head r287357-287358,287400: Not only build with buildworld, but also install with installworld all alternative kernels. Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Tue Jan 5 03:20:45 2016 (r293188) +++ stable/10/Makefile.inc1 Tue Jan 5 03:22:10 2016 (r293189) @@ -1102,6 +1102,16 @@ reinstallkernel reinstallkernel.debug: _ cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} +.if ${BUILDKERNELS:[#]} > 1 +.for _kernel in ${BUILDKERNELS:[2..-1]} + @echo "--------------------------------------------------------------" + @echo ">>> Installing kernel ${_kernel}" + @echo "--------------------------------------------------------------" + cd ${KRNLOBJDIR}/${_kernel}; \ + ${CROSSENV} PATH=${TMPPATH} \ + ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//} +.endfor +.endif distributekernel distributekernel.debug: .if empty(INSTALLKERNEL) @@ -1121,7 +1131,8 @@ distributekernel distributekernel.debug: sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \ ${DESTDIR}/${DISTDIR}/kernel.meta .endif -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.if ${BUILDKERNELS:[#]} > 1 +.for _kernel in ${BUILDKERNELS:[2..-1]} .if defined(NO_ROOT) echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta .endif @@ -1137,27 +1148,32 @@ distributekernel distributekernel.debug: ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta .endif .endfor +.endif packagekernel: .if defined(NO_ROOT) cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.if ${BUILDKERNELS:[#]} > 1 +.for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz .endfor +.endif .else cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - . | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz -.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} +.if ${BUILDKERNELS:[#]} > 1 +.for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - . | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz .endfor .endif +.endif # # doxygen From owner-svn-src-stable-10@freebsd.org Tue Jan 5 05:38:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4678A62093; Tue, 5 Jan 2016 05:38:07 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8358E1343; Tue, 5 Jan 2016 05:38:07 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by mail-ig0-x235.google.com with SMTP id to18so6246401igc.0; Mon, 04 Jan 2016 21:38:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=kFmyVvfpOutgLSO/u4gGnEDGz22QhbLtWhs7Yy/yUPs=; b=H254qbUeqWFvlVZGuHJhPmKca3NEZwA5K/mcuqelnInll8n042E2SPoF1HemivKASv fGxziZB5tcnHYxw+D+7V4raU/xMzmzxCHThNVhieQ/5bZKDZHzkFepsKvIbJlPEFUFaf 8e//6QFojZHUVPT5dhN4nd5QX1dPadvn1VMybLc71jCpensD4HrMThQFB0hyldPjk2KU CB/1R1qz+YVxvBCcG88QsoZDkdV8tAdu8Hp8279+WjfKieMjaOWeezjycddbk1Y5nWnd xBqWFzm7ojt0gOTD9O1ibnrRPCAHMrnxMd6SZjjIZjZu/KZcL7L0RAdEJKZFh1JQJJFX y7jg== MIME-Version: 1.0 X-Received: by 10.50.36.74 with SMTP id o10mr1892793igj.73.1451972286918; Mon, 04 Jan 2016 21:38:06 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.50.152.69 with HTTP; Mon, 4 Jan 2016 21:38:06 -0800 (PST) In-Reply-To: <201501202339.t0KNd9J6007337@svn.freebsd.org> References: <201501202339.t0KNd9J6007337@svn.freebsd.org> Date: Tue, 5 Jan 2016 00:38:06 -0500 X-Google-Sender-Auth: U8v-uhDkSawXo1m0Wn6MUxgE_X8 Message-ID: Subject: Re: svn commit: r277457 - in stable/10: . etc etc/mtree tools/build/mk From: Craig Rodrigues To: Garrett Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 05:38:07 -0000 On Tue, Jan 20, 2015 at 6:39 PM, Garrett Cooper wrote: > Author: ngie > Date: Tue Jan 20 23:39:08 2015 > New Revision: 277457 > URL: https://svnweb.freebsd.org/changeset/base/277457 > > Log: > MFC r275907: > > r275907 (by ngie): > > Fix building/installing tests when TESTSBASE != /usr/tests > > This merge is botched. Can you fix this? mtree is now creating these directories under /usr/tests/sys which is wrong, and causing "installworld" to fail if src.conf contains WITH_TESTS="yes" usr/tests/sys/usr.sbin usr/tests/sys/usr.sbin/sa usr/tests/sys/usr.sbin/pw usr/tests/sys/usr.sbin/fstyp usr/tests/sys/usr.sbin/nmtree usr/tests/sys/usr.sbin/newsyslog usr/tests/sys/usr.sbin/etcupdate usr/tests/sys/usr.sbin/makefs usr/tests/sys/usr.bin usr/tests/sys/usr.bin/tar usr/tests/sys/usr.bin/cut usr/tests/sys/usr.bin/comm usr/tests/sys/usr.bin/col usr/tests/sys/usr.bin/cpio usr/tests/sys/usr.bin/file2c usr/tests/sys/usr.bin/uudecode usr/tests/sys/usr.bin/truncate usr/tests/sys/usr.bin/cmp usr/tests/sys/usr.bin/m4 usr/tests/sys/usr.bin/grep usr/tests/sys/usr.bin/timeout usr/tests/sys/usr.bin/lastcomm usr/tests/sys/usr.bin/ncal usr/tests/sys/usr.bin/yacc usr/tests/sys/usr.bin/yacc/yacc usr/tests/sys/usr.bin/join usr/tests/sys/usr.bin/bmake usr/tests/sys/usr.bin/bmake/basic usr/tests/sys/usr.bin/bmake/basic/t3 usr/tests/sys/usr.bin/bmake/basic/t0 usr/tests/sys/usr.bin/bmake/basic/t2 usr/tests/sys/usr.bin/bmake/basic/t1 usr/tests/sys/usr.bin/bmake/shell usr/tests/sys/usr.bin/bmake/shell/select usr/tests/sys/usr.bin/bmake/shell/meta usr/tests/sys/usr.bin/bmake/shell/path usr/tests/sys/usr.bin/bmake/shell/path_select usr/tests/sys/usr.bin/bmake/shell/builtin usr/tests/sys/usr.bin/bmake/shell/replace usr/tests/sys/usr.bin/bmake/sysmk usr/tests/sys/usr.bin/bmake/sysmk/t1 usr/tests/sys/usr.bin/bmake/sysmk/t1/2 usr/tests/sys/usr.bin/bmake/sysmk/t1/2/1 usr/tests/sys/usr.bin/bmake/sysmk/t1/mk usr/tests/sys/usr.bin/bmake/sysmk/t2 usr/tests/sys/usr.bin/bmake/sysmk/t2/mk usr/tests/sys/usr.bin/bmake/sysmk/t2/2 usr/tests/sys/usr.bin/bmake/sysmk/t2/2/1 usr/tests/sys/usr.bin/bmake/sysmk/t0 usr/tests/sys/usr.bin/bmake/sysmk/t0/mk usr/tests/sys/usr.bin/bmake/sysmk/t0/2 usr/tests/sys/usr.bin/bmake/sysmk/t0/2/1 usr/tests/sys/usr.bin/bmake/variables usr/tests/sys/usr.bin/bmake/variables/modifier_t usr/tests/sys/usr.bin/bmake/variables/opt_V usr/tests/sys/usr.bin/bmake/variables/t0 usr/tests/sys/usr.bin/bmake/variables/modifier_M usr/tests/sys/usr.bin/bmake/archives usr/tests/sys/usr.bin/bmake/archives/fmt_oldbsd usr/tests/sys/usr.bin/bmake/archives/fmt_44bsd_mod usr/tests/sys/usr.bin/bmake/archives/fmt_44bsd usr/tests/sys/usr.bin/bmake/suffixes usr/tests/sys/usr.bin/bmake/suffixes/basic usr/tests/sys/usr.bin/bmake/suffixes/src_wild2 usr/tests/sys/usr.bin/bmake/suffixes/src_wild1 usr/tests/sys/usr.bin/bmake/execution usr/tests/sys/usr.bin/bmake/execution/plus usr/tests/sys/usr.bin/bmake/execution/ellipsis usr/tests/sys/usr.bin/bmake/execution/joberr usr/tests/sys/usr.bin/bmake/execution/empty usr/tests/sys/usr.bin/bmake/syntax usr/tests/sys/usr.bin/bmake/syntax/enl usr/tests/sys/usr.bin/bmake/syntax/funny-targets usr/tests/sys/usr.bin/bmake/syntax/directive-t0 usr/tests/sys/usr.bin/bmake/syntax/semi usr/tests/sys/usr.bin/sed usr/tests/sys/usr.bin/sed/regress.multitest.out usr/tests/sys/usr.bin/apply usr/tests/sys/usr.bin/opensm usr/tests/sys/usr.bin/calendar usr/tests/sys/usr.bin/limits usr/tests/sys/usr.bin/jot usr/tests/sys/usr.bin/tr usr/tests/sys/usr.bin/printf usr/tests/sys/usr.bin/dirname usr/tests/sys/usr.bin/xargs usr/tests/sys/usr.bin/uuencode usr/tests/sys/usr.bin/gzip usr/tests/sys/usr.bin/basename -- Craig From owner-svn-src-stable-10@freebsd.org Tue Jan 5 08:10:08 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49AFDA61A9D; Tue, 5 Jan 2016 08:10:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1831B15FC; Tue, 5 Jan 2016 08:10:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u058A7qb038758; Tue, 5 Jan 2016 08:10:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u058A7gb038757; Tue, 5 Jan 2016 08:10:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601050810.u058A7gb038757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 5 Jan 2016 08:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293191 - stable/10/etc/mtree X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 08:10:08 -0000 Author: ngie Date: Tue Jan 5 08:10:06 2016 New Revision: 293191 URL: https://svnweb.freebsd.org/changeset/base/293191 Log: Add `..` after sys/kern/pipe entry accidentally missed in r291183 This is a direct commit to stable/10 Pointyhat to: ngie Reported by: rodrigc Sponsored by: EMC / Isilon Storage Division Modified: stable/10/etc/mtree/BSD.tests.dist Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Tue Jan 5 05:25:16 2016 (r293190) +++ stable/10/etc/mtree/BSD.tests.dist Tue Jan 5 08:10:06 2016 (r293191) @@ -210,6 +210,7 @@ execve .. pipe + .. .. kqueue .. From owner-svn-src-stable-10@freebsd.org Tue Jan 5 08:11:28 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45AE2A61B1D; Tue, 5 Jan 2016 08:11:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ob0-x243.google.com (mail-ob0-x243.google.com [IPv6:2607:f8b0:4003:c01::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FE4619BD; Tue, 5 Jan 2016 08:11:28 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ob0-x243.google.com with SMTP id q2so23123215obl.1; Tue, 05 Jan 2016 00:11:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=n4SnSQ/FmpM7bEjEChQAw0OXsd4sSW5+AVLkCpSo5qo=; b=TRsUUztDRMavGDdRXvdsWBUSoBN/RDDCDTFOcCIEF2vNIudTmHlGx5MnwmT1dsMKMh +1hWLt9q2QXr32ogbDP62p5VtlH62xtEPwpbezfcgMF75VWJqWnTs3NXmi1b9B5hRnHr heh8rFJ+ZA1Ocg1UpKkeZGui7uZZEq+bGA6ba3FugFZFYg8j5ck3A1UVMmPzgVpOUTJD iE8jNECb0BhPOHS0Kb0sNY+L1pf0CxqsvZm0BxuavCK67xxLHzlSq19xWEAypfieE952 OVYGSf0fu4aFCSyimH/HiSjw/8+DGwBLMMOcegO07ZRiJwf3CiCdx8qhoSajkPTTT7rf vLWQ== X-Received: by 10.60.51.70 with SMTP id i6mr65963524oeo.3.1451981487400; Tue, 05 Jan 2016 00:11:27 -0800 (PST) Received: from [192.168.20.7] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id r84sm33364965oig.0.2016.01.05.00.11.25 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jan 2016 00:11:25 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r277457 - in stable/10: . etc etc/mtree tools/build/mk From: NGie Cooper In-Reply-To: Date: Tue, 5 Jan 2016 00:11:23 -0800 Cc: Garrett Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <76274015-66CE-40EA-A07B-084552119C21@gmail.com> References: <201501202339.t0KNd9J6007337@svn.freebsd.org> To: Craig Rodrigues X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 08:11:28 -0000 > On Jan 4, 2016, at 21:38, Craig Rodrigues wrote: >=20 > On Tue, Jan 20, 2015 at 6:39 PM, Garrett Cooper = wrote: > Author: ngie > Date: Tue Jan 20 23:39:08 2015 > New Revision: 277457 > URL: https://svnweb.freebsd.org/changeset/base/277457 >=20 > Log: > MFC r275907: >=20 > r275907 (by ngie): >=20 > Fix building/installing tests when TESTSBASE !=3D /usr/tests >=20 >=20 >=20 > This merge is botched. Can you fix this? >=20 > mtree is now creating these directories under /usr/tests/sys which is = wrong, and causing "installworld" to fail if > src.conf contains WITH_TESTS=3D"yes" It wasn=E2=80=99t the merge that created the problem=E2=80=A6 = the real problem was committed in r291183. I=E2=80=99ve fixed it in = r293191. Thanks for the report (and sorry for the mistake :(=E2=80=A6). -NGie= From owner-svn-src-stable-10@freebsd.org Tue Jan 5 13:05:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53846A6234C; Tue, 5 Jan 2016 13:05:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2139E1250; Tue, 5 Jan 2016 13:05:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05D5dZX027732; Tue, 5 Jan 2016 13:05:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05D5dWV027730; Tue, 5 Jan 2016 13:05:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601051305.u05D5dWV027730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 5 Jan 2016 13:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293195 - in stable/10/sys/x86: include x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 13:05:40 -0000 Author: kib Date: Tue Jan 5 13:05:38 2016 New Revision: 293195 URL: https://svnweb.freebsd.org/changeset/base/293195 Log: MFC r292890: Add standard extended feature bit 6 from the Intel SDM rev. 57. Modified: stable/10/sys/x86/include/specialreg.h stable/10/sys/x86/x86/identcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/include/specialreg.h ============================================================================== --- stable/10/sys/x86/include/specialreg.h Tue Jan 5 12:22:45 2016 (r293194) +++ stable/10/sys/x86/include/specialreg.h Tue Jan 5 13:05:38 2016 (r293195) @@ -334,6 +334,7 @@ #define CPUID_STDEXT_BMI1 0x00000008 #define CPUID_STDEXT_HLE 0x00000010 #define CPUID_STDEXT_AVX2 0x00000020 +#define CPUID_STDEXT_FDP_EXC 0x00000040 #define CPUID_STDEXT_SMEP 0x00000080 #define CPUID_STDEXT_BMI2 0x00000100 #define CPUID_STDEXT_ERMS 0x00000200 Modified: stable/10/sys/x86/x86/identcpu.c ============================================================================== --- stable/10/sys/x86/x86/identcpu.c Tue Jan 5 12:22:45 2016 (r293194) +++ stable/10/sys/x86/x86/identcpu.c Tue Jan 5 13:05:38 2016 (r293195) @@ -894,6 +894,8 @@ printcpuinfo(void) "\005HLE" /* Advanced Vector Instructions 2 */ "\006AVX2" + /* FDP_EXCPTN_ONLY */ + "\007FDPEXC" /* Supervisor Mode Execution Prot. */ "\010SMEP" /* Bit Manipulation Instructions */ From owner-svn-src-stable-10@freebsd.org Tue Jan 5 16:58:09 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34F43A63C5D; Tue, 5 Jan 2016 16:58:09 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 057CD1778; Tue, 5 Jan 2016 16:58:08 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05Gw8kX096726; Tue, 5 Jan 2016 16:58:08 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05Gw8pl096725; Tue, 5 Jan 2016 16:58:08 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201601051658.u05Gw8pl096725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Tue, 5 Jan 2016 16:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293208 - stable/10/sbin/route X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 16:58:09 -0000 Author: rstone Date: Tue Jan 5 16:58:07 2016 New Revision: 293208 URL: https://svnweb.freebsd.org/changeset/base/293208 Log: MFC r287920: Fix /sbin/route to never look up (invalid) interface names through DNS /sbin/route has a bug where if it is passed an interface name that does not exist, it falls through and winds up interpreting it as a hostname. It fails out eventually, but on a system where DNS lookup is broken you can end up waiting for up to 60 seconds waiting for the DNS lookup to timeout. I'm not quite sure what happens if the DNS lookup somehow succeeds but I doubt that can end well. Reviewed by: markj, cem MFC after: 2 weeks Sponsored by: EMC/Isilon Storage Division Modified: stable/10/sbin/route/route.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/route/route.c ============================================================================== --- stable/10/sbin/route/route.c Tue Jan 5 16:49:27 2016 (r293207) +++ stable/10/sbin/route/route.c Tue Jan 5 16:58:07 2016 (r293208) @@ -1239,6 +1239,9 @@ getaddr(int idx, char *str, struct hoste freeifaddrs(ifap); if (sdl != NULL) return(1); + else + errx(EX_DATAERR, + "interface '%s' does not exist", str); } break; case RTAX_IFP: From owner-svn-src-stable-10@freebsd.org Tue Jan 5 17:11:48 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1D39A63F74; Tue, 5 Jan 2016 17:11:47 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEB441E5B; Tue, 5 Jan 2016 17:11:47 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by mail-ig0-x233.google.com with SMTP id to18so16069594igc.0; Tue, 05 Jan 2016 09:11:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=DGjJ7kJNh2CAFSJon7Mf+ZZQMnG2gXhLYwXgH/1maNA=; b=ne2dMaMqqZyp2vH6508xBLJJBIIAE2UJybxeGlGdlLjf/b7ksdBkfVGucUp8+FoQ5v gIFoPl6xT50GdzlKT+UdUN0T0DtuxW9IYXPwviCu2sIkBEM8tqB0ZXjqVOnkxvExHmnw mCZRgdgVAquVObUVu7Tm7TYE82LfpvjZ9ZBPd/xdv3AtwkESiRiqzrepN/ugJqR46gV6 lVtmyK22WpT0MoAPgyehFwqg7ykRnvPVtb90jHTJrBWorVfZvz4x4BD8ch8i0DqmVHgo wwDz5/spEwi6sZfYJyr0Obv6VHMX0e8curxLoEbd/NEEO47RWoMWDVCI5XVkMWU/N4Bm p+PA== MIME-Version: 1.0 X-Received: by 10.50.147.73 with SMTP id ti9mr4513924igb.36.1452013907063; Tue, 05 Jan 2016 09:11:47 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.50.152.69 with HTTP; Tue, 5 Jan 2016 09:11:47 -0800 (PST) In-Reply-To: <201601050810.u058A7gb038757@repo.freebsd.org> References: <201601050810.u058A7gb038757@repo.freebsd.org> Date: Tue, 5 Jan 2016 12:11:47 -0500 X-Google-Sender-Auth: UrQK_pqkcnLMdGgwBxeGf5v9zTQ Message-ID: Subject: Re: svn commit: r293191 - stable/10/etc/mtree From: Craig Rodrigues To: Garrett Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 17:11:48 -0000 On Tue, Jan 5, 2016 at 3:10 AM, Garrett Cooper wrote: > Author: ngie > Date: Tue Jan 5 08:10:06 2016 > New Revision: 293191 > URL: https://svnweb.freebsd.org/changeset/base/293191 > > Log: > Add `..` after sys/kern/pipe entry accidentally missed in r291183 > > This is a direct commit to stable/10 > > Pointyhat to: ngie > Reported by: rodrigc > Sponsored by: EMC / Isilon Storage Division > > Thanks, that fixed it for me. From owner-svn-src-stable-10@freebsd.org Tue Jan 5 17:12:34 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94659A620FD; Tue, 5 Jan 2016 17:12:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66038122D; Tue, 5 Jan 2016 17:12:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05HCXOK003063; Tue, 5 Jan 2016 17:12:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05HCXKr003062; Tue, 5 Jan 2016 17:12:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601051712.u05HCXKr003062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 5 Jan 2016 17:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293209 - stable/10/sys/dev/usb/serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 17:12:34 -0000 Author: ian Date: Tue Jan 5 17:12:33 2016 New Revision: 293209 URL: https://svnweb.freebsd.org/changeset/base/293209 Log: MFC 292366: Flag the first port on a Sheevaplug ftdi serial device as jtag. Modified: stable/10/sys/dev/usb/serial/uftdi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/10/sys/dev/usb/serial/uftdi.c Tue Jan 5 16:58:07 2016 (r293208) +++ stable/10/sys/dev/usb/serial/uftdi.c Tue Jan 5 17:12:33 2016 (r293209) @@ -568,7 +568,7 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(KOBIL, CONV_B1, 0), UFTDI_DEV(KOBIL, CONV_KAAN, 0), UFTDI_DEV(LARSENBRUSGAARD, ALTITRACK, 0), - UFTDI_DEV(MARVELL, SHEEVAPLUG, 0), + UFTDI_DEV(MARVELL, SHEEVAPLUG, UFTDI_JTAG_IFACE(0)), UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0100, 0), UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0101, 0), UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0102, 0), From owner-svn-src-stable-10@freebsd.org Wed Jan 6 09:56:08 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2186BA6514C; Wed, 6 Jan 2016 09:56:08 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D55B710D3; Wed, 6 Jan 2016 09:56:07 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u069u64N000755; Wed, 6 Jan 2016 09:56:06 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u069u6Yw000753; Wed, 6 Jan 2016 09:56:06 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601060956.u069u6Yw000753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 6 Jan 2016 09:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293232 - stable/10/sbin/reboot X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 09:56:08 -0000 Author: smh Date: Wed Jan 6 09:56:06 2016 New Revision: 293232 URL: https://svnweb.freebsd.org/changeset/base/293232 Log: MFC: r292266 & r292947 Add flag to disable inital reboot(8) userland sync Sponsored by: Multiplay Modified: stable/10/sbin/reboot/reboot.8 stable/10/sbin/reboot/reboot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/reboot/reboot.8 ============================================================================== --- stable/10/sbin/reboot/reboot.8 Wed Jan 6 05:23:25 2016 (r293231) +++ stable/10/sbin/reboot/reboot.8 Wed Jan 6 09:56:06 2016 (r293232) @@ -29,6 +29,7 @@ .\" $FreeBSD$ .\" .Dd October 11, 2010 +.Dd Jan 06, 2016 .Dt REBOOT 8 .Os .Sh NAME @@ -39,16 +40,16 @@ .Nd stopping and restarting the system .Sh SYNOPSIS .Nm halt -.Op Fl lnpq +.Op Fl lNnpq .Op Fl k Ar kernel .Nm -.Op Fl dlnpq +.Op Fl dlNnpq .Op Fl k Ar kernel .Nm fasthalt -.Op Fl lnpq +.Op Fl lNnpq .Op Fl k Ar kernel .Nm fastboot -.Op Fl dlnpq +.Op Fl dlNnpq .Op Fl k Ar kernel .Sh DESCRIPTION The @@ -94,6 +95,16 @@ that call or .Nm halt and log this themselves. +.It Fl N +The file system cache is not flushed during the initial process clean-up, +however the kernel level +.Xr reboot 2 +is still processed with a sync. +This option can be useful for performing a +.Dq best-effort +reboot when devices might be unavailable. +This can happen when devices have been disconnected, such as with +.Xr iscsi 4 . .It Fl n The file system cache is not flushed. This option should probably not be used. Modified: stable/10/sbin/reboot/reboot.c ============================================================================== --- stable/10/sbin/reboot/reboot.c Wed Jan 6 05:23:25 2016 (r293231) +++ stable/10/sbin/reboot/reboot.c Wed Jan 6 09:56:06 2016 (r293232) @@ -67,7 +67,7 @@ main(int argc, char *argv[]) { struct utmpx utx; const struct passwd *pw; - int ch, howto, i, fd, lflag, nflag, qflag, sverrno; + int ch, howto, i, fd, lflag, nflag, qflag, sverrno, Nflag; u_int pageins; const char *user, *kernel = NULL; @@ -76,8 +76,8 @@ main(int argc, char *argv[]) howto = RB_HALT; } else howto = 0; - lflag = nflag = qflag = 0; - while ((ch = getopt(argc, argv, "dk:lnpq")) != -1) + lflag = nflag = qflag = Nflag = 0; + while ((ch = getopt(argc, argv, "dk:lNnpq")) != -1) switch(ch) { case 'd': howto |= RB_DUMP; @@ -92,6 +92,10 @@ main(int argc, char *argv[]) nflag = 1; howto |= RB_NOSYNC; break; + case 'N': + nflag = 1; + Nflag = 1; + break; case 'p': howto |= RB_POWEROFF; break; @@ -107,6 +111,8 @@ main(int argc, char *argv[]) if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT)) errx(1, "cannot dump (-d) when halting; must reboot instead"); + if (Nflag && (howto & RB_NOSYNC) != 0) + errx(1, "-N cannot be used with -n"); if (geteuid()) { errno = EPERM; err(1, NULL); From owner-svn-src-stable-10@freebsd.org Wed Jan 6 16:02:23 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67D72A4EE6C; Wed, 6 Jan 2016 16:02:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37F0B15DB; Wed, 6 Jan 2016 16:02:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06G2MUP010567; Wed, 6 Jan 2016 16:02:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06G2MbF010566; Wed, 6 Jan 2016 16:02:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601061602.u06G2MbF010566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 6 Jan 2016 16:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293235 - stable/10/sys/fs/nullfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 16:02:23 -0000 Author: kib Date: Wed Jan 6 16:02:22 2016 New Revision: 293235 URL: https://svnweb.freebsd.org/changeset/base/293235 Log: MFC r292961: Force nullfs vnode reclaim after unlinking, to potentially unlink lower vnode. Modified: stable/10/sys/fs/nullfs/null_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nullfs/null_vnops.c ============================================================================== --- stable/10/sys/fs/nullfs/null_vnops.c Wed Jan 6 15:50:21 2016 (r293234) +++ stable/10/sys/fs/nullfs/null_vnops.c Wed Jan 6 16:02:22 2016 (r293235) @@ -568,14 +568,16 @@ static int null_remove(struct vop_remove_args *ap) { int retval, vreleit; - struct vnode *lvp; + struct vnode *lvp, *vp; - if (vrefcnt(ap->a_vp) > 1) { - lvp = NULLVPTOLOWERVP(ap->a_vp); + vp = ap->a_vp; + if (vrefcnt(vp) > 1) { + lvp = NULLVPTOLOWERVP(vp); VREF(lvp); vreleit = 1; } else vreleit = 0; + VTONULL(vp)->null_flags |= NULLV_DROP; retval = null_bypass(&ap->a_gen); if (vreleit != 0) vrele(lvp); From owner-svn-src-stable-10@freebsd.org Wed Jan 6 16:25:02 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09D17A62934; Wed, 6 Jan 2016 16:25:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CABA51730; Wed, 6 Jan 2016 16:25:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06GP0rg017723; Wed, 6 Jan 2016 16:25:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06GP0x1017722; Wed, 6 Jan 2016 16:25:00 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601061625.u06GP0x1017722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 6 Jan 2016 16:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293236 - stable/10/sys/fs/ext2fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 16:25:02 -0000 Author: pfg Date: Wed Jan 6 16:25:00 2016 New Revision: 293236 URL: https://svnweb.freebsd.org/changeset/base/293236 Log: MFC r292872: ext2: recognize ext4 INCOMPAT_RECOVER flag This is a flag specific for journalling in ext4. Add it to the list of ext4 features we ignore for read-only purposes. PR: 205668 Modified: stable/10/sys/fs/ext2fs/ext2fs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2fs.h ============================================================================== --- stable/10/sys/fs/ext2fs/ext2fs.h Wed Jan 6 16:02:22 2016 (r293235) +++ stable/10/sys/fs/ext2fs/ext2fs.h Wed Jan 6 16:25:00 2016 (r293236) @@ -187,6 +187,7 @@ struct csum { #define EXT2F_INCOMPAT_COMP 0x0001 #define EXT2F_INCOMPAT_FTYPE 0x0002 +#define EXT2F_INCOMPAT_RECOVER 0x0004 #define EXT2F_INCOMPAT_META_BG 0x0010 #define EXT2F_INCOMPAT_EXTENTS 0x0040 #define EXT2F_INCOMPAT_64BIT 0x0080 @@ -208,6 +209,7 @@ struct csum { * * We do not support these EXT4 features but they are irrelevant * for read-only support: + * - EXT2F_INCOMPAT_RECOVER * - EXT2F_INCOMPAT_FLEX_BG * - EXT2F_INCOMPAT_META_BG */ @@ -216,6 +218,7 @@ struct csum { EXT2F_ROCOMPAT_EXTRA_ISIZE) #define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE #define EXT4F_RO_INCOMPAT_SUPP (EXT2F_INCOMPAT_EXTENTS | \ + EXT2F_INCOMPAT_RECOVER | \ EXT2F_INCOMPAT_FLEX_BG | \ EXT2F_INCOMPAT_META_BG ) From owner-svn-src-stable-10@freebsd.org Wed Jan 6 16:32:41 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D480A62CEA; Wed, 6 Jan 2016 16:32:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3EAC1DDD; Wed, 6 Jan 2016 16:32:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06GWeFH020532; Wed, 6 Jan 2016 16:32:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06GWe19020531; Wed, 6 Jan 2016 16:32:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601061632.u06GWe19020531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 6 Jan 2016 16:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293238 - stable/10/bin/pax X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 16:32:41 -0000 Author: pfg Date: Wed Jan 6 16:32:39 2016 New Revision: 293238 URL: https://svnweb.freebsd.org/changeset/base/293238 Log: MFC r292877: pax: prevent possible buffer overflow Or at least quiet down some static analyzers about it. CID: 978835 Obtained from: OpenBSD Modified: stable/10/bin/pax/pat_rep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/pax/pat_rep.c ============================================================================== --- stable/10/bin/pax/pat_rep.c Wed Jan 6 16:27:17 2016 (r293237) +++ stable/10/bin/pax/pat_rep.c Wed Jan 6 16:32:39 2016 (r293238) @@ -878,7 +878,7 @@ rep_name(char *name, int *nlen, int prnt * (the user already saw that substitution go by) */ pt = rephead; - (void)strcpy(buf1, name); + (void)strlcpy(buf1, name, sizeof(buf1)); inpt = buf1; outpt = nname; endpt = outpt + PAXPATHLEN; From owner-svn-src-stable-10@freebsd.org Wed Jan 6 17:48:37 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E332CA64774; Wed, 6 Jan 2016 17:48:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBC7010CA; Wed, 6 Jan 2016 17:48:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06HmZTT042379; Wed, 6 Jan 2016 17:48:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06HmZMQ042377; Wed, 6 Jan 2016 17:48:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601061748.u06HmZMQ042377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 6 Jan 2016 17:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293242 - stable/10/usr.sbin/mailwrapper X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 17:48:37 -0000 Author: bdrewery Date: Wed Jan 6 17:48:35 2016 New Revision: 293242 URL: https://svnweb.freebsd.org/changeset/base/293242 Log: MFC r270675: Allow mailwrapper to use mailer.conf from localbase (respecting LOCALBASE env var if set) PR: 205965 Modified: stable/10/usr.sbin/mailwrapper/mailwrapper.8 stable/10/usr.sbin/mailwrapper/mailwrapper.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mailwrapper/mailwrapper.8 ============================================================================== --- stable/10/usr.sbin/mailwrapper/mailwrapper.8 Wed Jan 6 17:33:32 2016 (r293241) +++ stable/10/usr.sbin/mailwrapper/mailwrapper.8 Wed Jan 6 17:48:35 2016 (r293242) @@ -31,7 +31,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 7, 2006 +.Dd August 27, 2014 .Dt MAILWRAPPER 8 .Os .Sh NAME @@ -109,6 +109,8 @@ utility is designed to replace and to invoke an appropriate MTA instead of .Xr sendmail 8 based on configuration information placed in +.Pa ${LOCALBASE}/etc/mail/mailer.conf +falling back on .Pa /etc/mail/mailer.conf . This permits the administrator to configure which MTA is to be invoked on the system at run time. @@ -126,6 +128,8 @@ should be turned off in Configuration for .Nm is kept in +.Pa ${LOCALBASE}/etc/mail/mailer.conf +or .Pa /etc/mail/mailer.conf . .Pa /usr/sbin/sendmail is typically set up as a symbolic link to Modified: stable/10/usr.sbin/mailwrapper/mailwrapper.c ============================================================================== --- stable/10/usr.sbin/mailwrapper/mailwrapper.c Wed Jan 6 17:33:32 2016 (r293241) +++ stable/10/usr.sbin/mailwrapper/mailwrapper.c Wed Jan 6 17:48:35 2016 (r293242) @@ -35,6 +35,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include @@ -87,6 +89,8 @@ main(int argc, char *argv[], char *envp[ FILE *config; char *line, *cp, *from, *to, *ap; const char *progname; + char localmailerconf[MAXPATHLEN]; + const char *mailerconf; size_t len, lineno = 0; int i; struct arglist al; @@ -98,11 +102,18 @@ main(int argc, char *argv[], char *envp[ initarg(&al); addarg(&al, argv[0]); - if ((config = fopen(_PATH_MAILERCONF, "r")) == NULL) { + snprintf(localmailerconf, MAXPATHLEN, "%s/etc/mail/mailer.conf", + getenv("LOCALBASE") ? getenv("LOCALBASE") : "/usr/local"); + + mailerconf = localmailerconf; + if ((config = fopen(localmailerconf, "r")) == NULL) + mailerconf = _PATH_MAILERCONF; + + if (config == NULL && ((config = fopen(mailerconf, "r")) == NULL)) { addarg(&al, NULL); openlog(getprogname(), LOG_PID, LOG_MAIL); syslog(LOG_INFO, "cannot open %s, using %s as default MTA", - _PATH_MAILERCONF, _PATH_DEFAULTMTA); + mailerconf, _PATH_DEFAULTMTA); closelog(); execve(_PATH_DEFAULTMTA, al.argv, envp); err(EX_OSERR, "cannot exec %s", _PATH_DEFAULTMTA); @@ -112,7 +123,7 @@ main(int argc, char *argv[], char *envp[ for (;;) { if ((line = fparseln(config, &len, &lineno, NULL, 0)) == NULL) { if (feof(config)) - errx(EX_CONFIG, "no mapping in %s", _PATH_MAILERCONF); + errx(EX_CONFIG, "no mapping in %s", mailerconf); err(EX_CONFIG, "cannot parse line %lu", (u_long)lineno); } @@ -157,6 +168,6 @@ main(int argc, char *argv[], char *envp[ /*NOTREACHED*/ parse_error: errx(EX_CONFIG, "parse error in %s at line %lu", - _PATH_MAILERCONF, (u_long)lineno); + mailerconf, (u_long)lineno); /*NOTREACHED*/ } From owner-svn-src-stable-10@freebsd.org Wed Jan 6 17:49:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAA6FA647FE; Wed, 6 Jan 2016 17:49:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id BB84A126B; Wed, 6 Jan 2016 17:49:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id B27BA1CEE; Wed, 6 Jan 2016 17:49:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 7E25E12A4D; Wed, 6 Jan 2016 17:49:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id ExI012ihM4T2; Wed, 6 Jan 2016 17:49:20 +0000 (UTC) Subject: Re: svn commit: r293242 - stable/10/usr.sbin/mailwrapper DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com EE88F12A47 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201601061748.u06HmZMQ042377@repo.freebsd.org> Cc: Glen Barber From: Bryan Drewery Organization: FreeBSD Message-ID: <568D539D.1080804@FreeBSD.org> Date: Wed, 6 Jan 2016 09:49:17 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <201601061748.u06HmZMQ042377@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 17:49:22 -0000 On 1/6/16 9:48 AM, Bryan Drewery wrote: > Author: bdrewery > Date: Wed Jan 6 17:48:35 2016 > New Revision: 293242 > URL: https://svnweb.freebsd.org/changeset/base/293242 > > Log: > MFC r270675: > > Allow mailwrapper to use mailer.conf from localbase (respecting LOCALBASE env > var if set) > > PR: 205965 > Relnotes: yes -- Regards, Bryan Drewery From owner-svn-src-stable-10@freebsd.org Wed Jan 6 19:40:39 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11B81A65EFA; Wed, 6 Jan 2016 19:40:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCD711AB1; Wed, 6 Jan 2016 19:40:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06Jeb0r075475; Wed, 6 Jan 2016 19:40:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06JebFW075474; Wed, 6 Jan 2016 19:40:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601061940.u06JebFW075474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 6 Jan 2016 19:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293246 - stable/10/tools/regression/mac/mac_bsdextended X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 19:40:39 -0000 Author: ngie Date: Wed Jan 6 19:40:37 2016 New Revision: 293246 URL: https://svnweb.freebsd.org/changeset/base/293246 Log: MFC r292530,r292546: r292530: - Use 1 for an exit code instead of -1 with err, errx, and exit - Add unistd.h for getuid(3) - Sort #includes r292546: - Convert testcase to TAP format - Use nitems(x) instead of handrolled sizeof(x) / sizeof(*x) macro - Do not mark count != 0 case with bsde_get_rule_count as a failure; this generates false positives on systems with ugidfw rules set on it Modified: stable/10/tools/regression/mac/mac_bsdextended/test_ugidfw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/mac/mac_bsdextended/test_ugidfw.c ============================================================================== --- stable/10/tools/regression/mac/mac_bsdextended/test_ugidfw.c Wed Jan 6 19:18:43 2016 (r293245) +++ stable/10/tools/regression/mac/mac_bsdextended/test_ugidfw.c Wed Jan 6 19:40:37 2016 (r293246) @@ -33,24 +33,19 @@ #include #include +#include #include #include -#include #include #include #include +#include +#include /* * Starting point for a regression test for mac_bsdextended(4) and the * supporting libugidfw(3). */ -void -usage(void) -{ - - fprintf(stderr, "test_ugidfw\n"); - exit(-1); -} /* * This section of the regression test passes some test cases through the @@ -68,7 +63,6 @@ static const char *test_users[] = { "operator", "bin", }; -static const int test_users_len = sizeof(test_users) / sizeof(char *); static const char *test_groups[] = { "wheel", @@ -76,7 +70,8 @@ static const char *test_groups[] = { "operator", "bin", }; -static const int test_groups_len = sizeof(test_groups) / sizeof(char *); + +int test_num; /* * List of test strings that must go in (and come out) of libugidfw intact. @@ -147,7 +142,6 @@ static const char *test_strings[] = { "object ! uid root:daemon gid daemon filesys / suid sgid uid_of_subject gid_of_subject ! type r " "mode rsx", }; -static const int test_strings_len = sizeof(test_strings) / sizeof(char *); static void test_libugidfw_strings(void) @@ -155,52 +149,68 @@ test_libugidfw_strings(void) struct mac_bsdextended_rule rule; char errorstr[256]; char rulestr[256]; - int i, error; + int error, i; - for (i = 0; i < test_users_len; i++) { + for (i = 0; i < nitems(test_users); i++, test_num++) { if (getpwnam(test_users[i]) == NULL) - err(-1, "test_libugidfw_strings: getpwnam: %s", - test_users[i]); + printf("not ok %d # test_libugidfw_strings: getpwnam(%s) " + "failed: %s\n", test_num, test_users[i], strerror(errno)); + else + printf("ok %d\n", test_num); } - for (i = 0; i < test_groups_len; i++) { + for (i = 0; i < nitems(test_groups); i++, test_num++) { if (getgrnam(test_groups[i]) == NULL) - err(-1, "test_libugidfw_strings: getgrnam: %s", - test_groups[i]); + printf("not ok %d # test_libugidfw_strings: getgrnam(%s) " + "failed: %s\n", test_num, test_groups[i], strerror(errno)); + else + printf("ok %d\n", test_num); } - for (i = 0; i < test_strings_len; i++) { + for (i = 0; i < nitems(test_strings); i++) { error = bsde_parse_rule_string(test_strings[i], &rule, sizeof(errorstr), errorstr); if (error == -1) - errx(-1, "bsde_parse_rule_string: '%s' (%d): %s", - test_strings[i], i, errorstr); + printf("not ok %d # bsde_parse_rule_string: '%s' (%d) " + "failed: %s\n", test_num, test_strings[i], i, errorstr); + else + printf("ok %d\n", test_num); + test_num++; + error = bsde_rule_to_string(&rule, rulestr, sizeof(rulestr)); if (error < 0) - errx(-1, "bsde_rule_to_string: rule for '%s' " - "returned %d", test_strings[i], error); + printf("not ok %d # bsde_rule_to_string: rule for '%s' " + "returned %d\n", test_num, test_strings[i], error); + else + printf("ok %d\n", test_num); + test_num++; if (strcmp(test_strings[i], rulestr) != 0) - errx(-1, "test_libugidfw: '%s' in, '%s' out", - test_strings[i], rulestr); + printf("not ok %d # test_libugidfw: '%s' in, '%s' " + "out\n", test_num, test_strings[i], rulestr); + else + printf("ok %d\n", test_num); + test_num++; } } int -main(int argc, char *argv[]) +main(void) { char errorstr[256]; int count, slots; - if (argc != 1) - usage(); + test_num = 1; /* Print an error if a non-root user attemps to run the tests. */ if (getuid() != 0) { - fprintf(stderr, "Error! Only root may run this utility\n"); - return (EXIT_FAILURE); + printf("1..0 # SKIP you must be root\n"); + return (0); } + printf("1..%lu\n", nitems(test_users) + nitems(test_groups) + + 3 * nitems(test_strings) + 2); + /* * We can test some parts of the library without the MAC Framework * and policy loaded, so run those tests before calling @@ -210,12 +220,15 @@ main(int argc, char *argv[]) switch (mac_is_present("bsdextended")) { case -1: - err(-1, "mac_is_present"); + printf("1..0 # SKIP mac_is_present failed: %s\n", + strerror(errno)); + return (0); case 1: break; case 0: default: - errx(-1, "mac_bsdextended not loaded"); + printf("1..0 # SKIP mac_bsdextended not loaded\n"); + return (0); } /* @@ -226,13 +239,19 @@ main(int argc, char *argv[]) */ count = bsde_get_rule_count(sizeof(errorstr), errorstr); if (count == -1) - errx(-1, "bsde_get_rule_count: %s", errorstr); - if (count != 0) - errx(-1, "bsde_get_rule_count: %d rules", count); + printf("not ok %d # bsde_get_rule_count: %s\n", test_num, + errorstr); + else + printf("ok %d\n", test_num); + + test_num++; slots = bsde_get_rule_slots(sizeof(errorstr), errorstr); if (slots == -1) - errx(-1, "bsde_get_rule_slots: %s", errorstr); + printf("not ok %d # bsde_get_rule_slots: %s\n", test_num, + errorstr); + else + printf("ok %d\n", test_num); return (0); } From owner-svn-src-stable-10@freebsd.org Wed Jan 6 20:02:50 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99C3CA65881; Wed, 6 Jan 2016 20:02:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52AB31E46; Wed, 6 Jan 2016 20:02:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06K2nQR084238; Wed, 6 Jan 2016 20:02:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06K2nmN084235; Wed, 6 Jan 2016 20:02:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601062002.u06K2nmN084235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 6 Jan 2016 20:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293251 - in stable/10: etc/mtree tests/sys tests/sys/mac tests/sys/mac/bsdextended X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:02:50 -0000 Author: ngie Date: Wed Jan 6 20:02:49 2016 New Revision: 293251 URL: https://svnweb.freebsd.org/changeset/base/293251 Log: MFC r292570: Integrate tools/regression/mac/mac_bsdextended and tools/regression/mac/mac_portacl into the FreeBSD test suite as tests/sys/mac/bsdextended and tests/sys/mac/portacl, respectively Added: stable/10/tests/sys/mac/ - copied from r292570, head/tests/sys/mac/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/tests/sys/Makefile stable/10/tests/sys/mac/bsdextended/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Wed Jan 6 20:02:26 2016 (r293250) +++ stable/10/etc/mtree/BSD.tests.dist Wed Jan 6 20:02:49 2016 (r293251) @@ -214,6 +214,12 @@ .. kqueue .. + mac + bsdextended + .. + portacl + .. + .. mqueue .. netinet Modified: stable/10/tests/sys/Makefile ============================================================================== --- stable/10/tests/sys/Makefile Wed Jan 6 20:02:26 2016 (r293250) +++ stable/10/tests/sys/Makefile Wed Jan 6 20:02:49 2016 (r293251) @@ -10,6 +10,7 @@ TESTS_SUBDIRS+= fifo TESTS_SUBDIRS+= file TESTS_SUBDIRS+= kern TESTS_SUBDIRS+= kqueue +TESTS_SUBDIRS+= mac TESTS_SUBDIRS+= mqueue TESTS_SUBDIRS+= netinet TESTS_SUBDIRS+= posixshm Modified: stable/10/tests/sys/mac/bsdextended/Makefile ============================================================================== --- head/tests/sys/mac/bsdextended/Makefile Mon Dec 21 21:24:03 2015 (r292570) +++ stable/10/tests/sys/mac/bsdextended/Makefile Wed Jan 6 20:02:49 2016 (r293251) @@ -5,7 +5,8 @@ TESTSDIR= ${TESTSBASE}/sys/mac/bsdextend TAP_TESTS_C+= ugidfw_test TAP_TESTS_SH+= matches_test -LIBADD.ugidfw_test+= ugidfw +DPADD.ugidfw_test+= ${LIBUGIDFW} +LDADD.ugidfw_test+= -lugidfw TEST_METADATA.matches_test+= required_user="root" TEST_METADATA.ugidfw_test+= required_user="root" From owner-svn-src-stable-10@freebsd.org Wed Jan 6 20:06:17 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12E9DA65C22; Wed, 6 Jan 2016 20:06:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF2651820; Wed, 6 Jan 2016 20:06:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06K6F9M084670; Wed, 6 Jan 2016 20:06:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06K6F2k084669; Wed, 6 Jan 2016 20:06:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601062006.u06K6F2k084669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 6 Jan 2016 20:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293257 - stable/10/tests/sys/mac/bsdextended X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:06:17 -0000 Author: ngie Date: Wed Jan 6 20:06:15 2016 New Revision: 293257 URL: https://svnweb.freebsd.org/changeset/base/293257 Log: MFC r292650,r292651: r292650: Move mac_bsdextended check up before running the test_libugidfw_strings testcases I realize that these tests could be run before mac_bsdextended is loaded, but it would overcomplicate things to special case handle the testcases before doing the mac_bsdextended(4) feature check The testcases will be split up so they can be run separately in the near future r292651: Delete the comment about running `test_libugidfw_strings` before testing `mac_is_present` so it doesn't accidentally confuse people Modified: stable/10/tests/sys/mac/bsdextended/ugidfw_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/mac/bsdextended/ugidfw_test.c ============================================================================== --- stable/10/tests/sys/mac/bsdextended/ugidfw_test.c Wed Jan 6 20:06:14 2016 (r293256) +++ stable/10/tests/sys/mac/bsdextended/ugidfw_test.c Wed Jan 6 20:06:15 2016 (r293257) @@ -208,16 +208,6 @@ main(void) return (0); } - printf("1..%lu\n", nitems(test_users) + nitems(test_groups) + - 3 * nitems(test_strings) + 2); - - /* - * We can test some parts of the library without the MAC Framework - * and policy loaded, so run those tests before calling - * mac_is_present(). - */ - test_libugidfw_strings(); - switch (mac_is_present("bsdextended")) { case -1: printf("1..0 # SKIP mac_is_present failed: %s\n", @@ -231,6 +221,11 @@ main(void) return (0); } + printf("1..%lu\n", nitems(test_users) + nitems(test_groups) + + 3 * nitems(test_strings) + 2); + + test_libugidfw_strings(); + /* * Some simple up-front checks to see if we're able to query the * policy for basic state. We want the rule count to be 0 before From owner-svn-src-stable-10@freebsd.org Wed Jan 6 20:21:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 426C4A662F4; Wed, 6 Jan 2016 20:21:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D58F01B61; Wed, 6 Jan 2016 20:21:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06KLfvm089012; Wed, 6 Jan 2016 20:21:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06KLeQ3089006; Wed, 6 Jan 2016 20:21:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601062021.u06KLeQ3089006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 6 Jan 2016 20:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293267 - in stable/10: lib/msun/tests tools/regression/lib/msun X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:21:42 -0000 Author: ngie Date: Wed Jan 6 20:21:40 2016 New Revision: 293267 URL: https://svnweb.freebsd.org/changeset/base/293267 Log: MFC r292328: Integrate a number of testcases from tools/regression/lib/msun into the FreeBSD test suite There's no functional change with these testcases; they're purposely being left in TAP format for the time being Other testcases which crash on amd64/i386 as-is have not been integrated yet (they need to be retested on a later version of CURRENT, as I haven't used i386 in some time) Added: stable/10/lib/msun/tests/cexp_test.c - copied unchanged from r292328, head/lib/msun/tests/cexp_test.c stable/10/lib/msun/tests/conj_test.c - copied unchanged from r292328, head/lib/msun/tests/conj_test.c stable/10/lib/msun/tests/csqrt_test.c - copied unchanged from r292328, head/lib/msun/tests/csqrt_test.c stable/10/lib/msun/tests/fenv_test.c - copied unchanged from r292328, head/lib/msun/tests/fenv_test.c stable/10/lib/msun/tests/fmaxmin_test.c - copied unchanged from r292328, head/lib/msun/tests/fmaxmin_test.c stable/10/lib/msun/tests/ilogb_test.c - copied unchanged from r292328, head/lib/msun/tests/ilogb_test.c stable/10/lib/msun/tests/invctrig_test.c - copied unchanged from r292328, head/lib/msun/tests/invctrig_test.c stable/10/lib/msun/tests/logarithm_test.c - copied unchanged from r292328, head/lib/msun/tests/logarithm_test.c stable/10/lib/msun/tests/lrint_test.c - copied unchanged from r292328, head/lib/msun/tests/lrint_test.c stable/10/lib/msun/tests/nan_test.c - copied unchanged from r292328, head/lib/msun/tests/nan_test.c stable/10/lib/msun/tests/nearbyint_test.c - copied unchanged from r292328, head/lib/msun/tests/nearbyint_test.c stable/10/lib/msun/tests/next_test.c - copied unchanged from r292328, head/lib/msun/tests/next_test.c stable/10/lib/msun/tests/rem_test.c - copied unchanged from r292328, head/lib/msun/tests/rem_test.c stable/10/lib/msun/tests/trig_test.c - copied unchanged from r292328, head/lib/msun/tests/trig_test.c Deleted: stable/10/tools/regression/lib/msun/test-cexp.t stable/10/tools/regression/lib/msun/test-conj.t stable/10/tools/regression/lib/msun/test-csqrt.t stable/10/tools/regression/lib/msun/test-fenv.c stable/10/tools/regression/lib/msun/test-fenv.t stable/10/tools/regression/lib/msun/test-fmaxmin.c stable/10/tools/regression/lib/msun/test-fmaxmin.t stable/10/tools/regression/lib/msun/test-ilogb.c stable/10/tools/regression/lib/msun/test-ilogb.t stable/10/tools/regression/lib/msun/test-invctrig.c stable/10/tools/regression/lib/msun/test-logarithm.c stable/10/tools/regression/lib/msun/test-logarithm.t stable/10/tools/regression/lib/msun/test-lrint.c stable/10/tools/regression/lib/msun/test-lrint.t stable/10/tools/regression/lib/msun/test-nan.c stable/10/tools/regression/lib/msun/test-nan.t stable/10/tools/regression/lib/msun/test-nearbyint.c stable/10/tools/regression/lib/msun/test-nearbyint.t stable/10/tools/regression/lib/msun/test-next.c stable/10/tools/regression/lib/msun/test-next.t stable/10/tools/regression/lib/msun/test-rem.c stable/10/tools/regression/lib/msun/test-rem.t stable/10/tools/regression/lib/msun/test-trig.t Modified: stable/10/lib/msun/tests/Makefile stable/10/tools/regression/lib/msun/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/msun/tests/Makefile ============================================================================== --- stable/10/lib/msun/tests/Makefile Wed Jan 6 20:20:48 2016 (r293266) +++ stable/10/lib/msun/tests/Makefile Wed Jan 6 20:21:40 2016 (r293267) @@ -36,12 +36,34 @@ NETBSD_ATF_TESTS_C+= sqrt_test NETBSD_ATF_TESTS_C+= tan_test NETBSD_ATF_TESTS_C+= tanh_test +TAP_TESTS_C+= cexp_test +TAP_TESTS_C+= conj_test +TAP_TESTS_C+= csqrt_test +TAP_TESTS_C+= fenv_test +TAP_TESTS_C+= fmaxmin_test +TAP_TESTS_C+= ilogb_test +TAP_TESTS_C+= invctrig_test +TAP_TESTS_C+= logarithm_test +TAP_TESTS_C+= lrint_test +TAP_TESTS_C+= nan_test +TAP_TESTS_C+= nearbyint_test +TAP_TESTS_C+= next_test +TAP_TESTS_C+= rem_test +TAP_TESTS_C+= trig_test + +.for t in ${TAP_TESTS_C} +CFLAGS.$t+= -O0 +CFLAGS.$t+= -I${SRCTOP}/tools/regression/lib/msun +.endfor + CSTD= c99 LDADD+= -lm DPADD+= ${LIBM} #COPTS+= -Wfloat-equal +IGNORE_PRAGMA= + # Copied from lib/msun/Makefile .if ${MACHINE_CPUARCH} == "i386" ARCH_SUBDIR= i387 Copied: stable/10/lib/msun/tests/cexp_test.c (from r292328, head/lib/msun/tests/cexp_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/msun/tests/cexp_test.c Wed Jan 6 20:21:40 2016 (r293267, copy of r292328, head/lib/msun/tests/cexp_test.c) @@ -0,0 +1,322 @@ +/*- + * Copyright (c) 2008-2011 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Tests for corner cases in cexp*(). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include + +#include "test-utils.h" + +#pragma STDC FENV_ACCESS ON +#pragma STDC CX_LIMITED_RANGE OFF + +/* + * Test that a function returns the correct value and sets the + * exception flags correctly. The exceptmask specifies which + * exceptions we should check. We need to be lenient for several + * reasons, but mainly because on some architectures it's impossible + * to raise FE_OVERFLOW without raising FE_INEXACT. In some cases, + * whether cexp() raises an invalid exception is unspecified. + * + * These are macros instead of functions so that assert provides more + * meaningful error messages. + * + * XXX The volatile here is to avoid gcc's bogus constant folding and work + * around the lack of support for the FENV_ACCESS pragma. + */ +#define test(func, z, result, exceptmask, excepts, checksign) do { \ + volatile long double complex _d = z; \ + assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ + assert(cfpequal_cs((func)(_d), (result), (checksign))); \ + assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ +} while (0) + +/* Test within a given tolerance. */ +#define test_tol(func, z, result, tol) do { \ + volatile long double complex _d = z; \ + assert(cfpequal_tol((func)(_d), (result), (tol), \ + FPE_ABS_ZERO | CS_BOTH)); \ +} while (0) + +/* Test all the functions that compute cexp(x). */ +#define testall(x, result, exceptmask, excepts, checksign) do { \ + test(cexp, x, result, exceptmask, excepts, checksign); \ + test(cexpf, x, result, exceptmask, excepts, checksign); \ +} while (0) + +/* + * Test all the functions that compute cexp(x), within a given tolerance. + * The tolerance is specified in ulps. + */ +#define testall_tol(x, result, tol) do { \ + test_tol(cexp, x, result, tol * DBL_ULP()); \ + test_tol(cexpf, x, result, tol * FLT_ULP()); \ +} while (0) + +/* Various finite non-zero numbers to test. */ +static const float finites[] = +{ -42.0e20, -1.0, -1.0e-10, -0.0, 0.0, 1.0e-10, 1.0, 42.0e20 }; + + +/* Tests for 0 */ +void +test_zero(void) +{ + + /* cexp(0) = 1, no exceptions raised */ + testall(0.0, 1.0, ALL_STD_EXCEPT, 0, 1); + testall(-0.0, 1.0, ALL_STD_EXCEPT, 0, 1); + testall(CMPLXL(0.0, -0.0), CMPLXL(1.0, -0.0), ALL_STD_EXCEPT, 0, 1); + testall(CMPLXL(-0.0, -0.0), CMPLXL(1.0, -0.0), ALL_STD_EXCEPT, 0, 1); +} + +/* + * Tests for NaN. The signs of the results are indeterminate unless the + * imaginary part is 0. + */ +void +test_nan() +{ + int i; + + /* cexp(x + NaNi) = NaN + NaNi and optionally raises invalid */ + /* cexp(NaN + yi) = NaN + NaNi and optionally raises invalid (|y|>0) */ + for (i = 0; i < nitems(finites); i++) { + printf("# Run %d..\n", i); + testall(CMPLXL(finites[i], NAN), CMPLXL(NAN, NAN), + ALL_STD_EXCEPT & ~FE_INVALID, 0, 0); + if (finites[i] == 0.0) + continue; + /* XXX FE_INEXACT shouldn't be raised here */ + testall(CMPLXL(NAN, finites[i]), CMPLXL(NAN, NAN), + ALL_STD_EXCEPT & ~(FE_INVALID | FE_INEXACT), 0, 0); + } + + /* cexp(NaN +- 0i) = NaN +- 0i */ + testall(CMPLXL(NAN, 0.0), CMPLXL(NAN, 0.0), ALL_STD_EXCEPT, 0, 1); + testall(CMPLXL(NAN, -0.0), CMPLXL(NAN, -0.0), ALL_STD_EXCEPT, 0, 1); + + /* cexp(inf + NaN i) = inf + nan i */ + testall(CMPLXL(INFINITY, NAN), CMPLXL(INFINITY, NAN), + ALL_STD_EXCEPT, 0, 0); + /* cexp(-inf + NaN i) = 0 */ + testall(CMPLXL(-INFINITY, NAN), CMPLXL(0.0, 0.0), + ALL_STD_EXCEPT, 0, 0); + /* cexp(NaN + NaN i) = NaN + NaN i */ + testall(CMPLXL(NAN, NAN), CMPLXL(NAN, NAN), + ALL_STD_EXCEPT, 0, 0); +} + +void +test_inf(void) +{ + int i; + + /* cexp(x + inf i) = NaN + NaNi and raises invalid */ + for (i = 0; i < nitems(finites); i++) { + printf("# Run %d..\n", i); + testall(CMPLXL(finites[i], INFINITY), CMPLXL(NAN, NAN), + ALL_STD_EXCEPT, FE_INVALID, 1); + } + /* cexp(-inf + yi) = 0 * (cos(y) + sin(y)i) */ + /* XXX shouldn't raise an inexact exception */ + testall(CMPLXL(-INFINITY, M_PI_4), CMPLXL(0.0, 0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(CMPLXL(-INFINITY, 3 * M_PI_4), CMPLXL(-0.0, 0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(CMPLXL(-INFINITY, 5 * M_PI_4), CMPLXL(-0.0, -0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(CMPLXL(-INFINITY, 7 * M_PI_4), CMPLXL(0.0, -0.0), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(CMPLXL(-INFINITY, 0.0), CMPLXL(0.0, 0.0), + ALL_STD_EXCEPT, 0, 1); + testall(CMPLXL(-INFINITY, -0.0), CMPLXL(0.0, -0.0), + ALL_STD_EXCEPT, 0, 1); + /* cexp(inf + yi) = inf * (cos(y) + sin(y)i) (except y=0) */ + /* XXX shouldn't raise an inexact exception */ + testall(CMPLXL(INFINITY, M_PI_4), CMPLXL(INFINITY, INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(CMPLXL(INFINITY, 3 * M_PI_4), CMPLXL(-INFINITY, INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(CMPLXL(INFINITY, 5 * M_PI_4), CMPLXL(-INFINITY, -INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + testall(CMPLXL(INFINITY, 7 * M_PI_4), CMPLXL(INFINITY, -INFINITY), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + /* cexp(inf + 0i) = inf + 0i */ + testall(CMPLXL(INFINITY, 0.0), CMPLXL(INFINITY, 0.0), + ALL_STD_EXCEPT, 0, 1); + testall(CMPLXL(INFINITY, -0.0), CMPLXL(INFINITY, -0.0), + ALL_STD_EXCEPT, 0, 1); +} + +void +test_reals(void) +{ + int i; + + for (i = 0; i < nitems(finites); i++) { + /* XXX could check exceptions more meticulously */ + printf("# Run %d..\n", i); + test(cexp, CMPLXL(finites[i], 0.0), + CMPLXL(exp(finites[i]), 0.0), + FE_INVALID | FE_DIVBYZERO, 0, 1); + test(cexp, CMPLXL(finites[i], -0.0), + CMPLXL(exp(finites[i]), -0.0), + FE_INVALID | FE_DIVBYZERO, 0, 1); + test(cexpf, CMPLXL(finites[i], 0.0), + CMPLXL(expf(finites[i]), 0.0), + FE_INVALID | FE_DIVBYZERO, 0, 1); + test(cexpf, CMPLXL(finites[i], -0.0), + CMPLXL(expf(finites[i]), -0.0), + FE_INVALID | FE_DIVBYZERO, 0, 1); + } +} + +void +test_imaginaries(void) +{ + int i; + + for (i = 0; i < nitems(finites); i++) { + printf("# Run %d..\n", i); + test(cexp, CMPLXL(0.0, finites[i]), + CMPLXL(cos(finites[i]), sin(finites[i])), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + test(cexp, CMPLXL(-0.0, finites[i]), + CMPLXL(cos(finites[i]), sin(finites[i])), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + test(cexpf, CMPLXL(0.0, finites[i]), + CMPLXL(cosf(finites[i]), sinf(finites[i])), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + test(cexpf, CMPLXL(-0.0, finites[i]), + CMPLXL(cosf(finites[i]), sinf(finites[i])), + ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); + } +} + +void +test_small(void) +{ + static const double tests[] = { + /* csqrt(a + bI) = x + yI */ + /* a b x y */ + 1.0, M_PI_4, M_SQRT2 * 0.5 * M_E, M_SQRT2 * 0.5 * M_E, + -1.0, M_PI_4, M_SQRT2 * 0.5 / M_E, M_SQRT2 * 0.5 / M_E, + 2.0, M_PI_2, 0.0, M_E * M_E, + M_LN2, M_PI, -2.0, 0.0, + }; + double a, b; + double x, y; + int i; + + for (i = 0; i < nitems(tests); i += 4) { + printf("# Run %d..\n", i); + a = tests[i]; + b = tests[i + 1]; + x = tests[i + 2]; + y = tests[i + 3]; + test_tol(cexp, CMPLXL(a, b), CMPLXL(x, y), 3 * DBL_ULP()); + + /* float doesn't have enough precision to pass these tests */ + if (x == 0 || y == 0) + continue; + test_tol(cexpf, CMPLXL(a, b), CMPLXL(x, y), 1 * FLT_ULP()); + } +} + +/* Test inputs with a real part r that would overflow exp(r). */ +void +test_large(void) +{ + + test_tol(cexp, CMPLXL(709.79, 0x1p-1074), + CMPLXL(INFINITY, 8.94674309915433533273e-16), DBL_ULP()); + test_tol(cexp, CMPLXL(1000, 0x1p-1074), + CMPLXL(INFINITY, 9.73344457300016401328e+110), DBL_ULP()); + test_tol(cexp, CMPLXL(1400, 0x1p-1074), + CMPLXL(INFINITY, 5.08228858149196559681e+284), DBL_ULP()); + test_tol(cexp, CMPLXL(900, 0x1.23456789abcdep-1020), + CMPLXL(INFINITY, 7.42156649354218408074e+83), DBL_ULP()); + test_tol(cexp, CMPLXL(1300, 0x1.23456789abcdep-1020), + CMPLXL(INFINITY, 3.87514844965996756704e+257), DBL_ULP()); + + test_tol(cexpf, CMPLXL(88.73, 0x1p-149), + CMPLXL(INFINITY, 4.80265603e-07), 2 * FLT_ULP()); + test_tol(cexpf, CMPLXL(90, 0x1p-149), + CMPLXL(INFINITY, 1.7101492622e-06f), 2 * FLT_ULP()); + test_tol(cexpf, CMPLXL(192, 0x1p-149), + CMPLXL(INFINITY, 3.396809344e+38f), 2 * FLT_ULP()); + test_tol(cexpf, CMPLXL(120, 0x1.234568p-120), + CMPLXL(INFINITY, 1.1163382522e+16f), 2 * FLT_ULP()); + test_tol(cexpf, CMPLXL(170, 0x1.234568p-120), + CMPLXL(INFINITY, 5.7878851079e+37f), 2 * FLT_ULP()); +} + +int +main(int argc, char *argv[]) +{ + + printf("1..7\n"); + + test_zero(); + printf("ok 1 - cexp zero\n"); + + test_nan(); + printf("ok 2 - cexp nan\n"); + + test_inf(); + printf("ok 3 - cexp inf\n"); + +#if defined(__i386__) + printf("not ok 4 - cexp reals # TODO: PR # 191676 fails assertion on i386\n"); +#else + test_reals(); + printf("ok 4 - cexp reals\n"); +#endif + + test_imaginaries(); + printf("ok 5 - cexp imaginaries\n"); + + test_small(); + printf("ok 6 - cexp small\n"); + + test_large(); + printf("ok 7 - cexp large\n"); + + return (0); +} Copied: stable/10/lib/msun/tests/conj_test.c (from r292328, head/lib/msun/tests/conj_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/msun/tests/conj_test.c Wed Jan 6 20:21:40 2016 (r293267, copy of r292328, head/lib/msun/tests/conj_test.c) @@ -0,0 +1,139 @@ +/*- + * Copyright (c) 2008 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Tests for conj{,f,l}() + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include "test-utils.h" + +#pragma STDC CX_LIMITED_RANGE OFF + +/* Make sure gcc doesn't use builtin versions of these or honor __pure2. */ +static float complex (*libconjf)(float complex) = conjf; +static double complex (*libconj)(double complex) = conj; +static long double complex (*libconjl)(long double complex) = conjl; +static float (*libcrealf)(float complex) = crealf; +static double (*libcreal)(double complex) = creal; +static long double (*libcreall)(long double complex) = creall; +static float (*libcimagf)(float complex) = cimagf; +static double (*libcimag)(double complex) = cimag; +static long double (*libcimagl)(long double complex) = cimagl; + +static const double tests[] = { + /* a + bI */ + 0.0, 0.0, + 0.0, 1.0, + 1.0, 0.0, + -1.0, 0.0, + 1.0, -0.0, + 0.0, -1.0, + 2.0, 4.0, + 0.0, INFINITY, + 0.0, -INFINITY, + INFINITY, 0.0, + NAN, 1.0, + 1.0, NAN, + NAN, NAN, + -INFINITY, INFINITY, +}; + +int +main(int argc, char *argv[]) +{ + static const int ntests = sizeof(tests) / sizeof(tests[0]) / 2; + complex float in; + complex long double expected; + int i; + + printf("1..%d\n", ntests * 3); + + for (i = 0; i < ntests; i++) { + __real__ expected = __real__ in = tests[2 * i]; + __imag__ in = tests[2 * i + 1]; + __imag__ expected = -cimag(in); + + assert(fpequal(libcrealf(in), __real__ in)); + assert(fpequal(libcreal(in), __real__ in)); + assert(fpequal(libcreall(in), __real__ in)); + assert(fpequal(libcimagf(in), __imag__ in)); + assert(fpequal(libcimag(in), __imag__ in)); + assert(fpequal(libcimagl(in), __imag__ in)); + + feclearexcept(FE_ALL_EXCEPT); + if (!cfpequal(libconjf(in), expected)) { + printf("not ok %d\t# conjf(%#.2g + %#.2gI): " + "wrong value\n", + 3 * i + 1, creal(in), cimag(in)); + } else if (fetestexcept(FE_ALL_EXCEPT)) { + printf("not ok %d\t# conjf(%#.2g + %#.2gI): " + "threw an exception\n", + 3 * i + 1, creal(in), cimag(in)); + } else { + printf("ok %d\t\t# conjf(%#.2g + %#.2gI)\n", + 3 * i + 1, creal(in), cimag(in)); + } + + feclearexcept(FE_ALL_EXCEPT); + if (!cfpequal(libconj(in), expected)) { + printf("not ok %d\t# conj(%#.2g + %#.2gI): " + "wrong value\n", + 3 * i + 2, creal(in), cimag(in)); + } else if (fetestexcept(FE_ALL_EXCEPT)) { + printf("not ok %d\t# conj(%#.2g + %#.2gI): " + "threw an exception\n", + 3 * i + 2, creal(in), cimag(in)); + } else { + printf("ok %d\t\t# conj(%#.2g + %#.2gI)\n", + 3 * i + 2, creal(in), cimag(in)); + } + + feclearexcept(FE_ALL_EXCEPT); + if (!cfpequal(libconjl(in), expected)) { + printf("not ok %d\t# conjl(%#.2g + %#.2gI): " + "wrong value\n", + 3 * i + 3, creal(in), cimag(in)); + } else if (fetestexcept(FE_ALL_EXCEPT)) { + printf("not ok %d\t# conjl(%#.2g + %#.2gI): " + "threw an exception\n", + 3 * i + 3, creal(in), cimag(in)); + } else { + printf("ok %d\t\t# conjl(%#.2g + %#.2gI)\n", + 3 * i + 3, creal(in), cimag(in)); + } + } + + return (0); +} Copied: stable/10/lib/msun/tests/csqrt_test.c (from r292328, head/lib/msun/tests/csqrt_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/msun/tests/csqrt_test.c Wed Jan 6 20:21:40 2016 (r293267, copy of r292328, head/lib/msun/tests/csqrt_test.c) @@ -0,0 +1,295 @@ +/*- + * Copyright (c) 2007 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Tests for csqrt{,f}() + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include + +#include "test-utils.h" + +/* + * This is a test hook that can point to csqrtl(), _csqrt(), or to _csqrtf(). + * The latter two convert to float or double, respectively, and test csqrtf() + * and csqrt() with the same arguments. + */ +long double complex (*t_csqrt)(long double complex); + +static long double complex +_csqrtf(long double complex d) +{ + + return (csqrtf((float complex)d)); +} + +static long double complex +_csqrt(long double complex d) +{ + + return (csqrt((double complex)d)); +} + +#pragma STDC CX_LIMITED_RANGE OFF + +/* + * Compare d1 and d2 using special rules: NaN == NaN and +0 != -0. + * Fail an assertion if they differ. + */ +static void +assert_equal(long double complex d1, long double complex d2) +{ + + assert(cfpequal(d1, d2)); +} + +/* + * Test csqrt for some finite arguments where the answer is exact. + * (We do not test if it produces correctly rounded answers when the + * result is inexact, nor do we check whether it throws spurious + * exceptions.) + */ +static void +test_finite() +{ + static const double tests[] = { + /* csqrt(a + bI) = x + yI */ + /* a b x y */ + 0, 8, 2, 2, + 0, -8, 2, -2, + 4, 0, 2, 0, + -4, 0, 0, 2, + 3, 4, 2, 1, + 3, -4, 2, -1, + -3, 4, 1, 2, + -3, -4, 1, -2, + 5, 12, 3, 2, + 7, 24, 4, 3, + 9, 40, 5, 4, + 11, 60, 6, 5, + 13, 84, 7, 6, + 33, 56, 7, 4, + 39, 80, 8, 5, + 65, 72, 9, 4, + 987, 9916, 74, 67, + 5289, 6640, 83, 40, + 460766389075.0, 16762287900.0, 678910, 12345 + }; + /* + * We also test some multiples of the above arguments. This + * array defines which multiples we use. Note that these have + * to be small enough to not cause overflow for float precision + * with all of the constants in the above table. + */ + static const double mults[] = { + 1, + 2, + 3, + 13, + 16, + 0x1.p30, + 0x1.p-30, + }; + + double a, b; + double x, y; + int i, j; + + for (i = 0; i < nitems(tests); i += 4) { + for (j = 0; j < nitems(mults); j++) { + a = tests[i] * mults[j] * mults[j]; + b = tests[i + 1] * mults[j] * mults[j]; + x = tests[i + 2] * mults[j]; + y = tests[i + 3] * mults[j]; + assert(t_csqrt(CMPLXL(a, b)) == CMPLXL(x, y)); + } + } + +} + +/* + * Test the handling of +/- 0. + */ +static void +test_zeros() +{ + + assert_equal(t_csqrt(CMPLXL(0.0, 0.0)), CMPLXL(0.0, 0.0)); + assert_equal(t_csqrt(CMPLXL(-0.0, 0.0)), CMPLXL(0.0, 0.0)); + assert_equal(t_csqrt(CMPLXL(0.0, -0.0)), CMPLXL(0.0, -0.0)); + assert_equal(t_csqrt(CMPLXL(-0.0, -0.0)), CMPLXL(0.0, -0.0)); +} + +/* + * Test the handling of infinities when the other argument is not NaN. + */ +static void +test_infinities() +{ + static const double vals[] = { + 0.0, + -0.0, + 42.0, + -42.0, + INFINITY, + -INFINITY, + }; + + int i; + + for (i = 0; i < nitems(vals); i++) { + if (isfinite(vals[i])) { + assert_equal(t_csqrt(CMPLXL(-INFINITY, vals[i])), + CMPLXL(0.0, copysignl(INFINITY, vals[i]))); + assert_equal(t_csqrt(CMPLXL(INFINITY, vals[i])), + CMPLXL(INFINITY, copysignl(0.0, vals[i]))); + } + assert_equal(t_csqrt(CMPLXL(vals[i], INFINITY)), + CMPLXL(INFINITY, INFINITY)); + assert_equal(t_csqrt(CMPLXL(vals[i], -INFINITY)), + CMPLXL(INFINITY, -INFINITY)); + } +} + +/* + * Test the handling of NaNs. + */ +static void +test_nans() +{ + + assert(creall(t_csqrt(CMPLXL(INFINITY, NAN))) == INFINITY); + assert(isnan(cimagl(t_csqrt(CMPLXL(INFINITY, NAN))))); + + assert(isnan(creall(t_csqrt(CMPLXL(-INFINITY, NAN))))); + assert(isinf(cimagl(t_csqrt(CMPLXL(-INFINITY, NAN))))); + + assert_equal(t_csqrt(CMPLXL(NAN, INFINITY)), + CMPLXL(INFINITY, INFINITY)); + assert_equal(t_csqrt(CMPLXL(NAN, -INFINITY)), + CMPLXL(INFINITY, -INFINITY)); + + assert_equal(t_csqrt(CMPLXL(0.0, NAN)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(-0.0, NAN)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(42.0, NAN)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(-42.0, NAN)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(NAN, 0.0)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(NAN, -0.0)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(NAN, 42.0)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(NAN, -42.0)), CMPLXL(NAN, NAN)); + assert_equal(t_csqrt(CMPLXL(NAN, NAN)), CMPLXL(NAN, NAN)); +} + +/* + * Test whether csqrt(a + bi) works for inputs that are large enough to + * cause overflow in hypot(a, b) + a. In this case we are using + * csqrt(115 + 252*I) == 14 + 9*I + * scaled up to near MAX_EXP. + */ +static void +test_overflow(int maxexp) +{ + long double a, b; + long double complex result; + + a = ldexpl(115 * 0x1p-8, maxexp); + b = ldexpl(252 * 0x1p-8, maxexp); + result = t_csqrt(CMPLXL(a, b)); + assert(creall(result) == ldexpl(14 * 0x1p-4, maxexp / 2)); + assert(cimagl(result) == ldexpl(9 * 0x1p-4, maxexp / 2)); +} + +int +main(int argc, char *argv[]) +{ + + printf("1..15\n"); + + /* Test csqrt() */ + t_csqrt = _csqrt; + + test_finite(); + printf("ok 1 - csqrt\n"); + + test_zeros(); + printf("ok 2 - csqrt\n"); + + test_infinities(); + printf("ok 3 - csqrt\n"); + + test_nans(); + printf("ok 4 - csqrt\n"); + + test_overflow(DBL_MAX_EXP); + printf("ok 5 - csqrt\n"); + + /* Now test csqrtf() */ + t_csqrt = _csqrtf; + + test_finite(); + printf("ok 6 - csqrt\n"); + + test_zeros(); + printf("ok 7 - csqrt\n"); + + test_infinities(); + printf("ok 8 - csqrt\n"); + + test_nans(); + printf("ok 9 - csqrt\n"); + + test_overflow(FLT_MAX_EXP); + printf("ok 10 - csqrt\n"); + + /* Now test csqrtl() */ + t_csqrt = csqrtl; + + test_finite(); + printf("ok 11 - csqrt\n"); + + test_zeros(); + printf("ok 12 - csqrt\n"); + + test_infinities(); + printf("ok 13 - csqrt\n"); + + test_nans(); + printf("ok 14 - csqrt\n"); + + test_overflow(LDBL_MAX_EXP); + printf("ok 15 - csqrt\n"); + + return (0); +} Copied: stable/10/lib/msun/tests/fenv_test.c (from r292328, head/lib/msun/tests/fenv_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/msun/tests/fenv_test.c Wed Jan 6 20:21:40 2016 (r293267, copy of r292328, head/lib/msun/tests/fenv_test.c) @@ -0,0 +1,576 @@ +/*- + * Copyright (c) 2004 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Test the correctness and C99-compliance of various fenv.h features. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Implementations are permitted to define additional exception flags + * not specified in the standard, so it is not necessarily true that + * FE_ALL_EXCEPT == ALL_STD_EXCEPT. + */ +#define ALL_STD_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \ + FE_OVERFLOW | FE_UNDERFLOW) + +#define NEXCEPTS (sizeof(std_excepts) / sizeof(std_excepts[0])) + +static const int std_excepts[] = { + FE_INVALID, + FE_DIVBYZERO, + FE_OVERFLOW, + FE_UNDERFLOW, + FE_INEXACT, +}; + +/* init_exceptsets() initializes this to the power set of std_excepts[] */ +static int std_except_sets[1 << NEXCEPTS]; + +static void init_exceptsets(void); + +static void test_dfl_env(void); +static void test_fegsetenv(void); +static void test_fegsetexceptflag(void); +static void test_masking(void); +static void test_fegsetround(void); +static void test_feholdupdate(void); +static void test_feraiseexcept(void); +static void test_fetestclearexcept(void); + +static int getround(void); +static void raiseexcept(int excepts); +static void trap_handler(int sig); + +#pragma STDC FENV_ACCESS ON + +int +main(int argc, char *argv[]) +{ + + printf("1..8\n"); + init_exceptsets(); + test_dfl_env(); + printf("ok 1 - fenv\n"); + test_fetestclearexcept(); + printf("ok 2 - fenv\n"); + test_fegsetexceptflag(); + printf("ok 3 - fenv\n"); + test_feraiseexcept(); + printf("ok 4 - fenv\n"); + test_fegsetround(); + printf("ok 5 - fenv\n"); + test_fegsetenv(); + printf("ok 6 - fenv\n"); + test_masking(); + printf("ok 7 - fenv\n"); + test_feholdupdate(); + printf("ok 8 - fenv\n"); + + return (0); +} + +/* + * Initialize std_except_sets[] to the power set of std_excepts[] + */ +void +init_exceptsets(void) +{ + int i, j, sr; + + for (i = 0; i < 1 << NEXCEPTS; i++) { + for (sr = i, j = 0; sr != 0; sr >>= 1, j++) + std_except_sets[i] |= std_excepts[j] & ((~sr & 1) - 1); + } +} + +/* + * This tests checks the default FP environment, so it must be first. + * The memcmp() test below may be too much to ask for, since there + * could be multiple machine-specific default environments. + */ +static void +test_dfl_env(void) +{ +#ifndef NO_STRICT_DFL_ENV + fenv_t env; + + fegetenv(&env); + +#ifdef __amd64__ + /* + * Compare the fields that the AMD [1] and Intel [2] specs say will be + * set once fnstenv returns. + * + * Not all amd64 capable processors implement the fnstenv instruction + * by zero'ing out the env.__x87.__other field (example: AMD Opteron + * 6308). The AMD64/x64 specs aren't explicit on what the + * env.__x87.__other field will contain after fnstenv is executed, so + * the values in env.__x87.__other could be filled with arbitrary + * data depending on how the CPU implements fnstenv. + * + * 1. http://support.amd.com/TechDocs/26569_APM_v5.pdf + * 2. http://www.intel.com/Assets/en_US/PDF/manual/253666.pdf + */ + assert(memcmp(&env.__mxcsr, &FE_DFL_ENV->__mxcsr, + sizeof(env.__mxcsr)) == 0); + assert(memcmp(&env.__x87.__control, &FE_DFL_ENV->__x87.__control, + sizeof(env.__x87.__control)) == 0); + assert(memcmp(&env.__x87.__status, &FE_DFL_ENV->__x87.__status, + sizeof(env.__x87.__status)) == 0); + assert(memcmp(&env.__x87.__tag, &FE_DFL_ENV->__x87.__tag, + sizeof(env.__x87.__tag)) == 0); +#else + assert(memcmp(&env, FE_DFL_ENV, sizeof(env)) == 0); +#endif + +#endif + assert(fetestexcept(FE_ALL_EXCEPT) == 0); +} + +/* + * Test fetestexcept() and feclearexcept(). + */ +static void +test_fetestclearexcept(void) +{ + int excepts, i; + + for (i = 0; i < 1 << NEXCEPTS; i++) + assert(fetestexcept(std_except_sets[i]) == 0); + for (i = 0; i < 1 << NEXCEPTS; i++) { + excepts = std_except_sets[i]; + + /* FE_ALL_EXCEPT might be special-cased, as on i386. */ + raiseexcept(excepts); + assert(fetestexcept(excepts) == excepts); + assert(feclearexcept(FE_ALL_EXCEPT) == 0); + assert(fetestexcept(FE_ALL_EXCEPT) == 0); + + raiseexcept(excepts); + assert(fetestexcept(excepts) == excepts); + if ((excepts & (FE_UNDERFLOW | FE_OVERFLOW)) != 0) { + excepts |= FE_INEXACT; + assert((fetestexcept(ALL_STD_EXCEPT) | FE_INEXACT) == + excepts); + } else { + assert(fetestexcept(ALL_STD_EXCEPT) == excepts); + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Wed Jan 6 20:27:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52D34A664C4; Wed, 6 Jan 2016 20:27:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24B391178; Wed, 6 Jan 2016 20:27:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06KRtOt091295; Wed, 6 Jan 2016 20:27:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06KRtE9091294; Wed, 6 Jan 2016 20:27:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601062027.u06KRtE9091294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 6 Jan 2016 20:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293270 - stable/10/tests/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:27:56 -0000 Author: ngie Date: Wed Jan 6 20:27:55 2016 New Revision: 293270 URL: https://svnweb.freebsd.org/changeset/base/293270 Log: MFC r288961,r288962: r288961 (by bdrewery): Fix build with older GCC which, doesn't like 'main' being a variable name. r288962 (by jhb): Tweak: use 'mainlwp' instead of 'mainpid' since this is a thread (LWP) identifier, not a pid. Modified: stable/10/tests/sys/kern/ptrace_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/ptrace_test.c ============================================================================== --- stable/10/tests/sys/kern/ptrace_test.c Wed Jan 6 20:25:41 2016 (r293269) +++ stable/10/tests/sys/kern/ptrace_test.c Wed Jan 6 20:27:55 2016 (r293270) @@ -1017,7 +1017,7 @@ ATF_TC_BODY(ptrace__new_child_pl_syscall { struct ptrace_lwpinfo pl; pid_t fpid, wpid; - lwpid_t main; + lwpid_t mainlwp; int status; ATF_REQUIRE((fpid = fork()) != -1); @@ -1040,7 +1040,7 @@ ATF_TC_BODY(ptrace__new_child_pl_syscall ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); - main = pl.pl_lwpid; + mainlwp = pl.pl_lwpid; /* * Continue the child ignoring the SIGSTOP and tracing all @@ -1065,7 +1065,7 @@ ATF_TC_BODY(ptrace__new_child_pl_syscall sizeof(pl)) != -1); ATF_REQUIRE((pl.pl_flags & PL_FLAG_SCX) != 0); ATF_REQUIRE(pl.pl_syscall_code != 0); - if (pl.pl_lwpid != main) + if (pl.pl_lwpid != mainlwp) /* New thread seen. */ break; From owner-svn-src-stable-10@freebsd.org Wed Jan 6 20:29:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C47EA6662D; Wed, 6 Jan 2016 20:29:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5778C1608; Wed, 6 Jan 2016 20:29:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06KTFSq091471; Wed, 6 Jan 2016 20:29:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06KTFfj091469; Wed, 6 Jan 2016 20:29:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601062029.u06KTFfj091469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 6 Jan 2016 20:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293272 - in stable/10: tests/sys/kern tools/regression/sockets/unix_passfd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:29:16 -0000 Author: ngie Date: Wed Jan 6 20:29:15 2016 New Revision: 293272 URL: https://svnweb.freebsd.org/changeset/base/293272 Log: MFC r292914,r292957: r292914: Integrate tools/regression/sockets/unix_passfd into the FreeBSD test suite as tests/sys/kern/unix_passfd_test - Convert testcases to ATF - Fix an alignment issues - Mark rights_creds_payload(..) as an expected failure (see PR # 181741) https://reviews.freebsd.org/D689 Submitted by: markj r292957: Rename `recvfd` and `sendfd` variables in recvfd/sendfd functions to avoid -Wshadow issues with gcc Added: stable/10/tests/sys/kern/unix_passfd_test.c - copied, changed from r292914, head/tests/sys/kern/unix_passfd_test.c Deleted: stable/10/tools/regression/sockets/unix_passfd/ Modified: stable/10/tests/sys/kern/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/Makefile ============================================================================== --- stable/10/tests/sys/kern/Makefile Wed Jan 6 20:28:09 2016 (r293271) +++ stable/10/tests/sys/kern/Makefile Wed Jan 6 20:29:15 2016 (r293272) @@ -9,6 +9,7 @@ TESTSDIR= ${TESTSBASE}/sys/kern ATF_TESTS_C+= kern_descrip_test ATF_TESTS_C+= ptrace_test ATF_TESTS_C+= unix_seqpacket_test +ATF_TESTS_C+= unix_passfd_test TEST_METADATA.unix_seqpacket_test+= timeout="15" LDADD.ptrace_test+= -lpthread Copied and modified: stable/10/tests/sys/kern/unix_passfd_test.c (from r292914, head/tests/sys/kern/unix_passfd_test.c) ============================================================================== --- head/tests/sys/kern/unix_passfd_test.c Wed Dec 30 11:15:07 2015 (r292914, copy source) +++ stable/10/tests/sys/kern/unix_passfd_test.c Wed Jan 6 20:29:15 2016 (r293272) @@ -109,7 +109,7 @@ samefile(struct stat *sb1, struct stat * } static void -sendfd_payload(int sockfd, int sendfd, void *payload, size_t paylen) +sendfd_payload(int sockfd, int send_fd, void *payload, size_t paylen) { struct iovec iovec; char message[CMSG_SPACE(sizeof(int))]; @@ -133,7 +133,7 @@ sendfd_payload(int sockfd, int sendfd, v cmsghdr->cmsg_len = CMSG_LEN(sizeof(int)); cmsghdr->cmsg_level = SOL_SOCKET; cmsghdr->cmsg_type = SCM_RIGHTS; - memcpy(CMSG_DATA(cmsghdr), &sendfd, sizeof(int)); + memcpy(CMSG_DATA(cmsghdr), &send_fd, sizeof(int)); len = sendmsg(sockfd, &msghdr, 0); ATF_REQUIRE_MSG(len != -1, "sendmsg failed: %s", strerror(errno)); @@ -143,15 +143,15 @@ sendfd_payload(int sockfd, int sendfd, v } static void -sendfd(int sockfd, int sendfd) +sendfd(int sockfd, int send_fd) { char ch = 0; - return (sendfd_payload(sockfd, sendfd, &ch, sizeof(ch))); + return (sendfd_payload(sockfd, send_fd, &ch, sizeof(ch))); } static void -recvfd_payload(int sockfd, int *recvfd, void *buf, size_t buflen) +recvfd_payload(int sockfd, int *recv_fd, void *buf, size_t buflen) { struct cmsghdr *cmsghdr; char message[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + sizeof(int)]; @@ -178,25 +178,25 @@ recvfd_payload(int sockfd, int *recvfd, cmsghdr = CMSG_FIRSTHDR(&msghdr); ATF_REQUIRE_MSG(cmsghdr != NULL, "recvmsg: did not receive control message"); - *recvfd = -1; + *recv_fd = -1; for (; cmsghdr != NULL; cmsghdr = CMSG_NXTHDR(&msghdr, cmsghdr)) { if (cmsghdr->cmsg_level == SOL_SOCKET && cmsghdr->cmsg_type == SCM_RIGHTS && cmsghdr->cmsg_len == CMSG_LEN(sizeof(int))) { - memcpy(recvfd, CMSG_DATA(cmsghdr), sizeof(int)); - ATF_REQUIRE(*recvfd != -1); + memcpy(recv_fd, CMSG_DATA(cmsghdr), sizeof(int)); + ATF_REQUIRE(*recv_fd != -1); } } - ATF_REQUIRE_MSG(*recvfd != -1, + ATF_REQUIRE_MSG(*recv_fd != -1, "recvmsg: did not receive single-fd message"); } static void -recvfd(int sockfd, int *recvfd) +recvfd(int sockfd, int *recv_fd) { char ch = 0; - return (recvfd_payload(sockfd, recvfd, &ch, sizeof(ch))); + return (recvfd_payload(sockfd, recv_fd, &ch, sizeof(ch))); } /* From owner-svn-src-stable-10@freebsd.org Wed Jan 6 20:43:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89E50A66B39; Wed, 6 Jan 2016 20:43:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 573B01193; Wed, 6 Jan 2016 20:43:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06KhfF0097312; Wed, 6 Jan 2016 20:43:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06KhfUi097311; Wed, 6 Jan 2016 20:43:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601062043.u06KhfUi097311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 6 Jan 2016 20:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293273 - stable/10/tests/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:43:42 -0000 Author: ngie Date: Wed Jan 6 20:43:41 2016 New Revision: 293273 URL: https://svnweb.freebsd.org/changeset/base/293273 Log: MFC r271397: r271397 (by asomers): Abort the create_socket test if socket creation fails. CID: 1232756 Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- stable/10/tests/sys/kern/unix_seqpacket_test.c Wed Jan 6 20:29:15 2016 (r293272) +++ stable/10/tests/sys/kern/unix_seqpacket_test.c Wed Jan 6 20:43:41 2016 (r293273) @@ -386,7 +386,7 @@ ATF_TC_BODY(create_socket, tc) int s; s = socket(PF_LOCAL, SOCK_SEQPACKET, 0); - ATF_CHECK(s >= 0); + ATF_REQUIRE(s >= 0); } /* Create SEQPACKET sockets using socketpair(2) */ From owner-svn-src-stable-10@freebsd.org Wed Jan 6 20:50:25 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62DAFA66CD3; Wed, 6 Jan 2016 20:50:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DA1015E9; Wed, 6 Jan 2016 20:50:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u06KoOOx097710; Wed, 6 Jan 2016 20:50:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u06KoOrh097709; Wed, 6 Jan 2016 20:50:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601062050.u06KoOrh097709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 6 Jan 2016 20:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293275 - stable/10/tests/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2016 20:50:25 -0000 Author: ngie Date: Wed Jan 6 20:50:23 2016 New Revision: 293275 URL: https://svnweb.freebsd.org/changeset/base/293275 Log: MFC r270228: r270228 (by asomers): Numerous small fixes, mostly suggested by Coverity. tests/sys/kern/unix_seqpacket_test.c * Remove a duplicate error check in mk_pair_of_sockets * Always close sockets in the success path of ATF test cases. Don't bother with the error paths, because those are mostly assertions anyway. Most of these socket leaks were reported by Coverity. All of them are harmless, because each ATF test case runs in its own process. * Fix the len argument to send in shutdown_send and shutdown_send_sigpipe. The old version was using sizeof a pointer instead of sizeof the char array. Reported by Coverity. * Change a few ATF_CHECK to ATF_REQUIRE if the test can't reasonably continue past a failure. CID: 1229995, 1229991, 1229988, 1229994, 1229989, 1229992 CID: 1229993, 1229990, 1229984, 1229967, 1230005, 1229977 CID: 1229966, 1230004, 1229976 Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- stable/10/tests/sys/kern/unix_seqpacket_test.c Wed Jan 6 20:48:29 2016 (r293274) +++ stable/10/tests/sys/kern/unix_seqpacket_test.c Wed Jan 6 20:50:23 2016 (r293275) @@ -91,7 +91,6 @@ mk_pair_of_sockets(int *sv) err = bind(s, (struct sockaddr *)&sun, sizeof(sun)); err = listen(s, -1); ATF_CHECK_EQ(0, err); - ATF_CHECK_EQ(0, err); /* Create the other socket */ s2 = socket(PF_LOCAL, SOCK_SEQPACKET, 0); @@ -111,6 +110,9 @@ mk_pair_of_sockets(int *sv) sv[0] = s1; sv[1] = s2; + + close(s); + return (path); } @@ -148,8 +150,11 @@ test_eagain(size_t sndbufsize, size_t rc for(i=0; i < numpkts; i++) { ssize = send(sv[0], sndbuf, pktsize, MSG_EOR); if (ssize == -1) { - if (errno == EAGAIN) + if (errno == EAGAIN) { + close(sv[0]); + close(sv[1]); atf_tc_pass(); + } else { perror("send"); atf_tc_fail("send returned < 0 but not EAGAIN"); @@ -199,6 +204,8 @@ test_sendrecv_symmetric_buffers(size_t b } ATF_CHECK_EQ_MSG(pktsize, rsize, "expected %zd=send(...) but got %zd", pktsize, rsize); + close(sv[0]); + close(sv[1]); } static void @@ -274,6 +281,8 @@ test_pipe_simulator(size_t sndbufsize, s } } } + close(sv[0]); + close(sv[1]); } typedef struct { @@ -372,6 +381,8 @@ test_pipe(size_t sndbufsize, size_t rcvb /* Join the children */ ATF_REQUIRE_EQ(0, pthread_join(writer, NULL)); ATF_REQUIRE_EQ(0, pthread_join(reader, NULL)); + close(sv[0]); + close(sv[1]); } @@ -387,6 +398,7 @@ ATF_TC_BODY(create_socket, tc) s = socket(PF_LOCAL, SOCK_SEQPACKET, 0); ATF_REQUIRE(s >= 0); + close(s); } /* Create SEQPACKET sockets using socketpair(2) */ @@ -401,6 +413,8 @@ ATF_TC_BODY(create_socketpair, tc) ATF_CHECK(sv[0] >= 0); ATF_CHECK(sv[1] >= 0); ATF_CHECK(sv[0] != sv[1]); + close(sv[0]); + close(sv[1]); } /* Call listen(2) without first calling bind(2). It should fail */ @@ -414,6 +428,7 @@ ATF_TC_BODY(listen_unbound, tc) r = listen(s, -1); /* expect listen to fail since we haven't called bind(2) */ ATF_CHECK(r != 0); + close(s); } /* Bind the socket to a file */ @@ -434,6 +449,7 @@ ATF_TC_BODY(bind, tc) strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); r = bind(s, (struct sockaddr *)&sun, sizeof(sun)); ATF_CHECK_EQ(0, r); + close(s); } /* listen(2) a socket that is already bound(2) should succeed */ @@ -456,6 +472,7 @@ ATF_TC_BODY(listen_bound, tc) l = listen(s, -1); ATF_CHECK_EQ(0, r); ATF_CHECK_EQ(0, l); + close(s); } /* connect(2) can make a connection */ @@ -487,6 +504,8 @@ ATF_TC_BODY(connect, tc) perror("connect"); atf_tc_fail("connect(2) failed"); } + close(s); + close(s2); } /* accept(2) can receive a connection */ @@ -496,6 +515,8 @@ ATF_TC_BODY(accept, tc) int sv[2]; mk_pair_of_sockets(sv); + close(sv[0]); + close(sv[1]); } @@ -511,6 +532,7 @@ ATF_TC_BODY(fcntl_nonblock, tc) perror("fcntl"); atf_tc_fail("fcntl failed"); } + close(s); } /* Resize the send and receive buffers */ @@ -547,6 +569,7 @@ ATF_TC_BODY(resize_buffers, tc) ATF_CHECK_EQ(0, getsockopt(s, SOL_SOCKET, SO_SNDBUF, &xs, &sl)); ATF_CHECK_EQ(0, getsockopt(s, SOL_SOCKET, SO_RCVBUF, &xr, &sl)); printf("After changing RCVBUF | %7d | %7d |\n", xs, xr); + close(s); } /* @@ -603,6 +626,8 @@ ATF_TC_BODY(resize_connected_buffers, tc ATF_CHECK_EQ(0, getsockopt(sv[1], SOL_SOCKET, SO_RCVBUF, &rr, &sl)); printf("After changing Left's RCVBUF | %7d | %7d | %7d | %7d |\n", ls, lr, rs, rr); + close(sv[0]); + close(sv[1]); } @@ -632,6 +657,8 @@ ATF_TC_BODY(send_recv, tc) rsize = recv(sv[1], recv_buf, bufsize, MSG_WAITALL); ATF_CHECK_EQ(datalen, rsize); + close(sv[0]); + close(sv[1]); } /* sendto(2) and recvfrom(2) a single short record @@ -684,6 +711,8 @@ ATF_TC_BODY(sendto_recvfrom, tc) */ /* ATF_CHECK_EQ(PF_LOCAL, from.ss_family); */ /* ATF_CHECK_STREQ(path, ((struct sockaddr_un*)&from)->sun_path); */ + close(sv[0]); + close(sv[1]); } /* @@ -714,6 +743,8 @@ ATF_TC_BODY(send_recv_with_connect, tc) rsize = recv(sv[1], recv_buf, bufsize, MSG_WAITALL); ATF_CHECK_EQ(datalen, rsize); + close(sv[0]); + close(sv[1]); } /* send(2) should fail on a shutdown socket */ @@ -721,16 +752,17 @@ ATF_TC_WITHOUT_HEAD(shutdown_send); ATF_TC_BODY(shutdown_send, tc) { int s; - const char *data = "data"; + const char data[] = "data"; ssize_t ssize; s = socket(PF_LOCAL, SOCK_SEQPACKET, 0); - ATF_CHECK(s >= 0); + ATF_REQUIRE(s >= 0); ATF_CHECK_EQ(0, shutdown(s, SHUT_RDWR)); /* USE MSG_NOSIGNAL so we don't get SIGPIPE */ ssize = send(s, data, sizeof(data), MSG_EOR | MSG_NOSIGNAL); ATF_CHECK_EQ(EPIPE, errno); ATF_CHECK_EQ(-1, ssize); + close(s); } /* send(2) should cause SIGPIPE on a shutdown socket */ @@ -738,15 +770,16 @@ ATF_TC_WITHOUT_HEAD(shutdown_send_sigpip ATF_TC_BODY(shutdown_send_sigpipe, tc) { int s; - const char *data = "data"; + const char data[] = "data"; ssize_t ssize; s = socket(PF_LOCAL, SOCK_SEQPACKET, 0); - ATF_CHECK(s >= 0); + ATF_REQUIRE(s >= 0); ATF_CHECK_EQ(0, shutdown(s, SHUT_RDWR)); ATF_REQUIRE(SIG_ERR != signal(SIGPIPE, shutdown_send_sigpipe_handler)); ssize = send(s, data, sizeof(data), MSG_EOR); ATF_CHECK_EQ(1, got_sigpipe); + close(s); } /* nonblocking send(2) and recv(2) a single short record */ @@ -780,6 +813,8 @@ ATF_TC_BODY(send_recv_nonblocking, tc) rsize = recv(sv[1], recv_buf, bufsize, MSG_WAITALL); ATF_CHECK_EQ(datalen, rsize); + close(sv[0]); + close(sv[1]); } /* @@ -807,6 +842,8 @@ ATF_TC_BODY(emsgsize, tc) ssize = send(sv[0], sndbuf, pktsize, MSG_EOR); ATF_CHECK_EQ(EMSGSIZE, errno); ATF_CHECK_EQ(-1, ssize); + close(sv[0]); + close(sv[1]); } /* @@ -834,6 +871,8 @@ ATF_TC_BODY(emsgsize_nonblocking, tc) ssize = send(sv[0], sndbuf, pktsize, MSG_EOR); ATF_CHECK_EQ(EMSGSIZE, errno); ATF_CHECK_EQ(-1, ssize); + close(sv[0]); + close(sv[1]); } @@ -924,6 +963,8 @@ ATF_TC_BODY(rcvbuf_oversized, tc) rsize = recv(sv[1], recv_buf, pktsize, MSG_WAITALL); ATF_CHECK_EQ(EAGAIN, errno); ATF_CHECK_EQ(-1, rsize); + close(sv[0]); + close(sv[1]); } /* From owner-svn-src-stable-10@freebsd.org Thu Jan 7 00:40:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 712F6A659EE; Thu, 7 Jan 2016 00:40:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 103EF15E1; Thu, 7 Jan 2016 00:40:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u070euvZ066179; Thu, 7 Jan 2016 00:40:56 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u070epN6066135; Thu, 7 Jan 2016 00:40:51 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601070040.u070epN6066135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jan 2016 00:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293290 - in stable/10: bin/csh sbin/devd sbin/fsck_ffs sbin/natd sbin/newfs_nandfs sbin/rcorder usr.bin/calendar usr.bin/colldef usr.bin/dtc usr.bin/indent usr.bin/locale usr.bin/mkimg... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 00:40:57 -0000 Author: bdrewery Date: Thu Jan 7 00:40:51 2016 New Revision: 293290 URL: https://svnweb.freebsd.org/changeset/base/293290 Log: MFC r289677: Fix a ton of speelling errors Modified: stable/10/bin/csh/config_p.h stable/10/sbin/devd/devd.cc stable/10/sbin/fsck_ffs/fsck.h stable/10/sbin/fsck_ffs/globs.c stable/10/sbin/natd/natd.c stable/10/sbin/newfs_nandfs/newfs_nandfs.c stable/10/sbin/rcorder/rcorder.c stable/10/usr.bin/calendar/parsedata.c stable/10/usr.bin/colldef/parse.y stable/10/usr.bin/dtc/dtb.hh stable/10/usr.bin/indent/indent.1 stable/10/usr.bin/locale/locale.c stable/10/usr.bin/mkimg/mkimg.1 stable/10/usr.bin/mt/mt.c stable/10/usr.bin/patch/pch.c stable/10/usr.bin/pr/egetopt.c stable/10/usr.bin/sed/compile.c stable/10/usr.bin/sockstat/sockstat.c stable/10/usr.bin/vgrind/regexp.c stable/10/usr.sbin/bhyve/pci_emul.c stable/10/usr.sbin/bsdconfig/bsdconfig stable/10/usr.sbin/config/config.h stable/10/usr.sbin/ctld/ctld.c stable/10/usr.sbin/fwcontrol/fwmpegts.c stable/10/usr.sbin/jail/command.c stable/10/usr.sbin/jail/jailp.h stable/10/usr.sbin/jail/jailparse.y stable/10/usr.sbin/jls/jls.c stable/10/usr.sbin/makefs/cd9660.c stable/10/usr.sbin/mfiutil/mfiutil.8 stable/10/usr.sbin/nandsim/nandsim.8 stable/10/usr.sbin/nandsim/nandsim.c stable/10/usr.sbin/nandsim/nandsim_cfgparse.c stable/10/usr.sbin/ndp/ndp.c stable/10/usr.sbin/newsyslog/newsyslog.c stable/10/usr.sbin/pmcstudy/eval_expr.c stable/10/usr.sbin/ppp/ip.c stable/10/usr.sbin/ppp/ppp.8 stable/10/usr.sbin/rtsold/rtsold.h stable/10/usr.sbin/uefisign/magic.h stable/10/usr.sbin/uefisign/pe.c stable/10/usr.sbin/ypbind/ypbind.c stable/10/usr.sbin/ypserv/ypinit.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/csh/config_p.h ============================================================================== --- stable/10/bin/csh/config_p.h Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/bin/csh/config_p.h Thu Jan 7 00:40:51 2016 (r293290) @@ -9,7 +9,7 @@ #ifndef _h_config #define _h_config -/****************** System dependant compilation flags ****************/ +/****************** System dependent compilation flags ****************/ /* * POSIX This system supports IEEE Std 1003.1-1988 (POSIX). */ Modified: stable/10/sbin/devd/devd.cc ============================================================================== --- stable/10/sbin/devd/devd.cc Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/sbin/devd/devd.cc Thu Jan 7 00:40:51 2016 (r293290) @@ -850,7 +850,7 @@ create_socket(const char *name, int sock return (fd); } -unsigned int max_clients = 10; /* Default, can be overriden on cmdline. */ +unsigned int max_clients = 10; /* Default, can be overridden on cmdline. */ unsigned int num_clients; list clients; Modified: stable/10/sbin/fsck_ffs/fsck.h ============================================================================== --- stable/10/sbin/fsck_ffs/fsck.h Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/sbin/fsck_ffs/fsck.h Thu Jan 7 00:40:51 2016 (r293290) @@ -301,7 +301,7 @@ extern char snapname[BUFSIZ]; /* when do extern char *cdevname; /* name of device being checked */ extern long dev_bsize; /* computed value of DEV_BSIZE */ extern long secsize; /* actual disk sector size */ -extern u_int real_dev_bsize; /* actual disk sector size, not overriden */ +extern u_int real_dev_bsize; /* actual disk sector size, not overridden */ extern char nflag; /* assume a no response */ extern char yflag; /* assume a yes response */ extern int bkgrdflag; /* use a snapshot to run on an active system */ Modified: stable/10/sbin/fsck_ffs/globs.c ============================================================================== --- stable/10/sbin/fsck_ffs/globs.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/sbin/fsck_ffs/globs.c Thu Jan 7 00:40:51 2016 (r293290) @@ -73,7 +73,7 @@ char snapname[BUFSIZ]; /* when doing sna char *cdevname; /* name of device being checked */ long dev_bsize; /* computed value of DEV_BSIZE */ long secsize; /* actual disk sector size */ -u_int real_dev_bsize; /* actual disk sector size, not overriden */ +u_int real_dev_bsize; /* actual disk sector size, not overridden */ char nflag; /* assume a no response */ char yflag; /* assume a yes response */ int bkgrdflag; /* use a snapshot to run on an active system */ Modified: stable/10/sbin/natd/natd.c ============================================================================== --- stable/10/sbin/natd/natd.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/sbin/natd/natd.c Thu Jan 7 00:40:51 2016 (r293290) @@ -223,7 +223,7 @@ int main (int argc, char** argv) /* * Create divert sockets. Use only one socket if -p was specified * on command line. Otherwise, create separate sockets for - * outgoing and incoming connnections. + * outgoing and incoming connections. */ if (mip->inOutPort) { Modified: stable/10/sbin/newfs_nandfs/newfs_nandfs.c ============================================================================== --- stable/10/sbin/newfs_nandfs/newfs_nandfs.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/sbin/newfs_nandfs/newfs_nandfs.c Thu Jan 7 00:40:51 2016 (r293290) @@ -1088,7 +1088,7 @@ static void print_summary(void) { - printf("filesystem created succesfully\n"); + printf("filesystem was created successfully\n"); printf("total segments: %#jx valid segments: %#jx\n", nsegments, nsegments - bad_segments_count); printf("total space: %ju MB free: %ju MB\n", Modified: stable/10/sbin/rcorder/rcorder.c ============================================================================== --- stable/10/sbin/rcorder/rcorder.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/sbin/rcorder/rcorder.c Thu Jan 7 00:40:51 2016 (r293290) @@ -220,7 +220,7 @@ strnode_add(strnodelist **listp, char *s /* * below are the functions that deal with creating the lists - * from the filename's given and the dependancies and provisions + * from the filename's given dependencies and provisions * in each of these files. no ordering or checking is done here. */ @@ -696,7 +696,7 @@ keep_ok(filenode *fnode) * * NOTE: do_file() is called recursively from several places and cannot * safely free() anything related to items that may be recursed on. - * Circular dependancies will cause problems if we do. + * Circular dependencies will cause problems if we do. */ static void do_file(filenode *fnode) Modified: stable/10/usr.bin/calendar/parsedata.c ============================================================================== --- stable/10/usr.bin/calendar/parsedata.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.bin/calendar/parsedata.c Thu Jan 7 00:40:51 2016 (r293290) @@ -274,7 +274,7 @@ determinestyle(char *date, int *flags, /* If both the month and date are specified as numbers */ if (isonlydigits(p1, 1) && isonlydigits(p2, 0)) { - /* Now who wants to be this ambigious? :-( */ + /* Now who wants to be this ambiguous? :-( */ int m, d; if (strchr(p2, '*') != NULL) Modified: stable/10/usr.bin/colldef/parse.y ============================================================================== --- stable/10/usr.bin/colldef/parse.y Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.bin/colldef/parse.y Thu Jan 7 00:40:51 2016 (r293290) @@ -134,17 +134,17 @@ order : ORDER order_list { strcpy(__collate_version, COLLATE_VERSION1_2); if (fwrite(__collate_version, sizeof(__collate_version), 1, fp) != 1) err(EX_IOERR, - "IO error writting collate version to destination file %s", + "I/O error writing collate version to destination file %s", out_file); u32 = htonl(chain_index); if (fwrite(&u32, sizeof(u32), 1, fp) != 1) err(EX_IOERR, - "IO error writting chains number to destination file %s", + "I/O error writing chains number to destination file %s", out_file); if (fwrite(__collate_substitute_table, sizeof(__collate_substitute_table), 1, fp) != 1) err(EX_IOERR, - "IO error writting substitute table to destination file %s", + "I/O error writing substitution table to destination file %s", out_file); for (ch = 0; ch < UCHAR_MAX + 1; ch++) { __collate_char_pri_table[ch].prim = @@ -155,7 +155,7 @@ order : ORDER order_list { if (fwrite(__collate_char_pri_table, sizeof(__collate_char_pri_table), 1, fp) != 1) err(EX_IOERR, - "IO error writting char table to destination file %s", + "I/O error writing char table to destination file %s", out_file); for (ch = 0; ch < chain_index; ch++) { __collate_chain_pri_table[ch].prim = @@ -167,10 +167,10 @@ order : ORDER order_list { sizeof(*__collate_chain_pri_table), chain_index, fp) != (size_t)chain_index) err(EX_IOERR, - "IO error writting chain table to destination file %s", + "I/O error writing chain table to destination file %s", out_file); if (fclose(fp) != 0) - err(EX_IOERR, "IO error closing destination file %s", + err(EX_IOERR, "I/O error closing destination file %s", out_file); exit(EX_OK); } Modified: stable/10/usr.bin/dtc/dtb.hh ============================================================================== --- stable/10/usr.bin/dtc/dtb.hh Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.bin/dtc/dtb.hh Thu Jan 7 00:40:51 2016 (r293290) @@ -224,7 +224,7 @@ class asm_writer : public output_writer uint32_t bytes_written; /** - * Writes a C string directly to the ouput as-is. This is mainly used + * Writes a C string directly to the output as-is. This is mainly used * for writing directives. */ void write_string(const char *c); Modified: stable/10/usr.bin/indent/indent.1 ============================================================================== --- stable/10/usr.bin/indent/indent.1 Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.bin/indent/indent.1 Thu Jan 7 00:40:51 2016 (r293290) @@ -523,7 +523,7 @@ The utility understands a substantial amount about the syntax of C, but it has a `forgiving' parser. It attempts to cope with the usual sorts of -incomplete and misformed syntax. +incomplete and malformed syntax. In particular, the use of macros like: .Pp .Dl #define forever for(;;) Modified: stable/10/usr.bin/locale/locale.c ============================================================================== --- stable/10/usr.bin/locale/locale.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.bin/locale/locale.c Thu Jan 7 00:40:51 2016 (r293290) @@ -466,10 +466,10 @@ showlocale(void) && strcmp(lang, vval)) { /* * Appropriate environment variable set, its value - * is valid and not overriden by LC_ALL + * is valid and not overridden by LC_ALL * * XXX: possible side effect: if both LANG and - * overriden environment variable are set into same + * overridden environment variable are set into same * value, then it'll be assumed as 'implied' */ printf("%s=%s\n", lcinfo[i].name, vval); Modified: stable/10/usr.bin/mkimg/mkimg.1 ============================================================================== --- stable/10/usr.bin/mkimg/mkimg.1 Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.bin/mkimg/mkimg.1 Thu Jan 7 00:40:51 2016 (r293290) @@ -289,7 +289,7 @@ utility as follows: .Dl % mkimg -s mbr -b /boot/mbr -p freebsd:-'mkimg -s bsd -b /boot/boot \ -p freebsd-ufs:=root-file-system.ufs -p freebsd-swap::1G' -o mbr-bsd.img .Pp -To accomodate the need to have partitions named or numbered in a certain +To accommodate the need to have partitions named or numbered in a certain way, the .Nm utility allows for the specification of empty partitions. Modified: stable/10/usr.bin/mt/mt.c ============================================================================== --- stable/10/usr.bin/mt/mt.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.bin/mt/mt.c Thu Jan 7 00:40:51 2016 (r293290) @@ -1343,7 +1343,7 @@ mt_param(int argc, char **argv, int mtfd break; case 'p': if (param_name != NULL) { - warnx("Only one paramter name may be " + warnx("Only one parameter name may be " "specified"); retval = 1; goto bailout; @@ -1355,7 +1355,7 @@ mt_param(int argc, char **argv, int mtfd break; case 's': if (param_value != NULL) { - warnx("Only one paramter value may be " + warnx("Only one parameter value may be " "specified"); retval = 1; goto bailout; Modified: stable/10/usr.bin/patch/pch.c ============================================================================== --- stable/10/usr.bin/patch/pch.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.bin/patch/pch.c Thu Jan 7 00:40:51 2016 (r293290) @@ -499,7 +499,7 @@ another_hunk(void) LINENUM fillcnt; /* #lines of missing ptrn or repl */ LINENUM fillsrc; /* index of first line to copy */ LINENUM filldst; /* index of first missing line */ - bool ptrn_spaces_eaten; /* ptrn was slightly misformed */ + bool ptrn_spaces_eaten; /* ptrn was slightly malformed */ bool repl_could_be_missing; /* no + or ! lines in this hunk */ bool repl_missing; /* we are now backtracking */ off_t repl_backtrack_position; /* file pos of first repl line */ Modified: stable/10/usr.bin/pr/egetopt.c ============================================================================== --- stable/10/usr.bin/pr/egetopt.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.bin/pr/egetopt.c Thu Jan 7 00:40:51 2016 (r293290) @@ -76,7 +76,7 @@ egetopt(int nargc, char * const *nargv, { static char *place = emsg; /* option letter processing */ char *oli; /* option letter list index */ - static int delim; /* which option delimeter */ + static int delim; /* which option delimiter */ char *p; static char savec = '\0'; Modified: stable/10/usr.bin/sed/compile.c ============================================================================== --- stable/10/usr.bin/sed/compile.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.bin/sed/compile.c Thu Jan 7 00:40:51 2016 (r293290) @@ -364,7 +364,7 @@ nonsel: /* Now parse the command */ } /* - * Get a delimited string. P points to the delimeter of the string; d points + * Get a delimited string. P points to the delimiter of the string; d points * to a buffer area. Newline and delimiter escapes are processed; other * escapes are ignored. * Modified: stable/10/usr.bin/sockstat/sockstat.c ============================================================================== --- stable/10/usr.bin/sockstat/sockstat.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.bin/sockstat/sockstat.c Thu Jan 7 00:40:51 2016 (r293290) @@ -365,7 +365,7 @@ gather_sctp(void) htons(xinpcb->local_port)); break; default: - errx(1, "adress family %d not supported", + errx(1, "address family %d not supported", xladdr->address.sa.sa_family); } laddr->next = NULL; @@ -457,7 +457,7 @@ gather_sctp(void) htons(xstcb->local_port)); break; default: - errx(1, "adress family %d not supported", + errx(1, "address family %d not supported", xladdr->address.sa.sa_family); } laddr->next = NULL; @@ -499,7 +499,7 @@ gather_sctp(void) htons(xstcb->remote_port)); break; default: - errx(1, "adress family %d not supported", + errx(1, "address family %d not supported", xraddr->address.sa.sa_family); } faddr->next = NULL; Modified: stable/10/usr.bin/vgrind/regexp.c ============================================================================== --- stable/10/usr.bin/vgrind/regexp.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.bin/vgrind/regexp.c Thu Jan 7 00:40:51 2016 (r293290) @@ -318,7 +318,7 @@ expconv() /* - * The following routine recognises an irregular expresion + * The following routine recognises an irregular expression * with the following special characters: * * \? - means last match was optional Modified: stable/10/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_emul.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/bhyve/pci_emul.c Thu Jan 7 00:40:51 2016 (r293290) @@ -295,7 +295,7 @@ pci_emul_msix_tread(struct pci_devinst * /* * The PCI standard only allows 4 and 8 byte accesses to the MSI-X - * table but we also allow 1 byte access to accomodate reads from + * table but we also allow 1 byte access to accommodate reads from * ddb. */ if (size != 1 && size != 4 && size != 8) Modified: stable/10/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- stable/10/usr.sbin/bsdconfig/bsdconfig Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/bsdconfig/bsdconfig Thu Jan 7 00:40:51 2016 (r293290) @@ -131,7 +131,7 @@ usage() # determine if we can use more than one column to display commands. # local x=$longest_cmd ncols=1 - x=$(( $x + 8 )) # Accomodate leading tab character + x=$(( $x + 8 )) # Accommodate leading tab character x=$(( $x + 3 + $longest_cmd )) # Preload end of next column while [ $x -lt $max_width ]; do ncols=$(( $ncols + 1 )) Modified: stable/10/usr.sbin/config/config.h ============================================================================== --- stable/10/usr.sbin/config/config.h Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/config/config.h Thu Jan 7 00:40:51 2016 (r293290) @@ -50,7 +50,7 @@ struct file_list { int f_type; /* type */ u_char f_flags; /* see below */ char *f_compilewith; /* special make rule if present */ - char *f_depends; /* additional dependancies */ + char *f_depends; /* additional dependencies */ char *f_clean; /* File list to add to clean rule */ char *f_warn; /* warning message */ const char *f_objprefix; /* prefix string for object name */ Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/ctld/ctld.c Thu Jan 7 00:40:51 2016 (r293290) @@ -2012,7 +2012,7 @@ conf_apply(struct conf *oldconf, struct } /* - * Go through the new portals, opening the sockets as neccessary. + * Go through the new portals, opening the sockets as necessary. */ TAILQ_FOREACH(newpg, &newconf->conf_portal_groups, pg_next) { if (newpg->pg_foreign) Modified: stable/10/usr.sbin/fwcontrol/fwmpegts.c ============================================================================== --- stable/10/usr.sbin/fwcontrol/fwmpegts.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/fwcontrol/fwmpegts.c Thu Jan 7 00:40:51 2016 (r293290) @@ -119,7 +119,7 @@ bandwidth (R): 2) 1.5 < R < 3 Mbps: db0/db1 or db2/db3 or db4/db5 or db6/db7 is payload, 3) 3 < R < 6 Mbps: db0/db1/db2/db3 or db4/db5/db6/db7 is payload, 4) R > 6 Mbps: all db0..db7 contain the payload. -Curently, only case (4) is supported in fwmpegts.c +Currently, only case (4) is supported in fwmpegts.c Each packet may contain N MPEG TS data blocks with timestamp header, which are (4+188)B long. Experimentally, the N ranges from 0 through 3. Modified: stable/10/usr.sbin/jail/command.c ============================================================================== --- stable/10/usr.sbin/jail/command.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/jail/command.c Thu Jan 7 00:40:51 2016 (r293290) @@ -762,7 +762,7 @@ add_proc(struct cfjail *j, pid_t pid) if (j->timeout.tv_sec == 0) requeue(j, &sleeping); else { - /* File the jail in the sleep queue acording to its timeout. */ + /* File the jail in the sleep queue according to its timeout. */ TAILQ_REMOVE(j->queue, j, tq); TAILQ_FOREACH(tj, &sleeping, tq) { if (!tj->timeout.tv_sec || Modified: stable/10/usr.sbin/jail/jailp.h ============================================================================== --- stable/10/usr.sbin/jail/jailp.h Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/jail/jailp.h Thu Jan 7 00:40:51 2016 (r293290) @@ -41,7 +41,7 @@ #define DF_SEEN 0x01 /* Dependency has been followed */ #define DF_LIGHT 0x02 /* Implied dependency on jail existence only */ -#define DF_NOFAIL 0x04 /* Don't propigate failed jails */ +#define DF_NOFAIL 0x04 /* Don't propagate failed jails */ #define PF_VAR 0x01 /* This is a variable, not a true parameter */ #define PF_APPEND 0x02 /* Append to existing parameter list */ Modified: stable/10/usr.sbin/jail/jailparse.y ============================================================================== --- stable/10/usr.sbin/jail/jailparse.y Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/jail/jailparse.y Thu Jan 7 00:40:51 2016 (r293290) @@ -103,7 +103,7 @@ param_l : /* * Parameters have a name and an optional list of value strings, - * which may have "+=" or "=" preceeding them. + * which may have "+=" or "=" preceding them. */ param : name { Modified: stable/10/usr.sbin/jls/jls.c ============================================================================== --- stable/10/usr.sbin/jls/jls.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/jls/jls.c Thu Jan 7 00:40:51 2016 (r293290) @@ -220,7 +220,7 @@ main(int argc, char **argv) putchar('\n'); } - /* Fetch the jail(s) and print the paramters. */ + /* Fetch the jail(s) and print the parameters. */ if (jid != 0 || jname != NULL) { if (print_jail(pflags, jflags) < 0) errx(1, "%s", jail_errmsg); Modified: stable/10/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/10/usr.sbin/makefs/cd9660.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/makefs/cd9660.c Thu Jan 7 00:40:51 2016 (r293290) @@ -163,7 +163,7 @@ static cd9660node *cd9660_create_special /* - * Allocate and initalize a cd9660node + * Allocate and initialize a cd9660node * @returns struct cd9660node * Pointer to new node, or NULL on error */ static cd9660node * Modified: stable/10/usr.sbin/mfiutil/mfiutil.8 ============================================================================== --- stable/10/usr.sbin/mfiutil/mfiutil.8 Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/mfiutil/mfiutil.8 Thu Jan 7 00:40:51 2016 (r293290) @@ -607,25 +607,25 @@ Scan for foreign configurations and disp argument for the commands below takes the form of a number from 0 to the total configurations found. .It Cm foreign clear Op config -Clear the specifed foreign +Clear the specified foreign .Ar config or all if no .Ar config argument is provided. .It Cm foreign diag Op config -Display a diagnostic display of the specifed foreign +Display a diagnostic display of the specified foreign .Ar config or all if no .Ar config argument is provided. .It Cm foreign preview Op config -Preview the specifed foreign +Preview the specified foreign .Ar config after import or all if no .Ar config argument is provided. .It Cm foreign import Op config -Import the specifed foreign +Import the specified foreign .Ar config or all if no .Ar config Modified: stable/10/usr.sbin/nandsim/nandsim.8 ============================================================================== --- stable/10/usr.sbin/nandsim/nandsim.8 Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/nandsim/nandsim.8 Thu Jan 7 00:40:51 2016 (r293290) @@ -177,7 +177,7 @@ list all blocks marked as bad on a given .El .It Ic log Prints activity log of the specified controller to stdout; if -controller number is not specifed, logs for all available +controller number is not specified, logs for all available controllers are printed. .It Ic stats Print statistics of the selected controller, chip and page. Modified: stable/10/usr.sbin/nandsim/nandsim.c ============================================================================== --- stable/10/usr.sbin/nandsim/nandsim.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/nandsim/nandsim.c Thu Jan 7 00:40:51 2016 (r293290) @@ -421,7 +421,7 @@ cmdmod(int gargc __unused, char **gargv) if (gargc >= 4) { if (strcmp(gargv[2], "--loglevel") == 0 || strcmp(gargv[2], "-l") == 0) { - /* Set loglevel (ctrl:chip pair independant) */ + /* Set loglevel (ctrl:chip pair independent) */ mods.field = SIM_MOD_LOG_LEVEL; if (convert_arguint(gargv[3], &mods.new_value) != 0) Modified: stable/10/usr.sbin/nandsim/nandsim_cfgparse.c ============================================================================== --- stable/10/usr.sbin/nandsim/nandsim_cfgparse.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/nandsim/nandsim_cfgparse.c Thu Jan 7 00:40:51 2016 (r293290) @@ -349,7 +349,7 @@ create_ctrls(struct rcfile *f, struct si /* * ECC layout have to end up with 0xffff, so * we're filling buffer with 0xff. If ecc_layout is - * defined in config file, values will be overriden. + * defined in config file, values will be overridden. */ memset((void *)&ctrl_conf.ecc_layout, 0xff, sizeof(ctrl_conf.ecc_layout)); @@ -411,7 +411,7 @@ create_chips(struct rcfile *f, struct si /* * Bad block map have to end up with 0xffff, so * we're filling array with 0xff. If bad block map is - * defined in config file, values will be overriden. + * defined in config file, values will be overridden. */ memset((void *)&chip_conf.bad_block_map, 0xff, sizeof(chip_conf.bad_block_map)); Modified: stable/10/usr.sbin/ndp/ndp.c ============================================================================== --- stable/10/usr.sbin/ndp/ndp.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/ndp/ndp.c Thu Jan 7 00:40:51 2016 (r293290) @@ -679,7 +679,7 @@ again:; printf("%-*.*s %-*.*s %*.*s", addrwidth, addrwidth, host_buf, llwidth, llwidth, ether_str(sdl), ifwidth, ifwidth, ifname); - /* Print neighbor discovery specific informations */ + /* Print neighbor discovery specific information */ nbi = getnbrinfo(&sin->sin6_addr, sdl->sdl_index, 1); if (nbi) { if (nbi->expire > now.tv_sec) { Modified: stable/10/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/10/usr.sbin/newsyslog/newsyslog.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/newsyslog/newsyslog.c Thu Jan 7 00:40:51 2016 (r293290) @@ -1913,7 +1913,7 @@ do_sigwork(struct sigwork_entry *swork) /* * Compute the pause between consecutive signals. Use a longer * sleep time if we will be sending two signals to the same - * deamon or process-group. + * daemon or process-group. */ secs = 0; nextsig = SLIST_NEXT(swork, sw_nextp); Modified: stable/10/usr.sbin/pmcstudy/eval_expr.c ============================================================================== --- stable/10/usr.sbin/pmcstudy/eval_expr.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/pmcstudy/eval_expr.c Thu Jan 7 00:40:51 2016 (r293290) @@ -444,7 +444,7 @@ parse_expression(char *str) * val OP val * val OP ( * d) A final optional step (not implemented yet) would be - * to insert the mathimatical precedence paran's. For + * to insert the mathematical precedence paran's. For * the start we will just do the left to right evaluation and * then later we can add this guy to add paran's to make it * mathimatically correct... i.e instead of 1 + 2 * 3 we Modified: stable/10/usr.sbin/ppp/ip.c ============================================================================== --- stable/10/usr.sbin/ppp/ip.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/ppp/ip.c Thu Jan 7 00:40:51 2016 (r293290) @@ -473,7 +473,7 @@ FilterCheck(const unsigned char *packet, ncpaddr_ntoa(&srcaddr), sport, dstip, dport); } return 1; - } /* Explict match. Deny this packet */ + } /* Explicit match. Deny this packet */ } } else { n++; Modified: stable/10/usr.sbin/ppp/ppp.8 ============================================================================== --- stable/10/usr.sbin/ppp/ppp.8 Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/ppp/ppp.8 Thu Jan 7 00:40:51 2016 (r293290) @@ -5412,7 +5412,7 @@ and .Dq default can be used for .Ar dest -to sepcify the default route, and +to specify the default route, and .Dq 0.0.0.0 is understood to be the same as .Dq default @@ -5463,7 +5463,7 @@ and .Dq default can be used for .Ar dest -to sepcify the default route, and +to specify the default route, and .Dq :: is understood to be the same as .Dq default Modified: stable/10/usr.sbin/rtsold/rtsold.h ============================================================================== --- stable/10/usr.sbin/rtsold/rtsold.h Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/rtsold/rtsold.h Thu Jan 7 00:40:51 2016 (r293290) @@ -67,7 +67,7 @@ struct ifinfo { int active; /* interface status */ int probeinterval; /* interval of probe timer (if necessary) */ int probetimer; /* rest of probe timer */ - int mediareqok; /* wheter the IF supports SIOCGIFMEDIA */ + int mediareqok; /* whether the IF supports SIOCGIFMEDIA */ int otherconfig; /* need a separate protocol for the "other" * configuration */ int state; Modified: stable/10/usr.sbin/uefisign/magic.h ============================================================================== --- stable/10/usr.sbin/uefisign/magic.h Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/uefisign/magic.h Thu Jan 7 00:40:51 2016 (r293290) @@ -50,7 +50,7 @@ static const char *magic_fmt = "a = FORMAT:HEX,BITSTRING:00\n" /* * Well, there should be some other struct here, "SPCLink", but it doesn't - * appear to be neccessary for UEFI, and I have no idea how to synthesize it, + * appear to be necessary for UEFI, and I have no idea how to synthesize it, * as it uses the CHOICE type. */ "\n" Modified: stable/10/usr.sbin/uefisign/pe.c ============================================================================== --- stable/10/usr.sbin/uefisign/pe.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/uefisign/pe.c Thu Jan 7 00:40:51 2016 (r293290) @@ -304,7 +304,7 @@ parse_directory(struct executable *x, of * Note that most software does not care about the checksum at all; perhaps * we could just set it to 0 instead. * - * XXX: Endianess? + * XXX: Endianness? */ static uint32_t compute_checksum(const struct executable *x) Modified: stable/10/usr.sbin/ypbind/ypbind.c ============================================================================== --- stable/10/usr.sbin/ypbind/ypbind.c Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/ypbind/ypbind.c Thu Jan 7 00:40:51 2016 (r293290) @@ -392,7 +392,7 @@ main(int argc, char *argv[]) if (flock(yplockfd, LOCK_EX|LOCK_NB) == -1 && errno == EWOULDBLOCK) errx(1, "another ypbind is already running. Aborting"); - /* XXX domainname will be overriden if we use restricted mode */ + /* XXX domainname will be overridden if we use restricted mode */ yp_get_default_domain(&domain_name); if (domain_name[0] == '\0') errx(1, "domainname not set. Aborting"); Modified: stable/10/usr.sbin/ypserv/ypinit.sh ============================================================================== --- stable/10/usr.sbin/ypserv/ypinit.sh Thu Jan 7 00:32:40 2016 (r293289) +++ stable/10/usr.sbin/ypserv/ypinit.sh Thu Jan 7 00:40:51 2016 (r293290) @@ -235,7 +235,7 @@ then for MAP in ${YPMAPLIST} do - echo "Transfering ${MAP}..." + echo "Transferring ${MAP}..." if ! ${YPXFR} -p ${YP_DIR} -h ${MASTER} -c -d ${DOMAIN} ${MAP}; then echo "Can't transfer map ${MAP}." 1>&2 ERROR_EXISTS="YES" From owner-svn-src-stable-10@freebsd.org Thu Jan 7 00:42:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 274ECA65A9F; Thu, 7 Jan 2016 00:42:40 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB2461947; Thu, 7 Jan 2016 00:42:39 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u070gddS068830; Thu, 7 Jan 2016 00:42:39 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u070gd3q068829; Thu, 7 Jan 2016 00:42:39 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601070042.u070gd3q068829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 7 Jan 2016 00:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293291 - stable/10/usr.sbin/bsdconfig/console X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 00:42:40 -0000 Author: dteske Date: Thu Jan 7 00:42:38 2016 New Revision: 293291 URL: https://svnweb.freebsd.org/changeset/base/293291 Log: MFC r278492: Add "vt_"* aliases to bsdconfig console entries. NB: "syscons_"* kept for backward compatibility Modified: stable/10/usr.sbin/bsdconfig/console/INDEX Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/console/INDEX ============================================================================== --- stable/10/usr.sbin/bsdconfig/console/INDEX Thu Jan 7 00:40:51 2016 (r293290) +++ stable/10/usr.sbin/bsdconfig/console/INDEX Thu Jan 7 00:42:38 2016 (r293291) @@ -46,6 +46,13 @@ menu_help="Customize system console beha # can be i18n'ed but `command' is the name of a script. # menu_selection="console|console" +menu_selection="vt_font|font" +menu_selection="vt_keymap|keymap" +menu_selection="vt_repeat|repeat" +menu_selection="vt_saver|saver" +menu_selection="vt_screenmap|screenmap" +menu_selection="vt_ttys|ttys" +# For backward compatibility menu_selection="syscons_font|font" menu_selection="syscons_keymap|keymap" menu_selection="syscons_repeat|repeat" From owner-svn-src-stable-10@freebsd.org Thu Jan 7 00:53:08 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 961DBA65D78; Thu, 7 Jan 2016 00:53:08 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64FF91D15; Thu, 7 Jan 2016 00:53:08 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u070r7QT071678; Thu, 7 Jan 2016 00:53:07 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u070r7U3071677; Thu, 7 Jan 2016 00:53:07 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601070053.u070r7U3071677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 7 Jan 2016 00:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293292 - stable/10/usr.sbin/bsdconfig/share X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 00:53:08 -0000 Author: dteske Date: Thu Jan 7 00:53:07 2016 New Revision: 293292 URL: https://svnweb.freebsd.org/changeset/base/293292 Log: MFC r290693: Add support for "rc.conf.d" file(s). Differential Revision: https://reviews.freebsd.org/D3551 Reviewed by: allanjude Relnotes: yes Modified: stable/10/usr.sbin/bsdconfig/share/sysrc.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/sysrc.subr Thu Jan 7 00:42:38 2016 (r293291) +++ stable/10/usr.sbin/bsdconfig/share/sysrc.subr Thu Jan 7 00:53:07 2016 (r293292) @@ -1,6 +1,6 @@ if [ ! "$_SYSRC_SUBR" ]; then _SYSRC_SUBR=1 # -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2015 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -204,6 +204,100 @@ f_sysrc_get() ) } +# f_sysrc_service_configs [-a|-p] $name [$var_to_set] +# +# Get a list of optional `rc.conf.d' entries sourced by system `rc.d' script +# $name (see rc.subr(8) for additional information on `rc.conf.d'). If $name +# exists in `/etc/rc.d' or $local_startup directories and is an rc(8) script +# the result is a space separated list of `rc.conf.d' entries sourced by the +# $name `rc.d' script. Otherwise, if $name exists as a binary `rc.d' script, +# the result is ``/etc/rc.conf.d/$name /usr/local/etc/rc.conf.d/$name''. The +# result is NULL if $name does not exist. +# +# If $var_to_set is missing or NULL, output is to standard out. Returns success +# if $name was found, failure otherwise. +# +# If `-a' flag is given and $var_to_set is non-NULL, append result to value of +# $var_to_set rather than overwriting current contents. +# +# If `-p' flag is given and $var_to_set is non-NULL, prepend result to value of +# $var_to_set rather than overwriting current contents. +# +# NB: The `-a' and `-p' option flags are mutually exclusive. +# +f_sysrc_service_configs() +{ + local OPTIND=1 OPTARG __flag __append= __prepend= + local __local_startup __dir __spath __stype __names= + + while getopts ap __flag; do + case "$__flag" in + a) __append=1 __prepend= ;; + p) __prepend=1 __append= ;; + esac + done + shift $(( $OPTIND - 1 )) + + [ $# -gt 0 ] || return $FAILURE + local __sname="$1" __var_to_set="$2" + + __local_startup=$( f_sysrc_get local_startup ) + for __dir in /etc/rc.d $__local_startup; do + __spath="$__dir/$__sname" + [ -f "$__spath" -a -x "$__spath" ] || __spath= continue + break + done + [ "$__spath" ] || return $FAILURE + + __stype=$( file -b "$__spath" 2> /dev/null ) + case "$__stype" in + *"shell script"*) + __names=$( exec 9<&1 1>&- 2>&- + last_name= + print_name() { + local name="$1" + [ "$name" = "$last_name" ] && return + echo "$name" >&9 + last_name="$name" + } + eval "$( awk '{ + gsub(/load_rc_config /, "print_name ") + gsub(/run_rc_command /, ": ") + print + }' "$__spath" )" + ) ;; + *) + __names="$__sname" + esac + + local __name __test_path __configs= + for __name in $__names; do + for __dir in /etc/rc.d $__local_startup; do + __test_path="${__dir%/rc.d}/rc.conf.d/$__name" + [ -d "$__test_path" ] || + __configs="$__configs $__test_path" continue + for __test_path in "$__test_path"/*; do + [ -f "$__test_path" ] || continue + __configs="$__configs $__test_path" + done + done + done + __configs="${__configs# }" + + if [ "$__var_to_set" ]; then + local __cur= + [ "$__append" -o "$__prepend" ] && + f_getvar "$__var_to_set" __cur + [ "$__append" ] && __configs="$__cur{$__cur:+ }$__configs" + [ "$__prepend" ] && __configs="$__configs${__cur:+ }$__cur" + setvar "$__var_to_set" "$__configs" + else + echo "$__configs" + fi + + return $SUCCESS +} + # f_sysrc_get_default $varname # # Get a system configuration default setting from the default rc.conf(5) file From owner-svn-src-stable-10@freebsd.org Thu Jan 7 01:33:44 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33C7EA667CF; Thu, 7 Jan 2016 01:33:44 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05DD01AEE; Thu, 7 Jan 2016 01:33:43 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u071XhpU083185; Thu, 7 Jan 2016 01:33:43 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u071Xh7H083184; Thu, 7 Jan 2016 01:33:43 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601070133.u071Xh7H083184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 7 Jan 2016 01:33:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293293 - stable/10/sys/boot/forth X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 01:33:44 -0000 Author: dteske Date: Thu Jan 7 01:33:42 2016 New Revision: 293293 URL: https://svnweb.freebsd.org/changeset/base/293293 Log: MFC SVN revisions 280922,285875,285882. r280922: Change contents of the exec variable in loader.conf (dteske/rpaulo) r285875: Use double newlines consistently (trasz/foundation) r285882: Use consistent spacing (trasz/foundation) Modified: stable/10/sys/boot/forth/loader.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/forth/loader.conf ============================================================================== --- stable/10/sys/boot/forth/loader.conf Thu Jan 7 00:53:07 2016 (r293292) +++ stable/10/sys/boot/forth/loader.conf Thu Jan 7 01:33:42 2016 (r293293) @@ -12,7 +12,7 @@ ### Basic configuration options ############################ ############################################################## -exec=".( Loading /boot/defaults/loader.conf ) cr" +exec="echo Loading /boot/defaults/loader.conf" kernel="kernel" # /boot sub-directory containing kernel and modules bootfile="kernel" # Kernel name (possibly absolute path) @@ -39,7 +39,7 @@ bitmap_type="splash_image_data" # and pl ############################################################## -### Random number generator configuration ################### +### Random number generator configuration ################## ############################################################## entropy_cache_load="NO" # Set this to YES to load entropy at boot time @@ -156,7 +156,7 @@ module_path="/boot/modules" # Set the mo ############################################################## -### ATA modules ############################################## +### ATA modules ############################################ ############################################################## ataacard_load="NO" # ACARD @@ -378,6 +378,7 @@ if_xe_load="NO" # Xircom CreditCard PC if_xl_load="NO" # 3Com Etherlink XL (3c900, 3c905, 3c905B) utopia_load="NO" # ATM PHY driver + ############################################################## ### Netgraph modules ####################################### ############################################################## @@ -420,6 +421,7 @@ ng_tty_load="NO" # Netgraph node type t ng_vjc_load="NO" # Van Jacobsen compression netgraph node type ng_vlan_load="NO" # IEEE 802.1Q VLAN tagging netgraph node type + ############################################################## ### Sound modules ########################################## ############################################################## @@ -456,6 +458,7 @@ snd_via82c686_load="NO" # via82c686 snd_vibes_load="NO" # vibes snd_driver_load="NO" # All sound drivers + ############################################################## ### USB modules ############################################ ############################################################## @@ -488,6 +491,7 @@ if_ural_load="NO" # Ralink RT2500USB 80 if_zyd_load="NO" # ZyDAS ZD1211(B) USB 802.11 wireless adapter snd_uaudio_load="NO" # USB audio + ############################################################## ### Other modules ########################################## ############################################################## @@ -512,6 +516,7 @@ amdtemp_load="NO" # AMD K8/K10/K11 temp tpm_load="NO" # Trusted Platform Module wbwd_load="NO" # Winbond watchdog + ############################################################## ### ACPI settings ########################################## ############################################################## @@ -522,8 +527,9 @@ acpi_dsdt_name="/boot/acpi_dsdt.aml" # Override DSDT in BIOS by this file acpi_video_load="NO" # Load the ACPI video extension driver + ############################################################## -### TrustedBSD MAC settings ################################## +### TrustedBSD MAC settings ################################ ############################################################## mac_biba_load="NO" # Biba MAC policy @@ -534,6 +540,7 @@ mac_none_load="NO" # Null MAC policy mac_partition_load="NO" # Partition MAC policy mac_seeotheruids_load="NO" # UID visbility MAC policy + ############################################################## ### Module loading syntax example ########################## ############################################################## From owner-svn-src-stable-10@freebsd.org Thu Jan 7 01:50:52 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91688A66CDD; Thu, 7 Jan 2016 01:50:52 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56269157A; Thu, 7 Jan 2016 01:50:52 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u071opJt086740; Thu, 7 Jan 2016 01:50:51 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u071oof0086732; Thu, 7 Jan 2016 01:50:50 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601070150.u071oof0086732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 7 Jan 2016 01:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293294 - in stable/10: . sys/boot/forth sys/boot/i386/loader sys/boot/pc98/loader sys/boot/powerpc/ofw sys/boot/powerpc/ps3 sys/boot/sparc64/loader X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 01:50:52 -0000 Author: dteske Date: Thu Jan 7 01:50:50 2016 New Revision: 293294 URL: https://svnweb.freebsd.org/changeset/base/293294 Log: MFC r286368: Remove guards around overwriting loader.rc and menu.rc There have been .local version of each for user modifications for some time This allows users to receive future updates to these files PR: 183765 Differential Revision: https://reviews.freebsd.org/D3176 Submitted by: Bertram Scharpf, Nikolai Lifanov (patch) Reviewed by: dteske, loos, eadler Approved by: bapt (mentor) Relnotes: yes Sponsored by: ScaleEngine Inc. Modified: stable/10/UPDATING stable/10/sys/boot/forth/loader.rc stable/10/sys/boot/forth/menu.rc stable/10/sys/boot/i386/loader/Makefile stable/10/sys/boot/pc98/loader/Makefile stable/10/sys/boot/powerpc/ofw/Makefile stable/10/sys/boot/powerpc/ps3/Makefile stable/10/sys/boot/sparc64/loader/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Thu Jan 7 01:33:42 2016 (r293293) +++ stable/10/UPDATING Thu Jan 7 01:50:50 2016 (r293294) @@ -26,6 +26,11 @@ older version of current is a bit fragil Kernel modules isp_2400_multi and isp_2500_multi were removed and should be replaced with isp_2400 and isp_2500 modules respectively. +20150806: + The menu.rc and loader.rc files will now be replaced during + upgrades. Please migrate local changes to menu.rc.local and + loader.rc.local instead. + 20151026: NTP has been upgraded to 4.2.8p4. Modified: stable/10/sys/boot/forth/loader.rc ============================================================================== --- stable/10/sys/boot/forth/loader.rc Thu Jan 7 01:33:42 2016 (r293293) +++ stable/10/sys/boot/forth/loader.rc Thu Jan 7 01:50:50 2016 (r293294) @@ -1,6 +1,9 @@ \ Loader.rc \ $FreeBSD$ \ +\ You should not edit this file! Put any overrides in loader.rc.local +\ instead as this file can be replaced during system updates. +\ \ Includes additional commands include /boot/loader.4th try-include /boot/loader.rc.local Modified: stable/10/sys/boot/forth/menu.rc ============================================================================== --- stable/10/sys/boot/forth/menu.rc Thu Jan 7 01:33:42 2016 (r293293) +++ stable/10/sys/boot/forth/menu.rc Thu Jan 7 01:50:50 2016 (r293294) @@ -1,6 +1,9 @@ \ Menu.rc \ $FreeBSD$ \ +\ You should not edit this file! Put any overrides in menu.rc.local +\ instead as this file can be replaced during system updates. +\ \ Load required Forth modules include /boot/version.4th include /boot/brand.4th Modified: stable/10/sys/boot/i386/loader/Makefile ============================================================================== --- stable/10/sys/boot/i386/loader/Makefile Thu Jan 7 01:33:42 2016 (r293293) +++ stable/10/sys/boot/i386/loader/Makefile Thu Jan 7 01:50:50 2016 (r293294) @@ -108,12 +108,7 @@ FILESMODE_${LOADER}= ${BINMODE} -b .PATH: ${.CURDIR}/../../forth .include "${.CURDIR}/../../forth/Makefile.inc" -.if !exists(${DESTDIR}/boot/loader.rc) -FILES+= loader.rc -.endif -.if !exists(${DESTDIR}/boot/menu.rc) -FILES+= menu.rc -.endif +FILES+= loader.rc menu.rc .endif # XXX crt0.o needs to be first for pxeboot(8) to work Modified: stable/10/sys/boot/pc98/loader/Makefile ============================================================================== --- stable/10/sys/boot/pc98/loader/Makefile Thu Jan 7 01:33:42 2016 (r293293) +++ stable/10/sys/boot/pc98/loader/Makefile Thu Jan 7 01:50:50 2016 (r293294) @@ -89,12 +89,7 @@ FILESMODE_${LOADER}= ${BINMODE} -b .PATH: ${.CURDIR}/../../forth .include "${.CURDIR}/../../forth/Makefile.inc" -.if !exists(${DESTDIR}/boot/loader.rc) -FILES+= ${.CURDIR}/../../i386/loader/loader.rc -.endif -.if !exists(${DESTDIR}/boot/menu.rc) -FILES+= menu.rc -.endif +FILES+= ${.CURDIR}/../../i386/loader/loader.rc menu.rc # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} Modified: stable/10/sys/boot/powerpc/ofw/Makefile ============================================================================== --- stable/10/sys/boot/powerpc/ofw/Makefile Thu Jan 7 01:33:42 2016 (r293293) +++ stable/10/sys/boot/powerpc/ofw/Makefile Thu Jan 7 01:50:50 2016 (r293294) @@ -105,12 +105,6 @@ loader.help: help.common help.ofw .PATH: ${.CURDIR}/../../forth .include "${.CURDIR}/../../forth/Makefile.inc" -.if !exists(${DESTDIR}/boot/loader.rc) -FILES+= loader.rc -.endif - -.if !exists(${DESTDIR}/boot/menu.rc) -FILES+= menu.rc -.endif +FILES+= loader.rc menu.rc .include Modified: stable/10/sys/boot/powerpc/ps3/Makefile ============================================================================== --- stable/10/sys/boot/powerpc/ps3/Makefile Thu Jan 7 01:33:42 2016 (r293293) +++ stable/10/sys/boot/powerpc/ps3/Makefile Thu Jan 7 01:50:50 2016 (r293294) @@ -116,12 +116,6 @@ loader.help: help.common help.ps3 ${.CUR .PATH: ${.CURDIR}/../../forth .include "${.CURDIR}/../../forth/Makefile.inc" -.if !exists(${DESTDIR}/boot/loader.rc) -FILES+= loader.rc -.endif - -.if !exists(${DESTDIR}/boot/menu.rc) -FILES+= menu.rc -.endif +FILES+= loader.rc menu.rc .include Modified: stable/10/sys/boot/sparc64/loader/Makefile ============================================================================== --- stable/10/sys/boot/sparc64/loader/Makefile Thu Jan 7 01:33:42 2016 (r293293) +++ stable/10/sys/boot/sparc64/loader/Makefile Thu Jan 7 01:50:50 2016 (r293294) @@ -98,12 +98,6 @@ loader.help: help.common help.sparc64 .PATH: ${.CURDIR}/../../forth .include "${.CURDIR}/../../forth/Makefile.inc" -.if !exists(${DESTDIR}/boot/loader.rc) -FILES+= loader.rc -.endif - -.if !exists(${DESTDIR}/boot/menu.rc) -FILES+= menu.rc -.endif +FILES+= loader.rc menu.rc .include From owner-svn-src-stable-10@freebsd.org Thu Jan 7 02:06:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE812A6516F; Thu, 7 Jan 2016 02:06:15 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AED531F09; Thu, 7 Jan 2016 02:06:15 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0726Exb092518; Thu, 7 Jan 2016 02:06:14 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0726EqC092517; Thu, 7 Jan 2016 02:06:14 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601070206.u0726EqC092517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 7 Jan 2016 02:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293296 - stable/10/sys/boot/forth X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 02:06:16 -0000 Author: dteske Date: Thu Jan 7 02:06:14 2016 New Revision: 293296 URL: https://svnweb.freebsd.org/changeset/base/293296 Log: MFC SVN revisions 292899,292996,292999-293000. r292899: Fix stack leak introduced by SVN r97201 r292996: Remove debugging messages added by SVN r187143 r292999: Fix a memory leak r293000: Remove supposition comment Modified: stable/10/sys/boot/forth/support.4th Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/forth/support.4th ============================================================================== --- stable/10/sys/boot/forth/support.4th Thu Jan 7 02:04:17 2016 (r293295) +++ stable/10/sys/boot/forth/support.4th Thu Jan 7 02:06:14 2016 (r293296) @@ -684,7 +684,7 @@ only forth also support-functions also f s" loader_conf_files" getenv conf_files string= ; -: set_nextboot_conf \ XXX maybe do as set_conf_files ? +: set_nextboot_conf value_buffer strget unquote nextboot_conf_file string= ; @@ -833,7 +833,7 @@ get-current ( -- wid ) previous definiti repeat ; -: peek_file +: peek_file ( addr len -- ) 0 to end_of_file? reset_line_reading O_RDONLY fopen fd ! @@ -844,6 +844,7 @@ get-current ( -- wid ) previous definiti ['] process_assignment catch ['] free_buffers catch fd @ fclose + swap throw throw ; only forth also support-functions definitions @@ -851,7 +852,6 @@ only forth also support-functions defini \ Interface to loading conf files : load_conf ( addr len -- ) - \ ." ----- Trying conf " 2dup type cr \ debugging 0 to end_of_file? reset_line_reading O_RDONLY fopen fd ! @@ -943,7 +943,6 @@ string current_file_name_ref \ used to p \ loader_conf_files processing support functions : get_conf_files ( -- addr len ) \ put addr/len on stack, reset var - \ ." -- starting on <" conf_files strtype ." >" cr \ debugging conf_files strget 0 0 conf_files strset ; @@ -970,7 +969,6 @@ string current_file_name_ref \ used to p pos char+ to pos repeat addr len pos addr r@ + pos r> - - \ 2dup ." get_file_name has " type cr \ debugging ; : get_next_file ( addr len ptr -- addr len ptr' addr' len' | 0 ) @@ -1021,25 +1019,26 @@ string current_file_name_ref \ used to p ; : get_nextboot_conf_file ( -- addr len ) - nextboot_conf_file strget strdup \ XXX is the strdup a leak ? + nextboot_conf_file strget ; : rewrite_nextboot_file ( -- ) get_nextboot_conf_file O_WRONLY fopen fd ! fd @ -1 = if EOPEN throw then - fd @ s' nextboot_enable="NO" ' fwrite + fd @ s' nextboot_enable="NO" ' fwrite ( fd buf len -- nwritten ) drop fd @ fclose ; -: include_nextboot_file +: include_nextboot_file ( -- ) get_nextboot_conf_file - ['] peek_file catch + ['] peek_file catch if 2drop then nextboot? if get_nextboot_conf_file + current_file_name_ref strref ['] load_conf catch process_conf_errors - ['] rewrite_nextboot_file catch + ['] rewrite_nextboot_file catch if 2drop then then ; From owner-svn-src-stable-10@freebsd.org Thu Jan 7 02:22:47 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94AC4A65AF1; Thu, 7 Jan 2016 02:22:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A6601E36; Thu, 7 Jan 2016 02:22:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u072Mkjr098138; Thu, 7 Jan 2016 02:22:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u072MjTs098126; Thu, 7 Jan 2016 02:22:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601070222.u072MjTs098126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 02:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293297 - in stable/10/sys/boot/efi: . boot1 loader loader/arch loader/arch/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 02:22:47 -0000 Author: emaste Date: Thu Jan 7 02:22:45 2016 New Revision: 293297 URL: https://svnweb.freebsd.org/changeset/base/293297 Log: MFC r280950: Move the efi loaders to be under sys/boot/efi In HEAD this was done to support UEFI on arm64. Merging to stable/10 to facilitate the merging of later UEFI changes. Added: stable/10/sys/boot/efi/boot1/ stable/10/sys/boot/efi/boot1/Makefile (contents, props changed) stable/10/sys/boot/efi/boot1/Makefile.fat (contents, props changed) stable/10/sys/boot/efi/boot1/boot1.c (contents, props changed) stable/10/sys/boot/efi/boot1/fat.tmpl.bz2.uu (contents, props changed) stable/10/sys/boot/efi/boot1/generate-fat.sh (contents, props changed) stable/10/sys/boot/efi/loader/ stable/10/sys/boot/efi/loader/Makefile (contents, props changed) stable/10/sys/boot/efi/loader/arch/ stable/10/sys/boot/efi/loader/arch/amd64/ stable/10/sys/boot/efi/loader/arch/amd64/Makefile.inc (contents, props changed) stable/10/sys/boot/efi/loader/arch/amd64/amd64_tramp.S (contents, props changed) stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c (contents, props changed) stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.c (contents, props changed) stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.h (contents, props changed) stable/10/sys/boot/efi/loader/arch/amd64/ldscript.amd64 (contents, props changed) stable/10/sys/boot/efi/loader/arch/amd64/reloc.c (contents, props changed) stable/10/sys/boot/efi/loader/arch/amd64/start.S (contents, props changed) stable/10/sys/boot/efi/loader/autoload.c (contents, props changed) stable/10/sys/boot/efi/loader/bootinfo.c (contents, props changed) stable/10/sys/boot/efi/loader/conf.c (contents, props changed) stable/10/sys/boot/efi/loader/copy.c (contents, props changed) stable/10/sys/boot/efi/loader/devicename.c (contents, props changed) stable/10/sys/boot/efi/loader/loader_efi.h (contents, props changed) stable/10/sys/boot/efi/loader/main.c (contents, props changed) stable/10/sys/boot/efi/loader/version (contents, props changed) Modified: stable/10/sys/boot/efi/Makefile stable/10/sys/boot/efi/Makefile.inc Modified: stable/10/sys/boot/efi/Makefile ============================================================================== --- stable/10/sys/boot/efi/Makefile Thu Jan 7 02:06:14 2016 (r293296) +++ stable/10/sys/boot/efi/Makefile Thu Jan 7 02:22:45 2016 (r293297) @@ -2,4 +2,8 @@ SUBDIR= libefi +.if ${MACHINE_CPUARCH} == "amd64" +SUBDIR+= loader boot1 +.endif + .include Modified: stable/10/sys/boot/efi/Makefile.inc ============================================================================== --- stable/10/sys/boot/efi/Makefile.inc Thu Jan 7 02:06:14 2016 (r293296) +++ stable/10/sys/boot/efi/Makefile.inc Thu Jan 7 02:22:45 2016 (r293297) @@ -7,7 +7,10 @@ CFLAGS+= -march=i386 .endif # Options used when building app-specific efi components +# See conf/kern.mk for the correct set of these CFLAGS+= -ffreestanding -fshort-wchar -Wformat +CFLAGS+= -mno-red-zone +CFLAGS+= -mno-mmx -mno-sse -mno-aes -mno-avx -msoft-float LDFLAGS+= -nostdlib .include "../Makefile.inc" Added: stable/10/sys/boot/efi/boot1/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/efi/boot1/Makefile Thu Jan 7 02:22:45 2016 (r293297) @@ -0,0 +1,84 @@ +# $FreeBSD$ + +MAN= + +.include + +# In-tree GCC does not support __attribute__((ms_abi)). +.if ${COMPILER_TYPE} != "gcc" + +MK_SSP= no + +PROG= loader.sym +INTERNALPROG= + +# architecture-specific loader code +SRCS= boot1.c reloc.c start.S + +CFLAGS+= -fPIC +CFLAGS+= -I. +CFLAGS+= -I${.CURDIR}/../include +CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include +CFLAGS+= -I${.CURDIR}/../../.. + +# Always add MI sources and REGULAR efi loader bits +.PATH: ${.CURDIR}/../loader/arch/amd64 ${.CURDIR}/../../common +CFLAGS+= -I${.CURDIR}/../../common + +FILES= boot1.efi boot1.efifat +FILESMODE_boot1.efi= ${BINMODE} + +LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE_CPUARCH}/ldscript.${MACHINE_CPUARCH} +LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared -Wl,-znocombreloc + +${PROG}: ${LDSCRIPT} + +OBJCOPY?= objcopy +OBJDUMP?= objdump + +.if ${MACHINE_CPUARCH} == "amd64" +EFI_TARGET= efi-app-x86_64 +.elif ${MACHINE_CPUARCH} == "i386" +EFI_TARGET= efi-app-ia32 +.endif + +boot1.efi: loader.sym + if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \ + ${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \ + exit 1; \ + fi + ${OBJCOPY} -j .text -j .sdata -j .data \ + -j .dynamic -j .dynsym -j .rel.dyn \ + -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ + --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} + +boot1.o: ${.CURDIR}/../../common/ufsread.c + +# The following inserts out objects into a template FAT file system +# created by generate-fat.sh + +.include "${.CURDIR}/Makefile.fat" + +boot1.efifat: boot1.efi + echo ${.OBJDIR} + uudecode ${.CURDIR}/fat.tmpl.bz2.uu + mv fat.tmpl.bz2 ${.TARGET}.bz2 + bzip2 -f -d ${.TARGET}.bz2 + dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc + +CLEANFILES= boot1.efifat + +.endif # ${COMPILER_TYPE} != "gcc" + +.include + +beforedepend ${OBJS}: machine x86 + +CLEANFILES+= machine x86 boot1.efi + +machine: + ln -sf ${.CURDIR}/../../../amd64/include machine + +x86: + ln -sf ${.CURDIR}/../../../x86/include x86 Added: stable/10/sys/boot/efi/boot1/Makefile.fat ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/efi/boot1/Makefile.fat Thu Jan 7 02:22:45 2016 (r293297) @@ -0,0 +1,3 @@ +# This file autogenerated by generate-fat.sh - DO NOT EDIT +# $FreeBSD$ +BOOT1_OFFSET=0x2d Added: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/efi/boot1/boot1.c Thu Jan 7 02:22:45 2016 (r293297) @@ -0,0 +1,552 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * Copyright (c) 2001 Robert Drehmel + * All rights reserved. + * Copyright (c) 2014 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#define _PATH_LOADER "/boot/loader.efi" +#define _PATH_KERNEL "/boot/kernel/kernel" + +#define BSIZEMAX 16384 + +typedef int putc_func_t(char c, void *arg); + +struct sp_data { + char *sp_buf; + u_int sp_len; + u_int sp_size; +}; + +static const char digits[] = "0123456789abcdef"; + +static void panic(const char *fmt, ...) __dead2; +static int printf(const char *fmt, ...); +static int putchar(char c, void *arg); +static int vprintf(const char *fmt, va_list ap); +static int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap); + +static int __printf(const char *fmt, putc_func_t *putc, void *arg, va_list ap); +static int __putc(char c, void *arg); +static int __puts(const char *s, putc_func_t *putc, void *arg); +static int __sputc(char c, void *arg); +static char *__uitoa(char *buf, u_int val, int base); +static char *__ultoa(char *buf, u_long val, int base); + +static int domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet); +static void load(const char *fname); + +EFI_SYSTEM_TABLE *systab; +EFI_HANDLE *image; + +static void +bcopy(const void *src, void *dst, size_t len) +{ + const char *s = src; + char *d = dst; + + while (len-- != 0) + *d++ = *s++; +} + +static void +memcpy(void *dst, const void *src, size_t len) +{ + bcopy(src, dst, len); +} + +static void +bzero(void *b, size_t len) +{ + char *p = b; + + while (len-- != 0) + *p++ = 0; +} + +static int +strcmp(const char *s1, const char *s2) +{ + for (; *s1 == *s2 && *s1; s1++, s2++) + ; + return ((u_char)*s1 - (u_char)*s2); +} + +static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; +static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; +static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; +static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; + +static EFI_BLOCK_IO *bootdev; +static EFI_DEVICE_PATH *bootdevpath; +static EFI_HANDLE *bootdevhandle; + +EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab) +{ + EFI_HANDLE handles[128]; + EFI_BLOCK_IO *blkio; + UINTN i, nparts = sizeof(handles); + EFI_STATUS status; + EFI_DEVICE_PATH *devpath; + EFI_BOOT_SERVICES *BS; + EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; + char *path = _PATH_LOADER; + + systab = Xsystab; + image = Ximage; + + BS = systab->BootServices; + status = BS->LocateProtocol(&ConsoleControlGUID, NULL, + (VOID **)&ConsoleControl); + if (status == EFI_SUCCESS) + (void)ConsoleControl->SetMode(ConsoleControl, + EfiConsoleControlScreenText); + + printf(" \n>> FreeBSD EFI boot block\n"); + printf(" Loader path: %s\n", path); + + status = systab->BootServices->LocateHandle(ByProtocol, + &BlockIoProtocolGUID, NULL, &nparts, handles); + nparts /= sizeof(handles[0]); + + for (i = 0; i < nparts; i++) { + status = systab->BootServices->HandleProtocol(handles[i], + &DevicePathGUID, (void **)&devpath); + if (EFI_ERROR(status)) + continue; + + while (!IsDevicePathEnd(NextDevicePathNode(devpath))) + devpath = NextDevicePathNode(devpath); + + status = systab->BootServices->HandleProtocol(handles[i], + &BlockIoProtocolGUID, (void **)&blkio); + if (EFI_ERROR(status)) + continue; + + if (!blkio->Media->LogicalPartition) + continue; + + if (domount(devpath, blkio, 1) >= 0) + break; + } + + if (i == nparts) + panic("No bootable partition found"); + + bootdevhandle = handles[i]; + load(path); + + panic("Load failed"); + + return EFI_SUCCESS; +} + +static int +dskread(void *buf, u_int64_t lba, int nblk) +{ + EFI_STATUS status; + int size; + + lba = lba / (bootdev->Media->BlockSize / DEV_BSIZE); + size = nblk * DEV_BSIZE; + status = bootdev->ReadBlocks(bootdev, bootdev->Media->MediaId, lba, + size, buf); + + if (EFI_ERROR(status)) + return (-1); + + return (0); +} + +#include "ufsread.c" + +static ssize_t +fsstat(ufs_ino_t inode) +{ +#ifndef UFS2_ONLY + static struct ufs1_dinode dp1; + ufs1_daddr_t addr1; +#endif +#ifndef UFS1_ONLY + static struct ufs2_dinode dp2; +#endif + static struct fs fs; + static ufs_ino_t inomap; + char *blkbuf; + void *indbuf; + size_t n, nb, size, off, vboff; + ufs_lbn_t lbn; + ufs2_daddr_t addr2, vbaddr; + static ufs2_daddr_t blkmap, indmap; + u_int u; + + blkbuf = dmadat->blkbuf; + indbuf = dmadat->indbuf; + if (!dsk_meta) { + inomap = 0; + for (n = 0; sblock_try[n] != -1; n++) { + if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, + SBLOCKSIZE / DEV_BSIZE)) + return -1; + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); + if (( +#if defined(UFS1_ONLY) + fs.fs_magic == FS_UFS1_MAGIC +#elif defined(UFS2_ONLY) + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) +#else + fs.fs_magic == FS_UFS1_MAGIC || + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) +#endif + ) && + fs.fs_bsize <= MAXBSIZE && + fs.fs_bsize >= sizeof(struct fs)) + break; + } + if (sblock_try[n] == -1) { + printf("Not ufs\n"); + return -1; + } + dsk_meta++; + } else + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); + if (!inode) + return 0; + if (inomap != inode) { + n = IPERVBLK(&fs); + if (dskread(blkbuf, INO_TO_VBA(&fs, n, inode), DBPERVBLK)) + return -1; + n = INO_TO_VBO(n, inode); +#if defined(UFS1_ONLY) + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); +#elif defined(UFS2_ONLY) + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); +#else + if (fs.fs_magic == FS_UFS1_MAGIC) + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); + else + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); +#endif + inomap = inode; + fs_off = 0; + blkmap = indmap = 0; + } + size = DIP(di_size); + n = size - fs_off; + return (n); +} + +static struct dmadat __dmadat; + +static int +domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet) +{ + + dmadat = &__dmadat; + bootdev = blkio; + bootdevpath = device; + if (fsread(0, NULL, 0)) { + if (!quiet) + printf("domount: can't read superblock\n"); + return (-1); + } + if (!quiet) + printf("Succesfully mounted UFS filesystem\n"); + return (0); +} + +static void +load(const char *fname) +{ + ufs_ino_t ino; + EFI_STATUS status; + EFI_HANDLE loaderhandle; + EFI_LOADED_IMAGE *loaded_image; + void *buffer; + size_t bufsize; + + if ((ino = lookup(fname)) == 0) { + printf("File %s not found\n", fname); + return; + } + + bufsize = fsstat(ino); + status = systab->BootServices->AllocatePool(EfiLoaderData, + bufsize, &buffer); + fsread(ino, buffer, bufsize); + + /* XXX: For secure boot, we need our own loader here */ + status = systab->BootServices->LoadImage(TRUE, image, bootdevpath, + buffer, bufsize, &loaderhandle); + if (EFI_ERROR(status)) + printf("LoadImage failed with error %d\n", status); + + status = systab->BootServices->HandleProtocol(loaderhandle, + &LoadedImageGUID, (VOID**)&loaded_image); + if (EFI_ERROR(status)) + printf("HandleProtocol failed with error %d\n", status); + + loaded_image->DeviceHandle = bootdevhandle; + + status = systab->BootServices->StartImage(loaderhandle, NULL, NULL); + if (EFI_ERROR(status)) + printf("StartImage failed with error %d\n", status); +} + +static void +panic(const char *fmt, ...) +{ + char buf[128]; + va_list ap; + + va_start(ap, fmt); + vsnprintf(buf, sizeof buf, fmt, ap); + printf("panic: %s\n", buf); + va_end(ap); + + while (1) {} +} + +static int +printf(const char *fmt, ...) +{ + va_list ap; + int ret; + + /* Don't annoy the user as we probe for partitions */ + if (strcmp(fmt,"Not ufs\n") == 0) + return 0; + + va_start(ap, fmt); + ret = vprintf(fmt, ap); + va_end(ap); + return (ret); +} + +static int +putchar(char c, void *arg) +{ + CHAR16 buf[2]; + + if (c == '\n') { + buf[0] = '\r'; + buf[1] = 0; + systab->ConOut->OutputString(systab->ConOut, buf); + } + buf[0] = c; + buf[1] = 0; + systab->ConOut->OutputString(systab->ConOut, buf); + return (1); +} + +static int +vprintf(const char *fmt, va_list ap) +{ + int ret; + + ret = __printf(fmt, putchar, 0, ap); + return (ret); +} + +static int +vsnprintf(char *str, size_t sz, const char *fmt, va_list ap) +{ + struct sp_data sp; + int ret; + + sp.sp_buf = str; + sp.sp_len = 0; + sp.sp_size = sz; + ret = __printf(fmt, __sputc, &sp, ap); + return (ret); +} + +static int +__printf(const char *fmt, putc_func_t *putc, void *arg, va_list ap) +{ + char buf[(sizeof(long) * 8) + 1]; + char *nbuf; + u_long ul; + u_int ui; + int lflag; + int sflag; + char *s; + int pad; + int ret; + int c; + + nbuf = &buf[sizeof buf - 1]; + ret = 0; + while ((c = *fmt++) != 0) { + if (c != '%') { + ret += putc(c, arg); + continue; + } + lflag = 0; + sflag = 0; + pad = 0; +reswitch: c = *fmt++; + switch (c) { + case '#': + sflag = 1; + goto reswitch; + case '%': + ret += putc('%', arg); + break; + case 'c': + c = va_arg(ap, int); + ret += putc(c, arg); + break; + case 'd': + if (lflag == 0) { + ui = (u_int)va_arg(ap, int); + if (ui < (int)ui) { + ui = -ui; + ret += putc('-', arg); + } + s = __uitoa(nbuf, ui, 10); + } else { + ul = (u_long)va_arg(ap, long); + if (ul < (long)ul) { + ul = -ul; + ret += putc('-', arg); + } + s = __ultoa(nbuf, ul, 10); + } + ret += __puts(s, putc, arg); + break; + case 'l': + lflag = 1; + goto reswitch; + case 'o': + if (lflag == 0) { + ui = (u_int)va_arg(ap, u_int); + s = __uitoa(nbuf, ui, 8); + } else { + ul = (u_long)va_arg(ap, u_long); + s = __ultoa(nbuf, ul, 8); + } + ret += __puts(s, putc, arg); + break; + case 'p': + ul = (u_long)va_arg(ap, void *); + s = __ultoa(nbuf, ul, 16); + ret += __puts("0x", putc, arg); + ret += __puts(s, putc, arg); + break; + case 's': + s = va_arg(ap, char *); + ret += __puts(s, putc, arg); + break; + case 'u': + if (lflag == 0) { + ui = va_arg(ap, u_int); + s = __uitoa(nbuf, ui, 10); + } else { + ul = va_arg(ap, u_long); + s = __ultoa(nbuf, ul, 10); + } + ret += __puts(s, putc, arg); + break; + case 'x': + if (lflag == 0) { + ui = va_arg(ap, u_int); + s = __uitoa(nbuf, ui, 16); + } else { + ul = va_arg(ap, u_long); + s = __ultoa(nbuf, ul, 16); + } + if (sflag) + ret += __puts("0x", putc, arg); + ret += __puts(s, putc, arg); + break; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + pad = pad * 10 + c - '0'; + goto reswitch; + default: + break; + } + } + return (ret); +} + +static int +__sputc(char c, void *arg) +{ + struct sp_data *sp; + + sp = arg; + if (sp->sp_len < sp->sp_size) + sp->sp_buf[sp->sp_len++] = c; + sp->sp_buf[sp->sp_len] = '\0'; + return (1); +} + +static int +__puts(const char *s, putc_func_t *putc, void *arg) +{ + const char *p; + int ret; + + ret = 0; + for (p = s; *p != '\0'; p++) + ret += putc(*p, arg); + return (ret); +} + +static char * +__uitoa(char *buf, u_int ui, int base) +{ + char *p; + + p = buf; + *p = '\0'; + do + *--p = digits[ui % base]; + while ((ui /= base) != 0); + return (p); +} + +static char * +__ultoa(char *buf, u_long ul, int base) +{ + char *p; + + p = buf; + *p = '\0'; + do + *--p = digits[ul % base]; + while ((ul /= base) != 0); + return (p); +} + Added: stable/10/sys/boot/efi/boot1/fat.tmpl.bz2.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/efi/boot1/fat.tmpl.bz2.uu Thu Jan 7 02:22:45 2016 (r293297) @@ -0,0 +1,20 @@ +FAT template boot filesystem created by generate-fat.sh +DO NOT EDIT +$FreeBSD$ +begin 644 fat.tmpl.bz2 +M0EIH.3%!629362AK*D(`&I+____[ZZKJZ_^N_ZO^Z_Z_OJ[L`4`!7I0$#&$" +M0$!$3&(I-DTU,)ZAZ0VA-!M0T'J`>H#"9 +M'I#0-H&HQI&0&3&FH>H>*`JHHU3V]1%/4/2``T#0`!H``#0`````#1H,@``6 +M'1&G'&@?$6[T#A)?X8$A160"20BO#")0J4TB1*4GXF$B4I,&>43+=_?K=#3* +M6]R"ZNKJZI,9*68E8*E2Q +M4J5*E3'(1830A"$(12A-"<(0A#]VD)H0A"$,>I0FA"$(0I\>P^=F5:M6K5JU +M:DI3:64UN;[7%5B]Y-^\]@_K@B:N\/,5F%&H<\G#IXQXAEFC&D?![6%0'6MR +MX1@@%FC"FD`M7,/SXFNG:2`'-0<-C$8^+$N.7M1B,^6)9,DV9,0A\OL<:C"L +ML1V&,<\9YRB>XV#BG")'6NKRK^("UF2XO?_L!#29">MGDF$R3).!PX&%E,4C +M''=(FL1.`_3?CN@-IB2PI3!FF\<8X.X@D,>CA90I)#M$XRPNDFJELL<3=1?8 +M2B7\5Z64,!7Z;EEBW-MXN-4IJ@W$462]-*\YCR,-B,5[W?=3&L/U>SX,WV#\ +M\B`:I"'0Z)5"$1B.E)(K[5I4RS`%R$>Y\D0NR*,;<9CZ:^V3P(I?D Makefile.fat +echo '# $FreeBSD$' >> Makefile.fat +echo "BOOT1_OFFSET=0x$BOOT1_OFFSET" >> Makefile.fat + +bzip2 $OUTPUT_FILE +echo 'FAT template boot filesystem created by generate-fat.sh' > $OUTPUT_FILE.bz2.uu +echo 'DO NOT EDIT' >> $OUTPUT_FILE.bz2.uu +echo '$FreeBSD$' >> $OUTPUT_FILE.bz2.uu + +uuencode $OUTPUT_FILE.bz2 $OUTPUT_FILE.bz2 >> $OUTPUT_FILE.bz2.uu +rm $OUTPUT_FILE.bz2 + Added: stable/10/sys/boot/efi/loader/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/efi/loader/Makefile Thu Jan 7 02:22:45 2016 (r293297) @@ -0,0 +1,106 @@ +# $FreeBSD$ + +MAN= + +.include + +# In-tree GCC does not support __attribute__((ms_abi)). +.if ${COMPILER_TYPE} != "gcc" + +MK_SSP= no + +PROG= loader.sym +INTERNALPROG= + +.PATH: ${.CURDIR}/../../efi/loader +# architecture-specific loader code +SRCS= autoload.c \ + bootinfo.c \ + conf.c \ + copy.c \ + devicename.c \ + main.c \ + vers.c + +.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH} +.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc" + +CFLAGS+= -fPIC +CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${.CURDIR}/arch/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/../include +CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include +CFLAGS+= -I${.CURDIR}/../../.. +CFLAGS+= -DNO_PCI + +.if ${MK_FORTH} != "no" +BOOT_FORTH= yes +CFLAGS+= -DBOOT_FORTH +CFLAGS+= -I${.CURDIR}/../../ficl +CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_CPUARCH} +LIBFICL= ${.OBJDIR}/../../ficl/libficl.a +.endif + +# Include bcache code. +HAVE_BCACHE= yes + +.if defined(EFI_STAGING_SIZE) +CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} +.endif + +# Always add MI sources +.PATH: ${.CURDIR}/../../common +.include "${.CURDIR}/../../common/Makefile.inc" +CFLAGS+= -I${.CURDIR}/../../common + +FILES= loader.efi +FILESMODE_loader.efi= ${BINMODE} + +LDSCRIPT= ${.CURDIR}/arch/${MACHINE_CPUARCH}/ldscript.${MACHINE_CPUARCH} +LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared -Wl,-znocombreloc + +CLEANFILES= vers.c loader.efi + +NEWVERSWHAT= "EFI loader" ${MACHINE_CPUARCH} + +vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../efi/loader/version + sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} + +OBJCOPY?= objcopy +OBJDUMP?= objdump + +.if ${MACHINE_CPUARCH} == "amd64" +EFI_TARGET= efi-app-x86_64 +.elif ${MACHINE_CPUARCH} == "i386" +EFI_TARGET= efi-app-ia32 +.endif + +loader.efi: loader.sym + if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \ + ${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \ + exit 1; \ + fi + ${OBJCOPY} -j .text -j .sdata -j .data \ + -j .dynamic -j .dynsym -j .rel.dyn \ + -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ + --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} + +LIBEFI= ${.OBJDIR}/../libefi/libefi.a + +DPADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} ${LDSCRIPT} +LDADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} + +.endif # ${COMPILER_TYPE} != "gcc" + +.include + +beforedepend ${OBJS}: machine x86 + +CLEANFILES+= machine x86 + +machine: + ln -sf ${.CURDIR}/../../../amd64/include machine + +x86: + ln -sf ${.CURDIR}/../../../x86/include x86 Added: stable/10/sys/boot/efi/loader/arch/amd64/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/efi/loader/arch/amd64/Makefile.inc Thu Jan 7 02:22:45 2016 (r293297) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +SRCS+= amd64_tramp.S \ + start.S \ + framebuffer.c \ + elf64_freebsd.c \ + reloc.c + +.PATH: ${.CURDIR}/../../i386/libi386 +SRCS+= nullconsole.c \ + comconsole.c Added: stable/10/sys/boot/efi/loader/arch/amd64/amd64_tramp.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/efi/loader/arch/amd64/amd64_tramp.S Thu Jan 7 02:22:45 2016 (r293297) @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Benno Rice under sponsorship from + * the FreeBSD Foundation. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + + .text + .globl amd64_tramp + +/* + * void amd64_tramp(uint64_t stack, void *copy_finish, uint64_t kernend, + * uint64_t modulep, uint64_t pagetable, uint64_t entry) + */ +amd64_tramp: + cli /* Make sure we don't get interrupted. */ + movq %rdi,%rsp /* Switch to our temporary stack. */ + + movq %rdx,%r12 /* Stash the kernel values for later. */ + movq %rcx,%r13 + movq %r8,%r14 + movq %r9,%r15 + + callq *%rsi /* Call copy_finish so we're all ready to go. */ + + pushq %r12 /* Push kernend. */ + salq $32,%r13 /* Shift modulep and push it. */ + pushq %r13 + pushq %r15 /* Push the entry address. */ + movq %r14,%cr3 /* Switch page tables. */ + ret /* "Return" to kernel entry. */ + + ALIGN_TEXT +amd64_tramp_end: + + .data + .globl amd64_tramp_size +amd64_tramp_size: + .long amd64_tramp_end-amd64_tramp Added: stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Thu Jan 7 02:22:45 2016 (r293297) @@ -0,0 +1,196 @@ +/*- + * Copyright (c) 1998 Michael Smith + * Copyright (c) 2014 The FreeBSD Foundation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#define __ELF_WORD_SIZE 64 +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "bootstrap.h" + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Thu Jan 7 02:33:29 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5ED7A65EE0; Thu, 7 Jan 2016 02:33:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5C3D1344; Thu, 7 Jan 2016 02:33:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u072XSFP001335; Thu, 7 Jan 2016 02:33:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u072XSXH001334; Thu, 7 Jan 2016 02:33:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601070233.u072XSXH001334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 02:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293298 - in stable/10/sys/boot: efi/loader/arch/i386 i386/efi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 02:33:30 -0000 Author: emaste Date: Thu Jan 7 02:33:28 2016 New Revision: 293298 URL: https://svnweb.freebsd.org/changeset/base/293298 Log: MFC r281000: Move i386/efi files to new home in efi/loader/arch/i386 This was not (and still is not) connected to the build, but the EFI loader is in the process of being built for other than amd64 so these files ought to live in their eventual MD location. Added: stable/10/sys/boot/efi/loader/arch/i386/ Deleted: stable/10/sys/boot/i386/efi/ From owner-svn-src-stable-10@freebsd.org Thu Jan 7 02:37:19 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0783CA65FD9; Thu, 7 Jan 2016 02:37:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C77CE152F; Thu, 7 Jan 2016 02:37:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u072bHrQ001511; Thu, 7 Jan 2016 02:37:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u072bHSa001510; Thu, 7 Jan 2016 02:37:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601070237.u072bHSa001510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 02:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293299 - stable/10/sys/boot/efi/boot1 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 02:37:19 -0000 Author: emaste Date: Thu Jan 7 02:37:17 2016 New Revision: 293299 URL: https://svnweb.freebsd.org/changeset/base/293299 Log: MFC r292576: boot1.efi: show EFI error number, not full status value EFI return values set the high bit to indicate an error. The log messages changed here are printed only in the case of an error, so including the error bit is redundant. Also switch to decimal to match the error definitions (in sys/boot/efi/include/efierr.h). Modified: stable/10/sys/boot/efi/boot1/boot1.c Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Thu Jan 7 02:33:28 2016 (r293298) +++ stable/10/sys/boot/efi/boot1/boot1.c Thu Jan 7 02:37:17 2016 (r293299) @@ -308,18 +308,21 @@ load(const char *fname) status = systab->BootServices->LoadImage(TRUE, image, bootdevpath, buffer, bufsize, &loaderhandle); if (EFI_ERROR(status)) - printf("LoadImage failed with error %d\n", status); + printf("LoadImage failed with error %lu\n", + status & ~EFI_ERROR_MASK); status = systab->BootServices->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image); if (EFI_ERROR(status)) - printf("HandleProtocol failed with error %d\n", status); + printf("HandleProtocol failed with error %lu\n", + status & ~EFI_ERROR_MASK); loaded_image->DeviceHandle = bootdevhandle; status = systab->BootServices->StartImage(loaderhandle, NULL, NULL); if (EFI_ERROR(status)) - printf("StartImage failed with error %d\n", status); + printf("StartImage failed with error %lu\n", + status & ~EFI_ERROR_MASK); } static void From owner-svn-src-stable-10@freebsd.org Thu Jan 7 02:41:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F0B7A661E4; Thu, 7 Jan 2016 02:41:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E178E1AAC; Thu, 7 Jan 2016 02:41:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u072fv7j003651; Thu, 7 Jan 2016 02:41:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u072fvpt003650; Thu, 7 Jan 2016 02:41:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601070241.u072fvpt003650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 02:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293300 - stable/10/sys/boot/efi/loader X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 02:41:59 -0000 Author: emaste Date: Thu Jan 7 02:41:57 2016 New Revision: 293300 URL: https://svnweb.freebsd.org/changeset/base/293300 Log: MFC r287934: Increase EFI staging size from 32MB to 48MB The EFI boot loader allocates a single chunk of contiguous memory to hold the kernel, modules, and any other loaded data. This memory block is relocated to the kernel's expected location during the transfer of control from the loader to the kernel. PR: 201679 Modified: stable/10/sys/boot/efi/loader/copy.c Modified: stable/10/sys/boot/efi/loader/copy.c ============================================================================== --- stable/10/sys/boot/efi/loader/copy.c Thu Jan 7 02:37:17 2016 (r293299) +++ stable/10/sys/boot/efi/loader/copy.c Thu Jan 7 02:41:57 2016 (r293300) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #ifndef EFI_STAGING_SIZE -#define EFI_STAGING_SIZE 32 +#define EFI_STAGING_SIZE 48 #endif #define STAGE_PAGES ((EFI_STAGING_SIZE) * 1024 * 1024 / 4096) From owner-svn-src-stable-10@freebsd.org Thu Jan 7 02:42:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C29EA66264; Thu, 7 Jan 2016 02:42:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C8B01C91; Thu, 7 Jan 2016 02:42:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u072guj7004368; Thu, 7 Jan 2016 02:42:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u072gui4004367; Thu, 7 Jan 2016 02:42:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601070242.u072gui4004367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 02:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293301 - stable/10/sys/boot/efi/loader X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 02:42:57 -0000 Author: emaste Date: Thu Jan 7 02:42:56 2016 New Revision: 293301 URL: https://svnweb.freebsd.org/changeset/base/293301 Log: MFC r288372: Use EFI page size constants instead of hardcoding 4096 Modified: stable/10/sys/boot/efi/loader/copy.c Modified: stable/10/sys/boot/efi/loader/copy.c ============================================================================== --- stable/10/sys/boot/efi/loader/copy.c Thu Jan 7 02:41:57 2016 (r293300) +++ stable/10/sys/boot/efi/loader/copy.c Thu Jan 7 02:42:56 2016 (r293301) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #define EFI_STAGING_SIZE 48 #endif -#define STAGE_PAGES ((EFI_STAGING_SIZE) * 1024 * 1024 / 4096) +#define STAGE_PAGES EFI_SIZE_TO_PAGES((EFI_STAGING_SIZE) * 1024 * 1024) EFI_PHYSICAL_ADDRESS staging, staging_end; int stage_offset_set = 0; @@ -59,7 +59,7 @@ efi_copy_init(void) (unsigned long)(status & EFI_ERROR_MASK)); return (status); } - staging_end = staging + STAGE_PAGES * 4096; + staging_end = staging + STAGE_PAGES * EFI_PAGE_SIZE; return (0); } @@ -114,7 +114,7 @@ efi_copy_finish(void) src = (uint64_t *)staging; dst = (uint64_t *)(staging - stage_offset); - last = (uint64_t *)(staging + STAGE_PAGES * EFI_PAGE_SIZE); + last = (uint64_t *)staging_end; while (src < last) *dst++ = *src++; From owner-svn-src-stable-10@freebsd.org Thu Jan 7 02:45:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 953EAA66359; Thu, 7 Jan 2016 02:45:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E4811E6F; Thu, 7 Jan 2016 02:45:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u072jfuT004513; Thu, 7 Jan 2016 02:45:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u072jfKW004512; Thu, 7 Jan 2016 02:45:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601070245.u072jfKW004512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 02:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293302 - stable/10/sys/boot/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 02:45:42 -0000 Author: emaste Date: Thu Jan 7 02:45:41 2016 New Revision: 293302 URL: https://svnweb.freebsd.org/changeset/base/293302 Log: Remove old amd64 EFI directory Deleted: stable/10/sys/boot/amd64/ From owner-svn-src-stable-10@freebsd.org Thu Jan 7 03:28:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B0D7A55308; Thu, 7 Jan 2016 03:28:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3226F19F6; Thu, 7 Jan 2016 03:28:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u073SuWR016779; Thu, 7 Jan 2016 03:28:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u073Sux6016777; Thu, 7 Jan 2016 03:28:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601070328.u073Sux6016777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 03:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293303 - stable/10/sys/boot/efi/loader X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 03:28:57 -0000 Author: emaste Date: Thu Jan 7 03:28:56 2016 New Revision: 293303 URL: https://svnweb.freebsd.org/changeset/base/293303 Log: MFC r281138: SMBIOS support for EFI Restore smbios support lost in r293297 Modified: stable/10/sys/boot/efi/loader/Makefile stable/10/sys/boot/efi/loader/main.c Modified: stable/10/sys/boot/efi/loader/Makefile ============================================================================== --- stable/10/sys/boot/efi/loader/Makefile Thu Jan 7 02:45:41 2016 (r293302) +++ stable/10/sys/boot/efi/loader/Makefile Thu Jan 7 03:28:56 2016 (r293303) @@ -20,9 +20,12 @@ SRCS= autoload.c \ copy.c \ devicename.c \ main.c \ + smbios.c \ vers.c .PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH} +# For smbios.c +.PATH: ${.CURDIR}/../../i386/libi386 .include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc" CFLAGS+= -fPIC @@ -32,7 +35,8 @@ CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH} CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include CFLAGS+= -I${.CURDIR}/../../.. -CFLAGS+= -DNO_PCI +CFLAGS+= -I${.CURDIR}/../../i386/libi386 +CFLAGS+= -DNO_PCI -DEFI .if ${MK_FORTH} != "no" BOOT_FORTH= yes Modified: stable/10/sys/boot/efi/loader/main.c ============================================================================== --- stable/10/sys/boot/efi/loader/main.c Thu Jan 7 02:45:41 2016 (r293302) +++ stable/10/sys/boot/efi/loader/main.c Thu Jan 7 03:28:56 2016 (r293303) @@ -36,6 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "loader_efi.h" extern char bootprog_name[]; @@ -63,6 +65,7 @@ main(int argc, CHAR16 *argv[]) { char vendor[128]; EFI_LOADED_IMAGE *img; + EFI_GUID *guid; int i; /* @@ -128,6 +131,14 @@ main(int argc, CHAR16 *argv[]) archsw.arch_copyout = efi_copyout; archsw.arch_readin = efi_readin; + for (i = 0; i < ST->NumberOfTableEntries; i++) { + guid = &ST->ConfigurationTable[i].VendorGuid; + if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { + smbios_detect(ST->ConfigurationTable[i].VendorTable); + break; + } + } + interact(); /* doesn't return */ return (EFI_SUCCESS); /* keep compiler happy */ From owner-svn-src-stable-10@freebsd.org Thu Jan 7 03:44:35 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9048A6505B; Thu, 7 Jan 2016 03:44:35 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAE631D69; Thu, 7 Jan 2016 03:44:35 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x22e.google.com with SMTP id t15so19764798igr.0; Wed, 06 Jan 2016 19:44:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=AQCcb4hhBHcsol0TbhGcraVORerEwC5slCi/JhWtJos=; b=BcVPzmOiEbR0R+p9iz4iEh/ksFuXw2kSPEVwsV2vPrIr2G5QKVpIwlECJIfzE2gGN1 SKk4DPD5fYo+PZw1SWH5bobcXSzI8QROOF+TfqRxwnYDtikSiYPDu8+yZYq63wk/Cf8Z x2/dKqpj0t/S6ZqhMC+KkzcmeqP2WsRuiAQAmX6IiXoaoRiAgaUWupewiPr3m8WfoQMc gYcXoVPhH7Xu+mx7hoPN+KwX6/aDfXk1tTMRAQt1/Nd11/hLvV6xFXdEXYHAlxzM5Ric zXSFGg+WVwcq5RkMCIJLhm57zrOQUFwpT5gn7Ouw+bzpcuzlmRnW7LaVTT+tD8JpVCKh KFYQ== X-Received: by 10.50.6.104 with SMTP id z8mr13197598igz.58.1452138275159; Wed, 06 Jan 2016 19:44:35 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.39.66 with HTTP; Wed, 6 Jan 2016 19:44:15 -0800 (PST) In-Reply-To: <201601070241.u072fvpt003650@repo.freebsd.org> References: <201601070241.u072fvpt003650@repo.freebsd.org> From: Ed Maste Date: Thu, 7 Jan 2016 03:44:15 +0000 X-Google-Sender-Auth: AEciNcpdGi-YgUiJsqrQ9LlHLiU Message-ID: Subject: Re: svn commit: r293300 - stable/10/sys/boot/efi/loader To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 03:44:36 -0000 On 7 January 2016 at 02:41, Ed Maste wrote: > Author: emaste > Date: Thu Jan 7 02:41:57 2016 > New Revision: 293300 > URL: https://svnweb.freebsd.org/changeset/base/293300 > > Log: > MFC r287934: Increase EFI staging size from 32MB to 48MB These and a few other changes had already been merged to stable/10, to the "old" location of various files. In r293297 I merged r280950 (Move the efi loaders to be under sys/boot/efi) to stable/10, which moved files to new locations and had the unfortunate side effect of losing the changes MFC'd previously. I'm going through and restoring them now. From owner-svn-src-stable-10@freebsd.org Thu Jan 7 04:02:39 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E900A6584E; Thu, 7 Jan 2016 04:02:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 404F21E0D; Thu, 7 Jan 2016 04:02:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0742cK7028267; Thu, 7 Jan 2016 04:02:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0742cNA028264; Thu, 7 Jan 2016 04:02:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601070402.u0742cNA028264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 04:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293304 - in stable/10/sys/boot/efi/loader: . arch/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 04:02:39 -0000 Author: emaste Date: Thu Jan 7 04:02:37 2016 New Revision: 293304 URL: https://svnweb.freebsd.org/changeset/base/293304 Log: loader.efi: combine GetMemoryMap and ExitBootServices and retry on error MFC r292338: UEFI: combine GetMemoryMap and ExitBootServices and retry on error The EFI memory map may change before or during the first ExitBootServices call. In that case ExitBootServices returns an error, and GetMemoryMap and ExitBootServices must be retried. Glue together calls to GetMemoryMap(), ExitBootServices() and storage of (now up-to-date) MODINFOMD_EFI_MAP metadata within a single function. That new function - bi_add_efi_data_and_exit() - uses space previously allocated in bi_load_efi_data() to store the memory map (it will fail if that space is too short). It handles re-calling GetMemoryMap() once to update the map key if necessary. Finally, if ExitBootServices() is successful, it stores the memory map and its header as MODINFOMD_EFI_MAP metadata. ExitBootServices() calls are now done earlier, from within arch- independent bi_load() code. MFC r292442: loader.efi: show EFI error number, not full status value EFI return values set the high bit to indicate an error. The log messages changed here are printed only in the case of an error, so including the error bit is redundant. Also switch to decimal to match the error definitions (in sys/boot/efi/include/efierr.h). MFC r292515: loader.efi: refresh size in GetMemoryMap retry loop If ExitBootServices fails due to a changed efi_mapkey then GetMemoryMap must be called again. In this case it is also possible for the memory map to grow, so repeat the initial GetMemoryMap call to fetch the new size. Also roll bi_add_efi_data_and_exit into bi_load_efi_data as there's no need for it to be a separate function. PR: 202455 Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c stable/10/sys/boot/efi/loader/bootinfo.c stable/10/sys/boot/efi/loader/loader_efi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c ============================================================================== --- stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Thu Jan 7 03:28:56 2016 (r293303) +++ stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Thu Jan 7 04:02:37 2016 (r293304) @@ -174,13 +174,6 @@ elf64_exec(struct preloaded_file *fp) if (err != 0) return(err); - status = BS->ExitBootServices(IH, efi_mapkey); - if (EFI_ERROR(status)) { - printf("%s: ExitBootServices() returned 0x%lx\n", __func__, - (long)status); - return (EINVAL); - } - dev_cleanup(); trampoline(trampstack, efi_copy_finish, kernend, modulep, PT4, Modified: stable/10/sys/boot/efi/loader/bootinfo.c ============================================================================== --- stable/10/sys/boot/efi/loader/bootinfo.c Thu Jan 7 03:28:56 2016 (r293303) +++ stable/10/sys/boot/efi/loader/bootinfo.c Thu Jan 7 04:02:37 2016 (r293304) @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); #include "framebuffer.h" #include "loader_efi.h" -UINTN efi_mapkey; - static const char howto_switches[] = "aCdrgDmphsv"; static int howto_masks[] = { RB_ASKNAME, RB_CDROM, RB_KDB, RB_DFLTROOT, RB_GDB, RB_MULTIPLE, @@ -230,7 +228,8 @@ bi_load_efi_data(struct preloaded_file * EFI_PHYSICAL_ADDRESS addr; EFI_STATUS status; size_t efisz; - UINTN mmsz, pages, sz; + UINTN efi_mapkey; + UINTN mmsz, pages, retry, sz; UINT32 mmver; struct efi_map_header *efihdr; struct efi_fb efifb; @@ -252,49 +251,63 @@ bi_load_efi_data(struct preloaded_file * efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; /* - * Allocate enough pages to hold the bootinfo block and the memory - * map EFI will return to us. The memory map has an unknown size, - * so we have to determine that first. Note that the AllocatePages - * call can itself modify the memory map, so we have to take that - * into account as well. The changes to the memory map are caused - * by splitting a range of free memory into two (AFAICT), so that - * one is marked as being loader data. + * It is possible that the first call to ExitBootServices may change + * the map key. Fetch a new map key and retry ExitBootServices in that + * case. */ - sz = 0; - BS->GetMemoryMap(&sz, NULL, &efi_mapkey, &mmsz, &mmver); - sz += mmsz; - sz = (sz + 0xf) & ~0xf; - pages = EFI_SIZE_TO_PAGES(sz + efisz); - status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, pages, - &addr); - if (EFI_ERROR(status)) { - printf("%s: AllocatePages() returned 0x%lx\n", __func__, - (long)status); - return (ENOMEM); - } + for (retry = 2; retry > 0; retry--) { + /* + * Allocate enough pages to hold the bootinfo block and the + * memory map EFI will return to us. The memory map has an + * unknown size, so we have to determine that first. Note that + * the AllocatePages call can itself modify the memory map, so + * we have to take that into account as well. The changes to + * the memory map are caused by splitting a range of free + * memory into two (AFAICT), so that one is marked as being + * loader data. + */ + sz = 0; + BS->GetMemoryMap(&sz, NULL, &efi_mapkey, &mmsz, &mmver); + sz += mmsz; + sz = (sz + 0xf) & ~0xf; + pages = EFI_SIZE_TO_PAGES(sz + efisz); + status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, + pages, &addr); + if (EFI_ERROR(status)) { + printf("%s: AllocatePages error %lu\n", __func__, + (unsigned long)(status & ~EFI_ERROR_MASK)); + return (ENOMEM); + } - /* - * Read the memory map and stash it after bootinfo. Align the - * memory map on a 16-byte boundary (the bootinfo block is page - * aligned). - */ - efihdr = (struct efi_map_header *)addr; - mm = (void *)((uint8_t *)efihdr + efisz); - sz = (EFI_PAGE_SIZE * pages) - efisz; - status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver); - if (EFI_ERROR(status)) { - printf("%s: GetMemoryMap() returned 0x%lx\n", __func__, - (long)status); - return (EINVAL); + /* + * Read the memory map and stash it after bootinfo. Align the + * memory map on a 16-byte boundary (the bootinfo block is page + * aligned). + */ + efihdr = (struct efi_map_header *)addr; + mm = (void *)((uint8_t *)efihdr + efisz); + sz = (EFI_PAGE_SIZE * pages) - efisz; + + status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver); + if (EFI_ERROR(status)) { + printf("%s: GetMemoryMap error %lu\n", __func__, + (unsigned long)(status & ~EFI_ERROR_MASK)); + return (EINVAL); + } + status = BS->ExitBootServices(IH, efi_mapkey); + if (EFI_ERROR(status) == 0) { + efihdr->memory_size = sz; + efihdr->descriptor_size = mmsz; + efihdr->descriptor_version = mmver; + file_addmetadata(kfp, MODINFOMD_EFI_MAP, efisz + sz, + efihdr); + return (0); + } + BS->FreePages(addr, pages); } - - efihdr->memory_size = sz; - efihdr->descriptor_size = mmsz; - efihdr->descriptor_version = mmver; - - file_addmetadata(kfp, MODINFOMD_EFI_MAP, efisz + sz, efihdr); - - return (0); + printf("ExitBootServices error %lu\n", + (unsigned long)(status & ~EFI_ERROR_MASK)); + return (EINVAL); } /* Modified: stable/10/sys/boot/efi/loader/loader_efi.h ============================================================================== --- stable/10/sys/boot/efi/loader/loader_efi.h Thu Jan 7 03:28:56 2016 (r293303) +++ stable/10/sys/boot/efi/loader/loader_efi.h Thu Jan 7 04:02:37 2016 (r293304) @@ -44,8 +44,6 @@ ssize_t efi_copyout(const vm_offset_t sr ssize_t efi_readin(const int fd, vm_offset_t dest, const size_t len); void * efi_translate(vm_offset_t ptr); -extern UINTN efi_mapkey; - void efi_copy_finish(void); #endif /* _LOADER_EFI_COPY_H_ */ From owner-svn-src-stable-10@freebsd.org Thu Jan 7 07:21:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1035DA65A63; Thu, 7 Jan 2016 07:21:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C82551353; Thu, 7 Jan 2016 07:21:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u077LcDZ090723; Thu, 7 Jan 2016 07:21:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u077LbEq090713; Thu, 7 Jan 2016 07:21:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201601070721.u077LbEq090713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Jan 2016 07:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293307 - stable/10/usr.bin/netstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 07:21:40 -0000 Author: markj Date: Thu Jan 7 07:21:37 2016 New Revision: 293307 URL: https://svnweb.freebsd.org/changeset/base/293307 Log: MFC r287649: Use a common subroutine to fetch and zero protocol stats instead of duplicating roughly similar code for each protocol. Modified: stable/10/usr.bin/netstat/flowtable.c stable/10/usr.bin/netstat/if.c stable/10/usr.bin/netstat/inet.c stable/10/usr.bin/netstat/inet6.c stable/10/usr.bin/netstat/main.c stable/10/usr.bin/netstat/mbuf.c stable/10/usr.bin/netstat/mroute.c stable/10/usr.bin/netstat/mroute6.c stable/10/usr.bin/netstat/netstat.h stable/10/usr.bin/netstat/sctp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/netstat/flowtable.c ============================================================================== --- stable/10/usr.bin/netstat/flowtable.c Thu Jan 7 05:47:34 2016 (r293306) +++ stable/10/usr.bin/netstat/flowtable.c Thu Jan 7 07:21:37 2016 (r293307) @@ -28,12 +28,14 @@ #include __FBSDID("$FreeBSD$"); + #include -#include + #include -#include + #include #include + #include "netstat.h" /* @@ -67,17 +69,18 @@ void flowtable_stats(void) { struct flowtable_stat stat; - size_t len = sizeof(stat); if (!live) return; - if (sysctlbyname("net.flowtable.ip4.stat", &stat, &len, NULL, 0) == 0) { + if (fetch_stats("net.flowtable.ip4.stat", 0, &stat, + sizeof(stat), NULL) == 0) { printf("flowtable for IPv4:\n"); print_stats(&stat); } - if (sysctlbyname("net.flowtable.ip6.stat", &stat, &len, NULL, 0) == 0) { + if (fetch_stats("net.flowtable.ip6.stat", 0, &stat, + sizeof(stat), NULL) == 0) { printf("flowtable for IPv6:\n"); print_stats(&stat); } Modified: stable/10/usr.bin/netstat/if.c ============================================================================== --- stable/10/usr.bin/netstat/if.c Thu Jan 7 05:47:34 2016 (r293306) +++ stable/10/usr.bin/netstat/if.c Thu Jan 7 07:21:37 2016 (r293307) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #define _IFI_OQDROPS @@ -117,20 +116,11 @@ pfsync_acts_stats(const char *fmt, uint6 void pfsync_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct pfsyncstats pfsyncstat, zerostat; - size_t len = sizeof(struct pfsyncstats); + struct pfsyncstats pfsyncstat; - if (live) { - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.pfsync.stats", &pfsyncstat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - if (errno != ENOENT) - warn("sysctl: net.pfsync.stats"); - return; - } - } else - kread(off, &pfsyncstat, len); + if (fetch_stats("net.pfsync.stats", off, &pfsyncstat, + sizeof(pfsyncstat), kread) != 0) + return; printf("%s:\n", name); Modified: stable/10/usr.bin/netstat/inet.c ============================================================================== --- stable/10/usr.bin/netstat/inet.c Thu Jan 7 05:47:34 2016 (r293306) +++ stable/10/usr.bin/netstat/inet.c Thu Jan 7 07:21:37 2016 (r293307) @@ -593,8 +593,7 @@ protopr(u_long off, const char *name, in void tcp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct tcpstat tcpstat, zerostat; - size_t len = sizeof tcpstat; + struct tcpstat tcpstat; #ifdef INET6 if (tcp_done != 0) @@ -603,16 +602,9 @@ tcp_stats(u_long off, const char *name, tcp_done = 1; #endif - if (live) { - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.inet.tcp.stats", &tcpstat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - warn("sysctl: net.inet.tcp.stats"); - return; - } - } else - kread_counters(off, &tcpstat, len); + if (fetch_stats("net.inet.tcp.stats", off, &tcpstat, + sizeof(tcpstat), kread_counters) != 0) + return; printf ("%s:\n", name); @@ -755,8 +747,7 @@ tcp_stats(u_long off, const char *name, void udp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct udpstat udpstat, zerostat; - size_t len = sizeof udpstat; + struct udpstat udpstat; uint64_t delivered; #ifdef INET6 @@ -766,16 +757,9 @@ udp_stats(u_long off, const char *name, udp_done = 1; #endif - if (live) { - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.inet.udp.stats", &udpstat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - warn("sysctl: net.inet.udp.stats"); - return; - } - } else - kread_counters(off, &udpstat, len); + if (fetch_stats("net.inet.udp.stats", off, &udpstat, + sizeof(udpstat), kread_counters) != 0) + return; printf("%s:\n", name); #define p(f, m) if (udpstat.f || sflag <= 1) \ @@ -815,23 +799,11 @@ udp_stats(u_long off, const char *name, void carp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct carpstats carpstat, zerostat; - size_t len = sizeof(struct carpstats); + struct carpstats carpstat; - if (live) { - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.inet.carp.stats", &carpstat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - if (errno != ENOENT) - warn("sysctl: net.inet.carp.stats"); - return; - } - } else { - if (off == 0) - return; - kread_counters(off, &carpstat, len); - } + if (fetch_stats("net.inet.carp.stats", off, &carpstat, + sizeof(carpstat), kread_counters) != 0) + return; printf("%s:\n", name); @@ -866,19 +838,11 @@ carp_stats(u_long off, const char *name, void ip_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct ipstat ipstat, zerostat; - size_t len = sizeof ipstat; + struct ipstat ipstat; - if (live) { - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.inet.ip.stats", &ipstat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - warn("sysctl: net.inet.ip.stats"); - return; - } - } else - kread_counters(off, &ipstat, len); + if (fetch_stats("net.inet.ip.stats", off, &ipstat, + sizeof(ipstat), kread_counters) != 0) + return; printf("%s:\n", name); @@ -930,19 +894,11 @@ ip_stats(u_long off, const char *name, i void arp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct arpstat arpstat, zerostat; - size_t len = sizeof(arpstat); + struct arpstat arpstat; - if (live) { - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.link.ether.arp.stats", &arpstat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - warn("sysctl: net.link.ether.arp.stats"); - return; - } - } else - kread_counters(off, &arpstat, len); + if (fetch_stats("net.link.ether.arp.stats", off, &arpstat, + sizeof(arpstat), kread_counters) != 0) + return; printf("%s:\n", name); @@ -1015,21 +971,13 @@ static const char *icmpnames[ICMP_MAXTYP void icmp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct icmpstat icmpstat, zerostat; - int i, first; + struct icmpstat icmpstat; size_t len; + int i, first; - len = sizeof icmpstat; - if (live) { - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.inet.icmp.stats", &icmpstat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - warn("sysctl: net.inet.icmp.stats"); - return; - } - } else - kread_counters(off, &icmpstat, len); + if (fetch_stats("net.inet.icmp.stats", off, &icmpstat, + sizeof(icmpstat), kread_counters) != 0) + return; printf("%s:\n", name); @@ -1138,43 +1086,11 @@ igmp_stats_live_old(const char *name) void igmp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct igmpstat igmpstat, zerostat; - size_t len; - -#ifndef BURN_BRIDGES - if (live) { - /* - * Detect if we are being run against a pre-IGMPv3 kernel. - * We cannot do this for a core file as the legacy - * struct igmpstat has no size field, nor does it - * export it in any readily-available symbols. - */ - len = 0; - if (sysctlbyname("net.inet.igmp.stats", NULL, &len, NULL, - 0) < 0) { - warn("sysctl: net.inet.igmp.stats"); - return; - } - if (len < sizeof(igmpstat)) { - igmp_stats_live_old(name); - return; - } - } -#endif /* !BURN_BRIDGES */ + struct igmpstat igmpstat; - len = sizeof(igmpstat); - if (live) { - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.inet.igmp.stats", &igmpstat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - warn("sysctl: net.inet.igmp.stats"); - return; - } - } else { - len = sizeof(igmpstat); - kread(off, &igmpstat, len); - } + if (fetch_stats("net.inet.igmp.stats", 0, &igmpstat, + sizeof(igmpstat), kread) != 0) + return; if (igmpstat.igps_version != IGPS_VERSION_3) { warnx("%s: version mismatch (%d != %d)", __func__, @@ -1221,23 +1137,11 @@ void pim_stats(u_long off __unused, const char *name, int af1 __unused, int proto __unused) { - struct pimstat pimstat, zerostat; - size_t len = sizeof pimstat; + struct pimstat pimstat; - if (live) { - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.inet.pim.stats", &pimstat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - if (errno != ENOENT) - warn("sysctl: net.inet.pim.stats"); - return; - } - } else { - if (off == 0) - return; - kread_counters(off, &pimstat, len); - } + if (fetch_stats("net.inet.pim.stats", off, &pimstat, + sizeof(pimstat), kread_counters) != 0) + return; printf("%s:\n", name); Modified: stable/10/usr.bin/netstat/inet6.c ============================================================================== --- stable/10/usr.bin/netstat/inet6.c Thu Jan 7 05:47:34 2016 (r293306) +++ stable/10/usr.bin/netstat/inet6.c Thu Jan 7 07:21:37 2016 (r293307) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -360,23 +359,12 @@ static const char *srcrule_str[] = { void ip6_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct ip6stat ip6stat, zerostat; + struct ip6stat ip6stat; int first, i; - size_t len; - len = sizeof ip6stat; - if (live) { - memset(&ip6stat, 0, len); - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.inet6.ip6.stats", &ip6stat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - if (errno != ENOENT) - warn("sysctl: net.inet6.ip6.stats"); - return; - } - } else - kread_counters(off, &ip6stat, len); + if (fetch_stats("net.inet6.ip6.stats", off, &ip6stat, + sizeof(ip6stat), kread_counters) != 0) + return; printf("%s:\n", name); @@ -842,23 +830,12 @@ static const char *icmp6names[] = { void icmp6_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct icmp6stat icmp6stat, zerostat; + struct icmp6stat icmp6stat; int i, first; - size_t len; - len = sizeof icmp6stat; - if (live) { - memset(&icmp6stat, 0, len); - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.inet6.icmp6.stats", &icmp6stat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - if (errno != ENOENT) - warn("sysctl: net.inet6.icmp6.stats"); - return; - } - } else - kread_counters(off, &icmp6stat, len); + if (fetch_stats("net.inet6.icmp6.stats", off, &icmp6stat, + sizeof(icmp6stat), kread_counters) != 0) + return; printf("%s:\n", name); @@ -999,23 +976,11 @@ icmp6_ifstats(char *ifname) void pim6_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct pim6stat pim6stat, zerostat; - size_t len = sizeof pim6stat; + struct pim6stat pim6stat; - if (live) { - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.inet6.pim.stats", &pim6stat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - if (errno != ENOENT) - warn("sysctl: net.inet6.pim.stats"); - return; - } - } else { - if (off == 0) - return; - kread(off, &pim6stat, len); - } + if (fetch_stats("net.inet6.pim.stats", off, &pim6stat, + sizeof(pim6stat), kread) != 0) + return; printf("%s:\n", name); @@ -1037,22 +1002,12 @@ pim6_stats(u_long off, const char *name, void rip6_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct rip6stat rip6stat, zerostat; + struct rip6stat rip6stat; u_quad_t delivered; - size_t len; - len = sizeof(rip6stat); - if (live) { - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.inet6.ip6.rip6stats", &rip6stat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - if (errno != ENOENT) - warn("sysctl: net.inet6.ip6.rip6stats"); - return; - } - } else - kread_counters(off, &rip6stat, len); + if (fetch_stats("net.inet6.ip6.rip6stats", off, &rip6stat, + sizeof(rip6stat), kread_counters) != 0) + return; printf("%s:\n", name); Modified: stable/10/usr.bin/netstat/main.c ============================================================================== --- stable/10/usr.bin/netstat/main.c Thu Jan 7 05:47:34 2016 (r293306) +++ stable/10/usr.bin/netstat/main.c Thu Jan 7 07:21:37 2016 (r293307) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -643,6 +644,29 @@ main(int argc, char *argv[]) exit(0); } +int +fetch_stats(const char *sysctlname, u_long off, void *stats, size_t len, + int (*kreadfn)(u_long, void *, size_t)) +{ + int error; + + if (live) { + memset(stats, 0, len); + if (zflag) + error = sysctlbyname(sysctlname, NULL, NULL, stats, + len); + else + error = sysctlbyname(sysctlname, stats, &len, NULL, 0); + if (error == -1 && errno != ENOENT) + warn("sysctl %s", sysctlname); + } else { + if (off == 0) + return (1); + error = kreadfn(off, stats, len); + } + return (error); +} + /* * Print out protocol statistics or control blocks (per sflag). * If the interface was not specifically requested, and the symbol Modified: stable/10/usr.bin/netstat/mbuf.c ============================================================================== --- stable/10/usr.bin/netstat/mbuf.c Thu Jan 7 05:47:34 2016 (r293306) +++ stable/10/usr.bin/netstat/mbuf.c Thu Jan 7 07:21:37 2016 (r293307) @@ -294,25 +294,20 @@ mbpr(void *kvmd, u_long mbaddr) "(%juk/9k/16k)\n", jumbop_failures, jumbo9_failures, jumbo16_failures, jumbop_size / 1024); - if (live) { - mlen = sizeof(nsfbufs); - if (!sysctlbyname("kern.ipc.nsfbufs", &nsfbufs, &mlen, NULL, - 0) && - !sysctlbyname("kern.ipc.nsfbufsused", &nsfbufsused, - &mlen, NULL, 0) && - !sysctlbyname("kern.ipc.nsfbufspeak", &nsfbufspeak, - &mlen, NULL, 0)) - printf("%d/%d/%d sfbufs in use (current/peak/max)\n", - nsfbufsused, nsfbufspeak, nsfbufs); - mlen = sizeof(sfstat); - if (sysctlbyname("kern.ipc.sfstat", &sfstat, &mlen, NULL, 0)) { - warn("kern.ipc.sfstat"); - goto out; - } - } else { - if (kread_counters(mbaddr, (char *)&sfstat, sizeof sfstat) != 0) - goto out; - } + mlen = sizeof(nsfbufs); + if (live && + sysctlbyname("kern.ipc.nsfbufs", &nsfbufs, &mlen, NULL, 0) == 0 && + sysctlbyname("kern.ipc.nsfbufsused", &nsfbufsused, &mlen, + NULL, 0) == 0 && + sysctlbyname("kern.ipc.nsfbufspeak", &nsfbufspeak, &mlen, + NULL, 0) == 0) + printf("%d/%d/%d sfbufs in use (current/peak/max)\n", + nsfbufsused, nsfbufspeak, nsfbufs); + + if (fetch_stats("kern.ipc.sfstat", mbaddr, &sfstat, sizeof(sfstat), + kread_counters) != 0) + goto out; + printf("%ju requests for sfbufs denied\n", (uintmax_t)sfstat.sf_allocfail); printf("%ju requests for sfbufs delayed\n", Modified: stable/10/usr.bin/netstat/mroute.c ============================================================================== --- stable/10/usr.bin/netstat/mroute.c Thu Jan 7 05:47:34 2016 (r293306) +++ stable/10/usr.bin/netstat/mroute.c Thu Jan 7 07:21:37 2016 (r293307) @@ -370,7 +370,6 @@ mrt_stats() { struct mrtstat mrtstat; u_long mstaddr; - size_t len = sizeof(mrtstat); kresolve_list(mrl); mstaddr = mrl[N_MRTSTAT].n_value; @@ -380,14 +379,9 @@ mrt_stats() return; } - if (live) { - if (sysctlbyname("net.inet.ip.mrtstat", &mrtstat, &len, NULL, - 0) < 0) { - warn("sysctl: net.inet.ip.mrtstat failed."); - return; - } - } else - kread_counters(mstaddr, &mrtstat, len); + if (fetch_stats("net.inet.ip.mrtstat", mstaddr, &mrtstat, + sizeof(mrtstat), kread_counters) != 0) + return; printf("IPv4 multicast forwarding:\n"); Modified: stable/10/usr.bin/netstat/mroute6.c ============================================================================== --- stable/10/usr.bin/netstat/mroute6.c Thu Jan 7 05:47:34 2016 (r293306) +++ stable/10/usr.bin/netstat/mroute6.c Thu Jan 7 07:21:37 2016 (r293307) @@ -246,7 +246,6 @@ mrt6_stats() { struct mrt6stat mrtstat; u_long mstaddr; - size_t len = sizeof mrtstat; kresolve_list(mrl); mstaddr = mrl[N_MRT6STAT].n_value; @@ -255,15 +254,9 @@ mrt6_stats() fprintf(stderr, "No IPv6 MROUTING kernel support.\n"); return; } - - if (live) { - if (sysctlbyname("net.inet6.ip6.mrt6stat", &mrtstat, &len, - NULL, 0) < 0) { - warn("sysctl: net.inet6.ip6.mrt6stat"); - return; - } - } else - kread(mstaddr, (char *)&mrtstat, sizeof(mrtstat)); + if (fetch_stats("net.inet6.ip6.mrt6stat", 0, &mrtstat, + sizeof(mrtstat), kread_counters) != 0) + return; printf("IPv6 multicast forwarding:\n"); Modified: stable/10/usr.bin/netstat/netstat.h ============================================================================== --- stable/10/usr.bin/netstat/netstat.h Thu Jan 7 05:47:34 2016 (r293306) +++ stable/10/usr.bin/netstat/netstat.h Thu Jan 7 07:21:37 2016 (r293307) @@ -60,6 +60,8 @@ extern int unit; /* unit number for abov extern int live; /* true if we are examining a live system */ struct nlist; +int fetch_stats(const char *sysctlname, u_long addr, void *stats, + size_t len, int (*kreadfn)(u_long, void *, size_t)); int kread(u_long addr, void *buf, size_t size); uint64_t kread_counter(u_long addr); int kread_counters(u_long addr, void *buf, size_t size); Modified: stable/10/usr.bin/netstat/sctp.c ============================================================================== --- stable/10/usr.bin/netstat/sctp.c Thu Jan 7 05:47:34 2016 (r293306) +++ stable/10/usr.bin/netstat/sctp.c Thu Jan 7 07:21:37 2016 (r293307) @@ -607,20 +607,11 @@ sctp_statesprint(uint32_t state) void sctp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { - struct sctpstat sctpstat, zerostat; - size_t len = sizeof(sctpstat); + struct sctpstat sctpstat; - if (live) { - if (zflag) - memset(&zerostat, 0, len); - if (sysctlbyname("net.inet.sctp.stats", &sctpstat, &len, - zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - if (errno != ENOENT) - warn("sysctl: net.inet.sctp.stats"); - return; - } - } else - kread(off, &sctpstat, len); + if (fetch_stats("net.inet.sctp.stats", off, &sctpstat, + sizeof(sctpstat), kread) != 0) + return; printf ("%s:\n", name); From owner-svn-src-stable-10@freebsd.org Thu Jan 7 12:08:17 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37511A64106; Thu, 7 Jan 2016 12:08:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1FD9164A; Thu, 7 Jan 2016 12:08:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07C8G7D076871; Thu, 7 Jan 2016 12:08:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07C8FUZ076869; Thu, 7 Jan 2016 12:08:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201601071208.u07C8FUZ076869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 7 Jan 2016 12:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293314 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 12:08:17 -0000 Author: mjg Date: Thu Jan 7 12:08:15 2016 New Revision: 293314 URL: https://svnweb.freebsd.org/changeset/base/293314 Log: MFC r292440: proc: fix a race which could result in dereference of bad p_pgrp pointer on fork During fork p_starcopy - p_endcopy area of a process is populated with bcopy with only proc lock held. Another forking thread can find such a process and proceed to access p_pgrp included in said area. Fix the problem by moving the field outside. It is being properly assigned later. Modified: stable/10/sys/kern/kern_proc.c stable/10/sys/sys/proc.h Modified: stable/10/sys/kern/kern_proc.c ============================================================================== --- stable/10/sys/kern/kern_proc.c Thu Jan 7 11:54:20 2016 (r293313) +++ stable/10/sys/kern/kern_proc.c Thu Jan 7 12:08:15 2016 (r293314) @@ -234,6 +234,7 @@ proc_init(void *mem, int size, int flags TAILQ_INIT(&p->p_threads); /* all threads in proc */ EVENTHANDLER_INVOKE(process_init, p); p->p_stats = pstats_alloc(); + p->p_pgrp = NULL; SDT_PROBE3(proc, kernel, init, return, p, size, flags); return (0); } Modified: stable/10/sys/sys/proc.h ============================================================================== --- stable/10/sys/sys/proc.h Thu Jan 7 11:54:20 2016 (r293313) +++ stable/10/sys/sys/proc.h Thu Jan 7 12:08:15 2016 (r293314) @@ -558,7 +558,7 @@ struct proc { int p_osrel; /* (x) osreldate for the binary (from ELF note, if any) */ char p_comm[MAXCOMLEN + 1]; /* (b) Process name. */ - struct pgrp *p_pgrp; /* (c + e) Pointer to process group. */ + void *p_pad0; struct sysentvec *p_sysent; /* (b) Syscall dispatch info. */ struct pargs *p_args; /* (c) Process arguments. */ rlim_t p_cpulimit; /* (c) Current CPU limit in seconds. */ @@ -604,6 +604,7 @@ struct proc { pid_t p_reapsubtree; /* (e) Pid of the direct child of the reaper which spawned our subtree. */ + struct pgrp *p_pgrp; /* (c + e) Pointer to process group. */ }; #define p_session p_pgrp->pg_session From owner-svn-src-stable-10@freebsd.org Thu Jan 7 14:52:34 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B778A65640; Thu, 7 Jan 2016 14:52:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1585019C5; Thu, 7 Jan 2016 14:52:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07EqXY4027948; Thu, 7 Jan 2016 14:52:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07EqXls027947; Thu, 7 Jan 2016 14:52:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601071452.u07EqXls027947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 14:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293317 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 14:52:34 -0000 Author: emaste Date: Thu Jan 7 14:52:32 2016 New Revision: 293317 URL: https://svnweb.freebsd.org/changeset/base/293317 Log: MFC r292705: rtld: remove old XXX comment missed in r35529 Modified: stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Thu Jan 7 12:31:49 2016 (r293316) +++ stable/10/libexec/rtld-elf/rtld.c Thu Jan 7 14:52:32 2016 (r293317) @@ -1115,7 +1115,6 @@ digest_dynamic1(Obj_Entry *obj, int earl #ifndef __mips__ case DT_DEBUG: - /* XXX - not implemented yet */ if (!early) dbg("Filling in DT_DEBUG entry"); ((Elf_Dyn*)dynp)->d_un.d_ptr = (Elf_Addr) &r_debug; From owner-svn-src-stable-10@freebsd.org Thu Jan 7 15:37:19 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 434A8A668CA; Thu, 7 Jan 2016 15:37:19 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12F441EA2; Thu, 7 Jan 2016 15:37:19 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07FbIkt040770; Thu, 7 Jan 2016 15:37:18 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07FbIF9040769; Thu, 7 Jan 2016 15:37:18 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201601071537.u07FbIF9040769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Thu, 7 Jan 2016 15:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293318 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 15:37:19 -0000 Author: jtl Date: Thu Jan 7 15:37:17 2016 New Revision: 293318 URL: https://svnweb.freebsd.org/changeset/base/293318 Log: MFC r292676: Only allow one PT_INTERP ELF program header. This also fixes a potential memory leak for interp_buf. Modified: stable/10/sys/kern/imgact_elf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/imgact_elf.c ============================================================================== --- stable/10/sys/kern/imgact_elf.c Thu Jan 7 14:52:32 2016 (r293317) +++ stable/10/sys/kern/imgact_elf.c Thu Jan 7 15:37:17 2016 (r293318) @@ -783,6 +783,11 @@ __CONCAT(exec_, __elfN(imgact))(struct i error = ENOEXEC; goto ret; } + if (interp != NULL) { + uprintf("Multiple PT_INTERP headers\n"); + error = ENOEXEC; + goto ret; + } interp_name_len = phdr[i].p_filesz; if (phdr[i].p_offset > PAGE_SIZE || interp_name_len > PAGE_SIZE - phdr[i].p_offset) { From owner-svn-src-stable-10@freebsd.org Thu Jan 7 17:00:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80F47A668D7; Thu, 7 Jan 2016 17:00:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E07A10B8; Thu, 7 Jan 2016 17:00:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07H0ZeL067229; Thu, 7 Jan 2016 17:00:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07H0Zu8067228; Thu, 7 Jan 2016 17:00:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601071700.u07H0Zu8067228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 17:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293333 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 17:00:36 -0000 Author: emaste Date: Thu Jan 7 17:00:35 2016 New Revision: 293333 URL: https://svnweb.freebsd.org/changeset/base/293333 Log: MFC r291691: newvers: Honour SOURCE_DATE_EPOCH for build reproducibility One reason the kernel does not build reproducibly is that it includes a timestamp in the version string. SOURCE_DATE_EPOCH provides a standard method to address this: it should be set to the last modification time of the source, and build processes use the specified timestamp instead of the "current" date and time. This change uses SOURCE_DATE_EPOCH if it is set; how it gets set needs to be addressed elsewhere. Modified: stable/10/sys/conf/newvers.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/newvers.sh ============================================================================== --- stable/10/sys/conf/newvers.sh Thu Jan 7 16:48:47 2016 (r293332) +++ stable/10/sys/conf/newvers.sh Thu Jan 7 17:00:35 2016 (r293333) @@ -87,7 +87,15 @@ then fi touch version -v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` +v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} +if [ -n "$SOURCE_DATE_EPOCH" ]; then + if ! t=`date -r $SOURCE_DATE_EPOCH 2>/dev/null`; then + echo "Invalid SOURCE_DATE_EPOCH" >&2 + exit 1 + fi +else + t=`date` +fi i=`${MAKE:-make} -V KERN_IDENT` compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep 'version') From owner-svn-src-stable-10@freebsd.org Thu Jan 7 17:03:27 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AAECA66B82; Thu, 7 Jan 2016 17:03:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53D121894; Thu, 7 Jan 2016 17:03:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07H3Qae069986; Thu, 7 Jan 2016 17:03:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07H3QIa069985; Thu, 7 Jan 2016 17:03:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601071703.u07H3QIa069985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 17:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293335 - stable/10/usr.sbin/kbdmap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 17:03:27 -0000 Author: emaste Date: Thu Jan 7 17:03:26 2016 New Revision: 293335 URL: https://svnweb.freebsd.org/changeset/base/293335 Log: MFC r291377: vidfont: with vt(4) omit size from vidcontrol -f When using syscons, vidfont extracts the font size from the filename passes it to vidcontrol -f. In vt(4) mode the size argument is not required, and some of the fonts in /usr/share/vt/fonts do not have the size in the filename, which caused vidfont to fail. Thus, just omit the size argument in vt(4) mode. Modified: stable/10/usr.sbin/kbdmap/kbdmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- stable/10/usr.sbin/kbdmap/kbdmap.c Thu Jan 7 17:02:34 2016 (r293334) +++ stable/10/usr.sbin/kbdmap/kbdmap.c Thu Jan 7 17:03:26 2016 (r293335) @@ -57,6 +57,7 @@ static const char *dir; static const char *menu = ""; static int x11; +static int using_vt; static int show; static int verbose; static int print; @@ -150,7 +151,7 @@ add_keymap(const char *desc, int mark, c * Return 0 if syscons is in use (to select legacy defaults). */ static int -check_newcons(void) +check_vt(void) { size_t len; char term[3]; @@ -159,7 +160,7 @@ check_newcons(void) if (sysctlbyname("kern.vty", &term, &len, NULL, 0) != 0 || strcmp(term, "vt") != 0) return 0; - return -1; + return 1; } /* @@ -256,7 +257,7 @@ get_font(void) static void vidcontrol(const char *fnt) { - char *tmp, *p, *q; + char *tmp, *p, *q, *cmd; char ch; int i; @@ -264,6 +265,13 @@ vidcontrol(const char *fnt) if (x11) return; + if (using_vt) { + asprintf(&cmd, "vidcontrol -f %s", fnt); + system(cmd); + free(cmd); + return; + } + tmp = strdup(fnt); /* Extract font size */ @@ -281,7 +289,6 @@ vidcontrol(const char *fnt) if (sscanf(p, "%dx%d%c", &i, &i, &ch) != 2) fprintf(stderr, "Which font size? %s\n", fnt); else { - char *cmd; asprintf(&cmd, "vidcontrol -f %s %s", p, fnt); if (verbose) fprintf(stderr, "%s\n", cmd); @@ -832,7 +839,8 @@ main(int argc, char **argv) sleep(2); } - if (check_newcons() == 0) { + using_vt = check_vt(); + if (using_vt == 0) { keymapdir = DEFAULT_SC_KEYMAP_DIR; fontdir = DEFAULT_SC_FONT_DIR; font_default = DEFAULT_SC_FONT; From owner-svn-src-stable-10@freebsd.org Thu Jan 7 19:52:19 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F01FA671C2; Thu, 7 Jan 2016 19:52:19 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37AD11DD0; Thu, 7 Jan 2016 19:52:19 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07JqIPB021305; Thu, 7 Jan 2016 19:52:18 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07JqIGi021303; Thu, 7 Jan 2016 19:52:18 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201601071952.u07JqIGi021303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 7 Jan 2016 19:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293344 - stable/10/usr.bin/netstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 19:52:19 -0000 Author: gnn Date: Thu Jan 7 19:52:17 2016 New Revision: 293344 URL: https://svnweb.freebsd.org/changeset/base/293344 Log: MFC: 292394 Switch the IPsec related statistics to using the built in sysctl variable set rather than reading from kernel memory. This also makes the -z (zero) flag work correctly Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/10/usr.bin/netstat/ipsec.c stable/10/usr.bin/netstat/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/netstat/ipsec.c ============================================================================== --- stable/10/usr.bin/netstat/ipsec.c Thu Jan 7 19:47:26 2016 (r293343) +++ stable/10/usr.bin/netstat/ipsec.c Thu Jan 7 19:52:17 2016 (r293344) @@ -199,10 +199,17 @@ ipsec_stats(u_long off, const char *name { struct ipsecstat ipsecstat; - if (off == 0) - return; + if (strcmp(name, "ipsec6") == 0) { + if (fetch_stats("net.inet6.ipsec6.ipsecstats", off,&ipsecstat, + sizeof(ipsecstat), kread_counters) != 0) + return; + } else { + if (fetch_stats("net.inet.ipsec.ipsecstats", off, &ipsecstat, + sizeof(ipsecstat), kread_counters) != 0) + return; + } + printf ("%s:\n", name); - kread_counters(off, (char *)&ipsecstat, sizeof(ipsecstat)); print_ipsecstats(&ipsecstat); } @@ -285,10 +292,10 @@ ah_stats(u_long off, const char *name, i { struct ahstat ahstat; - if (off == 0) + if (fetch_stats("net.inet.ah.stats", off, &ahstat, + sizeof(ahstat), kread_counters) != 0) return; printf ("%s:\n", name); - kread_counters(off, (char *)&ahstat, sizeof(ahstat)); print_ahstats(&ahstat); } @@ -332,10 +339,10 @@ esp_stats(u_long off, const char *name, { struct espstat espstat; - if (off == 0) + if (fetch_stats("net.inet.esp.stats", off, &espstat, + sizeof(espstat), kread_counters) != 0) return; printf ("%s:\n", name); - kread_counters(off, (char *)&espstat, sizeof(espstat)); print_espstats(&espstat); } @@ -377,10 +384,10 @@ ipcomp_stats(u_long off, const char *nam { struct ipcompstat ipcompstat; - if (off == 0) + if (fetch_stats("net.inet.ipcomp.stats", off, &ipcompstat, + sizeof(ipcompstat), kread_counters) != 0) return; printf ("%s:\n", name); - kread_counters(off, (char *)&ipcompstat, sizeof(ipcompstat)); print_ipcompstats(&ipcompstat); } Modified: stable/10/usr.bin/netstat/main.c ============================================================================== --- stable/10/usr.bin/netstat/main.c Thu Jan 7 19:47:26 2016 (r293343) +++ stable/10/usr.bin/netstat/main.c Thu Jan 7 19:52:17 2016 (r293344) @@ -203,13 +203,13 @@ struct protox { igmp_stats, NULL, "igmp", 1, IPPROTO_IGMP }, #ifdef IPSEC { -1, N_IPSECSTAT, 1, NULL, /* keep as compat */ - ipsec_stats, NULL, "ipsec", 0, 0}, + ipsec_stats, NULL, "ipsec", 1, 0}, { -1, N_AHSTAT, 1, NULL, - ah_stats, NULL, "ah", 0, 0}, + ah_stats, NULL, "ah", 1, 0}, { -1, N_ESPSTAT, 1, NULL, - esp_stats, NULL, "esp", 0, 0}, + esp_stats, NULL, "esp", 1, 0}, { -1, N_IPCOMPSTAT, 1, NULL, - ipcomp_stats, NULL, "ipcomp", 0, 0}, + ipcomp_stats, NULL, "ipcomp", 1, 0}, #endif { N_RIPCBINFO, N_PIMSTAT, 1, protopr, pim_stats, NULL, "pim", 1, IPPROTO_PIM }, @@ -241,7 +241,7 @@ struct protox ip6protox[] = { #endif #ifdef IPSEC { -1, N_IPSEC6STAT, 1, NULL, - ipsec_stats, NULL, "ipsec6", 0, 0 }, + ipsec_stats, NULL, "ipsec6", 1, 0 }, #endif #ifdef notyet { -1, N_PIM6STAT, 1, NULL, From owner-svn-src-stable-10@freebsd.org Thu Jan 7 20:10:51 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71C55A6792E; Thu, 7 Jan 2016 20:10:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FBE71EDF; Thu, 7 Jan 2016 20:10:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07KAoJq025747; Thu, 7 Jan 2016 20:10:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07KAneH025742; Thu, 7 Jan 2016 20:10:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601072010.u07KAneH025742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 20:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293347 - in stable/10/sys/boot/efi: boot1 libefi loader X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 20:10:51 -0000 Author: emaste Date: Thu Jan 7 20:10:49 2016 New Revision: 293347 URL: https://svnweb.freebsd.org/changeset/base/293347 Log: MFC r281524 by andrew@: Use MACHINE in the efi loader when it is what we mean It may not be the same as MACHINE_CPUARCH, it just happened to be the case the architectures this code currently supports. Fixes build failure reported by Oliver Pinter. Added: stable/10/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu - copied, changed from r293345, stable/10/sys/boot/efi/boot1/fat.tmpl.bz2.uu Deleted: stable/10/sys/boot/efi/boot1/fat.tmpl.bz2.uu Modified: stable/10/sys/boot/efi/boot1/Makefile stable/10/sys/boot/efi/libefi/Makefile stable/10/sys/boot/efi/loader/Makefile Modified: stable/10/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/10/sys/boot/efi/boot1/Makefile Thu Jan 7 20:08:02 2016 (r293346) +++ stable/10/sys/boot/efi/boot1/Makefile Thu Jan 7 20:10:49 2016 (r293347) @@ -18,18 +18,20 @@ SRCS= boot1.c reloc.c start.S CFLAGS+= -fPIC CFLAGS+= -I. CFLAGS+= -I${.CURDIR}/../include -CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/../include/${MACHINE} CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include CFLAGS+= -I${.CURDIR}/../../.. # Always add MI sources and REGULAR efi loader bits -.PATH: ${.CURDIR}/../loader/arch/amd64 ${.CURDIR}/../../common +.PATH: ${.CURDIR}/../loader/arch/${MACHINE} +.PATH: ${.CURDIR}/../loader +.PATH: ${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../common FILES= boot1.efi boot1.efifat FILESMODE_boot1.efi= ${BINMODE} -LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE_CPUARCH}/ldscript.${MACHINE_CPUARCH} +LDSCRIPT= ${.CURDIR}/../loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared -Wl,-znocombreloc ${PROG}: ${LDSCRIPT} @@ -62,8 +64,8 @@ boot1.o: ${.CURDIR}/../../common/ufsread boot1.efifat: boot1.efi echo ${.OBJDIR} - uudecode ${.CURDIR}/fat.tmpl.bz2.uu - mv fat.tmpl.bz2 ${.TARGET}.bz2 + uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu + mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2 bzip2 -f -d ${.TARGET}.bz2 dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc Copied and modified: stable/10/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu (from r293345, stable/10/sys/boot/efi/boot1/fat.tmpl.bz2.uu) ============================================================================== --- stable/10/sys/boot/efi/boot1/fat.tmpl.bz2.uu Thu Jan 7 19:58:23 2016 (r293345, copy source) +++ stable/10/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu Thu Jan 7 20:10:49 2016 (r293347) @@ -1,7 +1,7 @@ FAT template boot filesystem created by generate-fat.sh DO NOT EDIT $FreeBSD$ -begin 644 fat.tmpl.bz2 +begin 644 fat-amd64.tmpl.bz2 M0EIH.3%!629362AK*D(`&I+____[ZZKJZ_^N_ZO^Z_Z_OJ[L`4`!7I0$#&$" M0$!$3&(I-DTU,)ZAZ0VA-!M0T'J`>H#"9 Modified: stable/10/sys/boot/efi/libefi/Makefile ============================================================================== --- stable/10/sys/boot/efi/libefi/Makefile Thu Jan 7 20:08:02 2016 (r293346) +++ stable/10/sys/boot/efi/libefi/Makefile Thu Jan 7 20:10:49 2016 (r293347) @@ -10,7 +10,7 @@ SRCS= delay.c efi_console.c efinet.c efi CFLAGS+= -fPIC -mno-red-zone .endif CFLAGS+= -I${.CURDIR}/../include -CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/../include/${MACHINE} CFLAGS+= -I${.CURDIR}/../../../../lib/libstand # Pick up the bootstrap header for some interface items Modified: stable/10/sys/boot/efi/loader/Makefile ============================================================================== --- stable/10/sys/boot/efi/loader/Makefile Thu Jan 7 20:08:02 2016 (r293346) +++ stable/10/sys/boot/efi/loader/Makefile Thu Jan 7 20:10:49 2016 (r293347) @@ -23,16 +23,16 @@ SRCS= autoload.c \ smbios.c \ vers.c -.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH} +.PATH: ${.CURDIR}/arch/${MACHINE} # For smbios.c .PATH: ${.CURDIR}/../../i386/libi386 -.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc" +.include "${.CURDIR}/arch/${MACHINE}/Makefile.inc" CFLAGS+= -fPIC CFLAGS+= -I${.CURDIR} -CFLAGS+= -I${.CURDIR}/arch/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/arch/${MACHINE} CFLAGS+= -I${.CURDIR}/../include -CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/../include/${MACHINE} CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../i386/libi386 @@ -42,7 +42,7 @@ CFLAGS+= -DNO_PCI -DEFI BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH CFLAGS+= -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE} LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif @@ -61,12 +61,12 @@ CFLAGS+= -I${.CURDIR}/../../common FILES= loader.efi FILESMODE_loader.efi= ${BINMODE} -LDSCRIPT= ${.CURDIR}/arch/${MACHINE_CPUARCH}/ldscript.${MACHINE_CPUARCH} +LDSCRIPT= ${.CURDIR}/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared -Wl,-znocombreloc CLEANFILES= vers.c loader.efi -NEWVERSWHAT= "EFI loader" ${MACHINE_CPUARCH} +NEWVERSWHAT= "EFI loader" ${MACHINE} vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../efi/loader/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} From owner-svn-src-stable-10@freebsd.org Thu Jan 7 20:34:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96D62A6648B; Thu, 7 Jan 2016 20:34:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66D1618BB; Thu, 7 Jan 2016 20:34:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07KY6Vo034869; Thu, 7 Jan 2016 20:34:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07KY64m034867; Thu, 7 Jan 2016 20:34:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601072034.u07KY64m034867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Jan 2016 20:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293353 - stable/10/sys/boot X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 20:34:07 -0000 Author: emaste Date: Thu Jan 7 20:34:06 2016 New Revision: 293353 URL: https://svnweb.freebsd.org/changeset/base/293353 Log: MFC r280808 by andrew: Reorder sys/boot/Makefile for the efi loader move As these will depend on ficl having been built, and are set via bsd.arch.inc.mk we need to place this after ficl. As Makefile.amd64 is now late enough we can add the i386 directory to this. Modified: stable/10/sys/boot/Makefile stable/10/sys/boot/Makefile.amd64 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/Makefile ============================================================================== --- stable/10/sys/boot/Makefile Thu Jan 7 20:32:04 2016 (r293352) +++ stable/10/sys/boot/Makefile Thu Jan 7 20:34:06 2016 (r293353) @@ -1,7 +1,6 @@ # $FreeBSD$ .include -.include .if ${MK_FORTH} != "no" # Build the add-in FORTH interpreter. @@ -9,13 +8,12 @@ SUBDIR+= ficl SUBDIR+= forth .endif +.include + # Pick the machine-dependent subdir based on the target architecture. ADIR= ${MACHINE:S/powerpc64/powerpc/} .if exists(${.CURDIR}/${ADIR}/.) SUBDIR+= ${ADIR} .endif -.if ${MACHINE} == "amd64" -SUBDIR+= i386 -.endif .include Modified: stable/10/sys/boot/Makefile.amd64 ============================================================================== --- stable/10/sys/boot/Makefile.amd64 Thu Jan 7 20:32:04 2016 (r293352) +++ stable/10/sys/boot/Makefile.amd64 Thu Jan 7 20:34:06 2016 (r293353) @@ -8,3 +8,5 @@ SUBDIR+= userboot .if ${MK_FORTH} != "no" SUBDIR+= ficl32 .endif + +SUBDIR+= i386 From owner-svn-src-stable-10@freebsd.org Thu Jan 7 20:43:46 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85573A6686C; Thu, 7 Jan 2016 20:43:46 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54D0112A0; Thu, 7 Jan 2016 20:43:46 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07KhjfQ038045; Thu, 7 Jan 2016 20:43:45 GMT (envelope-from wollman@FreeBSD.org) Received: (from wollman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07KhjKD038044; Thu, 7 Jan 2016 20:43:45 GMT (envelope-from wollman@FreeBSD.org) Message-Id: <201601072043.u07KhjKD038044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wollman set sender to wollman@FreeBSD.org using -f From: Garrett Wollman Date: Thu, 7 Jan 2016 20:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293358 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 20:43:46 -0000 Author: wollman Date: Thu Jan 7 20:43:45 2016 New Revision: 293358 URL: https://svnweb.freebsd.org/changeset/base/293358 Log: MFH r292836: in6_if2idlen: treat bridge(4) interfaces like other Ethernet interfaces bridge(4) interfaces have an if_type of IFT_BRIDGE, rather than IFT_ETHER, even though they only support Ethernet-style links. This caused in6_if2idlen to emit an "unknown link type (209)" warning to the console every time it was called. Add IFT_BRIDGE to the case statement in the appropriate place, indicating that it uses the same IPv6 address format as other Ethernet-like interfaces. Modified: stable/10/sys/netinet6/in6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/in6.c ============================================================================== --- stable/10/sys/netinet6/in6.c Thu Jan 7 20:37:18 2016 (r293357) +++ stable/10/sys/netinet6/in6.c Thu Jan 7 20:43:45 2016 (r293358) @@ -2449,6 +2449,7 @@ in6_if2idlen(struct ifnet *ifp) #ifdef IFT_MIP case IFT_MIP: /* ditto */ #endif + case IFT_BRIDGE: /* bridge(4) only does Ethernet-like links */ case IFT_INFINIBAND: return (64); case IFT_FDDI: /* RFC2467 */ From owner-svn-src-stable-10@freebsd.org Thu Jan 7 21:21:30 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73F8FA6766E for ; Thu, 7 Jan 2016 21:21:30 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EDBC13CF for ; Thu, 7 Jan 2016 21:21:30 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x231.google.com with SMTP id f206so113267975wmf.0 for ; Thu, 07 Jan 2016 13:21:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=EaX0bUrG1wYDxmbyKCC5rH5s6dBn5cjijEk6Czm1pQI=; b=lWqyfmbPz5mGLr6GLk1VlQCC0eNIEgHePPVl2LOgVy0Rsw3aG7P6byk46pefa8sZ2g sujYz7H+I/9j6PjeZvxQBP/5+8fDLGcPilvHZPkkzS5SuWhvqFkhYnOl20SXTJKjqcgq oWjiEdy8TKNAJL0mi9HNGwRnvbUIoYMejZdZYxTQ5LTqrCCP5C2uO7g5ESAJOt/xwEdd SBCGyZYFQce6fnUno73jBkvjsgG6D9XnmVJ7o7AmXPg2qMOKP7I6nQ0brGHMa8Stddhq v30n+UxsQw0g4kJETx2x8TR1A2zy20ubsagYiHi2VWGUz37z4AE0nf1O+DlS2bNOzRuD Joow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=EaX0bUrG1wYDxmbyKCC5rH5s6dBn5cjijEk6Czm1pQI=; b=kKoRe+32he8foZKkNxzsFE1NcPcpzix93QY6In3BAqCC89lImfY4hknHrKYQ7o1DeI wF8TVk4LrvvZhVQqg3HiW/mnqF6ENUnJOkt8DTtDchzRPwKTtfyrmJoTQfChZ/SYXPx7 tmUTh0SfqQo7DX3RAgipz6EYZlFOBFyaIlmdg0SSQ9zGziZCfQREfcjxaPMnoufxX5eZ AaUr9C4LShAX5FnClXUUCVye15YdAj4cDKYtGX0q7ReYzdQBdvZKTxC2+pAx55cQFaNh QtLLthe1VLQLMJdVWqAh0is1jlFHLuFoKNWDB5p950+zSXV/vxm2FT2QYOxckrXeLXX1 IsIw== X-Gm-Message-State: ALoCoQnPD5mg5jmbWNy81kA4ZHzBEElqMoCXCftRjICBkMj7IcYXzo4ZCgaygq9GmiHHvCg8KlVIYHOs4EZjkA1vTnhN2BWuDi8y5DJb+s29UB/QQLpW6CY= MIME-Version: 1.0 X-Received: by 10.194.171.66 with SMTP id as2mr15027455wjc.73.1452201688562; Thu, 07 Jan 2016 13:21:28 -0800 (PST) Received: by 10.194.85.167 with HTTP; Thu, 7 Jan 2016 13:21:28 -0800 (PST) In-Reply-To: <201601072034.u07KY64m034867@repo.freebsd.org> References: <201601072034.u07KY64m034867@repo.freebsd.org> Date: Thu, 7 Jan 2016 22:21:28 +0100 Message-ID: Subject: Re: svn commit: r293353 - stable/10/sys/boot From: Oliver Pinter To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 21:21:30 -0000 On Thu, Jan 7, 2016 at 9:34 PM, Ed Maste wrote: > Author: emaste > Date: Thu Jan 7 20:34:06 2016 > New Revision: 293353 > URL: https://svnweb.freebsd.org/changeset/base/293353 > > Log: > MFC r280808 by andrew: Reorder sys/boot/Makefile for the efi loader move Thanks Ed! This commit is the real fix, and not the previous one what I mentioned. > > As these will depend on ficl having been built, and are set via > bsd.arch.inc.mk we need to place this after ficl. > > As Makefile.amd64 is now late enough we can add the i386 directory to > this. > > Modified: > stable/10/sys/boot/Makefile > stable/10/sys/boot/Makefile.amd64 > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sys/boot/Makefile > ============================================================================== > --- stable/10/sys/boot/Makefile Thu Jan 7 20:32:04 2016 (r293352) > +++ stable/10/sys/boot/Makefile Thu Jan 7 20:34:06 2016 (r293353) > @@ -1,7 +1,6 @@ > # $FreeBSD$ > > .include > -.include > > .if ${MK_FORTH} != "no" > # Build the add-in FORTH interpreter. > @@ -9,13 +8,12 @@ SUBDIR+= ficl > SUBDIR+= forth > .endif > > +.include > + > # Pick the machine-dependent subdir based on the target architecture. > ADIR= ${MACHINE:S/powerpc64/powerpc/} > .if exists(${.CURDIR}/${ADIR}/.) > SUBDIR+= ${ADIR} > .endif > -.if ${MACHINE} == "amd64" > -SUBDIR+= i386 > -.endif > > .include > > Modified: stable/10/sys/boot/Makefile.amd64 > ============================================================================== > --- stable/10/sys/boot/Makefile.amd64 Thu Jan 7 20:32:04 2016 (r293352) > +++ stable/10/sys/boot/Makefile.amd64 Thu Jan 7 20:34:06 2016 (r293353) > @@ -8,3 +8,5 @@ SUBDIR+= userboot > .if ${MK_FORTH} != "no" > SUBDIR+= ficl32 > .endif > + > +SUBDIR+= i386 > _______________________________________________ > svn-src-stable-10@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 > To unsubscribe, send any mail to "svn-src-stable-10-unsubscribe@freebsd.org" From owner-svn-src-stable-10@freebsd.org Thu Jan 7 22:05:05 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B27D9A666E5; Thu, 7 Jan 2016 22:05:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 674D21EC1; Thu, 7 Jan 2016 22:05:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07M54hP065403; Thu, 7 Jan 2016 22:05:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07M54FU065402; Thu, 7 Jan 2016 22:05:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601072205.u07M54FU065402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jan 2016 22:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293375 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 22:05:05 -0000 Author: bdrewery Date: Thu Jan 7 22:05:04 2016 New Revision: 293375 URL: https://svnweb.freebsd.org/changeset/base/293375 Log: MFC r291610: Allow storing package(world|kernel) tarballs into a different location at PACKAGEDIR. Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Thu Jan 7 21:53:44 2016 (r293374) +++ stable/10/Makefile.inc1 Thu Jan 7 22:05:04 2016 (r293375) @@ -116,6 +116,7 @@ CLEANDIR= cleandir .endif LOCAL_TOOL_DIRS?= +PACKAGEDIR?= ${DESTDIR}/${DISTDIR} BUILDENV_SHELL?=/bin/sh @@ -915,11 +916,11 @@ packageworld: ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ tar cvf - --exclude usr/lib/debug \ @${DESTDIR}/${DISTDIR}/${dist}.meta | \ - ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}.txz + ${XZ_CMD} > ${PACKAGEDIR}/${dist}.txz .else ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ tar cvf - --exclude usr/lib/debug . | \ - ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}.txz + ${XZ_CMD} > ${PACKAGEDIR}/${dist}.txz .endif .endfor @@ -928,11 +929,11 @@ packageworld: . if defined(NO_ROOT) ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ tar cvf - @${DESTDIR}/${DISTDIR}/${dist}.debug.meta | \ - ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}.debug.txz + ${XZ_CMD} > ${PACKAGEDIR}/${dist}.debug.txz . else ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ tar cvLf - usr/lib/debug | \ - ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}-debug.txz + ${XZ_CMD} > ${PACKAGEDIR}/${dist}-debug.txz . endif . endfor .endif @@ -1154,23 +1155,23 @@ packagekernel: .if defined(NO_ROOT) cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \ - ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz + ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .if ${BUILDKERNELS:[#]} > 1 .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ - ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz + ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz .endfor .endif .else cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - . | \ - ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz + ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .if ${BUILDKERNELS:[#]} > 1 .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - . | \ - ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz + ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz .endfor .endif .endif From owner-svn-src-stable-10@freebsd.org Thu Jan 7 22:06:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F906A6677B; Thu, 7 Jan 2016 22:06:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 476801030; Thu, 7 Jan 2016 22:06:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07M65Rs065480; Thu, 7 Jan 2016 22:06:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07M65VU065479; Thu, 7 Jan 2016 22:06:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601072206.u07M65VU065479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jan 2016 22:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293376 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 22:06:06 -0000 Author: bdrewery Date: Thu Jan 7 22:06:05 2016 New Revision: 293376 URL: https://svnweb.freebsd.org/changeset/base/293376 Log: MFC r291611: Add NO_INSTALLKERNEL to undo the assumption that the first KERNCONF will be installed as "kernel". This is relevant for packaging of the kernel when not wanting a default "kernel.txz". Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Thu Jan 7 22:05:04 2016 (r293375) +++ stable/10/Makefile.inc1 Thu Jan 7 22:06:05 2016 (r293376) @@ -1012,10 +1012,14 @@ KERNCONFDIR?= ${KRNLCONFDIR} BUILDKERNELS= INSTALLKERNEL= +.if defined(NO_INSTALLKERNEL) +# All of the BUILDKERNELS loops start at index 1. +BUILDKERNELS+= dummy +.endif .for _kernel in ${KERNCONF} .if exists(${KERNCONFDIR}/${_kernel}) BUILDKERNELS+= ${_kernel} -.if empty(INSTALLKERNEL) +.if empty(INSTALLKERNEL) && !defined(NO_INSTALLKERNEL) INSTALLKERNEL= ${_kernel} .endif .endif @@ -1029,12 +1033,12 @@ ${WMAKE_TGTS:N_worldtmp:Nbuild32} ${.ALL # Builds all kernels defined by BUILDKERNELS. # buildkernel: .MAKE .PHONY -.if empty(BUILDKERNELS) +.if empty(BUILDKERNELS:Ndummy) @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \ false .endif @echo -.for _kernel in ${BUILDKERNELS} +.for _kernel in ${BUILDKERNELS:Ndummy} @echo "--------------------------------------------------------------" @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`" @echo "--------------------------------------------------------------" @@ -1093,6 +1097,7 @@ buildkernel: .MAKE .PHONY # installkernel installkernel.debug \ reinstallkernel reinstallkernel.debug: _installcheck_kernel +.if !defined(NO_INSTALLKERNEL) .if empty(INSTALLKERNEL) @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ false @@ -1103,6 +1108,7 @@ reinstallkernel reinstallkernel.debug: _ cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} +.endif .if ${BUILDKERNELS:[#]} > 1 .for _kernel in ${BUILDKERNELS:[2..-1]} @echo "--------------------------------------------------------------" @@ -1115,6 +1121,7 @@ reinstallkernel reinstallkernel.debug: _ .endif distributekernel distributekernel.debug: +.if !defined(NO_INSTALLKERNEL) .if empty(INSTALLKERNEL) @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ false @@ -1132,6 +1139,7 @@ distributekernel distributekernel.debug: sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \ ${DESTDIR}/${DISTDIR}/kernel.meta .endif +.endif .if ${BUILDKERNELS:[#]} > 1 .for _kernel in ${BUILDKERNELS:[2..-1]} .if defined(NO_ROOT) @@ -1153,9 +1161,11 @@ distributekernel distributekernel.debug: packagekernel: .if defined(NO_ROOT) +.if !defined(NO_INSTALLKERNEL) cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz +.endif .if ${BUILDKERNELS:[#]} > 1 .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ @@ -1164,9 +1174,11 @@ packagekernel: .endfor .endif .else +.if !defined(NO_INSTALLKERNEL) cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - . | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz +.endif .if ${BUILDKERNELS:[#]} > 1 .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ From owner-svn-src-stable-10@freebsd.org Thu Jan 7 23:10:45 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAC27A66469; Thu, 7 Jan 2016 23:10:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 616C61AC8; Thu, 7 Jan 2016 23:10:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07NAiBq085843; Thu, 7 Jan 2016 23:10:44 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07NAiBY085842; Thu, 7 Jan 2016 23:10:44 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201601072310.u07NAiBY085842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Jan 2016 23:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293391 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 23:10:45 -0000 Author: glebius Date: Thu Jan 7 23:10:44 2016 New Revision: 293391 URL: https://svnweb.freebsd.org/changeset/base/293391 Log: Merge r293282 from head: Provide knob NO_INSTALLEXTRAKERNELS. If defined, extra kernels in KERNCONF won't be installed, only the first one would. Turn NO_INSTALLEXTRAKERNELS=yes on stable/10 to preserve original behaviour of not installing additional kernels built. Reported & tested by: Trond Endrestøl Reported & tested by: dhw Modified: stable/10/Makefile.inc1 Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Thu Jan 7 23:02:15 2016 (r293390) +++ stable/10/Makefile.inc1 Thu Jan 7 23:10:44 2016 (r293391) @@ -1012,6 +1012,7 @@ KERNCONFDIR?= ${KRNLCONFDIR} BUILDKERNELS= INSTALLKERNEL= +NO_INSTALLEXTRAKERNELS=yes .if defined(NO_INSTALLKERNEL) # All of the BUILDKERNELS loops start at index 1. BUILDKERNELS+= dummy @@ -1109,7 +1110,7 @@ reinstallkernel reinstallkernel.debug: _ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} .endif -.if ${BUILDKERNELS:[#]} > 1 +.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) .for _kernel in ${BUILDKERNELS:[2..-1]} @echo "--------------------------------------------------------------" @echo ">>> Installing kernel ${_kernel}" @@ -1140,7 +1141,7 @@ distributekernel distributekernel.debug: ${DESTDIR}/${DISTDIR}/kernel.meta .endif .endif -.if ${BUILDKERNELS:[#]} > 1 +.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) .for _kernel in ${BUILDKERNELS:[2..-1]} .if defined(NO_ROOT) echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta @@ -1166,7 +1167,7 @@ packagekernel: tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif -.if ${BUILDKERNELS:[#]} > 1 +.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ @@ -1179,7 +1180,7 @@ packagekernel: tar cvf - . | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif -.if ${BUILDKERNELS:[#]} > 1 +.if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - . | \ From owner-svn-src-stable-10@freebsd.org Thu Jan 7 23:26:19 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D8B6A66C1A; Thu, 7 Jan 2016 23:26:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C62811AED; Thu, 7 Jan 2016 23:26:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u07NQHi3091787; Thu, 7 Jan 2016 23:26:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u07NQGHw091773; Thu, 7 Jan 2016 23:26:16 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601072326.u07NQGHw091773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jan 2016 23:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293396 - in stable/10: lib/libpam/modules/pam_ssh secure/lib/libssh secure/libexec/sftp-server secure/libexec/ssh-keysign secure/libexec/ssh-pkcs11-helper secure/usr.bin/scp secure/usr... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 23:26:19 -0000 Author: bdrewery Date: Thu Jan 7 23:26:16 2016 New Revision: 293396 URL: https://svnweb.freebsd.org/changeset/base/293396 Log: MFC r291941: Replace unneeded manual dependency on header by adding it to SRCS. Modified: stable/10/lib/libpam/modules/pam_ssh/Makefile stable/10/secure/lib/libssh/Makefile stable/10/secure/libexec/sftp-server/Makefile stable/10/secure/libexec/ssh-keysign/Makefile stable/10/secure/libexec/ssh-pkcs11-helper/Makefile stable/10/secure/usr.bin/scp/Makefile stable/10/secure/usr.bin/sftp/Makefile stable/10/secure/usr.bin/ssh-add/Makefile stable/10/secure/usr.bin/ssh-agent/Makefile stable/10/secure/usr.bin/ssh-keygen/Makefile stable/10/secure/usr.bin/ssh-keyscan/Makefile stable/10/secure/usr.bin/ssh/Makefile stable/10/secure/usr.sbin/sshd/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpam/modules/pam_ssh/Makefile ============================================================================== --- stable/10/lib/libpam/modules/pam_ssh/Makefile Thu Jan 7 23:23:51 2016 (r293395) +++ stable/10/lib/libpam/modules/pam_ssh/Makefile Thu Jan 7 23:26:16 2016 (r293396) @@ -12,6 +12,7 @@ SRCS+= roaming_dummy.c WARNS?= 3 CFLAGS+= -I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h DPADD= ${LIBSSH} ${LIBCRYPTO} ${LIBCRYPT} LDADD= -lssh -lcrypto -lcrypt @@ -20,5 +21,3 @@ USEPRIVATELIB= ssh .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: stable/10/secure/lib/libssh/Makefile ============================================================================== --- stable/10/secure/lib/libssh/Makefile Thu Jan 7 23:23:51 2016 (r293395) +++ stable/10/secure/lib/libssh/Makefile Thu Jan 7 23:26:16 2016 (r293396) @@ -40,9 +40,11 @@ USEPRIVATELIB+= ldns .endif CFLAGS+= -I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h +SRCS+= krb5_config.h DPADD+= ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBCOM_ERR} ${LIBMD} ${LIBROKEN} LDADD+= -lgssapi -lkrb5 -lhx509 -lasn1 -lcom_err -lmd -lroken .endif @@ -59,8 +61,3 @@ LDADD+= -lcrypto -lcrypt -lz .include .PATH: ${SSHDIR} ${SSHDIR}/openbsd-compat - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h -.if ${MK_KERBEROS_SUPPORT} != "no" -${OBJS} ${POBJS} ${SOBJS}: krb5_config.h -.endif Modified: stable/10/secure/libexec/sftp-server/Makefile ============================================================================== --- stable/10/secure/libexec/sftp-server/Makefile Thu Jan 7 23:23:51 2016 (r293395) +++ stable/10/secure/libexec/sftp-server/Makefile Thu Jan 7 23:26:16 2016 (r293396) @@ -6,6 +6,7 @@ PROG= sftp-server SRCS= sftp-server.c sftp-common.c sftp-server-main.c MAN= sftp-server.8 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if !defined(NO_SHARED) # required when linking with a dynamic libssh @@ -29,5 +30,3 @@ LDADD+= -lcrypt -lcrypto -lz .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: stable/10/secure/libexec/ssh-keysign/Makefile ============================================================================== --- stable/10/secure/libexec/ssh-keysign/Makefile Thu Jan 7 23:23:51 2016 (r293395) +++ stable/10/secure/libexec/ssh-keysign/Makefile Thu Jan 7 23:26:16 2016 (r293396) @@ -6,6 +6,7 @@ PROG= ssh-keysign SRCS= ssh-keysign.c roaming_dummy.c readconf.c MAN= ssh-keysign.8 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h BINMODE=4555 DPADD= ${LIBSSH} @@ -25,5 +26,3 @@ LDADD+= -lcrypt -lcrypto -lz .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: stable/10/secure/libexec/ssh-pkcs11-helper/Makefile ============================================================================== --- stable/10/secure/libexec/ssh-pkcs11-helper/Makefile Thu Jan 7 23:23:51 2016 (r293395) +++ stable/10/secure/libexec/ssh-pkcs11-helper/Makefile Thu Jan 7 23:26:16 2016 (r293396) @@ -6,6 +6,7 @@ PROG= ssh-pkcs11-helper SRCS= ssh-pkcs11.c ssh-pkcs11-helper.c MAN= ssh-pkcs11-helper.8 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if !defined(NO_SHARED) # required when linking with a dynamic libssh @@ -29,5 +30,3 @@ LDADD+= -lcrypt -lcrypto -lz .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: stable/10/secure/usr.bin/scp/Makefile ============================================================================== --- stable/10/secure/usr.bin/scp/Makefile Thu Jan 7 23:23:51 2016 (r293395) +++ stable/10/secure/usr.bin/scp/Makefile Thu Jan 7 23:26:16 2016 (r293396) @@ -5,6 +5,7 @@ PROG= scp SRCS= scp.c CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if !defined(NO_SHARED) # required when linking with a dynamic libssh @@ -28,5 +29,3 @@ LDADD+= -lcrypt -lcrypto -lz .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: stable/10/secure/usr.bin/sftp/Makefile ============================================================================== --- stable/10/secure/usr.bin/sftp/Makefile Thu Jan 7 23:23:51 2016 (r293395) +++ stable/10/secure/usr.bin/sftp/Makefile Thu Jan 7 23:26:16 2016 (r293396) @@ -5,6 +5,7 @@ PROG= sftp SRCS= sftp.c sftp-client.c sftp-common.c sftp-glob.c progressmeter.c CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if !defined(NO_SHARED) # required when linking with a dynamic libssh @@ -28,5 +29,3 @@ LDADD+= -lcrypt -lcrypto -lz .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: stable/10/secure/usr.bin/ssh-add/Makefile ============================================================================== --- stable/10/secure/usr.bin/ssh-add/Makefile Thu Jan 7 23:23:51 2016 (r293395) +++ stable/10/secure/usr.bin/ssh-add/Makefile Thu Jan 7 23:26:16 2016 (r293396) @@ -5,6 +5,7 @@ PROG= ssh-add SRCS+= ssh-add.c CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if !defined(NO_SHARED) # required when linking with a dynamic libssh @@ -28,5 +29,3 @@ LDADD+= -lcrypt -lcrypto -lz .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: stable/10/secure/usr.bin/ssh-agent/Makefile ============================================================================== --- stable/10/secure/usr.bin/ssh-agent/Makefile Thu Jan 7 23:23:51 2016 (r293395) +++ stable/10/secure/usr.bin/ssh-agent/Makefile Thu Jan 7 23:26:16 2016 (r293396) @@ -5,6 +5,7 @@ PROG= ssh-agent SRCS= ssh-agent.c CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if !defined(NO_SHARED) # required when linking with a dynamic libssh @@ -28,5 +29,3 @@ LDADD+= -lcrypt -lcrypto -lz .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: stable/10/secure/usr.bin/ssh-keygen/Makefile ============================================================================== --- stable/10/secure/usr.bin/ssh-keygen/Makefile Thu Jan 7 23:23:51 2016 (r293395) +++ stable/10/secure/usr.bin/ssh-keygen/Makefile Thu Jan 7 23:26:16 2016 (r293396) @@ -5,6 +5,7 @@ PROG= ssh-keygen SRCS= ssh-keygen.c CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if !defined(NO_SHARED) # required when linking with a dynamic libssh @@ -28,5 +29,3 @@ LDADD+= -lcrypt -lcrypto -lz .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: stable/10/secure/usr.bin/ssh-keyscan/Makefile ============================================================================== --- stable/10/secure/usr.bin/ssh-keyscan/Makefile Thu Jan 7 23:23:51 2016 (r293395) +++ stable/10/secure/usr.bin/ssh-keyscan/Makefile Thu Jan 7 23:26:16 2016 (r293396) @@ -5,6 +5,7 @@ PROG= ssh-keyscan SRCS= ssh-keyscan.c roaming_dummy.c CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h DPADD= ${LIBSSH} LDADD= -lssh @@ -23,5 +24,3 @@ LDADD+= -lcrypt -lcrypto -lz .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: stable/10/secure/usr.bin/ssh/Makefile ============================================================================== --- stable/10/secure/usr.bin/ssh/Makefile Thu Jan 7 23:23:51 2016 (r293395) +++ stable/10/secure/usr.bin/ssh/Makefile Thu Jan 7 23:26:16 2016 (r293396) @@ -3,7 +3,6 @@ .include PROG= ssh -CFLAGS+=-I${SSHDIR} -include ssh_namespace.h LINKS= ${BINDIR}/ssh ${BINDIR}/slogin MAN= ssh.1 ssh_config.5 MLINKS= ssh.1 slogin.1 @@ -15,6 +14,9 @@ SRCS= ssh.c readconf.c clientloop.c ssht # gss-genr.c really belongs in libssh; see src/secure/lib/libssh/Makefile SRCS+= gss-genr.c +CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h + DPADD= ${LIBSSH} ${LIBUTIL} LDADD= -lssh -lutil USEPRIVATELIB= ssh @@ -28,6 +30,7 @@ USEPRIVATELIB+= ldns .if ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h +SRCS+= krb5_config.h DPADD+= ${LIBGSSAPI} LDADD+= -lgssapi .endif @@ -46,8 +49,3 @@ CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h -.if ${MK_KERBEROS_SUPPORT} != "no" -${OBJS} ${POBJS} ${SOBJS}: krb5_config.h -.endif Modified: stable/10/secure/usr.sbin/sshd/Makefile ============================================================================== --- stable/10/secure/usr.sbin/sshd/Makefile Thu Jan 7 23:23:51 2016 (r293395) +++ stable/10/secure/usr.sbin/sshd/Makefile Thu Jan 7 23:26:16 2016 (r293396) @@ -24,6 +24,7 @@ SRCS+= gss-genr.c MAN= sshd.8 sshd_config.5 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h DPADD= ${LIBSSH} ${LIBUTIL} ${LIBWRAP} ${LIBPAM} LDADD= -lssh -lutil -lwrap ${MINUSLPAM} @@ -44,6 +45,7 @@ LDADD+= -lbsm .if ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h +SRCS+= krb5_config.h DPADD+= ${LIBGSSAPI_KRB5} ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBASN1} \ ${LIBCOM_ERR} ${LIBROKEN} ${LIBWIND} ${LIBHEIMBASE} ${LIBHEIMIPCC} LDADD+= -lgssapi_krb5 -lgssapi -lkrb5 -lhx509 -lasn1 \ @@ -74,8 +76,3 @@ CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h -.if ${MK_KERBEROS_SUPPORT} != "no" -${OBJS} ${POBJS} ${SOBJS}: krb5_config.h -.endif From owner-svn-src-stable-10@freebsd.org Fri Jan 8 00:21:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3322AA65237; Fri, 8 Jan 2016 00:21:57 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 073581AA5; Fri, 8 Jan 2016 00:21:56 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u080LuSm009417; Fri, 8 Jan 2016 00:21:56 GMT (envelope-from stas@FreeBSD.org) Received: (from stas@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u080Luwv009416; Fri, 8 Jan 2016 00:21:56 GMT (envelope-from stas@FreeBSD.org) Message-Id: <201601080021.u080Luwv009416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stas set sender to stas@FreeBSD.org using -f From: Stanislav Sedov Date: Fri, 8 Jan 2016 00:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293401 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 00:21:57 -0000 Author: stas Date: Fri Jan 8 00:21:55 2016 New Revision: 293401 URL: https://svnweb.freebsd.org/changeset/base/293401 Log: MFC r292047: RPC: populate local address for rendezvous transporter. Modified: stable/10/lib/libc/rpc/svc_vc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/svc_vc.c ============================================================================== --- stable/10/lib/libc/rpc/svc_vc.c Fri Jan 8 00:07:37 2016 (r293400) +++ stable/10/lib/libc/rpc/svc_vc.c Fri Jan 8 00:21:55 2016 (r293401) @@ -292,8 +292,8 @@ rendezvous_request(xprt, msg) int sock, flags; struct cf_rendezvous *r; struct cf_conn *cd; - struct sockaddr_storage addr; - socklen_t len; + struct sockaddr_storage addr, sslocal; + socklen_t len, slen; struct __rpc_sockinfo si; SVCXPRT *newxprt; fd_set cleanfds; @@ -358,6 +358,20 @@ again: __xdrrec_setnonblock(&cd->xdrs, cd->maxrec); } else cd->nonblock = FALSE; + slen = sizeof(struct sockaddr_storage); + if(_getsockname(sock, (struct sockaddr *)(void *)&sslocal, &slen) < 0) { + warnx("svc_vc_create: could not retrieve local addr"); + newxprt->xp_ltaddr.maxlen = newxprt->xp_ltaddr.len = 0; + } else { + newxprt->xp_ltaddr.maxlen = newxprt->xp_ltaddr.len = sslocal.ss_len; + newxprt->xp_ltaddr.buf = mem_alloc((size_t)sslocal.ss_len); + if (newxprt->xp_ltaddr.buf == NULL) { + warnx("svc_vc_create: no mem for local addr"); + newxprt->xp_ltaddr.maxlen = newxprt->xp_ltaddr.len = 0; + } else { + memcpy(newxprt->xp_ltaddr.buf, &sslocal, (size_t)sslocal.ss_len); + } + } gettimeofday(&cd->last_recv_time, NULL); From owner-svn-src-stable-10@freebsd.org Fri Jan 8 00:46:29 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 817DEA65B90; Fri, 8 Jan 2016 00:46:29 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 556221763; Fri, 8 Jan 2016 00:46:29 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u080kSVX015727; Fri, 8 Jan 2016 00:46:28 GMT (envelope-from stas@FreeBSD.org) Received: (from stas@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u080kSaE015726; Fri, 8 Jan 2016 00:46:28 GMT (envelope-from stas@FreeBSD.org) Message-Id: <201601080046.u080kSaE015726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stas set sender to stas@FreeBSD.org using -f From: Stanislav Sedov Date: Fri, 8 Jan 2016 00:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293402 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 00:46:29 -0000 Author: stas Date: Fri Jan 8 00:46:28 2016 New Revision: 293402 URL: https://svnweb.freebsd.org/changeset/base/293402 Log: MFC r277938 (by hiren): make syncookie_mac() use 'tcp_seq irs' in computing hash. Modified: stable/10/sys/netinet/tcp_syncache.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_syncache.c ============================================================================== --- stable/10/sys/netinet/tcp_syncache.c Fri Jan 8 00:21:55 2016 (r293401) +++ stable/10/sys/netinet/tcp_syncache.c Fri Jan 8 00:46:28 2016 (r293402) @@ -1852,6 +1852,7 @@ syncookie_mac(struct in_conninfo *inc, t } SipHash_Update(&ctx, &inc->inc_fport, sizeof(inc->inc_fport)); SipHash_Update(&ctx, &inc->inc_lport, sizeof(inc->inc_lport)); + SipHash_Update(&ctx, &irs, sizeof(irs)); SipHash_Update(&ctx, &flags, sizeof(flags)); SipHash_Update(&ctx, &secmod, sizeof(secmod)); SipHash_Final((u_int8_t *)&siphash, &ctx); From owner-svn-src-stable-10@freebsd.org Fri Jan 8 02:52:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17008A66942; Fri, 8 Jan 2016 02:52:06 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD4AC14CC; Fri, 8 Jan 2016 02:52:05 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u082q5QD055290; Fri, 8 Jan 2016 02:52:05 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u082q521055289; Fri, 8 Jan 2016 02:52:05 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201601080252.u082q521055289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 8 Jan 2016 02:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293407 - stable/10/sys/xen/xenbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 02:52:06 -0000 Author: araujo Date: Fri Jan 8 02:52:04 2016 New Revision: 293407 URL: https://svnweb.freebsd.org/changeset/base/293407 Log: MFC: r292969 Clean up unused-but-set-variable spotted by gcc-4.9. Reviewed by: ngie Approved by: rodrigc (mentor) Sponsored by: gandi.net Differential Revision: https://reviews.freebsd.org/D4778 Modified: stable/10/sys/xen/xenbus/xenbusb.c Modified: stable/10/sys/xen/xenbus/xenbusb.c ============================================================================== --- stable/10/sys/xen/xenbus/xenbusb.c Fri Jan 8 01:18:10 2016 (r293406) +++ stable/10/sys/xen/xenbus/xenbusb.c Fri Jan 8 02:52:04 2016 (r293407) @@ -561,7 +561,6 @@ xenbusb_devices_changed(struct xs_watch struct xenbusb_softc *xbs; device_t dev; char *node; - char *bus; char *type; char *id; char *p; @@ -580,7 +579,6 @@ xenbusb_devices_changed(struct xs_watch p = strchr(node, '/'); if (p == NULL) goto out; - bus = node; *p = 0; type = p + 1; From owner-svn-src-stable-10@freebsd.org Fri Jan 8 02:54:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E07C8A66A6E; Fri, 8 Jan 2016 02:54:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0B4317AA; Fri, 8 Jan 2016 02:54:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u082sLUG055398; Fri, 8 Jan 2016 02:54:21 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u082sLBs055397; Fri, 8 Jan 2016 02:54:21 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201601080254.u082sLBs055397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 8 Jan 2016 02:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293408 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 02:54:23 -0000 Author: araujo Date: Fri Jan 8 02:54:21 2016 New Revision: 293408 URL: https://svnweb.freebsd.org/changeset/base/293408 Log: MFC: r292970 Clean up unused-but-set-variable spotted by gcc-4.9. Reviewed by: ngie Approved by: rodrigc (mentor) Sponsored by: gandi.net Differential Revision: https://reviews.freebsd.org/D4777 Modified: stable/10/usr.sbin/bhyve/pci_emul.c Modified: stable/10/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_emul.c Fri Jan 8 02:52:04 2016 (r293407) +++ stable/10/usr.sbin/bhyve/pci_emul.c Fri Jan 8 02:54:21 2016 (r293408) @@ -863,10 +863,9 @@ msixcap_cfgwrite(struct pci_devinst *pi, int bytes, uint32_t val) { uint16_t msgctrl, rwmask; - int off, table_bar; + int off; off = offset - capoff; - table_bar = pi->pi_msix.table_bar; /* Message Control Register */ if (off == 2 && bytes == 2) { rwmask = PCIM_MSIXCTRL_MSIX_ENABLE | PCIM_MSIXCTRL_FUNCTION_MASK; From owner-svn-src-stable-10@freebsd.org Fri Jan 8 02:56:23 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37BA6A66B2C; Fri, 8 Jan 2016 02:56:23 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 087AD197F; Fri, 8 Jan 2016 02:56:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u082uMVI055522; Fri, 8 Jan 2016 02:56:22 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u082uMXK055521; Fri, 8 Jan 2016 02:56:22 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201601080256.u082uMXK055521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 8 Jan 2016 02:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293409 - stable/10/usr.sbin/camdd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 02:56:23 -0000 Author: araujo Date: Fri Jan 8 02:56:21 2016 New Revision: 293409 URL: https://svnweb.freebsd.org/changeset/base/293409 Log: MFC: r292971 Clean up unused-but-set-variable spotted by gcc-4.9. Reviewed by: ngie Approved by: rodrigc (mentor) Sponsored by: gandi.net Differential Revision: https://reviews.freebsd.org/D4776 Modified: stable/10/usr.sbin/camdd/camdd.c Modified: stable/10/usr.sbin/camdd/camdd.c ============================================================================== --- stable/10/usr.sbin/camdd/camdd.c Fri Jan 8 02:54:21 2016 (r293408) +++ stable/10/usr.sbin/camdd/camdd.c Fri Jan 8 02:56:21 2016 (r293409) @@ -1276,7 +1276,6 @@ camdd_probe_pass(struct cam_device *cam_ struct camdd_dev_pass *pass_dev; struct kevent ke; int scsi_dev_type; - int retval; dev = NULL; @@ -1336,7 +1335,6 @@ camdd_probe_pass(struct cam_device *cam_ if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); - retval = 1; goto bailout; } @@ -1371,11 +1369,8 @@ camdd_probe_pass(struct cam_device *cam_ if (cam_send_ccb(cam_dev, ccb) < 0) { warn("error sending READ CAPACITY (16) command"); - cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); - - retval = 1; goto bailout; } From owner-svn-src-stable-10@freebsd.org Fri Jan 8 02:58:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29F8FA66BBB; Fri, 8 Jan 2016 02:58:12 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F19A41ADC; Fri, 8 Jan 2016 02:58:11 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u082wBr5055631; Fri, 8 Jan 2016 02:58:11 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u082wBD1055630; Fri, 8 Jan 2016 02:58:11 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201601080258.u082wBD1055630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 8 Jan 2016 02:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293410 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 02:58:12 -0000 Author: araujo Date: Fri Jan 8 02:58:10 2016 New Revision: 293410 URL: https://svnweb.freebsd.org/changeset/base/293410 Log: MFC: r292972 Wrap using #ifdef 'notyet' those variables and statements not yet implemented to lower the compiler warnings. It fix the case of unused-but-set-variable spotted by gcc4.9. Reviewed by: ngie Approved by: rodrigc (mentor) Sponsored by: gandi.net Differential Revision: https://reviews.freebsd.org/D4775 Modified: stable/10/sys/net/if_gre.c Modified: stable/10/sys/net/if_gre.c ============================================================================== --- stable/10/sys/net/if_gre.c Fri Jan 8 02:56:21 2016 (r293409) +++ stable/10/sys/net/if_gre.c Fri Jan 8 02:58:10 2016 (r293410) @@ -682,7 +682,10 @@ gre_input(struct mbuf **mp, int *offp, i struct grehdr *gh; struct ifnet *ifp; struct mbuf *m; - uint32_t *opts, key; + uint32_t *opts; +#ifdef notyet + uint32_t key; +#endif uint16_t flags; int hlen, isr, af; @@ -715,17 +718,27 @@ gre_input(struct mbuf **mp, int *offp, i opts++; } if (flags & GRE_FLAGS_KP) { +#ifdef notyet + /* + * XXX: The current implementation uses the key only for outgoing + * packets. But we can check the key value here, or even in the + * encapcheck function. + */ key = ntohl(*opts); +#endif hlen += sizeof(uint32_t); opts++; + } +#ifdef notyet } else key = 0; - /* if (sc->gre_key != 0 && (key != sc->gre_key || key != 0)) goto drop; - */ +#endif if (flags & GRE_FLAGS_SP) { - /* seq = ntohl(*opts); */ +#ifdef notyet + seq = ntohl(*opts); +#endif hlen += sizeof(uint32_t); } switch (ntohs(gh->gre_proto)) { From owner-svn-src-stable-10@freebsd.org Fri Jan 8 02:59:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC00A66C7B; Fri, 8 Jan 2016 02:59:57 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 509511C6C; Fri, 8 Jan 2016 02:59:57 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u082xuEH055729; Fri, 8 Jan 2016 02:59:56 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u082xuKp055728; Fri, 8 Jan 2016 02:59:56 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201601080259.u082xuKp055728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 8 Jan 2016 02:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293411 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 02:59:57 -0000 Author: araujo Date: Fri Jan 8 02:59:56 2016 New Revision: 293411 URL: https://svnweb.freebsd.org/changeset/base/293411 Log: MFC: r292980 Clean up unused-but-set-variable spotted by gcc4.9. Reviewed by: ngie Approved by: rodrigc (mentor) Sponsored by: gandi.net Differential Revision: https://reviews.freebsd.org/D4774 Modified: stable/10/sys/net/if_gif.c Modified: stable/10/sys/net/if_gif.c ============================================================================== --- stable/10/sys/net/if_gif.c Fri Jan 8 02:58:10 2016 (r293410) +++ stable/10/sys/net/if_gif.c Fri Jan 8 02:59:56 2016 (r293411) @@ -527,7 +527,6 @@ gif_input(struct mbuf *m, struct ifnet * struct gif_softc *sc; struct ether_header *eh; struct ifnet *oldifp; - uint32_t gif_options; int isr, n, af; if (ifp == NULL) { @@ -536,7 +535,6 @@ gif_input(struct mbuf *m, struct ifnet * return; } sc = ifp->if_softc; - gif_options = sc->gif_options; m->m_pkthdr.rcvif = ifp; m_clrprotoflags(m); switch (proto) { From owner-svn-src-stable-10@freebsd.org Fri Jan 8 03:02:20 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEE67A66D4A; Fri, 8 Jan 2016 03:02:20 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE18F136C; Fri, 8 Jan 2016 03:02:20 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0832Jku058981; Fri, 8 Jan 2016 03:02:19 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0832Jr3058980; Fri, 8 Jan 2016 03:02:19 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201601080302.u0832Jr3058980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 8 Jan 2016 03:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293412 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 03:02:21 -0000 Author: araujo Date: Fri Jan 8 03:02:19 2016 New Revision: 293412 URL: https://svnweb.freebsd.org/changeset/base/293412 Log: MFC: r292982 Remove unused variable after r292981 to unbreak the build. MFC: r292981 Clean up unused-but-set-variable spotted by gcc-4.9. Reviewed by: ngie Approved by: rodrigc (mentor) Sponsored by: gandi.net Differential Revision: https://reviews.freebsd.org/D4773 Modified: stable/10/usr.sbin/bhyve/bhyverun.c Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Fri Jan 8 02:59:56 2016 (r293411) +++ stable/10/usr.sbin/bhyve/bhyverun.c Fri Jan 8 03:02:19 2016 (r293412) @@ -307,14 +307,13 @@ static int vmexit_inout(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu) { int error; - int bytes, port, in, out, string; + int bytes, port, in, out; int vcpu; vcpu = *pvcpu; port = vme->u.inout.port; bytes = vme->u.inout.bytes; - string = vme->u.inout.string; in = vme->u.inout.in; out = !in; @@ -596,7 +595,7 @@ static vmexit_handler_t handler[VM_EXITC static void vm_loop(struct vmctx *ctx, int vcpu, uint64_t startrip) { - int error, rc, prevcpu; + int error, rc; enum vm_exitcode exitcode; cpuset_t active_cpus; @@ -617,8 +616,6 @@ vm_loop(struct vmctx *ctx, int vcpu, uin if (error != 0) break; - prevcpu = vcpu; - exitcode = vmexit[vcpu].exitcode; if (exitcode >= VM_EXITCODE_MAX || handler[exitcode] == NULL) { fprintf(stderr, "vm_loop: unexpected exitcode 0x%x\n", From owner-svn-src-stable-10@freebsd.org Fri Jan 8 03:45:29 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA4BEA67B11; Fri, 8 Jan 2016 03:45:29 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A698C14DD; Fri, 8 Jan 2016 03:45:29 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u083jSRA070676; Fri, 8 Jan 2016 03:45:28 GMT (envelope-from stas@FreeBSD.org) Received: (from stas@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u083jSIs070675; Fri, 8 Jan 2016 03:45:28 GMT (envelope-from stas@FreeBSD.org) Message-Id: <201601080345.u083jSIs070675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stas set sender to stas@FreeBSD.org using -f From: Stanislav Sedov Date: Fri, 8 Jan 2016 03:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293413 - stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 03:45:30 -0000 Author: stas Date: Fri Jan 8 03:45:28 2016 New Revision: 293413 URL: https://svnweb.freebsd.org/changeset/base/293413 Log: MFC r291545: make the number of fasttrap probes and the size of the trace points hash table tunable via sysctl or kernel tunables. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Fri Jan 8 03:02:19 2016 (r293412) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Fri Jan 8 03:45:28 2016 (r293413) @@ -63,6 +63,8 @@ #if !defined(sun) #include #include +#include +#include #include #include #include @@ -172,13 +174,14 @@ static volatile uint64_t fasttrap_mod_ge /* * When the fasttrap provider is loaded, fasttrap_max is set to either - * FASTTRAP_MAX_DEFAULT or the value for fasttrap-max-probes in the - * fasttrap.conf file. Each time a probe is created, fasttrap_total is - * incremented by the number of tracepoints that may be associated with that - * probe; fasttrap_total is capped at fasttrap_max. + * FASTTRAP_MAX_DEFAULT, or the value for fasttrap-max-probes in the + * fasttrap.conf file (Illumos), or the value provied in the loader.conf (FreeBSD). + * Each time a probe is created, fasttrap_total is incremented by the number + * of tracepoints that may be associated with that probe; fasttrap_total is capped + * at fasttrap_max. */ #define FASTTRAP_MAX_DEFAULT 250000 -static uint32_t fasttrap_max; +static uint32_t fasttrap_max = FASTTRAP_MAX_DEFAULT; static uint32_t fasttrap_total; /* @@ -226,6 +229,17 @@ static kmutex_t fasttrap_cpuc_pid_lock[M static eventhandler_tag fasttrap_thread_dtor_tag; #endif +static unsigned long tpoints_hash_size = FASTTRAP_TPOINTS_DEFAULT_SIZE; + +#ifdef __FreeBSD__ +SYSCTL_DECL(_kern_dtrace); +SYSCTL_NODE(_kern_dtrace, OID_AUTO, fasttrap, CTLFLAG_RD, 0, "DTrace fasttrap parameters"); +SYSCTL_UINT(_kern_dtrace_fasttrap, OID_AUTO, max_probes, CTLFLAG_RWTUN, &fasttrap_max, + FASTTRAP_MAX_DEFAULT, "Maximum number of fasttrap probes"); +SYSCTL_ULONG(_kern_dtrace_fasttrap, OID_AUTO, tpoints_hash_size, CTLFLAG_RDTUN, &tpoints_hash_size, + FASTTRAP_TPOINTS_DEFAULT_SIZE, "Size of the tracepoint hash table"); +#endif + static int fasttrap_highbit(ulong_t i) { @@ -2466,8 +2480,6 @@ fasttrap_load(void) #if defined(sun) fasttrap_max = ddi_getprop(DDI_DEV_T_ANY, devi, DDI_PROP_DONTPASS, "fasttrap-max-probes", FASTTRAP_MAX_DEFAULT); -#else - fasttrap_max = FASTTRAP_MAX_DEFAULT; #endif fasttrap_total = 0; @@ -2478,12 +2490,14 @@ fasttrap_load(void) nent = ddi_getprop(DDI_DEV_T_ANY, devi, DDI_PROP_DONTPASS, "fasttrap-hash-size", FASTTRAP_TPOINTS_DEFAULT_SIZE); #else - nent = FASTTRAP_TPOINTS_DEFAULT_SIZE; + nent = tpoints_hash_size; #endif if (nent == 0 || nent > 0x1000000) nent = FASTTRAP_TPOINTS_DEFAULT_SIZE; + tpoints_hash_size = nent; + if (ISP2(nent)) fasttrap_tpoints.fth_nent = nent; else From owner-svn-src-stable-10@freebsd.org Fri Jan 8 10:35:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1763AA67C49; Fri, 8 Jan 2016 10:35:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB9651956; Fri, 8 Jan 2016 10:35:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u08AZwse095139; Fri, 8 Jan 2016 10:35:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08AZvIv095138; Fri, 8 Jan 2016 10:35:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601081035.u08AZvIv095138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 8 Jan 2016 10:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293420 - stable/10/sys/fs/devfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 10:35:59 -0000 Author: kib Date: Fri Jan 8 10:35:57 2016 New Revision: 293420 URL: https://svnweb.freebsd.org/changeset/base/293420 Log: MFC r293042: Minor style cleanup. Modified: stable/10/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/10/sys/fs/devfs/devfs_vnops.c Fri Jan 8 10:04:19 2016 (r293419) +++ stable/10/sys/fs/devfs/devfs_vnops.c Fri Jan 8 10:35:57 2016 (r293420) @@ -1114,7 +1114,7 @@ devfs_open(struct vop_open_args *ap) error = dsw->d_fdopen(dev, ap->a_mode, td, fp); else error = dsw->d_open(dev, ap->a_mode, S_IFCHR, td); - /* cleanup any cdevpriv upon error */ + /* Clean up any cdevpriv upon error. */ if (error != 0) devfs_clear_cdevpriv(); td->td_fpop = fpop; From owner-svn-src-stable-10@freebsd.org Fri Jan 8 23:58:34 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B6F9A680D1; Fri, 8 Jan 2016 23:58:34 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C652D1F9A; Fri, 8 Jan 2016 23:58:33 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u08NwWPw034257; Fri, 8 Jan 2016 23:58:32 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u08NwWr2034255; Fri, 8 Jan 2016 23:58:32 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201601082358.u08NwWr2034255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Fri, 8 Jan 2016 23:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293446 - in stable/10: sys/kgssapi usr.sbin/gssd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 23:58:34 -0000 Author: jpaetzel Date: Fri Jan 8 23:58:32 2016 New Revision: 293446 URL: https://svnweb.freebsd.org/changeset/base/293446 Log: MFC 293043 Unset the gss kernel state when gssd exits When gssd exits it leaves the kernel state set by gssd_syscall(). nfsd sees this and waits endlessly in an unkillable state for gssd to come back. If you had acidentally started gssd then stopped it, then started nfsd you'd be in a bad way until you either restarted gssd or rebooted the system. This change fixes that by setting the kernel state to "" when gssd exits. Modified: stable/10/sys/kgssapi/gss_impl.c stable/10/usr.sbin/gssd/gssd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kgssapi/gss_impl.c ============================================================================== --- stable/10/sys/kgssapi/gss_impl.c Fri Jan 8 22:59:49 2016 (r293445) +++ stable/10/sys/kgssapi/gss_impl.c Fri Jan 8 23:58:32 2016 (r293446) @@ -105,14 +105,17 @@ sys_gssd_syscall(struct thread *td, stru if (error) return (error); - sun.sun_family = AF_LOCAL; - strcpy(sun.sun_path, path); - sun.sun_len = SUN_LEN(&sun); - - nconf = getnetconfigent("local"); - cl = clnt_reconnect_create(nconf, - (struct sockaddr *) &sun, GSSD, GSSDVERS, - RPC_MAXDATASIZE, RPC_MAXDATASIZE); + if (path[0] != '\0') { + sun.sun_family = AF_LOCAL; + strcpy(sun.sun_path, path); + sun.sun_len = SUN_LEN(&sun); + + nconf = getnetconfigent("local"); + cl = clnt_reconnect_create(nconf, + (struct sockaddr *) &sun, GSSD, GSSDVERS, + RPC_MAXDATASIZE, RPC_MAXDATASIZE); + } else + cl = NULL; mtx_lock(&kgss_gssd_lock); oldcl = kgss_gssd_handle; Modified: stable/10/usr.sbin/gssd/gssd.c ============================================================================== --- stable/10/usr.sbin/gssd/gssd.c Fri Jan 8 22:59:49 2016 (r293445) +++ stable/10/usr.sbin/gssd/gssd.c Fri Jan 8 23:58:32 2016 (r293446) @@ -253,6 +253,7 @@ main(int argc, char **argv) gssd_syscall(_PATH_GSSDSOCK); svc_run(); + gssd_syscall(""); return (0); } @@ -1284,6 +1285,7 @@ void gssd_terminate(int sig __unused) if (hostbased_initiator_cred != 0) unlink(GSSD_CREDENTIAL_CACHE_FILE); #endif + gssd_syscall(""); exit(0); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 00:28:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5D2FA68A86; Sat, 9 Jan 2016 00:28:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98CA51D89; Sat, 9 Jan 2016 00:28:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u090SZGE043511; Sat, 9 Jan 2016 00:28:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u090SYIK043501; Sat, 9 Jan 2016 00:28:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601090028.u090SYIK043501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 9 Jan 2016 00:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293447 - stable/10/share/vt/keymaps X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 00:28:37 -0000 Author: emaste Date: Sat Jan 9 00:28:34 2016 New Revision: 293447 URL: https://svnweb.freebsd.org/changeset/base/293447 Log: MFC r293047: Use correct name 'us' for character 31 in keymaps 'ns' was a historical accident, and kbdcontrol(1) has accepted the correct 'us' as well as 'ns' since r38139. PR: 205776 Modified: stable/10/share/vt/keymaps/gr.101.acc.kbd stable/10/share/vt/keymaps/gr.elot.acc.kbd stable/10/share/vt/keymaps/hu.101.kbd stable/10/share/vt/keymaps/hu.102.kbd stable/10/share/vt/keymaps/lt.kbd stable/10/share/vt/keymaps/pt.acc.kbd stable/10/share/vt/keymaps/pt.kbd stable/10/share/vt/keymaps/ua.kbd stable/10/share/vt/keymaps/ua.shift.alt.kbd Directory Properties: stable/10/ (props changed) Modified: stable/10/share/vt/keymaps/gr.101.acc.kbd ============================================================================== --- stable/10/share/vt/keymaps/gr.101.acc.kbd Fri Jan 8 23:58:32 2016 (r293446) +++ stable/10/share/vt/keymaps/gr.101.acc.kbd Sat Jan 9 00:28:34 2016 (r293447) @@ -18,7 +18,7 @@ 009 '8' '*' nop nop '8' '*' nop nop O 010 '9' '(' nop nop '9' '(' nop nop O 011 '0' ')' nop nop '0' ')' nop nop O - 012 '-' '_' ns ns '-' '_' ns ns O + 012 '-' '_' us us '-' '_' us us O 013 '=' '+' nop nop '=' '+' nop nop O 014 bs bs del del bs bs del del O 015 ht btab nop nop ht btab nop nop O @@ -90,7 +90,7 @@ 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N 083 del '.' '.' '.' '.' '.' boot boot N - 084 ns ns ns ns ns ns ns ns O + 084 us us us us us us us us O 085 nop nop nop nop nop nop nop nop O 086 '\' '|' nop nop '\' '|' nop nop O 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O @@ -148,7 +148,7 @@ 137 '8' '*' nop nop '8' '*' nop nop O 138 '9' '(' nop nop '9' '(' nop nop O 139 '0' ')' nop nop '0' ')' nop nop O - 140 '-' '_' ns ns '-' '_' ns ns O + 140 '-' '_' us us '-' '_' us us O 141 '=' '+' nop nop '=' '+' nop nop O 142 bs bs del del bs bs del del O 143 ht btab nop nop ht btab nop nop O @@ -220,7 +220,7 @@ 209 fkey59 '3' '3' '3' '3' '3' '3' '3' N 210 fkey60 '0' '0' '0' '0' '0' '0' '0' N 211 del '.' '.' '.' '.' '.' boot boot N - 212 ns ns ns ns ns ns ns ns O + 212 us us us us us us us us O 213 nop nop nop nop nop nop nop nop O 214 '\' '|' nop nop '\' '|' nop nop O 215 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O Modified: stable/10/share/vt/keymaps/gr.elot.acc.kbd ============================================================================== --- stable/10/share/vt/keymaps/gr.elot.acc.kbd Fri Jan 8 23:58:32 2016 (r293446) +++ stable/10/share/vt/keymaps/gr.elot.acc.kbd Sat Jan 9 00:28:34 2016 (r293447) @@ -18,7 +18,7 @@ 009 '8' '*' nop nop '8' '*' nop nop O 010 '9' '(' nop nop '9' '(' nop nop O 011 '0' ')' nop nop '0' ')' nop nop O - 012 '-' '_' ns ns '-' '_' ns ns O + 012 '-' '_' us us '-' '_' us us O 013 '=' '+' nop nop '=' '+' nop nop O 014 bs bs del del bs bs del del O 015 ht btab nop nop ht btab nop nop O @@ -90,7 +90,7 @@ 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N 083 del '.' '.' '.' '.' '.' boot boot N - 084 ns ns ns ns ns ns ns ns O + 084 us us us us us us us us O 085 nop nop nop nop nop nop nop nop O 086 '\' '|' nop nop '\' '|' nop nop O 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O @@ -148,7 +148,7 @@ 137 '8' '*' nop nop '8' '*' nop nop O 138 '9' '(' nop nop '9' '(' nop nop O 139 '0' ')' nop nop '0' ')' nop nop O - 140 '-' '_' ns ns '-' '_' ns ns O + 140 '-' '_' us us '-' '_' us us O 141 '=' '+' nop nop '=' '+' nop nop O 142 bs bs del del bs bs del del O 143 ht btab nop nop ht btab nop nop O @@ -220,7 +220,7 @@ 209 fkey59 '3' '3' '3' '3' '3' '3' '3' N 210 fkey60 '0' '0' '0' '0' '0' '0' '0' N 211 del '.' '.' '.' '.' '.' boot boot N - 212 ns ns ns ns ns ns ns ns O + 212 us us us us us us us us O 213 nop nop nop nop nop nop nop nop O 214 '\' '|' nop nop '\' '|' nop nop O 215 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O Modified: stable/10/share/vt/keymaps/hu.101.kbd ============================================================================== --- stable/10/share/vt/keymaps/hu.101.kbd Fri Jan 8 23:58:32 2016 (r293446) +++ stable/10/share/vt/keymaps/hu.101.kbd Sat Jan 9 00:28:34 2016 (r293447) @@ -46,7 +46,7 @@ 009 '8' '*' nop nop '8' '*' nop nop O 010 '9' '(' nop nop '9' '(' nop nop O 011 '0' ')' nop nop 0xf6 0xd6 nop nop O - 012 '-' '_' ns ns 0xfc 0xdc ns ns C + 012 '-' '_' us us 0xfc 0xdc us us C 013 '=' '+' nop nop 0xf3 0xd3 nop nop C 014 bs bs del del bs bs del del O 015 ht btab nop nop ht btab nop nop O @@ -175,7 +175,7 @@ 137 '8' '*' nop nop '8' '*' nop nop O 138 '9' '(' nop nop '9' '(' nop nop O 139 0xf6 0xd6 nop nop '0' ')' nop nop O - 140 0xfc 0xdc ns ns '-' '_' ns ns C + 140 0xfc 0xdc us us '-' '_' us us C 141 0xf3 0xd3 nop nop '=' '+' nop nop C 142 bs bs del del bs bs del del O 143 ht btab nop nop ht btab nop nop O Modified: stable/10/share/vt/keymaps/hu.102.kbd ============================================================================== --- stable/10/share/vt/keymaps/hu.102.kbd Fri Jan 8 23:58:32 2016 (r293446) +++ stable/10/share/vt/keymaps/hu.102.kbd Sat Jan 9 00:28:34 2016 (r293447) @@ -60,7 +60,7 @@ 050 'm' 'M' cr cr '<' nop cr cr C 051 ',' '?' nop nop ';' nop nop nop O 052 '.' ':' nop nop '>' nop nop nop O - 053 '-' '_' ns ns '*' nop nop nop O + 053 '-' '_' us us '*' nop nop nop O 054 rshift rshift rshift rshift rshift rshift rshift rshift O 055 '*' '*' '*' '*' '*' '*' '*' '*' O 056 lalt lalt lalt lalt lalt lalt lalt lalt O Modified: stable/10/share/vt/keymaps/lt.kbd ============================================================================== --- stable/10/share/vt/keymaps/lt.kbd Fri Jan 8 23:58:32 2016 (r293446) +++ stable/10/share/vt/keymaps/lt.kbd Sat Jan 9 00:28:34 2016 (r293447) @@ -15,7 +15,7 @@ 009 '8' '*' nop nop 0x016b 0x0172 nop nop O 010 '9' '(' nop nop '9' '(' nop nop O 011 '0' ')' nop nop '0' ')' nop nop O - 012 '-' '_' ns ns '-' '_' ns ns O + 012 '-' '_' us us '-' '_' us us O 013 '=' '+' nop nop 0x017e 0x017d nop nop O 014 bs bs del del bs bs del del O 015 ht btab nop nop ht btab nop nop O @@ -87,7 +87,7 @@ 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N 083 del '.' ',' ',' del ',' boot boot N - 084 ns ns ns ns ns ns ns ns O + 084 us us us us us us us us O 085 nop nop nop nop nop nop nop nop O 086 ralt ralt ralt ralt ralt ralt ralt ralt O 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O @@ -143,7 +143,7 @@ 137 0x016b 0x016a nop nop '8' '*' nop nop C 138 '9' '(' nop nop '9' '(' nop nop O 139 '0' ')' nop nop '0' ')' nop nop O - 140 '-' '_' ns ns '-' '_' ns ns O + 140 '-' '_' us us '-' '_' us us O 141 0x017e 0x017d nop nop '=' '+' nop nop C 142 bs bs del del bs bs del del O 143 ht btab nop nop ht btab nop nop O @@ -215,7 +215,7 @@ 209 fkey59 '3' '3' '3' '3' '3' '3' '3' N 210 fkey60 '0' '0' '0' '0' '0' '0' '0' N 211 del ',' '.' '.' del '.' boot boot N - 212 ns ns ns ns ns ns ns ns O + 212 us us us us us us us us O 213 nop nop nop nop nop nop nop nop O 214 ralt ralt ralt ralt ralt ralt ralt ralt O 215 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O Modified: stable/10/share/vt/keymaps/pt.acc.kbd ============================================================================== --- stable/10/share/vt/keymaps/pt.acc.kbd Fri Jan 8 23:58:32 2016 (r293446) +++ stable/10/share/vt/keymaps/pt.acc.kbd Sat Jan 9 00:28:34 2016 (r293447) @@ -17,7 +17,7 @@ 009 '8' '(' nop nop '[' '*' nop nop O 010 '9' ')' nop nop ']' '(' nop nop O 011 '0' '=' nop nop '}' ')' nop nop O - 012 ''' '?' ns ns '-' '_' ns ns O + 012 ''' '?' us us '-' '_' us us O 013 '=' '+' nop nop '=' '+' nop nop O 014 bs bs del del bs bs del del O 015 ht btab nop nop ht btab nop nop O Modified: stable/10/share/vt/keymaps/pt.kbd ============================================================================== --- stable/10/share/vt/keymaps/pt.kbd Fri Jan 8 23:58:32 2016 (r293446) +++ stable/10/share/vt/keymaps/pt.kbd Sat Jan 9 00:28:34 2016 (r293447) @@ -17,7 +17,7 @@ 009 '8' '(' nop nop '[' '*' nop nop O 010 '9' ')' nop nop ']' '(' nop nop O 011 '0' '=' nop nop '}' ')' nop nop O - 012 ''' '?' ns ns '-' '_' ns ns O + 012 ''' '?' us us '-' '_' us us O 013 '=' '+' nop nop '=' '+' nop nop O 014 bs bs del del bs bs del del O 015 ht btab nop nop ht btab nop nop O Modified: stable/10/share/vt/keymaps/ua.kbd ============================================================================== --- stable/10/share/vt/keymaps/ua.kbd Fri Jan 8 23:58:32 2016 (r293446) +++ stable/10/share/vt/keymaps/ua.kbd Sat Jan 9 00:28:34 2016 (r293447) @@ -15,7 +15,7 @@ 009 '8' '*' nop nop '8' ';' nop nop O 010 '9' '(' nop nop '9' '?' nop nop O 011 '0' ')' nop nop '0' '%' nop nop O - 012 '-' '_' ns ns '-' '_' ns ns O + 012 '-' '_' us us '-' '_' us us O 013 '=' '+' nop nop '=' '+' nop nop O 014 bs bs del del bs bs del del O 015 ht btab nop nop btab btab nop nop O @@ -144,7 +144,7 @@ 137 '8' ';' nop nop '8' '*' nop nop O 138 '9' '?' nop nop '9' '(' nop nop O 139 '0' '%' nop nop '0' ')' nop nop O - 140 '-' '_' ns ns '-' '_' ns ns O + 140 '-' '_' us us '-' '_' us us O 141 '=' '+' nop nop '=' '+' nop nop O 142 bs bs del del bs bs del del O 143 ht btab nop nop btab btab nop nop O Modified: stable/10/share/vt/keymaps/ua.shift.alt.kbd ============================================================================== --- stable/10/share/vt/keymaps/ua.shift.alt.kbd Fri Jan 8 23:58:32 2016 (r293446) +++ stable/10/share/vt/keymaps/ua.shift.alt.kbd Sat Jan 9 00:28:34 2016 (r293447) @@ -27,7 +27,7 @@ 009 '8' '*' nop nop '8' '*' nop nop O 010 '9' '(' nop nop '9' '(' nop nop O 011 '0' ')' nop nop '0' ')' nop nop O - 012 '-' '_' ns ns 0x0456 0x0406 0xf7 0xf7 O + 012 '-' '_' us us 0x0456 0x0406 0xf7 0xf7 O 013 '=' '+' nop nop 0x0454 0x0404 nop nop O 014 bs bs del del bs bs 0x042a 0x042a O 015 ht btab nop nop ht btab nop nop O @@ -155,7 +155,7 @@ 137 '8' '*' nop nop '8' '*' nop nop O 138 '9' '(' nop nop '9' '(' nop nop O 139 '0' ')' nop nop '0' ')' nop nop O - 140 0x0456 0x0406 ns ns '-' '_' 0xf7 0xf7 O + 140 0x0456 0x0406 us us '-' '_' 0xf7 0xf7 O 141 0x0454 0x0404 nop nop '=' '+' nop nop O 142 bs bs del del bs bs 0x042a 0x042a O 143 ht btab nop nop ht btab nop nop O From owner-svn-src-stable-10@freebsd.org Sat Jan 9 00:31:25 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 690CCA68C16; Sat, 9 Jan 2016 00:31:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A426106E; Sat, 9 Jan 2016 00:31:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u090VO3H044312; Sat, 9 Jan 2016 00:31:24 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u090VOET044311; Sat, 9 Jan 2016 00:31:24 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201601090031.u090VOET044311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 9 Jan 2016 00:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293448 - stable/10/release X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 00:31:25 -0000 Author: gjb Date: Sat Jan 9 00:31:24 2016 New Revision: 293448 URL: https://svnweb.freebsd.org/changeset/base/293448 Log: MFC r293173, r293231: r293173: Fix path to include .OBJDIR to avoid polluting the source tree during 'make release'. r293231: Add a new target to touch the ${.OBJDIR}/release file, which indicates the 'release' target has run (in order to prevent subsequent invocations that may clobber original build output). Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Sat Jan 9 00:28:34 2016 (r293447) +++ stable/10/release/Makefile Sat Jan 9 00:31:24 2016 (r293448) @@ -318,7 +318,11 @@ ftp: packagesystem cp *.txz MANIFEST ftp release: real-release vm-release cloudware-release - touch ${.TARGET} + ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} release-done + true + +release-done: + touch release real-release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj From owner-svn-src-stable-10@freebsd.org Sat Jan 9 00:34:50 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29653A68CFA; Sat, 9 Jan 2016 00:34:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB89D131F; Sat, 9 Jan 2016 00:34:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u090YnSW046428; Sat, 9 Jan 2016 00:34:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u090YnBZ046427; Sat, 9 Jan 2016 00:34:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601090034.u090YnBZ046427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 9 Jan 2016 00:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293449 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 00:34:50 -0000 Author: kib Date: Sat Jan 9 00:34:48 2016 New Revision: 293449 URL: https://svnweb.freebsd.org/changeset/base/293449 Log: MFC r292749: Do not substitute interpeter if the brand interpreter path is different from the interpreter path requested by the binary. Modified: stable/10/sys/kern/imgact_elf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/imgact_elf.c ============================================================================== --- stable/10/sys/kern/imgact_elf.c Sat Jan 9 00:31:24 2016 (r293448) +++ stable/10/sys/kern/imgact_elf.c Sat Jan 9 00:34:48 2016 (r293449) @@ -986,7 +986,9 @@ __CONCAT(exec_, __elfN(imgact))(struct i if (error == 0) have_interp = TRUE; } - if (!have_interp && newinterp != NULL) { + if (!have_interp && newinterp != NULL && + (brand_info->interp_path == NULL || + strcmp(interp, brand_info->interp_path) == 0)) { error = __elfN(load_file)(imgp->proc, newinterp, &addr, &imgp->entry_addr, sv->sv_pagesize); if (error == 0) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 01:01:05 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE8E7A68BEA; Sat, 9 Jan 2016 01:01:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD5321DB0; Sat, 9 Jan 2016 01:01:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09114Xi054801; Sat, 9 Jan 2016 01:01:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09114Ig054800; Sat, 9 Jan 2016 01:01:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601090101.u09114Ig054800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 9 Jan 2016 01:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293455 - stable/10/usr.sbin/kbdcontrol X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 01:01:06 -0000 Author: emaste Date: Sat Jan 9 01:01:04 2016 New Revision: 293455 URL: https://svnweb.freebsd.org/changeset/base/293455 Log: MFC r293055: kbdmap.5: Use current names for ASCII control codes lf, ff, us Refer to the old names nl, np, ns as historical aliases. PR: 205776, 205778 Modified: stable/10/usr.sbin/kbdcontrol/kbdmap.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/kbdcontrol/kbdmap.5 ============================================================================== --- stable/10/usr.sbin/kbdcontrol/kbdmap.5 Sat Jan 9 00:54:08 2016 (r293454) +++ stable/10/usr.sbin/kbdcontrol/kbdmap.5 Sat Jan 9 01:01:04 2016 (r293455) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 29, 2008 +.Dd January 9, 2016 .Dt KBDMAP 5 .Os .Sh NAME @@ -111,9 +111,9 @@ ack, bel, bs, ht, -nl, +lf, vt, -np, +ff, cr, so, si, @@ -132,10 +132,16 @@ esc, fs, gs, rs, -ns, us, sp, del. +.It Ar control-alias +One of the historical aliases for certain +.Tn ASCII +control characters: +nl, +np, +ns. .It Ar accentname By giving one of the accent names, the next key pressed will produce From owner-svn-src-stable-10@freebsd.org Sat Jan 9 05:02:37 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3137FA6976C; Sat, 9 Jan 2016 05:02:37 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BA631DE0; Sat, 9 Jan 2016 05:02:36 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0952aNA030059; Sat, 9 Jan 2016 05:02:36 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0952a4c030057; Sat, 9 Jan 2016 05:02:36 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201601090502.u0952a4c030057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Sat, 9 Jan 2016 05:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293462 - stable/10/usr.sbin/syslogd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 05:02:37 -0000 Author: rpokala Date: Sat Jan 9 05:02:35 2016 New Revision: 293462 URL: https://svnweb.freebsd.org/changeset/base/293462 Log: MFC r279567, r279568: Add and document an option to cause syslogd to run in the foreground. This allows a separate process to monitor when and how syslogd exits. That process can then restart syslogd if needed. Approved by: jhb Sponsored by: Panasas, Inc. Modified: stable/10/usr.sbin/syslogd/syslogd.8 stable/10/usr.sbin/syslogd/syslogd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/syslogd/syslogd.8 ============================================================================== --- stable/10/usr.sbin/syslogd/syslogd.8 Sat Jan 9 03:30:33 2016 (r293461) +++ stable/10/usr.sbin/syslogd/syslogd.8 Sat Jan 9 05:02:35 2016 (r293462) @@ -28,7 +28,7 @@ .\" @(#)syslogd.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 13, 2008 +.Dd March 3, 2015 .Dt SYSLOGD 8 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd log systems messages .Sh SYNOPSIS .Nm -.Op Fl 468ACcdkNnosTuv +.Op Fl 468ACcdFkNnosTuv .Op Fl a Ar allowed_peer .Op Fl b Ar bind_address .Op Fl f Ar config_file @@ -213,6 +213,17 @@ This is probably only of use to develope Specify the pathname of an alternate configuration file; the default is .Pa /etc/syslog.conf . +.It Fl F +Run +.Nm +in the foreground, rather than going into daemon mode. This is useful if +some other process uses +.Xr fork 2 +and +.Xr exec 3 +to run +.Nm , +and wants to monitor when and how it exits. .It Fl k Disable the translation of messages received with facility Modified: stable/10/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/10/usr.sbin/syslogd/syslogd.c Sat Jan 9 03:30:33 2016 (r293461) +++ stable/10/usr.sbin/syslogd/syslogd.c Sat Jan 9 05:02:35 2016 (r293462) @@ -271,6 +271,7 @@ static struct filed *Files; /* Log files static struct filed consfile; /* Console */ static int Debug; /* debug flag */ +static int Foreground = 0; /* Run in foreground, instead of daemonizing */ static int resolve = 1; /* resolve hostname */ static char LocalHostName[MAXHOSTNAMELEN]; /* our hostname */ static const char *LocalDomain; /* our local domain name */ @@ -372,7 +373,7 @@ main(int argc, char *argv[]) dprintf("madvise() failed: %s\n", strerror(errno)); bindhostname = NULL; - while ((ch = getopt(argc, argv, "468Aa:b:cCdf:kl:m:nNop:P:sS:Tuv")) + while ((ch = getopt(argc, argv, "468Aa:b:cCdf:Fkl:m:nNop:P:sS:Tuv")) != -1) switch (ch) { case '4': @@ -408,6 +409,9 @@ main(int argc, char *argv[]) case 'f': /* configuration file */ ConfFile = optarg; break; + case 'F': /* run in foreground instead of daemon */ + Foreground++; + break; case 'k': /* keep remote kern fac */ KeepKernFac = 1; break; @@ -499,14 +503,14 @@ main(int argc, char *argv[]) warn("cannot open pid file"); } - if (!Debug) { + if ((!Foreground) && (!Debug)) { ppid = waitdaemon(0, 0, 30); if (ppid < 0) { warn("could not become daemon"); pidfile_remove(pfh); exit(1); } - } else { + } else if (Debug) { setlinebuf(stdout); } @@ -726,7 +730,7 @@ usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: syslogd [-468ACcdknosTuv] [-a allowed_peer]", + "usage: syslogd [-468ACcdFknosTuv] [-a allowed_peer]", " [-b bind_address] [-f config_file]", " [-l [mode:]path] [-m mark_interval]", " [-P pid_file] [-p log_socket]"); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 05:05:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1C27A69810; Sat, 9 Jan 2016 05:05:16 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8448B1F55; Sat, 9 Jan 2016 05:05:16 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0955FDq030226; Sat, 9 Jan 2016 05:05:15 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0955FYL030225; Sat, 9 Jan 2016 05:05:15 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201601090505.u0955FYL030225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Sat, 9 Jan 2016 05:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293463 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 05:05:16 -0000 Author: rpokala Date: Sat Jan 9 05:05:15 2016 New Revision: 293463 URL: https://svnweb.freebsd.org/changeset/base/293463 Log: MFC r291114: popen() requires check for fdopen() failure Move fdopen() up near other resource allocation like malloc(); do proper deallocation on failure later on in the function. Approved by: jhb Sponsored by: Panasas, Inc. Modified: stable/10/lib/libc/gen/popen.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/popen.c ============================================================================== --- stable/10/lib/libc/gen/popen.c Sat Jan 9 05:02:35 2016 (r293462) +++ stable/10/lib/libc/gen/popen.c Sat Jan 9 05:05:15 2016 (r293463) @@ -73,6 +73,7 @@ popen(command, type) struct pid *cur; FILE *iop; int pdes[2], pid, twoway, cloexec; + int pdes_unused_in_parent; char *argv[4]; struct pid *p; @@ -99,6 +100,20 @@ popen(command, type) return (NULL); } + if (*type == 'r') { + iop = fdopen(pdes[0], type); + pdes_unused_in_parent = pdes[1]; + } else { + iop = fdopen(pdes[1], type); + pdes_unused_in_parent = pdes[0]; + } + if (iop == NULL) { + (void)_close(pdes[0]); + (void)_close(pdes[1]); + free(cur); + return (NULL); + } + argv[0] = "sh"; argv[1] = "-c"; argv[2] = (char *)command; @@ -108,9 +123,14 @@ popen(command, type) switch (pid = vfork()) { case -1: /* Error. */ THREAD_UNLOCK(); - (void)_close(pdes[0]); - (void)_close(pdes[1]); + /* + * The _close() closes the unused end of pdes[], while + * the fclose() closes the used end of pdes[], *and* cleans + * up iop. + */ + (void)_close(pdes_unused_in_parent); free(cur); + (void)fclose(iop); return (NULL); /* NOTREACHED */ case 0: /* Child. */ @@ -155,14 +175,8 @@ popen(command, type) } THREAD_UNLOCK(); - /* Parent; assume fdopen can't fail. */ - if (*type == 'r') { - iop = fdopen(pdes[0], type); - (void)_close(pdes[1]); - } else { - iop = fdopen(pdes[1], type); - (void)_close(pdes[0]); - } + /* Parent. */ + (void)_close(pdes_unused_in_parent); /* Link into list of file descriptors. */ cur->fp = iop; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 05:07:04 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CA85A698BA; Sat, 9 Jan 2016 05:07:04 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D771A13DF; Sat, 9 Jan 2016 05:07:03 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09573SO030470; Sat, 9 Jan 2016 05:07:03 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09573Ax030469; Sat, 9 Jan 2016 05:07:03 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201601090507.u09573Ax030469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Sat, 9 Jan 2016 05:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293464 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 05:07:04 -0000 Author: rpokala Date: Sat Jan 9 05:07:02 2016 New Revision: 293464 URL: https://svnweb.freebsd.org/changeset/base/293464 Log: MFC r292123: Document mps.enable_ssu mps(4) sends StartStopUnit to SATA direct-access devices during shutdown. Document the tunables which control that behavior. Approved by: jhb Sponsored by: Panasas, Inc. Modified: stable/10/share/man/man4/mps.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/mps.4 ============================================================================== --- stable/10/share/man/man4/mps.4 Sat Jan 9 05:05:15 2016 (r293463) +++ stable/10/share/man/man4/mps.4 Sat Jan 9 05:07:02 2016 (r293464) @@ -34,7 +34,7 @@ .\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $ .\" $FreeBSD$ .\" -.Dd January 3, 2013 +.Dd December 9, 2015 .Dt MPS 4 .Os .Sh NAME @@ -129,6 +129,8 @@ driver instance, set the following tunab dev.mps.X.disable_msix=1 .Ed .Pp +where X is the adapter number. +.Pp To set the maximum number of DMA chains allocated for all adapters, set the following variable in .Xr loader.conf 5 : @@ -166,6 +168,39 @@ The maximum number of active I/O command dev.mps.X.io_cmds_highwater .Xr sysctl 8 variable. +.Pp +The adapter can issue the +.Sy StartStopUnit +SCSI command to SATA direct-access devices during shutdown, to allow the +device to quiesce before being powered down. +To control this feature for all adapters, set the +.Bd -literal -offset indent +hw.mps.enable_ssu +.Ed +.Pp +tunable value in +.Xr loader.conf 5 +to one of the following values: +.Bl -tag -width 6n -offset indent +.It 0 +Do not send SSU to either HDDs or SSDs. +.It 1 +Send SSU to SSDs, but not to HDDs; this is the default value. +.It 2 +Send SSU to HDDs, but not to SSDs. +.It 3 +Send SSU to both HDDs and SSDs. +.El +.Pp +To control the feature for a specific adapter, set the following tunable +value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mps.X.enable_ssu +.Ed +.Pp +where X is the adapter number. +The same set of values are valid as for all adapters. .Sh DEBUGGING To enable debugging prints from the .Nm @@ -218,7 +253,7 @@ This man page was written by This driver has a couple of known shortcomings: .Bl -bullet -compact .It -No userland utility available (e.g. +No userland utility available (e.g., .Xr mptutil 8 ) . .It The driver probes devices sequentially. From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:08:13 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4161BA68021; Sat, 9 Jan 2016 14:08:13 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1028517A0; Sat, 9 Jan 2016 14:08:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09E8CJt092747; Sat, 9 Jan 2016 14:08:12 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09E8BeO092734; Sat, 9 Jan 2016 14:08:11 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091408.u09E8BeO092734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293473 - in stable/10/sys: compat/linux compat/svr4 fs/procfs kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:08:13 -0000 Author: dchagin Date: Sat Jan 9 14:08:10 2016 New Revision: 293473 URL: https://svnweb.freebsd.org/changeset/base/293473 Log: To facillitate an upcoming Linuxulator merging partially MFC r275121 (by kib). Only merge the syntax changes from r275121, PROC_*LOCK() macros still lock the same proc spinlock. The process spin lock currently has the following distinct uses: - Threads lifetime cycle, in particular, counting of the threads in the process, and interlocking with process mutex and thread lock. The main reason of this is that turnstile locks are after thread locks, so you e.g. cannot unlock blockable mutex (think process mutex) while owning thread lock. - Virtual and profiling itimers, since the timers activation is done from the clock interrupt context. Replace the p_slock by p_itimmtx and PROC_ITIMLOCK(). - Profiling code (profil(2)), for similar reason. Replace the p_slock by p_profmtx and PROC_PROFLOCK(). - Resource usage accounting. Need for the spinlock there is subtle, my understanding is that spinlock blocks context switching for the current thread, which prevents td_runtime and similar fields from changing (updates are done at the mi_switch()). Replace the p_slock by p_statmtx and PROC_STATLOCK(). Discussed with: kib Modified: stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/svr4/svr4_misc.c stable/10/sys/fs/procfs/procfs_status.c stable/10/sys/kern/init_main.c stable/10/sys/kern/kern_clock.c stable/10/sys/kern/kern_exit.c stable/10/sys/kern/kern_proc.c stable/10/sys/kern/kern_racct.c stable/10/sys/kern/kern_resource.c stable/10/sys/kern/kern_thread.c stable/10/sys/kern/kern_time.c stable/10/sys/kern/subr_prof.c stable/10/sys/sys/proc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 13:52:57 2016 (r293472) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 14:08:10 2016 (r293473) @@ -691,9 +691,9 @@ linux_times(struct thread *td, struct li if (args->buf != NULL) { p = td->td_proc; PROC_LOCK(p); - PROC_SLOCK(p); + PROC_STATLOCK(p); calcru(p, &utime, &stime); - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); calccru(p, &cutime, &cstime); PROC_UNLOCK(p); Modified: stable/10/sys/compat/svr4/svr4_misc.c ============================================================================== --- stable/10/sys/compat/svr4/svr4_misc.c Sat Jan 9 13:52:57 2016 (r293472) +++ stable/10/sys/compat/svr4/svr4_misc.c Sat Jan 9 14:08:10 2016 (r293473) @@ -875,9 +875,9 @@ svr4_sys_times(td, uap) p = td->td_proc; PROC_LOCK(p); - PROC_SLOCK(p); + PROC_STATLOCK(p); calcru(p, &utime, &stime); - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); calccru(p, &cutime, &cstime); PROC_UNLOCK(p); @@ -1288,9 +1288,9 @@ loop: pid = p->p_pid; status = p->p_xstat; ru = p->p_ru; - PROC_SLOCK(p); + PROC_STATLOCK(p); calcru(p, &ru.ru_utime, &ru.ru_stime); - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); PROC_UNLOCK(p); sx_sunlock(&proctree_lock); @@ -1315,9 +1315,9 @@ loop: pid = p->p_pid; status = W_STOPCODE(p->p_xstat); ru = p->p_ru; - PROC_SLOCK(p); + PROC_STATLOCK(p); calcru(p, &ru.ru_utime, &ru.ru_stime); - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); PROC_UNLOCK(p); if (((uap->options & SVR4_WNOWAIT)) == 0) { @@ -1339,9 +1339,9 @@ loop: pid = p->p_pid; ru = p->p_ru; status = SIGCONT; - PROC_SLOCK(p); + PROC_STATLOCK(p); calcru(p, &ru.ru_utime, &ru.ru_stime); - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); PROC_UNLOCK(p); if (((uap->options & SVR4_WNOWAIT)) == 0) { Modified: stable/10/sys/fs/procfs/procfs_status.c ============================================================================== --- stable/10/sys/fs/procfs/procfs_status.c Sat Jan 9 13:52:57 2016 (r293472) +++ stable/10/sys/fs/procfs/procfs_status.c Sat Jan 9 14:08:10 2016 (r293473) @@ -125,9 +125,9 @@ procfs_doprocstatus(PFS_FILL_ARGS) if (p->p_flag & P_INMEM) { struct timeval start, ut, st; - PROC_SLOCK(p); + PROC_STATLOCK(p); calcru(p, &ut, &st); - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); start = p->p_stats->p_start; timevaladd(&start, &boottime); sbuf_printf(sb, " %jd,%ld %jd,%ld %jd,%ld", Modified: stable/10/sys/kern/init_main.c ============================================================================== --- stable/10/sys/kern/init_main.c Sat Jan 9 13:52:57 2016 (r293472) +++ stable/10/sys/kern/init_main.c Sat Jan 9 14:08:10 2016 (r293473) @@ -608,9 +608,9 @@ proc0_post(void *dummy __unused) sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { microuptime(&p->p_stats->p_start); - PROC_SLOCK(p); + PROC_STATLOCK(p); rufetch(p, &ru); /* Clears thread stats */ - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); p->p_rux.rux_runtime = 0; p->p_rux.rux_uticks = 0; p->p_rux.rux_sticks = 0; Modified: stable/10/sys/kern/kern_clock.c ============================================================================== --- stable/10/sys/kern/kern_clock.c Sat Jan 9 13:52:57 2016 (r293472) +++ stable/10/sys/kern/kern_clock.c Sat Jan 9 14:08:10 2016 (r293473) @@ -433,16 +433,16 @@ hardclock_cpu(int usermode) flags = 0; if (usermode && timevalisset(&pstats->p_timer[ITIMER_VIRTUAL].it_value)) { - PROC_SLOCK(p); + PROC_ITIMLOCK(p); if (itimerdecr(&pstats->p_timer[ITIMER_VIRTUAL], tick) == 0) flags |= TDF_ALRMPEND | TDF_ASTPENDING; - PROC_SUNLOCK(p); + PROC_ITIMUNLOCK(p); } if (timevalisset(&pstats->p_timer[ITIMER_PROF].it_value)) { - PROC_SLOCK(p); + PROC_ITIMLOCK(p); if (itimerdecr(&pstats->p_timer[ITIMER_PROF], tick) == 0) flags |= TDF_PROFPEND | TDF_ASTPENDING; - PROC_SUNLOCK(p); + PROC_ITIMUNLOCK(p); } thread_lock(td); sched_tick(1); @@ -521,18 +521,18 @@ hardclock_cnt(int cnt, int usermode) flags = 0; if (usermode && timevalisset(&pstats->p_timer[ITIMER_VIRTUAL].it_value)) { - PROC_SLOCK(p); + PROC_ITIMLOCK(p); if (itimerdecr(&pstats->p_timer[ITIMER_VIRTUAL], tick * cnt) == 0) flags |= TDF_ALRMPEND | TDF_ASTPENDING; - PROC_SUNLOCK(p); + PROC_ITIMUNLOCK(p); } if (timevalisset(&pstats->p_timer[ITIMER_PROF].it_value)) { - PROC_SLOCK(p); + PROC_ITIMLOCK(p); if (itimerdecr(&pstats->p_timer[ITIMER_PROF], tick * cnt) == 0) flags |= TDF_PROFPEND | TDF_ASTPENDING; - PROC_SUNLOCK(p); + PROC_ITIMUNLOCK(p); } thread_lock(td); sched_tick(cnt); Modified: stable/10/sys/kern/kern_exit.c ============================================================================== --- stable/10/sys/kern/kern_exit.c Sat Jan 9 13:52:57 2016 (r293472) +++ stable/10/sys/kern/kern_exit.c Sat Jan 9 14:08:10 2016 (r293473) @@ -660,7 +660,9 @@ exit1(struct thread *td, int rv) /* * Save our children's rusage information in our exit rusage. */ + PROC_STATLOCK(p); ruadd(&p->p_ru, &p->p_rux, &p->p_stats->p_cru, &p->p_crux); + PROC_STATUNLOCK(p); /* * Make sure the scheduler takes this thread out of its tables etc. @@ -1044,8 +1046,6 @@ proc_to_reap(struct thread *td, struct p return (0); } - PROC_SLOCK(p); - if (siginfo != NULL) { bzero(siginfo, sizeof(*siginfo)); siginfo->si_errno = 0; @@ -1092,7 +1092,9 @@ proc_to_reap(struct thread *td, struct p if (wrusage != NULL) { rup = &wrusage->wru_self; *rup = p->p_ru; + PROC_STATLOCK(p); calcru(p, &rup->ru_utime, &rup->ru_stime); + PROC_STATUNLOCK(p); rup = &wrusage->wru_children; *rup = p->p_stats->p_cru; @@ -1100,10 +1102,10 @@ proc_to_reap(struct thread *td, struct p } if (p->p_state == PRS_ZOMBIE && !check_only) { + PROC_SLOCK(p); proc_reap(td, p, status, options); return (-1); } - PROC_SUNLOCK(p); PROC_UNLOCK(p); return (1); } Modified: stable/10/sys/kern/kern_proc.c ============================================================================== --- stable/10/sys/kern/kern_proc.c Sat Jan 9 13:52:57 2016 (r293472) +++ stable/10/sys/kern/kern_proc.c Sat Jan 9 14:08:10 2016 (r293473) @@ -872,11 +872,11 @@ fill_kinfo_proc_only(struct proc *p, str kp->ki_fibnum = p->p_fibnum; kp->ki_start = p->p_stats->p_start; timevaladd(&kp->ki_start, &boottime); - PROC_SLOCK(p); + PROC_STATLOCK(p); rufetch(p, &kp->ki_rusage); kp->ki_runtime = cputick2usec(p->p_rux.rux_runtime); calcru(p, &kp->ki_rusage.ru_utime, &kp->ki_rusage.ru_stime); - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); calccru(p, &kp->ki_childutime, &kp->ki_childstime); /* Some callers want child times in a single value. */ kp->ki_childtime = kp->ki_childstime; @@ -941,7 +941,7 @@ fill_kinfo_thread(struct thread *td, str PROC_LOCK_ASSERT(p, MA_OWNED); if (preferthread) - PROC_SLOCK(p); + PROC_STATLOCK(p); thread_lock(td); if (td->td_wmesg != NULL) strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg)); @@ -1008,7 +1008,7 @@ fill_kinfo_thread(struct thread *td, str kp->ki_sigmask = td->td_sigmask; thread_unlock(td); if (preferthread) - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); } /* Modified: stable/10/sys/kern/kern_racct.c ============================================================================== --- stable/10/sys/kern/kern_racct.c Sat Jan 9 13:52:57 2016 (r293472) +++ stable/10/sys/kern/kern_racct.c Sat Jan 9 14:08:10 2016 (r293473) @@ -1214,11 +1214,11 @@ racctd(void) microuptime(&wallclock); timevalsub(&wallclock, &p->p_stats->p_start); - PROC_SLOCK(p); + PROC_STATLOCK(p); FOREACH_THREAD_IN_PROC(p, td) ruxagg(p, td); runtime = cputick2usec(p->p_rux.rux_runtime); - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); #ifdef notyet KASSERT(runtime >= p->p_prev_runtime, ("runtime < p_prev_runtime")); Modified: stable/10/sys/kern/kern_resource.c ============================================================================== --- stable/10/sys/kern/kern_resource.c Sat Jan 9 13:52:57 2016 (r293472) +++ stable/10/sys/kern/kern_resource.c Sat Jan 9 14:08:10 2016 (r293473) @@ -631,11 +631,11 @@ lim_cb(void *arg) */ if (p->p_cpulimit == RLIM_INFINITY) return; - PROC_SLOCK(p); + PROC_STATLOCK(p); FOREACH_THREAD_IN_PROC(p, td) { ruxagg(p, td); } - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); if (p->p_rux.rux_runtime > p->p_cpulimit * cpu_tickrate()) { lim_rlimit(p, RLIMIT_CPU, &rlim); if (p->p_rux.rux_runtime >= rlim.rlim_max * cpu_tickrate()) { @@ -847,7 +847,7 @@ calcru(struct proc *p, struct timeval *u uint64_t runtime, u; PROC_LOCK_ASSERT(p, MA_OWNED); - PROC_SLOCK_ASSERT(p, MA_OWNED); + PROC_STATLOCK_ASSERT(p, MA_OWNED); /* * If we are getting stats for the current process, then add in the * stats that this thread has accumulated in its current time slice. @@ -879,7 +879,7 @@ rufetchtd(struct thread *td, struct rusa uint64_t runtime, u; p = td->td_proc; - PROC_SLOCK_ASSERT(p, MA_OWNED); + PROC_STATLOCK_ASSERT(p, MA_OWNED); THREAD_LOCK_ASSERT(td, MA_OWNED); /* * If we are getting stats for the current thread, then add in the @@ -1015,11 +1015,11 @@ kern_getrusage(struct thread *td, int wh break; case RUSAGE_THREAD: - PROC_SLOCK(p); + PROC_STATLOCK(p); thread_lock(td); rufetchtd(td, rup); thread_unlock(td); - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); break; default: @@ -1066,7 +1066,7 @@ ruxagg_locked(struct rusage_ext *rux, st { THREAD_LOCK_ASSERT(td, MA_OWNED); - PROC_SLOCK_ASSERT(td->td_proc, MA_OWNED); + PROC_STATLOCK_ASSERT(td->td_proc, MA_OWNED); rux->rux_runtime += td->td_incruntime; rux->rux_uticks += td->td_uticks; rux->rux_sticks += td->td_sticks; @@ -1096,7 +1096,7 @@ rufetch(struct proc *p, struct rusage *r { struct thread *td; - PROC_SLOCK_ASSERT(p, MA_OWNED); + PROC_STATLOCK_ASSERT(p, MA_OWNED); *ru = p->p_ru; if (p->p_numthreads > 0) { @@ -1117,10 +1117,10 @@ rufetchcalc(struct proc *p, struct rusag struct timeval *sp) { - PROC_SLOCK(p); + PROC_STATLOCK(p); rufetch(p, ru); calcru(p, up, sp); - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); } /* Modified: stable/10/sys/kern/kern_thread.c ============================================================================== --- stable/10/sys/kern/kern_thread.c Sat Jan 9 13:52:57 2016 (r293472) +++ stable/10/sys/kern/kern_thread.c Sat Jan 9 14:08:10 2016 (r293473) @@ -472,6 +472,9 @@ thread_exit(void) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif PROC_UNLOCK(p); + PROC_STATLOCK(p); + thread_lock(td); + PROC_SUNLOCK(p); /* Do the same timestamp bookkeeping that mi_switch() would do. */ new_switchtime = cpu_ticks(); @@ -486,9 +489,8 @@ thread_exit(void) td->td_ru.ru_nvcsw++; ruxagg(p, td); rucollect(&p->p_ru, &td->td_ru); + PROC_STATUNLOCK(p); - thread_lock(td); - PROC_SUNLOCK(p); td->td_state = TDS_INACTIVE; #ifdef WITNESS witness_thread_exit(td); Modified: stable/10/sys/kern/kern_time.c ============================================================================== --- stable/10/sys/kern/kern_time.c Sat Jan 9 13:52:57 2016 (r293472) +++ stable/10/sys/kern/kern_time.c Sat Jan 9 14:08:10 2016 (r293473) @@ -273,10 +273,10 @@ get_process_cputime(struct proc *targetp uint64_t runtime; struct rusage ru; - PROC_SLOCK(targetp); + PROC_STATLOCK(targetp); rufetch(targetp, &ru); runtime = targetp->p_rux.rux_runtime; - PROC_SUNLOCK(targetp); + PROC_STATUNLOCK(targetp); cputick2timespec(runtime, ats); } @@ -325,17 +325,17 @@ kern_clock_gettime(struct thread *td, cl break; case CLOCK_VIRTUAL: PROC_LOCK(p); - PROC_SLOCK(p); + PROC_STATLOCK(p); calcru(p, &user, &sys); - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); PROC_UNLOCK(p); TIMEVAL_TO_TIMESPEC(&user, ats); break; case CLOCK_PROF: PROC_LOCK(p); - PROC_SLOCK(p); + PROC_STATLOCK(p); calcru(p, &user, &sys); - PROC_SUNLOCK(p); + PROC_STATUNLOCK(p); PROC_UNLOCK(p); timevaladd(&user, &sys); TIMEVAL_TO_TIMESPEC(&user, ats); @@ -695,9 +695,9 @@ kern_getitimer(struct thread *td, u_int timevalsub(&aitv->it_value, &ctv); } } else { - PROC_SLOCK(p); + PROC_ITIMLOCK(p); *aitv = p->p_stats->p_timer[which]; - PROC_SUNLOCK(p); + PROC_ITIMUNLOCK(p); } return (0); } @@ -779,10 +779,10 @@ kern_setitimer(struct thread *td, u_int aitv->it_value.tv_usec != 0 && aitv->it_value.tv_usec < tick) aitv->it_value.tv_usec = tick; - PROC_SLOCK(p); + PROC_ITIMLOCK(p); *oitv = p->p_stats->p_timer[which]; p->p_stats->p_timer[which] = *aitv; - PROC_SUNLOCK(p); + PROC_ITIMUNLOCK(p); } return (0); } Modified: stable/10/sys/kern/subr_prof.c ============================================================================== --- stable/10/sys/kern/subr_prof.c Sat Jan 9 13:52:57 2016 (r293472) +++ stable/10/sys/kern/subr_prof.c Sat Jan 9 14:08:10 2016 (r293473) @@ -421,12 +421,12 @@ sys_profil(struct thread *td, struct pro } PROC_LOCK(p); upp = &td->td_proc->p_stats->p_prof; - PROC_SLOCK(p); + PROC_PROFLOCK(p); upp->pr_off = uap->offset; upp->pr_scale = uap->scale; upp->pr_base = uap->samples; upp->pr_size = uap->size; - PROC_SUNLOCK(p); + PROC_PROFUNLOCK(p); startprofclock(p); PROC_UNLOCK(p); @@ -466,15 +466,15 @@ addupc_intr(struct thread *td, uintfptr_ if (ticks == 0) return; prof = &td->td_proc->p_stats->p_prof; - PROC_SLOCK(td->td_proc); + PROC_PROFLOCK(td->td_proc); if (pc < prof->pr_off || (i = PC_TO_INDEX(pc, prof)) >= prof->pr_size) { - PROC_SUNLOCK(td->td_proc); + PROC_PROFUNLOCK(td->td_proc); return; /* out of range; ignore */ } addr = prof->pr_base + i; - PROC_SUNLOCK(td->td_proc); + PROC_PROFUNLOCK(td->td_proc); if ((v = fuswintr(addr)) == -1 || suswintr(addr, v + ticks) == -1) { td->td_profil_addr = pc; td->td_profil_ticks = ticks; @@ -509,15 +509,15 @@ addupc_task(struct thread *td, uintfptr_ } p->p_profthreads++; prof = &p->p_stats->p_prof; - PROC_SLOCK(p); + PROC_PROFLOCK(p); if (pc < prof->pr_off || (i = PC_TO_INDEX(pc, prof)) >= prof->pr_size) { - PROC_SUNLOCK(p); + PROC_PROFUNLOCK(p); goto out; } addr = prof->pr_base + i; - PROC_SUNLOCK(p); + PROC_PROFUNLOCK(p); PROC_UNLOCK(p); if (copyin(addr, &v, sizeof(v)) == 0) { v += ticks; Modified: stable/10/sys/sys/proc.h ============================================================================== --- stable/10/sys/sys/proc.h Sat Jan 9 13:52:57 2016 (r293472) +++ stable/10/sys/sys/proc.h Sat Jan 9 14:08:10 2016 (r293473) @@ -616,6 +616,18 @@ struct proc { #define PROC_SUNLOCK(p) mtx_unlock_spin(&(p)->p_slock) #define PROC_SLOCK_ASSERT(p, type) mtx_assert(&(p)->p_slock, (type)) +#define PROC_STATLOCK(p) mtx_lock_spin(&(p)->p_slock) +#define PROC_STATUNLOCK(p) mtx_unlock_spin(&(p)->p_slock) +#define PROC_STATLOCK_ASSERT(p, type) mtx_assert(&(p)->p_slock, (type)) + +#define PROC_ITIMLOCK(p) mtx_lock_spin(&(p)->p_slock) +#define PROC_ITIMUNLOCK(p) mtx_unlock_spin(&(p)->p_slock) +#define PROC_ITIMLOCK_ASSERT(p, type) mtx_assert(&(p)->p_slock, (type)) + +#define PROC_PROFLOCK(p) mtx_lock_spin(&(p)->p_slock) +#define PROC_PROFUNLOCK(p) mtx_unlock_spin(&(p)->p_slock) +#define PROC_PROFLOCK_ASSERT(p, type) mtx_assert(&(p)->p_slock, (type)) + /* These flags are kept in p_flag. */ #define P_ADVLOCK 0x00001 /* Process may hold a POSIX advisory lock. */ #define P_CONTROLT 0x00002 /* Has a controlling terminal. */ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:20:26 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8184A6834C; Sat, 9 Jan 2016 14:20:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40EBB1C0D; Sat, 9 Jan 2016 14:20:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09EKPkH095785; Sat, 9 Jan 2016 14:20:25 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09EKNN6095768; Sat, 9 Jan 2016 14:20:23 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091420.u09EKNN6095768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293474 - in stable/10: lib/libc/include lib/libc/sys share/man/man4 sys/compat/freebsd32 sys/kern sys/sys usr.bin/kdump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:20:26 -0000 Author: dchagin Date: Sat Jan 9 14:20:23 2016 New Revision: 293474 URL: https://svnweb.freebsd.org/changeset/base/293474 Log: MFC r277610 (by jillies): Add futimens and utimensat system calls. Added: stable/10/lib/libc/sys/futimens.c - copied unchanged from r277610, head/lib/libc/sys/futimens.c stable/10/lib/libc/sys/utimensat.2 - copied unchanged from r277610, head/lib/libc/sys/utimensat.2 stable/10/lib/libc/sys/utimensat.c - copied unchanged from r277610, head/lib/libc/sys/utimensat.c Modified: stable/10/lib/libc/include/libc_private.h stable/10/lib/libc/sys/Makefile.inc stable/10/lib/libc/sys/Symbol.map stable/10/share/man/man4/rights.4 stable/10/sys/compat/freebsd32/freebsd32_misc.c stable/10/sys/compat/freebsd32/syscalls.master stable/10/sys/kern/capabilities.conf stable/10/sys/kern/syscalls.master stable/10/sys/kern/vfs_syscalls.c stable/10/sys/sys/capsicum.h stable/10/sys/sys/stat.h stable/10/sys/sys/syscallsubr.h stable/10/usr.bin/kdump/kdump.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/include/libc_private.h ============================================================================== --- stable/10/lib/libc/include/libc_private.h Sat Jan 9 14:08:10 2016 (r293473) +++ stable/10/lib/libc/include/libc_private.h Sat Jan 9 14:20:23 2016 (r293474) @@ -379,6 +379,10 @@ int __libc_system(const char *); int __libc_tcdrain(int); int __fcntl_compat(int fd, int cmd, ...); +int __sys_futimens(int fd, const struct timespec *times) __hidden; +int __sys_utimensat(int fd, const char *path, + const struct timespec *times, int flag) __hidden; + /* execve() with PATH processing to implement posix_spawnp() */ int _execvpe(const char *, char * const *, char * const *); Modified: stable/10/lib/libc/sys/Makefile.inc ============================================================================== --- stable/10/lib/libc/sys/Makefile.inc Sat Jan 9 14:08:10 2016 (r293473) +++ stable/10/lib/libc/sys/Makefile.inc Sat Jan 9 14:20:23 2016 (r293474) @@ -38,6 +38,10 @@ SRCS+= ${SYSCALL_COMPAT_SRCS} NOASM+= ${SYSCALL_COMPAT_SRCS:S/.c/.o/} .endif +SRCS+= futimens.c utimensat.c +NOASM+= futimens.o utimensat.o +PSEUDO+= _futimens.o _utimensat.o + INTERPOSED = \ accept \ accept4 \ @@ -317,6 +321,7 @@ MAN+= sctp_generic_recvmsg.2 \ umask.2 \ undelete.2 \ unlink.2 \ + utimensat.2 \ utimes.2 \ utrace.2 \ uuidgen.2 \ @@ -449,6 +454,7 @@ MLINKS+=timer_settime.2 timer_getoverrun timer_settime.2 timer_gettime.2 MLINKS+=truncate.2 ftruncate.2 MLINKS+=unlink.2 unlinkat.2 +MLINKS+=utimensat.2 futimens.2 MLINKS+=utimes.2 futimes.2 \ utimes.2 futimesat.2 \ utimes.2 lutimes.2 Modified: stable/10/lib/libc/sys/Symbol.map ============================================================================== --- stable/10/lib/libc/sys/Symbol.map Sat Jan 9 14:08:10 2016 (r293473) +++ stable/10/lib/libc/sys/Symbol.map Sat Jan 9 14:20:23 2016 (r293474) @@ -397,7 +397,9 @@ FBSD_1.3 { }; FBSD_1.4 { + futimens; ppoll; + utimensat; }; FBSDprivate_1.0 { Copied: stable/10/lib/libc/sys/futimens.c (from r277610, head/lib/libc/sys/futimens.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/sys/futimens.c Sat Jan 9 14:20:23 2016 (r293474, copy of r277610, head/lib/libc/sys/futimens.c) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2015 Jilles Tjoelker + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include + +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" + +int +futimens(int fd, const struct timespec times[2]) +{ + struct timeval now, tv[2], *tvp; + struct stat sb; + + if (__getosreldate() >= 1100056) + return (__sys_futimens(fd, times)); + + if (times == NULL || (times[0].tv_nsec == UTIME_NOW && + times[1].tv_nsec == UTIME_NOW)) + tvp = NULL; + else if (times[0].tv_nsec == UTIME_OMIT && + times[1].tv_nsec == UTIME_OMIT) + return (0); + else { + if ((times[0].tv_nsec < 0 || times[0].tv_nsec > 999999999) && + times[0].tv_nsec != UTIME_NOW && + times[0].tv_nsec != UTIME_OMIT) { + errno = EINVAL; + return (-1); + } + if ((times[1].tv_nsec < 0 || times[1].tv_nsec > 999999999) && + times[1].tv_nsec != UTIME_NOW && + times[1].tv_nsec != UTIME_OMIT) { + errno = EINVAL; + return (-1); + } + tv[0].tv_sec = times[0].tv_sec; + tv[0].tv_usec = times[0].tv_nsec / 1000; + tv[1].tv_sec = times[1].tv_sec; + tv[1].tv_usec = times[1].tv_nsec / 1000; + tvp = tv; + if (times[0].tv_nsec == UTIME_OMIT || + times[1].tv_nsec == UTIME_OMIT) { + if (_fstat(fd, &sb) == -1) + return (-1); + if (times[0].tv_nsec == UTIME_OMIT) { + tv[0].tv_sec = sb.st_atim.tv_sec; + tv[0].tv_usec = sb.st_atim.tv_nsec / 1000; + } + if (times[1].tv_nsec == UTIME_OMIT) { + tv[1].tv_sec = sb.st_mtim.tv_sec; + tv[1].tv_usec = sb.st_mtim.tv_nsec / 1000; + } + } + if (times[0].tv_nsec == UTIME_NOW || + times[1].tv_nsec == UTIME_NOW) { + if (gettimeofday(&now, NULL) == -1) + return (-1); + if (times[0].tv_nsec == UTIME_NOW) + tv[0] = now; + if (times[1].tv_nsec == UTIME_NOW) + tv[1] = now; + } + } + return (futimes(fd, tvp)); +} Copied: stable/10/lib/libc/sys/utimensat.2 (from r277610, head/lib/libc/sys/utimensat.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/sys/utimensat.2 Sat Jan 9 14:20:23 2016 (r293474, copy of r277610, head/lib/libc/sys/utimensat.2) @@ -0,0 +1,292 @@ +.\" $NetBSD: utimes.2,v 1.13 1999/03/22 19:45:11 garbled Exp $ +.\" +.\" Copyright (c) 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" Copyright (c) 2012, Jilles Tjoelker +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 +.\" $FreeBSD$ +.\" +.Dd January 23, 2015 +.Dt UTIMENSAT 2 +.Os +.Sh NAME +.Nm futimens , +.Nm utimensat +.Nd set file access and modification times +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/stat.h +.Ft int +.Fn futimens "int fd" "const struct timespec times[2]" +.Ft int +.Fo utimensat +.Fa "int fd" +.Fa "const char *path" +.Fa "const struct timespec times[2]" +.Fa "int flag" +.Fc +.Sh DESCRIPTION +The access and modification times of the file named by +.Fa path +or referenced by +.Fa fd +are changed as specified by the argument +.Fa times . +The inode-change-time of the file is set to the current time. +.Pp +If +.Fa path +specifies a relative path, +it is relative to the current working directory if +.Fa fd +is +.Dv AT_FDCWD +and otherwise relative to the directory associated with the file descriptor +.Fa fd . +.Pp +The +.Va tv_nsec +field of a +.Vt timespec +structure +can be set to the special value +.Dv UTIME_NOW +to set the current time, or to +.Dv UTIME_OMIT +to leave the time unchanged. +In either case, the +.Va tv_sec +field is ignored. +.Pp +If +.Fa times +is +.No non- Ns Dv NULL , +it is assumed to point to an array of two timespec structures. +The access time is set to the value of the first element, and the +modification time is set to the value of the second element. +For file systems that support file birth (creation) times (such as +.Dv UFS2 ) , +the birth time will be set to the value of the second element +if the second element is older than the currently set birth time. +To set both a birth time and a modification time, +two calls are required; the first to set the birth time +and the second to set the (presumably newer) modification time. +Ideally a new system call will be added that allows the setting +of all three times at once. +If +.Fa times +is +.Dv NULL , +this is equivalent to passing +a pointer to an array of two timespec structures +with both +.Va tv_nsec +fields set to +.Dv UTIME_NOW . +.Pp +If both +.Va tv_nsec +fields are +.Dv UTIME_OMIT , +the timestamps remain unchanged and +no permissions are needed for the file itself, +although search permissions may be required for the path prefix. +The call may or may not succeed if the named file does not exist. +.Pp +If both +.Va tv_nsec +fields are +.Dv UTIME_NOW , +the caller must be the owner of the file, have permission to +write the file, or be the super-user. +.Pp +For all other values of the timestamps, +the caller must be the owner of the file or be the super-user. +.Pp +The values for the +.Fa flag +argument of the +.Fn utimensat +system call +are constructed by a bitwise-inclusive OR of flags from the following list, +defined in +.In fcntl.h : +.Bl -tag -width indent +.It Dv AT_SYMLINK_NOFOLLOW +If +.Fa path +names a symbolic link, the symbolic link's times are changed. +By default, +.Fn utimensat +changes the times of the file referenced by the symbolic link. +.El +.Sh RETURN VALUES +.Rv -std +.Sh COMPATIBILITY +If the running kernel does not support this system call, +a wrapper emulates it using +.Xr fstatat 2 , +.Xr futimesat 2 +and +.Xr lutimes 2 . +As a result, timestamps will be rounded down to the nearest microsecond, +.Dv UTIME_OMIT +is not atomic and +.Dv AT_SYMLINK_NOFOLLOW +is not available with a path relative to a file descriptor. +.Sh ERRORS +These system calls will fail if: +.Bl -tag -width Er +.It Bq Er EACCES +The +.Fa times +argument is +.Dv NULL , +or both +.Va tv_nsec +values are +.Dv UTIME_NOW , +and the effective user ID of the process does not +match the owner of the file, and is not the super-user, and write +access is denied. +.It Bq Er EFAULT +The +.Fa times +argument +points outside the process's allocated address space. +.It Bq Er EINVAL +The +.Va tv_usec +component of at least one of the values specified by the +.Fa times +argument has a value less than 0 or greater than 999999. +.It Bq Er EIO +An I/O error occurred while reading or writing the affected inode. +.It Bq Er EPERM +The +.Fa times +argument is not +.Dv NULL +nor are both +.Va tv_nsec +values +.Dv UTIME_NOW , +nor are both +.Va tv_nsec +values +.Dv UTIME_OMIT +and the calling process's effective user ID +does not match the owner of the file and is not the super-user. +.It Bq Er EPERM +The named file has its immutable or append-only flag set, see the +.Xr chflags 2 +manual page for more information. +.It Bq Er EROFS +The file system containing the file is mounted read-only. +.El +.Pp +The +.Fn futimens +system call +will fail if: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument +does not refer to a valid descriptor. +.El +.Pp +The +.Fn utimensat +system call +will fail if: +.Bl -tag -width Er +.It Bq Er EACCES +Search permission is denied for a component of the path prefix. +.It Bq Er EBADF +The +.Fa path +argument does not specify an absolute path and the +.Fa fd +argument is neither +.Dv AT_FDCWD +nor a valid file descriptor. +.It Bq Er EFAULT +The +.Fa path +argument +points outside the process's allocated address space. +.It Bq Er ELOOP +Too many symbolic links were encountered in translating the pathname. +.It Bq Er ENAMETOOLONG +A component of a pathname exceeded +.Dv NAME_MAX +characters, or an entire path name exceeded +.Dv PATH_MAX +characters. +.It Bq Er ENOENT +The named file does not exist. +.It Bq Er ENOTDIR +A component of the path prefix is not a directory. +.It Bq Er ENOTDIR +The +.Fa path +argument is not an absolute path and +.Fa fd +is neither +.Dv AT_FDCWD +nor a file descriptor associated with a directory. +.It Bq Er ENOTSUP +The running kernel does not support this system call and +.Dv AT_SYMLINK_NOFOLLOW +is used with a path relative to a file descriptor. +.El +.Sh SEE ALSO +.Xr chflags 2 , +.Xr stat 2 , +.Xr symlink 2 , +.Xr utimes 2 , +.Xr utime 3 , +.Xr symlink 7 +.Sh STANDARDS +The +.Fn futimens +and +.Fn utimensat +system calls are expected to conform to +.St -p1003.1-2008 . +.Sh HISTORY +The +.Fn futimens +and +.Fn utimensat +system calls appeared in +.Fx 11.0 . Copied: stable/10/lib/libc/sys/utimensat.c (from r277610, head/lib/libc/sys/utimensat.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/sys/utimensat.c Sat Jan 9 14:20:23 2016 (r293474, copy of r277610, head/lib/libc/sys/utimensat.c) @@ -0,0 +1,109 @@ +/*- + * Copyright (c) 2015 Jilles Tjoelker + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include + +#include +#include +#include +#include "un-namespace.h" + +#include "libc_private.h" + +int +utimensat(int fd, const char *path, const struct timespec times[2], int flag) +{ + struct timeval now, tv[2], *tvp; + struct stat sb; + + if (__getosreldate() >= 1100056) + return (__sys_utimensat(fd, path, times, flag)); + + if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) { + errno = EINVAL; + return (-1); + } + if (times == NULL || (times[0].tv_nsec == UTIME_NOW && + times[1].tv_nsec == UTIME_NOW)) + tvp = NULL; + else if (times[0].tv_nsec == UTIME_OMIT && + times[1].tv_nsec == UTIME_OMIT) + return (0); + else { + if ((times[0].tv_nsec < 0 || times[0].tv_nsec > 999999999) && + times[0].tv_nsec != UTIME_NOW && + times[0].tv_nsec != UTIME_OMIT) { + errno = EINVAL; + return (-1); + } + if ((times[1].tv_nsec < 0 || times[1].tv_nsec > 999999999) && + times[1].tv_nsec != UTIME_NOW && + times[1].tv_nsec != UTIME_OMIT) { + errno = EINVAL; + return (-1); + } + tv[0].tv_sec = times[0].tv_sec; + tv[0].tv_usec = times[0].tv_nsec / 1000; + tv[1].tv_sec = times[1].tv_sec; + tv[1].tv_usec = times[1].tv_nsec / 1000; + tvp = tv; + if (times[0].tv_nsec == UTIME_OMIT || + times[1].tv_nsec == UTIME_OMIT) { + if (fstatat(fd, path, &sb, flag) == -1) + return (-1); + if (times[0].tv_nsec == UTIME_OMIT) { + tv[0].tv_sec = sb.st_atim.tv_sec; + tv[0].tv_usec = sb.st_atim.tv_nsec / 1000; + } + if (times[1].tv_nsec == UTIME_OMIT) { + tv[1].tv_sec = sb.st_mtim.tv_sec; + tv[1].tv_usec = sb.st_mtim.tv_nsec / 1000; + } + } + if (times[0].tv_nsec == UTIME_NOW || + times[1].tv_nsec == UTIME_NOW) { + if (gettimeofday(&now, NULL) == -1) + return (-1); + if (times[0].tv_nsec == UTIME_NOW) + tv[0] = now; + if (times[1].tv_nsec == UTIME_NOW) + tv[1] = now; + } + } + if ((flag & AT_SYMLINK_NOFOLLOW) == 0) + return (futimesat(fd, path, tvp)); + else if ((flag & AT_SYMLINK_NOFOLLOW) != 0 && + (fd == AT_FDCWD || path[0] == '/')) + return (lutimes(path, tvp)); + else { + errno = ENOTSUP; + return (-1); + } +} Modified: stable/10/share/man/man4/rights.4 ============================================================================== --- stable/10/share/man/man4/rights.4 Sat Jan 9 14:08:10 2016 (r293473) +++ stable/10/share/man/man4/rights.4 Sat Jan 9 14:20:23 2016 (r293474) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 23, 2013 +.Dd January 23, 2015 .Dt RIGHTS 4 .Os .Sh NAME @@ -273,9 +273,13 @@ with the flag. .It Dv CAP_FUTIMES Permit -.Xr futimes 2 +.Xr futimens 2 and +.Xr futimes 2 , +and permit .Xr futimesat 2 +and +.Xr utimensat 2 if the .Dv CAP_LOOKUP right is also present. Modified: stable/10/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_misc.c Sat Jan 9 14:08:10 2016 (r293473) +++ stable/10/sys/compat/freebsd32/freebsd32_misc.c Sat Jan 9 14:20:23 2016 (r293474) @@ -1429,6 +1429,49 @@ freebsd32_futimesat(struct thread *td, s } int +freebsd32_futimens(struct thread *td, struct freebsd32_futimens_args *uap) +{ + struct timespec32 ts32[2]; + struct timespec ts[2], *tsp; + int error; + + if (uap->times != NULL) { + error = copyin(uap->times, ts32, sizeof(ts32)); + if (error) + return (error); + CP(ts32[0], ts[0], tv_sec); + CP(ts32[0], ts[0], tv_nsec); + CP(ts32[1], ts[1], tv_sec); + CP(ts32[1], ts[1], tv_nsec); + tsp = ts; + } else + tsp = NULL; + return (kern_futimens(td, uap->fd, tsp, UIO_SYSSPACE)); +} + +int +freebsd32_utimensat(struct thread *td, struct freebsd32_utimensat_args *uap) +{ + struct timespec32 ts32[2]; + struct timespec ts[2], *tsp; + int error; + + if (uap->times != NULL) { + error = copyin(uap->times, ts32, sizeof(ts32)); + if (error) + return (error); + CP(ts32[0], ts[0], tv_sec); + CP(ts32[0], ts[0], tv_nsec); + CP(ts32[1], ts[1], tv_sec); + CP(ts32[1], ts[1], tv_nsec); + tsp = ts; + } else + tsp = NULL; + return (kern_utimensat(td, uap->fd, uap->path, UIO_USERSPACE, + tsp, UIO_SYSSPACE, uap->flag)); +} + +int freebsd32_adjtime(struct thread *td, struct freebsd32_adjtime_args *uap) { struct timeval32 tv32; Modified: stable/10/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/10/sys/compat/freebsd32/syscalls.master Sat Jan 9 14:08:10 2016 (r293473) +++ stable/10/sys/compat/freebsd32/syscalls.master Sat Jan 9 14:20:23 2016 (r293474) @@ -1069,3 +1069,8 @@ 545 AUE_POLL STD { int freebsd32_ppoll(struct pollfd *fds, \ u_int nfds, const struct timespec32 *ts, \ const sigset_t *set); } +546 AUE_FUTIMES STD { int freebsd32_futimens(int fd, \ + struct timespec *times); } +547 AUE_FUTIMESAT STD { int freebsd32_utimensat(int fd, \ + char *path, \ + struct timespec *times, int flag); } Modified: stable/10/sys/kern/capabilities.conf ============================================================================== --- stable/10/sys/kern/capabilities.conf Sat Jan 9 14:08:10 2016 (r293473) +++ stable/10/sys/kern/capabilities.conf Sat Jan 9 14:20:23 2016 (r293474) @@ -220,8 +220,9 @@ fsync ftruncate ## -## Allow futimes(2), subject to capability rights. +## Allow futimens(2) and futimes(2), subject to capability rights. ## +futimens futimes ## @@ -453,6 +454,7 @@ readlinkat renameat symlinkat unlinkat +utimensat ## ## Allow entry into open(2). This system call will fail, since access to the Modified: stable/10/sys/kern/syscalls.master ============================================================================== --- stable/10/sys/kern/syscalls.master Sat Jan 9 14:08:10 2016 (r293473) +++ stable/10/sys/kern/syscalls.master Sat Jan 9 14:20:23 2016 (r293474) @@ -983,5 +983,10 @@ 545 AUE_POLL STD { int ppoll(struct pollfd *fds, u_int nfds, \ const struct timespec *ts, \ const sigset_t *set); } +546 AUE_FUTIMES STD { int futimens(int fd, \ + struct timespec *times); } +547 AUE_FUTIMESAT STD { int utimensat(int fd, \ + char *path, \ + struct timespec *times, int flag); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: stable/10/sys/kern/vfs_syscalls.c ============================================================================== --- stable/10/sys/kern/vfs_syscalls.c Sat Jan 9 14:08:10 2016 (r293473) +++ stable/10/sys/kern/vfs_syscalls.c Sat Jan 9 14:20:23 2016 (r293474) @@ -96,12 +96,14 @@ SDT_PROBE_DEFINE2(vfs, , stat, mode, "ch SDT_PROBE_DEFINE2(vfs, , stat, reg, "char *", "int"); static int chroot_refuse_vdir_fds(struct filedesc *fdp); -static int getutimes(const struct timeval *, enum uio_seg, struct timespec *); static int kern_chflags(struct thread *td, const char *path, enum uio_seg pathseg, u_long flags); static int kern_chflagsat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, u_long flags, int atflag); static int setfflags(struct thread *td, struct vnode *, u_long); +static int getutimes(const struct timeval *, enum uio_seg, struct timespec *); +static int getutimens(const struct timespec *, enum uio_seg, + struct timespec *, int *); static int setutimes(struct thread *td, struct vnode *, const struct timespec *, int, int); static int vn_access(struct vnode *vp, int user_flags, struct ucred *cred, @@ -3110,7 +3112,53 @@ getutimes(usrtvp, tvpseg, tsp) } /* - * Common implementation code for utimes(), lutimes(), and futimes(). + * Common implementation code for futimens(), utimensat(). + */ +#define UTIMENS_NULL 0x1 +#define UTIMENS_EXIT 0x2 +static int +getutimens(const struct timespec *usrtsp, enum uio_seg tspseg, + struct timespec *tsp, int *retflags) +{ + struct timespec tsnow; + int error; + + vfs_timestamp(&tsnow); + *retflags = 0; + if (usrtsp == NULL) { + tsp[0] = tsnow; + tsp[1] = tsnow; + *retflags |= UTIMENS_NULL; + return (0); + } + if (tspseg == UIO_SYSSPACE) { + tsp[0] = usrtsp[0]; + tsp[1] = usrtsp[1]; + } else if ((error = copyin(usrtsp, tsp, sizeof(*tsp) * 2)) != 0) + return (error); + if (tsp[0].tv_nsec == UTIME_OMIT && tsp[1].tv_nsec == UTIME_OMIT) + *retflags |= UTIMENS_EXIT; + if (tsp[0].tv_nsec == UTIME_NOW && tsp[1].tv_nsec == UTIME_NOW) + *retflags |= UTIMENS_NULL; + if (tsp[0].tv_nsec == UTIME_OMIT) + tsp[0].tv_sec = VNOVAL; + else if (tsp[0].tv_nsec == UTIME_NOW) + tsp[0] = tsnow; + else if (tsp[0].tv_nsec < 0 || tsp[0].tv_nsec >= 1000000000L) + return (EINVAL); + if (tsp[1].tv_nsec == UTIME_OMIT) + tsp[1].tv_sec = VNOVAL; + else if (tsp[1].tv_nsec == UTIME_NOW) + tsp[1] = tsnow; + else if (tsp[1].tv_nsec < 0 || tsp[1].tv_nsec >= 1000000000L) + return (EINVAL); + + return (0); +} + +/* + * Common implementation code for utimes(), lutimes(), futimes(), futimens(), + * and utimensat(). */ static int setutimes(td, vp, ts, numtimes, nullflag) @@ -3307,6 +3355,80 @@ kern_futimes(struct thread *td, int fd, return (error); } +int +sys_futimens(struct thread *td, struct futimens_args *uap) +{ + + return (kern_futimens(td, uap->fd, uap->times, UIO_USERSPACE)); +} + +int +kern_futimens(struct thread *td, int fd, struct timespec *tptr, + enum uio_seg tptrseg) +{ + struct timespec ts[2]; + struct file *fp; + cap_rights_t rights; + int error, flags; + + AUDIT_ARG_FD(fd); + error = getutimens(tptr, tptrseg, ts, &flags); + if (error != 0) + return (error); + if (flags & UTIMENS_EXIT) + return (0); + error = getvnode(td->td_proc->p_fd, fd, + cap_rights_init(&rights, CAP_FUTIMES), &fp); + if (error != 0) + return (error); +#ifdef AUDIT + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); + AUDIT_ARG_VNODE1(fp->f_vnode); + VOP_UNLOCK(fp->f_vnode, 0); +#endif + error = setutimes(td, fp->f_vnode, ts, 2, flags & UTIMENS_NULL); + fdrop(fp, td); + return (error); +} + +int +sys_utimensat(struct thread *td, struct utimensat_args *uap) +{ + + return (kern_utimensat(td, uap->fd, uap->path, UIO_USERSPACE, + uap->times, UIO_USERSPACE, uap->flag)); +} + +int +kern_utimensat(struct thread *td, int fd, char *path, enum uio_seg pathseg, + struct timespec *tptr, enum uio_seg tptrseg, int flag) +{ + struct nameidata nd; + struct timespec ts[2]; + int error, flags; + + if (flag & ~AT_SYMLINK_NOFOLLOW) + return (EINVAL); + + if ((error = getutimens(tptr, tptrseg, ts, &flags)) != 0) + return (error); + NDINIT_AT(&nd, LOOKUP, ((flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : + FOLLOW) | AUDITVNODE1, pathseg, path, fd, td); + if ((error = namei(&nd)) != 0) + return (error); + /* + * We are allowed to call namei() regardless of 2xUTIME_OMIT. + * POSIX states: + * "If both tv_nsec fields are UTIME_OMIT... EACCESS may be detected." + * "Search permission is denied by a component of the path prefix." + */ + NDFREE(&nd, NDF_ONLY_PNBUF); + if ((flags & UTIMENS_EXIT) == 0) + error = setutimes(td, nd.ni_vp, ts, 2, flags & UTIMENS_NULL); + vrele(nd.ni_vp); + return (error); +} + /* * Truncate a file given its path name. */ Modified: stable/10/sys/sys/capsicum.h ============================================================================== --- stable/10/sys/sys/capsicum.h Sat Jan 9 14:08:10 2016 (r293473) +++ stable/10/sys/sys/capsicum.h Sat Jan 9 14:20:23 2016 (r293474) @@ -146,9 +146,9 @@ #define CAP_FSTATAT (CAP_FSTAT | CAP_LOOKUP) /* Allows for fstatfs(2). */ #define CAP_FSTATFS CAPRIGHT(0, 0x0000000000100000ULL) -/* Allows for futimes(2). */ +/* Allows for futimens(2) and futimes(2). */ #define CAP_FUTIMES CAPRIGHT(0, 0x0000000000200000ULL) -/* Allows for futimes(2) and futimesat(2). */ +/* Allows for futimens(2), futimes(2), futimesat(2) and utimensat(2). */ #define CAP_FUTIMESAT (CAP_FUTIMES | CAP_LOOKUP) /* Allows for linkat(2) and renameat(2) (destination directory descriptor). */ #define CAP_LINKAT (CAP_LOOKUP | 0x0000000000400000ULL) Modified: stable/10/sys/sys/stat.h ============================================================================== --- stable/10/sys/sys/stat.h Sat Jan 9 14:08:10 2016 (r293473) +++ stable/10/sys/sys/stat.h Sat Jan 9 14:20:23 2016 (r293474) @@ -307,6 +307,11 @@ struct nstat { #endif /* __BSD_VISIBLE */ +#if __POSIX_VISIBLE >= 200809 +#define UTIME_NOW -1 +#define UTIME_OMIT -2 +#endif + #ifndef _KERNEL __BEGIN_DECLS #if __BSD_VISIBLE @@ -322,6 +327,9 @@ int fchmod(int, mode_t); #endif #if __POSIX_VISIBLE >= 200809 int fchmodat(int, const char *, mode_t, int); +int futimens(int fd, const struct timespec times[2]); +int utimensat(int fd, const char *path, const struct timespec times[2], + int flag); #endif int fstat(int, struct stat *); #if __BSD_VISIBLE Modified: stable/10/sys/sys/syscallsubr.h ============================================================================== --- stable/10/sys/sys/syscallsubr.h Sat Jan 9 14:08:10 2016 (r293473) +++ stable/10/sys/sys/syscallsubr.h Sat Jan 9 14:20:23 2016 (r293474) @@ -106,6 +106,8 @@ int kern_fstatfs(struct thread *td, int int kern_ftruncate(struct thread *td, int fd, off_t length); int kern_futimes(struct thread *td, int fd, struct timeval *tptr, enum uio_seg tptrseg); +int kern_futimens(struct thread *td, int fd, struct timespec *tptr, + enum uio_seg tptrseg); int kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, long *basep, ssize_t *residp, enum uio_seg bufseg); int kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize, @@ -255,6 +257,9 @@ int kern_utimes(struct thread *td, char struct timeval *tptr, enum uio_seg tptrseg); int kern_utimesat(struct thread *td, int fd, char *path, enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg); +int kern_utimensat(struct thread *td, int fd, char *path, + enum uio_seg pathseg, struct timespec *tptr, enum uio_seg tptrseg, + int follow); int kern_wait(struct thread *td, pid_t pid, int *status, int options, struct rusage *rup); int kern_wait6(struct thread *td, enum idtype idtype, id_t id, int *status, Modified: stable/10/usr.bin/kdump/kdump.c ============================================================================== --- stable/10/usr.bin/kdump/kdump.c Sat Jan 9 14:08:10 2016 (r293473) +++ stable/10/usr.bin/kdump/kdump.c Sat Jan 9 14:20:23 2016 (r293474) @@ -636,6 +636,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in case SYS_readlinkat: case SYS_renameat: case SYS_unlinkat: + case SYS_utimensat: putchar('('); atfdname(*ip, decimal); c = ','; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:21:48 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C030A684BE; Sat, 9 Jan 2016 14:21:48 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 573B21EC8; Sat, 9 Jan 2016 14:21:48 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09ELluF098430; Sat, 9 Jan 2016 14:21:47 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09ELkIv098419; Sat, 9 Jan 2016 14:21:46 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091421.u09ELkIv098419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293475 - in stable/10/sys: compat/freebsd32 kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:21:48 -0000 Author: dchagin Date: Sat Jan 9 14:21:46 2016 New Revision: 293475 URL: https://svnweb.freebsd.org/changeset/base/293475 Log: Regen for r293474. Modified: stable/10/sys/compat/freebsd32/freebsd32_proto.h stable/10/sys/compat/freebsd32/freebsd32_syscall.h stable/10/sys/compat/freebsd32/freebsd32_syscalls.c stable/10/sys/compat/freebsd32/freebsd32_sysent.c stable/10/sys/compat/freebsd32/freebsd32_systrace_args.c stable/10/sys/kern/init_sysent.c stable/10/sys/kern/syscalls.c stable/10/sys/kern/systrace_args.c stable/10/sys/sys/syscall.h stable/10/sys/sys/syscall.mk stable/10/sys/sys/sysproto.h Modified: stable/10/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_proto.h Sat Jan 9 14:20:23 2016 (r293474) +++ stable/10/sys/compat/freebsd32/freebsd32_proto.h Sat Jan 9 14:21:46 2016 (r293475) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/compat/freebsd32/syscalls.master 276955 2015-01-11 07:02:03Z dchagin + * created from FreeBSD: stable/10/sys/compat/freebsd32/syscalls.master 293474 2016-01-09 14:20:23Z dchagin */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -699,6 +699,16 @@ struct freebsd32_ppoll_args { char ts_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * ts; char ts_r_[PADR_(const struct timespec32 *)]; char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)]; }; +struct freebsd32_futimens_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char times_l_[PADL_(struct timespec *)]; struct timespec * times; char times_r_[PADR_(struct timespec *)]; +}; +struct freebsd32_utimensat_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char times_l_[PADL_(struct timespec *)]; struct timespec * times; char times_r_[PADR_(struct timespec *)]; + char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; +}; #if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) #define PAD64_REQUIRED #endif @@ -833,6 +843,8 @@ int freebsd32_procctl(struct thread *, s int freebsd32_procctl(struct thread *, struct freebsd32_procctl_args *); #endif int freebsd32_ppoll(struct thread *, struct freebsd32_ppoll_args *); +int freebsd32_futimens(struct thread *, struct freebsd32_futimens_args *); +int freebsd32_utimensat(struct thread *, struct freebsd32_utimensat_args *); #ifdef COMPAT_43 @@ -1250,6 +1262,8 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_procctl AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_procctl AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_ppoll AUE_POLL +#define FREEBSD32_SYS_AUE_freebsd32_futimens AUE_FUTIMES +#define FREEBSD32_SYS_AUE_freebsd32_utimensat AUE_FUTIMESAT #undef PAD_ #undef PADL_ Modified: stable/10/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_syscall.h Sat Jan 9 14:20:23 2016 (r293474) +++ stable/10/sys/compat/freebsd32/freebsd32_syscall.h Sat Jan 9 14:21:46 2016 (r293475) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/compat/freebsd32/syscalls.master 276955 2015-01-11 07:02:03Z dchagin + * created from FreeBSD: stable/10/sys/compat/freebsd32/syscalls.master 293474 2016-01-09 14:20:23Z dchagin */ #define FREEBSD32_SYS_syscall 0 @@ -455,4 +455,6 @@ #define FREEBSD32_SYS_freebsd32_procctl 544 #define FREEBSD32_SYS_freebsd32_procctl 544 #define FREEBSD32_SYS_freebsd32_ppoll 545 -#define FREEBSD32_SYS_MAXSYSCALL 546 +#define FREEBSD32_SYS_freebsd32_futimens 546 +#define FREEBSD32_SYS_freebsd32_utimensat 547 +#define FREEBSD32_SYS_MAXSYSCALL 548 Modified: stable/10/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_syscalls.c Sat Jan 9 14:20:23 2016 (r293474) +++ stable/10/sys/compat/freebsd32/freebsd32_syscalls.c Sat Jan 9 14:21:46 2016 (r293475) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/compat/freebsd32/syscalls.master 276955 2015-01-11 07:02:03Z dchagin + * created from FreeBSD: stable/10/sys/compat/freebsd32/syscalls.master 293474 2016-01-09 14:20:23Z dchagin */ const char *freebsd32_syscallnames[] = { @@ -579,4 +579,6 @@ const char *freebsd32_syscallnames[] = { "freebsd32_procctl", /* 544 = freebsd32_procctl */ #endif "freebsd32_ppoll", /* 545 = freebsd32_ppoll */ + "freebsd32_futimens", /* 546 = freebsd32_futimens */ + "freebsd32_utimensat", /* 547 = freebsd32_utimensat */ }; Modified: stable/10/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_sysent.c Sat Jan 9 14:20:23 2016 (r293474) +++ stable/10/sys/compat/freebsd32/freebsd32_sysent.c Sat Jan 9 14:21:46 2016 (r293475) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/compat/freebsd32/syscalls.master 276955 2015-01-11 07:02:03Z dchagin + * created from FreeBSD: stable/10/sys/compat/freebsd32/syscalls.master 293474 2016-01-09 14:20:23Z dchagin */ #include "opt_compat.h" @@ -616,4 +616,6 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_procctl_args), (sy_call_t *)freebsd32_procctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 544 = freebsd32_procctl */ #endif { AS(freebsd32_ppoll_args), (sy_call_t *)freebsd32_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 545 = freebsd32_ppoll */ + { AS(freebsd32_futimens_args), (sy_call_t *)freebsd32_futimens, AUE_FUTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 546 = freebsd32_futimens */ + { AS(freebsd32_utimensat_args), (sy_call_t *)freebsd32_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 547 = freebsd32_utimensat */ }; Modified: stable/10/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_systrace_args.c Sat Jan 9 14:20:23 2016 (r293474) +++ stable/10/sys/compat/freebsd32/freebsd32_systrace_args.c Sat Jan 9 14:21:46 2016 (r293475) @@ -3323,6 +3323,24 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* freebsd32_futimens */ + case 546: { + struct freebsd32_futimens_args *p = params; + iarg[0] = p->fd; /* int */ + uarg[1] = (intptr_t) p->times; /* struct timespec * */ + *n_args = 2; + break; + } + /* freebsd32_utimensat */ + case 547: { + struct freebsd32_utimensat_args *p = params; + iarg[0] = p->fd; /* int */ + uarg[1] = (intptr_t) p->path; /* char * */ + uarg[2] = (intptr_t) p->times; /* struct timespec * */ + iarg[3] = p->flag; /* int */ + *n_args = 4; + break; + } default: *n_args = 0; break; @@ -8907,6 +8925,38 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* freebsd32_futimens */ + case 546: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "struct timespec *"; + break; + default: + break; + }; + break; + /* freebsd32_utimensat */ + case 547: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "char *"; + break; + case 2: + p = "struct timespec *"; + break; + case 3: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10795,6 +10845,16 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* freebsd32_futimens */ + case 546: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32_utimensat */ + case 547: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: stable/10/sys/kern/init_sysent.c ============================================================================== --- stable/10/sys/kern/init_sysent.c Sat Jan 9 14:20:23 2016 (r293474) +++ stable/10/sys/kern/init_sysent.c Sat Jan 9 14:21:46 2016 (r293475) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/kern/syscalls.master 276955 2015-01-11 07:02:03Z dchagin + * created from FreeBSD: stable/10/sys/kern/syscalls.master 293474 2016-01-09 14:20:23Z dchagin */ #include "opt_compat.h" @@ -580,4 +580,6 @@ struct sysent sysent[] = { { AS(aio_mlock_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 543 = aio_mlock */ { AS(procctl_args), (sy_call_t *)sys_procctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 544 = procctl */ { AS(ppoll_args), (sy_call_t *)sys_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 545 = ppoll */ + { AS(futimens_args), (sy_call_t *)sys_futimens, AUE_FUTIMES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 546 = futimens */ + { AS(utimensat_args), (sy_call_t *)sys_utimensat, AUE_FUTIMESAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 547 = utimensat */ }; Modified: stable/10/sys/kern/syscalls.c ============================================================================== --- stable/10/sys/kern/syscalls.c Sat Jan 9 14:20:23 2016 (r293474) +++ stable/10/sys/kern/syscalls.c Sat Jan 9 14:21:46 2016 (r293475) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/kern/syscalls.master 276955 2015-01-11 07:02:03Z dchagin + * created from FreeBSD: stable/10/sys/kern/syscalls.master 293474 2016-01-09 14:20:23Z dchagin */ const char *syscallnames[] = { @@ -553,4 +553,6 @@ const char *syscallnames[] = { "aio_mlock", /* 543 = aio_mlock */ "procctl", /* 544 = procctl */ "ppoll", /* 545 = ppoll */ + "futimens", /* 546 = futimens */ + "utimensat", /* 547 = utimensat */ }; Modified: stable/10/sys/kern/systrace_args.c ============================================================================== --- stable/10/sys/kern/systrace_args.c Sat Jan 9 14:20:23 2016 (r293474) +++ stable/10/sys/kern/systrace_args.c Sat Jan 9 14:21:46 2016 (r293475) @@ -3396,6 +3396,24 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* futimens */ + case 546: { + struct futimens_args *p = params; + iarg[0] = p->fd; /* int */ + uarg[1] = (intptr_t) p->times; /* struct timespec * */ + *n_args = 2; + break; + } + /* utimensat */ + case 547: { + struct utimensat_args *p = params; + iarg[0] = p->fd; /* int */ + uarg[1] = (intptr_t) p->path; /* char * */ + uarg[2] = (intptr_t) p->times; /* struct timespec * */ + iarg[3] = p->flag; /* int */ + *n_args = 4; + break; + } default: *n_args = 0; break; @@ -9053,6 +9071,38 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* futimens */ + case 546: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "struct timespec *"; + break; + default: + break; + }; + break; + /* utimensat */ + case 547: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "char *"; + break; + case 2: + p = "struct timespec *"; + break; + case 3: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -11006,6 +11056,16 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* futimens */ + case 546: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* utimensat */ + case 547: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: stable/10/sys/sys/syscall.h ============================================================================== --- stable/10/sys/sys/syscall.h Sat Jan 9 14:20:23 2016 (r293474) +++ stable/10/sys/sys/syscall.h Sat Jan 9 14:21:46 2016 (r293475) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/kern/syscalls.master 276955 2015-01-11 07:02:03Z dchagin + * created from FreeBSD: stable/10/sys/kern/syscalls.master 293474 2016-01-09 14:20:23Z dchagin */ #define SYS_syscall 0 @@ -465,4 +465,6 @@ #define SYS_aio_mlock 543 #define SYS_procctl 544 #define SYS_ppoll 545 -#define SYS_MAXSYSCALL 546 +#define SYS_futimens 546 +#define SYS_utimensat 547 +#define SYS_MAXSYSCALL 548 Modified: stable/10/sys/sys/syscall.mk ============================================================================== --- stable/10/sys/sys/syscall.mk Sat Jan 9 14:20:23 2016 (r293474) +++ stable/10/sys/sys/syscall.mk Sat Jan 9 14:21:46 2016 (r293475) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: stable/10/sys/kern/syscalls.master 276955 2015-01-11 07:02:03Z dchagin +# created from FreeBSD: stable/10/sys/kern/syscalls.master 293474 2016-01-09 14:20:23Z dchagin MIASM = \ syscall.o \ exit.o \ @@ -412,4 +412,6 @@ MIASM = \ pipe2.o \ aio_mlock.o \ procctl.o \ - ppoll.o + ppoll.o \ + futimens.o \ + utimensat.o Modified: stable/10/sys/sys/sysproto.h ============================================================================== --- stable/10/sys/sys/sysproto.h Sat Jan 9 14:20:23 2016 (r293474) +++ stable/10/sys/sys/sysproto.h Sat Jan 9 14:21:46 2016 (r293475) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/kern/syscalls.master 276955 2015-01-11 07:02:03Z dchagin + * created from FreeBSD: stable/10/sys/kern/syscalls.master 293474 2016-01-09 14:20:23Z dchagin */ #ifndef _SYS_SYSPROTO_H_ @@ -1825,6 +1825,16 @@ struct ppoll_args { char ts_l_[PADL_(const struct timespec *)]; const struct timespec * ts; char ts_r_[PADR_(const struct timespec *)]; char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)]; }; +struct futimens_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char times_l_[PADL_(struct timespec *)]; struct timespec * times; char times_r_[PADR_(struct timespec *)]; +}; +struct utimensat_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char times_l_[PADL_(struct timespec *)]; struct timespec * times; char times_r_[PADR_(struct timespec *)]; + char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2219,6 +2229,8 @@ int sys_pipe2(struct thread *, struct pi int sys_aio_mlock(struct thread *, struct aio_mlock_args *); int sys_procctl(struct thread *, struct procctl_args *); int sys_ppoll(struct thread *, struct ppoll_args *); +int sys_futimens(struct thread *, struct futimens_args *); +int sys_utimensat(struct thread *, struct utimensat_args *); #ifdef COMPAT_43 @@ -2927,6 +2939,8 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_aio_mlock AUE_NULL #define SYS_AUE_procctl AUE_NULL #define SYS_AUE_ppoll AUE_POLL +#define SYS_AUE_futimens AUE_FUTIMES +#define SYS_AUE_utimensat AUE_FUTIMESAT #undef PAD_ #undef PADL_ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:24:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7648DA68559; Sat, 9 Jan 2016 14:24:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 419F610FD; Sat, 9 Jan 2016 14:24:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09EOBhi098570; Sat, 9 Jan 2016 14:24:11 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09EOBh3098569; Sat, 9 Jan 2016 14:24:11 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091424.u09EOBh3098569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293476 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:24:12 -0000 Author: dchagin Date: Sat Jan 9 14:24:11 2016 New Revision: 293476 URL: https://svnweb.freebsd.org/changeset/base/293476 Log: Bump __FreeBSD_version after utimensat merge made in r293473. Modified: stable/10/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Sat Jan 9 14:21:46 2016 (r293475) +++ stable/10/sys/sys/param.h Sat Jan 9 14:24:11 2016 (r293476) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1002505 /* Master, propagated to newvers */ +#define __FreeBSD_version 1002506 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:31:05 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32280A688D4; Sat, 9 Jan 2016 14:31:05 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC1BA1786; Sat, 9 Jan 2016 14:31:04 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09EV3wC099354; Sat, 9 Jan 2016 14:31:03 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09EV3cr099352; Sat, 9 Jan 2016 14:31:03 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091431.u09EV3cr099352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293477 - in stable/10/sys: amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:31:05 -0000 Author: dchagin Date: Sat Jan 9 14:31:03 2016 New Revision: 293477 URL: https://svnweb.freebsd.org/changeset/base/293477 Log: MFC r283369: In preparation for switching linuxulator to the use the native 1:1 threads print the thread id in addition to the pid in debug messages. Modified: stable/10/sys/amd64/linux32/linux.h stable/10/sys/i386/linux/linux.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux.h ============================================================================== --- stable/10/sys/amd64/linux32/linux.h Sat Jan 9 14:24:11 2016 (r293476) +++ stable/10/sys/amd64/linux32/linux.h Sat Jan 9 14:31:03 2016 (r293477) @@ -40,8 +40,10 @@ */ extern u_char linux_debug_map[]; #define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name) -#define ARGS(nm, fmt) "linux(%ld): "#nm"("fmt")\n", (long)td->td_proc->p_pid -#define LMSG(fmt) "linux(%ld): "fmt"\n", (long)td->td_proc->p_pid +#define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \ + (long)td->td_proc->p_pid, (long)td->td_tid +#define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \ + (long)td->td_proc->p_pid, (long)td->td_tid #define LINUX_DTRACE linuxulator32 #ifdef MALLOC_DECLARE Modified: stable/10/sys/i386/linux/linux.h ============================================================================== --- stable/10/sys/i386/linux/linux.h Sat Jan 9 14:24:11 2016 (r293476) +++ stable/10/sys/i386/linux/linux.h Sat Jan 9 14:31:03 2016 (r293477) @@ -40,8 +40,10 @@ */ extern u_char linux_debug_map[]; #define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name) -#define ARGS(nm, fmt) "linux(%ld): "#nm"("fmt")\n", (long)td->td_proc->p_pid -#define LMSG(fmt) "linux(%ld): "fmt"\n", (long)td->td_proc->p_pid +#define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \ + (long)td->td_proc->p_pid, (long)td->td_tid +#define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \ + (long)td->td_proc->p_pid, (long)td->td_tid #define LINUX_DTRACE linuxulator #ifdef MALLOC_DECLARE From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:33:11 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCBB8A689E2; Sat, 9 Jan 2016 14:33:11 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 936571AD4; Sat, 9 Jan 2016 14:33:11 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09EXAAF002094; Sat, 9 Jan 2016 14:33:10 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09EXAcD002091; Sat, 9 Jan 2016 14:33:10 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091433.u09EXAcD002091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293478 - in stable/10/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:33:12 -0000 Author: dchagin Date: Sat Jan 9 14:33:10 2016 New Revision: 293478 URL: https://svnweb.freebsd.org/changeset/base/293478 Log: MFC r283370: In preparation for switching linuxulator to the use the native 1:1 threads introduce linux_exit() stub instead of sys_exit() call (which terminates process). In the new linuxulator exit() system call terminates the calling thread (not a whole process). Modified: stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_fork.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 14:31:03 2016 (r293477) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 14:33:10 2016 (r293478) @@ -38,8 +38,7 @@ ; #ifdef's, etc. may be included, and are copied to the output files. 0 AUE_NULL UNIMPL setup -1 AUE_EXIT NOPROTO { void sys_exit(int rval); } exit \ - sys_exit_args void +1 AUE_EXIT STD { void linux_exit(int rval); } 2 AUE_FORK STD { int linux_fork(void); } 3 AUE_NULL NOPROTO { int read(int fd, char *buf, \ u_int nbyte); } Modified: stable/10/sys/compat/linux/linux_fork.c ============================================================================== --- stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 14:31:03 2016 (r293477) +++ stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 14:33:10 2016 (r293478) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef COMPAT_LINUX32 #include @@ -276,3 +277,16 @@ linux_clone(struct thread *td, struct li return (0); } + +int +linux_exit(struct thread *td, struct linux_exit_args *args) +{ + +#ifdef DEBUG + if (ldebug(exit)) + printf(ARGS(exit, "%d"), args->rval); +#endif + + exit1(td, W_EXITCODE(args->rval, 0)); + /* NOTREACHED */ +} Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 14:31:03 2016 (r293477) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 14:33:10 2016 (r293478) @@ -37,8 +37,7 @@ ; #ifdef's, etc. may be included, and are copied to the output files. 0 AUE_NULL UNIMPL setup -1 AUE_EXIT NOPROTO { void sys_exit(int rval); } exit \ - sys_exit_args void +1 AUE_EXIT STD { void linux_exit(int rval); } 2 AUE_FORK STD { int linux_fork(void); } 3 AUE_NULL NOPROTO { int read(int fd, char *buf, \ u_int nbyte); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:34:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9A16A68A6B; Sat, 9 Jan 2016 14:34:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA4581C56; Sat, 9 Jan 2016 14:34:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09EYUp9002186; Sat, 9 Jan 2016 14:34:30 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09EYTTW002176; Sat, 9 Jan 2016 14:34:29 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091434.u09EYTTW002176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293479 - in stable/10/sys: amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:34:32 -0000 Author: dchagin Date: Sat Jan 9 14:34:29 2016 New Revision: 293479 URL: https://svnweb.freebsd.org/changeset/base/293479 Log: Regen for r293478. Modified: stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 14:33:10 2016 (r293478) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 14:34:29 2016 (r293479) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 276810 2015-01-08 06:23:11Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293478 2016-01-09 14:33:10Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -35,6 +35,9 @@ struct thread; #endif #define nosys linux_nosys +struct linux_exit_args { + char rval_l_[PADL_(int)]; int rval; char rval_r_[PADR_(int)]; +}; struct linux_fork_args { register_t dummy; }; @@ -1105,6 +1108,7 @@ struct linux_process_vm_writev_args { register_t dummy; }; #define nosys linux_nosys +int linux_exit(struct thread *, struct linux_exit_args *); int linux_fork(struct thread *, struct linux_fork_args *); int linux_open(struct thread *, struct linux_open_args *); int linux_waitpid(struct thread *, struct linux_waitpid_args *); @@ -1407,6 +1411,7 @@ int linux_process_vm_writev(struct threa #endif /* COMPAT_FREEBSD7 */ +#define LINUX_SYS_AUE_linux_exit AUE_EXIT #define LINUX_SYS_AUE_linux_fork AUE_FORK #define LINUX_SYS_AUE_linux_open AUE_OPEN_RWTC #define LINUX_SYS_AUE_linux_waitpid AUE_WAIT4 Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 14:33:10 2016 (r293478) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 14:34:29 2016 (r293479) @@ -3,10 +3,10 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 276810 2015-01-08 06:23:11Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293478 2016-01-09 14:33:10Z dchagin */ -#define LINUX_SYS_exit 1 +#define LINUX_SYS_linux_exit 1 #define LINUX_SYS_linux_fork 2 #define LINUX_SYS_read 3 #define LINUX_SYS_write 4 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 14:33:10 2016 (r293478) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 14:34:29 2016 (r293479) @@ -3,13 +3,13 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 276810 2015-01-08 06:23:11Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293478 2016-01-09 14:33:10Z dchagin */ const char *linux_syscallnames[] = { #define nosys linux_nosys "#0", /* 0 = setup */ - "exit", /* 1 = exit */ + "linux_exit", /* 1 = linux_exit */ "linux_fork", /* 2 = linux_fork */ "read", /* 3 = read */ "write", /* 4 = write */ Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 14:33:10 2016 (r293478) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 14:34:29 2016 (r293479) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 276810 2015-01-08 06:23:11Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293478 2016-01-09 14:33:10Z dchagin */ #include "opt_compat.h" @@ -20,7 +20,7 @@ struct sysent linux_sysent[] = { #define nosys linux_nosys { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 0 = setup */ - { AS(sys_exit_args), (sy_call_t *)sys_sys_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = exit */ + { AS(linux_exit_args), (sy_call_t *)linux_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = linux_exit */ { 0, (sy_call_t *)linux_fork, AUE_FORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 2 = linux_fork */ { AS(read_args), (sy_call_t *)sys_read, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 3 = read */ { AS(write_args), (sy_call_t *)sys_write, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 4 = write */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 14:33:10 2016 (r293478) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 14:34:29 2016 (r293479) @@ -12,9 +12,9 @@ systrace_args(int sysnum, void *params, int64_t *iarg = (int64_t *) uarg; switch (sysnum) { #define nosys linux_nosys - /* sys_exit */ + /* linux_exit */ case 1: { - struct sys_exit_args *p = params; + struct linux_exit_args *p = params; iarg[0] = p->rval; /* int */ *n_args = 1; break; @@ -2287,7 +2287,7 @@ systrace_entry_setargdesc(int sysnum, in const char *p = NULL; switch (sysnum) { #define nosys linux_nosys - /* sys_exit */ + /* linux_exit */ case 1: switch(ndx) { case 0: @@ -5502,7 +5502,7 @@ systrace_return_setargdesc(int sysnum, i const char *p = NULL; switch (sysnum) { #define nosys linux_nosys - /* sys_exit */ + /* linux_exit */ case 1: if (ndx == 0 || ndx == 1) p = "void"; Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 14:33:10 2016 (r293478) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 14:34:29 2016 (r293479) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 276810 2015-01-08 06:23:11Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293478 2016-01-09 14:33:10Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -35,6 +35,9 @@ struct thread; #endif #define nosys linux_nosys +struct linux_exit_args { + char rval_l_[PADL_(int)]; int rval; char rval_r_[PADR_(int)]; +}; struct linux_fork_args { register_t dummy; }; @@ -1119,6 +1122,7 @@ struct linux_process_vm_writev_args { register_t dummy; }; #define nosys linux_nosys +int linux_exit(struct thread *, struct linux_exit_args *); int linux_fork(struct thread *, struct linux_fork_args *); int linux_open(struct thread *, struct linux_open_args *); int linux_waitpid(struct thread *, struct linux_waitpid_args *); @@ -1422,6 +1426,7 @@ int linux_process_vm_writev(struct threa #endif /* COMPAT_FREEBSD7 */ +#define LINUX_SYS_AUE_linux_exit AUE_EXIT #define LINUX_SYS_AUE_linux_fork AUE_FORK #define LINUX_SYS_AUE_linux_open AUE_OPEN_RWTC #define LINUX_SYS_AUE_linux_waitpid AUE_WAIT4 Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 14:33:10 2016 (r293478) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 14:34:29 2016 (r293479) @@ -3,10 +3,10 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 276810 2015-01-08 06:23:11Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293478 2016-01-09 14:33:10Z dchagin */ -#define LINUX_SYS_exit 1 +#define LINUX_SYS_linux_exit 1 #define LINUX_SYS_linux_fork 2 #define LINUX_SYS_read 3 #define LINUX_SYS_write 4 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 14:33:10 2016 (r293478) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 14:34:29 2016 (r293479) @@ -3,13 +3,13 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 276810 2015-01-08 06:23:11Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293478 2016-01-09 14:33:10Z dchagin */ const char *linux_syscallnames[] = { #define nosys linux_nosys "#0", /* 0 = setup */ - "exit", /* 1 = exit */ + "linux_exit", /* 1 = linux_exit */ "linux_fork", /* 2 = linux_fork */ "read", /* 3 = read */ "write", /* 4 = write */ Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 14:33:10 2016 (r293478) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 14:34:29 2016 (r293479) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 276810 2015-01-08 06:23:11Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293478 2016-01-09 14:33:10Z dchagin */ #include @@ -19,7 +19,7 @@ struct sysent linux_sysent[] = { #define nosys linux_nosys { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 0 = setup */ - { AS(sys_exit_args), (sy_call_t *)sys_sys_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = exit */ + { AS(linux_exit_args), (sy_call_t *)linux_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = linux_exit */ { 0, (sy_call_t *)linux_fork, AUE_FORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 2 = linux_fork */ { AS(read_args), (sy_call_t *)sys_read, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 3 = read */ { AS(write_args), (sy_call_t *)sys_write, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 4 = write */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 14:33:10 2016 (r293478) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 14:34:29 2016 (r293479) @@ -12,9 +12,9 @@ systrace_args(int sysnum, void *params, int64_t *iarg = (int64_t *) uarg; switch (sysnum) { #define nosys linux_nosys - /* sys_exit */ + /* linux_exit */ case 1: { - struct sys_exit_args *p = params; + struct linux_exit_args *p = params; iarg[0] = p->rval; /* int */ *n_args = 1; break; @@ -2363,7 +2363,7 @@ systrace_entry_setargdesc(int sysnum, in const char *p = NULL; switch (sysnum) { #define nosys linux_nosys - /* sys_exit */ + /* linux_exit */ case 1: switch(ndx) { case 0: @@ -5733,7 +5733,7 @@ systrace_return_setargdesc(int sysnum, i const char *p = NULL; switch (sysnum) { #define nosys linux_nosys - /* sys_exit */ + /* linux_exit */ case 1: if (ndx == 0 || ndx == 1) p = "void"; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:36:46 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18593A68B24; Sat, 9 Jan 2016 14:36:46 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C41EC1DCE; Sat, 9 Jan 2016 14:36:45 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09EaihK002323; Sat, 9 Jan 2016 14:36:44 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09EaiQk002321; Sat, 9 Jan 2016 14:36:44 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091436.u09EaiQk002321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293480 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:36:46 -0000 Author: dchagin Date: Sat Jan 9 14:36:44 2016 New Revision: 293480 URL: https://svnweb.freebsd.org/changeset/base/293480 Log: MFC r283372: In preparation for switching linuxulator to the use the native 1:1 threads split sys_thr_exit() up into sys_thr_exit() and kern_thr_exit(). Move Where the second will be used in linux_exit() system call later. Modified: stable/10/sys/kern/kern_thr.c stable/10/sys/sys/syscallsubr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_thr.c ============================================================================== --- stable/10/sys/kern/kern_thr.c Sat Jan 9 14:34:29 2016 (r293479) +++ stable/10/sys/kern/kern_thr.c Sat Jan 9 14:36:44 2016 (r293480) @@ -305,9 +305,6 @@ int sys_thr_exit(struct thread *td, struct thr_exit_args *uap) /* long *state */ { - struct proc *p; - - p = td->td_proc; /* Signal userland that it can free the stack. */ if ((void *)uap->state != NULL) { @@ -315,8 +312,17 @@ sys_thr_exit(struct thread *td, struct t kern_umtx_wake(td, uap->state, INT_MAX, 0); } - rw_wlock(&tidhash_lock); + return (kern_thr_exit(td)); +} + +int +kern_thr_exit(struct thread *td) +{ + struct proc *p; + p = td->td_proc; + + rw_wlock(&tidhash_lock); PROC_LOCK(p); if (p->p_numthreads != 1) { Modified: stable/10/sys/sys/syscallsubr.h ============================================================================== --- stable/10/sys/sys/syscallsubr.h Sat Jan 9 14:34:29 2016 (r293479) +++ stable/10/sys/sys/syscallsubr.h Sat Jan 9 14:36:44 2016 (r293480) @@ -246,6 +246,7 @@ int kern_ktimer_settime(struct thread *t int kern_ktimer_gettime(struct thread *td, int timer_id, struct itimerspec *val); int kern_ktimer_getoverrun(struct thread *td, int timer_id); +int kern_thr_exit(struct thread *td); int kern_thr_new(struct thread *td, struct thr_param *param); int kern_thr_suspend(struct thread *td, struct timespec *tsp); int kern_truncate(struct thread *td, char *path, enum uio_seg pathseg, From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:38:30 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BCF8A68CCB; Sat, 9 Jan 2016 14:38:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DA501FF3; Sat, 9 Jan 2016 14:38:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09EcTqp002434; Sat, 9 Jan 2016 14:38:29 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09EcTjq002432; Sat, 9 Jan 2016 14:38:29 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091438.u09EcTjq002432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293481 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:38:30 -0000 Author: dchagin Date: Sat Jan 9 14:38:29 2016 New Revision: 293481 URL: https://svnweb.freebsd.org/changeset/base/293481 Log: MFC r283373: In preparation for switching linuxulator to the use the native 1:1 threads introduce kern_thr_alloc() which will be used later in the linux_clone(). Modified: stable/10/sys/kern/kern_thr.c stable/10/sys/sys/syscallsubr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_thr.c ============================================================================== --- stable/10/sys/kern/kern_thr.c Sat Jan 9 14:36:44 2016 (r293480) +++ stable/10/sys/kern/kern_thr.c Sat Jan 9 14:38:29 2016 (r293481) @@ -192,12 +192,6 @@ thread_create(struct thread *td, struct p = td->td_proc; - /* Have race condition but it is cheap. */ - if (p->p_numthreads >= max_threads_per_proc) { - ++max_threads_hits; - return (EPROCLIM); - } - if (rtp != NULL) { switch(rtp->type) { case RTP_PRIO_REALTIME: @@ -225,11 +219,9 @@ thread_create(struct thread *td, struct #endif /* Initialize our td */ - newtd = thread_alloc(0); - if (newtd == NULL) { - error = ENOMEM; + error = kern_thr_alloc(p, 0, &newtd); + if (error) goto fail; - } cpu_set_upcall(newtd, td); @@ -564,3 +556,20 @@ sys_thr_set_name(struct thread *td, stru PROC_UNLOCK(p); return (error); } + +int +kern_thr_alloc(struct proc *p, int pages, struct thread **ntd) +{ + + /* Have race condition but it is cheap. */ + if (p->p_numthreads >= max_threads_per_proc) { + ++max_threads_hits; + return (EPROCLIM); + } + + *ntd = thread_alloc(pages); + if (*ntd == NULL) + return (ENOMEM); + + return (0); +} Modified: stable/10/sys/sys/syscallsubr.h ============================================================================== --- stable/10/sys/sys/syscallsubr.h Sat Jan 9 14:36:44 2016 (r293480) +++ stable/10/sys/sys/syscallsubr.h Sat Jan 9 14:38:29 2016 (r293481) @@ -246,6 +246,7 @@ int kern_ktimer_settime(struct thread *t int kern_ktimer_gettime(struct thread *td, int timer_id, struct itimerspec *val); int kern_ktimer_getoverrun(struct thread *td, int timer_id); +int kern_thr_alloc(struct proc *, int pages, struct thread **); int kern_thr_exit(struct thread *td); int kern_thr_new(struct thread *td, struct thr_param *param); int kern_thr_suspend(struct thread *td, struct timespec *tsp); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:40:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58B94A68EC8; Sat, 9 Jan 2016 14:40:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 318AF127A; Sat, 9 Jan 2016 14:40:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09EedUH002575; Sat, 9 Jan 2016 14:40:39 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Eedo1002571; Sat, 9 Jan 2016 14:40:39 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091440.u09Eedo1002571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293482 - in stable/10/sys: amd64/linux32 compat/linux kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:40:40 -0000 Author: dchagin Date: Sat Jan 9 14:40:38 2016 New Revision: 293482 URL: https://svnweb.freebsd.org/changeset/base/293482 Log: MFC r283374: In preparation for switching linuxulator to the use the native 1:1 threads refactor kern_sched_rr_get_interval() and sys_sched_rr_get_interval(). Add a kern_sched_rr_get_interval() counterpart which takes a targettd parameter to allow specify target thread directly by callee (new Linuxulator). Linuxulator temporarily uses first thread in proc. Move linux_sched_rr_get_interval() to the MI part. Modified: stable/10/sys/amd64/linux32/linux32_machdep.c stable/10/sys/compat/linux/linux_misc.c stable/10/sys/kern/p1003_1b.c stable/10/sys/sys/syscallsubr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 14:38:29 2016 (r293481) +++ stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 14:40:38 2016 (r293482) @@ -924,22 +924,6 @@ linux_getrusage(struct thread *td, struc } int -linux_sched_rr_get_interval(struct thread *td, - struct linux_sched_rr_get_interval_args *uap) -{ - struct timespec ts; - struct l_timespec ts32; - int error; - - error = kern_sched_rr_get_interval(td, uap->pid, &ts); - if (error != 0) - return (error); - ts32.tv_sec = ts.tv_sec; - ts32.tv_nsec = ts.tv_nsec; - return (copyout(&ts32, uap->interval, sizeof(ts32))); -} - -int linux_set_thread_area(struct thread *td, struct linux_set_thread_area_args *args) { Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 14:38:29 2016 (r293481) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 14:40:38 2016 (r293482) @@ -1926,3 +1926,33 @@ linux_sched_setaffinity(struct thread *t return (sys_cpuset_setaffinity(td, &csa)); } + +int +linux_sched_rr_get_interval(struct thread *td, + struct linux_sched_rr_get_interval_args *uap) +{ + struct timespec ts; + struct l_timespec lts; + struct thread *tdt; + struct proc *p; + int error; + + if (uap->pid == 0) { + tdt = td; + p = tdt->td_proc; + PROC_LOCK(p); + } else { + p = pfind(uap->pid); + if (p == NULL) + return (ESRCH); + tdt = FIRST_THREAD_IN_PROC(p); + } + + error = kern_sched_rr_get_interval_td(td, tdt, &ts); + PROC_UNLOCK(p); + if (error != 0) + return (error); + lts.tv_sec = ts.tv_sec; + lts.tv_nsec = ts.tv_nsec; + return (copyout(<s, uap->interval, sizeof(lts))); +} Modified: stable/10/sys/kern/p1003_1b.c ============================================================================== --- stable/10/sys/kern/p1003_1b.c Sat Jan 9 14:38:29 2016 (r293481) +++ stable/10/sys/kern/p1003_1b.c Sat Jan 9 14:40:38 2016 (r293482) @@ -296,13 +296,26 @@ kern_sched_rr_get_interval(struct thread targettd = FIRST_THREAD_IN_PROC(targetp); } - e = p_cansee(td, targetp); - if (e == 0) - e = ksched_rr_get_interval(ksched, targettd, ts); + e = kern_sched_rr_get_interval_td(td, targettd, ts); PROC_UNLOCK(targetp); return (e); } +int +kern_sched_rr_get_interval_td(struct thread *td, struct thread *targettd, + struct timespec *ts) +{ + struct proc *p; + int error; + + p = targettd->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + + error = p_cansee(td, p); + if (error == 0) + error = ksched_rr_get_interval(ksched, targettd, ts); + return (error); +} #endif static void Modified: stable/10/sys/sys/syscallsubr.h ============================================================================== --- stable/10/sys/sys/syscallsubr.h Sat Jan 9 14:38:29 2016 (r293481) +++ stable/10/sys/sys/syscallsubr.h Sat Jan 9 14:40:38 2016 (r293482) @@ -197,6 +197,8 @@ int kern_rmdirat(struct thread *td, int enum uio_seg pathseg); int kern_sched_rr_get_interval(struct thread *td, pid_t pid, struct timespec *ts); +int kern_sched_rr_get_interval_td(struct thread *td, struct thread *targettd, + struct timespec *ts); int kern_semctl(struct thread *td, int semid, int semnum, int cmd, union semun *arg, register_t *rval); int kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:41:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4EC5A6907B; Sat, 9 Jan 2016 14:41:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94BCD15C9; Sat, 9 Jan 2016 14:41:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Efw1r003289; Sat, 9 Jan 2016 14:41:58 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09EfwFL003288; Sat, 9 Jan 2016 14:41:58 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091441.u09EfwFL003288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293483 - stable/10/sys/i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:41:59 -0000 Author: dchagin Date: Sat Jan 9 14:41:58 2016 New Revision: 293483 URL: https://svnweb.freebsd.org/changeset/base/293483 Log: MFC r283375: In preparation for switching linuxulator to the use the native 1:1 threads use MI linux_sched_rr_get_interval() in i386. Modified: stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 14:40:38 2016 (r293482) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 14:41:58 2016 (r293483) @@ -283,8 +283,8 @@ l_int policy); } 160 AUE_SCHED_GET_PRIORITY_MIN STD { int linux_sched_get_priority_min( \ l_int policy); } -161 AUE_SCHED_RR_GET_INTERVAL NOPROTO { int sched_rr_get_interval(l_pid_t pid, \ - struct l_timespec *interval); } +161 AUE_SCHED_RR_GET_INTERVAL STD { int linux_sched_rr_get_interval( \ + l_pid_t pid, struct l_timespec *interval); } 162 AUE_NULL STD { int linux_nanosleep( \ const struct l_timespec *rqtp, \ struct l_timespec *rmtp); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:43:18 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DEB9A69145; Sat, 9 Jan 2016 14:43:18 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D2CE196E; Sat, 9 Jan 2016 14:43:17 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09EhHhg005332; Sat, 9 Jan 2016 14:43:17 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09EhGe6005327; Sat, 9 Jan 2016 14:43:16 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091443.u09EhGe6005327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293484 - stable/10/sys/i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:43:18 -0000 Author: dchagin Date: Sat Jan 9 14:43:16 2016 New Revision: 293484 URL: https://svnweb.freebsd.org/changeset/base/293484 Log: Regen for r293483. Modified: stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 14:41:58 2016 (r293483) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 14:43:16 2016 (r293484) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293478 2016-01-09 14:33:10Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293483 2016-01-09 14:41:58Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -490,6 +490,10 @@ struct linux_sched_get_priority_max_args struct linux_sched_get_priority_min_args { char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; }; +struct linux_sched_rr_get_interval_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char interval_l_[PADL_(struct l_timespec *)]; struct l_timespec * interval; char interval_r_[PADR_(struct l_timespec *)]; +}; struct linux_nanosleep_args { char rqtp_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * rqtp; char rqtp_r_[PADR_(const struct l_timespec *)]; char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)]; @@ -1238,6 +1242,7 @@ int linux_sched_setscheduler(struct thre int linux_sched_getscheduler(struct thread *, struct linux_sched_getscheduler_args *); int linux_sched_get_priority_max(struct thread *, struct linux_sched_get_priority_max_args *); int linux_sched_get_priority_min(struct thread *, struct linux_sched_get_priority_min_args *); +int linux_sched_rr_get_interval(struct thread *, struct linux_sched_rr_get_interval_args *); int linux_nanosleep(struct thread *, struct linux_nanosleep_args *); int linux_mremap(struct thread *, struct linux_mremap_args *); int linux_setresuid16(struct thread *, struct linux_setresuid16_args *); @@ -1542,6 +1547,7 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_sched_getscheduler AUE_SCHED_GETSCHEDULER #define LINUX_SYS_AUE_linux_sched_get_priority_max AUE_SCHED_GET_PRIORITY_MAX #define LINUX_SYS_AUE_linux_sched_get_priority_min AUE_SCHED_GET_PRIORITY_MIN +#define LINUX_SYS_AUE_linux_sched_rr_get_interval AUE_SCHED_RR_GET_INTERVAL #define LINUX_SYS_AUE_linux_nanosleep AUE_NULL #define LINUX_SYS_AUE_linux_mremap AUE_NULL #define LINUX_SYS_AUE_linux_setresuid16 AUE_SETRESUID Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 14:41:58 2016 (r293483) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 14:43:16 2016 (r293484) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293478 2016-01-09 14:33:10Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293483 2016-01-09 14:41:58Z dchagin */ #define LINUX_SYS_linux_exit 1 @@ -155,7 +155,7 @@ #define LINUX_SYS_sched_yield 158 #define LINUX_SYS_linux_sched_get_priority_max 159 #define LINUX_SYS_linux_sched_get_priority_min 160 -#define LINUX_SYS_sched_rr_get_interval 161 +#define LINUX_SYS_linux_sched_rr_get_interval 161 #define LINUX_SYS_linux_nanosleep 162 #define LINUX_SYS_linux_mremap 163 #define LINUX_SYS_linux_setresuid16 164 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 14:41:58 2016 (r293483) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 14:43:16 2016 (r293484) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293478 2016-01-09 14:33:10Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293483 2016-01-09 14:41:58Z dchagin */ const char *linux_syscallnames[] = { @@ -169,7 +169,7 @@ const char *linux_syscallnames[] = { "sched_yield", /* 158 = sched_yield */ "linux_sched_get_priority_max", /* 159 = linux_sched_get_priority_max */ "linux_sched_get_priority_min", /* 160 = linux_sched_get_priority_min */ - "sched_rr_get_interval", /* 161 = sched_rr_get_interval */ + "linux_sched_rr_get_interval", /* 161 = linux_sched_rr_get_interval */ "linux_nanosleep", /* 162 = linux_nanosleep */ "linux_mremap", /* 163 = linux_mremap */ "linux_setresuid16", /* 164 = linux_setresuid16 */ Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 14:41:58 2016 (r293483) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 14:43:16 2016 (r293484) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293478 2016-01-09 14:33:10Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293483 2016-01-09 14:41:58Z dchagin */ #include @@ -179,7 +179,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)sys_sched_yield, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 158 = sched_yield */ { AS(linux_sched_get_priority_max_args), (sy_call_t *)linux_sched_get_priority_max, AUE_SCHED_GET_PRIORITY_MAX, NULL, 0, 0, 0, SY_THR_STATIC }, /* 159 = linux_sched_get_priority_max */ { AS(linux_sched_get_priority_min_args), (sy_call_t *)linux_sched_get_priority_min, AUE_SCHED_GET_PRIORITY_MIN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 160 = linux_sched_get_priority_min */ - { AS(sched_rr_get_interval_args), (sy_call_t *)sys_sched_rr_get_interval, AUE_SCHED_RR_GET_INTERVAL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 161 = sched_rr_get_interval */ + { AS(linux_sched_rr_get_interval_args), (sy_call_t *)linux_sched_rr_get_interval, AUE_SCHED_RR_GET_INTERVAL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 161 = linux_sched_rr_get_interval */ { AS(linux_nanosleep_args), (sy_call_t *)linux_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 162 = linux_nanosleep */ { AS(linux_mremap_args), (sy_call_t *)linux_mremap, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 163 = linux_mremap */ { AS(linux_setresuid16_args), (sy_call_t *)linux_setresuid16, AUE_SETRESUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 164 = linux_setresuid16 */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 14:41:58 2016 (r293483) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 14:43:16 2016 (r293484) @@ -1132,9 +1132,9 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } - /* sched_rr_get_interval */ + /* linux_sched_rr_get_interval */ case 161: { - struct sched_rr_get_interval_args *p = params; + struct linux_sched_rr_get_interval_args *p = params; iarg[0] = p->pid; /* l_pid_t */ uarg[1] = (intptr_t) p->interval; /* struct l_timespec * */ *n_args = 2; @@ -4057,7 +4057,7 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* sched_rr_get_interval */ + /* linux_sched_rr_get_interval */ case 161: switch(ndx) { case 0: @@ -6397,7 +6397,7 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* sched_rr_get_interval */ + /* linux_sched_rr_get_interval */ case 161: if (ndx == 0 || ndx == 1) p = "int"; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:44:43 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03886A692C2; Sat, 9 Jan 2016 14:44:43 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B552A1BA5; Sat, 9 Jan 2016 14:44:42 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09EifTN005456; Sat, 9 Jan 2016 14:44:41 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09EifBD005454; Sat, 9 Jan 2016 14:44:41 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091444.u09EifBD005454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293485 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:44:43 -0000 Author: dchagin Date: Sat Jan 9 14:44:41 2016 New Revision: 293485 URL: https://svnweb.freebsd.org/changeset/base/293485 Log: MFC r283377: In preparation for switching linuxulator to the use the native 1:1 threads split sys_sched_getparam(), sys_sched_setparam(), sys_sched_getscheduler(), sys_sched_setscheduler() to their kern_* counterparts and add targettd parameter to allow specify the target thread directly by callee. Modified: stable/10/sys/kern/p1003_1b.c stable/10/sys/sys/syscallsubr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/p1003_1b.c ============================================================================== --- stable/10/sys/kern/p1003_1b.c Sat Jan 9 14:43:16 2016 (r293484) +++ stable/10/sys/kern/p1003_1b.c Sat Jan 9 14:44:41 2016 (r293485) @@ -130,16 +130,29 @@ sys_sched_setparam(struct thread *td, st targettd = FIRST_THREAD_IN_PROC(targetp); } - e = p_cansched(td, targetp); - if (e == 0) { - e = ksched_setparam(ksched, targettd, - (const struct sched_param *)&sched_param); - } + e = kern_sched_setparam(td, targettd, &sched_param); PROC_UNLOCK(targetp); return (e); } int +kern_sched_setparam(struct thread *td, struct thread *targettd, + struct sched_param *param) +{ + struct proc *targetp; + int error; + + targetp = targettd->td_proc; + PROC_LOCK_ASSERT(targetp, MA_OWNED); + + error = p_cansched(td, targetp); + if (error == 0) + error = ksched_setparam(ksched, targettd, + (const struct sched_param *)param); + return (error); +} + +int sys_sched_getparam(struct thread *td, struct sched_getparam_args *uap) { int e; @@ -159,10 +172,7 @@ sys_sched_getparam(struct thread *td, st targettd = FIRST_THREAD_IN_PROC(targetp); } - e = p_cansee(td, targetp); - if (e == 0) { - e = ksched_getparam(ksched, targettd, &sched_param); - } + e = kern_sched_getparam(td, targettd, &sched_param); PROC_UNLOCK(targetp); if (e == 0) e = copyout(&sched_param, uap->param, sizeof(sched_param)); @@ -170,6 +180,22 @@ sys_sched_getparam(struct thread *td, st } int +kern_sched_getparam(struct thread *td, struct thread *targettd, + struct sched_param *param) +{ + struct proc *targetp; + int error; + + targetp = targettd->td_proc; + PROC_LOCK_ASSERT(targetp, MA_OWNED); + + error = p_cansee(td, targetp); + if (error == 0) + error = ksched_getparam(ksched, targettd, param); + return (error); +} + +int sys_sched_setscheduler(struct thread *td, struct sched_setscheduler_args *uap) { int e; @@ -177,11 +203,6 @@ sys_sched_setscheduler(struct thread *td struct thread *targettd; struct proc *targetp; - /* Don't allow non root user to set a scheduler policy. */ - e = priv_check(td, PRIV_SCHED_SET); - if (e) - return (e); - e = copyin(uap->param, &sched_param, sizeof(sched_param)); if (e) return (e); @@ -197,16 +218,35 @@ sys_sched_setscheduler(struct thread *td targettd = FIRST_THREAD_IN_PROC(targetp); } - e = p_cansched(td, targetp); - if (e == 0) { - e = ksched_setscheduler(ksched, targettd, - uap->policy, (const struct sched_param *)&sched_param); - } + e = kern_sched_setscheduler(td, targettd, uap->policy, + &sched_param); PROC_UNLOCK(targetp); return (e); } int +kern_sched_setscheduler(struct thread *td, struct thread *targettd, + int policy, struct sched_param *param) +{ + struct proc *targetp; + int error; + + targetp = targettd->td_proc; + PROC_LOCK_ASSERT(targetp, MA_OWNED); + + /* Don't allow non root user to set a scheduler policy. */ + error = priv_check(td, PRIV_SCHED_SET); + if (error) + return (error); + + error = p_cansched(td, targetp); + if (error == 0) + error = ksched_setscheduler(ksched, targettd, policy, + (const struct sched_param *)param); + return (error); +} + +int sys_sched_getscheduler(struct thread *td, struct sched_getscheduler_args *uap) { int e, policy; @@ -224,17 +264,31 @@ sys_sched_getscheduler(struct thread *td targettd = FIRST_THREAD_IN_PROC(targetp); } - e = p_cansee(td, targetp); - if (e == 0) { - e = ksched_getscheduler(ksched, targettd, &policy); - td->td_retval[0] = policy; - } + e = kern_sched_getscheduler(td, targettd, &policy); PROC_UNLOCK(targetp); + if (e == 0) + td->td_retval[0] = policy; return (e); } int +kern_sched_getscheduler(struct thread *td, struct thread *targettd, + int *policy) +{ + struct proc *targetp; + int error; + + targetp = targettd->td_proc; + PROC_LOCK_ASSERT(targetp, MA_OWNED); + + error = p_cansee(td, targetp); + if (error == 0) + error = ksched_getscheduler(ksched, targettd, policy); + return (error); +} + +int sys_sched_yield(struct thread *td, struct sched_yield_args *uap) { Modified: stable/10/sys/sys/syscallsubr.h ============================================================================== --- stable/10/sys/sys/syscallsubr.h Sat Jan 9 14:43:16 2016 (r293484) +++ stable/10/sys/sys/syscallsubr.h Sat Jan 9 14:44:41 2016 (r293485) @@ -55,6 +55,7 @@ struct sendfile_args; struct sockaddr; struct stat; struct thr_param; +struct sched_param; struct __wrusage; int kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg, @@ -195,6 +196,14 @@ int kern_renameat(struct thread *td, int int kern_rmdir(struct thread *td, char *path, enum uio_seg pathseg); int kern_rmdirat(struct thread *td, int fd, char *path, enum uio_seg pathseg); +int kern_sched_getparam(struct thread *td, struct thread *targettd, + struct sched_param *param); +int kern_sched_getscheduler(struct thread *td, struct thread *targettd, + int *policy); +int kern_sched_setparam(struct thread *td, struct thread *targettd, + struct sched_param *param); +int kern_sched_setscheduler(struct thread *td, struct thread *targettd, + int policy, struct sched_param *param); int kern_sched_rr_get_interval(struct thread *td, pid_t pid, struct timespec *ts); int kern_sched_rr_get_interval_td(struct thread *td, struct thread *targettd, From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:45:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58FB2A6937F; Sat, 9 Jan 2016 14:45:42 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27CEB1D53; Sat, 9 Jan 2016 14:45:42 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09EjfPR005549; Sat, 9 Jan 2016 14:45:41 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09EjfXZ005548; Sat, 9 Jan 2016 14:45:41 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091445.u09EjfXZ005548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293486 - stable/10/sys/amd64/linux32 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:45:42 -0000 Author: dchagin Date: Sat Jan 9 14:45:41 2016 New Revision: 293486 URL: https://svnweb.freebsd.org/changeset/base/293486 Log: MFC r283378: Remove a now unused include. Modified: stable/10/sys/amd64/linux32/linux32_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 14:44:41 2016 (r293485) +++ stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 14:45:41 2016 (r293486) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:47:10 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72F34A69440; Sat, 9 Jan 2016 14:47:10 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5EA1F22; Sat, 9 Jan 2016 14:47:10 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09El9JE005659; Sat, 9 Jan 2016 14:47:09 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09El9Vu005656; Sat, 9 Jan 2016 14:47:09 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091447.u09El9Vu005656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293487 - in stable/10/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:47:10 -0000 Author: dchagin Date: Sat Jan 9 14:47:08 2016 New Revision: 293487 URL: https://svnweb.freebsd.org/changeset/base/293487 Log: MFC r283379: Implement a Linux version of sched_getparam() && sched_setparam(). Temporarily use the first thread in proc. Modified: stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_misc.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 14:45:41 2016 (r293486) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 14:47:08 2016 (r293487) @@ -267,10 +267,10 @@ 151 AUE_MUNLOCK NOPROTO { int munlock(const void *addr, size_t len); } 152 AUE_MLOCKALL NOPROTO { int mlockall(int how); } 153 AUE_MUNLOCKALL NOPROTO { int munlockall(void); } -154 AUE_SCHED_SETPARAM NOPROTO { int sched_setparam(pid_t pid, \ - const struct sched_param *param); } -155 AUE_SCHED_GETPARAM NOPROTO { int sched_getparam(pid_t pid, \ - struct sched_param *param); } +154 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \ + struct l_sched_param *param); } +155 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \ + struct l_sched_param *param); } 156 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ l_pid_t pid, l_int policy, \ struct l_sched_param *param); } Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 14:45:41 2016 (r293486) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 14:47:08 2016 (r293487) @@ -1871,6 +1871,78 @@ linux_prctl(struct thread *td, struct li return (error); } +int +linux_sched_setparam(struct thread *td, + struct linux_sched_setparam_args *uap) +{ + struct sched_param sched_param; + struct thread *tdt; + struct proc *p; + int error; + +#ifdef DEBUG + if (ldebug(sched_setparam)) + printf(ARGS(sched_setparam, "%d, *"), uap->pid); +#endif + + error = copyin(uap->param, &sched_param, sizeof(sched_param)); + if (error) + return (error); + + if (uap->pid == 0) { + tdt = td; + p = tdt->td_proc; + PROC_LOCK(p); + } else { + p = pfind(uap->pid); + if (p == NULL) + return (ESRCH); + /* + * XXX. Scheduling parameters are in fact per-thread + * attributes in Linux. Temporarily use the first + * thread in proc. The same for get_param(). + */ + tdt = FIRST_THREAD_IN_PROC(p); + } + + error = kern_sched_setparam(td, tdt, &sched_param); + PROC_UNLOCK(p); + return (error); +} + +int +linux_sched_getparam(struct thread *td, + struct linux_sched_getparam_args *uap) +{ + struct sched_param sched_param; + struct thread *tdt; + struct proc *p; + int error; + +#ifdef DEBUG + if (ldebug(sched_getparam)) + printf(ARGS(sched_getparam, "%d, *"), uap->pid); +#endif + + if (uap->pid == 0) { + tdt = td; + p = tdt->td_proc; + PROC_LOCK(p); + } else { + p = pfind(uap->pid); + if (p == NULL) + return (ESRCH); + tdt = FIRST_THREAD_IN_PROC(p); + } + + error = kern_sched_getparam(td, tdt, &sched_param); + PROC_UNLOCK(p); + if (error == 0) + error = copyout(&sched_param, uap->param, + sizeof(sched_param)); + return (error); +} + /* * Get affinity of a process. */ Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 14:45:41 2016 (r293486) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 14:47:08 2016 (r293487) @@ -269,10 +269,10 @@ 151 AUE_MUNLOCK NOPROTO { int munlock(const void *addr, size_t len); } 152 AUE_MLOCKALL NOPROTO { int mlockall(int how); } 153 AUE_MUNLOCKALL NOPROTO { int munlockall(void); } -154 AUE_SCHED_SETPARAM NOPROTO { int sched_setparam(pid_t pid, \ - const struct sched_param *param); } -155 AUE_SCHED_GETPARAM NOPROTO { int sched_getparam(pid_t pid, \ - struct sched_param *param); } +154 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \ + struct l_sched_param *param); } +155 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \ + struct l_sched_param *param); } 156 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ l_pid_t pid, l_int policy, \ struct l_sched_param *param); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:48:25 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DBDCA694F7; Sat, 9 Jan 2016 14:48:25 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AD5610BD; Sat, 9 Jan 2016 14:48:25 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09EmO7K005755; Sat, 9 Jan 2016 14:48:24 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09EmNsr005744; Sat, 9 Jan 2016 14:48:23 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091448.u09EmNsr005744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293488 - in stable/10/sys: amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:48:25 -0000 Author: dchagin Date: Sat Jan 9 14:48:23 2016 New Revision: 293488 URL: https://svnweb.freebsd.org/changeset/base/293488 Log: Regen fro r293487. Modified: stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 14:47:08 2016 (r293487) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 14:48:23 2016 (r293488) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293478 2016-01-09 14:33:10Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293487 2016-01-09 14:47:08Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -478,6 +478,14 @@ struct linux_fdatasync_args { struct linux_sysctl_args { char args_l_[PADL_(struct l___sysctl_args *)]; struct l___sysctl_args * args; char args_r_[PADR_(struct l___sysctl_args *)]; }; +struct linux_sched_setparam_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; +}; +struct linux_sched_getparam_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; +}; struct linux_sched_setscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; @@ -1220,6 +1228,8 @@ int linux_writev(struct thread *, struct int linux_getsid(struct thread *, struct linux_getsid_args *); int linux_fdatasync(struct thread *, struct linux_fdatasync_args *); int linux_sysctl(struct thread *, struct linux_sysctl_args *); +int linux_sched_setparam(struct thread *, struct linux_sched_setparam_args *); +int linux_sched_getparam(struct thread *, struct linux_sched_getparam_args *); int linux_sched_setscheduler(struct thread *, struct linux_sched_setscheduler_args *); int linux_sched_getscheduler(struct thread *, struct linux_sched_getscheduler_args *); int linux_sched_get_priority_max(struct thread *, struct linux_sched_get_priority_max_args *); @@ -1523,6 +1533,8 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_getsid AUE_GETSID #define LINUX_SYS_AUE_linux_fdatasync AUE_NULL #define LINUX_SYS_AUE_linux_sysctl AUE_SYSCTL +#define LINUX_SYS_AUE_linux_sched_setparam AUE_SCHED_SETPARAM +#define LINUX_SYS_AUE_linux_sched_getparam AUE_SCHED_GETPARAM #define LINUX_SYS_AUE_linux_sched_setscheduler AUE_SCHED_SETSCHEDULER #define LINUX_SYS_AUE_linux_sched_getscheduler AUE_SCHED_GETSCHEDULER #define LINUX_SYS_AUE_linux_sched_get_priority_max AUE_SCHED_GET_PRIORITY_MAX Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 14:47:08 2016 (r293487) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 14:48:23 2016 (r293488) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293478 2016-01-09 14:33:10Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293487 2016-01-09 14:47:08Z dchagin */ #define LINUX_SYS_linux_exit 1 @@ -143,8 +143,8 @@ #define LINUX_SYS_munlock 151 #define LINUX_SYS_mlockall 152 #define LINUX_SYS_munlockall 153 -#define LINUX_SYS_sched_setparam 154 -#define LINUX_SYS_sched_getparam 155 +#define LINUX_SYS_linux_sched_setparam 154 +#define LINUX_SYS_linux_sched_getparam 155 #define LINUX_SYS_linux_sched_setscheduler 156 #define LINUX_SYS_linux_sched_getscheduler 157 #define LINUX_SYS_sched_yield 158 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 14:47:08 2016 (r293487) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 14:48:23 2016 (r293488) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293478 2016-01-09 14:33:10Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293487 2016-01-09 14:47:08Z dchagin */ const char *linux_syscallnames[] = { @@ -162,8 +162,8 @@ const char *linux_syscallnames[] = { "munlock", /* 151 = munlock */ "mlockall", /* 152 = mlockall */ "munlockall", /* 153 = munlockall */ - "sched_setparam", /* 154 = sched_setparam */ - "sched_getparam", /* 155 = sched_getparam */ + "linux_sched_setparam", /* 154 = linux_sched_setparam */ + "linux_sched_getparam", /* 155 = linux_sched_getparam */ "linux_sched_setscheduler", /* 156 = linux_sched_setscheduler */ "linux_sched_getscheduler", /* 157 = linux_sched_getscheduler */ "sched_yield", /* 158 = sched_yield */ Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 14:47:08 2016 (r293487) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 14:48:23 2016 (r293488) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293478 2016-01-09 14:33:10Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293487 2016-01-09 14:47:08Z dchagin */ #include "opt_compat.h" @@ -173,8 +173,8 @@ struct sysent linux_sysent[] = { { AS(munlock_args), (sy_call_t *)sys_munlock, AUE_MUNLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 151 = munlock */ { AS(mlockall_args), (sy_call_t *)sys_mlockall, AUE_MLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 152 = mlockall */ { 0, (sy_call_t *)sys_munlockall, AUE_MUNLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 153 = munlockall */ - { AS(sched_setparam_args), (sy_call_t *)sys_sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 154 = sched_setparam */ - { AS(sched_getparam_args), (sy_call_t *)sys_sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 155 = sched_getparam */ + { AS(linux_sched_setparam_args), (sy_call_t *)linux_sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 154 = linux_sched_setparam */ + { AS(linux_sched_getparam_args), (sy_call_t *)linux_sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 155 = linux_sched_getparam */ { AS(linux_sched_setscheduler_args), (sy_call_t *)linux_sched_setscheduler, AUE_SCHED_SETSCHEDULER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 156 = linux_sched_setscheduler */ { AS(linux_sched_getscheduler_args), (sy_call_t *)linux_sched_getscheduler, AUE_SCHED_GETSCHEDULER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 157 = linux_sched_getscheduler */ { 0, (sy_call_t *)sys_sched_yield, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 158 = sched_yield */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 14:47:08 2016 (r293487) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 14:48:23 2016 (r293488) @@ -1043,19 +1043,19 @@ systrace_args(int sysnum, void *params, *n_args = 0; break; } - /* sched_setparam */ + /* linux_sched_setparam */ case 154: { - struct sched_setparam_args *p = params; - iarg[0] = p->pid; /* pid_t */ - uarg[1] = (intptr_t) p->param; /* const struct sched_param * */ + struct linux_sched_setparam_args *p = params; + iarg[0] = p->pid; /* l_pid_t */ + uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ *n_args = 2; break; } - /* sched_getparam */ + /* linux_sched_getparam */ case 155: { - struct sched_getparam_args *p = params; - iarg[0] = p->pid; /* pid_t */ - uarg[1] = (intptr_t) p->param; /* struct sched_param * */ + struct linux_sched_getparam_args *p = params; + iarg[0] = p->pid; /* l_pid_t */ + uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ *n_args = 2; break; } @@ -3848,27 +3848,27 @@ systrace_entry_setargdesc(int sysnum, in /* munlockall */ case 153: break; - /* sched_setparam */ + /* linux_sched_setparam */ case 154: switch(ndx) { case 0: - p = "pid_t"; + p = "l_pid_t"; break; case 1: - p = "const struct sched_param *"; + p = "struct l_sched_param *"; break; default: break; }; break; - /* sched_getparam */ + /* linux_sched_getparam */ case 155: switch(ndx) { case 0: - p = "pid_t"; + p = "l_pid_t"; break; case 1: - p = "struct sched_param *"; + p = "struct l_sched_param *"; break; default: break; @@ -6112,12 +6112,12 @@ systrace_return_setargdesc(int sysnum, i break; /* munlockall */ case 153: - /* sched_setparam */ + /* linux_sched_setparam */ case 154: if (ndx == 0 || ndx == 1) p = "int"; break; - /* sched_getparam */ + /* linux_sched_getparam */ case 155: if (ndx == 0 || ndx == 1) p = "int"; Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 14:47:08 2016 (r293487) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 14:48:23 2016 (r293488) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293483 2016-01-09 14:41:58Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293487 2016-01-09 14:47:08Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -476,6 +476,14 @@ struct linux_fdatasync_args { struct linux_sysctl_args { char args_l_[PADL_(struct l___sysctl_args *)]; struct l___sysctl_args * args; char args_r_[PADR_(struct l___sysctl_args *)]; }; +struct linux_sched_setparam_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; +}; +struct linux_sched_getparam_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; +}; struct linux_sched_setscheduler_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; @@ -1238,6 +1246,8 @@ int linux_msync(struct thread *, struct int linux_getsid(struct thread *, struct linux_getsid_args *); int linux_fdatasync(struct thread *, struct linux_fdatasync_args *); int linux_sysctl(struct thread *, struct linux_sysctl_args *); +int linux_sched_setparam(struct thread *, struct linux_sched_setparam_args *); +int linux_sched_getparam(struct thread *, struct linux_sched_getparam_args *); int linux_sched_setscheduler(struct thread *, struct linux_sched_setscheduler_args *); int linux_sched_getscheduler(struct thread *, struct linux_sched_getscheduler_args *); int linux_sched_get_priority_max(struct thread *, struct linux_sched_get_priority_max_args *); @@ -1543,6 +1553,8 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_getsid AUE_GETSID #define LINUX_SYS_AUE_linux_fdatasync AUE_NULL #define LINUX_SYS_AUE_linux_sysctl AUE_SYSCTL +#define LINUX_SYS_AUE_linux_sched_setparam AUE_SCHED_SETPARAM +#define LINUX_SYS_AUE_linux_sched_getparam AUE_SCHED_GETPARAM #define LINUX_SYS_AUE_linux_sched_setscheduler AUE_SCHED_SETSCHEDULER #define LINUX_SYS_AUE_linux_sched_getscheduler AUE_SCHED_GETSCHEDULER #define LINUX_SYS_AUE_linux_sched_get_priority_max AUE_SCHED_GET_PRIORITY_MAX Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 14:47:08 2016 (r293487) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 14:48:23 2016 (r293488) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293483 2016-01-09 14:41:58Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293487 2016-01-09 14:47:08Z dchagin */ #define LINUX_SYS_linux_exit 1 @@ -148,8 +148,8 @@ #define LINUX_SYS_munlock 151 #define LINUX_SYS_mlockall 152 #define LINUX_SYS_munlockall 153 -#define LINUX_SYS_sched_setparam 154 -#define LINUX_SYS_sched_getparam 155 +#define LINUX_SYS_linux_sched_setparam 154 +#define LINUX_SYS_linux_sched_getparam 155 #define LINUX_SYS_linux_sched_setscheduler 156 #define LINUX_SYS_linux_sched_getscheduler 157 #define LINUX_SYS_sched_yield 158 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 14:47:08 2016 (r293487) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 14:48:23 2016 (r293488) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293483 2016-01-09 14:41:58Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293487 2016-01-09 14:47:08Z dchagin */ const char *linux_syscallnames[] = { @@ -162,8 +162,8 @@ const char *linux_syscallnames[] = { "munlock", /* 151 = munlock */ "mlockall", /* 152 = mlockall */ "munlockall", /* 153 = munlockall */ - "sched_setparam", /* 154 = sched_setparam */ - "sched_getparam", /* 155 = sched_getparam */ + "linux_sched_setparam", /* 154 = linux_sched_setparam */ + "linux_sched_getparam", /* 155 = linux_sched_getparam */ "linux_sched_setscheduler", /* 156 = linux_sched_setscheduler */ "linux_sched_getscheduler", /* 157 = linux_sched_getscheduler */ "sched_yield", /* 158 = sched_yield */ Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 14:47:08 2016 (r293487) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 14:48:23 2016 (r293488) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293483 2016-01-09 14:41:58Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293487 2016-01-09 14:47:08Z dchagin */ #include @@ -172,8 +172,8 @@ struct sysent linux_sysent[] = { { AS(munlock_args), (sy_call_t *)sys_munlock, AUE_MUNLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 151 = munlock */ { AS(mlockall_args), (sy_call_t *)sys_mlockall, AUE_MLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 152 = mlockall */ { 0, (sy_call_t *)sys_munlockall, AUE_MUNLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 153 = munlockall */ - { AS(sched_setparam_args), (sy_call_t *)sys_sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 154 = sched_setparam */ - { AS(sched_getparam_args), (sy_call_t *)sys_sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 155 = sched_getparam */ + { AS(linux_sched_setparam_args), (sy_call_t *)linux_sched_setparam, AUE_SCHED_SETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 154 = linux_sched_setparam */ + { AS(linux_sched_getparam_args), (sy_call_t *)linux_sched_getparam, AUE_SCHED_GETPARAM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 155 = linux_sched_getparam */ { AS(linux_sched_setscheduler_args), (sy_call_t *)linux_sched_setscheduler, AUE_SCHED_SETSCHEDULER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 156 = linux_sched_setscheduler */ { AS(linux_sched_getscheduler_args), (sy_call_t *)linux_sched_getscheduler, AUE_SCHED_GETSCHEDULER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 157 = linux_sched_getscheduler */ { 0, (sy_call_t *)sys_sched_yield, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 158 = sched_yield */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 14:47:08 2016 (r293487) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 14:48:23 2016 (r293488) @@ -1081,19 +1081,19 @@ systrace_args(int sysnum, void *params, *n_args = 0; break; } - /* sched_setparam */ + /* linux_sched_setparam */ case 154: { - struct sched_setparam_args *p = params; - iarg[0] = p->pid; /* pid_t */ - uarg[1] = (intptr_t) p->param; /* const struct sched_param * */ + struct linux_sched_setparam_args *p = params; + iarg[0] = p->pid; /* l_pid_t */ + uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ *n_args = 2; break; } - /* sched_getparam */ + /* linux_sched_getparam */ case 155: { - struct sched_getparam_args *p = params; - iarg[0] = p->pid; /* pid_t */ - uarg[1] = (intptr_t) p->param; /* struct sched_param * */ + struct linux_sched_getparam_args *p = params; + iarg[0] = p->pid; /* l_pid_t */ + uarg[1] = (intptr_t) p->param; /* struct l_sched_param * */ *n_args = 2; break; } @@ -3982,27 +3982,27 @@ systrace_entry_setargdesc(int sysnum, in /* munlockall */ case 153: break; - /* sched_setparam */ + /* linux_sched_setparam */ case 154: switch(ndx) { case 0: - p = "pid_t"; + p = "l_pid_t"; break; case 1: - p = "const struct sched_param *"; + p = "struct l_sched_param *"; break; default: break; }; break; - /* sched_getparam */ + /* linux_sched_getparam */ case 155: switch(ndx) { case 0: - p = "pid_t"; + p = "l_pid_t"; break; case 1: - p = "struct sched_param *"; + p = "struct l_sched_param *"; break; default: break; @@ -6365,12 +6365,12 @@ systrace_return_setargdesc(int sysnum, i break; /* munlockall */ case 153: - /* sched_setparam */ + /* linux_sched_setparam */ case 154: if (ndx == 0 || ndx == 1) p = "int"; break; - /* sched_getparam */ + /* linux_sched_getparam */ case 155: if (ndx == 0 || ndx == 1) p = "int"; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:51:51 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEBF6A6976F; Sat, 9 Jan 2016 14:51:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF36014E3; Sat, 9 Jan 2016 14:51:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09EpogH008519; Sat, 9 Jan 2016 14:51:50 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09EpogC008518; Sat, 9 Jan 2016 14:51:50 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091451.u09EpogC008518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293489 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:51:52 -0000 Author: dchagin Date: Sat Jan 9 14:51:50 2016 New Revision: 293489 URL: https://svnweb.freebsd.org/changeset/base/293489 Log: MFC r283381: In preparation for switching linuxulator to the use the native 1:1 threads add per thread emulator state data. Modified: stable/10/sys/sys/proc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/proc.h ============================================================================== --- stable/10/sys/sys/proc.h Sat Jan 9 14:48:23 2016 (r293488) +++ stable/10/sys/sys/proc.h Sat Jan 9 14:51:50 2016 (r293489) @@ -323,6 +323,7 @@ struct thread { void *td_su; /* (k) FFS SU private */ u_int td_dbg_sc_code; /* (c) Syscall code to debugger. */ u_int td_dbg_sc_narg; /* (c) Syscall arg count to debugger.*/ + void *td_emuldata; /* Emulator state data */ }; struct mtx *thread_lock_block(struct thread *); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 14:53:11 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59338A6987F; Sat, 9 Jan 2016 14:53:11 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 301A7186F; Sat, 9 Jan 2016 14:53:11 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09ErATa008635; Sat, 9 Jan 2016 14:53:10 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Er8S5008620; Sat, 9 Jan 2016 14:53:08 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091453.u09Er8S5008620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 14:53:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293490 - in stable/10/sys: amd64/amd64 arm/arm compat/ia32 compat/svr4 i386/i386 i386/ibcs2 kern mips/mips powerpc/powerpc sparc64/sparc64 sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 14:53:11 -0000 Author: dchagin Date: Sat Jan 9 14:53:08 2016 New Revision: 293490 URL: https://svnweb.freebsd.org/changeset/base/293490 Log: MFC r283382: In preparation for switching linuxulator to the use the native 1:1 threads add a hook for cleaning thread resources before the thread die. Modified: stable/10/sys/amd64/amd64/elf_machdep.c stable/10/sys/arm/arm/elf_machdep.c stable/10/sys/compat/ia32/ia32_sysvec.c stable/10/sys/compat/svr4/svr4_sysvec.c stable/10/sys/i386/i386/elf_machdep.c stable/10/sys/i386/ibcs2/ibcs2_sysvec.c stable/10/sys/kern/imgact_aout.c stable/10/sys/kern/init_main.c stable/10/sys/kern/kern_thread.c stable/10/sys/mips/mips/elf_machdep.c stable/10/sys/mips/mips/freebsd32_machdep.c stable/10/sys/powerpc/powerpc/elf32_machdep.c stable/10/sys/powerpc/powerpc/elf64_machdep.c stable/10/sys/sparc64/sparc64/elf_machdep.c stable/10/sys/sys/sysent.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/elf_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/elf_machdep.c Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/amd64/amd64/elf_machdep.c Sat Jan 9 14:53:08 2016 (r293490) @@ -82,6 +82,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_shared_page_base = SHAREDPAGE, .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, + .sv_thread_detach = NULL, }; INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); Modified: stable/10/sys/arm/arm/elf_machdep.c ============================================================================== --- stable/10/sys/arm/arm/elf_machdep.c Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/arm/arm/elf_machdep.c Sat Jan 9 14:53:08 2016 (r293490) @@ -79,6 +79,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, .sv_schedtail = NULL, + .sv_thread_detach = NULL, }; static Elf32_Brandinfo freebsd_brand_info = { Modified: stable/10/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- stable/10/sys/compat/ia32/ia32_sysvec.c Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/compat/ia32/ia32_sysvec.c Sat Jan 9 14:53:08 2016 (r293490) @@ -139,6 +139,7 @@ struct sysentvec ia32_freebsd_sysvec = { .sv_shared_page_base = FREEBSD32_SHAREDPAGE, .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, + .sv_thread_detach = NULL, }; INIT_SYSENTVEC(elf_ia32_sysvec, &ia32_freebsd_sysvec); Modified: stable/10/sys/compat/svr4/svr4_sysvec.c ============================================================================== --- stable/10/sys/compat/svr4/svr4_sysvec.c Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/compat/svr4/svr4_sysvec.c Sat Jan 9 14:53:08 2016 (r293490) @@ -196,6 +196,7 @@ struct sysentvec svr4_sysvec = { .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = NULL, .sv_schedtail = NULL, + .sv_thread_detach = NULL, }; const char svr4_emul_path[] = "/compat/svr4"; Modified: stable/10/sys/i386/i386/elf_machdep.c ============================================================================== --- stable/10/sys/i386/i386/elf_machdep.c Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/i386/i386/elf_machdep.c Sat Jan 9 14:53:08 2016 (r293490) @@ -88,6 +88,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_shared_page_base = SHAREDPAGE, .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, + .sv_thread_detach = NULL, }; INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); Modified: stable/10/sys/i386/ibcs2/ibcs2_sysvec.c ============================================================================== --- stable/10/sys/i386/ibcs2/ibcs2_sysvec.c Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/i386/ibcs2/ibcs2_sysvec.c Sat Jan 9 14:53:08 2016 (r293490) @@ -89,6 +89,7 @@ struct sysentvec ibcs2_svr3_sysvec = { .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = NULL, .sv_schedtail = NULL, + .sv_thread_detach = NULL, }; static int Modified: stable/10/sys/kern/imgact_aout.c ============================================================================== --- stable/10/sys/kern/imgact_aout.c Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/kern/imgact_aout.c Sat Jan 9 14:53:08 2016 (r293490) @@ -99,6 +99,7 @@ struct sysentvec aout_sysvec = { .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, .sv_schedtail = NULL, + .sv_thread_detach = NULL, }; #elif defined(__amd64__) Modified: stable/10/sys/kern/init_main.c ============================================================================== --- stable/10/sys/kern/init_main.c Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/kern/init_main.c Sat Jan 9 14:53:08 2016 (r293490) @@ -414,6 +414,7 @@ struct sysentvec null_sysvec = { .sv_fetch_syscall_args = null_fetch_syscall_args, .sv_syscallnames = NULL, .sv_schedtail = NULL, + .sv_thread_detach = NULL, }; /* Modified: stable/10/sys/kern/kern_thread.c ============================================================================== --- stable/10/sys/kern/kern_thread.c Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/kern/kern_thread.c Sat Jan 9 14:53:08 2016 (r293490) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -885,6 +886,14 @@ thread_suspend_check(int return_instead) if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) { PROC_UNLOCK(p); tidhash_remove(td); + + /* + * Allow Linux emulation layer to do some work + * before thread suicide. + */ + if (__predict_false(p->p_sysent->sv_thread_detach != NULL)) + (p->p_sysent->sv_thread_detach)(td); + PROC_LOCK(p); tdsigcleanup(td); umtx_thread_exit(td); Modified: stable/10/sys/mips/mips/elf_machdep.c ============================================================================== --- stable/10/sys/mips/mips/elf_machdep.c Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/mips/mips/elf_machdep.c Sat Jan 9 14:53:08 2016 (r293490) @@ -83,6 +83,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, .sv_schedtail = NULL, + .sv_thread_detach = NULL, }; static Elf64_Brandinfo freebsd_brand_info = { @@ -139,6 +140,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, .sv_schedtail = NULL, + .sv_thread_detach = NULL, }; static Elf32_Brandinfo freebsd_brand_info = { Modified: stable/10/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- stable/10/sys/mips/mips/freebsd32_machdep.c Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/mips/mips/freebsd32_machdep.c Sat Jan 9 14:53:08 2016 (r293490) @@ -106,6 +106,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = freebsd32_syscallnames, .sv_schedtail = NULL, + .sv_thread_detach = NULL, }; INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); Modified: stable/10/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/elf32_machdep.c Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/powerpc/powerpc/elf32_machdep.c Sat Jan 9 14:53:08 2016 (r293490) @@ -107,6 +107,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_shared_page_base = FREEBSD32_SHAREDPAGE, .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, + .sv_thread_detach = NULL, }; INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); Modified: stable/10/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/elf64_machdep.c Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/powerpc/powerpc/elf64_machdep.c Sat Jan 9 14:53:08 2016 (r293490) @@ -83,6 +83,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_shared_page_base = SHAREDPAGE, .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, + .sv_thread_detach = NULL, }; INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); Modified: stable/10/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- stable/10/sys/sparc64/sparc64/elf_machdep.c Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/sparc64/sparc64/elf_machdep.c Sat Jan 9 14:53:08 2016 (r293490) @@ -87,6 +87,7 @@ static struct sysentvec elf64_freebsd_sy .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, .sv_schedtail = NULL, + .sv_thread_detach = NULL, }; static Elf64_Brandinfo freebsd_brand_info = { Modified: stable/10/sys/sys/sysent.h ============================================================================== --- stable/10/sys/sys/sysent.h Sat Jan 9 14:51:50 2016 (r293489) +++ stable/10/sys/sys/sysent.h Sat Jan 9 14:53:08 2016 (r293490) @@ -130,6 +130,7 @@ struct sysentvec { uint32_t sv_timekeep_gen; void *sv_shared_page_obj; void (*sv_schedtail)(struct thread *); + void (*sv_thread_detach)(struct thread *); }; #define SV_ILP32 0x000100 From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:12:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5119A68363; Sat, 9 Jan 2016 15:12:32 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C2091785; Sat, 9 Jan 2016 15:12:32 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FCVoY014839; Sat, 9 Jan 2016 15:12:31 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FCVqL014838; Sat, 9 Jan 2016 15:12:31 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091512.u09FCVqL014838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293492 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:12:32 -0000 Author: dchagin Date: Sat Jan 9 15:12:31 2016 New Revision: 293492 URL: https://svnweb.freebsd.org/changeset/base/293492 Log: To facillitate Linuxulator merging temporarilly revert r288994 (by bdrewery). Modified: stable/10/sys/compat/linux/linux_fork.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_fork.c ============================================================================== --- stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 14:53:23 2016 (r293491) +++ stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 15:12:31 2016 (r293492) @@ -112,8 +112,9 @@ linux_vfork(struct thread *td, struct li printf(ARGS(vfork, "")); #endif - if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFPPWAIT | RFSTOPPED, - 0, &p2, NULL, 0)) != 0) + /* Exclude RFPPWAIT */ + if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFSTOPPED, 0, &p2, + NULL, 0)) != 0) return (error); td->td_retval[0] = p2->p_pid; @@ -122,6 +123,10 @@ linux_vfork(struct thread *td, struct li if (error) return (error); + PROC_LOCK(p2); + p2->p_flag |= P_PPWAIT; + PROC_UNLOCK(p2); + td2 = FIRST_THREAD_IN_PROC(p2); /* @@ -132,6 +137,12 @@ linux_vfork(struct thread *td, struct li sched_add(td2, SRQ_BORING); thread_unlock(td2); + /* wait for the children to exit, ie. emulate vfork */ + PROC_LOCK(p2); + while (p2->p_flag & P_PPWAIT) + cv_wait(&p2->p_pwait, &p2->p_mtx); + PROC_UNLOCK(p2); + return (0); } @@ -193,9 +204,6 @@ linux_clone(struct thread *td, struct li if (args->parent_tidptr == NULL) return (EINVAL); - if (args->flags & LINUX_CLONE_VFORK) - ff |= RFPPWAIT; - error = fork1(td, ff, 0, &p2, NULL, 0); if (error) return (error); @@ -264,6 +272,12 @@ linux_clone(struct thread *td, struct li "stack %p sig = %d"), (int)p2->p_pid, args->stack, exit_signal); #endif + if (args->flags & LINUX_CLONE_VFORK) { + PROC_LOCK(p2); + p2->p_flag |= P_PPWAIT; + PROC_UNLOCK(p2); + } + /* * Make this runnable after we are finished with it. */ @@ -275,6 +289,14 @@ linux_clone(struct thread *td, struct li td->td_retval[0] = p2->p_pid; td->td_retval[1] = 0; + if (args->flags & LINUX_CLONE_VFORK) { + /* wait for the children to exit, ie. emulate vfork */ + PROC_LOCK(p2); + while (p2->p_flag & P_PPWAIT) + cv_wait(&p2->p_pwait, &p2->p_mtx); + PROC_UNLOCK(p2); + } + return (0); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:16:15 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABA35A68460; Sat, 9 Jan 2016 15:16:15 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74BEA1993; Sat, 9 Jan 2016 15:16:15 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FGEof015018; Sat, 9 Jan 2016 15:16:14 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FGEMF015010; Sat, 9 Jan 2016 15:16:14 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091516.u09FGEMF015010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:16:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293493 - in stable/10/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:16:15 -0000 Author: dchagin Date: Sat Jan 9 15:16:13 2016 New Revision: 293493 URL: https://svnweb.freebsd.org/changeset/base/293493 Log: MFC r283383: Switch linuxulator to use the native 1:1 threads. The reasons: 1. Get rid of the stubs/quirks with process dethreading, process reparent when the process group leader exits and close to this problems on wait(), waitpid(), etc. 2. Reuse our kernel code instead of writing excessive thread managment routines in Linuxulator. Implementation details: 1. The thread is created via kern_thr_new() in the clone() call with the CLONE_THREAD parameter. Thus, everything else is a process. 2. The test that the process has a threads is done via P_HADTHREADS bit p_flag of struct proc. 3. Per thread emulator state data structure is now located in the struct thread and freed in the thread_dtor() hook. Mandatory holdig of the p_mtx required when referencing emuldata from the other threads. 4. PID mangling has changed. Now Linux pid is the native tid and Linux tgid is the native pid, with the exception of the first thread in the process where tid and pid are one and the same. Ugliness: In case when the Linux thread is the initial thread in the thread group thread id is equal to the process id. Glibc depends on this magic (assert in pthread_getattr_np.c). So for system calls that take thread id as a parameter we should use the special method to reference struct thread. Modified: stable/10/sys/amd64/linux32/linux32_machdep.c stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/compat/linux/check_error.d stable/10/sys/compat/linux/check_internal_locks.d stable/10/sys/compat/linux/linux_emul.c stable/10/sys/compat/linux/linux_emul.h stable/10/sys/compat/linux/linux_fork.c stable/10/sys/compat/linux/linux_futex.c stable/10/sys/compat/linux/linux_futex.h stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/linux/linux_misc.h stable/10/sys/compat/linux/linux_signal.c stable/10/sys/compat/linux/stats_timing.d stable/10/sys/i386/linux/linux_machdep.c stable/10/sys/i386/linux/linux_sysvec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 15:12:31 2016 (r293492) +++ stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 15:16:13 2016 (r293493) @@ -157,15 +157,8 @@ linux_execve(struct thread *td, struct l free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); - if (error == 0) { - /* Linux process can execute FreeBSD one, do not attempt - * to create emuldata for such process using - * linux_proc_init, this leads to a panic on KASSERT - * because such process has p->p_emuldata == NULL. - */ - if (SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX) - error = linux_proc_init(td, 0, 0); - } + if (error == 0) + error = linux_common_execve(td, &eargs); post_execve(td, error, oldvmspace); return (error); } @@ -463,8 +456,14 @@ int linux_set_upcall_kse(struct thread *td, register_t stack) { - td->td_frame->tf_rsp = stack; + if (stack) + td->td_frame->tf_rsp = stack; + /* + * The newly created Linux thread returns + * to the user space by the same path that a parent do. + */ + td->td_frame->tf_rax = 0; return (0); } Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 15:12:31 2016 (r293492) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 15:16:13 2016 (r293493) @@ -130,6 +130,7 @@ static boolean_t linux32_trans_osrel(con static eventhandler_tag linux_exit_tag; static eventhandler_tag linux_exec_tag; +static eventhandler_tag linux_thread_dtor_tag; /* * Linux syscalls return negative errno's, we do positive and map them @@ -1037,6 +1038,7 @@ struct sysentvec elf_linux_sysvec = { .sv_shared_page_base = LINUX32_SHAREDPAGE, .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = linux_schedtail, + .sv_thread_detach = linux_thread_detach, }; INIT_SYSENTVEC(elf_sysvec, &elf_linux_sysvec); @@ -1125,14 +1127,14 @@ linux_elf_modevent(module_t mod, int typ linux_ioctl_register_handler(*lihp); SET_FOREACH(ldhp, linux_device_handler_set) linux_device_register_handler(*ldhp); - mtx_init(&emul_lock, "emuldata lock", NULL, MTX_DEF); - sx_init(&emul_shared_lock, "emuldata->shared lock"); LIST_INIT(&futex_list); mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit, NULL, 1000); linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, linux_proc_exec, NULL, 1000); + linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, + linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); linux_szplatform = roundup(strlen(linux_platform) + 1, sizeof(char *)); linux_osd_jail_register(); @@ -1158,11 +1160,10 @@ linux_elf_modevent(module_t mod, int typ linux_ioctl_unregister_handler(*lihp); SET_FOREACH(ldhp, linux_device_handler_set) linux_device_unregister_handler(*ldhp); - mtx_destroy(&emul_lock); - sx_destroy(&emul_shared_lock); mtx_destroy(&futex_mtx); EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); + EVENTHANDLER_DEREGISTER(thread_dtor, linux_thread_dtor_tag); linux_osd_jail_deregister(); if (bootverbose) printf("Linux ELF exec handler removed\n"); Modified: stable/10/sys/compat/linux/check_error.d ============================================================================== --- stable/10/sys/compat/linux/check_error.d Sat Jan 9 15:12:31 2016 (r293492) +++ stable/10/sys/compat/linux/check_error.d Sat Jan 9 15:16:13 2016 (r293493) @@ -36,8 +36,8 @@ */ linuxulator*:dummy::not_implemented, -linuxulator*:emul:proc_exit:child_clear_tid_error, -linuxulator*:emul:proc_exit:futex_failed, +linuxulator*:emul:linux_thread_detach:child_clear_tid_error, +linuxulator*:emul:linux_thread_detach:futex_failed, linuxulator*:emul:linux_schedtail:copyout_error, linuxulator*:futex:futex_get:error, linuxulator*:futex:futex_sleep:requeue_error, Modified: stable/10/sys/compat/linux/check_internal_locks.d ============================================================================== --- stable/10/sys/compat/linux/check_internal_locks.d Sat Jan 9 15:12:31 2016 (r293492) +++ stable/10/sys/compat/linux/check_internal_locks.d Sat Jan 9 15:16:13 2016 (r293493) @@ -41,14 +41,9 @@ BEGIN { - check["emul_lock"] = 0; - check["emul_shared_rlock"] = 0; - check["emul_shared_wlock"] = 0; check["futex_mtx"] = 0; } -linuxulator*:locks:emul_lock:locked, -linuxulator*:locks:emul_shared_wlock:locked, linuxulator*:locks:futex_mtx:locked /check[probefunc] > 0/ { @@ -57,9 +52,6 @@ linuxulator*:locks:futex_mtx:locked stack(); } -linuxulator*:locks:emul_lock:locked, -linuxulator*:locks:emul_shared_rlock:locked, -linuxulator*:locks:emul_shared_wlock:locked, linuxulator*:locks:futex_mtx:locked { ++check[probefunc]; @@ -69,9 +61,6 @@ linuxulator*:locks:futex_mtx:locked spec[probefunc] = speculation(); } -linuxulator*:locks:emul_lock:unlock, -linuxulator*:locks:emul_shared_rlock:unlock, -linuxulator*:locks:emul_shared_wlock:unlock, linuxulator*:locks:futex_mtx:unlock /check[probefunc] == 0/ { @@ -82,9 +71,6 @@ linuxulator*:locks:futex_mtx:unlock stack(); } -linuxulator*:locks:emul_lock:unlock, -linuxulator*:locks:emul_shared_rlock:unlock, -linuxulator*:locks:emul_shared_wlock:unlock, linuxulator*:locks:futex_mtx:unlock { discard(spec[probefunc]); @@ -95,27 +81,6 @@ linuxulator*:locks:futex_mtx:unlock /* Timeout handling */ tick-10s -/spec["emul_lock"] != 0 && timestamp - ts["emul_lock"] >= 9999999000/ -{ - commit(spec["emul_lock"]); - spec["emul_lock"] = 0; -} - -tick-10s -/spec["emul_shared_wlock"] != 0 && timestamp - ts["emul_shared_wlock"] >= 9999999000/ -{ - commit(spec["emul_shared_wlock"]); - spec["emul_shared_wlock"] = 0; -} - -tick-10s -/spec["emul_shared_rlock"] != 0 && timestamp - ts["emul_shared_rlock"] >= 9999999000/ -{ - commit(spec["emul_shared_rlock"]); - spec["emul_shared_rlock"] = 0; -} - -tick-10s /spec["futex_mtx"] != 0 && timestamp - ts["futex_mtx"] >= 9999999000/ { commit(spec["futex_mtx"]); Modified: stable/10/sys/compat/linux/linux_emul.c ============================================================================== --- stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 15:12:31 2016 (r293492) +++ stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 15:16:13 2016 (r293493) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2006 Roman Divacky + * Copyright (c) 2013 Dmitry Chagin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -59,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /** * Special DTrace provider for the linuxulator. @@ -74,33 +77,21 @@ __FBSDID("$FreeBSD$"); LIN_SDT_PROVIDER_DEFINE(LINUX_DTRACE); /** - * Special DTrace module "locks", it covers some linuxulator internal - * locks. - */ -LIN_SDT_PROBE_DEFINE1(locks, emul_lock, locked, "struct mtx *"); -LIN_SDT_PROBE_DEFINE1(locks, emul_lock, unlock, "struct mtx *"); -LIN_SDT_PROBE_DEFINE1(locks, emul_shared_rlock, locked, "struct sx *"); -LIN_SDT_PROBE_DEFINE1(locks, emul_shared_rlock, unlock, "struct sx *"); -LIN_SDT_PROBE_DEFINE1(locks, emul_shared_wlock, locked, "struct sx *"); -LIN_SDT_PROBE_DEFINE1(locks, emul_shared_wlock, unlock, "struct sx *"); - -/** * DTrace probes in this module. */ -LIN_SDT_PROBE_DEFINE2(emul, em_find, entry, "struct proc *", "int"); +LIN_SDT_PROBE_DEFINE1(emul, em_find, entry, "struct thread *"); LIN_SDT_PROBE_DEFINE0(emul, em_find, return); -LIN_SDT_PROBE_DEFINE3(emul, proc_init, entry, "struct thread *", "pid_t", - "int"); +LIN_SDT_PROBE_DEFINE3(emul, proc_init, entry, "struct thread *", + "struct thread *", "int"); LIN_SDT_PROBE_DEFINE0(emul, proc_init, create_thread); LIN_SDT_PROBE_DEFINE0(emul, proc_init, fork); LIN_SDT_PROBE_DEFINE0(emul, proc_init, exec); LIN_SDT_PROBE_DEFINE0(emul, proc_init, return); LIN_SDT_PROBE_DEFINE1(emul, proc_exit, entry, "struct proc *"); -LIN_SDT_PROBE_DEFINE0(emul, proc_exit, futex_failed); -LIN_SDT_PROBE_DEFINE3(emul, proc_exit, reparent, "pid_t", "pid_t", - "struct proc *"); -LIN_SDT_PROBE_DEFINE1(emul, proc_exit, child_clear_tid_error, "int"); -LIN_SDT_PROBE_DEFINE0(emul, proc_exit, return); +LIN_SDT_PROBE_DEFINE1(emul, linux_thread_detach, entry, "struct thread *"); +LIN_SDT_PROBE_DEFINE0(emul, linux_thread_detach, futex_failed); +LIN_SDT_PROBE_DEFINE1(emul, linux_thread_detach, child_clear_tid_error, "int"); +LIN_SDT_PROBE_DEFINE0(emul, linux_thread_detach, return); LIN_SDT_PROBE_DEFINE2(emul, proc_exec, entry, "struct proc *", "struct image_params *"); LIN_SDT_PROBE_DEFINE0(emul, proc_exec, return); @@ -109,284 +100,208 @@ LIN_SDT_PROBE_DEFINE1(emul, linux_schedt LIN_SDT_PROBE_DEFINE0(emul, linux_schedtail, return); LIN_SDT_PROBE_DEFINE1(emul, linux_set_tid_address, entry, "int *"); LIN_SDT_PROBE_DEFINE0(emul, linux_set_tid_address, return); -LIN_SDT_PROBE_DEFINE2(emul, linux_kill_threads, entry, "struct thread *", - "int"); -LIN_SDT_PROBE_DEFINE1(emul, linux_kill_threads, kill, "pid_t"); -LIN_SDT_PROBE_DEFINE0(emul, linux_kill_threads, return); - -struct sx emul_shared_lock; -struct mtx emul_lock; -/* this returns locked reference to the emuldata entry (if found) */ +/* + * This returns reference to the emuldata entry (if found) + * + * Hold PROC_LOCK when referencing emuldata from other threads. + */ struct linux_emuldata * -em_find(struct proc *p, int locked) +em_find(struct thread *td) { struct linux_emuldata *em; - LIN_SDT_PROBE2(emul, em_find, entry, p, locked); - - if (locked == EMUL_DOLOCK) - EMUL_LOCK(&emul_lock); + LIN_SDT_PROBE1(emul, em_find, entry, td); - em = p->p_emuldata; - - if (em == NULL && locked == EMUL_DOLOCK) - EMUL_UNLOCK(&emul_lock); + em = td->td_emuldata; LIN_SDT_PROBE1(emul, em_find, return, em); + return (em); } -int -linux_proc_init(struct thread *td, pid_t child, int flags) +void +linux_proc_init(struct thread *td, struct thread *newtd, int flags) { - struct linux_emuldata *em, *p_em; - struct proc *p; + struct linux_emuldata *em; - LIN_SDT_PROBE3(emul, proc_init, entry, td, child, flags); + LIN_SDT_PROBE3(emul, proc_init, entry, td, newtd, flags); - if (child != 0) { - /* fork or create a thread */ - em = malloc(sizeof *em, M_LINUX, M_WAITOK | M_ZERO); - em->pid = child; + if (newtd != NULL) { + /* non-exec call */ + em = malloc(sizeof(*em), M_TEMP, M_WAITOK | M_ZERO); em->pdeath_signal = 0; em->flags = 0; em->robust_futexes = NULL; if (flags & LINUX_CLONE_THREAD) { - /* handled later in the code */ LIN_SDT_PROBE0(emul, proc_init, create_thread); - } else { - struct linux_emuldata_shared *s; + em->em_tid = newtd->td_tid; + } else { LIN_SDT_PROBE0(emul, proc_init, fork); - s = malloc(sizeof *s, M_LINUX, M_WAITOK | M_ZERO); - s->refs = 1; - s->group_pid = child; - - LIST_INIT(&s->threads); - em->shared = s; + em->em_tid = newtd->td_proc->p_pid; } + newtd->td_emuldata = em; } else { /* exec */ LIN_SDT_PROBE0(emul, proc_init, exec); /* lookup the old one */ - em = em_find(td->td_proc, EMUL_DOLOCK); + em = em_find(td); KASSERT(em != NULL, ("proc_init: emuldata not found in exec case.\n")); + + em->em_tid = td->td_proc->p_pid; } em->child_clear_tid = NULL; em->child_set_tid = NULL; + LIN_SDT_PROBE0(emul, proc_init, return); +} + +void +linux_proc_exit(void *arg __unused, struct proc *p) +{ + struct thread *td = curthread; + + if (__predict_false(SV_CURPROC_ABI() != SV_ABI_LINUX)) { + LIN_SDT_PROBE1(emul, proc_exit, entry, p); + (p->p_sysent->sv_thread_detach)(td); + } +} + +int +linux_common_execve(struct thread *td, struct image_args *eargs) +{ + struct linux_emuldata *em; + struct proc *p; + int error; + + p = td->td_proc; + /* - * allocate the shared struct only in clone()/fork cases in the case - * of clone() td = calling proc and child = pid of the newly created - * proc + * Unlike FreeBSD abort all other threads before + * proceeding exec. */ - if (child != 0) { - if (flags & LINUX_CLONE_THREAD) { - /* lookup the parent */ - /* - * we dont have to lock the p_em because - * its waiting for us in linux_clone so - * there is no chance of it changing the - * p_em->shared address - */ - p_em = em_find(td->td_proc, EMUL_DONTLOCK); - KASSERT(p_em != NULL, ("proc_init: parent emuldata not found for CLONE_THREAD\n")); - em->shared = p_em->shared; - EMUL_SHARED_WLOCK(&emul_shared_lock); - em->shared->refs++; - EMUL_SHARED_WUNLOCK(&emul_shared_lock); - } else { - /* - * handled earlier to avoid malloc(M_WAITOK) with - * rwlock held - */ - } + PROC_LOCK(p); + /* See exit1() comments. */ + thread_suspend_check(0); + while (p->p_flag & P_HADTHREADS) { + if (!thread_single(p, SINGLE_EXIT)) + break; + thread_suspend_check(0); + } + PROC_UNLOCK(p); - EMUL_SHARED_WLOCK(&emul_shared_lock); - LIST_INSERT_HEAD(&em->shared->threads, em, threads); - EMUL_SHARED_WUNLOCK(&emul_shared_lock); - - p = pfind(child); - KASSERT(p != NULL, ("process not found in proc_init\n")); - p->p_emuldata = em; + error = kern_execve(td, eargs, NULL); + if (error != 0) + return (error); + + /* + * In a case of transition from Linux binary execing to + * FreeBSD binary we destroy linux emuldata thread entry. + */ + if (SV_CURPROC_ABI() != SV_ABI_LINUX) { + PROC_LOCK(p); + em = em_find(td); + KASSERT(em != NULL, ("proc_exec: emuldata not found.\n")); + td->td_emuldata = NULL; PROC_UNLOCK(p); - } else - EMUL_UNLOCK(&emul_lock); - LIN_SDT_PROBE0(emul, proc_init, return); + free(em, M_TEMP); + } return (0); } -void -linux_proc_exit(void *arg __unused, struct proc *p) +void +linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp) { - struct linux_emuldata *em; - int error, shared_flags, shared_xstat; - struct thread *td = FIRST_THREAD_IN_PROC(p); - int *child_clear_tid; - struct proc *q, *nq; - - if (__predict_true(p->p_sysent != &elf_linux_sysvec)) - return; + struct thread *td = curthread; - LIN_SDT_PROBE1(emul, proc_exit, entry, p); + /* + * In a case of execing to linux binary we create linux + * emuldata thread entry. + */ + if (__predict_false((imgp->sysent->sv_flags & SV_ABI_MASK) == + SV_ABI_LINUX)) { + LIN_SDT_PROBE2(emul, proc_exec, entry, p, imgp); + if (SV_PROC_ABI(p) == SV_ABI_LINUX) + linux_proc_init(td, NULL, 0); + else + linux_proc_init(td, td, 0); - release_futexes(p); + LIN_SDT_PROBE0(emul, proc_exec, return); + } +} - /* find the emuldata */ - em = em_find(p, EMUL_DOLOCK); +void +linux_thread_detach(struct thread *td) +{ + struct linux_sys_futex_args cup; + struct linux_emuldata *em; + int *child_clear_tid; + int null = 0; + int error; - KASSERT(em != NULL, ("proc_exit: emuldata not found.\n")); + LIN_SDT_PROBE1(emul, linux_thread_detach, entry, td); - /* reparent all procs that are not a thread leader to initproc */ - if (em->shared->group_pid != p->p_pid) { - LIN_SDT_PROBE3(emul, proc_exit, reparent, - em->shared->group_pid, p->p_pid, p); + em = em_find(td); + KASSERT(em != NULL, ("thread_detach: emuldata not found.\n")); - child_clear_tid = em->child_clear_tid; - EMUL_UNLOCK(&emul_lock); - sx_xlock(&proctree_lock); - wakeup(initproc); - PROC_LOCK(p); - proc_reparent(p, initproc); - p->p_sigparent = SIGCHLD; - PROC_UNLOCK(p); - sx_xunlock(&proctree_lock); - } else { - child_clear_tid = em->child_clear_tid; - EMUL_UNLOCK(&emul_lock); - } + LINUX_CTR1(exit, "thread detach(%d)", em->em_tid); - EMUL_SHARED_WLOCK(&emul_shared_lock); - shared_flags = em->shared->flags; - shared_xstat = em->shared->xstat; - LIST_REMOVE(em, threads); - - em->shared->refs--; - if (em->shared->refs == 0) { - EMUL_SHARED_WUNLOCK(&emul_shared_lock); - free(em->shared, M_LINUX); - } else - EMUL_SHARED_WUNLOCK(&emul_shared_lock); + release_futexes(td, em); - if ((shared_flags & EMUL_SHARED_HASXSTAT) != 0) - p->p_xstat = shared_xstat; + child_clear_tid = em->child_clear_tid; if (child_clear_tid != NULL) { - struct linux_sys_futex_args cup; - int null = 0; + LINUX_CTR2(exit, "thread detach(%d) %p", + em->em_tid, child_clear_tid); + error = copyout(&null, child_clear_tid, sizeof(null)); if (error) { - LIN_SDT_PROBE1(emul, proc_exit, + LIN_SDT_PROBE1(emul, linux_thread_detach, child_clear_tid_error, error); - free(em, M_LINUX); - - LIN_SDT_PROBE0(emul, proc_exit, return); + LIN_SDT_PROBE0(emul, linux_thread_detach, return); return; } - /* futexes stuff */ cup.uaddr = child_clear_tid; cup.op = LINUX_FUTEX_WAKE; cup.val = 0x7fffffff; /* Awake everyone */ cup.timeout = NULL; cup.uaddr2 = NULL; cup.val3 = 0; - error = linux_sys_futex(FIRST_THREAD_IN_PROC(p), &cup); + error = linux_sys_futex(td, &cup); /* * this cannot happen at the moment and if this happens it * probably means there is a user space bug */ if (error) { - LIN_SDT_PROBE0(emul, proc_exit, futex_failed); - printf(LMSG("futex stuff in proc_exit failed.\n")); - } - } - - /* clean the stuff up */ - free(em, M_LINUX); - - /* this is a little weird but rewritten from exit1() */ - sx_xlock(&proctree_lock); - q = LIST_FIRST(&p->p_children); - for (; q != NULL; q = nq) { - nq = LIST_NEXT(q, p_sibling); - if (q->p_flag & P_WEXIT) - continue; - if (__predict_false(q->p_sysent != &elf_linux_sysvec)) - continue; - em = em_find(q, EMUL_DOLOCK); - KASSERT(em != NULL, ("linux_reparent: emuldata not found: %i\n", q->p_pid)); - PROC_LOCK(q); - if ((q->p_flag & P_WEXIT) == 0 && em->pdeath_signal != 0) { - kern_psignal(q, em->pdeath_signal); + LIN_SDT_PROBE0(emul, linux_thread_detach, futex_failed); + printf(LMSG("futex stuff in thread_detach failed.\n")); } - PROC_UNLOCK(q); - EMUL_UNLOCK(&emul_lock); } - sx_xunlock(&proctree_lock); - LIN_SDT_PROBE0(emul, proc_exit, return); + LIN_SDT_PROBE0(emul, linux_thread_detach, return); } -/* - * This is used in a case of transition from FreeBSD binary execing to linux binary - * in this case we create linux emuldata proc entry with the pid of the currently running - * process. - */ -void -linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp) +void +linux_thread_dtor(void *arg __unused, struct thread *td) { - if (__predict_false(imgp->sysent == &elf_linux_sysvec)) { - LIN_SDT_PROBE2(emul, proc_exec, entry, p, imgp); - } - if (__predict_false(imgp->sysent == &elf_linux_sysvec - && p->p_sysent != &elf_linux_sysvec)) - linux_proc_init(FIRST_THREAD_IN_PROC(p), p->p_pid, 0); - if (__predict_false((p->p_sysent->sv_flags & SV_ABI_MASK) == - SV_ABI_LINUX)) - /* Kill threads regardless of imgp->sysent value */ - linux_kill_threads(FIRST_THREAD_IN_PROC(p), SIGKILL); - if (__predict_false(imgp->sysent != &elf_linux_sysvec - && p->p_sysent == &elf_linux_sysvec)) { - struct linux_emuldata *em; - - /* - * XXX:There's a race because here we assign p->p_emuldata NULL - * but the process is still counted as linux one for a short - * time so some other process might reference it and try to - * access its p->p_emuldata and panicing on a NULL reference. - */ - em = em_find(p, EMUL_DONTLOCK); - - KASSERT(em != NULL, ("proc_exec: emuldata not found.\n")); - - EMUL_SHARED_WLOCK(&emul_shared_lock); - LIST_REMOVE(em, threads); - - PROC_LOCK(p); - p->p_emuldata = NULL; - PROC_UNLOCK(p); + struct linux_emuldata *em; - em->shared->refs--; - if (em->shared->refs == 0) { - EMUL_SHARED_WUNLOCK(&emul_shared_lock); - free(em->shared, M_LINUX); - } else - EMUL_SHARED_WUNLOCK(&emul_shared_lock); + em = em_find(td); + if (em == NULL) + return; + td->td_emuldata = NULL; - free(em, M_LINUX); - } + LINUX_CTR1(exit, "thread dtor(%d)", em->em_tid); - if (__predict_false(imgp->sysent == &elf_linux_sysvec)) { - LIN_SDT_PROBE0(emul, proc_exec, return); - } + free(em, M_TEMP); } void @@ -397,30 +312,28 @@ linux_schedtail(struct thread *td) int error = 0; int *child_set_tid; - p = td->td_proc; - - LIN_SDT_PROBE1(emul, linux_schedtail, entry, p); + LIN_SDT_PROBE1(emul, linux_schedtail, entry, td); - /* find the emuldata */ - em = em_find(p, EMUL_DOLOCK); + p = td->td_proc; + em = em_find(td); KASSERT(em != NULL, ("linux_schedtail: emuldata not found.\n")); child_set_tid = em->child_set_tid; - EMUL_UNLOCK(&emul_lock); if (child_set_tid != NULL) { - error = copyout(&p->p_pid, (int *)child_set_tid, - sizeof(p->p_pid)); + error = copyout(&em->em_tid, (int *)child_set_tid, + sizeof(em->em_tid)); + LINUX_CTR4(clone, "schedtail(%d) %p stored %d error %d", + td->td_tid, child_set_tid, em->em_tid, error); if (error != 0) { LIN_SDT_PROBE1(emul, linux_schedtail, copyout_error, error); } - } + } else + LINUX_CTR1(clone, "schedtail(%d)", em->em_tid); LIN_SDT_PROBE0(emul, linux_schedtail, return); - - return; } int @@ -430,45 +343,16 @@ linux_set_tid_address(struct thread *td, LIN_SDT_PROBE1(emul, linux_set_tid_address, entry, args->tidptr); - /* find the emuldata */ - em = em_find(td->td_proc, EMUL_DOLOCK); - + em = em_find(td); KASSERT(em != NULL, ("set_tid_address: emuldata not found.\n")); em->child_clear_tid = args->tidptr; - td->td_retval[0] = td->td_proc->p_pid; - EMUL_UNLOCK(&emul_lock); + td->td_retval[0] = em->em_tid; - LIN_SDT_PROBE0(emul, linux_set_tid_address, return); - return 0; -} - -void -linux_kill_threads(struct thread *td, int sig) -{ - struct linux_emuldata *em, *td_em, *tmp_em; - struct proc *sp; - - LIN_SDT_PROBE2(emul, linux_kill_threads, entry, td, sig); - - td_em = em_find(td->td_proc, EMUL_DONTLOCK); + LINUX_CTR3(set_tid_address, "tidptr(%d) %p, returns %d", + em->em_tid, args->tidptr, td->td_retval[0]); - KASSERT(td_em != NULL, ("linux_kill_threads: emuldata not found.\n")); - - EMUL_SHARED_RLOCK(&emul_shared_lock); - LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { - if (em->pid == td_em->pid) - continue; - - sp = pfind(em->pid); - if ((sp->p_flag & P_WEXIT) == 0) - kern_psignal(sp, sig); - PROC_UNLOCK(sp); - - LIN_SDT_PROBE1(emul, linux_kill_threads, kill, em->pid); - } - EMUL_SHARED_RUNLOCK(&emul_shared_lock); - - LIN_SDT_PROBE0(emul, linux_kill_threads, return); + LIN_SDT_PROBE0(emul, linux_set_tid_address, return); + return (0); } Modified: stable/10/sys/compat/linux/linux_emul.h ============================================================================== --- stable/10/sys/compat/linux/linux_emul.h Sat Jan 9 15:12:31 2016 (r293492) +++ stable/10/sys/compat/linux/linux_emul.h Sat Jan 9 15:16:13 2016 (r293493) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2006 Roman Divacky + * Copyright (c) 2013 Dmitry Chagin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,91 +32,33 @@ #ifndef _LINUX_EMUL_H_ #define _LINUX_EMUL_H_ -#define EMUL_SHARED_HASXSTAT 0x01 - -struct linux_emuldata_shared { - int refs; - int flags; - int xstat; - pid_t group_pid; - - LIST_HEAD(, linux_emuldata) threads; /* head of list of linux threads */ -}; - /* * modeled after similar structure in NetBSD * this will be extended as we need more functionality */ struct linux_emuldata { - pid_t pid; - int *child_set_tid; /* in clone(): Child's TID to set on clone */ int *child_clear_tid;/* in clone(): Child's TID to clear on exit */ - struct linux_emuldata_shared *shared; - int pdeath_signal; /* parent death signal */ int flags; /* different emuldata flags */ + int em_tid; /* thread id */ struct linux_robust_list_head *robust_futexes; - - LIST_ENTRY(linux_emuldata) threads; /* list of linux threads */ }; -struct linux_emuldata *em_find(struct proc *, int locked); - -/* - * DTrace probes for locks should be fired after locking and before releasing - * to prevent races (to provide data/function stability in dtrace, see the - * output of "dtrace -v ..." and the corresponding dtrace docs). - */ -#define EMUL_LOCK(l) do { \ - mtx_lock(l); \ - LIN_SDT_PROBE1(locks, emul_lock, \ - locked, l); \ - } while (0) -#define EMUL_UNLOCK(l) do { \ - LIN_SDT_PROBE1(locks, emul_lock, \ - unlock, l); \ - mtx_unlock(l); \ - } while (0) - -#define EMUL_SHARED_RLOCK(l) do { \ - sx_slock(l); \ - LIN_SDT_PROBE1(locks, emul_shared_rlock, \ - locked, l); \ - } while (0) -#define EMUL_SHARED_RUNLOCK(l) do { \ - LIN_SDT_PROBE1(locks, emul_shared_rlock, \ - unlock, l); \ - sx_sunlock(l); \ - } while (0) -#define EMUL_SHARED_WLOCK(l) do { \ - sx_xlock(l); \ - LIN_SDT_PROBE1(locks, emul_shared_wlock, \ - locked, l); \ - } while (0) -#define EMUL_SHARED_WUNLOCK(l) do { \ - LIN_SDT_PROBE1(locks, emul_shared_wlock, \ - unlock, l); \ - sx_xunlock(l); \ - } while (0) - -/* for em_find use */ -#define EMUL_DOLOCK 1 -#define EMUL_DONTLOCK 0 +struct linux_emuldata *em_find(struct thread *); /* emuldata flags */ #define LINUX_XDEPR_REQUEUEOP 0x00000001 /* uses deprecated futex REQUEUE op*/ -int linux_proc_init(struct thread *, pid_t, int); +void linux_proc_init(struct thread *, struct thread *, int); void linux_proc_exit(void *, struct proc *); void linux_schedtail(struct thread *); void linux_proc_exec(void *, struct proc *, struct image_params *); -void linux_kill_threads(struct thread *, int); - -extern struct sx emul_shared_lock; -extern struct mtx emul_lock; +void linux_thread_dtor(void *arg __unused, struct thread *); +void linux_thread_detach(struct thread *); +int linux_common_execve(struct thread *, struct image_args *); #endif /* !_LINUX_EMUL_H_ */ Modified: stable/10/sys/compat/linux/linux_fork.c ============================================================================== --- stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 15:12:31 2016 (r293492) +++ stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 15:16:13 2016 (r293493) @@ -35,15 +35,21 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include -#include +#include #include #include #include +#include +#include +#include + #ifdef COMPAT_LINUX32 #include #include @@ -51,18 +57,10 @@ __FBSDID("$FreeBSD$"); #include #include #endif -#include #include #include #include - -/* DTrace init */ -LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); - -/* Linuxulator-global DTrace probes */ -LIN_SDT_PROBE_DECLARE(locks, emul_lock, locked); -LIN_SDT_PROBE_DECLARE(locks, emul_lock, unlock); - +#include int linux_fork(struct thread *td, struct linux_fork_args *args) @@ -80,14 +78,11 @@ linux_fork(struct thread *td, struct lin != 0) return (error); - td->td_retval[0] = p2->p_pid; - td->td_retval[1] = 0; + td2 = FIRST_THREAD_IN_PROC(p2); - error = linux_proc_init(td, td->td_retval[0], 0); - if (error) - return (error); + linux_proc_init(td, td2, 0); - td2 = FIRST_THREAD_IN_PROC(p2); + td->td_retval[0] = p2->p_pid; /* * Make this runnable after we are finished with it. @@ -117,17 +112,16 @@ linux_vfork(struct thread *td, struct li NULL, 0)) != 0) return (error); - td->td_retval[0] = p2->p_pid; - error = linux_proc_init(td, td->td_retval[0], 0); - if (error) - return (error); + td2 = FIRST_THREAD_IN_PROC(p2); + + linux_proc_init(td, td2, 0); PROC_LOCK(p2); p2->p_flag |= P_PPWAIT; PROC_UNLOCK(p2); - td2 = FIRST_THREAD_IN_PROC(p2); + td->td_retval[0] = p2->p_pid; /* * Make this runnable after we are finished with it. @@ -146,8 +140,8 @@ linux_vfork(struct thread *td, struct li return (0); } -int -linux_clone(struct thread *td, struct linux_clone_args *args) +static int +linux_clone_proc(struct thread *td, struct linux_clone_args *args) { int error, ff = RFPROC | RFSTOPPED; struct proc *p2; @@ -184,22 +178,6 @@ linux_clone(struct thread *td, struct li if (!(args->flags & (LINUX_CLONE_FILES | LINUX_CLONE_FS))) ff |= RFFDG; - /* - * Attempt to detect when linux_clone(2) is used for creating - * kernel threads. Unfortunately despite the existence of the - * CLONE_THREAD flag, version of linuxthreads package used in - * most popular distros as of beginning of 2005 doesn't make - * any use of it. Therefore, this detection relies on - * empirical observation that linuxthreads sets certain - * combination of flags, so that we can make more or less - * precise detection and notify the FreeBSD kernel that several - * processes are in fact part of the same threading group, so - * that special treatment is necessary for signal delivery - * between those processes and fd locking. - */ - if ((args->flags & 0xffffff00) == LINUX_THREADING_FLAGS) - ff |= RFTHREAD; - if (args->flags & LINUX_CLONE_PARENT_SETTID) if (args->parent_tidptr == NULL) return (EINVAL); @@ -208,29 +186,13 @@ linux_clone(struct thread *td, struct li if (error) return (error); - if (args->flags & (LINUX_CLONE_PARENT | LINUX_CLONE_THREAD)) { - sx_xlock(&proctree_lock); - PROC_LOCK(p2); - proc_reparent(p2, td->td_proc->p_pptr); - PROC_UNLOCK(p2); - sx_xunlock(&proctree_lock); - } + td2 = FIRST_THREAD_IN_PROC(p2); /* create the emuldata */ - error = linux_proc_init(td, p2->p_pid, args->flags); - /* reference it - no need to check this */ - em = em_find(p2, EMUL_DOLOCK); - KASSERT(em != NULL, ("clone: emuldata not found.")); - /* and adjust it */ + linux_proc_init(td, td2, args->flags); - if (args->flags & LINUX_CLONE_THREAD) { -#ifdef notyet - PROC_LOCK(p2); - p2->p_pgrp = td->td_proc->p_pgrp; - PROC_UNLOCK(p2); -#endif - exit_signal = 0; - } + em = em_find(td2); + KASSERT(em != NULL, ("clone_proc: emuldata not found.\n")); if (args->flags & LINUX_CLONE_CHILD_SETTID) em->child_set_tid = args->child_tidptr; @@ -242,8 +204,6 @@ linux_clone(struct thread *td, struct li else em->child_clear_tid = NULL; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:17:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3ACB3A68512; Sat, 9 Jan 2016 15:17:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CE5D1AF3; Sat, 9 Jan 2016 15:17:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FHZ9F015120; Sat, 9 Jan 2016 15:17:35 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FHZxk015119; Sat, 9 Jan 2016 15:17:35 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091517.u09FHZxk015119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293494 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:17:36 -0000 Author: dchagin Date: Sat Jan 9 15:17:34 2016 New Revision: 293494 URL: https://svnweb.freebsd.org/changeset/base/293494 Log: MFC r283384: pthread_join() caller do futex_wait on child_clear_tid. As a results of multiple simultaneous calls to pthread_join() specifying the same target thread are undefined wake up the one thread. Modified: stable/10/sys/compat/linux/linux_emul.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_emul.c ============================================================================== --- stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 15:16:13 2016 (r293493) +++ stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 15:17:34 2016 (r293494) @@ -271,7 +271,7 @@ linux_thread_detach(struct thread *td) cup.uaddr = child_clear_tid; cup.op = LINUX_FUTEX_WAKE; - cup.val = 0x7fffffff; /* Awake everyone */ + cup.val = 1; /* wake one */ cup.timeout = NULL; cup.uaddr2 = NULL; cup.val3 = 0; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:18:38 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3A5EA68591; Sat, 9 Jan 2016 15:18:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF9E41C8D; Sat, 9 Jan 2016 15:18:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FIa1k015216; Sat, 9 Jan 2016 15:18:36 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FIaeH015214; Sat, 9 Jan 2016 15:18:36 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091518.u09FIaeH015214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293495 - in stable/10/sys: amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:18:38 -0000 Author: dchagin Date: Sat Jan 9 15:18:36 2016 New Revision: 293495 URL: https://svnweb.freebsd.org/changeset/base/293495 Log: MFC r283385: Some style(9) && whitespaces fixes. No functional changes. Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/i386/linux/linux_sysvec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 15:17:34 2016 (r293494) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 15:18:36 2016 (r293495) @@ -294,7 +294,7 @@ elf_linux_fixup(register_t **stack_base, base--; suword32(base, (uint32_t)imgp->args->argc); *stack_base = (register_t *)base; - return 0; + return (0); } extern unsigned long linux_sznonrtsigcode; @@ -1171,9 +1171,9 @@ linux_elf_modevent(module_t mod, int typ printf("Could not deinstall ELF interpreter entry\n"); break; default: - return EOPNOTSUPP; + return (EOPNOTSUPP); } - return error; + return (error); } static moduledata_t linux_elf_mod = { Modified: stable/10/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysvec.c Sat Jan 9 15:17:34 2016 (r293494) +++ stable/10/sys/i386/linux/linux_sysvec.c Sat Jan 9 15:18:36 2016 (r293495) @@ -209,15 +209,15 @@ static int translate_traps(int signal, int trap_code) { if (signal != SIGBUS) - return signal; + return (signal); switch (trap_code) { case T_PROTFLT: case T_TSSFLT: case T_DOUBLEFLT: case T_PAGEFLT: - return SIGSEGV; + return (SIGSEGV); default: - return signal; + return (signal); } } @@ -685,7 +685,7 @@ linux_sigreturn(struct thread *td, struc #define EFLAGS_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) eflags = frame.sf_sc.sc_eflags; if (!EFLAGS_SECURE(eflags, regs->tf_eflags)) - return(EINVAL); + return (EINVAL); /* * Don't allow users to load a valid privileged %cs. Let the @@ -700,7 +700,7 @@ linux_sigreturn(struct thread *td, struc ksi.ksi_trapno = T_PROTFLT; ksi.ksi_addr = (void *)regs->tf_eip; trapsignal(td, &ksi); - return(EINVAL); + return (EINVAL); } lmask.__bits[0] = frame.sf_sc.sc_mask; @@ -776,7 +776,7 @@ linux_rt_sigreturn(struct thread *td, st #define EFLAGS_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) eflags = context->sc_eflags; if (!EFLAGS_SECURE(eflags, regs->tf_eflags)) - return(EINVAL); + return (EINVAL); /* * Don't allow users to load a valid privileged %cs. Let the @@ -791,7 +791,7 @@ linux_rt_sigreturn(struct thread *td, st ksi.ksi_trapno = T_PROTFLT; ksi.ksi_addr = (void *)regs->tf_eip; trapsignal(td, &ksi); - return(EINVAL); + return (EINVAL); } linux_to_bsd_sigset(&uc.uc_sigmask, &bmask); @@ -1147,9 +1147,9 @@ linux_elf_modevent(module_t mod, int typ printf("Could not deinstall ELF interpreter entry\n"); break; default: - return EOPNOTSUPP; + return (EOPNOTSUPP); } - return error; + return (error); } static moduledata_t linux_elf_mod = { From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:19:44 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84FDAA68603; Sat, 9 Jan 2016 15:19:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E0B01DF4; Sat, 9 Jan 2016 15:19:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FJhms015308; Sat, 9 Jan 2016 15:19:43 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FJhMt015306; Sat, 9 Jan 2016 15:19:43 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091519.u09FJhMt015306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293496 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:19:44 -0000 Author: dchagin Date: Sat Jan 9 15:19:43 2016 New Revision: 293496 URL: https://svnweb.freebsd.org/changeset/base/293496 Log: MFC r283386: Introduce LINUX_VERSION_STR, LINUX_VERSION_CODE macro for use instead of harcoded pr_osrelease, pr_osrel values. This will be used later in the VDSO. Modified: stable/10/sys/compat/linux/linux_mib.c stable/10/sys/compat/linux/linux_mib.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_mib.c ============================================================================== --- stable/10/sys/compat/linux/linux_mib.c Sat Jan 9 15:18:36 2016 (r293495) +++ stable/10/sys/compat/linux/linux_mib.c Sat Jan 9 15:19:43 2016 (r293496) @@ -130,9 +130,9 @@ struct linux_prison { static struct linux_prison lprison0 = { .pr_osname = "Linux", - .pr_osrelease = "2.6.18", + .pr_osrelease = LINUX_VERSION_STR, .pr_oss_version = 0x030600, - .pr_osrel = 2006018 + .pr_osrel = LINUX_VERSION_CODE }; static unsigned linux_osd_jail_slot; Modified: stable/10/sys/compat/linux/linux_mib.h ============================================================================== --- stable/10/sys/compat/linux/linux_mib.h Sat Jan 9 15:18:36 2016 (r293495) +++ stable/10/sys/compat/linux/linux_mib.h Sat Jan 9 15:19:43 2016 (r293496) @@ -42,8 +42,19 @@ int linux_get_oss_version(struct thread int linux_kernver(struct thread *td); -#define LINUX_KERNVER_2004000 2004000 -#define LINUX_KERNVER_2006000 2006000 +#define LINUX_KVERSION 2 +#define LINUX_KPATCHLEVEL 6 +#define LINUX_KSUBLEVEL 18 + +#define LINUX_KERNVER(a,b,c) (((a) << 16) + ((b) << 8) + (c)) +#define LINUX_VERSION_CODE LINUX_KERNVER(LINUX_KVERSION, \ + LINUX_KPATCHLEVEL, LINUX_KSUBLEVEL) +#define LINUX_KERNVERSTR(x) #x +#define LINUX_XKERNVERSTR(x) LINUX_KERNVERSTR(x) +#define LINUX_VERSION_STR LINUX_XKERNVERSTR(LINUX_KVERSION.LINUX_KPATCHLEVEL.LINUX_KSUBLEVEL) + +#define LINUX_KERNVER_2004000 LINUX_KERNVER(2,4,0) +#define LINUX_KERNVER_2006000 LINUX_KERNVER(2,6,0) #define linux_use26(t) (linux_kernver(t) >= LINUX_KERNVER_2006000) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:20:49 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF2C2A687CA; Sat, 9 Jan 2016 15:20:49 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FCC41F8F; Sat, 9 Jan 2016 15:20:49 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FKm0x015422; Sat, 9 Jan 2016 15:20:48 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FKmF9015421; Sat, 9 Jan 2016 15:20:48 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091520.u09FKmF9015421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293497 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:20:49 -0000 Author: dchagin Date: Sat Jan 9 15:20:48 2016 New Revision: 293497 URL: https://svnweb.freebsd.org/changeset/base/293497 Log: MFC r283388: Remove a now unused define. Modified: stable/10/sys/compat/linux/linux_misc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_misc.h ============================================================================== --- stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 15:19:43 2016 (r293496) +++ stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 15:20:48 2016 (r293497) @@ -88,10 +88,6 @@ extern const char *linux_platform; #define LINUX_CLONE_CHILD_CLEARTID 0x00200000 #define LINUX_CLONE_CHILD_SETTID 0x01000000 -#define LINUX_THREADING_FLAGS \ - (LINUX_CLONE_VM | LINUX_CLONE_FS | LINUX_CLONE_FILES | \ - LINUX_CLONE_SIGHAND | LINUX_CLONE_THREAD) - /* Scheduling policies */ #define LINUX_SCHED_OTHER 0 #define LINUX_SCHED_FIFO 1 From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:21:47 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F7A1A6888D; Sat, 9 Jan 2016 15:21:47 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A19712D6; Sat, 9 Jan 2016 15:21:47 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FLkC1017334; Sat, 9 Jan 2016 15:21:46 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FLkUT017332; Sat, 9 Jan 2016 15:21:46 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091521.u09FLkUT017332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293498 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:21:47 -0000 Author: dchagin Date: Sat Jan 9 15:21:45 2016 New Revision: 293498 URL: https://svnweb.freebsd.org/changeset/base/293498 Log: MFC r283389: Add a siginfo_t conversion function. Modified: stable/10/sys/compat/linux/linux_signal.c stable/10/sys/compat/linux/linux_signal.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_signal.c ============================================================================== --- stable/10/sys/compat/linux/linux_signal.c Sat Jan 9 15:20:48 2016 (r293497) +++ stable/10/sys/compat/linux/linux_signal.c Sat Jan 9 15:21:45 2016 (r293498) @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); static int linux_do_tkill(struct thread *td, struct thread *tdt, ksiginfo_t *ksi); +static void sicode_to_lsicode(int si_code, int *lsi_code); + void linux_to_bsd_sigset(l_sigset_t *lss, sigset_t *bss) @@ -595,7 +597,7 @@ linux_tgkill(struct thread *td, struct l ksiginfo_init(&ksi); ksi.ksi_signo = sig; - ksi.ksi_code = LINUX_SI_TKILL; + ksi.ksi_code = SI_LWP; ksi.ksi_errno = 0; ksi.ksi_pid = td->td_proc->p_pid; ksi.ksi_uid = td->td_proc->p_ucred->cr_ruid; @@ -633,7 +635,7 @@ linux_tkill(struct thread *td, struct li ksiginfo_init(&ksi); ksi.ksi_signo = sig; - ksi.ksi_code = LINUX_SI_TKILL; + ksi.ksi_code = SI_LWP; ksi.ksi_errno = 0; ksi.ksi_pid = td->td_proc->p_pid; ksi.ksi_uid = td->td_proc->p_ucred->cr_ruid; @@ -641,36 +643,111 @@ linux_tkill(struct thread *td, struct li } void -ksiginfo_to_lsiginfo(ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig) +ksiginfo_to_lsiginfo(const ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig) { - lsi->lsi_signo = sig; - lsi->lsi_code = ksi->ksi_code; + siginfo_to_lsiginfo(&ksi->ksi_info, lsi, sig); +} + +static void +sicode_to_lsicode(int si_code, int *lsi_code) +{ - switch (sig) { - case LINUX_SIGPOLL: - /* XXX si_fd? */ - lsi->lsi_band = ksi->ksi_band; - break; - case LINUX_SIGCHLD: - lsi->lsi_pid = ksi->ksi_pid; - lsi->lsi_uid = ksi->ksi_uid; - lsi->lsi_status = ksi->ksi_status; - break; - case LINUX_SIGBUS: - case LINUX_SIGILL: - case LINUX_SIGFPE: - case LINUX_SIGSEGV: - lsi->lsi_addr = PTROUT(ksi->ksi_addr); + switch (si_code) { + case SI_USER: + *lsi_code = LINUX_SI_USER; + break; + case SI_KERNEL: + *lsi_code = LINUX_SI_KERNEL; + break; + case SI_QUEUE: + *lsi_code = LINUX_SI_QUEUE; + break; + case SI_TIMER: + *lsi_code = LINUX_SI_TIMER; + break; + case SI_MESGQ: + *lsi_code = LINUX_SI_MESGQ; + break; + case SI_ASYNCIO: + *lsi_code = LINUX_SI_ASYNCIO; + break; + case SI_LWP: + *lsi_code = LINUX_SI_TKILL; break; default: - /* XXX SI_TIMER etc... */ - lsi->lsi_pid = ksi->ksi_pid; - lsi->lsi_uid = ksi->ksi_uid; + *lsi_code = si_code; break; } - if (sig >= LINUX_SIGRTMIN) { - lsi->lsi_int = ksi->ksi_info.si_value.sival_int; - lsi->lsi_ptr = PTROUT(ksi->ksi_info.si_value.sival_ptr); +} + +void +siginfo_to_lsiginfo(const siginfo_t *si, l_siginfo_t *lsi, l_int sig) +{ + + /* sig alredy converted */ + lsi->lsi_signo = sig; + sicode_to_lsicode(si->si_code, &lsi->lsi_code); + + switch (si->si_code) { + case SI_LWP: + lsi->lsi_pid = si->si_pid; + lsi->lsi_uid = si->si_uid; + break; + + case SI_TIMER: + lsi->lsi_int = si->si_value.sival_int; + lsi->lsi_ptr = PTROUT(si->si_value.sival_ptr); + lsi->lsi_tid = si->si_timerid; + break; + + case SI_QUEUE: + lsi->lsi_pid = si->si_pid; + lsi->lsi_uid = si->si_uid; + lsi->lsi_ptr = PTROUT(si->si_value.sival_ptr); + break; + + case SI_ASYNCIO: + lsi->lsi_int = si->si_value.sival_int; + lsi->lsi_ptr = PTROUT(si->si_value.sival_ptr); + break; + + default: + switch (sig) { + case LINUX_SIGPOLL: + /* XXX si_fd? */ + lsi->lsi_band = si->si_band; + break; + + case LINUX_SIGCHLD: + lsi->lsi_errno = 0; + lsi->lsi_pid = si->si_pid; + lsi->lsi_uid = si->si_uid; + + if (si->si_code == CLD_STOPPED) + lsi->lsi_status = BSD_TO_LINUX_SIGNAL(si->si_status); + else if (si->si_code == CLD_CONTINUED) + lsi->lsi_status = BSD_TO_LINUX_SIGNAL(SIGCONT); + else + lsi->lsi_status = si->si_status; + break; + + case LINUX_SIGBUS: + case LINUX_SIGILL: + case LINUX_SIGFPE: + case LINUX_SIGSEGV: + lsi->lsi_addr = PTROUT(si->si_addr); + break; + + default: + lsi->lsi_pid = si->si_pid; + lsi->lsi_uid = si->si_uid; + if (sig >= LINUX_SIGRTMIN) { + lsi->lsi_int = si->si_value.sival_int; + lsi->lsi_ptr = PTROUT(si->si_value.sival_ptr); + } + break; + } + break; } } Modified: stable/10/sys/compat/linux/linux_signal.h ============================================================================== --- stable/10/sys/compat/linux/linux_signal.h Sat Jan 9 15:20:48 2016 (r293497) +++ stable/10/sys/compat/linux/linux_signal.h Sat Jan 9 15:21:45 2016 (r293498) @@ -31,7 +31,17 @@ #ifndef _LINUX_SIGNAL_H_ #define _LINUX_SIGNAL_H_ -#define LINUX_SI_TKILL -6; +/* + * si_code values + */ +#define LINUX_SI_USER 0 /* sent by kill, sigsend, raise */ +#define LINUX_SI_KERNEL 0x80 /* sent by the kernel from somewhere */ +#define LINUX_SI_QUEUE -1 /* sent by sigqueue */ +#define LINUX_SI_TIMER -2 /* sent by timer expiration */ +#define LINUX_SI_MESGQ -3 /* sent by real time mesq state change */ +#define LINUX_SI_ASYNCIO -4 /* sent by AIO completion */ +#define LINUX_SI_SIGIO -5 /* sent by queued SIGIO */ +#define LINUX_SI_TKILL -6 /* sent by tkill system call */ extern int bsd_to_linux_signal[]; extern int linux_to_bsd_signal[]; @@ -39,7 +49,8 @@ extern int linux_to_bsd_signal[]; void linux_to_bsd_sigset(l_sigset_t *, sigset_t *); void bsd_to_linux_sigset(sigset_t *, l_sigset_t *); int linux_do_sigaction(struct thread *, int, l_sigaction_t *, l_sigaction_t *); -void ksiginfo_to_lsiginfo(ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig); +void ksiginfo_to_lsiginfo(const ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig); +void siginfo_to_lsiginfo(const siginfo_t *si, l_siginfo_t *lsi, l_int sig); #define LINUX_SIG_VALID(sig) ((sig) <= LINUX_NSIG && (sig) > 0) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:22:51 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F186BA689D9; Sat, 9 Jan 2016 15:22:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6795159D; Sat, 9 Jan 2016 15:22:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FMoPt018057; Sat, 9 Jan 2016 15:22:50 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FMol4018055; Sat, 9 Jan 2016 15:22:50 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091522.u09FMol4018055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293499 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:22:52 -0000 Author: dchagin Date: Sat Jan 9 15:22:50 2016 New Revision: 293499 URL: https://svnweb.freebsd.org/changeset/base/293499 Log: MFC r283390: Add a function for converting wait options. Modified: stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/linux/linux_misc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:21:45 2016 (r293498) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:22:50 2016 (r293499) @@ -2006,3 +2006,22 @@ linux_tdfind(struct thread *td, lwpid_t return (tdt); } + +void +linux_to_bsd_waitopts(int options, int *bsdopts) +{ + + if (options & LINUX_WNOHANG) + *bsdopts |= WNOHANG; + if (options & LINUX_WUNTRACED) + *bsdopts |= WUNTRACED; + if (options & LINUX_WEXITED) + *bsdopts |= WEXITED; + if (options & LINUX_WCONTINUED) + *bsdopts |= WCONTINUED; + if (options & LINUX_WNOWAIT) + *bsdopts |= WNOWAIT; + + if (options & __WCLONE) + *bsdopts |= WLINUXCLONE; +} Modified: stable/10/sys/compat/linux/linux_misc.h ============================================================================== --- stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 15:21:45 2016 (r293498) +++ stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 15:22:50 2016 (r293499) @@ -111,10 +111,21 @@ struct l_new_utsname { extern int stclohz; -#define __WCLONE 0x80000000 +#define LINUX_WNOHANG 0x00000001 +#define LINUX_WUNTRACED 0x00000002 +#define LINUX_WSTOPPED LINUX_WUNTRACED +#define LINUX_WEXITED 0x00000004 +#define LINUX_WCONTINUED 0x00000008 +#define LINUX_WNOWAIT 0x01000000 + + +#define __WNOTHREAD 0x20000000 +#define __WALL 0x40000000 +#define __WCLONE 0x80000000 int linux_common_wait(struct thread *td, int pid, int *status, int options, struct rusage *ru); +void linux_to_bsd_waitopts(int options, int *bsdopts); int linux_set_upcall_kse(struct thread *td, register_t stack); int linux_set_cloned_tls(struct thread *td, void *desc); struct thread *linux_tdfind(struct thread *, lwpid_t, pid_t); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:23:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 378A8A68A91; Sat, 9 Jan 2016 15:23:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12BB117EA; Sat, 9 Jan 2016 15:23:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FNtiJ018160; Sat, 9 Jan 2016 15:23:55 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FNsoH018153; Sat, 9 Jan 2016 15:23:54 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091523.u09FNsoH018153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293500 - in stable/10/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:23:56 -0000 Author: dchagin Date: Sat Jan 9 15:23:54 2016 New Revision: 293500 URL: https://svnweb.freebsd.org/changeset/base/293500 Log: MFC r283391: To reduce code duplication introduce linux_copyout_rusage() method. Use it in linux_wait4() system call and move linux_wait4() to the MI path. While here add a prototype for the static bsd_to_linux_rusage(). Modified: stable/10/sys/amd64/linux32/linux.h stable/10/sys/amd64/linux32/linux32_genassym.c stable/10/sys/amd64/linux32/linux32_machdep.c stable/10/sys/compat/linux/linux_misc.c stable/10/sys/i386/linux/linux.h stable/10/sys/i386/linux/linux_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux.h ============================================================================== --- stable/10/sys/amd64/linux32/linux.h Sat Jan 9 15:22:50 2016 (r293499) +++ stable/10/sys/amd64/linux32/linux.h Sat Jan 9 15:23:54 2016 (r293500) @@ -780,6 +780,7 @@ struct l_iovec32 { int linux32_copyiniov(struct l_iovec32 *iovp32, l_ulong iovcnt, struct iovec **iovp, int error); +int linux_copyout_rusage(struct rusage *ru, void *uaddr); /* robust futexes */ struct linux_robust_list { Modified: stable/10/sys/amd64/linux32/linux32_genassym.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_genassym.c Sat Jan 9 15:22:50 2016 (r293499) +++ stable/10/sys/amd64/linux32/linux32_genassym.c Sat Jan 9 15:23:54 2016 (r293500) @@ -3,6 +3,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: stable/10/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 15:22:50 2016 (r293499) +++ stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 15:23:54 2016 (r293500) @@ -72,6 +72,8 @@ __FBSDID("$FreeBSD$"); #include #include +static void bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru); + struct l_old_select_argv { l_int nfds; l_uintptr_t readfds; @@ -133,6 +135,16 @@ bsd_to_linux_rusage(struct rusage *ru, s } int +linux_copyout_rusage(struct rusage *ru, void *uaddr) +{ + struct l_rusage lru; + + bsd_to_linux_rusage(ru, &lru); + + return (copyout(&lru, uaddr, sizeof(struct l_rusage))); +} + +int linux_execve(struct thread *td, struct linux_execve_args *args) { struct image_args eargs; @@ -907,17 +919,14 @@ linux_settimeofday(struct thread *td, st int linux_getrusage(struct thread *td, struct linux_getrusage_args *uap) { - struct l_rusage s32; struct rusage s; int error; error = kern_getrusage(td, uap->who, &s); if (error != 0) return (error); - if (uap->rusage != NULL) { - bsd_to_linux_rusage(&s, &s32); - error = copyout(&s32, uap->rusage, sizeof(s32)); - } + if (uap->rusage != NULL) + error = linux_copyout_rusage(&s, uap->rusage); return (error); } @@ -1023,37 +1032,3 @@ linux_set_thread_area(struct thread *td, return (0); } - -int -linux_wait4(struct thread *td, struct linux_wait4_args *args) -{ - int error, options; - struct rusage ru, *rup; - struct l_rusage lru; - -#ifdef DEBUG - if (ldebug(wait4)) - printf(ARGS(wait4, "%d, %p, %d, %p"), - args->pid, (void *)args->status, args->options, - (void *)args->rusage); -#endif - - options = (args->options & (WNOHANG | WUNTRACED)); - /* WLINUXCLONE should be equal to __WCLONE, but we make sure */ - if (args->options & __WCLONE) - options |= WLINUXCLONE; - - if (args->rusage != NULL) - rup = &ru; - else - rup = NULL; - error = linux_common_wait(td, args->pid, args->status, options, rup); - if (error) - return (error); - if (args->rusage != NULL) { - bsd_to_linux_rusage(rup, &lru); - error = copyout(&lru, args->rusage, sizeof(lru)); - } - - return (error); -} Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:22:50 2016 (r293499) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:23:54 2016 (r293500) @@ -885,6 +885,35 @@ linux_waitpid(struct thread *td, struct return (linux_common_wait(td, args->pid, args->status, options, NULL)); } +int +linux_wait4(struct thread *td, struct linux_wait4_args *args) +{ + int error, options; + struct rusage ru, *rup; + +#ifdef DEBUG + if (ldebug(wait4)) + printf(ARGS(wait4, "%d, %p, %d, %p"), + args->pid, (void *)args->status, args->options, + (void *)args->rusage); +#endif + + options = (args->options & (WNOHANG | WUNTRACED)); + /* WLINUXCLONE should be equal to __WCLONE, but we make sure */ + if (args->options & __WCLONE) + options |= WLINUXCLONE; + + if (args->rusage != NULL) + rup = &ru; + else + rup = NULL; + error = linux_common_wait(td, args->pid, args->status, options, rup); + if (error != 0) + return (error); + if (args->rusage != NULL) + error = linux_copyout_rusage(&ru, args->rusage); + return (error); +} int linux_mknod(struct thread *td, struct linux_mknod_args *args) Modified: stable/10/sys/i386/linux/linux.h ============================================================================== --- stable/10/sys/i386/linux/linux.h Sat Jan 9 15:22:50 2016 (r293499) +++ stable/10/sys/i386/linux/linux.h Sat Jan 9 15:23:54 2016 (r293500) @@ -741,6 +741,8 @@ struct l_desc_struct { #define LINUX_GET_USEABLE(desc) \ (((desc)->b >> LINUX_ENTRY_B_USEABLE) & 1) +#define linux_copyout_rusage(r, u) copyout(r, u, sizeof(*r)) + /* robust futexes */ struct linux_robust_list { struct linux_robust_list *next; Modified: stable/10/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/10/sys/i386/linux/linux_machdep.c Sat Jan 9 15:22:50 2016 (r293499) +++ stable/10/sys/i386/linux/linux_machdep.c Sat Jan 9 15:23:54 2016 (r293500) @@ -1047,34 +1047,3 @@ linux_mq_getsetattr(struct thread *td, s return (ENOSYS); #endif } - -int -linux_wait4(struct thread *td, struct linux_wait4_args *args) -{ - int error, options; - struct rusage ru, *rup; - -#ifdef DEBUG - if (ldebug(wait4)) - printf(ARGS(wait4, "%d, %p, %d, %p"), - args->pid, (void *)args->status, args->options, - (void *)args->rusage); -#endif - - options = (args->options & (WNOHANG | WUNTRACED)); - /* WLINUXCLONE should be equal to __WCLONE, but we make sure */ - if (args->options & __WCLONE) - options |= WLINUXCLONE; - - if (args->rusage != NULL) - rup = &ru; - else - rup = NULL; - error = linux_common_wait(td, args->pid, args->status, options, rup); - if (error) - return (error); - if (args->rusage != NULL) - error = copyout(&ru, args->rusage, sizeof(ru)); - - return (error); -} From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:25:23 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EEDEA68B44; Sat, 9 Jan 2016 15:25:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F285199A; Sat, 9 Jan 2016 15:25:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FPMoj018311; Sat, 9 Jan 2016 15:25:22 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FPMbW018310; Sat, 9 Jan 2016 15:25:22 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091525.u09FPMbW018310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293501 - stable/10/sys/i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:25:23 -0000 Author: dchagin Date: Sat Jan 9 15:25:22 2016 New Revision: 293501 URL: https://svnweb.freebsd.org/changeset/base/293501 Log: MFC r283392: struct l_rusage does not defined for i386 Linuxulator due to it's nature. Modified: stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 15:23:54 2016 (r293500) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 15:25:22 2016 (r293501) @@ -208,7 +208,7 @@ 113 AUE_NULL STD { int linux_vm86old(void); } 114 AUE_WAIT4 STD { int linux_wait4(l_pid_t pid, \ l_int *status, l_int options, \ - struct l_rusage *rusage); } + void *rusage); } 115 AUE_SWAPOFF STD { int linux_swapoff(void); } 116 AUE_NULL STD { int linux_sysinfo(struct l_sysinfo *info); } 117 AUE_NULL STD { int linux_ipc(l_uint what, l_int arg1, \ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:26:21 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6E3FA68BA4; Sat, 9 Jan 2016 15:26:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C13541AF5; Sat, 9 Jan 2016 15:26:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FQKuD018395; Sat, 9 Jan 2016 15:26:20 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FQKNb018390; Sat, 9 Jan 2016 15:26:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091526.u09FQKNb018390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293502 - stable/10/sys/i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:26:22 -0000 Author: dchagin Date: Sat Jan 9 15:26:20 2016 New Revision: 293502 URL: https://svnweb.freebsd.org/changeset/base/293502 Log: Regen for r293501. Modified: stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 15:25:22 2016 (r293501) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 15:26:20 2016 (r293502) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293487 2016-01-09 14:47:08Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293501 2016-01-09 15:25:22Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -360,7 +360,7 @@ struct linux_wait4_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; char status_l_[PADL_(l_int *)]; l_int * status; char status_r_[PADR_(l_int *)]; char options_l_[PADL_(l_int)]; l_int options; char options_r_[PADR_(l_int)]; - char rusage_l_[PADL_(struct l_rusage *)]; struct l_rusage * rusage; char rusage_r_[PADR_(struct l_rusage *)]; + char rusage_l_[PADL_(void *)]; void * rusage; char rusage_r_[PADR_(void *)]; }; struct linux_swapoff_args { register_t dummy; Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 15:25:22 2016 (r293501) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 15:26:20 2016 (r293502) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293487 2016-01-09 14:47:08Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293501 2016-01-09 15:25:22Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 15:25:22 2016 (r293501) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 15:26:20 2016 (r293502) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293487 2016-01-09 14:47:08Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293501 2016-01-09 15:25:22Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 15:25:22 2016 (r293501) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 15:26:20 2016 (r293502) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293487 2016-01-09 14:47:08Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293501 2016-01-09 15:25:22Z dchagin */ #include Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 15:25:22 2016 (r293501) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 15:26:20 2016 (r293502) @@ -792,7 +792,7 @@ systrace_args(int sysnum, void *params, iarg[0] = p->pid; /* l_pid_t */ uarg[1] = (intptr_t) p->status; /* l_int * */ iarg[2] = p->options; /* l_int */ - uarg[3] = (intptr_t) p->rusage; /* struct l_rusage * */ + uarg[3] = (intptr_t) p->rusage; /* void * */ *n_args = 4; break; } @@ -3548,7 +3548,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 3: - p = "struct l_rusage *"; + p = "void *"; break; default: break; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:28:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DE64A68CCA; Sat, 9 Jan 2016 15:28:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E57361CA9; Sat, 9 Jan 2016 15:28:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FS6W5018517; Sat, 9 Jan 2016 15:28:06 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FS5FI018510; Sat, 9 Jan 2016 15:28:05 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091528.u09FS5FI018510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293503 - in stable/10/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:28:07 -0000 Author: dchagin Date: Sat Jan 9 15:28:05 2016 New Revision: 293503 URL: https://svnweb.freebsd.org/changeset/base/293503 Log: MFC r283394: Implement waitid() system call. Modified: stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/linux/linux_misc.h stable/10/sys/i386/linux/linux_dummy.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 15:26:20 2016 (r293502) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 15:28:05 2016 (r293503) @@ -85,7 +85,6 @@ DUMMY(mq_timedreceive); DUMMY(mq_notify); DUMMY(mq_getsetattr); DUMMY(kexec_load); -DUMMY(waitid); /* linux 2.6.11: */ DUMMY(add_key); DUMMY(request_key); Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 15:26:20 2016 (r293502) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 15:28:05 2016 (r293503) @@ -466,7 +466,9 @@ 281 AUE_NULL STD { int linux_mq_notify(void); } 282 AUE_NULL STD { int linux_mq_getsetattr(void); } 283 AUE_NULL STD { int linux_kexec_load(void); } -284 AUE_NULL STD { int linux_waitid(void); } +284 AUE_WAIT6 STD { int linux_waitid(int idtype, l_pid_t id, \ + l_siginfo_t *info, int options, \ + struct l_rusage *rusage); } 285 AUE_NULL UNIMPL ; linux 2.6.11: 286 AUE_NULL STD { int linux_add_key(void); } Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:26:20 2016 (r293502) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:28:05 2016 (r293503) @@ -916,6 +916,68 @@ linux_wait4(struct thread *td, struct li } int +linux_waitid(struct thread *td, struct linux_waitid_args *args) +{ + int status, options, sig; + struct __wrusage wru; + siginfo_t siginfo; + l_siginfo_t lsi; + idtype_t idtype; + struct proc *p; + int error; + + options = 0; + linux_to_bsd_waitopts(args->options, &options); + + if (options & ~(WNOHANG | WNOWAIT | WEXITED | WUNTRACED | WCONTINUED)) + return (EINVAL); + if (!(options & (WEXITED | WUNTRACED | WCONTINUED))) + return (EINVAL); + + switch (args->idtype) { + case LINUX_P_ALL: + idtype = P_ALL; + break; + case LINUX_P_PID: + if (args->id <= 0) + return (EINVAL); + idtype = P_PID; + break; + case LINUX_P_PGID: + if (args->id <= 0) + return (EINVAL); + idtype = P_PGID; + break; + default: + return (EINVAL); + } + + error = kern_wait6(td, idtype, args->id, &status, options, + &wru, &siginfo); + if (error != 0) + return (error); + if (args->rusage != NULL) { + error = linux_copyout_rusage(&wru.wru_children, + args->rusage); + if (error != 0) + return (error); + } + if (args->info != NULL) { + p = td->td_proc; + if (td->td_retval[0] == 0) + bzero(&lsi, sizeof(lsi)); + else { + sig = BSD_TO_LINUX_SIGNAL(siginfo.si_signo); + siginfo_to_lsiginfo(&siginfo, &lsi, sig); + } + error = copyout(&lsi, args->info, sizeof(lsi)); + } + td->td_retval[0] = 0; + + return (error); +} + +int linux_mknod(struct thread *td, struct linux_mknod_args *args) { char *path; Modified: stable/10/sys/compat/linux/linux_misc.h ============================================================================== --- stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 15:26:20 2016 (r293502) +++ stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 15:28:05 2016 (r293503) @@ -123,6 +123,12 @@ extern int stclohz; #define __WALL 0x40000000 #define __WCLONE 0x80000000 +/* Linux waitid idtype */ +#define LINUX_P_ALL 0 +#define LINUX_P_PID 1 +#define LINUX_P_PGID 2 + + int linux_common_wait(struct thread *td, int pid, int *status, int options, struct rusage *ru); void linux_to_bsd_waitopts(int options, int *bsdopts); Modified: stable/10/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 15:26:20 2016 (r293502) +++ stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 15:28:05 2016 (r293503) @@ -81,7 +81,6 @@ DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); DUMMY(kexec_load); -DUMMY(waitid); /* linux 2.6.11: */ DUMMY(add_key); DUMMY(request_key); Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 15:26:20 2016 (r293502) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 15:28:05 2016 (r293503) @@ -474,7 +474,9 @@ 282 AUE_NULL STD { int linux_mq_getsetattr(l_mqd_t mqd, const struct mq_attr *attr, \ struct mq_attr *oattr); } 283 AUE_NULL STD { int linux_kexec_load(void); } -284 AUE_NULL STD { int linux_waitid(void); } +284 AUE_WAIT6 STD { int linux_waitid(int idtype, l_pid_t id, \ + l_siginfo_t *info, int options, \ + void *rusage); } 285 AUE_NULL UNIMPL ; linux 2.6.11: 286 AUE_NULL STD { int linux_add_key(void); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:29:13 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02D83A68D41; Sat, 9 Jan 2016 15:29:13 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFFD21E24; Sat, 9 Jan 2016 15:29:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FTBEb018605; Sat, 9 Jan 2016 15:29:11 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FTAAK018595; Sat, 9 Jan 2016 15:29:10 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091529.u09FTAAK018595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293504 - in stable/10/sys: amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:29:13 -0000 Author: dchagin Date: Sat Jan 9 15:29:10 2016 New Revision: 293504 URL: https://svnweb.freebsd.org/changeset/base/293504 Log: Regen for r293503. Modified: stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 15:28:05 2016 (r293503) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 15:29:10 2016 (r293504) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293487 2016-01-09 14:47:08Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293503 2016-01-09 15:28:05Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -884,7 +884,11 @@ struct linux_kexec_load_args { register_t dummy; }; struct linux_waitid_args { - register_t dummy; + char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; + char id_l_[PADL_(l_pid_t)]; l_pid_t id; char id_r_[PADR_(l_pid_t)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; + char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; + char rusage_l_[PADL_(struct l_rusage *)]; struct l_rusage * rusage; char rusage_r_[PADR_(struct l_rusage *)]; }; struct linux_add_key_args { register_t dummy; @@ -1634,7 +1638,7 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_mq_notify AUE_NULL #define LINUX_SYS_AUE_linux_mq_getsetattr AUE_NULL #define LINUX_SYS_AUE_linux_kexec_load AUE_NULL -#define LINUX_SYS_AUE_linux_waitid AUE_NULL +#define LINUX_SYS_AUE_linux_waitid AUE_WAIT6 #define LINUX_SYS_AUE_linux_add_key AUE_NULL #define LINUX_SYS_AUE_linux_request_key AUE_NULL #define LINUX_SYS_AUE_linux_keyctl AUE_NULL Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 15:28:05 2016 (r293503) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 15:29:10 2016 (r293504) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293487 2016-01-09 14:47:08Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293503 2016-01-09 15:28:05Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 15:28:05 2016 (r293503) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 15:29:10 2016 (r293504) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293487 2016-01-09 14:47:08Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293503 2016-01-09 15:28:05Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 15:28:05 2016 (r293503) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 15:29:10 2016 (r293504) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293487 2016-01-09 14:47:08Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293503 2016-01-09 15:28:05Z dchagin */ #include "opt_compat.h" @@ -303,7 +303,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_mq_notify, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 281 = linux_mq_notify */ { 0, (sy_call_t *)linux_mq_getsetattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 282 = linux_mq_getsetattr */ { 0, (sy_call_t *)linux_kexec_load, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_kexec_load */ - { 0, (sy_call_t *)linux_waitid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_waitid */ + { AS(linux_waitid_args), (sy_call_t *)linux_waitid, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_waitid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 285 = */ { 0, (sy_call_t *)linux_add_key, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 286 = linux_add_key */ { 0, (sy_call_t *)linux_request_key, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 287 = linux_request_key */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 15:28:05 2016 (r293503) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 15:29:10 2016 (r293504) @@ -1886,7 +1886,13 @@ systrace_args(int sysnum, void *params, } /* linux_waitid */ case 284: { - *n_args = 0; + struct linux_waitid_args *p = params; + iarg[0] = p->idtype; /* int */ + iarg[1] = p->id; /* l_pid_t */ + uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */ + iarg[3] = p->options; /* int */ + uarg[4] = (intptr_t) p->rusage; /* struct l_rusage * */ + *n_args = 5; break; } /* linux_add_key */ @@ -5068,6 +5074,25 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_waitid */ case 284: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "l_pid_t"; + break; + case 2: + p = "l_siginfo_t *"; + break; + case 3: + p = "int"; + break; + case 4: + p = "struct l_rusage *"; + break; + default: + break; + }; break; /* linux_add_key */ case 286: @@ -6569,6 +6594,9 @@ systrace_return_setargdesc(int sysnum, i case 283: /* linux_waitid */ case 284: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_add_key */ case 286: /* linux_request_key */ Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 15:28:05 2016 (r293503) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 15:29:10 2016 (r293504) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293501 2016-01-09 15:25:22Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293503 2016-01-09 15:28:05Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -902,7 +902,11 @@ struct linux_kexec_load_args { register_t dummy; }; struct linux_waitid_args { - register_t dummy; + char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; + char id_l_[PADL_(l_pid_t)]; l_pid_t id; char id_r_[PADR_(l_pid_t)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; + char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; + char rusage_l_[PADL_(void *)]; void * rusage; char rusage_r_[PADR_(void *)]; }; struct linux_add_key_args { register_t dummy; @@ -1656,7 +1660,7 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_mq_notify AUE_NULL #define LINUX_SYS_AUE_linux_mq_getsetattr AUE_NULL #define LINUX_SYS_AUE_linux_kexec_load AUE_NULL -#define LINUX_SYS_AUE_linux_waitid AUE_NULL +#define LINUX_SYS_AUE_linux_waitid AUE_WAIT6 #define LINUX_SYS_AUE_linux_add_key AUE_NULL #define LINUX_SYS_AUE_linux_request_key AUE_NULL #define LINUX_SYS_AUE_linux_keyctl AUE_NULL Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 15:28:05 2016 (r293503) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 15:29:10 2016 (r293504) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293501 2016-01-09 15:25:22Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293503 2016-01-09 15:28:05Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 15:28:05 2016 (r293503) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 15:29:10 2016 (r293504) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293501 2016-01-09 15:25:22Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293503 2016-01-09 15:28:05Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 15:28:05 2016 (r293503) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 15:29:10 2016 (r293504) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293501 2016-01-09 15:25:22Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293503 2016-01-09 15:28:05Z dchagin */ #include @@ -302,7 +302,7 @@ struct sysent linux_sysent[] = { { AS(linux_mq_notify_args), (sy_call_t *)linux_mq_notify, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 281 = linux_mq_notify */ { AS(linux_mq_getsetattr_args), (sy_call_t *)linux_mq_getsetattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 282 = linux_mq_getsetattr */ { 0, (sy_call_t *)linux_kexec_load, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_kexec_load */ - { 0, (sy_call_t *)linux_waitid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_waitid */ + { AS(linux_waitid_args), (sy_call_t *)linux_waitid, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_waitid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 285 = */ { 0, (sy_call_t *)linux_add_key, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 286 = linux_add_key */ { 0, (sy_call_t *)linux_request_key, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 287 = linux_request_key */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 15:28:05 2016 (r293503) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 15:29:10 2016 (r293504) @@ -1962,7 +1962,13 @@ systrace_args(int sysnum, void *params, } /* linux_waitid */ case 284: { - *n_args = 0; + struct linux_waitid_args *p = params; + iarg[0] = p->idtype; /* int */ + iarg[1] = p->id; /* l_pid_t */ + uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */ + iarg[3] = p->options; /* int */ + uarg[4] = (intptr_t) p->rusage; /* void * */ + *n_args = 5; break; } /* linux_add_key */ @@ -5299,6 +5305,25 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_waitid */ case 284: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "l_pid_t"; + break; + case 2: + p = "l_siginfo_t *"; + break; + case 3: + p = "int"; + break; + case 4: + p = "void *"; + break; + default: + break; + }; break; /* linux_add_key */ case 286: @@ -6847,6 +6872,9 @@ systrace_return_setargdesc(int sysnum, i case 283: /* linux_waitid */ case 284: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_add_key */ case 286: /* linux_request_key */ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:31:17 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B24BA68F48; Sat, 9 Jan 2016 15:31:17 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F07B910B9; Sat, 9 Jan 2016 15:31:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FVG1S020676; Sat, 9 Jan 2016 15:31:16 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FVFMr020670; Sat, 9 Jan 2016 15:31:15 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091531.u09FVFMr020670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293505 - in stable/10/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:31:17 -0000 Author: dchagin Date: Sat Jan 9 15:31:15 2016 New Revision: 293505 URL: https://svnweb.freebsd.org/changeset/base/293505 Log: MFC r283396: Implement rt_sigqueueinfo() system call. Modified: stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_signal.c stable/10/sys/compat/linux/linux_signal.h stable/10/sys/i386/linux/linux_dummy.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 15:29:10 2016 (r293504) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 15:31:15 2016 (r293505) @@ -62,7 +62,6 @@ DUMMY(bdflush); DUMMY(sysfs); DUMMY(query_module); DUMMY(nfsservctl); -DUMMY(rt_sigqueueinfo); DUMMY(sendfile); DUMMY(setfsuid); DUMMY(setfsgid); Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 15:29:10 2016 (r293504) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 15:31:15 2016 (r293505) @@ -318,7 +318,8 @@ l_siginfo_t *ptr, \ struct l_timeval *timeout, \ l_size_t sigsetsize); } -178 AUE_NULL STD { int linux_rt_sigqueueinfo(void); } +178 AUE_NULL STD { int linux_rt_sigqueueinfo(l_pid_t pid, l_int sig, \ + l_siginfo_t *info); } 179 AUE_NULL STD { int linux_rt_sigsuspend( \ l_sigset_t *newset, \ l_size_t sigsetsize); } Modified: stable/10/sys/compat/linux/linux_signal.c ============================================================================== --- stable/10/sys/compat/linux/linux_signal.c Sat Jan 9 15:29:10 2016 (r293504) +++ stable/10/sys/compat/linux/linux_signal.c Sat Jan 9 15:31:15 2016 (r293505) @@ -751,3 +751,58 @@ siginfo_to_lsiginfo(const siginfo_t *si, break; } } + +void +lsiginfo_to_ksiginfo(const l_siginfo_t *lsi, ksiginfo_t *ksi, int sig) +{ + + ksi->ksi_signo = sig; + ksi->ksi_code = lsi->lsi_code; /* XXX. Convert. */ + ksi->ksi_pid = lsi->lsi_pid; + ksi->ksi_uid = lsi->lsi_uid; + ksi->ksi_status = lsi->lsi_status; + ksi->ksi_addr = PTRIN(lsi->lsi_addr); + ksi->ksi_info.si_value.sival_int = lsi->lsi_int; +} + +int +linux_rt_sigqueueinfo(struct thread *td, struct linux_rt_sigqueueinfo_args *args) +{ + l_siginfo_t linfo; + struct proc *p; + ksiginfo_t ksi; + int error; + int sig; + + if (!LINUX_SIG_VALID(args->sig)) + return (EINVAL); + + error = copyin(args->info, &linfo, sizeof(linfo)); + if (error != 0) + return (error); + + if (linfo.lsi_code >= 0) + return (EPERM); + + if (args->sig > 0 && args->sig <= LINUX_SIGTBLSZ) + sig = linux_to_bsd_signal[_SIG_IDX(args->sig)]; + else + sig = args->sig; + + error = ESRCH; + if ((p = pfind(args->pid)) != NULL || + (p = zpfind(args->pid)) != NULL) { + error = p_cansignal(td, p, sig); + if (error != 0) { + PROC_UNLOCK(p); + return (error); + } + + ksiginfo_init(&ksi); + lsiginfo_to_ksiginfo(&linfo, &ksi, sig); + error = tdsendsignal(p, NULL, sig, &ksi); + PROC_UNLOCK(p); + } + + return (error); +} Modified: stable/10/sys/compat/linux/linux_signal.h ============================================================================== --- stable/10/sys/compat/linux/linux_signal.h Sat Jan 9 15:29:10 2016 (r293504) +++ stable/10/sys/compat/linux/linux_signal.h Sat Jan 9 15:31:15 2016 (r293505) @@ -51,6 +51,7 @@ void bsd_to_linux_sigset(sigset_t *, l_s int linux_do_sigaction(struct thread *, int, l_sigaction_t *, l_sigaction_t *); void ksiginfo_to_lsiginfo(const ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig); void siginfo_to_lsiginfo(const siginfo_t *si, l_siginfo_t *lsi, l_int sig); +void lsiginfo_to_ksiginfo(const l_siginfo_t *lsi, ksiginfo_t *ksi, int sig); #define LINUX_SIG_VALID(sig) ((sig) <= LINUX_NSIG && (sig) > 0) Modified: stable/10/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 15:29:10 2016 (r293504) +++ stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 15:31:15 2016 (r293505) @@ -65,7 +65,6 @@ DUMMY(sysfs); DUMMY(vm86); DUMMY(query_module); DUMMY(nfsservctl); -DUMMY(rt_sigqueueinfo); DUMMY(sendfile); /* different semantics */ DUMMY(setfsuid); DUMMY(setfsgid); Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 15:29:10 2016 (r293504) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 15:31:15 2016 (r293505) @@ -320,7 +320,8 @@ l_siginfo_t *ptr, \ struct l_timeval *timeout, \ l_size_t sigsetsize); } -178 AUE_NULL STD { int linux_rt_sigqueueinfo(void); } +178 AUE_NULL STD { int linux_rt_sigqueueinfo(l_pid_t pid, l_int sig, \ + l_siginfo_t *info); } 179 AUE_NULL STD { int linux_rt_sigsuspend( \ l_sigset_t *newset, \ l_size_t sigsetsize); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:32:35 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4E5AA69033; Sat, 9 Jan 2016 15:32:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADE5414D1; Sat, 9 Jan 2016 15:32:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FWYe4021270; Sat, 9 Jan 2016 15:32:34 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FWXDb021260; Sat, 9 Jan 2016 15:32:33 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091532.u09FWXDb021260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293506 - in stable/10/sys: amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:32:36 -0000 Author: dchagin Date: Sat Jan 9 15:32:33 2016 New Revision: 293506 URL: https://svnweb.freebsd.org/changeset/base/293506 Log: Regen for r293505. Modified: stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 15:31:15 2016 (r293505) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 15:32:33 2016 (r293506) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293503 2016-01-09 15:28:05Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293505 2016-01-09 15:31:15Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -574,7 +574,9 @@ struct linux_rt_sigtimedwait_args { char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; }; struct linux_rt_sigqueueinfo_args { - register_t dummy; + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; }; struct linux_rt_sigsuspend_args { char newset_l_[PADL_(l_sigset_t *)]; l_sigset_t * newset; char newset_r_[PADR_(l_sigset_t *)]; Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 15:31:15 2016 (r293505) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 15:32:33 2016 (r293506) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293503 2016-01-09 15:28:05Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293505 2016-01-09 15:31:15Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 15:31:15 2016 (r293505) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 15:32:33 2016 (r293506) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293503 2016-01-09 15:28:05Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293505 2016-01-09 15:31:15Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 15:31:15 2016 (r293505) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 15:32:33 2016 (r293506) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293503 2016-01-09 15:28:05Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293505 2016-01-09 15:31:15Z dchagin */ #include "opt_compat.h" @@ -197,7 +197,7 @@ struct sysent linux_sysent[] = { { AS(linux_rt_sigprocmask_args), (sy_call_t *)linux_rt_sigprocmask, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 175 = linux_rt_sigprocmask */ { AS(linux_rt_sigpending_args), (sy_call_t *)linux_rt_sigpending, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 176 = linux_rt_sigpending */ { AS(linux_rt_sigtimedwait_args), (sy_call_t *)linux_rt_sigtimedwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 177 = linux_rt_sigtimedwait */ - { 0, (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 178 = linux_rt_sigqueueinfo */ + { AS(linux_rt_sigqueueinfo_args), (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 178 = linux_rt_sigqueueinfo */ { AS(linux_rt_sigsuspend_args), (sy_call_t *)linux_rt_sigsuspend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 179 = linux_rt_sigsuspend */ { AS(linux_pread_args), (sy_call_t *)linux_pread, AUE_PREAD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 180 = linux_pread */ { AS(linux_pwrite_args), (sy_call_t *)linux_pwrite, AUE_PWRITE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 181 = linux_pwrite */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 15:31:15 2016 (r293505) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 15:32:33 2016 (r293506) @@ -1234,7 +1234,11 @@ systrace_args(int sysnum, void *params, } /* linux_rt_sigqueueinfo */ case 178: { - *n_args = 0; + struct linux_rt_sigqueueinfo_args *p = params; + iarg[0] = p->pid; /* l_pid_t */ + iarg[1] = p->sig; /* l_int */ + uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */ + *n_args = 3; break; } /* linux_rt_sigsuspend */ @@ -4167,6 +4171,19 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_rt_sigqueueinfo */ case 178: + switch(ndx) { + case 0: + p = "l_pid_t"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "l_siginfo_t *"; + break; + default: + break; + }; break; /* linux_rt_sigsuspend */ case 179: @@ -6245,6 +6262,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_rt_sigqueueinfo */ case 178: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_rt_sigsuspend */ case 179: if (ndx == 0 || ndx == 1) Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 15:31:15 2016 (r293505) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 15:32:33 2016 (r293506) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293503 2016-01-09 15:28:05Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293505 2016-01-09 15:31:15Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -575,7 +575,9 @@ struct linux_rt_sigtimedwait_args { char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; }; struct linux_rt_sigqueueinfo_args { - register_t dummy; + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; }; struct linux_rt_sigsuspend_args { char newset_l_[PADL_(l_sigset_t *)]; l_sigset_t * newset; char newset_r_[PADR_(l_sigset_t *)]; Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 15:31:15 2016 (r293505) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 15:32:33 2016 (r293506) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293503 2016-01-09 15:28:05Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293505 2016-01-09 15:31:15Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 15:31:15 2016 (r293505) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 15:32:33 2016 (r293506) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293503 2016-01-09 15:28:05Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293505 2016-01-09 15:31:15Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 15:31:15 2016 (r293505) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 15:32:33 2016 (r293506) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293503 2016-01-09 15:28:05Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293505 2016-01-09 15:31:15Z dchagin */ #include @@ -196,7 +196,7 @@ struct sysent linux_sysent[] = { { AS(linux_rt_sigprocmask_args), (sy_call_t *)linux_rt_sigprocmask, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 175 = linux_rt_sigprocmask */ { AS(linux_rt_sigpending_args), (sy_call_t *)linux_rt_sigpending, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 176 = linux_rt_sigpending */ { AS(linux_rt_sigtimedwait_args), (sy_call_t *)linux_rt_sigtimedwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 177 = linux_rt_sigtimedwait */ - { 0, (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 178 = linux_rt_sigqueueinfo */ + { AS(linux_rt_sigqueueinfo_args), (sy_call_t *)linux_rt_sigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 178 = linux_rt_sigqueueinfo */ { AS(linux_rt_sigsuspend_args), (sy_call_t *)linux_rt_sigsuspend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 179 = linux_rt_sigsuspend */ { AS(linux_pread_args), (sy_call_t *)linux_pread, AUE_PREAD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 180 = linux_pread */ { AS(linux_pwrite_args), (sy_call_t *)linux_pwrite, AUE_PWRITE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 181 = linux_pwrite */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 15:31:15 2016 (r293505) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 15:32:33 2016 (r293506) @@ -1277,7 +1277,11 @@ systrace_args(int sysnum, void *params, } /* linux_rt_sigqueueinfo */ case 178: { - *n_args = 0; + struct linux_rt_sigqueueinfo_args *p = params; + iarg[0] = p->pid; /* l_pid_t */ + iarg[1] = p->sig; /* l_int */ + uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */ + *n_args = 3; break; } /* linux_rt_sigsuspend */ @@ -4304,6 +4308,19 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_rt_sigqueueinfo */ case 178: + switch(ndx) { + case 0: + p = "l_pid_t"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "l_siginfo_t *"; + break; + default: + break; + }; break; /* linux_rt_sigsuspend */ case 179: @@ -6500,6 +6517,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_rt_sigqueueinfo */ case 178: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_rt_sigsuspend */ case 179: if (ndx == 0 || ndx == 1) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:33:49 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2539A690CE; Sat, 9 Jan 2016 15:33:49 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75395178C; Sat, 9 Jan 2016 15:33:49 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FXmj2021382; Sat, 9 Jan 2016 15:33:48 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FXm11021381; Sat, 9 Jan 2016 15:33:48 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091533.u09FXm11021381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293507 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:33:49 -0000 Author: dchagin Date: Sat Jan 9 15:33:48 2016 New Revision: 293507 URL: https://svnweb.freebsd.org/changeset/base/293507 Log: MFC r283398: Sched_rr_get_interval returns EINVAL in case when the invalid pid specified. This silence the ltp tests. Modified: stable/10/sys/compat/linux/linux_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:32:33 2016 (r293506) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:33:48 2016 (r293507) @@ -2041,6 +2041,13 @@ linux_sched_rr_get_interval(struct threa struct thread *tdt; int error; + /* + * According to man in case the invalid pid specified + * EINVAL should be returned. + */ + if (uap->pid < 0) + return (EINVAL); + tdt = linux_tdfind(td, uap->pid, -1); if (tdt == NULL) return (ESRCH); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:34:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07350A692B7; Sat, 9 Jan 2016 15:34:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2F8119BE; Sat, 9 Jan 2016 15:34:55 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FYssf021477; Sat, 9 Jan 2016 15:34:54 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FYsHY021472; Sat, 9 Jan 2016 15:34:54 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091534.u09FYsHY021472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293508 - in stable/10/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:34:56 -0000 Author: dchagin Date: Sat Jan 9 15:34:54 2016 New Revision: 293508 URL: https://svnweb.freebsd.org/changeset/base/293508 Log: MFC r283399: Implement dup3() system call. Modified: stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_file.c stable/10/sys/i386/linux/linux_dummy.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 15:33:48 2016 (r293507) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 15:34:54 2016 (r293508) @@ -123,7 +123,6 @@ DUMMY(timerfd_gettime); DUMMY(signalfd4); DUMMY(eventfd2); DUMMY(epoll_create1); -DUMMY(dup3); DUMMY(inotify_init1); /* linux 2.6.30: */ DUMMY(preadv); Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 15:33:48 2016 (r293507) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 15:34:54 2016 (r293508) @@ -539,7 +539,8 @@ 327 AUE_NULL STD { int linux_signalfd4(void); } 328 AUE_NULL STD { int linux_eventfd2(void); } 329 AUE_NULL STD { int linux_epoll_create1(void); } -330 AUE_NULL STD { int linux_dup3(void); } +330 AUE_NULL STD { int linux_dup3(l_int oldfd, \ + l_int newfd, l_int flags); } 331 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } 332 AUE_NULL STD { int linux_inotify_init1(void); } ; linux 2.6.30: Modified: stable/10/sys/compat/linux/linux_file.c ============================================================================== --- stable/10/sys/compat/linux/linux_file.c Sat Jan 9 15:33:48 2016 (r293507) +++ stable/10/sys/compat/linux/linux_file.c Sat Jan 9 15:34:54 2016 (r293508) @@ -1600,3 +1600,22 @@ linux_pipe2(struct thread *td, struct li /* XXX: Close descriptors on error. */ return (copyout(fildes, args->pipefds, sizeof(fildes))); } + +int +linux_dup3(struct thread *td, struct linux_dup3_args *args) +{ + int cmd; + intptr_t newfd; + + if (args->oldfd == args->newfd) + return (EINVAL); + if ((args->flags & ~LINUX_O_CLOEXEC) != 0) + return (EINVAL); + if (args->flags & LINUX_O_CLOEXEC) + cmd = F_DUP2FD_CLOEXEC; + else + cmd = F_DUP2FD; + + newfd = args->newfd; + return (kern_fcntl(td, args->oldfd, cmd, newfd)); +} Modified: stable/10/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 15:33:48 2016 (r293507) +++ stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 15:34:54 2016 (r293508) @@ -119,7 +119,6 @@ DUMMY(timerfd_gettime); DUMMY(signalfd4); DUMMY(eventfd2); DUMMY(epoll_create1); -DUMMY(dup3); DUMMY(inotify_init1); /* linux 2.6.30: */ DUMMY(preadv); Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 15:33:48 2016 (r293507) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 15:34:54 2016 (r293508) @@ -547,7 +547,8 @@ 327 AUE_NULL STD { int linux_signalfd4(void); } 328 AUE_NULL STD { int linux_eventfd2(void); } 329 AUE_NULL STD { int linux_epoll_create1(void); } -330 AUE_NULL STD { int linux_dup3(void); } +330 AUE_NULL STD { int linux_dup3(l_int oldfd, \ + l_int newfd, l_int flags); } 331 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } 332 AUE_NULL STD { int linux_inotify_init1(void); } ; linux 2.6.30: From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:36:00 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 023B8A69395; Sat, 9 Jan 2016 15:36:00 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6C1E1BEE; Sat, 9 Jan 2016 15:35:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FZwAl021576; Sat, 9 Jan 2016 15:35:58 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FZvui021565; Sat, 9 Jan 2016 15:35:57 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091535.u09FZvui021565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293509 - in stable/10/sys: amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:36:00 -0000 Author: dchagin Date: Sat Jan 9 15:35:57 2016 New Revision: 293509 URL: https://svnweb.freebsd.org/changeset/base/293509 Log: Regen for r293508. Modified: stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 15:34:54 2016 (r293508) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 15:35:57 2016 (r293509) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293505 2016-01-09 15:31:15Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293508 2016-01-09 15:34:54Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1064,7 +1064,9 @@ struct linux_epoll_create1_args { register_t dummy; }; struct linux_dup3_args { - register_t dummy; + char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)]; + char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_pipe2_args { char pipefds_l_[PADL_(l_int *)]; l_int * pipefds; char pipefds_r_[PADR_(l_int *)]; Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 15:34:54 2016 (r293508) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 15:35:57 2016 (r293509) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293505 2016-01-09 15:31:15Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293508 2016-01-09 15:34:54Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 15:34:54 2016 (r293508) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 15:35:57 2016 (r293509) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293505 2016-01-09 15:31:15Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293508 2016-01-09 15:34:54Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 15:34:54 2016 (r293508) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 15:35:57 2016 (r293509) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293505 2016-01-09 15:31:15Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293508 2016-01-09 15:34:54Z dchagin */ #include "opt_compat.h" @@ -349,7 +349,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */ { 0, (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */ { 0, (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */ - { 0, (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */ + { AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */ { AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pipe2 */ { 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = linux_inotify_init1 */ { 0, (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 333 = linux_preadv */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 15:34:54 2016 (r293508) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 15:35:57 2016 (r293509) @@ -2190,7 +2190,11 @@ systrace_args(int sysnum, void *params, } /* linux_dup3 */ case 330: { - *n_args = 0; + struct linux_dup3_args *p = params; + iarg[0] = p->oldfd; /* l_int */ + iarg[1] = p->newfd; /* l_int */ + iarg[2] = p->flags; /* l_int */ + *n_args = 3; break; } /* linux_pipe2 */ @@ -5467,6 +5471,19 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_dup3 */ case 330: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "l_int"; + break; + default: + break; + }; break; /* linux_pipe2 */ case 331: @@ -6752,6 +6769,9 @@ systrace_return_setargdesc(int sysnum, i case 329: /* linux_dup3 */ case 330: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_pipe2 */ case 331: if (ndx == 0 || ndx == 1) Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 15:34:54 2016 (r293508) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 15:35:57 2016 (r293509) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293505 2016-01-09 15:31:15Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293508 2016-01-09 15:34:54Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1082,7 +1082,9 @@ struct linux_epoll_create1_args { register_t dummy; }; struct linux_dup3_args { - register_t dummy; + char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)]; + char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_pipe2_args { char pipefds_l_[PADL_(l_int *)]; l_int * pipefds; char pipefds_r_[PADR_(l_int *)]; Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 15:34:54 2016 (r293508) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 15:35:57 2016 (r293509) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293505 2016-01-09 15:31:15Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293508 2016-01-09 15:34:54Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 15:34:54 2016 (r293508) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 15:35:57 2016 (r293509) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293505 2016-01-09 15:31:15Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293508 2016-01-09 15:34:54Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 15:34:54 2016 (r293508) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 15:35:57 2016 (r293509) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293505 2016-01-09 15:31:15Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293508 2016-01-09 15:34:54Z dchagin */ #include @@ -348,7 +348,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */ { 0, (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */ { 0, (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */ - { 0, (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */ + { AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */ { AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pipe2 */ { 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = linux_inotify_init1 */ { 0, (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 333 = linux_preadv */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 15:34:54 2016 (r293508) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 15:35:57 2016 (r293509) @@ -2266,7 +2266,11 @@ systrace_args(int sysnum, void *params, } /* linux_dup3 */ case 330: { - *n_args = 0; + struct linux_dup3_args *p = params; + iarg[0] = p->oldfd; /* l_int */ + iarg[1] = p->newfd; /* l_int */ + iarg[2] = p->flags; /* l_int */ + *n_args = 3; break; } /* linux_pipe2 */ @@ -5698,6 +5702,19 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_dup3 */ case 330: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "l_int"; + break; + default: + break; + }; break; /* linux_pipe2 */ case 331: @@ -7030,6 +7047,9 @@ systrace_return_setargdesc(int sysnum, i case 329: /* linux_dup3 */ case 330: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_pipe2 */ case 331: if (ndx == 0 || ndx == 1) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:37:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC7CCA69455; Sat, 9 Jan 2016 15:37:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E0181DD0; Sat, 9 Jan 2016 15:37:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FbBns021682; Sat, 9 Jan 2016 15:37:11 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FbBeP021676; Sat, 9 Jan 2016 15:37:11 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091537.u09FbBeP021676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293510 - in stable/10/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:37:12 -0000 Author: dchagin Date: Sat Jan 9 15:37:10 2016 New Revision: 293510 URL: https://svnweb.freebsd.org/changeset/base/293510 Log: MFC r283401: Implement prlimit64() system call. Modified: stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/linux/linux_misc.h stable/10/sys/i386/linux/linux_dummy.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 15:35:57 2016 (r293509) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 15:37:10 2016 (r293510) @@ -134,8 +134,6 @@ DUMMY(perf_event_open); DUMMY(recvmmsg); DUMMY(fanotify_init); DUMMY(fanotify_mark); -/* linux 2.6.36: */ -DUMMY(prlimit64); /* later: */ DUMMY(name_to_handle_at); DUMMY(open_by_handle_at); Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 15:35:57 2016 (r293509) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 15:37:10 2016 (r293510) @@ -554,7 +554,10 @@ 338 AUE_NULL STD { int linux_fanotify_init(void); } 339 AUE_NULL STD { int linux_fanotify_mark(void); } ; linux 2.6.36: -340 AUE_NULL STD { int linux_prlimit64(void); } +340 AUE_NULL STD { int linux_prlimit64(l_pid_t pid, \ + l_uint resource, \ + struct rlimit *new, \ + struct rlimit *old); } ; later: 341 AUE_NULL STD { int linux_name_to_handle_at(void); } 342 AUE_NULL STD { int linux_open_by_handle_at(void); } Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:35:57 2016 (r293509) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:37:10 2016 (r293510) @@ -2032,6 +2032,79 @@ linux_sched_setaffinity(struct thread *t return (sys_cpuset_setaffinity(td, &csa)); } +struct linux_rlimit64 { + uint64_t rlim_cur; + uint64_t rlim_max; +}; + +int +linux_prlimit64(struct thread *td, struct linux_prlimit64_args *args) +{ + struct rlimit rlim, nrlim; + struct linux_rlimit64 lrlim; + struct proc *p; + u_int which; + int flags; + int error; + +#ifdef DEBUG + if (ldebug(prlimit64)) + printf(ARGS(prlimit64, "%d, %d, %p, %p"), args->pid, + args->resource, (void *)args->new, (void *)args->old); +#endif + + if (args->resource >= LINUX_RLIM_NLIMITS) + return (EINVAL); + + which = linux_to_bsd_resource[args->resource]; + if (which == -1) + return (EINVAL); + + if (args->new != NULL) { + /* + * Note. Unlike FreeBSD where rlim is signed 64-bit Linux + * rlim is unsigned 64-bit. FreeBSD treats negative limits + * as INFINITY so we do not need a conversion even. + */ + error = copyin(args->new, &nrlim, sizeof(nrlim)); + if (error != 0) + return (error); + } + + flags = PGET_HOLD | PGET_NOTWEXIT; + if (args->new != NULL) + flags |= PGET_CANDEBUG; + else + flags |= PGET_CANSEE; + error = pget(args->pid, flags, &p); + if (error != 0) + return (error); + + if (args->old != NULL) { + PROC_LOCK(p); + lim_rlimit(p, which, &rlim); + PROC_UNLOCK(p); + if (rlim.rlim_cur == RLIM_INFINITY) + lrlim.rlim_cur = LINUX_RLIM_INFINITY; + else + lrlim.rlim_cur = rlim.rlim_cur; + if (rlim.rlim_max == RLIM_INFINITY) + lrlim.rlim_max = LINUX_RLIM_INFINITY; + else + lrlim.rlim_max = rlim.rlim_max; + error = copyout(&lrlim, args->old, sizeof(lrlim)); + if (error != 0) + goto out; + } + + if (args->new != NULL) + error = kern_proc_setrlimit(td, p, which, &nrlim); + + out: + PRELE(p); + return (error); +} + int linux_sched_rr_get_interval(struct thread *td, struct linux_sched_rr_get_interval_args *uap) Modified: stable/10/sys/compat/linux/linux_misc.h ============================================================================== --- stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 15:35:57 2016 (r293509) +++ stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 15:37:10 2016 (r293510) @@ -128,6 +128,7 @@ extern int stclohz; #define LINUX_P_PID 1 #define LINUX_P_PGID 2 +#define LINUX_RLIM_INFINITY (~0UL) int linux_common_wait(struct thread *td, int pid, int *status, int options, struct rusage *ru); Modified: stable/10/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 15:35:57 2016 (r293509) +++ stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 15:37:10 2016 (r293510) @@ -130,8 +130,6 @@ DUMMY(perf_event_open); DUMMY(recvmmsg); DUMMY(fanotify_init); DUMMY(fanotify_mark); -/* linux 2.6.36: */ -DUMMY(prlimit64); /* later: */ DUMMY(name_to_handle_at); DUMMY(open_by_handle_at); Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 15:35:57 2016 (r293509) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 15:37:10 2016 (r293510) @@ -562,7 +562,10 @@ 338 AUE_NULL STD { int linux_fanotify_init(void); } 339 AUE_NULL STD { int linux_fanotify_mark(void); } ; linux 2.6.36: -340 AUE_NULL STD { int linux_prlimit64(void); } +340 AUE_NULL STD { int linux_prlimit64(l_pid_t pid, \ + l_uint resource, \ + struct rlimit *new, \ + struct rlimit *old); } ; later: 341 AUE_NULL STD { int linux_name_to_handle_at(void); } 342 AUE_NULL STD { int linux_open_by_handle_at(void); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:38:18 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 859D7A694FE; Sat, 9 Jan 2016 15:38:18 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 453E71F33; Sat, 9 Jan 2016 15:38:18 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FcHaw021777; Sat, 9 Jan 2016 15:38:17 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FcGsm021766; Sat, 9 Jan 2016 15:38:16 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091538.u09FcGsm021766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293511 - in stable/10/sys: amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:38:18 -0000 Author: dchagin Date: Sat Jan 9 15:38:16 2016 New Revision: 293511 URL: https://svnweb.freebsd.org/changeset/base/293511 Log: Regen for r293510. Modified: stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 15:37:10 2016 (r293510) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 15:38:16 2016 (r293511) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293508 2016-01-09 15:34:54Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293510 2016-01-09 15:37:10Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1097,7 +1097,10 @@ struct linux_fanotify_mark_args { register_t dummy; }; struct linux_prlimit64_args { - register_t dummy; + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)]; + char new_l_[PADL_(struct rlimit *)]; struct rlimit * new; char new_r_[PADR_(struct rlimit *)]; + char old_l_[PADL_(struct rlimit *)]; struct rlimit * old; char old_r_[PADR_(struct rlimit *)]; }; struct linux_name_to_handle_at_args { register_t dummy; Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 15:37:10 2016 (r293510) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 15:38:16 2016 (r293511) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293508 2016-01-09 15:34:54Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293510 2016-01-09 15:37:10Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 15:37:10 2016 (r293510) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 15:38:16 2016 (r293511) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293508 2016-01-09 15:34:54Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293510 2016-01-09 15:37:10Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 15:37:10 2016 (r293510) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 15:38:16 2016 (r293511) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293508 2016-01-09 15:34:54Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293510 2016-01-09 15:37:10Z dchagin */ #include "opt_compat.h" @@ -359,7 +359,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = linux_recvmmsg */ { 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = linux_fanotify_init */ { 0, (sy_call_t *)linux_fanotify_mark, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 339 = linux_fanotify_mark */ - { 0, (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = linux_prlimit64 */ + { AS(linux_prlimit64_args), (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = linux_prlimit64 */ { 0, (sy_call_t *)linux_name_to_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 341 = linux_name_to_handle_at */ { 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 342 = linux_open_by_handle_at */ { 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = linux_clock_adjtime */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 15:37:10 2016 (r293510) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 15:38:16 2016 (r293511) @@ -2247,7 +2247,12 @@ systrace_args(int sysnum, void *params, } /* linux_prlimit64 */ case 340: { - *n_args = 0; + struct linux_prlimit64_args *p = params; + iarg[0] = p->pid; /* l_pid_t */ + iarg[1] = p->resource; /* l_uint */ + uarg[2] = (intptr_t) p->new; /* struct rlimit * */ + uarg[3] = (intptr_t) p->old; /* struct rlimit * */ + *n_args = 4; break; } /* linux_name_to_handle_at */ @@ -5524,6 +5529,22 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_prlimit64 */ case 340: + switch(ndx) { + case 0: + p = "l_pid_t"; + break; + case 1: + p = "l_uint"; + break; + case 2: + p = "struct rlimit *"; + break; + case 3: + p = "struct rlimit *"; + break; + default: + break; + }; break; /* linux_name_to_handle_at */ case 341: @@ -6795,6 +6816,9 @@ systrace_return_setargdesc(int sysnum, i case 339: /* linux_prlimit64 */ case 340: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_name_to_handle_at */ case 341: /* linux_open_by_handle_at */ Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 15:37:10 2016 (r293510) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 15:38:16 2016 (r293511) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293508 2016-01-09 15:34:54Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293510 2016-01-09 15:37:10Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1115,7 +1115,10 @@ struct linux_fanotify_mark_args { register_t dummy; }; struct linux_prlimit64_args { - register_t dummy; + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)]; + char new_l_[PADL_(struct rlimit *)]; struct rlimit * new; char new_r_[PADR_(struct rlimit *)]; + char old_l_[PADL_(struct rlimit *)]; struct rlimit * old; char old_r_[PADR_(struct rlimit *)]; }; struct linux_name_to_handle_at_args { register_t dummy; Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 15:37:10 2016 (r293510) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 15:38:16 2016 (r293511) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293508 2016-01-09 15:34:54Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293510 2016-01-09 15:37:10Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 15:37:10 2016 (r293510) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 15:38:16 2016 (r293511) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293508 2016-01-09 15:34:54Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293510 2016-01-09 15:37:10Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 15:37:10 2016 (r293510) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 15:38:16 2016 (r293511) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293508 2016-01-09 15:34:54Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293510 2016-01-09 15:37:10Z dchagin */ #include @@ -358,7 +358,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = linux_recvmmsg */ { 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = linux_fanotify_init */ { 0, (sy_call_t *)linux_fanotify_mark, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 339 = linux_fanotify_mark */ - { 0, (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = linux_prlimit64 */ + { AS(linux_prlimit64_args), (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = linux_prlimit64 */ { 0, (sy_call_t *)linux_name_to_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 341 = linux_name_to_handle_at */ { 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 342 = linux_open_by_handle_at */ { 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = linux_clock_adjtime */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 15:37:10 2016 (r293510) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 15:38:16 2016 (r293511) @@ -2323,7 +2323,12 @@ systrace_args(int sysnum, void *params, } /* linux_prlimit64 */ case 340: { - *n_args = 0; + struct linux_prlimit64_args *p = params; + iarg[0] = p->pid; /* l_pid_t */ + iarg[1] = p->resource; /* l_uint */ + uarg[2] = (intptr_t) p->new; /* struct rlimit * */ + uarg[3] = (intptr_t) p->old; /* struct rlimit * */ + *n_args = 4; break; } /* linux_name_to_handle_at */ @@ -5755,6 +5760,22 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_prlimit64 */ case 340: + switch(ndx) { + case 0: + p = "l_pid_t"; + break; + case 1: + p = "l_uint"; + break; + case 2: + p = "struct rlimit *"; + break; + case 3: + p = "struct rlimit *"; + break; + default: + break; + }; break; /* linux_name_to_handle_at */ case 341: @@ -7073,6 +7094,9 @@ systrace_return_setargdesc(int sysnum, i case 339: /* linux_prlimit64 */ case 340: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_name_to_handle_at */ case 341: /* linux_open_by_handle_at */ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:39:43 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B442A69584; Sat, 9 Jan 2016 15:39:43 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DECE010D6; Sat, 9 Jan 2016 15:39:42 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FdfeN021885; Sat, 9 Jan 2016 15:39:41 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FdfnV021880; Sat, 9 Jan 2016 15:39:41 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091539.u09FdfnV021880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293512 - in stable/10/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:39:43 -0000 Author: dchagin Date: Sat Jan 9 15:39:41 2016 New Revision: 293512 URL: https://svnweb.freebsd.org/changeset/base/293512 Log: MFC r283403: Implement pselect6() system call. Modified: stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_misc.c stable/10/sys/i386/linux/linux_dummy.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 15:38:16 2016 (r293511) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 15:39:41 2016 (r293512) @@ -96,7 +96,6 @@ DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); /* linux 2.6.16: */ DUMMY(migrate_pages); -DUMMY(pselect6); DUMMY(ppoll); DUMMY(unshare); /* linux 2.6.17: */ Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 15:38:16 2016 (r293511) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 15:39:41 2016 (r293512) @@ -508,7 +508,9 @@ 306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \ l_mode_t mode); } 307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode, int flag); } -308 AUE_NULL STD { int linux_pselect6(void); } +308 AUE_SELECT STD { int linux_pselect6(l_int nfds, l_fd_set *readfds, \ + l_fd_set *writefds, l_fd_set *exceptfds, \ + struct l_timespec *tsp, l_uintptr_t *sig); } 309 AUE_NULL STD { int linux_ppoll(void); } 310 AUE_NULL STD { int linux_unshare(void); } ; linux 2.6.17: Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:38:16 2016 (r293511) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:39:41 2016 (r293512) @@ -117,6 +117,12 @@ struct l_sysinfo { l_uint mem_unit; char _f[20-2*sizeof(l_long)-sizeof(l_int)]; /* padding */ }; + +struct l_pselect6arg { + l_uintptr_t ss; + l_size_t ss_len; +}; + int linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args) { @@ -2106,6 +2112,84 @@ linux_prlimit64(struct thread *td, struc } int +linux_pselect6(struct thread *td, struct linux_pselect6_args *args) +{ + struct timeval utv, tv0, tv1, *tvp; + struct l_pselect6arg lpse6; + struct l_timespec lts; + struct timespec uts; + l_sigset_t l_ss; + sigset_t *ssp; + sigset_t ss; + int error; + + ssp = NULL; + if (args->sig != NULL) { + error = copyin(args->sig, &lpse6, sizeof(lpse6)); + if (error != 0) + return (error); + if (lpse6.ss_len != sizeof(l_ss)) + return (EINVAL); + if (lpse6.ss != 0) { + error = copyin(PTRIN(lpse6.ss), &l_ss, + sizeof(l_ss)); + if (error != 0) + return (error); + linux_to_bsd_sigset(&l_ss, &ss); + ssp = &ss; + } + } + + /* + * Currently glibc changes nanosecond number to microsecond. + * This mean losing precision but for now it is hardly seen. + */ + if (args->tsp != NULL) { + error = copyin(args->tsp, <s, sizeof(lts)); + if (error != 0) + return (error); + uts.tv_sec = lts.tv_sec; + uts.tv_nsec = lts.tv_nsec; + + TIMESPEC_TO_TIMEVAL(&utv, &uts); + if (itimerfix(&utv)) + return (EINVAL); + + microtime(&tv0); + tvp = &utv; + } else + tvp = NULL; + + error = kern_pselect(td, args->nfds, args->readfds, args->writefds, + args->exceptfds, tvp, ssp, sizeof(l_int) * 8); + + if (error == 0 && args->tsp != NULL) { + if (td->td_retval[0] != 0) { + /* + * Compute how much time was left of the timeout, + * by subtracting the current time and the time + * before we started the call, and subtracting + * that result from the user-supplied value. + */ + + microtime(&tv1); + timevalsub(&tv1, &tv0); + timevalsub(&utv, &tv1); + if (utv.tv_sec < 0) + timevalclear(&utv); + } else + timevalclear(&utv); + + TIMEVAL_TO_TIMESPEC(&utv, &uts); + lts.tv_sec = uts.tv_sec; + lts.tv_nsec = uts.tv_nsec; + error = copyout(<s, args->tsp, sizeof(lts)); + } + + return (error); +} + +int linux_sched_rr_get_interval(struct thread *td, struct linux_sched_rr_get_interval_args *uap) { Modified: stable/10/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 15:38:16 2016 (r293511) +++ stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 15:39:41 2016 (r293512) @@ -92,7 +92,6 @@ DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); /* linux 2.6.16: */ DUMMY(migrate_pages); -DUMMY(pselect6); DUMMY(ppoll); DUMMY(unshare); /* linux 2.6.17: */ Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 15:38:16 2016 (r293511) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 15:39:41 2016 (r293512) @@ -516,7 +516,9 @@ 306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \ l_mode_t mode); } 307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode, l_int flag); } -308 AUE_NULL STD { int linux_pselect6(void); } +308 AUE_SELECT STD { int linux_pselect6(l_int nfds, l_fd_set *readfds, \ + l_fd_set *writefds, l_fd_set *exceptfds, \ + struct l_timespec *tsp, l_uintptr_t *sig); } 309 AUE_NULL STD { int linux_ppoll(void); } 310 AUE_NULL STD { int linux_unshare(void); } ; linux 2.6.17: From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:40:46 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79251A69601; Sat, 9 Jan 2016 15:40:46 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 454F412AA; Sat, 9 Jan 2016 15:40:46 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Fej1E021989; Sat, 9 Jan 2016 15:40:45 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Feio7021979; Sat, 9 Jan 2016 15:40:44 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091540.u09Feio7021979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:40:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293513 - in stable/10/sys: amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:40:46 -0000 Author: dchagin Date: Sat Jan 9 15:40:44 2016 New Revision: 293513 URL: https://svnweb.freebsd.org/changeset/base/293513 Log: Regen for r293511. Modified: stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 15:39:41 2016 (r293512) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 15:40:44 2016 (r293513) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293510 2016-01-09 15:37:10Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293512 2016-01-09 15:39:41Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -995,7 +995,12 @@ struct linux_faccessat_args { char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; }; struct linux_pselect6_args { - register_t dummy; + char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)]; + char readfds_l_[PADL_(l_fd_set *)]; l_fd_set * readfds; char readfds_r_[PADR_(l_fd_set *)]; + char writefds_l_[PADL_(l_fd_set *)]; l_fd_set * writefds; char writefds_r_[PADR_(l_fd_set *)]; + char exceptfds_l_[PADL_(l_fd_set *)]; l_fd_set * exceptfds; char exceptfds_r_[PADR_(l_fd_set *)]; + char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)]; + char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)]; }; struct linux_ppoll_args { register_t dummy; @@ -1668,7 +1673,7 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_readlinkat AUE_READLINKAT #define LINUX_SYS_AUE_linux_fchmodat AUE_FCHMODAT #define LINUX_SYS_AUE_linux_faccessat AUE_FACCESSAT -#define LINUX_SYS_AUE_linux_pselect6 AUE_NULL +#define LINUX_SYS_AUE_linux_pselect6 AUE_SELECT #define LINUX_SYS_AUE_linux_ppoll AUE_NULL #define LINUX_SYS_AUE_linux_unshare AUE_NULL #define LINUX_SYS_AUE_linux_set_robust_list AUE_NULL Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 15:39:41 2016 (r293512) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 15:40:44 2016 (r293513) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293510 2016-01-09 15:37:10Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293512 2016-01-09 15:39:41Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 15:39:41 2016 (r293512) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 15:40:44 2016 (r293513) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293510 2016-01-09 15:37:10Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293512 2016-01-09 15:39:41Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 15:39:41 2016 (r293512) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 15:40:44 2016 (r293513) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293510 2016-01-09 15:37:10Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293512 2016-01-09 15:39:41Z dchagin */ #include "opt_compat.h" @@ -327,7 +327,7 @@ struct sysent linux_sysent[] = { { AS(linux_readlinkat_args), (sy_call_t *)linux_readlinkat, AUE_READLINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 305 = linux_readlinkat */ { AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 306 = linux_fchmodat */ { AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = linux_faccessat */ - { 0, (sy_call_t *)linux_pselect6, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_pselect6 */ + { AS(linux_pselect6_args), (sy_call_t *)linux_pselect6, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_pselect6 */ { 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_ppoll */ { 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_unshare */ { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_set_robust_list */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 15:39:41 2016 (r293512) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 15:40:44 2016 (r293513) @@ -2073,7 +2073,14 @@ systrace_args(int sysnum, void *params, } /* linux_pselect6 */ case 308: { - *n_args = 0; + struct linux_pselect6_args *p = params; + iarg[0] = p->nfds; /* l_int */ + uarg[1] = (intptr_t) p->readfds; /* l_fd_set * */ + uarg[2] = (intptr_t) p->writefds; /* l_fd_set * */ + uarg[3] = (intptr_t) p->exceptfds; /* l_fd_set * */ + uarg[4] = (intptr_t) p->tsp; /* struct l_timespec * */ + uarg[5] = (intptr_t) p->sig; /* l_uintptr_t * */ + *n_args = 6; break; } /* linux_ppoll */ @@ -5387,6 +5394,28 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_pselect6 */ case 308: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_fd_set *"; + break; + case 2: + p = "l_fd_set *"; + break; + case 3: + p = "l_fd_set *"; + break; + case 4: + p = "struct l_timespec *"; + break; + case 5: + p = "l_uintptr_t *"; + break; + default: + break; + }; break; /* linux_ppoll */ case 309: @@ -6740,6 +6769,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_pselect6 */ case 308: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_ppoll */ case 309: /* linux_unshare */ Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 15:39:41 2016 (r293512) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 15:40:44 2016 (r293513) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293510 2016-01-09 15:37:10Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293512 2016-01-09 15:39:41Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1013,7 +1013,12 @@ struct linux_faccessat_args { char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; }; struct linux_pselect6_args { - register_t dummy; + char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)]; + char readfds_l_[PADL_(l_fd_set *)]; l_fd_set * readfds; char readfds_r_[PADR_(l_fd_set *)]; + char writefds_l_[PADL_(l_fd_set *)]; l_fd_set * writefds; char writefds_r_[PADR_(l_fd_set *)]; + char exceptfds_l_[PADL_(l_fd_set *)]; l_fd_set * exceptfds; char exceptfds_r_[PADR_(l_fd_set *)]; + char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)]; + char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)]; }; struct linux_ppoll_args { register_t dummy; @@ -1690,7 +1695,7 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_readlinkat AUE_READLINKAT #define LINUX_SYS_AUE_linux_fchmodat AUE_FCHMODAT #define LINUX_SYS_AUE_linux_faccessat AUE_FACCESSAT -#define LINUX_SYS_AUE_linux_pselect6 AUE_NULL +#define LINUX_SYS_AUE_linux_pselect6 AUE_SELECT #define LINUX_SYS_AUE_linux_ppoll AUE_NULL #define LINUX_SYS_AUE_linux_unshare AUE_NULL #define LINUX_SYS_AUE_linux_set_robust_list AUE_NULL Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 15:39:41 2016 (r293512) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 15:40:44 2016 (r293513) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293510 2016-01-09 15:37:10Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293512 2016-01-09 15:39:41Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 15:39:41 2016 (r293512) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 15:40:44 2016 (r293513) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293510 2016-01-09 15:37:10Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293512 2016-01-09 15:39:41Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 15:39:41 2016 (r293512) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 15:40:44 2016 (r293513) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293510 2016-01-09 15:37:10Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293512 2016-01-09 15:39:41Z dchagin */ #include @@ -326,7 +326,7 @@ struct sysent linux_sysent[] = { { AS(linux_readlinkat_args), (sy_call_t *)linux_readlinkat, AUE_READLINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 305 = linux_readlinkat */ { AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 306 = linux_fchmodat */ { AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = linux_faccessat */ - { 0, (sy_call_t *)linux_pselect6, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_pselect6 */ + { AS(linux_pselect6_args), (sy_call_t *)linux_pselect6, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_pselect6 */ { 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_ppoll */ { 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_unshare */ { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_set_robust_list */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 15:39:41 2016 (r293512) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 15:40:44 2016 (r293513) @@ -2149,7 +2149,14 @@ systrace_args(int sysnum, void *params, } /* linux_pselect6 */ case 308: { - *n_args = 0; + struct linux_pselect6_args *p = params; + iarg[0] = p->nfds; /* l_int */ + uarg[1] = (intptr_t) p->readfds; /* l_fd_set * */ + uarg[2] = (intptr_t) p->writefds; /* l_fd_set * */ + uarg[3] = (intptr_t) p->exceptfds; /* l_fd_set * */ + uarg[4] = (intptr_t) p->tsp; /* struct l_timespec * */ + uarg[5] = (intptr_t) p->sig; /* l_uintptr_t * */ + *n_args = 6; break; } /* linux_ppoll */ @@ -5618,6 +5625,28 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_pselect6 */ case 308: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_fd_set *"; + break; + case 2: + p = "l_fd_set *"; + break; + case 3: + p = "l_fd_set *"; + break; + case 4: + p = "struct l_timespec *"; + break; + case 5: + p = "l_uintptr_t *"; + break; + default: + break; + }; break; /* linux_ppoll */ case 309: @@ -7018,6 +7047,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_pselect6 */ case 308: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_ppoll */ case 309: /* linux_unshare */ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:44:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96A69A69880; Sat, 9 Jan 2016 15:44:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CCEC18CA; Sat, 9 Jan 2016 15:44:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FidcS024736; Sat, 9 Jan 2016 15:44:39 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FicUH024721; Sat, 9 Jan 2016 15:44:38 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091544.u09FicUH024721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293514 - in stable/10/sys: amd64/linux32 compat/linux conf i386/linux modules/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:44:40 -0000 Author: dchagin Date: Sat Jan 9 15:44:38 2016 New Revision: 293514 URL: https://svnweb.freebsd.org/changeset/base/293514 Log: MFC r283407: Implement vdso - virtual dynamic shared object. Through vdso Linux exposes functions from kernel with proper DWARF CFI information so that it becomes easier to unwind through them. Using vdso is a mandatory for a thread cancelation && cleanup on a modern glibc. Added: stable/10/sys/amd64/linux32/linux32_vdso.lds.s - copied unchanged from r283407, head/sys/amd64/linux32/linux32_vdso.lds.s stable/10/sys/compat/linux/linux_vdso.c - copied unchanged from r283407, head/sys/compat/linux/linux_vdso.c stable/10/sys/compat/linux/linux_vdso.h - copied unchanged from r283407, head/sys/compat/linux/linux_vdso.h stable/10/sys/i386/linux/linux_vdso.lds.s - copied unchanged from r283407, head/sys/i386/linux/linux_vdso.lds.s Modified: stable/10/sys/amd64/linux32/linux.h stable/10/sys/amd64/linux32/linux32_genassym.c stable/10/sys/amd64/linux32/linux32_locore.s stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/compat/linux/linux_misc.h stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/i386/linux/linux.h stable/10/sys/i386/linux/linux_genassym.c stable/10/sys/i386/linux/linux_locore.s stable/10/sys/i386/linux/linux_sysvec.c stable/10/sys/modules/linux/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux.h ============================================================================== --- stable/10/sys/amd64/linux32/linux.h Sat Jan 9 15:40:44 2016 (r293513) +++ stable/10/sys/amd64/linux32/linux.h Sat Jan 9 15:44:38 2016 (r293514) @@ -114,7 +114,7 @@ typedef struct { /* * Miscellaneous */ -#define LINUX_AT_COUNT 16 /* Count of used aux entry types. +#define LINUX_AT_COUNT 18 /* Count of used aux entry types. * Keep this synchronized with * elf_linux_fixup() code. */ Modified: stable/10/sys/amd64/linux32/linux32_genassym.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_genassym.c Sat Jan 9 15:40:44 2016 (r293513) +++ stable/10/sys/amd64/linux32/linux32_genassym.c Sat Jan 9 15:44:38 2016 (r293514) @@ -7,9 +7,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include ASSYM(LINUX_SIGF_HANDLER, offsetof(struct l_sigframe, sf_handler)); ASSYM(LINUX_SIGF_SC, offsetof(struct l_sigframe, sf_sc)); ASSYM(LINUX_RT_SIGF_HANDLER, offsetof(struct l_rt_sigframe, sf_handler)); ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_sc)); ASSYM(LINUX_RT_SIGF_SC, offsetof(struct l_ucontext, uc_mcontext)); +ASSYM(LINUX_VERSION_CODE, LINUX_VERSION_CODE); +ASSYM(LINUX_SC_ESP, offsetof(struct l_sigcontext, sc_esp)); Modified: stable/10/sys/amd64/linux32/linux32_locore.s ============================================================================== --- stable/10/sys/amd64/linux32/linux32_locore.s Sat Jan 9 15:40:44 2016 (r293513) +++ stable/10/sys/amd64/linux32/linux32_locore.s Sat Jan 9 15:44:38 2016 (r293514) @@ -8,31 +8,143 @@ .text .code32 -NON_GPROF_ENTRY(linux_sigcode) - call *LINUX_SIGF_HANDLER(%esp) - leal LINUX_SIGF_SC(%esp),%ebx /* linux scp */ - movl %esp, %ebx /* pass sigframe */ - push %eax /* fake ret addr */ +/* + * To avoid excess stack frame the signal trampoline code emulates + * the 'call' instruction. + */ +NON_GPROF_ENTRY(linux32_sigcode) + movl %esp, %ebx /* preserve sigframe */ + call .getip0 +.getip0: + popl %eax + add $.startsigcode-.getip0, %eax /* ret address */ + push %eax + jmp *LINUX_SIGF_HANDLER(%ebx) +.startsigcode: + popl %eax movl $LINUX_SYS_linux_sigreturn,%eax /* linux_sigreturn() */ int $0x80 /* enter kernel with args */ +.endsigcode: 0: jmp 0b - ALIGN_TEXT -/* XXXXX */ -linux_rt_sigcode: - call *LINUX_RT_SIGF_HANDLER(%esp) + +NON_GPROF_ENTRY(linux32_rt_sigcode) leal LINUX_RT_SIGF_UC(%esp),%ebx /* linux ucp */ leal LINUX_RT_SIGF_SC(%ebx),%ecx /* linux sigcontext */ - push %eax /* fake ret addr */ + movl %esp, %edi + call .getip1 +.getip1: + popl %eax + add $.startrtsigcode-.getip1, %eax /* ret address */ + push %eax + jmp *LINUX_RT_SIGF_HANDLER(%edi) +.startrtsigcode: movl $LINUX_SYS_linux_rt_sigreturn,%eax /* linux_rt_sigreturn() */ int $0x80 /* enter kernel with args */ +.endrtsigcode: 0: jmp 0b - ALIGN_TEXT -/* XXXXX */ -linux_esigcode: - - .data - .globl linux_szsigcode, linux_sznonrtsigcode -linux_szsigcode: - .long linux_esigcode-linux_sigcode -linux_sznonrtsigcode: - .long linux_rt_sigcode-linux_sigcode + +NON_GPROF_ENTRY(linux32_vsyscall) +.startvsyscall: + int $0x80 + ret +.endvsyscall: + + + .section .note.Linux, "a",@note + .long 2f - 1f /* namesz */ + .balign 4 + .long 4f - 3f /* descsz */ + .long 0 +1: + .asciz "Linux" +2: + .balign 4 +3: + .long LINUX_VERSION_CODE +4: + .balign 4 + .previous + + +#define do_cfa_expr(offset) \ + .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ + .uleb128 11f-10f; /* length */ \ +10: .byte 0x74; /* DW_OP_breg4 */ \ + .sleb128 offset; /* offset */ \ + .byte 0x06; /* DW_OP_deref */ \ +11: + + + /* CIE */ + .section .eh_frame,"a",@progbits +.LSTARTFRAMEDLSI1: + .long .LENDCIEDLSI1-.LSTARTCIEDLSI1 +.LSTARTCIEDLSI1: + .long 0 /* CIE ID */ + .byte 1 /* Version number */ + .string "zRS" /* NULL-terminated + * augmentation string + */ + .uleb128 1 /* Code alignment factor */ + .sleb128 -4 /* Data alignment factor */ + .byte 8 /* Return address + * register column + */ + .uleb128 1 /* Augmentation value length */ + .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ + .byte 0 /* DW_CFA_nop */ + .align 4 +.LENDCIEDLSI1: + + /* FDE */ + .long .LENDFDEDLSI1-.LSTARTFDEDLSI1 /* Length FDE */ +.LSTARTFDEDLSI1: + .long .LSTARTFDEDLSI1-.LSTARTFRAMEDLSI1 /* CIE pointer */ + .long .startsigcode-. /* PC-relative start address */ + .long .endsigcode-.startsigcode + .uleb128 0 /* Augmentation */ + do_cfa_expr(LINUX_SIGF_SC-8) + .align 4 +.LENDFDEDLSI1: + + .long .LENDFDEDLSI2-.LSTARTFDEDLSI2 /* Length FDE */ +.LSTARTFDEDLSI2: + .long .LSTARTFDEDLSI2-.LSTARTFRAMEDLSI1 /* CIE pointer */ + .long .startrtsigcode-. /* PC-relative start address */ + .long .endrtsigcode-.startrtsigcode + .uleb128 0 /* Augmentation */ + do_cfa_expr(LINUX_RT_SIGF_SC-4+LINUX_SC_ESP) + .align 4 +.LENDFDEDLSI2: + .previous + + .section .eh_frame,"a",@progbits +.LSTARTFRAMEDLSI2: + .long .LENDCIEDLSI2-.LSTARTCIEDLSI2 +.LSTARTCIEDLSI2: + .long 0 /* CIE ID */ + .byte 1 /* Version number */ + .string "zR" /* NULL-terminated + * augmentation string + */ + .uleb128 1 /* Code alignment factor */ + .sleb128 -4 /* Data alignment factor */ + .byte 8 /* Return address register column */ + .uleb128 1 /* Augmentation value length */ + .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ + .byte 0x0c /* DW_CFA_def_cfa */ + .uleb128 4 + .uleb128 4 + .byte 0x88 /* DW_CFA_offset, column 0x8 */ + .uleb128 1 + .align 4 +.LENDCIEDLSI2: + .long .LENDFDEDLSI3-.LSTARTFDEDLSI3 /* Length FDE */ +.LSTARTFDEDLSI3: + .long .LSTARTFDEDLSI3-.LSTARTFRAMEDLSI2 /* CIE pointer */ + .long .startvsyscall-. /* PC-relative start address */ + .long .endvsyscall-.startvsyscall + .uleb128 0 + .align 4 +.LENDFDEDLSI3: + .previous Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 15:40:44 2016 (r293513) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 15:44:38 2016 (r293514) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include MODULE_VERSION(linux, 1); @@ -111,8 +112,11 @@ MALLOC_DEFINE(M_LINUX, "linux", "Linux m const char *linux_platform = "i686"; static int linux_szplatform; -extern char linux_sigcode[]; -extern int linux_szsigcode; +static int linux_szsigcode; +static vm_object_t linux_shared_page_obj; +static char *linux_shared_page_mapping; +extern char _binary_linux32_locore_o_start; +extern char _binary_linux32_locore_o_end; extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL]; @@ -127,6 +131,8 @@ static void exec_linux_setregs(struct th struct image_params *imgp, u_long stack); static void linux32_fixlimit(struct rlimit *rl, int which); static boolean_t linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); +static void linux_vdso_install(void *param); +static void linux_vdso_deinstall(void *param); static eventhandler_tag linux_exit_tag; static eventhandler_tag linux_exec_tag; @@ -220,6 +226,10 @@ struct linux32_ps_strings { u_int ps_nenvstr; /* the number of environment strings */ }; +LINUX_VDSO_SYM_INTPTR(linux32_sigcode); +LINUX_VDSO_SYM_INTPTR(linux32_rt_sigcode); +LINUX_VDSO_SYM_INTPTR(linux32_vsyscall); + /* * If FreeBSD & Linux have a difference of opinion about what a trap * means, deal with it here. @@ -259,6 +269,9 @@ elf_linux_fixup(register_t **stack_base, args = (Elf32_Auxargs *)imgp->auxargs; pos = base + (imgp->args->argc + imgp->args->envc + 2); + AUXARGS_ENTRY_32(pos, LINUX_AT_SYSINFO_EHDR, + imgp->proc->p_sysent->sv_shared_page_base); + AUXARGS_ENTRY_32(pos, LINUX_AT_SYSINFO, linux32_vsyscall); AUXARGS_ENTRY_32(pos, LINUX_AT_HWCAP, cpu_feature); /* @@ -297,8 +310,6 @@ elf_linux_fixup(register_t **stack_base, return (0); } -extern unsigned long linux_sznonrtsigcode; - static void linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) { @@ -353,7 +364,8 @@ linux_rt_sendsig(sig_t catcher, ksiginfo ksiginfo_to_lsiginfo(ksi, &frame.sf_si, sig); /* - * Build the signal context to be used by sigreturn. + * Build the signal context to be used by sigreturn + * and libgcc unwind. */ frame.sf_sc.uc_flags = 0; /* XXX ??? */ frame.sf_sc.uc_link = 0; /* XXX ??? */ @@ -371,6 +383,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo frame.sf_sc.uc_mcontext.sc_esi = regs->tf_rsi; frame.sf_sc.uc_mcontext.sc_ebp = regs->tf_rbp; frame.sf_sc.uc_mcontext.sc_ebx = regs->tf_rbx; + frame.sf_sc.uc_mcontext.sc_esp = regs->tf_rsp; frame.sf_sc.uc_mcontext.sc_edx = regs->tf_rdx; frame.sf_sc.uc_mcontext.sc_ecx = regs->tf_rcx; frame.sf_sc.uc_mcontext.sc_eax = regs->tf_rax; @@ -412,7 +425,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo * Build context to run handler in. */ regs->tf_rsp = PTROUT(fp); - regs->tf_rip = p->p_sysent->sv_sigcode_base + linux_sznonrtsigcode; + regs->tf_rip = linux32_rt_sigcode; regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucode32sel; regs->tf_ss = _udatasel; @@ -507,6 +520,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t frame.sf_sc.sc_esi = regs->tf_rsi; frame.sf_sc.sc_ebp = regs->tf_rbp; frame.sf_sc.sc_ebx = regs->tf_rbx; + frame.sf_sc.sc_esp = regs->tf_rsp; frame.sf_sc.sc_edx = regs->tf_rdx; frame.sf_sc.sc_ecx = regs->tf_rcx; frame.sf_sc.sc_eax = regs->tf_rax; @@ -535,7 +549,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t * Build context to run handler in. */ regs->tf_rsp = PTROUT(fp); - regs->tf_rip = p->p_sysent->sv_sigcode_base; + regs->tf_rip = linux32_sigcode; regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucode32sel; regs->tf_ss = _udatasel; @@ -1014,7 +1028,7 @@ struct sysentvec elf_linux_sysvec = { .sv_transtrap = translate_traps, .sv_fixup = elf_linux_fixup, .sv_sendsig = linux_sendsig, - .sv_sigcode = linux_sigcode, + .sv_sigcode = &_binary_linux32_locore_o_start, .sv_szsigcode = &linux_szsigcode, .sv_prepsyscall = NULL, .sv_name = "Linux ELF32", @@ -1040,7 +1054,39 @@ struct sysentvec elf_linux_sysvec = { .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, }; -INIT_SYSENTVEC(elf_sysvec, &elf_linux_sysvec); + +static void +linux_vdso_install(void *param) +{ + + linux_szsigcode = (&_binary_linux32_locore_o_end - + &_binary_linux32_locore_o_start); + + if (linux_szsigcode > elf_linux_sysvec.sv_shared_page_len) + panic("Linux invalid vdso size\n"); + + __elfN(linux_vdso_fixup)(&elf_linux_sysvec); + + linux_shared_page_obj = __elfN(linux_shared_page_init) + (&linux_shared_page_mapping); + + __elfN(linux_vdso_reloc)(&elf_linux_sysvec, LINUX32_SHAREDPAGE); + + bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping, + linux_szsigcode); + elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj; +} +SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY, + (sysinit_cfunc_t)linux_vdso_install, NULL); + +static void +linux_vdso_deinstall(void *param) +{ + + __elfN(linux_shared_page_fini)(linux_shared_page_obj); +}; +SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, + (sysinit_cfunc_t)linux_vdso_deinstall, NULL); static char GNU_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; Copied: stable/10/sys/amd64/linux32/linux32_vdso.lds.s (from r283407, head/sys/amd64/linux32/linux32_vdso.lds.s) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/amd64/linux32/linux32_vdso.lds.s Sat Jan 9 15:44:38 2016 (r293514, copy of r283407, head/sys/amd64/linux32/linux32_vdso.lds.s) @@ -0,0 +1,65 @@ +/* + * Linker script for 32-bit vDSO. + * Copied from Linux kernel arch/x86/vdso/vdso-layout.lds.S + * and arch/x86/vdso/vdso32/vdso32.lds.S + * + * $FreeBSD$ + */ + +SECTIONS +{ + . = . + SIZEOF_HEADERS; + + .hash : { *(.hash) } :text + .gnu.hash : { *(.gnu.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + + .note : { *(.note.*) } :text :note + + .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr + .eh_frame : { KEEP (*(.eh_frame)) } :text + + .dynamic : { *(.dynamic) } :text :dynamic + + .rodata : { *(.rodata*) } :text + .data : { + *(.data*) + *(.sdata*) + *(.got.plt) *(.got) + *(.gnu.linkonce.d.*) + *(.bss*) + *(.dynbss*) + *(.gnu.linkonce.b.*) + } + + .altinstructions : { *(.altinstructions) } + .altinstr_replacement : { *(.altinstr_replacement) } + + . = ALIGN(0x100); + .text : { *(.text*) } :text =0x90909090 +} + +PHDRS +{ + text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */ + dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ + note PT_NOTE FLAGS(4); /* PF_R */ + eh_frame_hdr PT_GNU_EH_FRAME; +} + +ENTRY(linux32_vsyscall); + +VERSION +{ + LINUX_2.5 { + global: + linux32_vsyscall; + linux32_sigcode; + linux32_rt_sigcode; + local: *; + }; +} Modified: stable/10/sys/compat/linux/linux_misc.h ============================================================================== --- stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 15:40:44 2016 (r293513) +++ stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 15:44:38 2016 (r293514) @@ -69,6 +69,8 @@ extern const char *linux_platform; * differ from AT_PLATFORM. */ #define LINUX_AT_EXECFN 31 /* filename of program */ +#define LINUX_AT_SYSINFO 32 /* vsyscall */ +#define LINUX_AT_SYSINFO_EHDR 33 /* vdso header */ /* Linux sets the i387 to extended precision. */ #if defined(__i386__) || defined(__amd64__) Copied: stable/10/sys/compat/linux/linux_vdso.c (from r283407, head/sys/compat/linux/linux_vdso.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/compat/linux/linux_vdso.c Sat Jan 9 15:44:38 2016 (r293514, copy of r283407, head/sys/compat/linux/linux_vdso.c) @@ -0,0 +1,240 @@ +/*- + * Copyright (c) 2013 Dmitry Chagin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_compat.h" + +#define __ELF_WORD_SIZE 32 + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +SLIST_HEAD(, linux_vdso_sym) __elfN(linux_vdso_syms) = + SLIST_HEAD_INITIALIZER(__elfN(linux_vdso_syms)); + +static int __elfN(symtabindex); +static int __elfN(symstrindex); + +static void +__elfN(linux_vdso_lookup)(Elf_Ehdr *, struct linux_vdso_sym *); + + +void +__elfN(linux_vdso_sym_init)(struct linux_vdso_sym *s) +{ + + SLIST_INSERT_HEAD(&__elfN(linux_vdso_syms), s, sym); +} + +vm_object_t +__elfN(linux_shared_page_init)(char **mapping) +{ + vm_page_t m; + vm_object_t obj; + vm_offset_t addr; + + obj = vm_pager_allocate(OBJT_PHYS, 0, PAGE_SIZE, + VM_PROT_DEFAULT, 0, NULL); + VM_OBJECT_WLOCK(obj); + m = vm_page_grab(obj, 0, VM_ALLOC_NOBUSY | VM_ALLOC_ZERO); + m->valid = VM_PAGE_BITS_ALL; + VM_OBJECT_WUNLOCK(obj); + addr = kva_alloc(PAGE_SIZE); + pmap_qenter(addr, &m, 1); + *mapping = (char *)addr; + return (obj); +} + +void +__elfN(linux_shared_page_fini)(vm_object_t obj) +{ + + vm_object_deallocate(obj); +} + +void +__elfN(linux_vdso_fixup)(struct sysentvec *sv) +{ + Elf_Ehdr *ehdr; + Elf_Shdr *shdr; + int i; + + ehdr = (Elf_Ehdr *) sv->sv_sigcode; + + if (!IS_ELF(*ehdr) || + ehdr->e_ident[EI_CLASS] != ELF_TARG_CLASS || + ehdr->e_ident[EI_DATA] != ELF_TARG_DATA || + ehdr->e_ident[EI_VERSION] != EV_CURRENT || + ehdr->e_shoff == 0 || + ehdr->e_shentsize != sizeof(Elf_Shdr)) + panic("Linux invalid vdso header.\n"); + + if (ehdr->e_type != ET_DYN) + panic("Linux invalid vdso header.\n"); + + shdr = (Elf_Shdr *) ((caddr_t)ehdr + ehdr->e_shoff); + + __elfN(symtabindex) = -1; + __elfN(symstrindex) = -1; + for (i = 0; i < ehdr->e_shnum; i++) { + if (shdr[i].sh_size == 0) + continue; + if (shdr[i].sh_type == SHT_DYNSYM) { + __elfN(symtabindex) = i; + __elfN(symstrindex) = shdr[i].sh_link; + } + } + + if (__elfN(symtabindex) == -1 || __elfN(symstrindex) == -1) + panic("Linux invalid vdso header.\n"); + + ehdr->e_ident[EI_OSABI] = ELFOSABI_LINUX; +} + +void +__elfN(linux_vdso_reloc)(struct sysentvec *sv, int vdso_adjust) +{ + struct linux_vdso_sym *lsym; + Elf_Ehdr *ehdr; + Elf_Phdr *phdr; + Elf_Shdr *shdr; + Elf_Dyn *dyn; + Elf_Sym *sym; + int i, symcnt; + + ehdr = (Elf_Ehdr *) sv->sv_sigcode; + + /* Adjust our so relative to the sigcode_base */ + if (vdso_adjust != 0) { + ehdr->e_entry += vdso_adjust; + phdr = (Elf_Phdr *)((caddr_t)ehdr + ehdr->e_phoff); + + /* phdrs */ + for (i = 0; i < ehdr->e_phnum; i++) { + phdr[i].p_vaddr += vdso_adjust; + if (phdr[i].p_type != PT_DYNAMIC) + continue; + dyn = (Elf_Dyn *)((caddr_t)ehdr + phdr[i].p_offset); + for(; dyn->d_tag != DT_NULL; dyn++) { + switch (dyn->d_tag) { + case DT_PLTGOT: + case DT_HASH: + case DT_STRTAB: + case DT_SYMTAB: + case DT_RELA: + case DT_INIT: + case DT_FINI: + case DT_REL: + case DT_DEBUG: + case DT_JMPREL: + case DT_VERSYM: + case DT_VERDEF: + case DT_VERNEED: + case DT_ADDRRNGLO ... DT_ADDRRNGHI: + dyn->d_un.d_ptr += vdso_adjust; + break; + case DT_ENCODING ... DT_LOOS-1: + case DT_LOOS ... DT_HIOS: + if (dyn->d_tag >= DT_ENCODING && + (dyn->d_tag & 1) == 0) + dyn->d_un.d_ptr += vdso_adjust; + break; + default: + break; + } + } + } + + /* sections */ + shdr = (Elf_Shdr *)((caddr_t)ehdr + ehdr->e_shoff); + for(i = 0; i < ehdr->e_shnum; i++) { + if (!(shdr[i].sh_flags & SHF_ALLOC)) + continue; + shdr[i].sh_addr += vdso_adjust; + if (shdr[i].sh_type != SHT_SYMTAB && + shdr[i].sh_type != SHT_DYNSYM) + continue; + + sym = (Elf_Sym *)((caddr_t)ehdr + shdr[i].sh_offset); + symcnt = shdr[i].sh_size / sizeof(*sym); + + for(i = 0; i < symcnt; i++, sym++) { + if (sym->st_shndx == SHN_UNDEF || + sym->st_shndx == SHN_ABS) + continue; + sym->st_value += vdso_adjust; + } + } + } + + SLIST_FOREACH(lsym, &__elfN(linux_vdso_syms), sym) + __elfN(linux_vdso_lookup)(ehdr, lsym); +} + +static void +__elfN(linux_vdso_lookup)(Elf_Ehdr *ehdr, struct linux_vdso_sym *vsym) +{ + vm_offset_t strtab, symname; + uint32_t symcnt; + Elf_Shdr *shdr; + int i; + + shdr = (Elf_Shdr *) ((caddr_t)ehdr + ehdr->e_shoff); + + strtab = (vm_offset_t)((caddr_t)ehdr + + shdr[__elfN(symstrindex)].sh_offset); + Elf_Sym *sym = (Elf_Sym *)((caddr_t)ehdr + + shdr[__elfN(symtabindex)].sh_offset); + symcnt = shdr[__elfN(symtabindex)].sh_size / sizeof(*sym); + + for (i = 0; i < symcnt; ++i, ++sym) { + symname = strtab + sym->st_name; + if (strncmp(vsym->symname, (char *)symname, vsym->size) == 0) { + *vsym->ptr = (uintptr_t)sym->st_value; + break; + } + } +} Copied: stable/10/sys/compat/linux/linux_vdso.h (from r283407, head/sys/compat/linux/linux_vdso.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/compat/linux/linux_vdso.h Sat Jan 9 15:44:38 2016 (r293514, copy of r283407, head/sys/compat/linux/linux_vdso.h) @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2013 Dmitry Chagin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_VDSO_H_ +#define _LINUX_VDSO_H_ + +#include + +struct linux_vdso_sym { + SLIST_ENTRY(linux_vdso_sym) sym; + uint32_t size; + uintptr_t * ptr; + char symname[]; +}; + +vm_object_t __elfN(linux_shared_page_init)(char **); +void __elfN(linux_shared_page_fini)(vm_object_t); +void __elfN(linux_vdso_fixup)(struct sysentvec *); +void __elfN(linux_vdso_reloc)(struct sysentvec *, int); +void __elfN(linux_vdso_sym_init)(struct linux_vdso_sym *); + +#define LINUX_VDSO_SYM_INTPTR(name) \ +uintptr_t name; \ +LINUX_VDSO_SYM_DEFINE(name) + +#define LINUX_VDSO_SYM_CHAR(name) \ +const char * name; \ +LINUX_VDSO_SYM_DEFINE(name) + +#define LINUX_VDSO_SYM_DEFINE(name) \ +static struct linux_vdso_sym name ## sym = { \ + .symname = #name, \ + .size = sizeof(#name), \ + .ptr = (uintptr_t *)&name \ +}; \ +SYSINIT(__elfN(name ## _sym_init), SI_SUB_EXEC, \ + SI_ORDER_FIRST, __elfN(linux_vdso_sym_init), &name ## sym); \ +struct __hack + +#endif /* _LINUX_VDSO_H_ */ Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Sat Jan 9 15:40:44 2016 (r293513) +++ stable/10/sys/conf/files.amd64 Sat Jan 9 15:44:38 2016 (r293514) @@ -20,6 +20,18 @@ linux32_assym.h optional compat_linux3 no-obj no-implicit-rule before-depend \ clean "linux32_assym.h" # +linux32_locore.o optional compat_linux32 \ + dependency "linux32_assym.h $S/amd64/linux32/linux32_locore.s" \ + compile-with "${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s -pipe -I. -I$S -Werror -Wall -fno-common -nostdinc -nostdlib -Wl,-T$S/amd64/linux32/linux32_vdso.lds.s -Wl,-soname=linux32_vdso.so,--eh-frame-hdr,-fPIC,-warn-common ${.IMPSRC} -o ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "linux32_locore.o" +# +linux32_vdso.so optional compat_linux32 \ + dependency "linux32_locore.o" \ + compile-with "${OBJCOPY} --input binary --output elf64-x86-64-freebsd --binary-architecture i386 linux32_locore.o ${.TARGET}" \ + no-implicit-rule \ + clean "linux32_vdso.so" +# ia32_genassym.o standard \ dependency "$S/compat/ia32/ia32_genassym.c" \ compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \ @@ -505,8 +517,6 @@ compat/linsysfs/linsysfs.c optional lins # Linux/i386 binary support # amd64/linux32/linux32_dummy.c optional compat_linux32 -amd64/linux32/linux32_locore.s optional compat_linux32 \ - dependency "linux32_assym.h" amd64/linux32/linux32_machdep.c optional compat_linux32 amd64/linux32/linux32_support.s optional compat_linux32 \ dependency "linux32_assym.h" @@ -529,6 +539,7 @@ compat/linux/linux_time.c optional compa compat/linux/linux_timer.c optional compat_linux32 compat/linux/linux_uid16.c optional compat_linux32 compat/linux/linux_util.c optional compat_linux32 +compat/linux/linux_vdso.c optional compat_linux32 dev/amr/amr_linux.c optional compat_linux32 amr dev/mfi/mfi_linux.c optional compat_linux32 mfi # Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Sat Jan 9 15:40:44 2016 (r293513) +++ stable/10/sys/conf/files.i386 Sat Jan 9 15:44:38 2016 (r293514) @@ -19,6 +19,18 @@ linux_assym.h optional compat_linux \ no-obj no-implicit-rule before-depend \ clean "linux_assym.h" # +linux_locore.o optional compat_linux \ + dependency "linux_assym.h $S/i386/linux/linux_locore.s" \ + compile-with "${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S -Werror -Wall -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-fPIC,-warn-common ${.IMPSRC} -o ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "linux_locore.o" +# +linux_vdso.so optional compat_linux \ + dependency "linux_locore.o" \ + compile-with "${OBJCOPY} --input binary --output elf32-i386-freebsd --binary-architecture i386 linux_locore.o ${.TARGET}" \ + no-implicit-rule \ + clean "linux_vdso.so" +# svr4_genassym.o optional compat_svr4 \ dependency "$S/i386/svr4/svr4_genassym.c" \ compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \ @@ -97,6 +109,7 @@ compat/linux/linux_time.c optional compa compat/linux/linux_timer.c optional compat_linux compat/linux/linux_uid16.c optional compat_linux compat/linux/linux_util.c optional compat_linux +compat/linux/linux_vdso.c optional compat_linux compat/ndis/kern_ndis.c optional ndisapi pci compat/ndis/kern_windrv.c optional ndisapi pci compat/ndis/subr_hal.c optional ndisapi pci @@ -516,8 +529,6 @@ i386/isa/prof_machdep.c optional profil i386/isa/spic.c optional spic i386/linux/imgact_linux.c optional compat_linux i386/linux/linux_dummy.c optional compat_linux -i386/linux/linux_locore.s optional compat_linux \ - dependency "linux_assym.h" i386/linux/linux_machdep.c optional compat_linux i386/linux/linux_ptrace.c optional compat_linux i386/linux/linux_support.s optional compat_linux \ Modified: stable/10/sys/i386/linux/linux.h ============================================================================== --- stable/10/sys/i386/linux/linux.h Sat Jan 9 15:40:44 2016 (r293513) +++ stable/10/sys/i386/linux/linux.h Sat Jan 9 15:44:38 2016 (r293514) @@ -108,7 +108,7 @@ typedef struct { /* * Miscellaneous */ -#define LINUX_AT_COUNT 16 /* Count of used aux entry types. +#define LINUX_AT_COUNT 18 /* Count of used aux entry types. * Keep this synchronized with * elf_linux_fixup() code. */ Modified: stable/10/sys/i386/linux/linux_genassym.c ============================================================================== --- stable/10/sys/i386/linux/linux_genassym.c Sat Jan 9 15:40:44 2016 (r293513) +++ stable/10/sys/i386/linux/linux_genassym.c Sat Jan 9 15:44:38 2016 (r293514) @@ -6,6 +6,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include ASSYM(LINUX_SIGF_HANDLER, offsetof(struct l_sigframe, sf_handler)); ASSYM(LINUX_SIGF_SC, offsetof(struct l_sigframe, sf_sc)); @@ -14,3 +15,5 @@ ASSYM(LINUX_SC_EFLAGS, offsetof(struct l ASSYM(LINUX_RT_SIGF_HANDLER, offsetof(struct l_rt_sigframe, sf_handler)); ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_sc)); ASSYM(LINUX_RT_SIGF_SC, offsetof(struct l_ucontext, uc_mcontext)); +ASSYM(LINUX_SC_ESP, offsetof(struct l_sigcontext, sc_esp)); +ASSYM(LINUX_VERSION_CODE, LINUX_VERSION_CODE); Modified: stable/10/sys/i386/linux/linux_locore.s ============================================================================== --- stable/10/sys/i386/linux/linux_locore.s Sat Jan 9 15:40:44 2016 (r293513) +++ stable/10/sys/i386/linux/linux_locore.s Sat Jan 9 15:44:38 2016 (r293514) @@ -5,33 +5,145 @@ #include /* system call numbers */ +#include "assym.s" + +/* + * To avoid excess stack frame the signal trampoline code emulates + * the 'call' instruction. + */ NON_GPROF_ENTRY(linux_sigcode) - call *LINUX_SIGF_HANDLER(%esp) - leal LINUX_SIGF_SC(%esp),%ebx /* linux scp */ - mov LINUX_SC_GS(%ebx),%gs - movl %esp, %ebx /* pass sigframe */ - push %eax /* fake ret addr */ + movl %esp, %ebx /* preserve sigframe */ + call .getip0 +.getip0: + popl %eax + add $.startsigcode-.getip0, %eax /* ret address */ + push %eax + jmp *LINUX_SIGF_HANDLER(%ebx) +.startsigcode: + popl %eax /* gcc unwind code need this */ movl $LINUX_SYS_linux_sigreturn,%eax /* linux_sigreturn() */ int $0x80 /* enter kernel with args */ +.endsigcode: 0: jmp 0b - ALIGN_TEXT -/* XXXXX */ -linux_rt_sigcode: - call *LINUX_RT_SIGF_HANDLER(%esp) + +NON_GPROF_ENTRY(linux_rt_sigcode) leal LINUX_RT_SIGF_UC(%esp),%ebx /* linux ucp */ leal LINUX_RT_SIGF_SC(%ebx),%ecx /* linux sigcontext */ - mov LINUX_SC_GS(%ecx),%gs - push %eax /* fake ret addr */ + movl %esp, %edi + call .getip1 +.getip1: + popl %eax + add $.startrtsigcode-.getip1, %eax /* ret address */ + push %eax + jmp *LINUX_RT_SIGF_HANDLER(%edi) +.startrtsigcode: movl $LINUX_SYS_linux_rt_sigreturn,%eax /* linux_rt_sigreturn() */ int $0x80 /* enter kernel with args */ +.endrtsigcode: 0: jmp 0b - ALIGN_TEXT -/* XXXXX */ -linux_esigcode: - - .data - .globl linux_szsigcode, linux_sznonrtsigcode -linux_szsigcode: - .long linux_esigcode-linux_sigcode -linux_sznonrtsigcode: - .long linux_rt_sigcode-linux_sigcode + +NON_GPROF_ENTRY(linux_vsyscall) +.startvsyscall: + int $0x80 + ret +.endvsyscall: + + + .section .note.Linux, "a",@note + .long 2f - 1f /* namesz */ + .balign 4 + .long 4f - 3f /* descsz */ + .long 0 +1: + .asciz "Linux" +2: + .balign 4 +3: + .long LINUX_VERSION_CODE +4: + .balign 4 + .previous + + +#define do_cfa_expr(offset) \ + .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ + .uleb128 11f-10f; /* length */ \ +10: .byte 0x74; /* DW_OP_breg4 */ \ + .sleb128 offset; /* offset */ \ + .byte 0x06; /* DW_OP_deref */ \ +11: + + + /* CIE */ + .section .eh_frame,"a",@progbits +.LSTARTFRAMEDLSI1: + .long .LENDCIEDLSI1-.LSTARTCIEDLSI1 +.LSTARTCIEDLSI1: + .long 0 /* CIE ID */ + .byte 1 /* Version number */ + .string "zRS" /* NULL-terminated + * augmentation string + */ + .uleb128 1 /* Code alignment factor */ + .sleb128 -4 /* Data alignment factor */ + .byte 8 /* Return address + * register column + */ + .uleb128 1 /* Augmentation value length */ + .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ + .byte 0 /* DW_CFA_nop */ + .align 4 +.LENDCIEDLSI1: + + /* FDE */ + .long .LENDFDEDLSI1-.LSTARTFDEDLSI1 /* Length FDE */ +.LSTARTFDEDLSI1: + .long .LSTARTFDEDLSI1-.LSTARTFRAMEDLSI1 /* CIE pointer */ + .long .startsigcode-. /* PC-relative start address */ + .long .endsigcode-.startsigcode + .uleb128 0 /* Augmentation */ + do_cfa_expr(LINUX_SIGF_SC-8) + .align 4 +.LENDFDEDLSI1: + + .long .LENDFDEDLSI2-.LSTARTFDEDLSI2 /* Length FDE */ +.LSTARTFDEDLSI2: + .long .LSTARTFDEDLSI2-.LSTARTFRAMEDLSI1 /* CIE pointer */ + .long .startrtsigcode-. /* PC-relative start address */ + .long .endrtsigcode-.startrtsigcode + .uleb128 0 /* Augmentation */ + do_cfa_expr(LINUX_RT_SIGF_SC-4+LINUX_SC_ESP) + .align 4 +.LENDFDEDLSI2: + .previous + + .section .eh_frame,"a",@progbits +.LSTARTFRAMEDLSI2: + .long .LENDCIEDLSI2-.LSTARTCIEDLSI2 +.LSTARTCIEDLSI2: + .long 0 /* CIE ID */ + .byte 1 /* Version number */ + .string "zR" /* NULL-terminated + * augmentation string + */ + .uleb128 1 /* Code alignment factor */ + .sleb128 -4 /* Data alignment factor */ + .byte 8 /* Return address register column */ + .uleb128 1 /* Augmentation value length */ + .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ + .byte 0x0c /* DW_CFA_def_cfa */ + .uleb128 4 + .uleb128 4 + .byte 0x88 /* DW_CFA_offset, column 0x8 */ + .uleb128 1 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:46:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 056B5A6991E; Sat, 9 Jan 2016 15:46:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C68901A78; Sat, 9 Jan 2016 15:46:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Fk5Ll024846; Sat, 9 Jan 2016 15:46:05 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Fk5VT024844; Sat, 9 Jan 2016 15:46:05 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091546.u09Fk5VT024844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293515 - in stable/10/sys: amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:46:07 -0000 Author: dchagin Date: Sat Jan 9 15:46:05 2016 New Revision: 293515 URL: https://svnweb.freebsd.org/changeset/base/293515 Log: MFC r283408: Eliminate a now unused global declaration of elf_linux_sysvec. Modified: stable/10/sys/amd64/linux32/linux.h stable/10/sys/i386/linux/linux.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux.h ============================================================================== --- stable/10/sys/amd64/linux32/linux.h Sat Jan 9 15:44:38 2016 (r293514) +++ stable/10/sys/amd64/linux32/linux.h Sat Jan 9 15:46:05 2016 (r293515) @@ -523,8 +523,6 @@ struct l_rt_sigframe { l_handler_t sf_handler; } __packed; -extern struct sysentvec elf_linux_sysvec; - /* * open/fcntl flags */ Modified: stable/10/sys/i386/linux/linux.h ============================================================================== --- stable/10/sys/i386/linux/linux.h Sat Jan 9 15:44:38 2016 (r293514) +++ stable/10/sys/i386/linux/linux.h Sat Jan 9 15:46:05 2016 (r293515) @@ -499,7 +499,6 @@ struct l_rt_sigframe { }; extern struct sysentvec linux_sysvec; -extern struct sysentvec elf_linux_sysvec; /* * open/fcntl flags From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:48:13 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31B75A699EB; Sat, 9 Jan 2016 15:48:13 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D8C91BF9; Sat, 9 Jan 2016 15:48:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FmCDe024988; Sat, 9 Jan 2016 15:48:12 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FmBug024982; Sat, 9 Jan 2016 15:48:11 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091548.u09FmBug024982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293516 - in stable/10/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:48:13 -0000 Author: dchagin Date: Sat Jan 9 15:48:11 2016 New Revision: 293516 URL: https://svnweb.freebsd.org/changeset/base/293516 Log: MFC r283410: Put linux_platform into the vdso to avoid copying it onto the stack at every exec. Modified: stable/10/sys/amd64/linux32/linux32_locore.s stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/amd64/linux32/linux32_vdso.lds.s stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/linux/linux_misc.h stable/10/sys/i386/linux/linux_sysvec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_locore.s ============================================================================== --- stable/10/sys/amd64/linux32/linux32_locore.s Sat Jan 9 15:46:05 2016 (r293515) +++ stable/10/sys/amd64/linux32/linux32_locore.s Sat Jan 9 15:48:11 2016 (r293516) @@ -5,6 +5,12 @@ #include /* system call numbers */ +.data + + .globl linux_platform +linux_platform: + .asciz "i686" + .text .code32 Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 15:46:05 2016 (r293515) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 15:48:11 2016 (r293516) @@ -110,8 +110,7 @@ MALLOC_DEFINE(M_LINUX, "linux", "Linux m #define LINUX_SYS_linux_rt_sendsig 0 #define LINUX_SYS_linux_sendsig 0 -const char *linux_platform = "i686"; -static int linux_szplatform; +const char *linux_kplatform; static int linux_szsigcode; static vm_object_t linux_shared_page_obj; static char *linux_shared_page_mapping; @@ -229,6 +228,7 @@ struct linux32_ps_strings { LINUX_VDSO_SYM_INTPTR(linux32_sigcode); LINUX_VDSO_SYM_INTPTR(linux32_rt_sigcode); LINUX_VDSO_SYM_INTPTR(linux32_vsyscall); +LINUX_VDSO_SYM_CHAR(linux_platform); /* * If FreeBSD & Linux have a difference of opinion about what a trap @@ -257,11 +257,10 @@ elf_linux_fixup(register_t **stack_base, { Elf32_Auxargs *args; Elf32_Addr *base; - Elf32_Addr *pos, *uplatform; + Elf32_Addr *pos; struct linux32_ps_strings *arginfo; arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS; - uplatform = (Elf32_Addr *)((caddr_t)arginfo - linux_szplatform); KASSERT(curthread->td_proc == imgp->proc, ("unsafe elf_linux_fixup(), should be curproc")); @@ -296,7 +295,7 @@ elf_linux_fixup(register_t **stack_base, AUXARGS_ENTRY_32(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid); AUXARGS_ENTRY_32(pos, AT_GID, imgp->proc->p_ucred->cr_rgid); AUXARGS_ENTRY_32(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid); - AUXARGS_ENTRY_32(pos, LINUX_AT_PLATFORM, PTROUT(uplatform)); + AUXARGS_ENTRY_32(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform)); if (args->execfd != -1) AUXARGS_ENTRY_32(pos, AT_EXECFD, args->execfd); AUXARGS_ENTRY_32(pos, AT_NULL, 0); @@ -883,15 +882,8 @@ linux_copyout_strings(struct image_param * Also deal with signal trampoline code for this exec type. */ arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS; - destp = (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform - - roundup((ARG_MAX - imgp->args->stringspace), - sizeof(char *)); - - /* - * Install LINUX_PLATFORM - */ - copyout(linux_platform, ((caddr_t)arginfo - linux_szplatform), - linux_szplatform); + destp = (caddr_t)arginfo - SPARE_USRSPACE - + roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); /* * If we have a valid auxargs ptr, prepare some room @@ -1075,6 +1067,9 @@ linux_vdso_install(void *param) bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping, linux_szsigcode); elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj; + + linux_kplatform = linux_shared_page_mapping + + (linux_platform - (caddr_t)LINUX32_SHAREDPAGE); } SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY, (sysinit_cfunc_t)linux_vdso_install, NULL); @@ -1181,8 +1176,6 @@ linux_elf_modevent(module_t mod, int typ linux_proc_exec, NULL, 1000); linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); - linux_szplatform = roundup(strlen(linux_platform) + 1, - sizeof(char *)); linux_osd_jail_register(); stclohz = (stathz ? stathz : hz); if (bootverbose) Modified: stable/10/sys/amd64/linux32/linux32_vdso.lds.s ============================================================================== --- stable/10/sys/amd64/linux32/linux32_vdso.lds.s Sat Jan 9 15:46:05 2016 (r293515) +++ stable/10/sys/amd64/linux32/linux32_vdso.lds.s Sat Jan 9 15:48:11 2016 (r293516) @@ -60,6 +60,7 @@ VERSION linux32_vsyscall; linux32_sigcode; linux32_rt_sigcode; + linux_platform; local: *; }; } Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:46:05 2016 (r293515) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:48:11 2016 (r293516) @@ -732,7 +732,7 @@ linux_newuname(struct thread *td, struct *p = '\0'; break; } - strlcpy(utsname.machine, linux_platform, LINUX_MAX_UTSNAME); + strlcpy(utsname.machine, linux_kplatform, LINUX_MAX_UTSNAME); return (copyout(&utsname, args->buf, sizeof(utsname))); } Modified: stable/10/sys/compat/linux/linux_misc.h ============================================================================== --- stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 15:46:05 2016 (r293515) +++ stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 15:48:11 2016 (r293516) @@ -55,7 +55,7 @@ #define LINUX_MREMAP_MAYMOVE 1 #define LINUX_MREMAP_FIXED 2 -extern const char *linux_platform; +extern const char *linux_kplatform; /* * Non-standard aux entry types used in Linux ELF binaries. Modified: stable/10/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysvec.c Sat Jan 9 15:46:05 2016 (r293515) +++ stable/10/sys/i386/linux/linux_sysvec.c Sat Jan 9 15:48:11 2016 (r293516) @@ -118,7 +118,7 @@ static void linux_vdso_install(void *par static void linux_vdso_deinstall(void *param); static int linux_szplatform; -const char *linux_platform; +const char *linux_kplatform; static eventhandler_tag linux_exit_tag; static eventhandler_tag linux_exec_tag; @@ -330,7 +330,7 @@ linux_copyout_strings(struct image_param /* * install LINUX_PLATFORM */ - copyout(linux_platform, ((caddr_t)arginfo - linux_szplatform), + copyout(linux_kplatform, ((caddr_t)arginfo - linux_szplatform), linux_szplatform); /* @@ -1153,8 +1153,8 @@ linux_elf_modevent(module_t mod, int typ NULL, 1000); linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); - linux_get_machine(&linux_platform); - linux_szplatform = roundup(strlen(linux_platform) + 1, + linux_get_machine(&linux_kplatform); + linux_szplatform = roundup(strlen(linux_kplatform) + 1, sizeof(char *)); linux_osd_jail_register(); stclohz = (stathz ? stathz : hz); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:49:44 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17A5FA69BCF; Sat, 9 Jan 2016 15:49:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D81931DD7; Sat, 9 Jan 2016 15:49:43 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FngMe025093; Sat, 9 Jan 2016 15:49:42 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Fng0K025091; Sat, 9 Jan 2016 15:49:42 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091549.u09Fng0K025091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293517 - in stable/10/sys: amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:49:44 -0000 Author: dchagin Date: Sat Jan 9 15:49:42 2016 New Revision: 293517 URL: https://svnweb.freebsd.org/changeset/base/293517 Log: MFC r283411: Remove stale comment about a signal trampoline which is moved to the shared page at r219609. Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/i386/linux/linux_sysvec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 15:48:11 2016 (r293516) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 15:49:42 2016 (r293517) @@ -879,7 +879,6 @@ linux_copyout_strings(struct image_param /* * Calculate string base and vector table pointers. - * Also deal with signal trampoline code for this exec type. */ arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS; destp = (caddr_t)arginfo - SPARE_USRSPACE - Modified: stable/10/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysvec.c Sat Jan 9 15:48:11 2016 (r293516) +++ stable/10/sys/i386/linux/linux_sysvec.c Sat Jan 9 15:49:42 2016 (r293517) @@ -320,7 +320,6 @@ linux_copyout_strings(struct image_param /* * Calculate string base and vector table pointers. - * Also deal with signal trampoline code for this exec type. */ p = imgp->proc; arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:50:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B95EDA69CCE; Sat, 9 Jan 2016 15:50:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 869091161; Sat, 9 Jan 2016 15:50:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Fotmx025476; Sat, 9 Jan 2016 15:50:55 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Fot0i025475; Sat, 9 Jan 2016 15:50:55 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091550.u09Fot0i025475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293518 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:50:56 -0000 Author: dchagin Date: Sat Jan 9 15:50:55 2016 New Revision: 293518 URL: https://svnweb.freebsd.org/changeset/base/293518 Log: MFC r283412: Get ready to commit x86_64 Linux emulation. All fields of type l_int in struct statfs are defined as l_long on i386 and amd64. Modified: stable/10/sys/compat/linux/linux_stats.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_stats.c ============================================================================== --- stable/10/sys/compat/linux/linux_stats.c Sat Jan 9 15:49:42 2016 (r293517) +++ stable/10/sys/compat/linux/linux_stats.c Sat Jan 9 15:50:55 2016 (r293518) @@ -326,18 +326,17 @@ linux_lstat(struct thread *td, struct li return(stat_copyout(&buf, args->up)); } -/* XXX - All fields of type l_int are defined as l_long on i386 */ struct l_statfs { - l_int f_type; - l_int f_bsize; - l_int f_blocks; - l_int f_bfree; - l_int f_bavail; - l_int f_files; - l_int f_ffree; + l_long f_type; + l_long f_bsize; + l_long f_blocks; + l_long f_bfree; + l_long f_bavail; + l_long f_files; + l_long f_ffree; l_fsid_t f_fsid; - l_int f_namelen; - l_int f_spare[6]; + l_long f_namelen; + l_long f_spare[6]; }; #define LINUX_CODA_SUPER_MAGIC 0x73757245L From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:52:33 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AB87A69E5D; Sat, 9 Jan 2016 15:52:33 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4718014FD; Sat, 9 Jan 2016 15:52:33 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FqWIA028146; Sat, 9 Jan 2016 15:52:32 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FqWr7028144; Sat, 9 Jan 2016 15:52:32 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091552.u09FqWr7028144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293519 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:52:33 -0000 Author: dchagin Date: Sat Jan 9 15:52:32 2016 New Revision: 293519 URL: https://svnweb.freebsd.org/changeset/base/293519 Log: MFC r283413: 64-bit paltforms, like x86_64, do not use multiplexing on socketcall system calls. Modified: stable/10/sys/compat/linux/linux_socket.c stable/10/sys/compat/linux/linux_socket.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 15:50:55 2016 (r293518) +++ stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 15:52:32 2016 (r293519) @@ -585,15 +585,6 @@ linux_check_hdrincl(struct thread *td, i return (optval == 0); } -struct linux_sendto_args { - int s; - l_uintptr_t msg; - int len; - int flags; - l_uintptr_t to; - int tolen; -}; - /* * Updated sendto() when IP_HDRINCL is set: * tweak endian-dependent fields in the IP packet. @@ -645,13 +636,7 @@ goout: return (error); } -struct linux_socket_args { - int domain; - int type; - int protocol; -}; - -static int +int linux_socket(struct thread *td, struct linux_socket_args *args) { struct socket_args /* { @@ -715,13 +700,7 @@ out: return (retval_socket); } -struct linux_bind_args { - int s; - l_uintptr_t name; - int namelen; -}; - -static int +int linux_bind(struct thread *td, struct linux_bind_args *args) { struct sockaddr *sa; @@ -739,13 +718,6 @@ linux_bind(struct thread *td, struct lin return (error); } -struct linux_connect_args { - int s; - l_uintptr_t name; - int namelen; -}; -int linux_connect(struct thread *, struct linux_connect_args *); - int linux_connect(struct thread *td, struct linux_connect_args *args) { @@ -790,12 +762,7 @@ linux_connect(struct thread *td, struct return (error); } -struct linux_listen_args { - int s; - int backlog; -}; - -static int +int linux_listen(struct thread *td, struct linux_listen_args *args) { struct listen_args /* { @@ -856,13 +823,7 @@ out: return (error); } -struct linux_accept_args { - int s; - l_uintptr_t addr; - l_uintptr_t namelen; -}; - -static int +int linux_accept(struct thread *td, struct linux_accept_args *args) { @@ -870,14 +831,7 @@ linux_accept(struct thread *td, struct l args->namelen, 0)); } -struct linux_accept4_args { - int s; - l_uintptr_t addr; - l_uintptr_t namelen; - int flags; -}; - -static int +int linux_accept4(struct thread *td, struct linux_accept4_args *args) { @@ -885,13 +839,7 @@ linux_accept4(struct thread *td, struct args->namelen, args->flags)); } -struct linux_getsockname_args { - int s; - l_uintptr_t addr; - l_uintptr_t namelen; -}; - -static int +int linux_getsockname(struct thread *td, struct linux_getsockname_args *args) { struct getsockname_args /* { @@ -915,13 +863,7 @@ linux_getsockname(struct thread *td, str return (0); } -struct linux_getpeername_args { - int s; - l_uintptr_t addr; - l_uintptr_t namelen; -}; - -static int +int linux_getpeername(struct thread *td, struct linux_getpeername_args *args) { struct getpeername_args /* { @@ -944,14 +886,7 @@ linux_getpeername(struct thread *td, str return (0); } -struct linux_socketpair_args { - int domain; - int type; - int protocol; - l_uintptr_t rsv; -}; - -static int +int linux_socketpair(struct thread *td, struct linux_socketpair_args *args) { struct socketpair_args /* { @@ -1007,6 +942,7 @@ out: return (error); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) struct linux_send_args { int s; l_uintptr_t msg; @@ -1062,8 +998,9 @@ linux_recv(struct thread *td, struct lin bsd_args.fromlenaddr = 0; return (sys_recvfrom(td, &bsd_args)); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ -static int +int linux_sendto(struct thread *td, struct linux_sendto_args *args) { struct msghdr msg; @@ -1087,16 +1024,7 @@ linux_sendto(struct thread *td, struct l return (error); } -struct linux_recvfrom_args { - int s; - l_uintptr_t buf; - int len; - int flags; - l_uintptr_t from; - l_uintptr_t fromlen; -}; - -static int +int linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args) { struct recvfrom_args /* { @@ -1136,13 +1064,7 @@ linux_recvfrom(struct thread *td, struct return (0); } -struct linux_sendmsg_args { - int s; - l_uintptr_t msg; - int flags; -}; - -static int +int linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) { struct cmsghdr *cmsg; @@ -1279,13 +1201,7 @@ bad: return (error); } -struct linux_recvmsg_args { - int s; - l_uintptr_t msg; - int flags; -}; - -static int +int linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args) { struct cmsghdr *cm; @@ -1452,12 +1368,7 @@ bad: return (error); } -struct linux_shutdown_args { - int s; - int how; -}; - -static int +int linux_shutdown(struct thread *td, struct linux_shutdown_args *args) { struct shutdown_args /* { @@ -1470,15 +1381,7 @@ linux_shutdown(struct thread *td, struct return (sys_shutdown(td, &bsd_args)); } -struct linux_setsockopt_args { - int s; - int level; - int optname; - l_uintptr_t optval; - int optlen; -}; - -static int +int linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args) { struct setsockopt_args /* { @@ -1543,15 +1446,7 @@ linux_setsockopt(struct thread *td, stru return (error); } -struct linux_getsockopt_args { - int s; - int level; - int optname; - l_uintptr_t optval; - l_uintptr_t optlen; -}; - -static int +int linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) { struct getsockopt_args /* { @@ -1654,6 +1549,7 @@ static const unsigned char lxs_args[] = #define LINUX_AL_SIZE sizeof(lxs_args) / sizeof(lxs_args[0]) - 1 +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int linux_socketcall(struct thread *td, struct linux_socketcall_args *args) { @@ -1710,3 +1606,4 @@ linux_socketcall(struct thread *td, stru uprintf("LINUX: 'socket' typ=%d not implemented\n", args->what); return (ENOSYS); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ Modified: stable/10/sys/compat/linux/linux_socket.h ============================================================================== --- stable/10/sys/compat/linux/linux_socket.h Sat Jan 9 15:50:55 2016 (r293518) +++ stable/10/sys/compat/linux/linux_socket.h Sat Jan 9 15:52:32 2016 (r293519) @@ -116,6 +116,133 @@ struct l_ucred { uint32_t gid; }; +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) + +struct linux_sendto_args { + int s; + l_uintptr_t msg; + int len; + int flags; + l_uintptr_t to; + int tolen; +}; + +struct linux_socket_args { + int domain; + int type; + int protocol; +}; + +struct linux_bind_args { + int s; + l_uintptr_t name; + int namelen; +}; + +struct linux_connect_args { + int s; + l_uintptr_t name; + int namelen; +}; + +struct linux_listen_args { + int s; + int backlog; +}; + +struct linux_accept_args { + int s; + l_uintptr_t addr; + l_uintptr_t namelen; +}; + +struct linux_accept4_args { + int s; + l_uintptr_t addr; + l_uintptr_t namelen; + int flags; +}; + +struct linux_getsockname_args { + int s; + l_uintptr_t addr; + l_uintptr_t namelen; +}; + +struct linux_getpeername_args { + int s; + l_uintptr_t addr; + l_uintptr_t namelen; +}; + +struct linux_socketpair_args { + int domain; + int type; + int protocol; + l_uintptr_t rsv; +}; + +struct linux_recvfrom_args { + int s; + l_uintptr_t buf; + int len; + int flags; + l_uintptr_t from; + l_uintptr_t fromlen; +}; + +struct linux_sendmsg_args { + int s; + l_uintptr_t msg; + int flags; +}; + +struct linux_recvmsg_args { + int s; + l_uintptr_t msg; + int flags; +}; + +struct linux_shutdown_args { + int s; + int how; +}; + +struct linux_setsockopt_args { + int s; + int level; + int optname; + l_uintptr_t optval; + int optlen; +}; + +struct linux_getsockopt_args { + int s; + int level; + int optname; + l_uintptr_t optval; + l_uintptr_t optlen; +}; + +int linux_socket(struct thread *td, struct linux_socket_args *args); +int linux_bind(struct thread *td, struct linux_bind_args *args); +int linux_connect(struct thread *, struct linux_connect_args *); +int linux_listen(struct thread *td, struct linux_listen_args *args); +int linux_accept(struct thread *td, struct linux_accept_args *args); +int linux_accept4(struct thread *td, struct linux_accept4_args *args); +int linux_getsockname(struct thread *td, struct linux_getsockname_args *args); +int linux_getpeername(struct thread *td, struct linux_getpeername_args *args); +int linux_socketpair(struct thread *td, struct linux_socketpair_args *args); +int linux_sendto(struct thread *td, struct linux_sendto_args *args); +int linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args); +int linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args); +int linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args); +int linux_shutdown(struct thread *td, struct linux_shutdown_args *args); +int linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args); +int linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args); + +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ + /* Operations for socketcall */ #define LINUX_SOCKET 1 From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:53:51 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53C74A69F24; Sat, 9 Jan 2016 15:53:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24397182F; Sat, 9 Jan 2016 15:53:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Fro6n028330; Sat, 9 Jan 2016 15:53:50 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FroQu028329; Sat, 9 Jan 2016 15:53:50 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091553.u09FroQu028329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293520 - stable/10/sys/compat/linprocfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:53:51 -0000 Author: dchagin Date: Sat Jan 9 15:53:50 2016 New Revision: 293520 URL: https://svnweb.freebsd.org/changeset/base/293520 Log: MFC r283414: Print out proper procmap entry for 64 bit binaries. Modified: stable/10/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/10/sys/compat/linprocfs/linprocfs.c Sat Jan 9 15:52:32 2016 (r293519) +++ stable/10/sys/compat/linprocfs/linprocfs.c Sat Jan 9 15:53:50 2016 (r293520) @@ -965,6 +965,9 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) return (ret); } +static char l32_map_str[] = "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n"; +static char l64_map_str[] = "%016lx-%016lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n"; + /* * Filler function for proc/pid/maps */ @@ -980,6 +983,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) vm_prot_t e_prot; unsigned int last_timestamp; char *name = "", *freename = NULL; + const char *l_map_str; ino_t ino; int ref_count, shadow_count, flags; int error; @@ -1048,8 +1052,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) * format: * start, end, access, offset, major, minor, inode, name. */ - error = sbuf_printf(sb, - "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n", + if (SV_CURPROC_FLAG(SV_LP64)) + l_map_str = l64_map_str; + else + l_map_str = l32_map_str; + error = sbuf_printf(sb, l_map_str, (u_long)e_start, (u_long)e_end, (e_prot & VM_PROT_READ)?"r":"-", (e_prot & VM_PROT_WRITE)?"w":"-", From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:54:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CFAAA69FC9; Sat, 9 Jan 2016 15:54:57 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D414719D2; Sat, 9 Jan 2016 15:54:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Fsuqu028435; Sat, 9 Jan 2016 15:54:56 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FstOn028430; Sat, 9 Jan 2016 15:54:55 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091554.u09FstOn028430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293521 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:54:57 -0000 Author: dchagin Date: Sat Jan 9 15:54:55 2016 New Revision: 293521 URL: https://svnweb.freebsd.org/changeset/base/293521 Log: MFC r283415: Disable i386 call for x86-64 Linux. Modified: stable/10/sys/compat/linux/linux_file.c stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/linux/linux_signal.c stable/10/sys/compat/linux/linux_socket.c stable/10/sys/compat/linux/linux_stats.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_file.c ============================================================================== --- stable/10/sys/compat/linux/linux_file.c Sat Jan 9 15:53:50 2016 (r293520) +++ stable/10/sys/compat/linux/linux_file.c Sat Jan 9 15:54:55 2016 (r293521) @@ -235,6 +235,7 @@ linux_lseek(struct thread *td, struct li return error; } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int linux_llseek(struct thread *td, struct linux_llseek_args *args) { @@ -273,6 +274,7 @@ linux_readdir(struct thread *td, struct lda.count = 1; return linux_getdents(td, &lda); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ /* * Note that linux_getdents(2) and linux_getdents64(2) have the same @@ -919,6 +921,7 @@ linux_truncate(struct thread *td, struct return (error); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int linux_truncate64(struct thread *td, struct linux_truncate64_args *args) { @@ -936,6 +939,8 @@ linux_truncate64(struct thread *td, stru LFREEPATH(path); return (error); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ + int linux_ftruncate(struct thread *td, struct linux_ftruncate_args *args) { @@ -1123,6 +1128,7 @@ linux_mount(struct thread *td, struct li return (error); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int linux_oldumount(struct thread *td, struct linux_oldumount_args *args) { @@ -1132,6 +1138,7 @@ linux_oldumount(struct thread *td, struc args2.flags = 0; return (linux_umount(td, &args2)); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ int linux_umount(struct thread *td, struct linux_umount_args *args) @@ -1262,7 +1269,7 @@ bsd_to_linux_flock64(struct flock *bsd_f #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ static int -fcntl_common(struct thread *td, struct linux_fcntl64_args *args) +fcntl_common(struct thread *td, struct linux_fcntl_args *args) { struct l_flock linux_flock; struct flock bsd_flock; @@ -1388,17 +1395,13 @@ fcntl_common(struct thread *td, struct l int linux_fcntl(struct thread *td, struct linux_fcntl_args *args) { - struct linux_fcntl64_args args64; #ifdef DEBUG if (ldebug(fcntl)) printf(ARGS(fcntl, "%d, %08x, *"), args->fd, args->cmd); #endif - args64.fd = args->fd; - args64.cmd = args->cmd; - args64.arg = args->arg; - return (fcntl_common(td, &args64)); + return (fcntl_common(td, args)); } #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) @@ -1407,6 +1410,7 @@ linux_fcntl64(struct thread *td, struct { struct l_flock64 linux_flock; struct flock bsd_flock; + struct linux_fcntl_args fcntl_args; int error; #ifdef DEBUG @@ -1447,7 +1451,10 @@ linux_fcntl64(struct thread *td, struct (intptr_t)&bsd_flock)); } - return (fcntl_common(td, args)); + fcntl_args.fd = args->fd; + fcntl_args.cmd = args->cmd; + fcntl_args.arg = args->arg; + return (fcntl_common(td, &fcntl_args)); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ @@ -1543,6 +1550,7 @@ linux_fadvise64(struct thread *td, struc advice)); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int linux_fadvise64_64(struct thread *td, struct linux_fadvise64_64_args *args) { @@ -1554,6 +1562,7 @@ linux_fadvise64_64(struct thread *td, st return (kern_posix_fadvise(td, args->fd, args->offset, args->len, advice)); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ int linux_pipe(struct thread *td, struct linux_pipe_args *args) Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:53:50 2016 (r293520) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:54:55 2016 (r293521) @@ -737,7 +737,6 @@ linux_newuname(struct thread *td, struct return (copyout(&utsname, args->buf, sizeof(utsname))); } -#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) struct l_utimbuf { l_time_t l_actime; l_time_t l_modtime; @@ -840,7 +839,6 @@ linux_futimesat(struct thread *td, struc LFREEPATH(fname); return (error); } -#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ int linux_common_wait(struct thread *td, int pid, int *status, @@ -866,6 +864,7 @@ linux_common_wait(struct thread *td, int return (error); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int linux_waitpid(struct thread *td, struct linux_waitpid_args *args) { @@ -890,6 +889,7 @@ linux_waitpid(struct thread *td, struct return (linux_common_wait(td, args->pid, args->status, options, NULL)); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ int linux_wait4(struct thread *td, struct linux_wait4_args *args) @@ -1163,6 +1163,7 @@ linux_getitimer(struct thread *td, struc return (copyout(&ls, uap->itv, sizeof(ls))); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int linux_nice(struct thread *td, struct linux_nice_args *args) { @@ -1173,6 +1174,7 @@ linux_nice(struct thread *td, struct lin bsd_args.prio = args->inc; return (sys_setpriority(td, &bsd_args)); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ int linux_setgroups(struct thread *td, struct linux_setgroups_args *args) @@ -1302,6 +1304,7 @@ linux_setrlimit(struct thread *td, struc return (kern_setrlimit(td, which, &bsd_rlim)); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int linux_old_getrlimit(struct thread *td, struct linux_old_getrlimit_args *args) { @@ -1344,6 +1347,7 @@ linux_old_getrlimit(struct thread *td, s #endif return (copyout(&rlim, args->rlim, sizeof(rlim))); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ int linux_getrlimit(struct thread *td, struct linux_getrlimit_args *args) Modified: stable/10/sys/compat/linux/linux_signal.c ============================================================================== --- stable/10/sys/compat/linux/linux_signal.c Sat Jan 9 15:53:50 2016 (r293520) +++ stable/10/sys/compat/linux/linux_signal.c Sat Jan 9 15:54:55 2016 (r293521) @@ -60,6 +60,7 @@ static int linux_do_tkill(struct thread static void sicode_to_lsicode(int si_code, int *lsi_code); +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) void linux_to_bsd_sigset(l_sigset_t *lss, sigset_t *bss) { @@ -93,6 +94,7 @@ bsd_to_linux_sigset(sigset_t *bss, l_sig } } } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ static void linux_to_bsd_sigaction(l_sigaction_t *lsa, struct sigaction *bsa) @@ -177,7 +179,7 @@ linux_do_sigaction(struct thread *td, in return (0); } - +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int linux_signal(struct thread *td, struct linux_signal_args *args) { @@ -199,6 +201,7 @@ linux_signal(struct thread *td, struct l return (error); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ int linux_rt_sigaction(struct thread *td, struct linux_rt_sigaction_args *args) @@ -268,6 +271,7 @@ linux_do_sigprocmask(struct thread *td, return (error); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int linux_sigprocmask(struct thread *td, struct linux_sigprocmask_args *args) { @@ -299,6 +303,7 @@ linux_sigprocmask(struct thread *td, str return (error); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ int linux_rt_sigprocmask(struct thread *td, struct linux_rt_sigprocmask_args *args) @@ -333,6 +338,7 @@ linux_rt_sigprocmask(struct thread *td, return (error); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int linux_sgetmask(struct thread *td, struct linux_sgetmask_args *args) { @@ -376,9 +382,6 @@ linux_ssetmask(struct thread *td, struct return (0); } -/* - * MPSAFE - */ int linux_sigpending(struct thread *td, struct linux_sigpending_args *args) { @@ -401,6 +404,7 @@ linux_sigpending(struct thread *td, stru mask = lset.__bits[0]; return (copyout(&mask, args->mask, sizeof(mask))); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ /* * MPSAFE Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 15:53:50 2016 (r293520) +++ stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 15:54:55 2016 (r293521) @@ -1530,6 +1530,8 @@ linux_getsockopt(struct thread *td, stru return (error); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) + /* Argument list sizes for linux_socketcall */ #define LINUX_AL(x) ((x) * sizeof(l_ulong)) @@ -1549,7 +1551,6 @@ static const unsigned char lxs_args[] = #define LINUX_AL_SIZE sizeof(lxs_args) / sizeof(lxs_args[0]) - 1 -#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int linux_socketcall(struct thread *td, struct linux_socketcall_args *args) { Modified: stable/10/sys/compat/linux/linux_stats.c ============================================================================== --- stable/10/sys/compat/linux/linux_stats.c Sat Jan 9 15:53:50 2016 (r293520) +++ stable/10/sys/compat/linux/linux_stats.c Sat Jan 9 15:54:55 2016 (r293521) @@ -251,6 +251,7 @@ linux_newfstat(struct thread *td, struct return (error); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) static int stat_copyout(struct stat *buf, void *ubuf) { @@ -325,6 +326,7 @@ linux_lstat(struct thread *td, struct li LFREEPATH(path); return(stat_copyout(&buf, args->up)); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ struct l_statfs { l_long f_type; @@ -420,6 +422,7 @@ linux_statfs(struct thread *td, struct l return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) static void bsd_to_linux_statfs64(struct statfs *bsd_statfs, struct l_statfs64 *linux_statfs) { @@ -460,6 +463,7 @@ linux_statfs64(struct thread *td, struct bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs); return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ int linux_fstatfs(struct thread *td, struct linux_fstatfs_args *args) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:56:02 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF80AA6906F; Sat, 9 Jan 2016 15:56:02 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 917811C16; Sat, 9 Jan 2016 15:56:02 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Fu14h028653; Sat, 9 Jan 2016 15:56:01 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Fu1EU028649; Sat, 9 Jan 2016 15:56:01 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091556.u09Fu1EU028649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293522 - in stable/10/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:56:03 -0000 Author: dchagin Date: Sat Jan 9 15:56:01 2016 New Revision: 293522 URL: https://svnweb.freebsd.org/changeset/base/293522 Log: MFC r283416: x86_64 Linux do not use multiplexing on ipc system calls. Move struct ipc_perm definition to the MD path as it differs for 64 and 32 bit platform. Modified: stable/10/sys/amd64/linux32/linux.h stable/10/sys/compat/linux/linux_ipc.c stable/10/sys/compat/linux/linux_ipc.h stable/10/sys/i386/linux/linux.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux.h ============================================================================== --- stable/10/sys/amd64/linux32/linux.h Sat Jan 9 15:54:55 2016 (r293521) +++ stable/10/sys/amd64/linux32/linux.h Sat Jan 9 15:56:01 2016 (r293522) @@ -573,6 +573,16 @@ union l_semun { l_uintptr_t __pad; } __packed; +struct l_ipc_perm { + l_key_t key; + l_uid16_t uid; + l_gid16_t gid; + l_uid16_t cuid; + l_gid16_t cgid; + l_ushort mode; + l_ushort seq; +}; + /* * Socket defines */ Modified: stable/10/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/10/sys/compat/linux/linux_ipc.c Sat Jan 9 15:54:55 2016 (r293521) +++ stable/10/sys/compat/linux/linux_ipc.c Sat Jan 9 15:56:01 2016 (r293522) @@ -117,16 +117,6 @@ bsd_to_linux_shm_info( struct shm_info * lpp->swap_successes = bpp->swap_successes ; } -struct l_ipc_perm { - l_key_t key; - l_uid16_t uid; - l_gid16_t gid; - l_uid16_t cuid; - l_gid16_t cgid; - l_ushort mode; - l_ushort seq; -}; - static void linux_to_bsd_ipc_perm(struct l_ipc_perm *lpp, struct ipc_perm *bpp) { Modified: stable/10/sys/compat/linux/linux_ipc.h ============================================================================== --- stable/10/sys/compat/linux/linux_ipc.h Sat Jan 9 15:54:55 2016 (r293521) +++ stable/10/sys/compat/linux/linux_ipc.h Sat Jan 9 15:56:01 2016 (r293522) @@ -82,7 +82,7 @@ #define LINUX_IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger message sizes, etc. */ -#if defined(__i386__) || defined(__amd64__) +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) struct linux_msgctl_args { @@ -177,6 +177,6 @@ int linux_shmctl(struct thread *, struct int linux_shmdt(struct thread *, struct linux_shmdt_args *); int linux_shmget(struct thread *, struct linux_shmget_args *); -#endif /* __i386__ || __amd64__ */ +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ #endif /* _LINUX_IPC_H_ */ Modified: stable/10/sys/i386/linux/linux.h ============================================================================== --- stable/10/sys/i386/linux/linux.h Sat Jan 9 15:54:55 2016 (r293521) +++ stable/10/sys/i386/linux/linux.h Sat Jan 9 15:56:01 2016 (r293522) @@ -550,6 +550,16 @@ union l_semun { void *__pad; }; +struct l_ipc_perm { + l_key_t key; + l_uid16_t uid; + l_gid16_t gid; + l_uid16_t cuid; + l_gid16_t cgid; + l_ushort mode; + l_ushort seq; +}; + /* * Socket defines */ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:57:30 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3063BA6918B; Sat, 9 Jan 2016 15:57:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0214E1DDB; Sat, 9 Jan 2016 15:57:29 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FvTIq028756; Sat, 9 Jan 2016 15:57:29 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09FvT23028754; Sat, 9 Jan 2016 15:57:29 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091557.u09FvT23028754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293523 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:57:30 -0000 Author: dchagin Date: Sat Jan 9 15:57:28 2016 New Revision: 293523 URL: https://svnweb.freebsd.org/changeset/base/293523 Log: MFC r283417: Add 64 bit support to the vdso. Modified: stable/10/sys/compat/linux/linux_vdso.c stable/10/sys/compat/linux/linux_vdso.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_vdso.c ============================================================================== --- stable/10/sys/compat/linux/linux_vdso.c Sat Jan 9 15:56:01 2016 (r293522) +++ stable/10/sys/compat/linux/linux_vdso.c Sat Jan 9 15:57:28 2016 (r293523) @@ -29,7 +29,11 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) #define __ELF_WORD_SIZE 32 +#else +#define __ELF_WORD_SIZE 64 +#endif #include #include @@ -135,7 +139,7 @@ __elfN(linux_vdso_fixup)(struct sysentve } void -__elfN(linux_vdso_reloc)(struct sysentvec *sv, int vdso_adjust) +__elfN(linux_vdso_reloc)(struct sysentvec *sv, long vdso_adjust) { struct linux_vdso_sym *lsym; Elf_Ehdr *ehdr; Modified: stable/10/sys/compat/linux/linux_vdso.h ============================================================================== --- stable/10/sys/compat/linux/linux_vdso.h Sat Jan 9 15:56:01 2016 (r293522) +++ stable/10/sys/compat/linux/linux_vdso.h Sat Jan 9 15:57:28 2016 (r293523) @@ -41,7 +41,7 @@ struct linux_vdso_sym { vm_object_t __elfN(linux_shared_page_init)(char **); void __elfN(linux_shared_page_fini)(vm_object_t); void __elfN(linux_vdso_fixup)(struct sysentvec *); -void __elfN(linux_vdso_reloc)(struct sysentvec *, int); +void __elfN(linux_vdso_reloc)(struct sysentvec *, long); void __elfN(linux_vdso_sym_init)(struct linux_vdso_sym *); #define LINUX_VDSO_SYM_INTPTR(name) \ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 15:58:43 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3C1EA69205; Sat, 9 Jan 2016 15:58:43 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AC5C1F2C; Sat, 9 Jan 2016 15:58:43 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09FwgTP028859; Sat, 9 Jan 2016 15:58:42 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Fwg4j028856; Sat, 9 Jan 2016 15:58:42 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091558.u09Fwg4j028856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 15:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293524 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 15:58:43 -0000 Author: dchagin Date: Sat Jan 9 15:58:42 2016 New Revision: 293524 URL: https://svnweb.freebsd.org/changeset/base/293524 Log: MFC r283419: Fix compilation with -DDEBUG option. Modified: stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/linux/linux_signal.c stable/10/sys/compat/linux/linux_stats.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:57:28 2016 (r293523) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 15:58:42 2016 (r293524) @@ -993,7 +993,8 @@ linux_mknod(struct thread *td, struct li #ifdef DEBUG if (ldebug(mknod)) - printf(ARGS(mknod, "%s, %d, %d"), path, args->mode, args->dev); + printf(ARGS(mknod, "%s, %d, %ju"), path, args->mode, + (uintmax_t)args->dev); #endif switch (args->mode & S_IFMT) { @@ -1843,8 +1844,9 @@ linux_prctl(struct thread *td, struct li #ifdef DEBUG if (ldebug(prctl)) - printf(ARGS(prctl, "%d, %d, %d, %d, %d"), args->option, - args->arg2, args->arg3, args->arg4, args->arg5); + printf(ARGS(prctl, "%d, %ju, %ju, %ju, %ju"), args->option, + (uintmax_t)args->arg2, (uintmax_t)args->arg3, + (uintmax_t)args->arg4, (uintmax_t)args->arg5); #endif switch (args->option) { Modified: stable/10/sys/compat/linux/linux_signal.c ============================================================================== --- stable/10/sys/compat/linux/linux_signal.c Sat Jan 9 15:57:28 2016 (r293523) +++ stable/10/sys/compat/linux/linux_signal.c Sat Jan 9 15:58:42 2016 (r293524) @@ -468,8 +468,8 @@ linux_rt_sigtimedwait(struct thread *td, #ifdef DEBUG if (ldebug(rt_sigtimedwait)) printf(LMSG("linux_rt_sigtimedwait: " - "incoming timeout (%d/%d)\n"), - ltv.tv_sec, ltv.tv_usec); + "incoming timeout (%jd/%jd)\n"), + (intmax_t)ltv.tv_sec, (intmax_t)ltv.tv_usec); #endif tv.tv_sec = (long)ltv.tv_sec; tv.tv_usec = (suseconds_t)ltv.tv_usec; Modified: stable/10/sys/compat/linux/linux_stats.c ============================================================================== --- stable/10/sys/compat/linux/linux_stats.c Sat Jan 9 15:57:28 2016 (r293523) +++ stable/10/sys/compat/linux/linux_stats.c Sat Jan 9 15:58:42 2016 (r293524) @@ -496,7 +496,7 @@ linux_ustat(struct thread *td, struct li { #ifdef DEBUG if (ldebug(ustat)) - printf(ARGS(ustat, "%d, *"), args->dev); + printf(ARGS(ustat, "%ju, *"), (uintmax_t)args->dev); #endif return (EOPNOTSUPP); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:00:14 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66DA5A692CD; Sat, 9 Jan 2016 16:00:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34B3B10D6; Sat, 9 Jan 2016 16:00:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09G0DtS028997; Sat, 9 Jan 2016 16:00:13 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09G0DUq028996; Sat, 9 Jan 2016 16:00:13 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091600.u09G0DUq028996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293525 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:00:14 -0000 Author: dchagin Date: Sat Jan 9 16:00:13 2016 New Revision: 293525 URL: https://svnweb.freebsd.org/changeset/base/293525 Log: MFC r283420: Add newfstatat system call for 64-bit Linuxulator. Modified: stable/10/sys/compat/linux/linux_stats.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_stats.c ============================================================================== --- stable/10/sys/compat/linux/linux_stats.c Sat Jan 9 15:58:42 2016 (r293524) +++ stable/10/sys/compat/linux/linux_stats.c Sat Jan 9 16:00:13 2016 (r293525) @@ -627,4 +627,34 @@ linux_fstatat64(struct thread *td, struc return (error); } +#else /* __amd64__ && !COMPAT_LINUX32 */ + +int +linux_newfstatat(struct thread *td, struct linux_newfstatat_args *args) +{ + char *path; + int error, dfd, flag; + struct stat buf; + + if (args->flag & ~LINUX_AT_SYMLINK_NOFOLLOW) + return (EINVAL); + flag = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) ? + AT_SYMLINK_NOFOLLOW : 0; + + dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; + LCONVPATHEXIST_AT(td, args->pathname, &path, dfd); + +#ifdef DEBUG + if (ldebug(newfstatat)) + printf(ARGS(newfstatat, "%i, %s, %i"), args->dfd, path, args->flag); +#endif + + error = linux_kern_statat(td, flag, dfd, path, UIO_SYSSPACE, &buf); + if (error == 0) + error = newstat_copyout(&buf, args->statbuf); + LFREEPATH(path); + + return (error); +} + #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:01:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16914A6943F; Sat, 9 Jan 2016 16:01:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC5331443; Sat, 9 Jan 2016 16:01:58 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09G1w1U031654; Sat, 9 Jan 2016 16:01:58 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09G1whE031653; Sat, 9 Jan 2016 16:01:58 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091601.u09G1whE031653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293526 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:01:59 -0000 Author: dchagin Date: Sat Jan 9 16:01:57 2016 New Revision: 293526 URL: https://svnweb.freebsd.org/changeset/base/293526 Log: MFC r283447: Fix build with KTR option. Modified: stable/10/sys/compat/linux/linux_util.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_util.h ============================================================================== --- stable/10/sys/compat/linux/linux_util.h Sat Jan 9 16:00:13 2016 (r293525) +++ stable/10/sys/compat/linux/linux_util.h Sat Jan 9 16:01:57 2016 (r293526) @@ -115,7 +115,6 @@ void linux_free_get_char_devices(char *s #define LINUX_CTRFMT(nm, fmt) #nm"("fmt")" #define LINUX_CTR6(f, m, p1, p2, p3, p4, p5, p6) do { \ - if (ldebug(f)) \ CTR6(KTR_LINUX, LINUX_CTRFMT(f, m), \ p1, p2, p3, p4, p5, p6); \ } while (0) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:08:24 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43131A6965E; Sat, 9 Jan 2016 16:08:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D67AA17B7; Sat, 9 Jan 2016 16:08:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09G8Ntv031915; Sat, 9 Jan 2016 16:08:23 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09G8MqY031906; Sat, 9 Jan 2016 16:08:22 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091608.u09G8MqY031906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293527 - in stable/10/sys: amd64/linux32 compat/linprocfs compat/linsysfs compat/linux conf i386/linux modules modules/linprocfs modules/linsysfs modules/linux modules/linux_common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:08:24 -0000 Author: dchagin Date: Sat Jan 9 16:08:22 2016 New Revision: 293527 URL: https://svnweb.freebsd.org/changeset/base/293527 Log: MFC r283421: Introduce a new module linux_common.ko which is intended for the following primary purposes: 1. Remove the dependency of linsysfs and linprocfs modules from linux.ko, which will be architecture specific on amd64. 2. Incorporate into linux_common.ko general code for platforms on which we'll support two Linuxulator modules (for both instruction set - 32 & 64 bit). 3. Move malloc(9) declaration to linux_common.ko, to enable getting memory usage statistics properly. Currently linux_common.ko incorporates a code from linux_mib.c and linux_util.c and linprocfs, linsysfs and linux kernel modules depend on linux_common.ko. Temporarily remove dtrace garbage from linux_mib.c and linux_util.c Added: stable/10/sys/compat/linux/linux_common.c - copied unchanged from r283421, head/sys/compat/linux/linux_common.c stable/10/sys/modules/linux_common/ - copied from r283421, head/sys/modules/linux_common/ Modified: stable/10/sys/amd64/linux32/linux.h stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/compat/linprocfs/linprocfs.c stable/10/sys/compat/linsysfs/linsysfs.c stable/10/sys/compat/linux/linux_ioctl.c stable/10/sys/compat/linux/linux_ioctl.h stable/10/sys/compat/linux/linux_mib.c stable/10/sys/compat/linux/linux_mib.h stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/linux/linux_misc.h stable/10/sys/compat/linux/linux_util.c stable/10/sys/compat/linux/linux_util.h stable/10/sys/conf/files.amd64 stable/10/sys/i386/linux/linux.h stable/10/sys/i386/linux/linux_sysvec.c stable/10/sys/modules/Makefile stable/10/sys/modules/linprocfs/Makefile stable/10/sys/modules/linsysfs/Makefile stable/10/sys/modules/linux/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux.h ============================================================================== --- stable/10/sys/amd64/linux32/linux.h Sat Jan 9 16:01:57 2016 (r293526) +++ stable/10/sys/amd64/linux32/linux.h Sat Jan 9 16:08:22 2016 (r293527) @@ -46,10 +46,6 @@ extern u_char linux_debug_map[]; (long)td->td_proc->p_pid, (long)td->td_tid #define LINUX_DTRACE linuxulator32 -#ifdef MALLOC_DECLARE -MALLOC_DECLARE(M_LINUX); -#endif - #define LINUX32_MAXUSER ((1ul << 32) - PAGE_SIZE) #define LINUX32_SHAREDPAGE (LINUX32_MAXUSER - PAGE_SIZE) #define LINUX32_USRSTACK LINUX32_SHAREDPAGE Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 16:01:57 2016 (r293526) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 16:08:22 2016 (r293527) @@ -87,8 +87,6 @@ __FBSDID("$FreeBSD$"); MODULE_VERSION(linux, 1); -MALLOC_DEFINE(M_LINUX, "linux", "Linux mode structures"); - #define AUXARGS_ENTRY_32(pos, id, val) \ do { \ suword32(pos++, id); \ @@ -120,7 +118,6 @@ extern char _binary_linux32_locore_o_end extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL]; SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); -SET_DECLARE(linux_device_handler_set, struct linux_device_handler); static int elf_linux_fixup(register_t **stack_base, struct image_params *iparams); @@ -976,6 +973,13 @@ static u_long linux32_maxvmem = LINUX32_ SYSCTL_ULONG(_compat_linux32, OID_AUTO, maxvmem, CTLFLAG_RW, &linux32_maxvmem, 0, ""); +#if defined(DEBUG) +SYSCTL_PROC(_compat_linux32, OID_AUTO, debug, + CTLTYPE_STRING | CTLFLAG_RW, + 0, 0, linux_sysctl_debug, "A", + "Linux debugging control"); +#endif + static void linux32_fixlimit(struct rlimit *rl, int which) { @@ -1152,7 +1156,6 @@ linux_elf_modevent(module_t mod, int typ Elf32_Brandinfo **brandinfo; int error; struct linux_ioctl_handler **lihp; - struct linux_device_handler **ldhp; error = 0; @@ -1165,8 +1168,6 @@ linux_elf_modevent(module_t mod, int typ if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_register_handler(*lihp); - SET_FOREACH(ldhp, linux_device_handler_set) - linux_device_register_handler(*ldhp); LIST_INIT(&futex_list); mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, @@ -1175,7 +1176,6 @@ linux_elf_modevent(module_t mod, int typ linux_proc_exec, NULL, 1000); linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); - linux_osd_jail_register(); stclohz = (stathz ? stathz : hz); if (bootverbose) printf("Linux ELF exec handler installed\n"); @@ -1196,13 +1196,10 @@ linux_elf_modevent(module_t mod, int typ if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_unregister_handler(*lihp); - SET_FOREACH(ldhp, linux_device_handler_set) - linux_device_unregister_handler(*ldhp); mtx_destroy(&futex_mtx); EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); EVENTHANDLER_DEREGISTER(thread_dtor, linux_thread_dtor_tag); - linux_osd_jail_deregister(); if (bootverbose) printf("Linux ELF exec handler removed\n"); } else @@ -1221,3 +1218,4 @@ static moduledata_t linux_elf_mod = { }; DECLARE_MODULE_TIED(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); +MODULE_DEPEND(linuxelf, linux_common, 1, 1, 1); Modified: stable/10/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/10/sys/compat/linprocfs/linprocfs.c Sat Jan 9 16:01:57 2016 (r293526) +++ stable/10/sys/compat/linprocfs/linprocfs.c Sat Jan 9 16:08:22 2016 (r293527) @@ -39,8 +39,6 @@ * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 */ -#include "opt_compat.h" - #include __FBSDID("$FreeBSD$"); @@ -68,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -78,7 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include @@ -98,11 +97,6 @@ __FBSDID("$FreeBSD$"); #include #endif /* __i386__ || __amd64__ */ -#ifdef COMPAT_FREEBSD32 -#include -#endif - -#include #include #include #include @@ -1093,6 +1087,35 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) } /* + * Criteria for interface name translation + */ +#define IFP_IS_ETH(ifp) (ifp->if_type == IFT_ETHER) + +static int +linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen) +{ + struct ifnet *ifscan; + int ethno; + + IFNET_RLOCK_ASSERT(); + + /* Short-circuit non ethernet interfaces */ + if (!IFP_IS_ETH(ifp)) + return (strlcpy(buffer, ifp->if_xname, buflen)); + + /* Determine the (relative) unit number for ethernet interfaces */ + ethno = 0; + TAILQ_FOREACH(ifscan, &V_ifnet, if_link) { + if (ifscan == ifp) + return (snprintf(buffer, buflen, "eth%d", ethno)); + if (IFP_IS_ETH(ifscan)) + ethno++; + } + + return (0); +} + +/* * Filler function for proc/net/dev */ static int @@ -1239,8 +1262,6 @@ linprocfs_doscsiscsi(PFS_FILL_ARGS) return (0); } -extern struct cdevsw *cdevsw[]; - /* * Filler function for proc/devices */ @@ -1455,7 +1476,11 @@ linprocfs_uninit(PFS_INIT_ARGS) } PSEUDOFS(linprocfs, 1, 0); +#if defined(__amd64__) +MODULE_DEPEND(linprocfs, linux_common, 1, 1, 1); +#else MODULE_DEPEND(linprocfs, linux, 1, 1, 1); +#endif MODULE_DEPEND(linprocfs, procfs, 1, 1, 1); MODULE_DEPEND(linprocfs, sysvmsg, 1, 1, 1); MODULE_DEPEND(linprocfs, sysvsem, 1, 1, 1); Modified: stable/10/sys/compat/linsysfs/linsysfs.c ============================================================================== --- stable/10/sys/compat/linsysfs/linsysfs.c Sat Jan 9 16:01:57 2016 (r293526) +++ stable/10/sys/compat/linsysfs/linsysfs.c Sat Jan 9 16:08:22 2016 (r293527) @@ -61,12 +61,6 @@ __FBSDID("$FreeBSD$"); #include -#include "opt_compat.h" -#ifdef COMPAT_LINUX32 /* XXX */ -#include -#else -#include -#endif #include #include #include @@ -281,4 +275,8 @@ linsysfs_uninit(PFS_INIT_ARGS) } PSEUDOFS(linsysfs, 1, 0); +#if defined(__amd64__) +MODULE_DEPEND(linsysfs, linux_common, 1, 1, 1); +#else MODULE_DEPEND(linsysfs, linux, 1, 1, 1); +#endif Copied: stable/10/sys/compat/linux/linux_common.c (from r283421, head/sys/compat/linux/linux_common.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/compat/linux/linux_common.c Sat Jan 9 16:08:22 2016 (r293527, copy of r283421, head/sys/compat/linux/linux_common.c) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2014 Vassilis Laganakos + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +MODULE_VERSION(linux_common, 1); + +SET_DECLARE(linux_device_handler_set, struct linux_device_handler); + + +static int +linux_common_modevent(module_t mod, int type, void *data) +{ + struct linux_device_handler **ldhp; + + switch(type) { + case MOD_LOAD: + linux_osd_jail_register(); + SET_FOREACH(ldhp, linux_device_handler_set) + linux_device_register_handler(*ldhp); + break; + case MOD_UNLOAD: + linux_osd_jail_deregister(); + SET_FOREACH(ldhp, linux_device_handler_set) + linux_device_unregister_handler(*ldhp); + break; + default: + return (EOPNOTSUPP); + } + return (0); +} + +static moduledata_t linux_common_mod = { + "linuxcommon", + linux_common_modevent, + 0 +}; + +DECLARE_MODULE(linuxcommon, linux_common_mod, SI_SUB_EXEC, SI_ORDER_ANY); Modified: stable/10/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.c Sat Jan 9 16:01:57 2016 (r293526) +++ stable/10/sys/compat/linux/linux_ioctl.c Sat Jan 9 16:08:22 2016 (r293527) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -2108,34 +2107,6 @@ linux_ioctl_console(struct thread *td, s #define IFP_IS_ETH(ifp) (ifp->if_type == IFT_ETHER) /* - * Interface function used by linprocfs (at the time of writing). It's not - * used by the Linuxulator itself. - */ -int -linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen) -{ - struct ifnet *ifscan; - int ethno; - - IFNET_RLOCK_ASSERT(); - - /* Short-circuit non ethernet interfaces */ - if (!IFP_IS_ETH(ifp)) - return (strlcpy(buffer, ifp->if_xname, buflen)); - - /* Determine the (relative) unit number for ethernet interfaces */ - ethno = 0; - TAILQ_FOREACH(ifscan, &V_ifnet, if_link) { - if (ifscan == ifp) - return (snprintf(buffer, buflen, "eth%d", ethno)); - if (IFP_IS_ETH(ifscan)) - ethno++; - } - - return (0); -} - -/* * Translate a Linux interface name to a FreeBSD interface name, * and return the associated ifnet structure * bsdname and lxname need to be least IFNAMSIZ bytes long, but Modified: stable/10/sys/compat/linux/linux_ioctl.h ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.h Sat Jan 9 16:01:57 2016 (r293526) +++ stable/10/sys/compat/linux/linux_ioctl.h Sat Jan 9 16:08:22 2016 (r293527) @@ -581,13 +581,6 @@ #define LINUX_IOCTL_DRM_MAX 0x64ff /* - * This doesn't really belong here, but I can't think of a better - * place to put it. - */ -struct ifnet; -int linux_ifname(struct ifnet *, char *, size_t); - -/* * video */ #define LINUX_VIDIOCGCAP 0x7601 Modified: stable/10/sys/compat/linux/linux_mib.c ============================================================================== --- stable/10/sys/compat/linux/linux_mib.c Sat Jan 9 16:01:57 2016 (r293526) +++ stable/10/sys/compat/linux/linux_mib.c Sat Jan 9 16:08:22 2016 (r293527) @@ -29,9 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" -#include "opt_kdtrace.h" - #include #include #include @@ -42,85 +39,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#ifdef COMPAT_LINUX32 -#include -#else -#include -#endif -#include #include #include -/* DTrace init */ -LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); - -/** - * DTrace probes in this module. - */ -LIN_SDT_PROBE_DEFINE0(mib, linux_sysctl_osname, entry); -LIN_SDT_PROBE_DEFINE1(mib, linux_sysctl_osname, sysctl_string_error, "int"); -LIN_SDT_PROBE_DEFINE1(mib, linux_sysctl_osname, return, "int"); - -LIN_SDT_PROBE_DEFINE0(mib, linux_sysctl_osrelease, entry); -LIN_SDT_PROBE_DEFINE1(mib, linux_sysctl_osrelease, sysctl_string_error, "int"); -LIN_SDT_PROBE_DEFINE1(mib, linux_sysctl_osrelease, return, "int"); -LIN_SDT_PROBE_DEFINE0(mib, linux_sysctl_oss_version, entry); -LIN_SDT_PROBE_DEFINE1(mib, linux_sysctl_oss_version, sysctl_string_error, - "int"); -LIN_SDT_PROBE_DEFINE1(mib, linux_sysctl_oss_version, return, "int"); -LIN_SDT_PROBE_DEFINE2(mib, linux_map_osrel, entry, "char *", "int *"); -LIN_SDT_PROBE_DEFINE1(mib, linux_map_osrel, return, "int"); -LIN_SDT_PROBE_DEFINE2(mib, linux_get_prison, entry, "struct prison *", - "struct prison **"); -LIN_SDT_PROBE_DEFINE1(mib, linux_get_prison, return, "struct linux_prison *"); -LIN_SDT_PROBE_DEFINE2(mib, linux_alloc_prison, entry, "struct prison *", - "struct linux_prison **"); -LIN_SDT_PROBE_DEFINE1(mib, linux_alloc_prison, return, "int"); -LIN_SDT_PROBE_DEFINE2(mib, linux_prison_create, entry, "void *", "void *"); -LIN_SDT_PROBE_DEFINE1(mib, linux_prison_create, vfs_copyopt_error, "int"); -LIN_SDT_PROBE_DEFINE1(mib, linux_prison_create, return, "int"); -LIN_SDT_PROBE_DEFINE2(mib, linux_prison_check, entry, "void *", "void *"); -LIN_SDT_PROBE_DEFINE1(mib, linux_prison_check, vfs_copyopt_error, "int"); -LIN_SDT_PROBE_DEFINE1(mib, linux_prison_check, vfs_getopt_error, "int"); -LIN_SDT_PROBE_DEFINE1(mib, linux_prison_check, return, "int"); -LIN_SDT_PROBE_DEFINE2(mib, linux_prison_set, entry, "void *", "void *"); -LIN_SDT_PROBE_DEFINE1(mib, linux_prison_set, vfs_copyopt_error, "int"); -LIN_SDT_PROBE_DEFINE1(mib, linux_prison_set, vfs_getopt_error, "int"); -LIN_SDT_PROBE_DEFINE1(mib, linux_prison_set, return, "int"); -LIN_SDT_PROBE_DEFINE2(mib, linux_prison_get, entry, "void *", "void *"); -LIN_SDT_PROBE_DEFINE1(mib, linux_prison_get, vfs_setopt_error, "int"); -LIN_SDT_PROBE_DEFINE1(mib, linux_prison_get, vfs_setopts_error, "int"); -LIN_SDT_PROBE_DEFINE1(mib, linux_prison_get, return, "int"); -LIN_SDT_PROBE_DEFINE1(mib, linux_prison_destructor, entry, "void *"); -LIN_SDT_PROBE_DEFINE0(mib, linux_prison_destructor, return); -LIN_SDT_PROBE_DEFINE0(mib, linux_osd_jail_register, entry); -LIN_SDT_PROBE_DEFINE0(mib, linux_osd_jail_register, return); -LIN_SDT_PROBE_DEFINE0(mib, linux_osd_jail_deregister, entry); -LIN_SDT_PROBE_DEFINE0(mib, linux_osd_jail_deregister, return); -LIN_SDT_PROBE_DEFINE2(mib, linux_get_osname, entry, "struct thread *", - "char *"); -LIN_SDT_PROBE_DEFINE0(mib, linux_get_osname, return); -LIN_SDT_PROBE_DEFINE2(mib, linux_set_osname, entry, "struct thread *", - "char *"); -LIN_SDT_PROBE_DEFINE1(mib, linux_set_osname, return, "int"); -LIN_SDT_PROBE_DEFINE2(mib, linux_get_osrelease, entry, "struct thread *", - "char *"); -LIN_SDT_PROBE_DEFINE0(mib, linux_get_osrelease, return); -LIN_SDT_PROBE_DEFINE1(mib, linux_kernver, entry, "struct thread *"); -LIN_SDT_PROBE_DEFINE1(mib, linux_kernver, return, "int"); -LIN_SDT_PROBE_DEFINE2(mib, linux_set_osrelease, entry, "struct thread *", - "char *"); -LIN_SDT_PROBE_DEFINE1(mib, linux_set_osrelease, return, "int"); -LIN_SDT_PROBE_DEFINE1(mib, linux_get_oss_version, entry, "struct thread *"); -LIN_SDT_PROBE_DEFINE1(mib, linux_get_oss_version, return, "int"); - -LIN_SDT_PROBE_DEFINE2(mib, linux_set_oss_version, entry, "struct thread *", - "int"); -LIN_SDT_PROBE_DEFINE1(mib, linux_set_oss_version, return, "int"); - struct linux_prison { char pr_osname[LINUX_MAX_UTSNAME]; char pr_osrelease[LINUX_MAX_UTSNAME]; @@ -137,8 +60,7 @@ static struct linux_prison lprison0 = { static unsigned linux_osd_jail_slot; -static SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0, - "Linux mode"); +SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0, "Linux mode"); static int linux_set_osname(struct thread *td, char *osname); static int linux_set_osrelease(struct thread *td, char *osrelease); @@ -150,19 +72,12 @@ linux_sysctl_osname(SYSCTL_HANDLER_ARGS) char osname[LINUX_MAX_UTSNAME]; int error; - LIN_SDT_PROBE0(mib, linux_sysctl_osname, entry); - linux_get_osname(req->td, osname); error = sysctl_handle_string(oidp, osname, LINUX_MAX_UTSNAME, req); - if (error != 0 || req->newptr == NULL) { - LIN_SDT_PROBE1(mib, linux_sysctl_osname, sysctl_string_error, - error); - LIN_SDT_PROBE1(mib, linux_sysctl_osname, return, error); + if (error != 0 || req->newptr == NULL) return (error); - } error = linux_set_osname(req->td, osname); - LIN_SDT_PROBE1(mib, linux_sysctl_osname, return, error); return (error); } @@ -177,19 +92,12 @@ linux_sysctl_osrelease(SYSCTL_HANDLER_AR char osrelease[LINUX_MAX_UTSNAME]; int error; - LIN_SDT_PROBE0(mib, linux_sysctl_osrelease, entry); - linux_get_osrelease(req->td, osrelease); error = sysctl_handle_string(oidp, osrelease, LINUX_MAX_UTSNAME, req); - if (error != 0 || req->newptr == NULL) { - LIN_SDT_PROBE1(mib, linux_sysctl_osrelease, sysctl_string_error, - error); - LIN_SDT_PROBE1(mib, linux_sysctl_osrelease, return, error); + if (error != 0 || req->newptr == NULL) return (error); - } error = linux_set_osrelease(req->td, osrelease); - LIN_SDT_PROBE1(mib, linux_sysctl_osrelease, return, error); return (error); } @@ -204,19 +112,12 @@ linux_sysctl_oss_version(SYSCTL_HANDLER_ int oss_version; int error; - LIN_SDT_PROBE0(mib, linux_sysctl_oss_version, entry); - oss_version = linux_get_oss_version(req->td); error = sysctl_handle_int(oidp, &oss_version, 0, req); - if (error != 0 || req->newptr == NULL) { - LIN_SDT_PROBE1(mib, linux_sysctl_oss_version, - sysctl_string_error, error); - LIN_SDT_PROBE1(mib, linux_sysctl_oss_version, return, error); + if (error != 0 || req->newptr == NULL) return (error); - } error = linux_set_oss_version(req->td, oss_version); - LIN_SDT_PROBE1(mib, linux_sysctl_oss_version, return, error); return (error); } @@ -234,37 +135,26 @@ linux_map_osrel(char *osrelease, int *os char *sep, *eosrelease; int len, v0, v1, v2, v; - LIN_SDT_PROBE2(mib, linux_map_osrel, entry, osrelease, osrel); - len = strlen(osrelease); eosrelease = osrelease + len; v0 = strtol(osrelease, &sep, 10); - if (osrelease == sep || sep + 1 >= eosrelease || *sep != '.') { - LIN_SDT_PROBE1(mib, linux_map_osrel, return, EINVAL); + if (osrelease == sep || sep + 1 >= eosrelease || *sep != '.') return (EINVAL); - } osrelease = sep + 1; v1 = strtol(osrelease, &sep, 10); - if (osrelease == sep || sep + 1 >= eosrelease || *sep != '.') { - LIN_SDT_PROBE1(mib, linux_map_osrel, return, EINVAL); + if (osrelease == sep || sep + 1 >= eosrelease || *sep != '.') return (EINVAL); - } osrelease = sep + 1; v2 = strtol(osrelease, &sep, 10); - if (osrelease == sep || sep != eosrelease) { - LIN_SDT_PROBE1(mib, linux_map_osrel, return, EINVAL); + if (osrelease == sep || sep != eosrelease) return (EINVAL); - } v = v0 * 1000000 + v1 * 1000 + v2; - if (v < 1000000) { - LIN_SDT_PROBE1(mib, linux_map_osrel, return, EINVAL); + if (v < 1000000) return (EINVAL); - } *osrel = v; - LIN_SDT_PROBE1(mib, linux_map_osrel, return, 0); return (0); } @@ -278,8 +168,6 @@ linux_find_prison(struct prison *spr, st struct prison *pr; struct linux_prison *lpr; - LIN_SDT_PROBE2(mib, linux_get_prison, entry, spr, prp); - if (!linux_osd_jail_slot) /* In case osd_register failed. */ spr = &prison0; @@ -294,7 +182,6 @@ linux_find_prison(struct prison *spr, st } *prp = pr; - LIN_SDT_PROBE1(mib, linux_get_prison, return, lpr); return (lpr); } @@ -309,8 +196,6 @@ linux_alloc_prison(struct prison *pr, st struct linux_prison *lpr, *nlpr; int error; - LIN_SDT_PROBE2(mib, linux_alloc_prison, entry, pr, lprp); - /* If this prison already has Linux info, return that. */ error = 0; lpr = linux_find_prison(pr, &ppr); @@ -344,7 +229,6 @@ linux_alloc_prison(struct prison *pr, st else mtx_unlock(&pr->pr_mtx); - LIN_SDT_PROBE1(mib, linux_alloc_prison, return, error); return (error); } @@ -356,26 +240,16 @@ linux_prison_create(void *obj, void *dat { struct prison *pr = obj; struct vfsoptlist *opts = data; - int jsys, error; - - LIN_SDT_PROBE2(mib, linux_prison_create, entry, obj, data); + int jsys; - error = vfs_copyopt(opts, "linux", &jsys, sizeof(jsys)); - if (error != 0) { - LIN_SDT_PROBE1(mib, linux_prison_create, vfs_copyopt_error, - error); - } else if (jsys == JAIL_SYS_INHERIT) { - LIN_SDT_PROBE1(mib, linux_prison_create, return, 0); + if (vfs_copyopt(opts, "linux", &jsys, sizeof(jsys)) == 0 && + jsys == JAIL_SYS_INHERIT) return (0); - } /* * Inherit a prison's initial values from its parent * (different from JAIL_SYS_INHERIT which also inherits changes). */ - error = linux_alloc_prison(pr, NULL); - - LIN_SDT_PROBE1(mib, linux_prison_create, return, error); - return (error); + return (linux_alloc_prison(pr, NULL)); } static int @@ -385,80 +259,46 @@ linux_prison_check(void *obj __unused, v char *osname, *osrelease; int error, jsys, len, osrel, oss_version; - LIN_SDT_PROBE2(mib, linux_prison_check, entry, obj, data); - /* Check that the parameters are correct. */ error = vfs_copyopt(opts, "linux", &jsys, sizeof(jsys)); - if (error != 0) { - LIN_SDT_PROBE1(mib, linux_prison_check, vfs_copyopt_error, - error); - } if (error != ENOENT) { - if (error != 0) { - LIN_SDT_PROBE1(mib, linux_prison_check, return, error); + if (error != 0) return (error); - } - if (jsys != JAIL_SYS_NEW && jsys != JAIL_SYS_INHERIT) { - LIN_SDT_PROBE1(mib, linux_prison_check, return, EINVAL); + if (jsys != JAIL_SYS_NEW && jsys != JAIL_SYS_INHERIT) return (EINVAL); - } } error = vfs_getopt(opts, "linux.osname", (void **)&osname, &len); - if (error != 0) { - LIN_SDT_PROBE1(mib, linux_prison_check, vfs_getopt_error, - error); - } if (error != ENOENT) { - if (error != 0) { - LIN_SDT_PROBE1(mib, linux_prison_check, return, error); + if (error != 0) return (error); - } - if (len == 0 || osname[len - 1] != '\0') { - LIN_SDT_PROBE1(mib, linux_prison_check, return, EINVAL); + if (len == 0 || osname[len - 1] != '\0') return (EINVAL); - } if (len > LINUX_MAX_UTSNAME) { vfs_opterror(opts, "linux.osname too long"); - LIN_SDT_PROBE1(mib, linux_prison_check, return, - ENAMETOOLONG); return (ENAMETOOLONG); } } error = vfs_getopt(opts, "linux.osrelease", (void **)&osrelease, &len); - if (error != 0) { - LIN_SDT_PROBE1(mib, linux_prison_check, vfs_getopt_error, - error); - } if (error != ENOENT) { - if (error != 0) { - LIN_SDT_PROBE1(mib, linux_prison_check, return, error); + if (error != 0) return (error); - } - if (len == 0 || osrelease[len - 1] != '\0') { - LIN_SDT_PROBE1(mib, linux_prison_check, return, EINVAL); + if (len == 0 || osrelease[len - 1] != '\0') return (EINVAL); - } if (len > LINUX_MAX_UTSNAME) { vfs_opterror(opts, "linux.osrelease too long"); - LIN_SDT_PROBE1(mib, linux_prison_check, return, - ENAMETOOLONG); return (ENAMETOOLONG); } error = linux_map_osrel(osrelease, &osrel); if (error != 0) { vfs_opterror(opts, "linux.osrelease format error"); - LIN_SDT_PROBE1(mib, linux_prison_check, return, error); return (error); } } error = vfs_copyopt(opts, "linux.oss_version", &oss_version, sizeof(oss_version)); - if (error != 0) - LIN_SDT_PROBE1(mib, linux_prison_check, vfs_copyopt_error, error); if (error == ENOENT) error = 0; - LIN_SDT_PROBE1(mib, linux_prison_check, return, error); return (error); } @@ -471,32 +311,22 @@ linux_prison_set(void *obj, void *data) char *osname, *osrelease; int error, gotversion, jsys, len, oss_version; - LIN_SDT_PROBE2(mib, linux_prison_set, entry, obj, data); - /* Set the parameters, which should be correct. */ error = vfs_copyopt(opts, "linux", &jsys, sizeof(jsys)); - if (error != 0) - LIN_SDT_PROBE1(mib, linux_prison_set, vfs_copyopt_error, error); if (error == ENOENT) jsys = -1; error = vfs_getopt(opts, "linux.osname", (void **)&osname, &len); - if (error != 0) - LIN_SDT_PROBE1(mib, linux_prison_set, vfs_getopt_error, error); if (error == ENOENT) osname = NULL; else jsys = JAIL_SYS_NEW; error = vfs_getopt(opts, "linux.osrelease", (void **)&osrelease, &len); - if (error != 0) - LIN_SDT_PROBE1(mib, linux_prison_set, vfs_getopt_error, error); if (error == ENOENT) osrelease = NULL; else jsys = JAIL_SYS_NEW; error = vfs_copyopt(opts, "linux.oss_version", &oss_version, sizeof(oss_version)); - if (error != 0) - LIN_SDT_PROBE1(mib, linux_prison_set, vfs_copyopt_error, error); if (error == ENOENT) gotversion = 0; else { @@ -518,15 +348,12 @@ linux_prison_set(void *obj, void *data) error = linux_alloc_prison(pr, &lpr); if (error) { mtx_unlock(&pr->pr_mtx); - LIN_SDT_PROBE1(mib, linux_prison_set, return, error); return (error); } if (osrelease) { error = linux_map_osrel(osrelease, &lpr->pr_osrel); if (error) { mtx_unlock(&pr->pr_mtx); - LIN_SDT_PROBE1(mib, linux_prison_set, return, - error); return (error); } strlcpy(lpr->pr_osrelease, osrelease, @@ -539,7 +366,6 @@ linux_prison_set(void *obj, void *data) mtx_unlock(&pr->pr_mtx); } - LIN_SDT_PROBE1(mib, linux_prison_set, return, 0); return (0); } @@ -562,74 +388,44 @@ linux_prison_get(void *obj, void *data) static int version0; - LIN_SDT_PROBE2(mib, linux_prison_get, entry, obj, data); - /* See if this prison is the one with the Linux info. */ lpr = linux_find_prison(pr, &ppr); i = (ppr == pr) ? JAIL_SYS_NEW : JAIL_SYS_INHERIT; error = vfs_setopt(opts, "linux", &i, sizeof(i)); - if (error != 0) { - LIN_SDT_PROBE1(mib, linux_prison_get, vfs_setopt_error, error); - if (error != ENOENT) - goto done; - } + if (error != 0 && error != ENOENT) + goto done; if (i) { error = vfs_setopts(opts, "linux.osname", lpr->pr_osname); - if (error != 0) { - LIN_SDT_PROBE1(mib, linux_prison_get, vfs_setopts_error, - error); - if (error != ENOENT) - goto done; - } + if (error != 0 && error != ENOENT) + goto done; error = vfs_setopts(opts, "linux.osrelease", lpr->pr_osrelease); - if (error != 0) { - LIN_SDT_PROBE1(mib, linux_prison_get, vfs_setopts_error, - error); - if (error != ENOENT) - goto done; - } + if (error != 0 && error != ENOENT) + goto done; error = vfs_setopt(opts, "linux.oss_version", &lpr->pr_oss_version, sizeof(lpr->pr_oss_version)); - if (error != 0) { - LIN_SDT_PROBE1(mib, linux_prison_get, vfs_setopt_error, - error); - if(error != ENOENT) - goto done; - } + if (error != 0 && error != ENOENT) + goto done; } else { /* * If this prison is inheriting its Linux info, report * empty/zero parameters. */ error = vfs_setopts(opts, "linux.osname", ""); - if (error != 0) { - LIN_SDT_PROBE1(mib, linux_prison_get, vfs_setopts_error, - error); - if(error != ENOENT) - goto done; - } + if (error != 0 && error != ENOENT) + goto done; error = vfs_setopts(opts, "linux.osrelease", ""); - if (error != 0) { - LIN_SDT_PROBE1(mib, linux_prison_get, vfs_setopts_error, - error); - if(error != ENOENT) - goto done; - } + if (error != 0 && error != ENOENT) + goto done; error = vfs_setopt(opts, "linux.oss_version", &version0, sizeof(lpr->pr_oss_version)); - if (error != 0) { - LIN_SDT_PROBE1(mib, linux_prison_get, vfs_setopt_error, - error); - if(error != ENOENT) - goto done; - } + if (error != 0 && error != ENOENT) + goto done; } error = 0; done: mtx_unlock(&ppr->pr_mtx); - LIN_SDT_PROBE1(mib, linux_prison_get, return, error); return (error); } @@ -637,9 +433,7 @@ static void linux_prison_destructor(void *data) { - LIN_SDT_PROBE1(mib, linux_prison_destructor, entry, data); free(data, M_PRISON); - LIN_SDT_PROBE0(mib, linux_prison_destructor, return); } void @@ -653,8 +447,6 @@ linux_osd_jail_register(void) [PR_METHOD_CHECK] = linux_prison_check }; - LIN_SDT_PROBE0(mib, linux_osd_jail_register, entry); - linux_osd_jail_slot = osd_jail_register(linux_prison_destructor, methods); if (linux_osd_jail_slot > 0) { @@ -664,20 +456,14 @@ linux_osd_jail_register(void) (void)linux_alloc_prison(pr, NULL); sx_xunlock(&allprison_lock); } - - LIN_SDT_PROBE0(mib, linux_osd_jail_register, return); } void linux_osd_jail_deregister(void) { - LIN_SDT_PROBE0(mib, linux_osd_jail_register, entry); - if (linux_osd_jail_slot) osd_jail_deregister(linux_osd_jail_slot); - - LIN_SDT_PROBE0(mib, linux_osd_jail_register, return); } void @@ -686,13 +472,9 @@ linux_get_osname(struct thread *td, char struct prison *pr; struct linux_prison *lpr; - LIN_SDT_PROBE2(mib, linux_get_osname, entry, td, dst); - lpr = linux_find_prison(td->td_ucred->cr_prison, &pr); bcopy(lpr->pr_osname, dst, LINUX_MAX_UTSNAME); mtx_unlock(&pr->pr_mtx); - - LIN_SDT_PROBE0(mib, linux_get_osname, return); } static int @@ -701,13 +483,10 @@ linux_set_osname(struct thread *td, char struct prison *pr; struct linux_prison *lpr; - LIN_SDT_PROBE2(mib, linux_set_osname, entry, td, osname); - lpr = linux_find_prison(td->td_ucred->cr_prison, &pr); strlcpy(lpr->pr_osname, osname, LINUX_MAX_UTSNAME); mtx_unlock(&pr->pr_mtx); - LIN_SDT_PROBE1(mib, linux_set_osname, return, 0); return (0); } @@ -717,13 +496,9 @@ linux_get_osrelease(struct thread *td, c struct prison *pr; struct linux_prison *lpr; - LIN_SDT_PROBE2(mib, linux_get_osrelease, entry, td, dst); - lpr = linux_find_prison(td->td_ucred->cr_prison, &pr); bcopy(lpr->pr_osrelease, dst, LINUX_MAX_UTSNAME); mtx_unlock(&pr->pr_mtx); - - LIN_SDT_PROBE0(mib, linux_get_osrelease, return); } int @@ -733,13 +508,10 @@ linux_kernver(struct thread *td) struct linux_prison *lpr; int osrel; - LIN_SDT_PROBE1(mib, linux_kernver, entry, td); - lpr = linux_find_prison(td->td_ucred->cr_prison, &pr); osrel = lpr->pr_osrel; mtx_unlock(&pr->pr_mtx); - LIN_SDT_PROBE1(mib, linux_kernver, return, osrel); return (osrel); } @@ -750,15 +522,12 @@ linux_set_osrelease(struct thread *td, c struct linux_prison *lpr; int error; - LIN_SDT_PROBE2(mib, linux_set_osrelease, entry, td, osrelease); - lpr = linux_find_prison(td->td_ucred->cr_prison, &pr); error = linux_map_osrel(osrelease, &lpr->pr_osrel); if (error == 0) strlcpy(lpr->pr_osrelease, osrelease, LINUX_MAX_UTSNAME); mtx_unlock(&pr->pr_mtx); - LIN_SDT_PROBE1(mib, linux_set_osrelease, return, error); return (error); } @@ -769,13 +538,10 @@ linux_get_oss_version(struct thread *td) struct linux_prison *lpr; int version; - LIN_SDT_PROBE1(mib, linux_get_oss_version, entry, td); - lpr = linux_find_prison(td->td_ucred->cr_prison, &pr); version = lpr->pr_oss_version; mtx_unlock(&pr->pr_mtx); - LIN_SDT_PROBE1(mib, linux_get_oss_version, return, version); return (version); } @@ -785,74 +551,9 @@ linux_set_oss_version(struct thread *td, struct prison *pr; struct linux_prison *lpr; - LIN_SDT_PROBE2(mib, linux_set_oss_version, entry, td, oss_version); - lpr = linux_find_prison(td->td_ucred->cr_prison, &pr); lpr->pr_oss_version = oss_version; mtx_unlock(&pr->pr_mtx); - LIN_SDT_PROBE1(mib, linux_set_oss_version, return, 0); - return (0); -} - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:11:11 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC01DA69832; Sat, 9 Jan 2016 16:11:11 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B871B1A12; Sat, 9 Jan 2016 16:11:11 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GBBQi032104; Sat, 9 Jan 2016 16:11:11 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GBAkw032095; Sat, 9 Jan 2016 16:11:10 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091611.u09GBAkw032095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:11:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293528 - in stable/10/sys: amd64/linux32 compat/linux modules/linux modules/linux_common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:11:12 -0000 Author: dchagin Date: Sat Jan 9 16:11:09 2016 New Revision: 293528 URL: https://svnweb.freebsd.org/changeset/base/293528 Log: MFC r283422: Refund the proc emuldata struct for future use. For now move flags from thread emuldata to proc emuldata as it was originally intended. As we can have both 64 & 32 bit Linuxulator running any eventhandler can be called twice for us. To prevent this move eventhandlers code from linux_emul.c to the linux_common.ko module. Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/compat/linux/linux_common.c stable/10/sys/compat/linux/linux_emul.c stable/10/sys/compat/linux/linux_emul.h stable/10/sys/compat/linux/linux_fork.c stable/10/sys/compat/linux/linux_futex.c stable/10/sys/compat/linux/linux_misc.c stable/10/sys/modules/linux/Makefile stable/10/sys/modules/linux_common/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 16:08:22 2016 (r293527) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 16:11:09 2016 (r293528) @@ -130,10 +130,6 @@ static boolean_t linux32_trans_osrel(con static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); -static eventhandler_tag linux_exit_tag; -static eventhandler_tag linux_exec_tag; -static eventhandler_tag linux_thread_dtor_tag; - /* * Linux syscalls return negative errno's, we do positive and map them * Reference: @@ -1170,12 +1166,6 @@ linux_elf_modevent(module_t mod, int typ linux_ioctl_register_handler(*lihp); LIST_INIT(&futex_list); mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); - linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, - linux_proc_exit, NULL, 1000); - linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, - linux_proc_exec, NULL, 1000); - linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, - linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); stclohz = (stathz ? stathz : hz); if (bootverbose) printf("Linux ELF exec handler installed\n"); @@ -1197,9 +1187,6 @@ linux_elf_modevent(module_t mod, int typ SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_unregister_handler(*lihp); mtx_destroy(&futex_mtx); - EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); - EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); - EVENTHANDLER_DEREGISTER(thread_dtor, linux_thread_dtor_tag); if (bootverbose) printf("Linux ELF exec handler removed\n"); } else Modified: stable/10/sys/compat/linux/linux_common.c ============================================================================== --- stable/10/sys/compat/linux/linux_common.c Sat Jan 9 16:08:22 2016 (r293527) +++ stable/10/sys/compat/linux/linux_common.c Sat Jan 9 16:11:09 2016 (r293528) @@ -28,13 +28,15 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include +#include +#include #include #include @@ -42,6 +44,10 @@ MODULE_VERSION(linux_common, 1); SET_DECLARE(linux_device_handler_set, struct linux_device_handler); +static eventhandler_tag linux_exec_tag; +static eventhandler_tag linux_thread_dtor_tag; +static eventhandler_tag linux_exit_tag; + static int linux_common_modevent(module_t mod, int type, void *data) @@ -51,6 +57,12 @@ linux_common_modevent(module_t mod, int switch(type) { case MOD_LOAD: linux_osd_jail_register(); + linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, + linux_proc_exit, NULL, 1000); + linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, + linux_proc_exec, NULL, 1000); + linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, + linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); SET_FOREACH(ldhp, linux_device_handler_set) linux_device_register_handler(*ldhp); break; @@ -58,6 +70,9 @@ linux_common_modevent(module_t mod, int linux_osd_jail_deregister(); SET_FOREACH(ldhp, linux_device_handler_set) linux_device_unregister_handler(*ldhp); + EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); + EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); + EVENTHANDLER_DEREGISTER(thread_dtor, linux_thread_dtor_tag); break; default: return (EOPNOTSUPP); Modified: stable/10/sys/compat/linux/linux_emul.c ============================================================================== --- stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 16:08:22 2016 (r293527) +++ stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 16:11:09 2016 (r293528) @@ -30,9 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_compat.h" -#include "opt_kdtrace.h" - #include #include #include @@ -41,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -49,60 +45,13 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef COMPAT_LINUX32 -#include -#include -#else -#include -#include -#endif - -#include #include -#include #include #include -/** - * Special DTrace provider for the linuxulator. - * - * In this file we define the provider for the entire linuxulator. All - * modules (= files of the linuxulator) use it. - * - * We define a different name depending on the emulated bitsize, see - * ../..//linux{,32}/linux.h, e.g.: - * native bitsize = linuxulator - * amd64, 32bit emulation = linuxulator32 - */ -LIN_SDT_PROVIDER_DEFINE(LINUX_DTRACE); - -/** - * DTrace probes in this module. - */ -LIN_SDT_PROBE_DEFINE1(emul, em_find, entry, "struct thread *"); -LIN_SDT_PROBE_DEFINE0(emul, em_find, return); -LIN_SDT_PROBE_DEFINE3(emul, proc_init, entry, "struct thread *", - "struct thread *", "int"); -LIN_SDT_PROBE_DEFINE0(emul, proc_init, create_thread); -LIN_SDT_PROBE_DEFINE0(emul, proc_init, fork); -LIN_SDT_PROBE_DEFINE0(emul, proc_init, exec); -LIN_SDT_PROBE_DEFINE0(emul, proc_init, return); -LIN_SDT_PROBE_DEFINE1(emul, proc_exit, entry, "struct proc *"); -LIN_SDT_PROBE_DEFINE1(emul, linux_thread_detach, entry, "struct thread *"); -LIN_SDT_PROBE_DEFINE0(emul, linux_thread_detach, futex_failed); -LIN_SDT_PROBE_DEFINE1(emul, linux_thread_detach, child_clear_tid_error, "int"); -LIN_SDT_PROBE_DEFINE0(emul, linux_thread_detach, return); -LIN_SDT_PROBE_DEFINE2(emul, proc_exec, entry, "struct proc *", - "struct image_params *"); -LIN_SDT_PROBE_DEFINE0(emul, proc_exec, return); -LIN_SDT_PROBE_DEFINE0(emul, linux_schedtail, entry); -LIN_SDT_PROBE_DEFINE1(emul, linux_schedtail, copyout_error, "int"); -LIN_SDT_PROBE_DEFINE0(emul, linux_schedtail, return); -LIN_SDT_PROBE_DEFINE1(emul, linux_set_tid_address, entry, "int *"); -LIN_SDT_PROBE_DEFINE0(emul, linux_set_tid_address, return); /* - * This returns reference to the emuldata entry (if found) + * This returns reference to the thread emuldata entry (if found) * * Hold PROC_LOCK when referencing emuldata from other threads. */ @@ -111,41 +60,51 @@ em_find(struct thread *td) { struct linux_emuldata *em; - LIN_SDT_PROBE1(emul, em_find, entry, td); - em = td->td_emuldata; - LIN_SDT_PROBE1(emul, em_find, return, em); - return (em); } +/* + * This returns reference to the proc pemuldata entry (if found) + * + * Hold PROC_LOCK when referencing proc pemuldata from other threads. + * Hold LINUX_PEM_LOCK wher referencing pemuldata members. + */ +struct linux_pemuldata * +pem_find(struct proc *p) +{ + struct linux_pemuldata *pem; + + pem = p->p_emuldata; + + return (pem); +} + void linux_proc_init(struct thread *td, struct thread *newtd, int flags) { struct linux_emuldata *em; - - LIN_SDT_PROBE3(emul, proc_init, entry, td, newtd, flags); + struct linux_pemuldata *pem; if (newtd != NULL) { /* non-exec call */ em = malloc(sizeof(*em), M_TEMP, M_WAITOK | M_ZERO); em->pdeath_signal = 0; - em->flags = 0; em->robust_futexes = NULL; if (flags & LINUX_CLONE_THREAD) { - LIN_SDT_PROBE0(emul, proc_init, create_thread); - em->em_tid = newtd->td_tid; } else { - LIN_SDT_PROBE0(emul, proc_init, fork); em->em_tid = newtd->td_proc->p_pid; + + pem = malloc(sizeof(*pem), M_TEMP, M_WAITOK | M_ZERO); + sx_init(&pem->pem_sx, "lpemlk"); + newtd->td_proc->p_emuldata = pem; } newtd->td_emuldata = em; } else { /* exec */ - LIN_SDT_PROBE0(emul, proc_init, exec); /* lookup the old one */ em = em_find(td); @@ -156,24 +115,32 @@ linux_proc_init(struct thread *td, struc em->child_clear_tid = NULL; em->child_set_tid = NULL; - - LIN_SDT_PROBE0(emul, proc_init, return); } void linux_proc_exit(void *arg __unused, struct proc *p) { + struct linux_pemuldata *pem; struct thread *td = curthread; - if (__predict_false(SV_CURPROC_ABI() != SV_ABI_LINUX)) { - LIN_SDT_PROBE1(emul, proc_exit, entry, p); - (p->p_sysent->sv_thread_detach)(td); - } + if (__predict_false(SV_CURPROC_ABI() != SV_ABI_LINUX)) + return; + + pem = pem_find(p); + if (pem == NULL) + return; + (p->p_sysent->sv_thread_detach)(td); + + p->p_emuldata = NULL; + + sx_destroy(&pem->pem_sx); + free(pem, M_TEMP); } int linux_common_execve(struct thread *td, struct image_args *eargs) { + struct linux_pemuldata *pem; struct linux_emuldata *em; struct proc *p; int error; @@ -200,16 +167,21 @@ linux_common_execve(struct thread *td, s /* * In a case of transition from Linux binary execing to - * FreeBSD binary we destroy linux emuldata thread entry. + * FreeBSD binary we destroy linux emuldata thread & proc entries. */ if (SV_CURPROC_ABI() != SV_ABI_LINUX) { PROC_LOCK(p); em = em_find(td); - KASSERT(em != NULL, ("proc_exec: emuldata not found.\n")); + KASSERT(em != NULL, ("proc_exec: thread emuldata not found.\n")); td->td_emuldata = NULL; + + pem = pem_find(p); + KASSERT(pem != NULL, ("proc_exec: proc pemuldata not found.\n")); + p->p_emuldata = NULL; PROC_UNLOCK(p); free(em, M_TEMP); + free(pem, M_TEMP); } return (0); } @@ -225,68 +197,11 @@ linux_proc_exec(void *arg __unused, stru */ if (__predict_false((imgp->sysent->sv_flags & SV_ABI_MASK) == SV_ABI_LINUX)) { - LIN_SDT_PROBE2(emul, proc_exec, entry, p, imgp); if (SV_PROC_ABI(p) == SV_ABI_LINUX) linux_proc_init(td, NULL, 0); else linux_proc_init(td, td, 0); - - LIN_SDT_PROBE0(emul, proc_exec, return); - } -} - -void -linux_thread_detach(struct thread *td) -{ - struct linux_sys_futex_args cup; - struct linux_emuldata *em; - int *child_clear_tid; - int null = 0; - int error; - - LIN_SDT_PROBE1(emul, linux_thread_detach, entry, td); - - em = em_find(td); - KASSERT(em != NULL, ("thread_detach: emuldata not found.\n")); - - LINUX_CTR1(exit, "thread detach(%d)", em->em_tid); - - release_futexes(td, em); - - child_clear_tid = em->child_clear_tid; - - if (child_clear_tid != NULL) { - - LINUX_CTR2(exit, "thread detach(%d) %p", - em->em_tid, child_clear_tid); - - error = copyout(&null, child_clear_tid, sizeof(null)); - if (error) { - LIN_SDT_PROBE1(emul, linux_thread_detach, - child_clear_tid_error, error); - - LIN_SDT_PROBE0(emul, linux_thread_detach, return); - return; - } - - cup.uaddr = child_clear_tid; - cup.op = LINUX_FUTEX_WAKE; - cup.val = 1; /* wake one */ - cup.timeout = NULL; - cup.uaddr2 = NULL; - cup.val3 = 0; - error = linux_sys_futex(td, &cup); - /* - * this cannot happen at the moment and if this happens it - * probably means there is a user space bug - */ - if (error) { - LIN_SDT_PROBE0(emul, linux_thread_detach, futex_failed); - printf(LMSG("futex stuff in thread_detach failed.\n")); - } } - - LIN_SDT_PROBE0(emul, linux_thread_detach, return); } void @@ -312,12 +227,10 @@ linux_schedtail(struct thread *td) int error = 0; int *child_set_tid; - LIN_SDT_PROBE1(emul, linux_schedtail, entry, td); - p = td->td_proc; em = em_find(td); - KASSERT(em != NULL, ("linux_schedtail: emuldata not found.\n")); + KASSERT(em != NULL, ("linux_schedtail: thread emuldata not found.\n")); child_set_tid = em->child_set_tid; if (child_set_tid != NULL) { @@ -325,34 +238,6 @@ linux_schedtail(struct thread *td) sizeof(em->em_tid)); LINUX_CTR4(clone, "schedtail(%d) %p stored %d error %d", td->td_tid, child_set_tid, em->em_tid, error); - - if (error != 0) { - LIN_SDT_PROBE1(emul, linux_schedtail, copyout_error, - error); - } } else LINUX_CTR1(clone, "schedtail(%d)", em->em_tid); - - LIN_SDT_PROBE0(emul, linux_schedtail, return); -} - -int -linux_set_tid_address(struct thread *td, struct linux_set_tid_address_args *args) -{ - struct linux_emuldata *em; - - LIN_SDT_PROBE1(emul, linux_set_tid_address, entry, args->tidptr); - - em = em_find(td); - KASSERT(em != NULL, ("set_tid_address: emuldata not found.\n")); - - em->child_clear_tid = args->tidptr; - - td->td_retval[0] = em->em_tid; - - LINUX_CTR3(set_tid_address, "tidptr(%d) %p, returns %d", - em->em_tid, args->tidptr, td->td_retval[0]); - - LIN_SDT_PROBE0(emul, linux_set_tid_address, return); - return (0); } Modified: stable/10/sys/compat/linux/linux_emul.h ============================================================================== --- stable/10/sys/compat/linux/linux_emul.h Sat Jan 9 16:08:22 2016 (r293527) +++ stable/10/sys/compat/linux/linux_emul.h Sat Jan 9 16:11:09 2016 (r293528) @@ -41,7 +41,7 @@ struct linux_emuldata { int *child_clear_tid;/* in clone(): Child's TID to clear on exit */ int pdeath_signal; /* parent death signal */ - int flags; /* different emuldata flags */ + int flags; /* thread emuldata flags */ int em_tid; /* thread id */ struct linux_robust_list_head *robust_futexes; @@ -49,10 +49,6 @@ struct linux_emuldata { struct linux_emuldata *em_find(struct thread *); -/* emuldata flags */ -#define LINUX_XDEPR_REQUEUEOP 0x00000001 /* uses deprecated - futex REQUEUE op*/ - void linux_proc_init(struct thread *, struct thread *, int); void linux_proc_exit(void *, struct proc *); void linux_schedtail(struct thread *); @@ -61,4 +57,19 @@ void linux_thread_dtor(void *arg __unuse void linux_thread_detach(struct thread *); int linux_common_execve(struct thread *, struct image_args *); +/* process emuldata flags */ +#define LINUX_XDEPR_REQUEUEOP 0x00000001 /* uses deprecated + futex REQUEUE op*/ +struct linux_pemuldata { + uint32_t flags; /* process emuldata flags */ + struct sx pem_sx; /* lock for this struct */ +}; + +#define LINUX_PEM_XLOCK(p) sx_xlock(&(p)->pem_sx) +#define LINUX_PEM_XUNLOCK(p) sx_xunlock(&(p)->pem_sx) +#define LINUX_PEM_SLOCK(p) sx_slock(&(p)->pem_sx) +#define LINUX_PEM_SUNLOCK(p) sx_sunlock(&(p)->pem_sx) + +struct linux_pemuldata *pem_find(struct proc *); + #endif /* !_LINUX_EMUL_H_ */ Modified: stable/10/sys/compat/linux/linux_fork.c ============================================================================== --- stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 16:08:22 2016 (r293527) +++ stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 16:11:09 2016 (r293528) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #include #include @@ -405,3 +406,63 @@ linux_exit(struct thread *td, struct lin exit1(td, W_EXITCODE(args->rval, 0)); /* NOTREACHED */ } + +int +linux_set_tid_address(struct thread *td, struct linux_set_tid_address_args *args) +{ + struct linux_emuldata *em; + + em = em_find(td); + KASSERT(em != NULL, ("set_tid_address: emuldata not found.\n")); + + em->child_clear_tid = args->tidptr; + + td->td_retval[0] = em->em_tid; + + LINUX_CTR3(set_tid_address, "tidptr(%d) %p, returns %d", + em->em_tid, args->tidptr, td->td_retval[0]); + + return (0); +} + +void +linux_thread_detach(struct thread *td) +{ + struct linux_sys_futex_args cup; + struct linux_emuldata *em; + int *child_clear_tid; + int error; + + em = em_find(td); + KASSERT(em != NULL, ("thread_detach: emuldata not found.\n")); + + LINUX_CTR1(exit, "thread detach(%d)", em->em_tid); + + release_futexes(td, em); + + child_clear_tid = em->child_clear_tid; + + if (child_clear_tid != NULL) { + + LINUX_CTR2(exit, "thread detach(%d) %p", + em->em_tid, child_clear_tid); + + error = suword32(child_clear_tid, 0); + if (error != 0) + return; + + cup.uaddr = child_clear_tid; + cup.op = LINUX_FUTEX_WAKE; + cup.val = 1; /* wake one */ + cup.timeout = NULL; + cup.uaddr2 = NULL; + cup.val3 = 0; + error = linux_sys_futex(td, &cup); + /* + * this cannot happen at the moment and if this happens it + * probably means there is a user space bug + */ + if (error != 0) + linux_msg(td, "futex stuff in thread_detach failed."); + } +} Modified: stable/10/sys/compat/linux/linux_futex.c ============================================================================== --- stable/10/sys/compat/linux/linux_futex.c Sat Jan 9 16:08:22 2016 (r293527) +++ stable/10/sys/compat/linux/linux_futex.c Sat Jan 9 16:11:09 2016 (r293528) @@ -654,7 +654,7 @@ int linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args) { int clockrt, nrwake, op_ret, ret; - struct linux_emuldata *em; + struct linux_pemuldata *pem; struct waiting_proc *wp; struct futex *f, *f2; struct l_timespec timeout; @@ -974,12 +974,12 @@ linux_sys_futex(struct thread *td, struc * Glibc versions prior to 2.3.3 fall back to FUTEX_WAKE when * FUTEX_REQUEUE returned EINVAL. */ - em = em_find(td); - if ((em->flags & LINUX_XDEPR_REQUEUEOP) == 0) { + pem = pem_find(td->td_proc); + if ((pem->flags & LINUX_XDEPR_REQUEUEOP) == 0) { linux_msg(td, "linux_sys_futex: " "unsupported futex_requeue op\n"); - em->flags |= LINUX_XDEPR_REQUEUEOP; + pem->flags |= LINUX_XDEPR_REQUEUEOP; LIN_SDT_PROBE0(futex, linux_sys_futex, deprecated_requeue); } Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 16:08:22 2016 (r293527) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 16:11:09 2016 (r293528) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -84,6 +85,7 @@ __FBSDID("$FreeBSD$"); #include #endif +#include #include #include #include @@ -92,6 +94,19 @@ __FBSDID("$FreeBSD$"); #include #include +/** + * Special DTrace provider for the linuxulator. + * + * In this file we define the provider for the entire linuxulator. All + * modules (= files of the linuxulator) use it. + * + * We define a different name depending on the emulated bitsize, see + * ../..//linux{,32}/linux.h, e.g.: + * native bitsize = linuxulator + * amd64, 32bit emulation = linuxulator32 + */ +LIN_SDT_PROVIDER_DEFINE(LINUX_DTRACE); + int stclohz; /* Statistics clock frequency */ static unsigned int linux_to_bsd_resource[LINUX_RLIM_NLIMITS] = { Modified: stable/10/sys/modules/linux/Makefile ============================================================================== --- stable/10/sys/modules/linux/Makefile Sat Jan 9 16:08:22 2016 (r293527) +++ stable/10/sys/modules/linux/Makefile Sat Jan 9 16:11:09 2016 (r293528) @@ -10,7 +10,7 @@ CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINU VDSO= linux${SFX}_vdso KMOD= linux -SRCS= linux_fork.c linux${SFX}_dummy.c linux_emul.c linux_file.c \ +SRCS= linux_fork.c linux${SFX}_dummy.c linux_file.c \ linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \ linux${SFX}_machdep.c linux_misc.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ @@ -30,7 +30,8 @@ SRCS+= opt_apic.h OBJS= ${VDSO}.so .if ${MACHINE_CPUARCH} == "i386" -SRCS+= linux_ptrace.c imgact_linux.c linux_util.c linux_mib.c opt_cpu.h +SRCS+= linux_ptrace.c imgact_linux.c linux_util.c linux_mib.c \ + linux_emul.c opt_cpu.h .endif .if ${MACHINE_CPUARCH} == "i386" Modified: stable/10/sys/modules/linux_common/Makefile ============================================================================== --- stable/10/sys/modules/linux_common/Makefile Sat Jan 9 16:08:22 2016 (r293527) +++ stable/10/sys/modules/linux_common/Makefile Sat Jan 9 16:11:09 2016 (r293528) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../compat/linux KMOD= linux_common -SRCS= linux_common.c linux_mib.c linux_util.c \ +SRCS= linux_common.c linux_mib.c linux_util.c linux_emul.c \ opt_compat.h device_if.h vnode_if.h bus_if.h EXPORT_SYMS= From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:12:38 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83C62A698D4; Sat, 9 Jan 2016 16:12:38 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52A601CEF; Sat, 9 Jan 2016 16:12:38 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GCba2034757; Sat, 9 Jan 2016 16:12:37 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GCbiq034755; Sat, 9 Jan 2016 16:12:37 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091612.u09GCbiq034755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293529 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:12:38 -0000 Author: dchagin Date: Sat Jan 9 16:12:37 2016 New Revision: 293529 URL: https://svnweb.freebsd.org/changeset/base/293529 Log: MFC r283423: Move FEATURE macros for v4l and v4l2 to the common module. Modified: stable/10/sys/compat/linux/linux_common.c stable/10/sys/compat/linux/linux_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_common.c ============================================================================== --- stable/10/sys/compat/linux/linux_common.c Sat Jan 9 16:11:09 2016 (r293528) +++ stable/10/sys/compat/linux/linux_common.c Sat Jan 9 16:12:37 2016 (r293529) @@ -35,11 +35,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in the linuxulator"); +FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator"); + MODULE_VERSION(linux_common, 1); SET_DECLARE(linux_device_handler_set, struct linux_device_handler); Modified: stable/10/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.c Sat Jan 9 16:11:09 2016 (r293528) +++ stable/10/sys/compat/linux/linux_ioctl.c Sat Jan 9 16:12:37 2016 (r293529) @@ -94,9 +94,6 @@ __FBSDID("$FreeBSD$"); CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ); -FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in the linuxulator"); -FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator"); - static linux_ioctl_function_t linux_ioctl_cdrom; static linux_ioctl_function_t linux_ioctl_vfat; static linux_ioctl_function_t linux_ioctl_console; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:14:25 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79E14A6995B; Sat, 9 Jan 2016 16:14:25 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EEEB1E45; Sat, 9 Jan 2016 16:14:25 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GEOvc034873; Sat, 9 Jan 2016 16:14:24 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GEOu2034872; Sat, 9 Jan 2016 16:14:24 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091614.u09GEOu2034872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293530 - in stable/10/sys: amd64/linux modules/linux64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:14:25 -0000 Author: dchagin Date: Sat Jan 9 16:14:24 2016 New Revision: 293530 URL: https://svnweb.freebsd.org/changeset/base/293530 Log: MFC r283424: Add preliminary support for x86-64 Linux binaries. Added: stable/10/sys/amd64/linux/ - copied from r283424, head/sys/amd64/linux/ stable/10/sys/modules/linux64/ - copied from r283424, head/sys/modules/linux64/ Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:16:18 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44F08A69A12; Sat, 9 Jan 2016 16:16:18 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECE3B1FDF; Sat, 9 Jan 2016 16:16:17 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GGHTO034979; Sat, 9 Jan 2016 16:16:17 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GGHdP034977; Sat, 9 Jan 2016 16:16:17 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091616.u09GGHdP034977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293531 - stable/10/sys/amd64/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:16:18 -0000 Author: dchagin Date: Sat Jan 9 16:16:16 2016 New Revision: 293531 URL: https://svnweb.freebsd.org/changeset/base/293531 Log: Regen for r293530. Added: stable/10/sys/amd64/linux/linux_proto.h (contents, props changed) stable/10/sys/amd64/linux/linux_syscall.h (contents, props changed) stable/10/sys/amd64/linux/linux_syscalls.c (contents, props changed) stable/10/sys/amd64/linux/linux_sysent.c (contents, props changed) stable/10/sys/amd64/linux/linux_systrace_args.c (contents, props changed) Added: stable/10/sys/amd64/linux/linux_proto.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 16:16:16 2016 (r293531) @@ -0,0 +1,1636 @@ +/* + * System call prototypes. + * + * DO NOT EDIT-- this file is automatically generated. + * $FreeBSD$ + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 283424 2015-05-24 16:07:11Z dchagin + */ + +#ifndef _LINUX_SYSPROTO_H_ +#define _LINUX_SYSPROTO_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include + +struct proc; + +struct thread; + +#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ + 0 : sizeof(register_t) - sizeof(t)) + +#if BYTE_ORDER == LITTLE_ENDIAN +#define PADL_(t) 0 +#define PADR_(t) PAD_(t) +#else +#define PADL_(t) PAD_(t) +#define PADR_(t) 0 +#endif + +#define nosys linux_nosys +struct linux_open_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; +}; +struct linux_newstat_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char buf_l_[PADL_(struct l_newstat *)]; struct l_newstat * buf; char buf_r_[PADR_(struct l_newstat *)]; +}; +struct linux_newfstat_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char buf_l_[PADL_(struct l_newstat *)]; struct l_newstat * buf; char buf_r_[PADR_(struct l_newstat *)]; +}; +struct linux_newlstat_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char buf_l_[PADL_(struct l_newstat *)]; struct l_newstat * buf; char buf_r_[PADR_(struct l_newstat *)]; +}; +struct linux_lseek_args { + char fdes_l_[PADL_(l_uint)]; l_uint fdes; char fdes_r_[PADR_(l_uint)]; + char off_l_[PADL_(l_off_t)]; l_off_t off; char off_r_[PADR_(l_off_t)]; + char whence_l_[PADL_(l_int)]; l_int whence; char whence_r_[PADR_(l_int)]; +}; +struct linux_mmap2_args { + char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; + char len_l_[PADL_(l_ulong)]; l_ulong len; char len_r_[PADR_(l_ulong)]; + char prot_l_[PADL_(l_ulong)]; l_ulong prot; char prot_r_[PADR_(l_ulong)]; + char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; + char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)]; + char pgoff_l_[PADL_(l_ulong)]; l_ulong pgoff; char pgoff_r_[PADR_(l_ulong)]; +}; +struct linux_mprotect_args { + char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; + char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; + char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)]; +}; +struct linux_brk_args { + char dsend_l_[PADL_(l_ulong)]; l_ulong dsend; char dsend_r_[PADR_(l_ulong)]; +}; +struct linux_rt_sigaction_args { + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char act_l_[PADL_(l_sigaction_t *)]; l_sigaction_t * act; char act_r_[PADR_(l_sigaction_t *)]; + char oact_l_[PADL_(l_sigaction_t *)]; l_sigaction_t * oact; char oact_r_[PADR_(l_sigaction_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_rt_sigprocmask_args { + char how_l_[PADL_(l_int)]; l_int how; char how_r_[PADR_(l_int)]; + char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; + char omask_l_[PADL_(l_sigset_t *)]; l_sigset_t * omask; char omask_r_[PADR_(l_sigset_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_rt_sigreturn_args { + char ucp_l_[PADL_(struct l_ucontext *)]; struct l_ucontext * ucp; char ucp_r_[PADR_(struct l_ucontext *)]; +}; +struct linux_ioctl_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)]; + char arg_l_[PADL_(uintptr_t)]; uintptr_t arg; char arg_r_[PADR_(uintptr_t)]; +}; +struct linux_pread_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char nbyte_l_[PADL_(l_size_t)]; l_size_t nbyte; char nbyte_r_[PADR_(l_size_t)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; +}; +struct linux_pwrite_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char nbyte_l_[PADL_(l_size_t)]; l_size_t nbyte; char nbyte_r_[PADR_(l_size_t)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; +}; +struct linux_access_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)]; +}; +struct linux_pipe_args { + char pipefds_l_[PADL_(l_ulong *)]; l_ulong * pipefds; char pipefds_r_[PADR_(l_ulong *)]; +}; +struct linux_select_args { + char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)]; + char readfds_l_[PADL_(l_fd_set *)]; l_fd_set * readfds; char readfds_r_[PADR_(l_fd_set *)]; + char writefds_l_[PADL_(l_fd_set *)]; l_fd_set * writefds; char writefds_r_[PADR_(l_fd_set *)]; + char exceptfds_l_[PADL_(l_fd_set *)]; l_fd_set * exceptfds; char exceptfds_r_[PADR_(l_fd_set *)]; + char timeout_l_[PADL_(struct l_timeval *)]; struct l_timeval * timeout; char timeout_r_[PADR_(struct l_timeval *)]; +}; +struct linux_mremap_args { + char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; + char old_len_l_[PADL_(l_ulong)]; l_ulong old_len; char old_len_r_[PADR_(l_ulong)]; + char new_len_l_[PADL_(l_ulong)]; l_ulong new_len; char new_len_r_[PADR_(l_ulong)]; + char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; + char new_addr_l_[PADL_(l_ulong)]; l_ulong new_addr; char new_addr_r_[PADR_(l_ulong)]; +}; +struct linux_msync_args { + char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char fl_l_[PADL_(l_int)]; l_int fl; char fl_r_[PADR_(l_int)]; +}; +struct linux_mincore_args { + char start_l_[PADL_(l_ulong)]; l_ulong start; char start_r_[PADR_(l_ulong)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char vec_l_[PADL_(u_char *)]; u_char * vec; char vec_r_[PADR_(u_char *)]; +}; +struct linux_shmget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; + char shmflg_l_[PADL_(l_int)]; l_int shmflg; char shmflg_r_[PADR_(l_int)]; +}; +struct linux_shmat_args { + char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)]; + char shmaddr_l_[PADL_(char *)]; char * shmaddr; char shmaddr_r_[PADR_(char *)]; + char shmflg_l_[PADL_(l_int)]; l_int shmflg; char shmflg_r_[PADR_(l_int)]; +}; +struct linux_shmctl_args { + char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char buf_l_[PADL_(struct l_shmid_ds *)]; struct l_shmid_ds * buf; char buf_r_[PADR_(struct l_shmid_ds *)]; +}; +struct linux_pause_args { + register_t dummy; +}; +struct linux_nanosleep_args { + char rqtp_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * rqtp; char rqtp_r_[PADR_(const struct l_timespec *)]; + char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_getitimer_args { + char which_l_[PADL_(l_int)]; l_int which; char which_r_[PADR_(l_int)]; + char itv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * itv; char itv_r_[PADR_(struct l_itimerval *)]; +}; +struct linux_alarm_args { + char secs_l_[PADL_(l_uint)]; l_uint secs; char secs_r_[PADR_(l_uint)]; +}; +struct linux_setitimer_args { + char which_l_[PADL_(l_int)]; l_int which; char which_r_[PADR_(l_int)]; + char itv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * itv; char itv_r_[PADR_(struct l_itimerval *)]; + char oitv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * oitv; char oitv_r_[PADR_(struct l_itimerval *)]; +}; +struct linux_getpid_args { + register_t dummy; +}; +struct linux_sendfile_args { + char out_l_[PADL_(int)]; int out; char out_r_[PADR_(int)]; + char in_l_[PADL_(int)]; int in; char in_r_[PADR_(int)]; + char offset_l_[PADL_(l_long *)]; l_long * offset; char offset_r_[PADR_(l_long *)]; + char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; +}; +struct linux_socket_args { + char domain_l_[PADL_(l_int)]; l_int domain; char domain_r_[PADR_(l_int)]; + char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)]; + char protocol_l_[PADL_(l_int)]; l_int protocol; char protocol_r_[PADR_(l_int)]; +}; +struct linux_connect_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char name_l_[PADL_(l_uintptr_t)]; l_uintptr_t name; char name_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_int)]; l_int namelen; char namelen_r_[PADR_(l_int)]; +}; +struct linux_accept_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_sendto_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; + char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char to_l_[PADL_(l_uintptr_t)]; l_uintptr_t to; char to_r_[PADR_(l_uintptr_t)]; + char tolen_l_[PADL_(l_int)]; l_int tolen; char tolen_r_[PADR_(l_int)]; +}; +struct linux_recvfrom_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char buf_l_[PADL_(l_uintptr_t)]; l_uintptr_t buf; char buf_r_[PADR_(l_uintptr_t)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char from_l_[PADL_(l_uintptr_t)]; l_uintptr_t from; char from_r_[PADR_(l_uintptr_t)]; + char fromlen_l_[PADL_(l_uintptr_t)]; l_uintptr_t fromlen; char fromlen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_sendmsg_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_recvmsg_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_shutdown_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char how_l_[PADL_(l_int)]; l_int how; char how_r_[PADR_(l_int)]; +}; +struct linux_bind_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char name_l_[PADL_(l_uintptr_t)]; l_uintptr_t name; char name_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_int)]; l_int namelen; char namelen_r_[PADR_(l_int)]; +}; +struct linux_listen_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char backlog_l_[PADL_(l_int)]; l_int backlog; char backlog_r_[PADR_(l_int)]; +}; +struct linux_getsockname_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_getpeername_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_socketpair_args { + char domain_l_[PADL_(l_int)]; l_int domain; char domain_r_[PADR_(l_int)]; + char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)]; + char protocol_l_[PADL_(l_int)]; l_int protocol; char protocol_r_[PADR_(l_int)]; + char rsv_l_[PADL_(l_uintptr_t)]; l_uintptr_t rsv; char rsv_r_[PADR_(l_uintptr_t)]; +}; +struct linux_setsockopt_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char level_l_[PADL_(l_int)]; l_int level; char level_r_[PADR_(l_int)]; + char optname_l_[PADL_(l_int)]; l_int optname; char optname_r_[PADR_(l_int)]; + char optval_l_[PADL_(l_uintptr_t)]; l_uintptr_t optval; char optval_r_[PADR_(l_uintptr_t)]; + char optlen_l_[PADL_(l_int)]; l_int optlen; char optlen_r_[PADR_(l_int)]; +}; +struct linux_getsockopt_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char level_l_[PADL_(l_int)]; l_int level; char level_r_[PADR_(l_int)]; + char optname_l_[PADL_(l_int)]; l_int optname; char optname_r_[PADR_(l_int)]; + char optval_l_[PADL_(l_uintptr_t)]; l_uintptr_t optval; char optval_r_[PADR_(l_uintptr_t)]; + char optlen_l_[PADL_(l_uintptr_t)]; l_uintptr_t optlen; char optlen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_clone_args { + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char stack_l_[PADL_(void *)]; void * stack; char stack_r_[PADR_(void *)]; + char parent_tidptr_l_[PADL_(void *)]; void * parent_tidptr; char parent_tidptr_r_[PADR_(void *)]; + char child_tidptr_l_[PADL_(void *)]; void * child_tidptr; char child_tidptr_r_[PADR_(void *)]; + char tls_l_[PADL_(void *)]; void * tls; char tls_r_[PADR_(void *)]; +}; +struct linux_fork_args { + register_t dummy; +}; +struct linux_vfork_args { + register_t dummy; +}; +struct linux_execve_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char argp_l_[PADL_(char **)]; char ** argp; char argp_r_[PADR_(char **)]; + char envp_l_[PADL_(char **)]; char ** envp; char envp_r_[PADR_(char **)]; +}; +struct linux_exit_args { + char rval_l_[PADL_(int)]; int rval; char rval_r_[PADR_(int)]; +}; +struct linux_wait4_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char status_l_[PADL_(l_int *)]; l_int * status; char status_r_[PADR_(l_int *)]; + char options_l_[PADL_(l_int)]; l_int options; char options_r_[PADR_(l_int)]; + char rusage_l_[PADL_(struct rusage *)]; struct rusage * rusage; char rusage_r_[PADR_(struct rusage *)]; +}; +struct linux_kill_args { + char pid_l_[PADL_(l_int)]; l_int pid; char pid_r_[PADR_(l_int)]; + char signum_l_[PADL_(l_int)]; l_int signum; char signum_r_[PADR_(l_int)]; +}; +struct linux_newuname_args { + char buf_l_[PADL_(struct l_new_utsname *)]; struct l_new_utsname * buf; char buf_r_[PADR_(struct l_new_utsname *)]; +}; +struct linux_semget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char nsems_l_[PADL_(l_int)]; l_int nsems; char nsems_r_[PADR_(l_int)]; + char semflg_l_[PADL_(l_int)]; l_int semflg; char semflg_r_[PADR_(l_int)]; +}; +struct linux_semop_args { + char semid_l_[PADL_(l_int)]; l_int semid; char semid_r_[PADR_(l_int)]; + char tsops_l_[PADL_(struct l_sembuf *)]; struct l_sembuf * tsops; char tsops_r_[PADR_(struct l_sembuf *)]; + char nsops_l_[PADL_(l_uint)]; l_uint nsops; char nsops_r_[PADR_(l_uint)]; +}; +struct linux_semctl_args { + char semid_l_[PADL_(l_int)]; l_int semid; char semid_r_[PADR_(l_int)]; + char semnum_l_[PADL_(l_int)]; l_int semnum; char semnum_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char arg_l_[PADL_(union l_semun)]; union l_semun arg; char arg_r_[PADR_(union l_semun)]; +}; +struct linux_shmdt_args { + char shmaddr_l_[PADL_(char *)]; char * shmaddr; char shmaddr_r_[PADR_(char *)]; +}; +struct linux_msgget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgsnd_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)]; + char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgrcv_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)]; + char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)]; + char msgtyp_l_[PADL_(l_long)]; l_long msgtyp; char msgtyp_r_[PADR_(l_long)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgctl_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char buf_l_[PADL_(struct l_msqid_ds *)]; struct l_msqid_ds * buf; char buf_r_[PADR_(struct l_msqid_ds *)]; +}; +struct linux_fcntl_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)]; + char arg_l_[PADL_(l_ulong)]; l_ulong arg; char arg_r_[PADR_(l_ulong)]; +}; +struct linux_fdatasync_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; +}; +struct linux_truncate_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char length_l_[PADL_(l_ulong)]; l_ulong length; char length_r_[PADR_(l_ulong)]; +}; +struct linux_ftruncate_args { + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char length_l_[PADL_(l_long)]; l_long length; char length_r_[PADR_(l_long)]; +}; +struct linux_getdents_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char dent_l_[PADL_(void *)]; void * dent; char dent_r_[PADR_(void *)]; + char count_l_[PADL_(l_uint)]; l_uint count; char count_r_[PADR_(l_uint)]; +}; +struct linux_getcwd_args { + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char bufsize_l_[PADL_(l_ulong)]; l_ulong bufsize; char bufsize_r_[PADR_(l_ulong)]; +}; +struct linux_chdir_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; +}; +struct linux_rename_args { + char from_l_[PADL_(char *)]; char * from; char from_r_[PADR_(char *)]; + char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)]; +}; +struct linux_mkdir_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; +}; +struct linux_rmdir_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; +}; +struct linux_creat_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; +}; +struct linux_link_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)]; +}; +struct linux_unlink_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; +}; +struct linux_symlink_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)]; +}; +struct linux_readlink_args { + char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char count_l_[PADL_(l_int)]; l_int count; char count_r_[PADR_(l_int)]; +}; +struct linux_chmod_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char mode_l_[PADL_(l_mode_t)]; l_mode_t mode; char mode_r_[PADR_(l_mode_t)]; +}; +struct linux_chown_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)]; + char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)]; +}; +struct linux_lchown_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)]; + char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)]; +}; +struct linux_getrlimit_args { + char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)]; + char rlim_l_[PADL_(struct l_rlimit *)]; struct l_rlimit * rlim; char rlim_r_[PADR_(struct l_rlimit *)]; +}; +struct linux_sysinfo_args { + char info_l_[PADL_(struct l_sysinfo *)]; struct l_sysinfo * info; char info_r_[PADR_(struct l_sysinfo *)]; +}; +struct linux_times_args { + char buf_l_[PADL_(struct l_times_argv *)]; struct l_times_argv * buf; char buf_r_[PADR_(struct l_times_argv *)]; +}; +struct linux_ptrace_args { + char req_l_[PADL_(l_long)]; l_long req; char req_r_[PADR_(l_long)]; + char pid_l_[PADL_(l_long)]; l_long pid; char pid_r_[PADR_(l_long)]; + char addr_l_[PADL_(l_long)]; l_long addr; char addr_r_[PADR_(l_long)]; + char data_l_[PADL_(l_long)]; l_long data; char data_r_[PADR_(l_long)]; +}; +struct linux_getuid_args { + register_t dummy; +}; +struct linux_syslog_args { + char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)]; +}; +struct linux_getgid_args { + register_t dummy; +}; +struct linux_getppid_args { + register_t dummy; +}; +struct linux_getgroups_args { + char gidsetsize_l_[PADL_(l_int)]; l_int gidsetsize; char gidsetsize_r_[PADR_(l_int)]; + char grouplist_l_[PADL_(l_gid_t *)]; l_gid_t * grouplist; char grouplist_r_[PADR_(l_gid_t *)]; +}; +struct linux_setgroups_args { + char gidsetsize_l_[PADL_(l_int)]; l_int gidsetsize; char gidsetsize_r_[PADR_(l_int)]; + char grouplist_l_[PADL_(l_gid_t *)]; l_gid_t * grouplist; char grouplist_r_[PADR_(l_gid_t *)]; +}; +struct linux_setfsuid_args { + char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)]; +}; +struct linux_setfsgid_args { + char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)]; +}; +struct linux_getsid_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; +}; +struct linux_capget_args { + char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)]; + char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)]; +}; +struct linux_capset_args { + char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)]; + char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)]; +}; +struct linux_rt_sigpending_args { + char set_l_[PADL_(l_sigset_t *)]; l_sigset_t * set; char set_r_[PADR_(l_sigset_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_rt_sigtimedwait_args { + char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; + char ptr_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * ptr; char ptr_r_[PADR_(l_siginfo_t *)]; + char timeout_l_[PADL_(struct l_timeval *)]; struct l_timeval * timeout; char timeout_r_[PADR_(struct l_timeval *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_rt_sigqueueinfo_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; +}; +struct linux_rt_sigsuspend_args { + char newset_l_[PADL_(l_sigset_t *)]; l_sigset_t * newset; char newset_r_[PADR_(l_sigset_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_sigaltstack_args { + char uss_l_[PADL_(l_stack_t *)]; l_stack_t * uss; char uss_r_[PADR_(l_stack_t *)]; + char uoss_l_[PADL_(l_stack_t *)]; l_stack_t * uoss; char uoss_r_[PADR_(l_stack_t *)]; +}; +struct linux_utime_args { + char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)]; + char times_l_[PADL_(struct l_utimbuf *)]; struct l_utimbuf * times; char times_r_[PADR_(struct l_utimbuf *)]; +}; +struct linux_mknod_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; + char dev_l_[PADL_(l_dev_t)]; l_dev_t dev; char dev_r_[PADR_(l_dev_t)]; +}; +struct linux_personality_args { + char per_l_[PADL_(l_ulong)]; l_ulong per; char per_r_[PADR_(l_ulong)]; +}; +struct linux_ustat_args { + char dev_l_[PADL_(l_dev_t)]; l_dev_t dev; char dev_r_[PADR_(l_dev_t)]; + char ubuf_l_[PADL_(struct l_ustat *)]; struct l_ustat * ubuf; char ubuf_r_[PADR_(struct l_ustat *)]; +}; +struct linux_statfs_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char buf_l_[PADL_(struct l_statfs_buf *)]; struct l_statfs_buf * buf; char buf_r_[PADR_(struct l_statfs_buf *)]; +}; +struct linux_fstatfs_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char buf_l_[PADL_(struct l_statfs_buf *)]; struct l_statfs_buf * buf; char buf_r_[PADR_(struct l_statfs_buf *)]; +}; +struct linux_sysfs_args { + char option_l_[PADL_(l_int)]; l_int option; char option_r_[PADR_(l_int)]; + char arg1_l_[PADL_(l_ulong)]; l_ulong arg1; char arg1_r_[PADR_(l_ulong)]; + char arg2_l_[PADL_(l_ulong)]; l_ulong arg2; char arg2_r_[PADR_(l_ulong)]; +}; +struct linux_getpriority_args { + char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; + char who_l_[PADL_(int)]; int who; char who_r_[PADR_(int)]; +}; +struct linux_sched_setparam_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; +}; +struct linux_sched_getparam_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; +}; +struct linux_sched_setscheduler_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; + char param_l_[PADL_(struct l_sched_param *)]; struct l_sched_param * param; char param_r_[PADR_(struct l_sched_param *)]; +}; +struct linux_sched_getscheduler_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; +}; +struct linux_sched_get_priority_max_args { + char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; +}; +struct linux_sched_get_priority_min_args { + char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; +}; +struct linux_sched_rr_get_interval_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char interval_l_[PADL_(struct l_timespec *)]; struct l_timespec * interval; char interval_r_[PADR_(struct l_timespec *)]; +}; +struct linux_vhangup_args { + register_t dummy; +}; +struct linux_pivot_root_args { + register_t dummy; +}; +struct linux_sysctl_args { + char args_l_[PADL_(struct l___sysctl_args *)]; struct l___sysctl_args * args; char args_r_[PADR_(struct l___sysctl_args *)]; +}; +struct linux_prctl_args { + char option_l_[PADL_(l_int)]; l_int option; char option_r_[PADR_(l_int)]; + char arg2_l_[PADL_(l_uintptr_t)]; l_uintptr_t arg2; char arg2_r_[PADR_(l_uintptr_t)]; + char arg3_l_[PADL_(l_uintptr_t)]; l_uintptr_t arg3; char arg3_r_[PADR_(l_uintptr_t)]; + char arg4_l_[PADL_(l_uintptr_t)]; l_uintptr_t arg4; char arg4_r_[PADR_(l_uintptr_t)]; + char arg5_l_[PADL_(l_uintptr_t)]; l_uintptr_t arg5; char arg5_r_[PADR_(l_uintptr_t)]; +}; +struct linux_arch_prctl_args { + char code_l_[PADL_(l_int)]; l_int code; char code_r_[PADR_(l_int)]; + char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; +}; +struct linux_adjtimex_args { + register_t dummy; +}; +struct linux_setrlimit_args { + char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)]; + char rlim_l_[PADL_(struct l_rlimit *)]; struct l_rlimit * rlim; char rlim_r_[PADR_(struct l_rlimit *)]; +}; +struct linux_mount_args { + char specialfile_l_[PADL_(char *)]; char * specialfile; char specialfile_r_[PADR_(char *)]; + char dir_l_[PADL_(char *)]; char * dir; char dir_r_[PADR_(char *)]; + char filesystemtype_l_[PADL_(char *)]; char * filesystemtype; char filesystemtype_r_[PADR_(char *)]; + char rwflag_l_[PADL_(l_ulong)]; l_ulong rwflag; char rwflag_r_[PADR_(l_ulong)]; + char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; +}; +struct linux_umount_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_swapoff_args { + register_t dummy; +}; +struct linux_reboot_args { + char magic1_l_[PADL_(l_int)]; l_int magic1; char magic1_r_[PADR_(l_int)]; + char magic2_l_[PADL_(l_int)]; l_int magic2; char magic2_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)]; + char arg_l_[PADL_(void *)]; void * arg; char arg_r_[PADR_(void *)]; +}; +struct linux_sethostname_args { + char hostname_l_[PADL_(char *)]; char * hostname; char hostname_r_[PADR_(char *)]; + char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; +}; +struct linux_setdomainname_args { + char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)]; + char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)]; +}; +struct linux_iopl_args { + char level_l_[PADL_(l_uint)]; l_uint level; char level_r_[PADR_(l_uint)]; +}; +struct linux_create_module_args { + register_t dummy; +}; +struct linux_init_module_args { + register_t dummy; +}; +struct linux_delete_module_args { + register_t dummy; +}; +struct linux_get_kernel_syms_args { + register_t dummy; +}; +struct linux_query_module_args { + register_t dummy; +}; +struct linux_quotactl_args { + register_t dummy; +}; +struct linux_nfsservctl_args { + register_t dummy; +}; +struct linux_getpmsg_args { + register_t dummy; +}; +struct linux_putpmsg_args { + register_t dummy; +}; +struct linux_afs_syscall_args { + register_t dummy; +}; +struct linux_tuxcall_args { + register_t dummy; +}; +struct linux_security_args { + register_t dummy; +}; +struct linux_gettid_args { + register_t dummy; +}; +struct linux_setxattr_args { + register_t dummy; +}; +struct linux_lsetxattr_args { + register_t dummy; +}; +struct linux_fsetxattr_args { + register_t dummy; +}; +struct linux_getxattr_args { + register_t dummy; +}; +struct linux_lgetxattr_args { + register_t dummy; +}; +struct linux_fgetxattr_args { + register_t dummy; +}; +struct linux_listxattr_args { + register_t dummy; +}; +struct linux_llistxattr_args { + register_t dummy; +}; +struct linux_flistxattr_args { + register_t dummy; +}; +struct linux_removexattr_args { + register_t dummy; +}; +struct linux_lremovexattr_args { + register_t dummy; +}; +struct linux_fremovexattr_args { + register_t dummy; +}; +struct linux_tkill_args { + char tid_l_[PADL_(int)]; int tid; char tid_r_[PADR_(int)]; + char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; +}; +struct linux_time_args { + char tm_l_[PADL_(l_time_t *)]; l_time_t * tm; char tm_r_[PADR_(l_time_t *)]; +}; +struct linux_sys_futex_args { + char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)]; + char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; + char val_l_[PADL_(int)]; int val; char val_r_[PADR_(int)]; + char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; + char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)]; + char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)]; +}; +struct linux_sched_setaffinity_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; + char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)]; +}; +struct linux_sched_getaffinity_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; + char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)]; +}; +struct linux_set_thread_area_args { + register_t dummy; +}; +struct linux_lookup_dcookie_args { + register_t dummy; +}; +struct linux_epoll_create_args { + register_t dummy; +}; +struct linux_epoll_ctl_old_args { + register_t dummy; +}; +struct linux_epoll_wait_old_args { + register_t dummy; +}; +struct linux_remap_file_pages_args { + register_t dummy; +}; +struct linux_getdents64_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char dirent_l_[PADL_(void *)]; void * dirent; char dirent_r_[PADR_(void *)]; + char count_l_[PADL_(l_uint)]; l_uint count; char count_r_[PADR_(l_uint)]; +}; +struct linux_set_tid_address_args { + char tidptr_l_[PADL_(int *)]; int * tidptr; char tidptr_r_[PADR_(int *)]; +}; +struct linux_semtimedop_args { + register_t dummy; +}; +struct linux_fadvise64_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; +}; +struct linux_timer_create_args { + char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; + char evp_l_[PADL_(struct sigevent *)]; struct sigevent * evp; char evp_r_[PADR_(struct sigevent *)]; + char timerid_l_[PADL_(l_timer_t *)]; l_timer_t * timerid; char timerid_r_[PADR_(l_timer_t *)]; +}; +struct linux_timer_settime_args { + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char new_l_[PADL_(const struct itimerspec *)]; const struct itimerspec * new; char new_r_[PADR_(const struct itimerspec *)]; + char old_l_[PADL_(struct itimerspec *)]; struct itimerspec * old; char old_r_[PADR_(struct itimerspec *)]; +}; +struct linux_timer_gettime_args { + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char setting_l_[PADL_(struct itimerspec *)]; struct itimerspec * setting; char setting_r_[PADR_(struct itimerspec *)]; +}; +struct linux_timer_getoverrun_args { + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; +}; +struct linux_timer_delete_args { + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; +}; +struct linux_clock_settime_args { + char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; + char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_clock_gettime_args { + char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; + char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_clock_getres_args { + char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; + char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_clock_nanosleep_args { + char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char rqtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rqtp; char rqtp_r_[PADR_(struct l_timespec *)]; + char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_exit_group_args { + char error_code_l_[PADL_(int)]; int error_code; char error_code_r_[PADR_(int)]; +}; +struct linux_epoll_wait_args { + register_t dummy; +}; +struct linux_epoll_ctl_args { + register_t dummy; +}; +struct linux_tgkill_args { + char tgid_l_[PADL_(int)]; int tgid; char tgid_r_[PADR_(int)]; + char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; + char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; +}; +struct linux_utimes_args { + char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)]; + char tptr_l_[PADL_(struct l_timeval *)]; struct l_timeval * tptr; char tptr_r_[PADR_(struct l_timeval *)]; +}; +struct linux_mbind_args { + register_t dummy; +}; +struct linux_set_mempolicy_args { + register_t dummy; +}; +struct linux_get_mempolicy_args { + register_t dummy; +}; +struct linux_mq_open_args { + register_t dummy; +}; +struct linux_mq_unlink_args { + register_t dummy; +}; +struct linux_mq_timedsend_args { + register_t dummy; +}; +struct linux_mq_timedreceive_args { + register_t dummy; +}; +struct linux_mq_notify_args { + register_t dummy; +}; +struct linux_mq_getsetattr_args { + register_t dummy; +}; +struct linux_kexec_load_args { + register_t dummy; +}; +struct linux_waitid_args { + char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; + char id_l_[PADL_(l_pid_t)]; l_pid_t id; char id_r_[PADR_(l_pid_t)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; + char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; + char rusage_l_[PADL_(struct rusage *)]; struct rusage * rusage; char rusage_r_[PADR_(struct rusage *)]; +}; +struct linux_add_key_args { + register_t dummy; +}; +struct linux_request_key_args { + register_t dummy; +}; +struct linux_keyctl_args { + register_t dummy; +}; +struct linux_ioprio_set_args { + register_t dummy; +}; +struct linux_ioprio_get_args { + register_t dummy; +}; +struct linux_inotify_init_args { + register_t dummy; +}; +struct linux_inotify_add_watch_args { + register_t dummy; +}; +struct linux_inotify_rm_watch_args { + register_t dummy; +}; +struct linux_migrate_pages_args { + register_t dummy; +}; +struct linux_openat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; +}; +struct linux_mkdirat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; +}; +struct linux_mknodat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; + char dev_l_[PADL_(l_uint)]; l_uint dev; char dev_r_[PADR_(l_uint)]; +}; +struct linux_fchownat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)]; + char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)]; + char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; +}; +struct linux_futimesat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(char *)]; char * filename; char filename_r_[PADR_(char *)]; + char utimes_l_[PADL_(struct l_timeval *)]; struct l_timeval * utimes; char utimes_r_[PADR_(struct l_timeval *)]; +}; +struct linux_newfstatat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(char *)]; char * pathname; char pathname_r_[PADR_(char *)]; + char statbuf_l_[PADL_(struct l_stat64 *)]; struct l_stat64 * statbuf; char statbuf_r_[PADR_(struct l_stat64 *)]; + char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; +}; +struct linux_unlinkat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; +}; +struct linux_renameat_args { + char olddfd_l_[PADL_(l_int)]; l_int olddfd; char olddfd_r_[PADR_(l_int)]; + char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; + char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)]; + char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)]; +}; +struct linux_linkat_args { + char olddfd_l_[PADL_(l_int)]; l_int olddfd; char olddfd_r_[PADR_(l_int)]; + char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; + char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)]; + char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)]; + char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; +}; +struct linux_symlinkat_args { + char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; + char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)]; + char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)]; +}; +struct linux_readlinkat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char bufsiz_l_[PADL_(l_int)]; l_int bufsiz; char bufsiz_r_[PADR_(l_int)]; +}; +struct linux_fchmodat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char mode_l_[PADL_(l_mode_t)]; l_mode_t mode; char mode_r_[PADR_(l_mode_t)]; +}; +struct linux_faccessat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)]; + char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; +}; +struct linux_pselect6_args { + char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)]; + char readfds_l_[PADL_(l_fd_set *)]; l_fd_set * readfds; char readfds_r_[PADR_(l_fd_set *)]; + char writefds_l_[PADL_(l_fd_set *)]; l_fd_set * writefds; char writefds_r_[PADR_(l_fd_set *)]; + char exceptfds_l_[PADL_(l_fd_set *)]; l_fd_set * exceptfds; char exceptfds_r_[PADR_(l_fd_set *)]; + char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)]; + char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)]; +}; +struct linux_ppoll_args { + register_t dummy; +}; +struct linux_unshare_args { + register_t dummy; +}; +struct linux_set_robust_list_args { + char head_l_[PADL_(struct linux_robust_list_head *)]; struct linux_robust_list_head * head; char head_r_[PADR_(struct linux_robust_list_head *)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; +}; +struct linux_get_robust_list_args { + char pid_l_[PADL_(l_int)]; l_int pid; char pid_r_[PADR_(l_int)]; + char head_l_[PADL_(struct linux_robust_list_head *)]; struct linux_robust_list_head * head; char head_r_[PADR_(struct linux_robust_list_head *)]; + char len_l_[PADL_(l_size_t *)]; l_size_t * len; char len_r_[PADR_(l_size_t *)]; +}; +struct linux_splice_args { + register_t dummy; +}; +struct linux_tee_args { + register_t dummy; +}; +struct linux_sync_file_range_args { + register_t dummy; +}; +struct linux_vmsplice_args { + register_t dummy; +}; +struct linux_move_pages_args { + register_t dummy; +}; +struct linux_utimensat_args { + register_t dummy; +}; +struct linux_epoll_pwait_args { + register_t dummy; +}; +struct linux_signalfd_args { + register_t dummy; +}; +struct linux_timerfd_args { + register_t dummy; +}; +struct linux_eventfd_args { + register_t dummy; +}; +struct linux_fallocate_args { + register_t dummy; +}; +struct linux_timerfd_settime_args { + register_t dummy; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:20:31 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6CB1A69AFA; Sat, 9 Jan 2016 16:20:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F7C711BB; Sat, 9 Jan 2016 16:20:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GKUkn035191; Sat, 9 Jan 2016 16:20:30 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GKTfj035180; Sat, 9 Jan 2016 16:20:29 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091620.u09GKTfj035180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293532 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:20:31 -0000 Author: dchagin Date: Sat Jan 9 16:20:29 2016 New Revision: 293532 URL: https://svnweb.freebsd.org/changeset/base/293532 Log: MFC r283427: Where possible we will use M_LINUX malloc(9) type. Move M_FUTEX defines to the linux_common.ko. Modified: stable/10/sys/compat/linux/linux_emul.c stable/10/sys/compat/linux/linux_file.c stable/10/sys/compat/linux/linux_futex.c stable/10/sys/compat/linux/linux_getcwd.c stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/linux/linux_socket.c stable/10/sys/compat/linux/linux_sysctl.c stable/10/sys/compat/linux/linux_uid16.c stable/10/sys/compat/linux/linux_util.c stable/10/sys/compat/linux/linux_util.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_emul.c ============================================================================== --- stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 16:16:16 2016 (r293531) +++ stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 16:20:29 2016 (r293532) @@ -98,7 +98,7 @@ linux_proc_init(struct thread *td, struc em->em_tid = newtd->td_proc->p_pid; - pem = malloc(sizeof(*pem), M_TEMP, M_WAITOK | M_ZERO); + pem = malloc(sizeof(*pem), M_LINUX, M_WAITOK | M_ZERO); sx_init(&pem->pem_sx, "lpemlk"); newtd->td_proc->p_emuldata = pem; } @@ -134,7 +134,7 @@ linux_proc_exit(void *arg __unused, stru p->p_emuldata = NULL; sx_destroy(&pem->pem_sx); - free(pem, M_TEMP); + free(pem, M_LINUX); } int @@ -181,7 +181,7 @@ linux_common_execve(struct thread *td, s PROC_UNLOCK(p); free(em, M_TEMP); - free(pem, M_TEMP); + free(pem, M_LINUX); } return (0); } Modified: stable/10/sys/compat/linux/linux_file.c ============================================================================== --- stable/10/sys/compat/linux/linux_file.c Sat Jan 9 16:16:16 2016 (r293531) +++ stable/10/sys/compat/linux/linux_file.c Sat Jan 9 16:20:29 2016 (r293532) @@ -369,8 +369,8 @@ getdents_common(struct thread *td, struc buflen = max(LINUX_DIRBLKSIZ, nbytes); buflen = min(buflen, MAXBSIZE); - buf = malloc(buflen, M_TEMP, M_WAITOK); - lbuf = malloc(LINUX_MAXRECLEN, M_TEMP, M_WAITOK | M_ZERO); + buf = malloc(buflen, M_LINUX, M_WAITOK); + lbuf = malloc(LINUX_MAXRECLEN, M_LINUX, M_WAITOK | M_ZERO); vn_lock(vp, LK_SHARED | LK_RETRY); aiov.iov_base = buf; @@ -521,8 +521,8 @@ out: VOP_UNLOCK(vp, 0); foffset_unlock(fp, off, 0); fdrop(fp, td); - free(buf, M_TEMP); - free(lbuf, M_TEMP); + free(buf, M_LINUX); + free(lbuf, M_LINUX); return (error); } Modified: stable/10/sys/compat/linux/linux_futex.c ============================================================================== --- stable/10/sys/compat/linux/linux_futex.c Sat Jan 9 16:16:16 2016 (r293531) +++ stable/10/sys/compat/linux/linux_futex.c Sat Jan 9 16:20:29 2016 (r293532) @@ -185,9 +185,6 @@ LIN_SDT_PROBE_DEFINE2(futex, release_fut LIN_SDT_PROBE_DEFINE1(futex, release_futexes, copyin_error, "int"); LIN_SDT_PROBE_DEFINE0(futex, release_futexes, return); -static MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes"); -static MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futexes wp"); - struct futex; struct waiting_proc { Modified: stable/10/sys/compat/linux/linux_getcwd.c ============================================================================== --- stable/10/sys/compat/linux/linux_getcwd.c Sat Jan 9 16:16:16 2016 (r293531) +++ stable/10/sys/compat/linux/linux_getcwd.c Sat Jan 9 16:20:29 2016 (r293532) @@ -186,7 +186,7 @@ linux_getcwd_scandir(lvpp, uvpp, bpp, bu dirbuflen = DIRBLKSIZ; if (dirbuflen < va.va_blocksize) dirbuflen = va.va_blocksize; - dirbuf = malloc(dirbuflen, M_TEMP, M_WAITOK); + dirbuf = malloc(dirbuflen, M_LINUX, M_WAITOK); #if 0 unionread: @@ -274,7 +274,7 @@ unionread: out: vput(lvp); *lvpp = NULL; - free(dirbuf, M_TEMP); + free(dirbuf, M_LINUX); return error; } Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 16:16:16 2016 (r293531) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 16:20:29 2016 (r293532) @@ -1204,7 +1204,7 @@ linux_setgroups(struct thread *td, struc ngrp = args->gidsetsize; if (ngrp < 0 || ngrp >= ngroups_max + 1) return (EINVAL); - linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK); + linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_LINUX, M_WAITOK); error = copyin(args->grouplist, linux_gidset, ngrp * sizeof(l_gid_t)); if (error) goto out; @@ -1243,7 +1243,7 @@ linux_setgroups(struct thread *td, struc crfree(oldcred); error = 0; out: - free(linux_gidset, M_TEMP); + free(linux_gidset, M_LINUX); return (error); } @@ -1275,14 +1275,14 @@ linux_getgroups(struct thread *td, struc ngrp = 0; linux_gidset = malloc(bsd_gidsetsz * sizeof(*linux_gidset), - M_TEMP, M_WAITOK); + M_LINUX, M_WAITOK); while (ngrp < bsd_gidsetsz) { linux_gidset[ngrp] = bsd_gidset[ngrp + 1]; ngrp++; } error = copyout(linux_gidset, args->grouplist, ngrp * sizeof(l_gid_t)); - free(linux_gidset, M_TEMP); + free(linux_gidset, M_LINUX); if (error) return (error); Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 16:16:16 2016 (r293531) +++ stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 16:20:29 2016 (r293532) @@ -609,7 +609,7 @@ linux_sendto_hdrincl(struct thread *td, linux_args->len > IP_MAXPACKET) return (EINVAL); - packet = (struct ip *)malloc(linux_args->len, M_TEMP, M_WAITOK); + packet = (struct ip *)malloc(linux_args->len, M_LINUX, M_WAITOK); /* Make kernel copy of the packet to be sent */ if ((error = copyin(PTRIN(linux_args->msg), packet, @@ -632,7 +632,7 @@ linux_sendto_hdrincl(struct thread *td, error = linux_sendit(td, linux_args->s, &msg, linux_args->flags, NULL, UIO_SYSSPACE); goout: - free(packet, M_TEMP); + free(packet, M_LINUX); return (error); } @@ -1119,7 +1119,7 @@ linux_sendmsg(struct thread *td, struct free(sa, M_SONAME); error = ENOBUFS; - cmsg = malloc(CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO); + cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK | M_ZERO); control = m_get(M_WAITOK, MT_CONTROL); if (control == NULL) goto bad; @@ -1197,7 +1197,7 @@ linux_sendmsg(struct thread *td, struct bad: free(iov, M_IOV); if (cmsg) - free(cmsg, M_TEMP); + free(cmsg, M_LINUX); return (error); } @@ -1270,7 +1270,7 @@ linux_recvmsg(struct thread *td, struct outlen = 0; if (control) { - linux_cmsg = malloc(L_CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO); + linux_cmsg = malloc(L_CMSG_HDRSZ, M_LINUX, M_WAITOK | M_ZERO); msg.msg_control = mtod(control, struct cmsghdr *); msg.msg_controllen = control->m_len; @@ -1363,7 +1363,7 @@ out: bad: free(iov, M_IOV); m_freem(control); - free(linux_cmsg, M_TEMP); + free(linux_cmsg, M_LINUX); return (error); } Modified: stable/10/sys/compat/linux/linux_sysctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_sysctl.c Sat Jan 9 16:16:16 2016 (r293531) +++ stable/10/sys/compat/linux/linux_sysctl.c Sat Jan 9 16:20:29 2016 (r293532) @@ -141,12 +141,12 @@ linux_sysctl(struct thread *td, struct l return (ENOTDIR); } - mib = malloc(la.nlen * sizeof(l_int), M_TEMP, M_WAITOK); + mib = malloc(la.nlen * sizeof(l_int), M_LINUX, M_WAITOK); error = copyin(PTRIN(la.name), mib, la.nlen * sizeof(l_int)); if (error) { LIN_SDT_PROBE1(sysctl, linux_sysctl, copyin_error, error); LIN_SDT_PROBE1(sysctl, linux_sysctl, return, error); - free(mib, M_TEMP); + free(mib, M_LINUX); return (error); } @@ -158,7 +158,7 @@ linux_sysctl(struct thread *td, struct l switch (mib[1]) { case LINUX_KERN_VERSION: error = handle_string(&la, version); - free(mib, M_TEMP); + free(mib, M_LINUX); LIN_SDT_PROBE1(sysctl, linux_sysctl, return, error); return (error); default: @@ -187,7 +187,7 @@ linux_sysctl(struct thread *td, struct l sbuf_delete(sb); } - free(mib, M_TEMP); + free(mib, M_LINUX); LIN_SDT_PROBE1(sysctl, linux_sysctl, return, ENOTDIR); return (ENOTDIR); Modified: stable/10/sys/compat/linux/linux_uid16.c ============================================================================== --- stable/10/sys/compat/linux/linux_uid16.c Sat Jan 9 16:16:16 2016 (r293531) +++ stable/10/sys/compat/linux/linux_uid16.c Sat Jan 9 16:20:29 2016 (r293532) @@ -172,12 +172,12 @@ linux_setgroups16(struct thread *td, str LIN_SDT_PROBE1(uid16, linux_setgroups16, return, EINVAL); return (EINVAL); } - linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK); + linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_LINUX, M_WAITOK); error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t)); if (error) { LIN_SDT_PROBE1(uid16, linux_setgroups16, copyin_error, error); LIN_SDT_PROBE1(uid16, linux_setgroups16, return, error); - free(linux_gidset, M_TEMP); + free(linux_gidset, M_LINUX); return (error); } newcred = crget(); @@ -219,7 +219,7 @@ linux_setgroups16(struct thread *td, str crfree(oldcred); error = 0; out: - free(linux_gidset, M_TEMP); + free(linux_gidset, M_LINUX); LIN_SDT_PROBE1(uid16, linux_setgroups16, return, error); return (error); @@ -260,14 +260,14 @@ linux_getgroups16(struct thread *td, str ngrp = 0; linux_gidset = malloc(bsd_gidsetsz * sizeof(*linux_gidset), - M_TEMP, M_WAITOK); + M_LINUX, M_WAITOK); while (ngrp < bsd_gidsetsz) { linux_gidset[ngrp] = bsd_gidset[ngrp + 1]; ngrp++; } error = copyout(linux_gidset, args->gidset, ngrp * sizeof(l_gid16_t)); - free(linux_gidset, M_TEMP); + free(linux_gidset, M_LINUX); if (error) { LIN_SDT_PROBE1(uid16, linux_getgroups16, copyout_error, error); LIN_SDT_PROBE1(uid16, linux_getgroups16, return, error); Modified: stable/10/sys/compat/linux/linux_util.c ============================================================================== --- stable/10/sys/compat/linux/linux_util.c Sat Jan 9 16:16:16 2016 (r293531) +++ stable/10/sys/compat/linux/linux_util.c Sat Jan 9 16:20:29 2016 (r293532) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include MALLOC_DEFINE(M_LINUX, "linux", "Linux mode structures"); +MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes"); +MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futex waiting proc"); const char linux_emul_path[] = "/compat/linux"; Modified: stable/10/sys/compat/linux/linux_util.h ============================================================================== --- stable/10/sys/compat/linux/linux_util.h Sat Jan 9 16:16:16 2016 (r293531) +++ stable/10/sys/compat/linux/linux_util.h Sat Jan 9 16:20:29 2016 (r293532) @@ -45,6 +45,8 @@ #include MALLOC_DECLARE(M_LINUX); +MALLOC_DECLARE(M_FUTEX); +MALLOC_DECLARE(M_FUTEX_WP); extern const char linux_emul_path[]; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:21:41 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E941A69BB5; Sat, 9 Jan 2016 16:21:41 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB5D814C4; Sat, 9 Jan 2016 16:21:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GLeD4037877; Sat, 9 Jan 2016 16:21:40 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GLdN5037873; Sat, 9 Jan 2016 16:21:39 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091621.u09GLdN5037873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293533 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:21:41 -0000 Author: dchagin Date: Sat Jan 9 16:21:39 2016 New Revision: 293533 URL: https://svnweb.freebsd.org/changeset/base/293533 Log: MFC r283428: Change linux faccessat syscall definition to match actual linux one. The AT_EACCESS and AT_SYMLINK_NOFOLLOW flags are actually implemented within the glibc wrapper function for faccessat(). If either of these flags are specified, then the wrapper function employs fstatat() to determine access permissions. Modified: stable/10/sys/amd64/linux/syscalls.master stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_file.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 16:20:29 2016 (r293532) +++ stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 16:21:39 2016 (r293533) @@ -450,7 +450,7 @@ 268 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \ l_mode_t mode); } 269 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, \ - l_int amode, l_int flag); } + l_int amode); } 270 AUE_SELECT STD { int linux_pselect6(l_int nfds, \ l_fd_set *readfds, l_fd_set *writefds, l_fd_set *exceptfds, \ struct l_timespec *tsp, l_uintptr_t *sig); } Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 16:20:29 2016 (r293532) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 16:21:39 2016 (r293533) @@ -507,7 +507,8 @@ char *buf, l_int bufsiz); } 306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \ l_mode_t mode); } -307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode, int flag); } +307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, \ + l_int amode); } 308 AUE_SELECT STD { int linux_pselect6(l_int nfds, l_fd_set *readfds, \ l_fd_set *writefds, l_fd_set *exceptfds, \ struct l_timespec *tsp, l_uintptr_t *sig); } Modified: stable/10/sys/compat/linux/linux_file.c ============================================================================== --- stable/10/sys/compat/linux/linux_file.c Sat Jan 9 16:20:29 2016 (r293532) +++ stable/10/sys/compat/linux/linux_file.c Sat Jan 9 16:21:39 2016 (r293533) @@ -580,10 +580,8 @@ int linux_faccessat(struct thread *td, struct linux_faccessat_args *args) { char *path; - int error, dfd, flag; + int error, dfd; - if (args->flag & ~LINUX_AT_EACCESS) - return (EINVAL); /* linux convention */ if (args->amode & ~(F_OK | X_OK | W_OK | R_OK)) return (EINVAL); @@ -596,8 +594,7 @@ linux_faccessat(struct thread *td, struc printf(ARGS(access, "%s, %d"), path, args->amode); #endif - flag = (args->flag & LINUX_AT_EACCESS) == 0 ? 0 : AT_EACCESS; - error = kern_accessat(td, dfd, path, UIO_SYSSPACE, flag, args->amode); + error = kern_accessat(td, dfd, path, UIO_SYSSPACE, 0, args->amode); LFREEPATH(path); return (error); Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 16:20:29 2016 (r293532) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 16:21:39 2016 (r293533) @@ -515,7 +515,8 @@ char *buf, l_int bufsiz); } 306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \ l_mode_t mode); } -307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode, l_int flag); } +307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, \ + l_int amode); } 308 AUE_SELECT STD { int linux_pselect6(l_int nfds, l_fd_set *readfds, \ l_fd_set *writefds, l_fd_set *exceptfds, \ struct l_timespec *tsp, l_uintptr_t *sig); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:23:13 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C70FBA69D4E; Sat, 9 Jan 2016 16:23:13 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FF5118AE; Sat, 9 Jan 2016 16:23:13 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GNCYd038007; Sat, 9 Jan 2016 16:23:12 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GNBVP037992; Sat, 9 Jan 2016 16:23:11 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091623.u09GNBVP037992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293534 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:23:14 -0000 Author: dchagin Date: Sat Jan 9 16:23:11 2016 New Revision: 293534 URL: https://svnweb.freebsd.org/changeset/base/293534 Log: Regen for r293533. Modified: stable/10/sys/amd64/linux/linux_proto.h stable/10/sys/amd64/linux/linux_syscall.h stable/10/sys/amd64/linux/linux_syscalls.c stable/10/sys/amd64/linux/linux_sysent.c stable/10/sys/amd64/linux/linux_systrace_args.c stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 16:23:11 2016 (r293534) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 283424 2015-05-24 16:07:11Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -935,7 +935,6 @@ struct linux_faccessat_args { char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)]; - char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; }; struct linux_pselect6_args { char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)]; Modified: stable/10/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 16:23:11 2016 (r293534) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 283424 2015-05-24 16:07:11Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin */ #define LINUX_SYS_read 0 Modified: stable/10/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 16:23:11 2016 (r293534) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 283424 2015-05-24 16:07:11Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 16:23:11 2016 (r293534) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 283424 2015-05-24 16:07:11Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin */ #include Modified: stable/10/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 16:23:11 2016 (r293534) @@ -1965,8 +1965,7 @@ systrace_args(int sysnum, void *params, iarg[0] = p->dfd; /* l_int */ uarg[1] = (intptr_t) p->filename; /* const char * */ iarg[2] = p->amode; /* l_int */ - iarg[3] = p->flag; /* l_int */ - *n_args = 4; + *n_args = 3; break; } /* linux_pselect6 */ @@ -5181,9 +5180,6 @@ systrace_entry_setargdesc(int sysnum, in case 2: p = "l_int"; break; - case 3: - p = "l_int"; - break; default: break; }; Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 16:23:11 2016 (r293534) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293512 2016-01-09 15:39:41Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293533 2016-01-09 16:21:39Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -992,7 +992,6 @@ struct linux_faccessat_args { char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)]; - char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; }; struct linux_pselect6_args { char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)]; Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 16:23:11 2016 (r293534) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293512 2016-01-09 15:39:41Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293533 2016-01-09 16:21:39Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 16:23:11 2016 (r293534) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293512 2016-01-09 15:39:41Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293533 2016-01-09 16:21:39Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 16:23:11 2016 (r293534) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293512 2016-01-09 15:39:41Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293533 2016-01-09 16:21:39Z dchagin */ #include "opt_compat.h" Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 16:23:11 2016 (r293534) @@ -2067,8 +2067,7 @@ systrace_args(int sysnum, void *params, iarg[0] = p->dfd; /* l_int */ uarg[1] = (intptr_t) p->filename; /* const char * */ iarg[2] = p->amode; /* l_int */ - iarg[3] = p->flag; /* int */ - *n_args = 4; + *n_args = 3; break; } /* linux_pselect6 */ @@ -5385,9 +5384,6 @@ systrace_entry_setargdesc(int sysnum, in case 2: p = "l_int"; break; - case 3: - p = "int"; - break; default: break; }; Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 16:23:11 2016 (r293534) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293512 2016-01-09 15:39:41Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1010,7 +1010,6 @@ struct linux_faccessat_args { char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)]; - char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; }; struct linux_pselect6_args { char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)]; Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 16:23:11 2016 (r293534) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293512 2016-01-09 15:39:41Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 16:23:11 2016 (r293534) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293512 2016-01-09 15:39:41Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 16:23:11 2016 (r293534) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293512 2016-01-09 15:39:41Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin */ #include Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 16:21:39 2016 (r293533) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 16:23:11 2016 (r293534) @@ -2143,8 +2143,7 @@ systrace_args(int sysnum, void *params, iarg[0] = p->dfd; /* l_int */ uarg[1] = (intptr_t) p->filename; /* const char * */ iarg[2] = p->amode; /* l_int */ - iarg[3] = p->flag; /* l_int */ - *n_args = 4; + *n_args = 3; break; } /* linux_pselect6 */ @@ -5616,9 +5615,6 @@ systrace_entry_setargdesc(int sysnum, in case 2: p = "l_int"; break; - case 3: - p = "l_int"; - break; default: break; }; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:24:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03ADFA69E13; Sat, 9 Jan 2016 16:24:32 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF7321B3E; Sat, 9 Jan 2016 16:24:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GOUpW038224; Sat, 9 Jan 2016 16:24:30 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GOUT2038217; Sat, 9 Jan 2016 16:24:30 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091624.u09GOUT2038217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293535 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:24:32 -0000 Author: dchagin Date: Sat Jan 9 16:24:30 2016 New Revision: 293535 URL: https://svnweb.freebsd.org/changeset/base/293535 Log: MFC r283431: Add AT_RANDOM and AT_EXECFN auxiliary vector entries which are used by glibc. At list since glibc version 2.16 using AT_RANDOM is mandatory. Modified: stable/10/sys/amd64/linux/linux.h stable/10/sys/amd64/linux/linux_sysvec.c stable/10/sys/amd64/linux32/linux.h stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/compat/linux/linux_misc.h stable/10/sys/i386/linux/linux.h stable/10/sys/i386/linux/linux_sysvec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux.h ============================================================================== --- stable/10/sys/amd64/linux/linux.h Sat Jan 9 16:23:11 2016 (r293534) +++ stable/10/sys/amd64/linux/linux.h Sat Jan 9 16:24:30 2016 (r293535) @@ -100,7 +100,7 @@ typedef struct { #define LINUX_NAME_MAX 255 #define LINUX_CTL_MAXNAME 10 -#define LINUX_AT_COUNT 17 /* Count of used aux entry types. */ +#define LINUX_AT_COUNT 19 /* Count of used aux entry types. */ struct l___sysctl_args { Modified: stable/10/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysvec.c Sat Jan 9 16:23:11 2016 (r293534) +++ stable/10/sys/amd64/linux/linux_sysvec.c Sat Jan 9 16:24:30 2016 (r293535) @@ -319,6 +319,9 @@ elf_linux_fixup(register_t **stack_base, AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid); AUXARGS_ENTRY(pos, LINUX_AT_SECURE, 0); AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform)); + AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, imgp->canary); + if (imgp->execpathp != 0) + AUXARGS_ENTRY(pos, LINUX_AT_EXECFN, imgp->execpathp); if (args->execfd != -1) AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd); AUXARGS_ENTRY(pos, AT_NULL, 0); @@ -345,16 +348,39 @@ linux_copyout_strings(struct image_param char *stringp, *destp; register_t *stack_base; struct ps_strings *arginfo; + char canary[LINUX_AT_RANDOM_LEN]; + size_t execpath_len; struct proc *p; /* * Calculate string base and vector table pointers. */ + if (imgp->execpath != NULL && imgp->auxargs != NULL) + execpath_len = strlen(imgp->execpath) + 1; + else + execpath_len = 0; + p = imgp->proc; arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; destp = (caddr_t)arginfo - SPARE_USRSPACE - + roundup(sizeof(canary), sizeof(char *)) - + roundup(execpath_len, sizeof(char *)) - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); + if (execpath_len != 0) { + imgp->execpathp = (uintptr_t)arginfo - execpath_len; + copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len); + } + + /* + * Prepare the canary for SSP. + */ + arc4rand(canary, sizeof(canary), 0); + imgp->canary = (uintptr_t)arginfo - + roundup(execpath_len, sizeof(char *)) - + roundup(sizeof(canary), sizeof(char *)); + copyout(canary, (void *)imgp->canary, sizeof(canary)); + /* * If we have a valid auxargs ptr, prepare some room * on the stack. Modified: stable/10/sys/amd64/linux32/linux.h ============================================================================== --- stable/10/sys/amd64/linux32/linux.h Sat Jan 9 16:23:11 2016 (r293534) +++ stable/10/sys/amd64/linux32/linux.h Sat Jan 9 16:24:30 2016 (r293535) @@ -110,7 +110,7 @@ typedef struct { /* * Miscellaneous */ -#define LINUX_AT_COUNT 18 /* Count of used aux entry types. +#define LINUX_AT_COUNT 20 /* Count of used aux entry types. * Keep this synchronized with * elf_linux_fixup() code. */ Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 16:23:11 2016 (r293534) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 16:24:30 2016 (r293535) @@ -289,6 +289,9 @@ elf_linux_fixup(register_t **stack_base, AUXARGS_ENTRY_32(pos, AT_GID, imgp->proc->p_ucred->cr_rgid); AUXARGS_ENTRY_32(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid); AUXARGS_ENTRY_32(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform)); + AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, PTROUT(imgp->canary)); + if (imgp->execpathp != 0) + AUXARGS_ENTRY(pos, LINUX_AT_EXECFN, PTROUT(imgp->execpathp)); if (args->execfd != -1) AUXARGS_ENTRY_32(pos, AT_EXECFD, args->execfd); AUXARGS_ENTRY_32(pos, AT_NULL, 0); @@ -869,14 +872,37 @@ linux_copyout_strings(struct image_param char *stringp, *destp; u_int32_t *stack_base; struct linux32_ps_strings *arginfo; + char canary[LINUX_AT_RANDOM_LEN]; + size_t execpath_len; /* * Calculate string base and vector table pointers. */ + if (imgp->execpath != NULL && imgp->auxargs != NULL) + execpath_len = strlen(imgp->execpath) + 1; + else + execpath_len = 0; + arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS; destp = (caddr_t)arginfo - SPARE_USRSPACE - + roundup(sizeof(canary), sizeof(char *)) - + roundup(execpath_len, sizeof(char *)) - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); + if (execpath_len != 0) { + imgp->execpathp = (uintptr_t)arginfo - execpath_len; + copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len); + } + + /* + * Prepare the canary for SSP. + */ + arc4rand(canary, sizeof(canary), 0); + imgp->canary = (uintptr_t)arginfo - + roundup(execpath_len, sizeof(char *)) - + roundup(sizeof(canary), sizeof(char *)); + copyout(canary, (void *)imgp->canary, sizeof(canary)); + /* * If we have a valid auxargs ptr, prepare some room * on the stack. Modified: stable/10/sys/compat/linux/linux_misc.h ============================================================================== --- stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 16:23:11 2016 (r293534) +++ stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 16:24:30 2016 (r293535) @@ -70,10 +70,13 @@ extern const char *linux_kplatform; #define LINUX_AT_BASE_PLATFORM 24 /* string identifying real platform, may * differ from AT_PLATFORM. */ +#define LINUX_AT_RANDOM 25 /* address of random bytes */ #define LINUX_AT_EXECFN 31 /* filename of program */ #define LINUX_AT_SYSINFO 32 /* vsyscall */ #define LINUX_AT_SYSINFO_EHDR 33 /* vdso header */ +#define LINUX_AT_RANDOM_LEN 16 /* size of random bytes */ + /* Linux sets the i387 to extended precision. */ #if defined(__i386__) || defined(__amd64__) #define __LINUX_NPXCW__ 0x37f Modified: stable/10/sys/i386/linux/linux.h ============================================================================== --- stable/10/sys/i386/linux/linux.h Sat Jan 9 16:23:11 2016 (r293534) +++ stable/10/sys/i386/linux/linux.h Sat Jan 9 16:24:30 2016 (r293535) @@ -104,7 +104,7 @@ typedef struct { /* * Miscellaneous */ -#define LINUX_AT_COUNT 18 /* Count of used aux entry types. +#define LINUX_AT_COUNT 20 /* Count of used aux entry types. * Keep this synchronized with * elf_linux_fixup() code. */ Modified: stable/10/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysvec.c Sat Jan 9 16:23:11 2016 (r293534) +++ stable/10/sys/i386/linux/linux_sysvec.c Sat Jan 9 16:24:30 2016 (r293535) @@ -298,6 +298,9 @@ elf_linux_fixup(register_t **stack_base, AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid); AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid); AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(uplatform)); + AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, imgp->canary); + if (imgp->execpathp != 0) + AUXARGS_ENTRY(pos, LINUX_AT_EXECFN, imgp->execpathp); if (args->execfd != -1) AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd); AUXARGS_ENTRY(pos, AT_NULL, 0); @@ -321,14 +324,22 @@ linux_copyout_strings(struct image_param char *stringp, *destp; register_t *stack_base; struct ps_strings *arginfo; + char canary[LINUX_AT_RANDOM_LEN]; + size_t execpath_len; struct proc *p; /* * Calculate string base and vector table pointers. */ p = imgp->proc; + if (imgp->execpath != NULL && imgp->auxargs != NULL) + execpath_len = strlen(imgp->execpath) + 1; + else + execpath_len = 0; arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; destp = (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform - + roundup(sizeof(canary), sizeof(char *)) - + roundup(execpath_len, sizeof(char *)) - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); /* @@ -337,6 +348,21 @@ linux_copyout_strings(struct image_param copyout(linux_kplatform, ((caddr_t)arginfo - linux_szplatform), linux_szplatform); + if (execpath_len != 0) { + imgp->execpathp = (uintptr_t)arginfo - + linux_szplatform - execpath_len; + copyout(imgp->execpath, (void *)imgp->execpathp, execpath_len); + } + + /* + * Prepare the canary for SSP. + */ + arc4rand(canary, sizeof(canary), 0); + imgp->canary = (uintptr_t)arginfo - linux_szplatform - + roundup(execpath_len, sizeof(char *)) - + roundup(sizeof(canary), sizeof(char *)); + copyout(canary, (void *)imgp->canary, sizeof(canary)); + /* * If we have a valid auxargs ptr, prepare some room * on the stack. From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:25:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92A8AA69ED5; Sat, 9 Jan 2016 16:25:32 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45B961CE3; Sat, 9 Jan 2016 16:25:32 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GPVuQ038321; Sat, 9 Jan 2016 16:25:31 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GPV66038318; Sat, 9 Jan 2016 16:25:31 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091625.u09GPV66038318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293536 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:25:32 -0000 Author: dchagin Date: Sat Jan 9 16:25:30 2016 New Revision: 293536 URL: https://svnweb.freebsd.org/changeset/base/293536 Log: MFC r283432: Being exported through vdso the note.Linux section used by glibc to determine the kernel version (this saves one uname call). Temporarily disable the export of a note.Linux section until I figured out how to change the kernel version in the note.Linux on the fly. Modified: stable/10/sys/amd64/linux/linux_locore.s stable/10/sys/amd64/linux32/linux32_locore.s stable/10/sys/i386/linux/linux_locore.s Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_locore.s ============================================================================== --- stable/10/sys/amd64/linux/linux_locore.s Sat Jan 9 16:24:30 2016 (r293535) +++ stable/10/sys/amd64/linux/linux_locore.s Sat Jan 9 16:25:30 2016 (r293536) @@ -58,7 +58,7 @@ NON_GPROF_ENTRY(__vdso_getcpu) .weak getcpu .set getcpu, __vdso_getcpu - +#if 0 .section .note.Linux, "a",@note .long 2f - 1f /* namesz */ .balign 4 @@ -73,3 +73,4 @@ NON_GPROF_ENTRY(__vdso_getcpu) 4: .balign 4 .previous +#endif Modified: stable/10/sys/amd64/linux32/linux32_locore.s ============================================================================== --- stable/10/sys/amd64/linux32/linux32_locore.s Sat Jan 9 16:24:30 2016 (r293535) +++ stable/10/sys/amd64/linux32/linux32_locore.s Sat Jan 9 16:25:30 2016 (r293536) @@ -55,7 +55,7 @@ NON_GPROF_ENTRY(linux32_vsyscall) ret .endvsyscall: - +#if 0 .section .note.Linux, "a",@note .long 2f - 1f /* namesz */ .balign 4 @@ -70,7 +70,7 @@ NON_GPROF_ENTRY(linux32_vsyscall) 4: .balign 4 .previous - +#endif #define do_cfa_expr(offset) \ .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ Modified: stable/10/sys/i386/linux/linux_locore.s ============================================================================== --- stable/10/sys/i386/linux/linux_locore.s Sat Jan 9 16:24:30 2016 (r293535) +++ stable/10/sys/i386/linux/linux_locore.s Sat Jan 9 16:25:30 2016 (r293536) @@ -48,7 +48,7 @@ NON_GPROF_ENTRY(linux_vsyscall) ret .endvsyscall: - +#if 0 .section .note.Linux, "a",@note .long 2f - 1f /* namesz */ .balign 4 @@ -63,7 +63,7 @@ NON_GPROF_ENTRY(linux_vsyscall) 4: .balign 4 .previous - +#endif #define do_cfa_expr(offset) \ .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:26:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65D8BA69F99; Sat, 9 Jan 2016 16:26:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2410A1F11; Sat, 9 Jan 2016 16:26:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GQdEC038510; Sat, 9 Jan 2016 16:26:39 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GQdsZ038509; Sat, 9 Jan 2016 16:26:39 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091626.u09GQdsZ038509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293537 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:26:40 -0000 Author: dchagin Date: Sat Jan 9 16:26:39 2016 New Revision: 293537 URL: https://svnweb.freebsd.org/changeset/base/293537 Log: MFC r283433: Rewrite linux_recvfrom. To avoid double conversion of sockaddr use kern_recvit() directly. And check fromlen parameter before sockaddr copyin and conversion. Modified: stable/10/sys/compat/linux/linux_socket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 16:25:30 2016 (r293536) +++ stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 16:26:39 2016 (r293537) @@ -428,7 +428,6 @@ linux_to_bsd_sockaddr(struct sockaddr *a return (error); } - static int linux_sa_put(struct osockaddr *osa) { @@ -1027,41 +1026,50 @@ linux_sendto(struct thread *td, struct l int linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args) { - struct recvfrom_args /* { - int s; - caddr_t buf; - size_t len; - int flags; - struct sockaddr * __restrict from; - socklen_t * __restrict fromlenaddr; - } */ bsd_args; - size_t len; + struct msghdr msg; + struct iovec aiov; int error; - if ((error = copyin(PTRIN(args->fromlen), &len, sizeof(size_t)))) - return (error); + if (PTRIN(args->fromlen) != NULL) { + error = copyin(PTRIN(args->fromlen), &msg.msg_namelen, + sizeof(msg.msg_namelen)); + if (error != 0) + return (error); - bsd_args.s = args->s; - bsd_args.buf = PTRIN(args->buf); - bsd_args.len = args->len; - bsd_args.flags = linux_to_bsd_msg_flags(args->flags); - /* XXX: */ - bsd_args.from = (struct sockaddr * __restrict)PTRIN(args->from); - bsd_args.fromlenaddr = PTRIN(args->fromlen);/* XXX */ - - linux_to_bsd_sockaddr((struct sockaddr *)bsd_args.from, len); - error = sys_recvfrom(td, &bsd_args); - bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.from); - - if (error) + error = linux_to_bsd_sockaddr((struct sockaddr *)PTRIN(args->from), + msg.msg_namelen); + if (error != 0) + return (error); + } else + msg.msg_namelen = 0; + + msg.msg_name = (struct sockaddr * __restrict)PTRIN(args->from); + msg.msg_iov = &aiov; + msg.msg_iovlen = 1; + aiov.iov_base = PTRIN(args->buf); + aiov.iov_len = args->len; + msg.msg_control = 0; + msg.msg_flags = linux_to_bsd_msg_flags(args->flags); + + error = kern_recvit(td, args->s, &msg, UIO_USERSPACE, NULL); + if (error != 0) return (error); - if (args->from) { - error = linux_sa_put((struct osockaddr *) + + if (PTRIN(args->from) != NULL) { + error = bsd_to_linux_sockaddr((struct sockaddr *) PTRIN(args->from)); - if (error) + if (error != 0) return (error); + + error = linux_sa_put((struct osockaddr *) + PTRIN(args->from)); } - return (0); + + if (PTRIN(args->fromlen) != NULL) + error = copyout(&msg.msg_namelen, PTRIN(args->fromlen), + sizeof(msg.msg_namelen)); + + return (error); } int From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:27:35 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09C16A67018; Sat, 9 Jan 2016 16:27:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBF9910A3; Sat, 9 Jan 2016 16:27:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GRXAt038604; Sat, 9 Jan 2016 16:27:33 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GRXR1038603; Sat, 9 Jan 2016 16:27:33 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091627.u09GRXR1038603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293538 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:27:35 -0000 Author: dchagin Date: Sat Jan 9 16:27:33 2016 New Revision: 293538 URL: https://svnweb.freebsd.org/changeset/base/293538 Log: MFC r283434: Set WIFCONTINUED to the wait status if needed. Modified: stable/10/sys/compat/linux/linux_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 16:26:39 2016 (r293537) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 16:27:33 2016 (r293538) @@ -873,6 +873,8 @@ linux_common_wait(struct thread *td, int else if (WIFSTOPPED(tmpstat)) tmpstat = (tmpstat & 0xffff00ff) | (BSD_TO_LINUX_SIGNAL(WSTOPSIG(tmpstat)) << 8); + else if (WIFCONTINUED(tmpstat)) + tmpstat = 0xffff; error = copyout(&tmpstat, status, sizeof(int)); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:28:41 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E007A6709C; Sat, 9 Jan 2016 16:28:41 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54CBF1246; Sat, 9 Jan 2016 16:28:41 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GSeff038701; Sat, 9 Jan 2016 16:28:40 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GSeBY038700; Sat, 9 Jan 2016 16:28:40 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091628.u09GSeBY038700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293539 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:28:41 -0000 Author: dchagin Date: Sat Jan 9 16:28:40 2016 New Revision: 293539 URL: https://svnweb.freebsd.org/changeset/base/293539 Log: MFC r283435: Convert Linux wait options to the FreeBSD. Check wait options as a Linux do. Linux always set WEXITED option not a WUNTRACED|WNOHANG which is a strange bug. Modified: stable/10/sys/compat/linux/linux_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 16:27:33 2016 (r293538) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 16:28:40 2016 (r293539) @@ -885,26 +885,20 @@ linux_common_wait(struct thread *td, int int linux_waitpid(struct thread *td, struct linux_waitpid_args *args) { - int options; - + struct linux_wait4_args wait4_args; + #ifdef DEBUG if (ldebug(waitpid)) printf(ARGS(waitpid, "%d, %p, %d"), args->pid, (void *)args->status, args->options); #endif - /* - * this is necessary because the test in kern_wait doesn't work - * because we mess with the options here - */ - if (args->options & ~(WUNTRACED | WNOHANG | WCONTINUED | __WCLONE)) - return (EINVAL); - - options = (args->options & (WNOHANG | WUNTRACED)); - /* WLINUXCLONE should be equal to __WCLONE, but we make sure */ - if (args->options & __WCLONE) - options |= WLINUXCLONE; - return (linux_common_wait(td, args->pid, args->status, options, NULL)); + wait4_args.pid = args->pid; + wait4_args.status = args->status; + wait4_args.options = args->options; + wait4_args.rusage = NULL; + + return (linux_wait4(td, &wait4_args)); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ @@ -920,11 +914,12 @@ linux_wait4(struct thread *td, struct li args->pid, (void *)args->status, args->options, (void *)args->rusage); #endif + if (args->options & ~(LINUX_WUNTRACED | LINUX_WNOHANG | + LINUX_WCONTINUED | __WCLONE | __WNOTHREAD | __WALL)) + return (EINVAL); - options = (args->options & (WNOHANG | WUNTRACED)); - /* WLINUXCLONE should be equal to __WCLONE, but we make sure */ - if (args->options & __WCLONE) - options |= WLINUXCLONE; + options = WEXITED; + linux_to_bsd_waitopts(args->options, &options); if (args->rusage != NULL) rup = &ru; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:29:53 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06DBAA6711D; Sat, 9 Jan 2016 16:29:53 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D42821397; Sat, 9 Jan 2016 16:29:52 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GTpn3038797; Sat, 9 Jan 2016 16:29:51 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GTpaV038794; Sat, 9 Jan 2016 16:29:51 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091629.u09GTpaV038794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293540 - in stable/10/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:29:53 -0000 Author: dchagin Date: Sat Jan 9 16:29:51 2016 New Revision: 293540 URL: https://svnweb.freebsd.org/changeset/base/293540 Log: MFC r283436: Use the BSD_TO_LINUX_SIGNAL() wherever there is no need to check the ABI as it is known. Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/compat/linux/linux_signal.c stable/10/sys/i386/linux/linux_sysvec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 16:28:40 2016 (r293539) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 16:29:51 2016 (r293540) @@ -344,9 +344,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo /* * Build the argument list for the signal handler. */ - if (p->p_sysent->sv_sigtbl) - if (sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; + sig = BSD_TO_LINUX_SIGNAL(sig); bzero(&frame, sizeof(frame)); @@ -492,9 +490,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t /* * Build the argument list for the signal handler. */ - if (p->p_sysent->sv_sigtbl) - if (sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; + sig = BSD_TO_LINUX_SIGNAL(sig); bzero(&frame, sizeof(frame)); Modified: stable/10/sys/compat/linux/linux_signal.c ============================================================================== --- stable/10/sys/compat/linux/linux_signal.c Sat Jan 9 16:28:40 2016 (r293539) +++ stable/10/sys/compat/linux/linux_signal.c Sat Jan 9 16:29:51 2016 (r293540) @@ -628,10 +628,8 @@ linux_tkill(struct thread *td, struct li if (!LINUX_SIG_VALID(args->sig)) return (EINVAL); - if (args->sig > 0 && args->sig <= LINUX_SIGTBLSZ) - sig = linux_to_bsd_signal[_SIG_IDX(args->sig)]; - else - sig = args->sig; + + sig = BSD_TO_LINUX_SIGNAL(args->sig); tdt = linux_tdfind(td, args->tid, -1); if (tdt == NULL) @@ -788,10 +786,7 @@ linux_rt_sigqueueinfo(struct thread *td, if (linfo.lsi_code >= 0) return (EPERM); - if (args->sig > 0 && args->sig <= LINUX_SIGTBLSZ) - sig = linux_to_bsd_signal[_SIG_IDX(args->sig)]; - else - sig = args->sig; + sig = BSD_TO_LINUX_SIGNAL(args->sig); error = ESRCH; if ((p = pfind(args->pid)) != NULL || Modified: stable/10/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysvec.c Sat Jan 9 16:28:40 2016 (r293539) +++ stable/10/sys/i386/linux/linux_sysvec.c Sat Jan 9 16:29:51 2016 (r293540) @@ -480,9 +480,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo /* * Build the argument list for the signal handler. */ - if (p->p_sysent->sv_sigtbl) - if (sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; + sig = BSD_TO_LINUX_SIGNAL(sig); bzero(&frame, sizeof(frame)); @@ -623,9 +621,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t /* * Build the argument list for the signal handler. */ - if (p->p_sysent->sv_sigtbl) - if (sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; + sig = BSD_TO_LINUX_SIGNAL(sig); bzero(&frame, sizeof(frame)); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:31:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68B57A672F1; Sat, 9 Jan 2016 16:31:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B20515E7; Sat, 9 Jan 2016 16:31:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GVBxp041363; Sat, 9 Jan 2016 16:31:11 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GVAmg041358; Sat, 9 Jan 2016 16:31:10 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091631.u09GVAmg041358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:31:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293541 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:31:12 -0000 Author: dchagin Date: Sat Jan 9 16:31:10 2016 New Revision: 293541 URL: https://svnweb.freebsd.org/changeset/base/293541 Log: MFC r283437: To avoid code duplication move open/fcntl definitions to the MI header file. Modified: stable/10/sys/amd64/linux/linux.h stable/10/sys/amd64/linux32/linux.h stable/10/sys/compat/linux/linux_file.h stable/10/sys/compat/linux/linux_socket.c stable/10/sys/i386/linux/linux.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux.h ============================================================================== --- stable/10/sys/amd64/linux/linux.h Sat Jan 9 16:29:51 2016 (r293540) +++ stable/10/sys/amd64/linux/linux.h Sat Jan 9 16:31:10 2016 (r293541) @@ -407,44 +407,6 @@ struct l_rt_sigframe { }; /* - * open/fcntl flags - */ -#define LINUX_O_RDONLY 00000000 -#define LINUX_O_WRONLY 00000001 -#define LINUX_O_RDWR 00000002 -#define LINUX_O_ACCMODE 00000003 -#define LINUX_O_CREAT 00000100 -#define LINUX_O_EXCL 00000200 -#define LINUX_O_NOCTTY 00000400 -#define LINUX_O_TRUNC 00001000 -#define LINUX_O_APPEND 00002000 -#define LINUX_O_NONBLOCK 00004000 -#define LINUX_O_NDELAY LINUX_O_NONBLOCK -#define LINUX_O_SYNC 00010000 -#define LINUX_FASYNC 00020000 -#define LINUX_O_DIRECT 00040000 /* Direct disk access hint */ -#define LINUX_O_LARGEFILE 00100000 -#define LINUX_O_DIRECTORY 00200000 /* Must be a directory */ -#define LINUX_O_NOFOLLOW 00400000 /* Do not follow links */ -#define LINUX_O_NOATIME 01000000 -#define LINUX_O_CLOEXEC 02000000 - -#define LINUX_F_DUPFD 0 -#define LINUX_F_GETFD 1 -#define LINUX_F_SETFD 2 -#define LINUX_F_GETFL 3 -#define LINUX_F_SETFL 4 -#define LINUX_F_GETLK 5 -#define LINUX_F_SETLK 6 -#define LINUX_F_SETLKW 7 -#define LINUX_F_SETOWN 8 -#define LINUX_F_GETOWN 9 - -#define LINUX_F_RDLCK 0 -#define LINUX_F_WRLCK 1 -#define LINUX_F_UNLCK 2 - -/* * mount flags */ #define LINUX_MS_RDONLY 0x0001 Modified: stable/10/sys/amd64/linux32/linux.h ============================================================================== --- stable/10/sys/amd64/linux32/linux.h Sat Jan 9 16:29:51 2016 (r293540) +++ stable/10/sys/amd64/linux32/linux.h Sat Jan 9 16:31:10 2016 (r293541) @@ -520,47 +520,12 @@ struct l_rt_sigframe { } __packed; /* - * open/fcntl flags + * arch specific open/fcntl flags */ -#define LINUX_O_RDONLY 00000000 -#define LINUX_O_WRONLY 00000001 -#define LINUX_O_RDWR 00000002 -#define LINUX_O_ACCMODE 00000003 -#define LINUX_O_CREAT 00000100 -#define LINUX_O_EXCL 00000200 -#define LINUX_O_NOCTTY 00000400 -#define LINUX_O_TRUNC 00001000 -#define LINUX_O_APPEND 00002000 -#define LINUX_O_NONBLOCK 00004000 -#define LINUX_O_NDELAY LINUX_O_NONBLOCK -#define LINUX_O_SYNC 00010000 -#define LINUX_FASYNC 00020000 -#define LINUX_O_DIRECT 00040000 /* Direct disk access hint */ -#define LINUX_O_LARGEFILE 00100000 -#define LINUX_O_DIRECTORY 00200000 /* Must be a directory */ -#define LINUX_O_NOFOLLOW 00400000 /* Do not follow links */ -#define LINUX_O_NOATIME 01000000 -#define LINUX_O_CLOEXEC 02000000 - -#define LINUX_F_DUPFD 0 -#define LINUX_F_GETFD 1 -#define LINUX_F_SETFD 2 -#define LINUX_F_GETFL 3 -#define LINUX_F_SETFL 4 -#define LINUX_F_GETLK 5 -#define LINUX_F_SETLK 6 -#define LINUX_F_SETLKW 7 -#define LINUX_F_SETOWN 8 -#define LINUX_F_GETOWN 9 - #define LINUX_F_GETLK64 12 #define LINUX_F_SETLK64 13 #define LINUX_F_SETLKW64 14 -#define LINUX_F_RDLCK 0 -#define LINUX_F_WRLCK 1 -#define LINUX_F_UNLCK 2 - union l_semun { l_int val; l_uintptr_t buf; Modified: stable/10/sys/compat/linux/linux_file.h ============================================================================== --- stable/10/sys/compat/linux/linux_file.h Sat Jan 9 16:29:51 2016 (r293540) +++ stable/10/sys/compat/linux/linux_file.h Sat Jan 9 16:31:10 2016 (r293541) @@ -54,4 +54,48 @@ #define LINUX_MS_NOEXEC 0x0008 #define LINUX_MS_REMOUNT 0x0020 +/* + * common open/fcntl flags + */ +#define LINUX_O_RDONLY 00000000 +#define LINUX_O_WRONLY 00000001 +#define LINUX_O_RDWR 00000002 +#define LINUX_O_ACCMODE 00000003 +#define LINUX_O_CREAT 00000100 +#define LINUX_O_EXCL 00000200 +#define LINUX_O_NOCTTY 00000400 +#define LINUX_O_TRUNC 00001000 +#define LINUX_O_APPEND 00002000 +#define LINUX_O_NONBLOCK 00004000 +#define LINUX_O_NDELAY LINUX_O_NONBLOCK +#define LINUX_O_SYNC 00010000 +#define LINUX_FASYNC 00020000 +#define LINUX_O_DIRECT 00040000 /* Direct disk access hint */ +#define LINUX_O_LARGEFILE 00100000 +#define LINUX_O_DIRECTORY 00200000 /* Must be a directory */ +#define LINUX_O_NOFOLLOW 00400000 /* Do not follow links */ +#define LINUX_O_NOATIME 01000000 +#define LINUX_O_CLOEXEC 02000000 + +#define LINUX_F_DUPFD 0 +#define LINUX_F_GETFD 1 +#define LINUX_F_SETFD 2 +#define LINUX_F_GETFL 3 +#define LINUX_F_SETFL 4 +#ifndef LINUX_F_GETLK +#define LINUX_F_GETLK 5 +#define LINUX_F_SETLK 6 +#define LINUX_F_SETLKW 7 +#endif +#ifndef LINUX_F_SETOWN +#define LINUX_F_SETOWN 8 +#define LINUX_F_GETOWN 9 +#endif + +#ifndef LINUX_F_RDLCK +#define LINUX_F_RDLCK 0 +#define LINUX_F_WRLCK 1 +#define LINUX_F_UNLCK 2 +#endif + #endif /* !_LINUX_FILE_H_ */ Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 16:29:51 2016 (r293540) +++ stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 16:31:10 2016 (r293541) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#include #include #include Modified: stable/10/sys/i386/linux/linux.h ============================================================================== --- stable/10/sys/i386/linux/linux.h Sat Jan 9 16:29:51 2016 (r293540) +++ stable/10/sys/i386/linux/linux.h Sat Jan 9 16:31:10 2016 (r293541) @@ -497,47 +497,12 @@ struct l_rt_sigframe { extern struct sysentvec linux_sysvec; /* - * open/fcntl flags + * arch specific open/fcntl flags */ -#define LINUX_O_RDONLY 00000000 -#define LINUX_O_WRONLY 00000001 -#define LINUX_O_RDWR 00000002 -#define LINUX_O_ACCMODE 00000003 -#define LINUX_O_CREAT 00000100 -#define LINUX_O_EXCL 00000200 -#define LINUX_O_NOCTTY 00000400 -#define LINUX_O_TRUNC 00001000 -#define LINUX_O_APPEND 00002000 -#define LINUX_O_NONBLOCK 00004000 -#define LINUX_O_NDELAY LINUX_O_NONBLOCK -#define LINUX_O_SYNC 00010000 -#define LINUX_FASYNC 00020000 -#define LINUX_O_DIRECT 00040000 /* Direct disk access hint */ -#define LINUX_O_LARGEFILE 00100000 -#define LINUX_O_DIRECTORY 00200000 /* Must be a directory */ -#define LINUX_O_NOFOLLOW 00400000 /* Do not follow links */ -#define LINUX_O_NOATIME 01000000 -#define LINUX_O_CLOEXEC 02000000 - -#define LINUX_F_DUPFD 0 -#define LINUX_F_GETFD 1 -#define LINUX_F_SETFD 2 -#define LINUX_F_GETFL 3 -#define LINUX_F_SETFL 4 -#define LINUX_F_GETLK 5 -#define LINUX_F_SETLK 6 -#define LINUX_F_SETLKW 7 -#define LINUX_F_SETOWN 8 -#define LINUX_F_GETOWN 9 - #define LINUX_F_GETLK64 12 #define LINUX_F_SETLK64 13 #define LINUX_F_SETLKW64 14 -#define LINUX_F_RDLCK 0 -#define LINUX_F_WRLCK 1 -#define LINUX_F_UNLCK 2 - union l_semun { l_int val; struct l_semid_ds *buf; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:32:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1C0CA6743A; Sat, 9 Jan 2016 16:32:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF1A219E8; Sat, 9 Jan 2016 16:32:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GWZXA041473; Sat, 9 Jan 2016 16:32:35 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GWZlP041472; Sat, 9 Jan 2016 16:32:35 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091632.u09GWZlP041472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293542 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:32:37 -0000 Author: dchagin Date: Sat Jan 9 16:32:35 2016 New Revision: 293542 URL: https://svnweb.freebsd.org/changeset/base/293542 Log: MFC r283438: Add several fcntl flags. Modified: stable/10/sys/compat/linux/linux_file.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_file.h ============================================================================== --- stable/10/sys/compat/linux/linux_file.h Sat Jan 9 16:31:10 2016 (r293541) +++ stable/10/sys/compat/linux/linux_file.h Sat Jan 9 16:32:35 2016 (r293542) @@ -91,6 +91,33 @@ #define LINUX_F_SETOWN 8 #define LINUX_F_GETOWN 9 #endif +#ifndef LINUX_F_SETSIG +#define LINUX_F_SETSIG 10 +#define LINUX_F_GETSIG 11 +#endif +#ifndef LINUX_F_SETOWN_EX +#define LINUX_F_SETOWN_EX 15 +#define LINUX_F_GETOWN_EX 16 +#define LINUX_F_GETOWNER_UIDS 17 +#endif + +#define LINUX_F_SPECIFIC_BASE 1024 + +#define LINUX_F_SETLEASE (LINUX_F_SPECIFIC_BASE + 0) +#define LINUX_F_GETLEASE (LINUX_F_SPECIFIC_BASE + 1) +#define LINUX_F_CANCELLK (LINUX_F_SPECIFIC_BASE + 5) +#define LINUX_F_DUPFD_CLOEXEC (LINUX_F_SPECIFIC_BASE + 6) +#define LINUX_F_NOTIFY (LINUX_F_SPECIFIC_BASE + 2) +#define LINUX_F_SETPIPE_SZ (LINUX_F_SPECIFIC_BASE + 7) +#define LINUX_F_GETPIPE_SZ (LINUX_F_SPECIFIC_BASE + 8) + +#define LINUX_F_GETLKP 36 +#define LINUX_F_SETLKP 37 +#define LINUX_F_SETLKPW 38 + +#define LINUX_F_OWNER_TID 0 +#define LINUX_F_OWNER_PID 1 +#define LINUX_F_OWNER_PGRP 2 #ifndef LINUX_F_RDLCK #define LINUX_F_RDLCK 0 From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:33:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6B75A674DF; Sat, 9 Jan 2016 16:33:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6DA41B45; Sat, 9 Jan 2016 16:33:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GXt8d041591; Sat, 9 Jan 2016 16:33:55 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GXtZp041590; Sat, 9 Jan 2016 16:33:55 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091633.u09GXtZp041590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293543 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:33:56 -0000 Author: dchagin Date: Sat Jan 9 16:33:55 2016 New Revision: 293543 URL: https://svnweb.freebsd.org/changeset/base/293543 Log: MFC r283439: Implement F_DUPFD_CLOEXEC fcntl flag. Modified: stable/10/sys/compat/linux/linux_file.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_file.c ============================================================================== --- stable/10/sys/compat/linux/linux_file.c Sat Jan 9 16:32:35 2016 (r293542) +++ stable/10/sys/compat/linux/linux_file.c Sat Jan 9 16:33:55 2016 (r293543) @@ -1384,6 +1384,9 @@ fcntl_common(struct thread *td, struct l fdrop(fp, td); return (kern_fcntl(td, args->fd, F_SETOWN, args->arg)); + + case LINUX_F_DUPFD_CLOEXEC: + return (kern_fcntl(td, args->fd, F_DUPFD_CLOEXEC, args->arg)); } return (EINVAL); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:39:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6C41A676EB; Sat, 9 Jan 2016 16:39:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8486B1EDD; Sat, 9 Jan 2016 16:39:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GdFIG041888; Sat, 9 Jan 2016 16:39:15 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GdFgX041885; Sat, 9 Jan 2016 16:39:15 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091639.u09GdFgX041885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293545 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:39:16 -0000 Author: dchagin Date: Sat Jan 9 16:39:15 2016 New Revision: 293545 URL: https://svnweb.freebsd.org/changeset/base/293545 Log: MFC r283440: For future use in the Linuxulator: 1. Add a kern_kqueue() counterpart for kqueue() with flags parameter. 2. Be a bit secure. To avoid a double fp lookup add a kern_kevent_fp() counterpart for kern_kevent() with file pointer parameter instead of file descriptor an pass the buck to it. Suggested by: mjg [2] Modified: stable/10/sys/kern/kern_event.c stable/10/sys/sys/syscallsubr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_event.c ============================================================================== --- stable/10/sys/kern/kern_event.c Sat Jan 9 16:34:37 2016 (r293544) +++ stable/10/sys/kern/kern_event.c Sat Jan 9 16:39:15 2016 (r293545) @@ -731,13 +731,20 @@ filt_usertouch(struct knote *kn, struct int sys_kqueue(struct thread *td, struct kqueue_args *uap) { + + return (kern_kqueue(td, 0)); +} + +int +kern_kqueue(struct thread *td, int flags) +{ struct filedesc *fdp; struct kqueue *kq; struct file *fp; int fd, error; fdp = td->td_proc->p_fd; - error = falloc(td, &fp, &fd, 0); + error = falloc(td, &fp, &fd, flags); if (error) goto done2; @@ -863,12 +870,9 @@ int kern_kevent(struct thread *td, int fd, int nchanges, int nevents, struct kevent_copyops *k_ops, const struct timespec *timeout) { - struct kevent keva[KQ_NEVENTS]; - struct kevent *kevp, *changes; - struct kqueue *kq; - struct file *fp; cap_rights_t rights; - int i, n, nerrors, error; + struct file *fp; + int error; cap_rights_init(&rights); if (nchanges > 0) @@ -879,9 +883,24 @@ kern_kevent(struct thread *td, int fd, i if (error != 0) return (error); + error = kern_kevent_fp(td, fp, nchanges, nevents, k_ops, timeout); + fdrop(fp, td); + + return (error); +} + +int +kern_kevent_fp(struct thread *td, struct file *fp, int nchanges, int nevents, + struct kevent_copyops *k_ops, const struct timespec *timeout) +{ + struct kevent keva[KQ_NEVENTS]; + struct kevent *kevp, *changes; + struct kqueue *kq; + int i, n, nerrors, error; + error = kqueue_acquire(fp, &kq); if (error != 0) - goto done_norel; + return (error); nerrors = 0; @@ -921,8 +940,6 @@ kern_kevent(struct thread *td, int fd, i error = kqueue_scan(kq, nevents, k_ops, timeout, keva, td); done: kqueue_release(kq, 0); -done_norel: - fdrop(fp, td); return (error); } Modified: stable/10/sys/sys/syscallsubr.h ============================================================================== --- stable/10/sys/sys/syscallsubr.h Sat Jan 9 16:34:37 2016 (r293544) +++ stable/10/sys/sys/syscallsubr.h Sat Jan 9 16:39:15 2016 (r293545) @@ -128,6 +128,10 @@ int kern_jail_get(struct thread *td, str int kern_jail_set(struct thread *td, struct uio *options, int flags); int kern_kevent(struct thread *td, int fd, int nchanges, int nevents, struct kevent_copyops *k_ops, const struct timespec *timeout); +int kern_kevent_fp(struct thread *td, struct file *fp, int nchanges, + int nevents, struct kevent_copyops *k_ops, + const struct timespec *timeout); +int kern_kqueue(struct thread *td, int flags); int kern_kldload(struct thread *td, const char *file, int *fileid); int kern_kldstat(struct thread *td, int fileid, struct kld_file_stat *stat); int kern_kldunload(struct thread *td, int fileid, int flags); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:44:20 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 237FEA67942; Sat, 9 Jan 2016 16:44:20 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B66A512EC; Sat, 9 Jan 2016 16:44:19 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GiIxE044573; Sat, 9 Jan 2016 16:44:18 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GiHk7044556; Sat, 9 Jan 2016 16:44:17 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091644.u09GiHk7044556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293546 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux conf i386/linux modules/linux modules/linux64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:44:20 -0000 Author: dchagin Date: Sat Jan 9 16:44:17 2016 New Revision: 293546 URL: https://svnweb.freebsd.org/changeset/base/293546 Log: MFC r283441: Implement epoll family system calls. This is a tiny wrapper around kqueue() to implement epoll subset of functionality. The kqueue user data are 32bit on i386 which is not enough for epoll user data, so we keep user data in the proc emuldata. Initial patch developed by rdivacky@ in 2007, then extended by Yuri Victorovich @ r255672 and finished by me in collaboration with mjg@ and jillies@. Added: stable/10/sys/compat/linux/linux_event.c - copied unchanged from r283441, head/sys/compat/linux/linux_event.c stable/10/sys/compat/linux/linux_event.h - copied unchanged from r283441, head/sys/compat/linux/linux_event.h Modified: stable/10/sys/amd64/linux/linux_dummy.c stable/10/sys/amd64/linux/syscalls.master stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_emul.c stable/10/sys/compat/linux/linux_emul.h stable/10/sys/compat/linux/linux_util.c stable/10/sys/compat/linux/linux_util.h stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/conf/files.pc98 stable/10/sys/i386/linux/linux_dummy.c stable/10/sys/i386/linux/syscalls.master stable/10/sys/modules/linux/Makefile stable/10/sys/modules/linux64/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 16:44:17 2016 (r293546) @@ -69,13 +69,10 @@ DUMMY(tuxcall); DUMMY(security); DUMMY(set_thread_area); DUMMY(lookup_dcookie); -DUMMY(epoll_create); DUMMY(epoll_ctl_old); DUMMY(epoll_wait_old); DUMMY(remap_file_pages); DUMMY(semtimedop); -DUMMY(epoll_ctl); -DUMMY(epoll_wait); DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); @@ -112,7 +109,6 @@ DUMMY(timerfd_settime); DUMMY(timerfd_gettime); DUMMY(signalfd4); DUMMY(eventfd2); -DUMMY(epoll_create1); DUMMY(inotify_init1); DUMMY(preadv); DUMMY(pwritev); Modified: stable/10/sys/amd64/linux/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 16:44:17 2016 (r293546) @@ -373,7 +373,7 @@ 210 AUE_NULL UNIMPL linux_io_cancel 211 AUE_NULL UNIMPL linux_get_thread_area 212 AUE_NULL STD { int linux_lookup_dcookie(void); } -213 AUE_NULL STD { int linux_epoll_create(void); } +213 AUE_NULL STD { int linux_epoll_create(l_int size); } 214 AUE_NULL STD { int linux_epoll_ctl_old(void); } 215 AUE_NULL STD { int linux_epoll_wait_old(void); } 216 AUE_NULL STD { int linux_remap_file_pages(void); } @@ -397,8 +397,10 @@ 230 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, int flags, \ struct l_timespec *rqtp, struct l_timespec *rmtp); } 231 AUE_EXIT STD { int linux_exit_group(int error_code); } -232 AUE_NULL STD { int linux_epoll_wait(void); } -233 AUE_NULL STD { int linux_epoll_ctl(void); } +232 AUE_NULL STD { int linux_epoll_wait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout); } +233 AUE_NULL STD { int linux_epoll_ctl(l_int epfd, l_int op, l_int fd, \ + struct epoll_event *event); } 234 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } 235 AUE_UTIMES STD { int linux_utimes(char *fname, \ struct l_timeval *tptr); } @@ -466,7 +468,8 @@ 278 AUE_NULL STD { int linux_vmsplice(void); } 279 AUE_NULL STD { int linux_move_pages(void); } 280 AUE_NULL STD { int linux_utimensat(void); } -281 AUE_NULL STD { int linux_epoll_pwait(void); } +281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout, l_sigset_t *mask); } 282 AUE_NULL STD { int linux_signalfd(void); } 283 AUE_NULL STD { int linux_timerfd(void); } 284 AUE_NULL STD { int linux_eventfd(void); } @@ -477,7 +480,7 @@ l_uintptr_t namelen, int flags); } 289 AUE_NULL STD { int linux_signalfd4(void); } 290 AUE_NULL STD { int linux_eventfd2(void); } -291 AUE_NULL STD { int linux_epoll_create1(void); } +291 AUE_NULL STD { int linux_epoll_create1(l_int flags); } 292 AUE_NULL STD { int linux_dup3(l_int oldfd, \ l_int newfd, l_int flags); } 293 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 16:44:17 2016 (r293546) @@ -69,9 +69,6 @@ DUMMY(pivot_root); DUMMY(mincore); DUMMY(ptrace); DUMMY(lookup_dcookie); -DUMMY(epoll_create); -DUMMY(epoll_ctl); -DUMMY(epoll_wait); DUMMY(remap_file_pages); DUMMY(fstatfs64); DUMMY(mbind); @@ -121,7 +118,6 @@ DUMMY(timerfd_gettime); /* linux 2.6.27: */ DUMMY(signalfd4); DUMMY(eventfd2); -DUMMY(epoll_create1); DUMMY(inotify_init1); /* linux 2.6.30: */ DUMMY(preadv); Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 16:44:17 2016 (r293546) @@ -430,9 +430,11 @@ 251 AUE_NULL UNIMPL 252 AUE_EXIT STD { int linux_exit_group(int error_code); } 253 AUE_NULL STD { int linux_lookup_dcookie(void); } -254 AUE_NULL STD { int linux_epoll_create(void); } -255 AUE_NULL STD { int linux_epoll_ctl(void); } -256 AUE_NULL STD { int linux_epoll_wait(void); } +254 AUE_NULL STD { int linux_epoll_create(l_int size); } +255 AUE_NULL STD { int linux_epoll_ctl(l_int epfd, l_int op, l_int fd, \ + struct epoll_event *event); } +256 AUE_NULL STD { int linux_epoll_wait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout); } 257 AUE_NULL STD { int linux_remap_file_pages(void); } 258 AUE_NULL STD { int linux_set_tid_address(int *tidptr); } 259 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \ @@ -527,7 +529,8 @@ 317 AUE_NULL STD { int linux_move_pages(void); } ; linux 2.6.19: 318 AUE_NULL STD { int linux_getcpu(void); } -319 AUE_NULL STD { int linux_epoll_pwait(void); } +319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout, l_osigset_t *mask); } ; linux 2.6.22: 320 AUE_NULL STD { int linux_utimensat(void); } 321 AUE_NULL STD { int linux_signalfd(void); } @@ -541,7 +544,7 @@ ; linux 2.6.27: 327 AUE_NULL STD { int linux_signalfd4(void); } 328 AUE_NULL STD { int linux_eventfd2(void); } -329 AUE_NULL STD { int linux_epoll_create1(void); } +329 AUE_NULL STD { int linux_epoll_create1(l_int flags); } 330 AUE_NULL STD { int linux_dup3(l_int oldfd, \ l_int newfd, l_int flags); } 331 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } Modified: stable/10/sys/compat/linux/linux_emul.c ============================================================================== --- stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 16:44:17 2016 (r293546) @@ -42,8 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include @@ -86,6 +84,7 @@ linux_proc_init(struct thread *td, struc { struct linux_emuldata *em; struct linux_pemuldata *pem; + struct epoll_emuldata *emd; if (newtd != NULL) { /* non-exec call */ @@ -93,8 +92,13 @@ linux_proc_init(struct thread *td, struc em->pdeath_signal = 0; em->robust_futexes = NULL; if (flags & LINUX_CLONE_THREAD) { + LINUX_CTR1(proc_init, "thread newtd(%d)", + newtd->td_tid); + em->em_tid = newtd->td_tid; } else { + LINUX_CTR1(proc_init, "fork newtd(%d)", + newtd->td_proc->p_pid); em->em_tid = newtd->td_proc->p_pid; @@ -105,12 +109,24 @@ linux_proc_init(struct thread *td, struc newtd->td_emuldata = em; } else { /* exec */ + LINUX_CTR1(proc_init, "exec newtd(%d)", + td->td_proc->p_pid); /* lookup the old one */ em = em_find(td); KASSERT(em != NULL, ("proc_init: emuldata not found in exec case.\n")); em->em_tid = td->td_proc->p_pid; + + /* epoll should be destroyed in a case of exec. */ + pem = pem_find(td->td_proc); + KASSERT(pem != NULL, ("proc_exit: proc emuldata not found.\n")); + + if (pem->epoll != NULL) { + emd = pem->epoll; + pem->epoll = NULL; + free(emd, M_EPOLL); + } } em->child_clear_tid = NULL; @@ -121,6 +137,7 @@ void linux_proc_exit(void *arg __unused, struct proc *p) { struct linux_pemuldata *pem; + struct epoll_emuldata *emd; struct thread *td = curthread; if (__predict_false(SV_CURPROC_ABI() != SV_ABI_LINUX)) @@ -133,6 +150,12 @@ linux_proc_exit(void *arg __unused, stru p->p_emuldata = NULL; + if (pem->epoll != NULL) { + emd = pem->epoll; + pem->epoll = NULL; + free(emd, M_EPOLL); + } + sx_destroy(&pem->pem_sx); free(pem, M_LINUX); } @@ -141,6 +164,7 @@ int linux_common_execve(struct thread *td, struct image_args *eargs) { struct linux_pemuldata *pem; + struct epoll_emuldata *emd; struct linux_emuldata *em; struct proc *p; int error; @@ -180,6 +204,12 @@ linux_common_execve(struct thread *td, s p->p_emuldata = NULL; PROC_UNLOCK(p); + if (pem->epoll != NULL) { + emd = pem->epoll; + pem->epoll = NULL; + free(emd, M_EPOLL); + } + free(em, M_TEMP); free(pem, M_LINUX); } @@ -197,6 +227,7 @@ linux_proc_exec(void *arg __unused, stru */ if (__predict_false((imgp->sysent->sv_flags & SV_ABI_MASK) == SV_ABI_LINUX)) { + if (SV_PROC_ABI(p) == SV_ABI_LINUX) linux_proc_init(td, NULL, 0); else Modified: stable/10/sys/compat/linux/linux_emul.h ============================================================================== --- stable/10/sys/compat/linux/linux_emul.h Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/compat/linux/linux_emul.h Sat Jan 9 16:44:17 2016 (r293546) @@ -60,9 +60,12 @@ int linux_common_execve(struct thread *, /* process emuldata flags */ #define LINUX_XDEPR_REQUEUEOP 0x00000001 /* uses deprecated futex REQUEUE op*/ +#define LINUX_XUNSUP_EPOLL 0x00000002 /* unsupported epoll events */ + struct linux_pemuldata { uint32_t flags; /* process emuldata flags */ struct sx pem_sx; /* lock for this struct */ + void *epoll; /* epoll data */ }; #define LINUX_PEM_XLOCK(p) sx_xlock(&(p)->pem_sx) Copied: stable/10/sys/compat/linux/linux_event.c (from r283441, head/sys/compat/linux/linux_event.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/compat/linux/linux_event.c Sat Jan 9 16:44:17 2016 (r293546, copy of r283441, head/sys/compat/linux/linux_event.c) @@ -0,0 +1,500 @@ +/*- + * Copyright (c) 2007 Roman Divacky + * Copyright (c) 2014 Dmitry Chagin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_compat.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef COMPAT_LINUX32 +#include +#include +#else +#include +#include +#endif + +#include +#include +#include +#include + +/* + * epoll defines 'struct epoll_event' with the field 'data' as 64 bits + * on all architectures. But on 32 bit architectures BSD 'struct kevent' only + * has 32 bit opaque pointer as 'udata' field. So we can't pass epoll supplied + * data verbatuim. Therefore we allocate 64-bit memory block to pass + * user supplied data for every file descriptor. + */ + +typedef uint64_t epoll_udata_t; + +struct epoll_emuldata { + uint32_t fdc; /* epoll udata max index */ + epoll_udata_t udata[1]; /* epoll user data vector */ +}; + +#define EPOLL_DEF_SZ 16 +#define EPOLL_SIZE(fdn) \ + (sizeof(struct epoll_emuldata)+(fdn) * sizeof(epoll_udata_t)) + +struct epoll_event { + uint32_t events; + epoll_udata_t data; +} +#if defined(__amd64__) +__attribute__((packed)) +#endif +; + +#define LINUX_MAX_EVENTS (INT_MAX / sizeof(struct epoll_event)) + +static void epoll_fd_install(struct thread *td, int fd, epoll_udata_t udata); +static int epoll_to_kevent(struct thread *td, struct file *epfp, + int fd, struct epoll_event *l_event, int *kev_flags, + struct kevent *kevent, int *nkevents); +static void kevent_to_epoll(struct kevent *kevent, struct epoll_event *l_event); +static int epoll_kev_copyout(void *arg, struct kevent *kevp, int count); +static int epoll_kev_copyin(void *arg, struct kevent *kevp, int count); +static int epoll_delete_event(struct thread *td, struct file *epfp, + int fd, int filter); +static int epoll_delete_all_events(struct thread *td, struct file *epfp, + int fd); + +struct epoll_copyin_args { + struct kevent *changelist; +}; + +struct epoll_copyout_args { + struct epoll_event *leventlist; + struct proc *p; + uint32_t count; + int error; +}; + + +static void +epoll_fd_install(struct thread *td, int fd, epoll_udata_t udata) +{ + struct linux_pemuldata *pem; + struct epoll_emuldata *emd; + struct proc *p; + + p = td->td_proc; + + pem = pem_find(p); + KASSERT(pem != NULL, ("epoll proc emuldata not found.\n")); + + LINUX_PEM_XLOCK(pem); + if (pem->epoll == NULL) { + emd = malloc(EPOLL_SIZE(fd), M_EPOLL, M_WAITOK); + emd->fdc = fd; + pem->epoll = emd; + } else { + emd = pem->epoll; + if (fd > emd->fdc) { + emd = realloc(emd, EPOLL_SIZE(fd), M_EPOLL, M_WAITOK); + emd->fdc = fd; + pem->epoll = emd; + } + } + emd->udata[fd] = udata; + LINUX_PEM_XUNLOCK(pem); +} + +static int +epoll_create_common(struct thread *td, int flags) +{ + int error; + + error = kern_kqueue(td, flags); + if (error) + return (error); + + epoll_fd_install(td, EPOLL_DEF_SZ, 0); + + return (0); +} + +int +linux_epoll_create(struct thread *td, struct linux_epoll_create_args *args) +{ + + /* + * args->size is unused. Linux just tests it + * and then forgets it as well. + */ + if (args->size <= 0) + return (EINVAL); + + return (epoll_create_common(td, 0)); +} + +int +linux_epoll_create1(struct thread *td, struct linux_epoll_create1_args *args) +{ + int flags; + + if ((args->flags & ~(LINUX_O_CLOEXEC)) != 0) + return (EINVAL); + + flags = 0; + if ((args->flags & LINUX_O_CLOEXEC) != 0) + flags |= O_CLOEXEC; + + return (epoll_create_common(td, flags)); +} + +/* Structure converting function from epoll to kevent. */ +static int +epoll_to_kevent(struct thread *td, struct file *epfp, + int fd, struct epoll_event *l_event, int *kev_flags, + struct kevent *kevent, int *nkevents) +{ + uint32_t levents = l_event->events; + struct linux_pemuldata *pem; + struct proc *p; + + /* flags related to how event is registered */ + if ((levents & LINUX_EPOLLONESHOT) != 0) + *kev_flags |= EV_ONESHOT; + if ((levents & LINUX_EPOLLET) != 0) + *kev_flags |= EV_CLEAR; + + /* flags related to what event is registered */ + if ((levents & LINUX_EPOLL_EVRD) != 0) { + EV_SET(kevent++, fd, EVFILT_READ, *kev_flags, 0, 0, 0); + ++(*nkevents); + } + if ((levents & LINUX_EPOLL_EVWR) != 0) { + EV_SET(kevent++, fd, EVFILT_WRITE, *kev_flags, 0, 0, 0); + ++(*nkevents); + } + + if ((levents & ~(LINUX_EPOLL_EVSUP)) != 0) { + p = td->td_proc; + + pem = pem_find(p); + KASSERT(pem != NULL, ("epoll proc emuldata not found.\n")); + KASSERT(pem->epoll != NULL, ("epoll proc epolldata not found.\n")); + + LINUX_PEM_XLOCK(pem); + if ((pem->flags & LINUX_XUNSUP_EPOLL) == 0) { + pem->flags |= LINUX_XUNSUP_EPOLL; + LINUX_PEM_XUNLOCK(pem); + linux_msg(td, "epoll_ctl unsupported flags: 0x%x\n", + levents); + } else + LINUX_PEM_XUNLOCK(pem); + return (EINVAL); + } + + return (0); +} + +/* + * Structure converting function from kevent to epoll. In a case + * this is called on error in registration we store the error in + * event->data and pick it up later in linux_epoll_ctl(). + */ +static void +kevent_to_epoll(struct kevent *kevent, struct epoll_event *l_event) +{ + + if ((kevent->flags & EV_ERROR) != 0) + return; + + switch (kevent->filter) { + case EVFILT_READ: + l_event->events = LINUX_EPOLLIN|LINUX_EPOLLRDNORM|LINUX_EPOLLPRI; + break; + case EVFILT_WRITE: + l_event->events = LINUX_EPOLLOUT|LINUX_EPOLLWRNORM; + break; + } +} + +/* + * Copyout callback used by kevent. This converts kevent + * events to epoll events and copies them back to the + * userspace. This is also called on error on registering + * of the filter. + */ +static int +epoll_kev_copyout(void *arg, struct kevent *kevp, int count) +{ + struct epoll_copyout_args *args; + struct linux_pemuldata *pem; + struct epoll_emuldata *emd; + struct epoll_event *eep; + int error, fd, i; + + args = (struct epoll_copyout_args*) arg; + eep = malloc(sizeof(*eep) * count, M_EPOLL, M_WAITOK | M_ZERO); + + pem = pem_find(args->p); + KASSERT(pem != NULL, ("epoll proc emuldata not found.\n")); + LINUX_PEM_SLOCK(pem); + emd = pem->epoll; + KASSERT(emd != NULL, ("epoll proc epolldata not found.\n")); + + for (i = 0; i < count; i++) { + kevent_to_epoll(&kevp[i], &eep[i]); + + fd = kevp[i].ident; + KASSERT(fd <= emd->fdc, ("epoll user data vector" + " is too small.\n")); + eep[i].data = emd->udata[fd]; + } + LINUX_PEM_SUNLOCK(pem); + + error = copyout(eep, args->leventlist, count * sizeof(*eep)); + if (error == 0) { + args->leventlist += count; + args->count += count; + } else if (args->error == 0) + args->error = error; + + free(eep, M_EPOLL); + return (error); +} + +/* + * Copyin callback used by kevent. This copies already + * converted filters from kernel memory to the kevent + * internal kernel memory. Hence the memcpy instead of + * copyin. + */ +static int +epoll_kev_copyin(void *arg, struct kevent *kevp, int count) +{ + struct epoll_copyin_args *args; + + args = (struct epoll_copyin_args*) arg; + + memcpy(kevp, args->changelist, count * sizeof(*kevp)); + args->changelist += count; + + return (0); +} + +/* + * Load epoll filter, convert it to kevent filter + * and load it into kevent subsystem. + */ +int +linux_epoll_ctl(struct thread *td, struct linux_epoll_ctl_args *args) +{ + struct file *epfp, *fp; + struct epoll_copyin_args ciargs; + struct kevent kev[2]; + struct kevent_copyops k_ops = { &ciargs, + NULL, + epoll_kev_copyin}; + struct epoll_event le; + cap_rights_t rights; + int kev_flags; + int nchanges = 0; + int error; + + if (args->op != LINUX_EPOLL_CTL_DEL) { + error = copyin(args->event, &le, sizeof(le)); + if (error != 0) + return (error); + } + + error = fget(td, args->epfd, + cap_rights_init(&rights, CAP_KQUEUE_CHANGE), &epfp); + if (error != 0) + return (error); + if (epfp->f_type != DTYPE_KQUEUE) + goto leave1; + + /* Protect user data vector from incorrectly supplied fd. */ + error = fget(td, args->fd, cap_rights_init(&rights, CAP_POLL_EVENT), &fp); + if (error != 0) + goto leave1; + + /* Linux disallows spying on himself */ + if (epfp == fp) { + error = EINVAL; + goto leave0; + } + + ciargs.changelist = kev; + + switch (args->op) { + case LINUX_EPOLL_CTL_MOD: + /* + * We don't memorize which events were set for this FD + * on this level, so just delete all we could have set: + * EVFILT_READ and EVFILT_WRITE, ignoring any errors + */ + error = epoll_delete_all_events(td, epfp, args->fd); + if (error) + goto leave0; + /* FALLTHROUGH */ + + case LINUX_EPOLL_CTL_ADD: + kev_flags = EV_ADD | EV_ENABLE; + break; + + case LINUX_EPOLL_CTL_DEL: + /* CTL_DEL means unregister this fd with this epoll */ + error = epoll_delete_all_events(td, epfp, args->fd); + goto leave0; + + default: + error = EINVAL; + goto leave0; + } + + error = epoll_to_kevent(td, epfp, args->fd, &le, &kev_flags, + kev, &nchanges); + if (error) + goto leave0; + + epoll_fd_install(td, args->fd, le.data); + + error = kern_kevent_fp(td, epfp, nchanges, 0, &k_ops, NULL); + +leave0: + fdrop(fp, td); + +leave1: + fdrop(epfp, td); + return (error); +} + +/* + * Wait for a filter to be triggered on the epoll file descriptor. + */ +int +linux_epoll_wait(struct thread *td, struct linux_epoll_wait_args *args) +{ + struct file *epfp; + struct timespec ts, *tsp; + cap_rights_t rights; + struct epoll_copyout_args coargs; + struct kevent_copyops k_ops = { &coargs, + epoll_kev_copyout, + NULL}; + int error; + + if (args->maxevents <= 0 || args->maxevents > LINUX_MAX_EVENTS) + return (EINVAL); + + error = fget(td, args->epfd, + cap_rights_init(&rights, CAP_KQUEUE_EVENT), &epfp); + if (error != 0) + return (error); + + coargs.leventlist = args->events; + coargs.p = td->td_proc; + coargs.count = 0; + coargs.error = 0; + + if (args->timeout != -1) { + if (args->timeout < 0) { + error = EINVAL; + goto leave; + } + /* Convert from milliseconds to timespec. */ + ts.tv_sec = args->timeout / 1000; + ts.tv_nsec = (args->timeout % 1000) * 1000000; + tsp = &ts; + } else { + tsp = NULL; + } + + error = kern_kevent_fp(td, epfp, 0, args->maxevents, &k_ops, tsp); + if (error == 0 && coargs.error != 0) + error = coargs.error; + + /* + * kern_kevent might return ENOMEM which is not expected from epoll_wait. + * Maybe we should translate that but I don't think it matters at all. + */ + if (error == 0) + td->td_retval[0] = coargs.count; +leave: + fdrop(epfp, td); + return (error); +} + +static int +epoll_delete_event(struct thread *td, struct file *epfp, int fd, int filter) +{ + struct epoll_copyin_args ciargs; + struct kevent kev; + struct kevent_copyops k_ops = { &ciargs, + NULL, + epoll_kev_copyin}; + int error; + + ciargs.changelist = &kev; + EV_SET(&kev, fd, filter, EV_DELETE | EV_DISABLE, 0, 0, 0); + + error = kern_kevent_fp(td, epfp, 1, 0, &k_ops, NULL); + + /* + * here we ignore ENONT, because we don't keep track of events here + */ + if (error == ENOENT) + error = 0; + return (error); +} + +static int +epoll_delete_all_events(struct thread *td, struct file *epfp, int fd) +{ + int error1, error2; + + error1 = epoll_delete_event(td, epfp, fd, EVFILT_READ); + error2 = epoll_delete_event(td, epfp, fd, EVFILT_WRITE); + + /* report any errors we got */ + return (error1 == 0 ? error2 : error1); +} Copied: stable/10/sys/compat/linux/linux_event.h (from r283441, head/sys/compat/linux/linux_event.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/compat/linux/linux_event.h Sat Jan 9 16:44:17 2016 (r293546, copy of r283441, head/sys/compat/linux/linux_event.h) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2007 Roman Divacky + * Copyright (c) 2014 Dmitry Chagin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_EVENT_H_ +#define _LINUX_EVENT_H_ + +#define LINUX_EPOLLIN 0x001 +#define LINUX_EPOLLPRI 0x002 +#define LINUX_EPOLLOUT 0x004 +#define LINUX_EPOLLRDNORM 0x040 +#define LINUX_EPOLLRDBAND 0x080 +#define LINUX_EPOLLWRNORM 0x100 +#define LINUX_EPOLLWRBAND 0x200 +#define LINUX_EPOLLMSG 0x400 +#define LINUX_EPOLLERR 0x008 +#define LINUX_EPOLLHUP 0x010 +#define LINUX_EPOLLRDHUP 0x2000 +#define LINUX_EPOLLWAKEUP 1u<<29 +#define LINUX_EPOLLONESHOT 1u<<30 +#define LINUX_EPOLLET 1u<<31 + +#define LINUX_EPOLL_EVRD (LINUX_EPOLLIN|LINUX_EPOLLRDNORM \ + |LINUX_EPOLLHUP|LINUX_EPOLLPRI) +#define LINUX_EPOLL_EVWR (LINUX_EPOLLOUT|LINUX_EPOLLWRNORM) +#define LINUX_EPOLL_EVSUP (LINUX_EPOLLET|LINUX_EPOLLONESHOT \ + |LINUX_EPOLL_EVRD|LINUX_EPOLL_EVWR) + +#define LINUX_EPOLL_CTL_ADD 1 +#define LINUX_EPOLL_CTL_DEL 2 +#define LINUX_EPOLL_CTL_MOD 3 + +#endif /* !_LINUX_EVENT_H_ */ Modified: stable/10/sys/compat/linux/linux_util.c ============================================================================== --- stable/10/sys/compat/linux/linux_util.c Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/compat/linux/linux_util.c Sat Jan 9 16:44:17 2016 (r293546) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include MALLOC_DEFINE(M_LINUX, "linux", "Linux mode structures"); +MALLOC_DEFINE(M_EPOLL, "lepoll", "Linux events structures"); MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes"); MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futex waiting proc"); Modified: stable/10/sys/compat/linux/linux_util.h ============================================================================== --- stable/10/sys/compat/linux/linux_util.h Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/compat/linux/linux_util.h Sat Jan 9 16:44:17 2016 (r293546) @@ -45,6 +45,7 @@ #include MALLOC_DECLARE(M_LINUX); +MALLOC_DECLARE(M_EPOLL); MALLOC_DECLARE(M_FUTEX); MALLOC_DECLARE(M_FUTEX_WP); Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/conf/files.amd64 Sat Jan 9 16:44:17 2016 (r293546) @@ -541,6 +541,7 @@ compat/linux/linux_uid16.c optional comp compat/linux/linux_util.c optional compat_linux32 compat/linux/linux_vdso.c optional compat_linux32 compat/linux/linux_common.c optional compat_linux32 +compat/linux/linux_event.c optional compat_linux32 dev/amr/amr_linux.c optional compat_linux32 amr dev/mfi/mfi_linux.c optional compat_linux32 mfi # Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/conf/files.i386 Sat Jan 9 16:44:17 2016 (r293546) @@ -92,6 +92,7 @@ hptrr_lib.o optional hptrr \ cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S optional zfs compile-with "${ZFS_S}" compat/linprocfs/linprocfs.c optional linprocfs compat/linsysfs/linsysfs.c optional linsysfs +compat/linux/linux_event.c optional compat_linux compat/linux/linux_emul.c optional compat_linux compat/linux/linux_file.c optional compat_linux compat/linux/linux_fork.c optional compat_linux Modified: stable/10/sys/conf/files.pc98 ============================================================================== --- stable/10/sys/conf/files.pc98 Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/conf/files.pc98 Sat Jan 9 16:44:17 2016 (r293546) @@ -41,6 +41,7 @@ ukbdmap.h optional ukbd_dflt_keymap \ cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S optional zfs compile-with "${ZFS_S}" compat/linprocfs/linprocfs.c optional linprocfs compat/linsysfs/linsysfs.c optional linsysfs +compat/linux/linux_event.c optional compat_linux compat/linux/linux_emul.c optional compat_linux compat/linux/linux_file.c optional compat_linux compat/linux/linux_fork.c optional compat_linux Modified: stable/10/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 16:44:17 2016 (r293546) @@ -71,9 +71,6 @@ DUMMY(setfsgid); DUMMY(pivot_root); DUMMY(mincore); DUMMY(lookup_dcookie); -DUMMY(epoll_create); -DUMMY(epoll_ctl); -DUMMY(epoll_wait); DUMMY(remap_file_pages); DUMMY(fstatfs64); DUMMY(mbind); @@ -117,7 +114,6 @@ DUMMY(timerfd_gettime); /* linux 2.6.27: */ DUMMY(signalfd4); DUMMY(eventfd2); -DUMMY(epoll_create1); DUMMY(inotify_init1); /* linux 2.6.30: */ DUMMY(preadv); Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 16:44:17 2016 (r293546) @@ -432,9 +432,11 @@ 251 AUE_NULL UNIMPL 252 AUE_EXIT STD { int linux_exit_group(int error_code); } 253 AUE_NULL STD { int linux_lookup_dcookie(void); } -254 AUE_NULL STD { int linux_epoll_create(void); } -255 AUE_NULL STD { int linux_epoll_ctl(void); } -256 AUE_NULL STD { int linux_epoll_wait(void); } +254 AUE_NULL STD { int linux_epoll_create(l_int size); } +255 AUE_NULL STD { int linux_epoll_ctl(l_int epfd, l_int op, l_int fd, \ + struct epoll_event *event); } +256 AUE_NULL STD { int linux_epoll_wait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout); } 257 AUE_NULL STD { int linux_remap_file_pages(void); } 258 AUE_NULL STD { int linux_set_tid_address(int *tidptr); } 259 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \ @@ -535,7 +537,8 @@ 317 AUE_NULL STD { int linux_move_pages(void); } ; linux 2.6.19: 318 AUE_NULL STD { int linux_getcpu(void); } -319 AUE_NULL STD { int linux_epoll_pwait(void); } +319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout, l_osigset_t *mask); } ; linux 2.6.22: 320 AUE_NULL STD { int linux_utimensat(void); } 321 AUE_NULL STD { int linux_signalfd(void); } @@ -549,7 +552,7 @@ ; linux 2.6.27: 327 AUE_NULL STD { int linux_signalfd4(void); } 328 AUE_NULL STD { int linux_eventfd2(void); } -329 AUE_NULL STD { int linux_epoll_create1(void); } +329 AUE_NULL STD { int linux_epoll_create1(l_int flags); } 330 AUE_NULL STD { int linux_dup3(l_int oldfd, \ l_int newfd, l_int flags); } 331 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } Modified: stable/10/sys/modules/linux/Makefile ============================================================================== --- stable/10/sys/modules/linux/Makefile Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/modules/linux/Makefile Sat Jan 9 16:44:17 2016 (r293546) @@ -10,7 +10,7 @@ CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINU VDSO= linux${SFX}_vdso KMOD= linux -SRCS= linux_fork.c linux${SFX}_dummy.c linux_file.c \ +SRCS= linux_fork.c linux${SFX}_dummy.c linux_file.c linux_event.c \ linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \ linux${SFX}_machdep.c linux_misc.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ Modified: stable/10/sys/modules/linux64/Makefile ============================================================================== --- stable/10/sys/modules/linux64/Makefile Sat Jan 9 16:39:15 2016 (r293545) +++ stable/10/sys/modules/linux64/Makefile Sat Jan 9 16:44:17 2016 (r293546) @@ -5,7 +5,7 @@ VDSO= linux_vdso KMOD= linux64 -SRCS= linux_fork.c linux_dummy.c linux_file.c \ +SRCS= linux_fork.c linux_dummy.c linux_file.c linux_event.c \ linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \ linux_machdep.c linux_misc.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux_sysent.c \ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:45:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DD26A679D1; Sat, 9 Jan 2016 16:45:57 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE7F81484; Sat, 9 Jan 2016 16:45:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GjuhO044683; Sat, 9 Jan 2016 16:45:56 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GjsEP044667; Sat, 9 Jan 2016 16:45:54 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091645.u09GjsEP044667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293547 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:45:57 -0000 Author: dchagin Date: Sat Jan 9 16:45:54 2016 New Revision: 293547 URL: https://svnweb.freebsd.org/changeset/base/293547 Log: Regen for r293546. Modified: stable/10/sys/amd64/linux/linux_proto.h stable/10/sys/amd64/linux/linux_syscall.h stable/10/sys/amd64/linux/linux_syscalls.c stable/10/sys/amd64/linux/linux_sysent.c stable/10/sys/amd64/linux/linux_systrace_args.c stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 16:45:54 2016 (r293547) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -713,7 +713,7 @@ struct linux_lookup_dcookie_args { register_t dummy; }; struct linux_epoll_create_args { - register_t dummy; + char size_l_[PADL_(l_int)]; l_int size; char size_r_[PADR_(l_int)]; }; struct linux_epoll_ctl_old_args { register_t dummy; @@ -784,10 +784,16 @@ struct linux_exit_group_args { char error_code_l_[PADL_(int)]; int error_code; char error_code_r_[PADR_(int)]; }; struct linux_epoll_wait_args { - register_t dummy; + char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; + char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)]; + char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)]; + char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)]; }; struct linux_epoll_ctl_args { - register_t dummy; + char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; + char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char event_l_[PADL_(struct epoll_event *)]; struct epoll_event * event; char event_r_[PADR_(struct epoll_event *)]; }; struct linux_tgkill_args { char tgid_l_[PADL_(int)]; int tgid; char tgid_r_[PADR_(int)]; @@ -978,7 +984,11 @@ struct linux_utimensat_args { register_t dummy; }; struct linux_epoll_pwait_args { - register_t dummy; + char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; + char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)]; + char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)]; + char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)]; + char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; }; struct linux_signalfd_args { register_t dummy; @@ -1011,7 +1021,7 @@ struct linux_eventfd2_args { register_t dummy; }; struct linux_epoll_create1_args { - register_t dummy; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_dup3_args { char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)]; Modified: stable/10/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 16:45:54 2016 (r293547) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin */ #define LINUX_SYS_read 0 Modified: stable/10/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 16:45:54 2016 (r293547) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 16:45:54 2016 (r293547) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin */ #include @@ -231,7 +231,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 210 = linux_io_cancel */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 211 = linux_get_thread_area */ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 212 = linux_lookup_dcookie */ - { 0, (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 213 = linux_epoll_create */ + { AS(linux_epoll_create_args), (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 213 = linux_epoll_create */ { 0, (sy_call_t *)linux_epoll_ctl_old, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 214 = linux_epoll_ctl_old */ { 0, (sy_call_t *)linux_epoll_wait_old, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 215 = linux_epoll_wait_old */ { 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 216 = linux_remap_file_pages */ @@ -250,8 +250,8 @@ struct sysent linux_sysent[] = { { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 229 = linux_clock_getres */ { AS(linux_clock_nanosleep_args), (sy_call_t *)linux_clock_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 230 = linux_clock_nanosleep */ { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 231 = linux_exit_group */ - { 0, (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 232 = linux_epoll_wait */ - { 0, (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 233 = linux_epoll_ctl */ + { AS(linux_epoll_wait_args), (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 232 = linux_epoll_wait */ + { AS(linux_epoll_ctl_args), (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 233 = linux_epoll_ctl */ { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 234 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 235 = linux_utimes */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 236 = vserver */ @@ -299,7 +299,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 278 = linux_vmsplice */ { 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 279 = linux_move_pages */ { 0, (sy_call_t *)linux_utimensat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 280 = linux_utimensat */ - { 0, (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 281 = linux_epoll_pwait */ + { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 281 = linux_epoll_pwait */ { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 282 = linux_signalfd */ { 0, (sy_call_t *)linux_timerfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_timerfd */ { 0, (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_eventfd */ @@ -309,7 +309,7 @@ struct sysent linux_sysent[] = { { AS(linux_accept4_args), (sy_call_t *)linux_accept4, AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 288 = linux_accept4 */ { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 289 = linux_signalfd4 */ { 0, (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 290 = linux_eventfd2 */ - { 0, (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 291 = linux_epoll_create1 */ + { AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 291 = linux_epoll_create1 */ { AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 292 = linux_dup3 */ { AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 293 = linux_pipe2 */ { 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 294 = linux_inotify_init1 */ Modified: stable/10/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 16:45:54 2016 (r293547) @@ -1578,7 +1578,9 @@ systrace_args(int sysnum, void *params, } /* linux_epoll_create */ case 213: { - *n_args = 0; + struct linux_epoll_create_args *p = params; + iarg[0] = p->size; /* l_int */ + *n_args = 1; break; } /* linux_epoll_ctl_old */ @@ -1711,12 +1713,22 @@ systrace_args(int sysnum, void *params, } /* linux_epoll_wait */ case 232: { - *n_args = 0; + struct linux_epoll_wait_args *p = params; + iarg[0] = p->epfd; /* l_int */ + uarg[1] = (intptr_t) p->events; /* struct epoll_event * */ + iarg[2] = p->maxevents; /* l_int */ + iarg[3] = p->timeout; /* l_int */ + *n_args = 4; break; } /* linux_epoll_ctl */ case 233: { - *n_args = 0; + struct linux_epoll_ctl_args *p = params; + iarg[0] = p->epfd; /* l_int */ + iarg[1] = p->op; /* l_int */ + iarg[2] = p->fd; /* l_int */ + uarg[3] = (intptr_t) p->event; /* struct epoll_event * */ + *n_args = 4; break; } /* linux_tgkill */ @@ -2039,7 +2051,13 @@ systrace_args(int sysnum, void *params, } /* linux_epoll_pwait */ case 281: { - *n_args = 0; + struct linux_epoll_pwait_args *p = params; + iarg[0] = p->epfd; /* l_int */ + uarg[1] = (intptr_t) p->events; /* struct epoll_event * */ + iarg[2] = p->maxevents; /* l_int */ + iarg[3] = p->timeout; /* l_int */ + uarg[4] = (intptr_t) p->mask; /* l_sigset_t * */ + *n_args = 5; break; } /* linux_signalfd */ @@ -2094,7 +2112,9 @@ systrace_args(int sysnum, void *params, } /* linux_epoll_create1 */ case 291: { - *n_args = 0; + struct linux_epoll_create1_args *p = params; + iarg[0] = p->flags; /* l_int */ + *n_args = 1; break; } /* linux_dup3 */ @@ -4641,6 +4661,13 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_epoll_create */ case 213: + switch(ndx) { + case 0: + p = "l_int"; + break; + default: + break; + }; break; /* linux_epoll_ctl_old */ case 214: @@ -4837,9 +4864,41 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_epoll_wait */ case 232: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct epoll_event *"; + break; + case 2: + p = "l_int"; + break; + case 3: + p = "l_int"; + break; + default: + break; + }; break; /* linux_epoll_ctl */ case 233: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "l_int"; + break; + case 3: + p = "struct epoll_event *"; + break; + default: + break; + }; break; /* linux_tgkill */ case 234: @@ -5264,6 +5323,25 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_epoll_pwait */ case 281: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct epoll_event *"; + break; + case 2: + p = "l_int"; + break; + case 3: + p = "l_int"; + break; + case 4: + p = "l_sigset_t *"; + break; + default: + break; + }; break; /* linux_signalfd */ case 282: @@ -5310,6 +5388,13 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_epoll_create1 */ case 291: + switch(ndx) { + case 0: + p = "l_int"; + break; + default: + break; + }; break; /* linux_dup3 */ case 292: @@ -6307,6 +6392,9 @@ systrace_return_setargdesc(int sysnum, i case 212: /* linux_epoll_create */ case 213: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_epoll_ctl_old */ case 214: /* linux_epoll_wait_old */ @@ -6382,8 +6470,14 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_epoll_wait */ case 232: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_epoll_ctl */ case 233: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_tgkill */ case 234: if (ndx == 0 || ndx == 1) @@ -6535,6 +6629,9 @@ systrace_return_setargdesc(int sysnum, i case 280: /* linux_epoll_pwait */ case 281: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_signalfd */ case 282: /* linux_timerfd */ @@ -6558,6 +6655,9 @@ systrace_return_setargdesc(int sysnum, i case 290: /* linux_epoll_create1 */ case 291: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_dup3 */ case 292: if (ndx == 0 || ndx == 1) Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 16:45:54 2016 (r293547) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293533 2016-01-09 16:21:39Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293546 2016-01-09 16:44:17Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -779,13 +779,19 @@ struct linux_lookup_dcookie_args { register_t dummy; }; struct linux_epoll_create_args { - register_t dummy; + char size_l_[PADL_(l_int)]; l_int size; char size_r_[PADR_(l_int)]; }; struct linux_epoll_ctl_args { - register_t dummy; + char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; + char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char event_l_[PADL_(struct epoll_event *)]; struct epoll_event * event; char event_r_[PADR_(struct epoll_event *)]; }; struct linux_epoll_wait_args { - register_t dummy; + char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; + char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)]; + char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)]; + char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)]; }; struct linux_remap_file_pages_args { register_t dummy; @@ -1035,7 +1041,11 @@ struct linux_getcpu_args { register_t dummy; }; struct linux_epoll_pwait_args { - register_t dummy; + char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; + char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)]; + char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)]; + char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)]; + char mask_l_[PADL_(l_osigset_t *)]; l_osigset_t * mask; char mask_r_[PADR_(l_osigset_t *)]; }; struct linux_utimensat_args { register_t dummy; @@ -1065,7 +1075,7 @@ struct linux_eventfd2_args { register_t dummy; }; struct linux_epoll_create1_args { - register_t dummy; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_dup3_args { char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)]; Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 16:45:54 2016 (r293547) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293533 2016-01-09 16:21:39Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293546 2016-01-09 16:44:17Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 16:45:54 2016 (r293547) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293533 2016-01-09 16:21:39Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293546 2016-01-09 16:44:17Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 16:45:54 2016 (r293547) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293533 2016-01-09 16:21:39Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293546 2016-01-09 16:44:17Z dchagin */ #include "opt_compat.h" @@ -273,9 +273,9 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 251 = */ { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 252 = linux_exit_group */ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 253 = linux_lookup_dcookie */ - { 0, (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = linux_epoll_create */ - { 0, (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 255 = linux_epoll_ctl */ - { 0, (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 256 = linux_epoll_wait */ + { AS(linux_epoll_create_args), (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = linux_epoll_create */ + { AS(linux_epoll_ctl_args), (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 255 = linux_epoll_ctl */ + { AS(linux_epoll_wait_args), (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 256 = linux_epoll_wait */ { 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 257 = linux_remap_file_pages */ { AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 258 = linux_set_tid_address */ { AS(linux_timer_create_args), (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 259 = linux_timer_create */ @@ -338,7 +338,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 316 = linux_vmsplice */ { 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_move_pages */ { 0, (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getcpu */ - { 0, (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */ + { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */ { 0, (sy_call_t *)linux_utimensat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */ { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */ { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ @@ -348,7 +348,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */ { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */ { 0, (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */ - { 0, (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */ + { AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */ { AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */ { AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pipe2 */ { 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = linux_inotify_init1 */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 16:45:54 2016 (r293547) @@ -1697,17 +1697,29 @@ systrace_args(int sysnum, void *params, } /* linux_epoll_create */ case 254: { - *n_args = 0; + struct linux_epoll_create_args *p = params; + iarg[0] = p->size; /* l_int */ + *n_args = 1; break; } /* linux_epoll_ctl */ case 255: { - *n_args = 0; + struct linux_epoll_ctl_args *p = params; + iarg[0] = p->epfd; /* l_int */ + iarg[1] = p->op; /* l_int */ + iarg[2] = p->fd; /* l_int */ + uarg[3] = (intptr_t) p->event; /* struct epoll_event * */ + *n_args = 4; break; } /* linux_epoll_wait */ case 256: { - *n_args = 0; + struct linux_epoll_wait_args *p = params; + iarg[0] = p->epfd; /* l_int */ + uarg[1] = (intptr_t) p->events; /* struct epoll_event * */ + iarg[2] = p->maxevents; /* l_int */ + iarg[3] = p->timeout; /* l_int */ + *n_args = 4; break; } /* linux_remap_file_pages */ @@ -2141,7 +2153,13 @@ systrace_args(int sysnum, void *params, } /* linux_epoll_pwait */ case 319: { - *n_args = 0; + struct linux_epoll_pwait_args *p = params; + iarg[0] = p->epfd; /* l_int */ + uarg[1] = (intptr_t) p->events; /* struct epoll_event * */ + iarg[2] = p->maxevents; /* l_int */ + iarg[3] = p->timeout; /* l_int */ + uarg[4] = (intptr_t) p->mask; /* l_osigset_t * */ + *n_args = 5; break; } /* linux_utimensat */ @@ -2191,7 +2209,9 @@ systrace_args(int sysnum, void *params, } /* linux_epoll_create1 */ case 329: { - *n_args = 0; + struct linux_epoll_create1_args *p = params; + iarg[0] = p->flags; /* l_int */ + *n_args = 1; break; } /* linux_dup3 */ @@ -4861,12 +4881,51 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_epoll_create */ case 254: + switch(ndx) { + case 0: + p = "l_int"; + break; + default: + break; + }; break; /* linux_epoll_ctl */ case 255: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "l_int"; + break; + case 3: + p = "struct epoll_event *"; + break; + default: + break; + }; break; /* linux_epoll_wait */ case 256: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct epoll_event *"; + break; + case 2: + p = "l_int"; + break; + case 3: + p = "l_int"; + break; + default: + break; + }; break; /* linux_remap_file_pages */ case 257: @@ -5468,6 +5527,25 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_epoll_pwait */ case 319: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct epoll_event *"; + break; + case 2: + p = "l_int"; + break; + case 3: + p = "l_int"; + break; + case 4: + p = "l_osigset_t *"; + break; + default: + break; + }; break; /* linux_utimensat */ case 320: @@ -5498,6 +5576,13 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_epoll_create1 */ case 329: + switch(ndx) { + case 0: + p = "l_int"; + break; + default: + break; + }; break; /* linux_dup3 */ case 330: @@ -6577,10 +6662,19 @@ systrace_return_setargdesc(int sysnum, i case 253: /* linux_epoll_create */ case 254: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_epoll_ctl */ case 255: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_epoll_wait */ case 256: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_remap_file_pages */ case 257: /* linux_set_tid_address */ @@ -6796,6 +6890,9 @@ systrace_return_setargdesc(int sysnum, i case 318: /* linux_epoll_pwait */ case 319: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_utimensat */ case 320: /* linux_signalfd */ @@ -6816,6 +6913,9 @@ systrace_return_setargdesc(int sysnum, i case 328: /* linux_epoll_create1 */ case 329: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_dup3 */ case 330: if (ndx == 0 || ndx == 1) Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 16:45:54 2016 (r293547) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -783,13 +783,19 @@ struct linux_lookup_dcookie_args { register_t dummy; }; struct linux_epoll_create_args { - register_t dummy; + char size_l_[PADL_(l_int)]; l_int size; char size_r_[PADR_(l_int)]; }; struct linux_epoll_ctl_args { - register_t dummy; + char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; + char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char event_l_[PADL_(struct epoll_event *)]; struct epoll_event * event; char event_r_[PADR_(struct epoll_event *)]; }; struct linux_epoll_wait_args { - register_t dummy; + char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; + char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)]; + char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)]; + char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)]; }; struct linux_remap_file_pages_args { register_t dummy; @@ -1053,7 +1059,11 @@ struct linux_getcpu_args { register_t dummy; }; struct linux_epoll_pwait_args { - register_t dummy; + char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; + char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)]; + char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)]; + char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)]; + char mask_l_[PADL_(l_osigset_t *)]; l_osigset_t * mask; char mask_r_[PADR_(l_osigset_t *)]; }; struct linux_utimensat_args { register_t dummy; @@ -1083,7 +1093,7 @@ struct linux_eventfd2_args { register_t dummy; }; struct linux_epoll_create1_args { - register_t dummy; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_dup3_args { char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)]; Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 16:45:54 2016 (r293547) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 16:45:54 2016 (r293547) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 16:45:54 2016 (r293547) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293533 2016-01-09 16:21:39Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin */ #include @@ -272,9 +272,9 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 251 = */ { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 252 = linux_exit_group */ { 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 253 = linux_lookup_dcookie */ - { 0, (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = linux_epoll_create */ - { 0, (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 255 = linux_epoll_ctl */ - { 0, (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 256 = linux_epoll_wait */ + { AS(linux_epoll_create_args), (sy_call_t *)linux_epoll_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = linux_epoll_create */ + { AS(linux_epoll_ctl_args), (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 255 = linux_epoll_ctl */ + { AS(linux_epoll_wait_args), (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 256 = linux_epoll_wait */ { 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 257 = linux_remap_file_pages */ { AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 258 = linux_set_tid_address */ { AS(linux_timer_create_args), (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 259 = linux_timer_create */ @@ -337,7 +337,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 316 = linux_vmsplice */ { 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_move_pages */ { 0, (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getcpu */ - { 0, (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */ + { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */ { 0, (sy_call_t *)linux_utimensat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */ { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */ { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ @@ -347,7 +347,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */ { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */ { 0, (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */ - { 0, (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */ + { AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */ { AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */ { AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pipe2 */ { 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = linux_inotify_init1 */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 16:44:17 2016 (r293546) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 16:45:54 2016 (r293547) @@ -1747,17 +1747,29 @@ systrace_args(int sysnum, void *params, } /* linux_epoll_create */ case 254: { - *n_args = 0; + struct linux_epoll_create_args *p = params; + iarg[0] = p->size; /* l_int */ + *n_args = 1; break; } /* linux_epoll_ctl */ case 255: { - *n_args = 0; + struct linux_epoll_ctl_args *p = params; + iarg[0] = p->epfd; /* l_int */ + iarg[1] = p->op; /* l_int */ + iarg[2] = p->fd; /* l_int */ + uarg[3] = (intptr_t) p->event; /* struct epoll_event * */ + *n_args = 4; break; } /* linux_epoll_wait */ case 256: { - *n_args = 0; + struct linux_epoll_wait_args *p = params; + iarg[0] = p->epfd; /* l_int */ + uarg[1] = (intptr_t) p->events; /* struct epoll_event * */ + iarg[2] = p->maxevents; /* l_int */ + iarg[3] = p->timeout; /* l_int */ + *n_args = 4; break; } /* linux_remap_file_pages */ @@ -2217,7 +2229,13 @@ systrace_args(int sysnum, void *params, } /* linux_epoll_pwait */ case 319: { - *n_args = 0; + struct linux_epoll_pwait_args *p = params; + iarg[0] = p->epfd; /* l_int */ + uarg[1] = (intptr_t) p->events; /* struct epoll_event * */ + iarg[2] = p->maxevents; /* l_int */ + iarg[3] = p->timeout; /* l_int */ + uarg[4] = (intptr_t) p->mask; /* l_osigset_t * */ + *n_args = 5; break; } /* linux_utimensat */ @@ -2267,7 +2285,9 @@ systrace_args(int sysnum, void *params, } /* linux_epoll_create1 */ case 329: { - *n_args = 0; + struct linux_epoll_create1_args *p = params; + iarg[0] = p->flags; /* l_int */ + *n_args = 1; break; } /* linux_dup3 */ @@ -5008,12 +5028,51 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_epoll_create */ case 254: + switch(ndx) { + case 0: + p = "l_int"; + break; + default: + break; + }; break; /* linux_epoll_ctl */ case 255: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "l_int"; + break; + case 3: + p = "struct epoll_event *"; + break; + default: + break; + }; break; /* linux_epoll_wait */ case 256: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct epoll_event *"; + break; + case 2: + p = "l_int"; + break; + case 3: + p = "l_int"; + break; + default: + break; + }; break; /* linux_remap_file_pages */ case 257: @@ -5699,6 +5758,25 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_epoll_pwait */ case 319: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct epoll_event *"; + break; + case 2: + p = "l_int"; + break; + case 3: + p = "l_int"; + break; + case 4: + p = "l_osigset_t *"; + break; + default: + break; + }; break; /* linux_utimensat */ case 320: @@ -5729,6 +5807,13 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_epoll_create1 */ case 329: + switch(ndx) { + case 0: + p = "l_int"; + break; + default: + break; + }; break; /* linux_dup3 */ case 330: @@ -6837,10 +6922,19 @@ systrace_return_setargdesc(int sysnum, i case 253: /* linux_epoll_create */ case 254: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_epoll_ctl */ case 255: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_epoll_wait */ case 256: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_remap_file_pages */ case 257: /* linux_set_tid_address */ @@ -7074,6 +7168,9 @@ systrace_return_setargdesc(int sysnum, i case 318: /* linux_epoll_pwait */ case 319: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_utimensat */ case 320: /* linux_signalfd */ @@ -7094,6 +7191,9 @@ systrace_return_setargdesc(int sysnum, i case 328: /* linux_epoll_create1 */ case 329: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_dup3 */ case 330: if (ndx == 0 || ndx == 1) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:47:38 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5AFCA67AFA; Sat, 9 Jan 2016 16:47:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCED61760; Sat, 9 Jan 2016 16:47:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GlaXX044799; Sat, 9 Jan 2016 16:47:36 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Gla90044794; Sat, 9 Jan 2016 16:47:36 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091647.u09Gla90044794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293548 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:47:38 -0000 Author: dchagin Date: Sat Jan 9 16:47:36 2016 New Revision: 293548 URL: https://svnweb.freebsd.org/changeset/base/293548 Log: MFC r283443: Put the correct value for the abi_nfdbits parameter of kern_select() for all supported Linuxulators. Modified: stable/10/sys/amd64/linux/linux.h stable/10/sys/amd64/linux32/linux.h stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/linux/linux_misc.h stable/10/sys/i386/linux/linux.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux.h ============================================================================== --- stable/10/sys/amd64/linux/linux.h Sat Jan 9 16:45:54 2016 (r293547) +++ stable/10/sys/amd64/linux/linux.h Sat Jan 9 16:47:36 2016 (r293548) @@ -82,6 +82,7 @@ typedef l_long l_time_t; typedef l_int l_timer_t; typedef l_int l_mqd_t; typedef l_size_t l_socklen_t; +typedef l_ulong l_fd_mask; typedef struct { l_int val[2]; Modified: stable/10/sys/amd64/linux32/linux.h ============================================================================== --- stable/10/sys/amd64/linux32/linux.h Sat Jan 9 16:45:54 2016 (r293547) +++ stable/10/sys/amd64/linux32/linux.h Sat Jan 9 16:47:36 2016 (r293548) @@ -95,6 +95,7 @@ typedef l_uint l_uid_t; typedef l_ushort l_uid16_t; typedef l_int l_timer_t; typedef l_int l_mqd_t; +typedef l_ulong l_fd_mask; typedef struct { l_int val[2]; Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 16:45:54 2016 (r293547) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 16:47:36 2016 (r293548) @@ -532,7 +532,7 @@ linux_select(struct thread *td, struct l tvp = NULL; error = kern_select(td, args->nfds, args->readfds, args->writefds, - args->exceptfds, tvp, sizeof(l_int) * 8); + args->exceptfds, tvp, LINUX_NFDBITS); #ifdef DEBUG if (ldebug(select)) @@ -2179,7 +2179,7 @@ linux_pselect6(struct thread *td, struct tvp = NULL; error = kern_pselect(td, args->nfds, args->readfds, args->writefds, - args->exceptfds, tvp, ssp, sizeof(l_int) * 8); + args->exceptfds, tvp, ssp, LINUX_NFDBITS); if (error == 0 && args->tsp != NULL) { if (td->td_retval[0] != 0) { Modified: stable/10/sys/compat/linux/linux_misc.h ============================================================================== --- stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 16:45:54 2016 (r293547) +++ stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 16:47:36 2016 (r293548) @@ -33,6 +33,9 @@ #include + /* bits per mask */ +#define LINUX_NFDBITS sizeof(l_fd_mask) * 8 + /* * Miscellaneous */ Modified: stable/10/sys/i386/linux/linux.h ============================================================================== --- stable/10/sys/i386/linux/linux.h Sat Jan 9 16:45:54 2016 (r293547) +++ stable/10/sys/i386/linux/linux.h Sat Jan 9 16:47:36 2016 (r293548) @@ -89,6 +89,7 @@ typedef l_uint l_uid_t; typedef l_ushort l_uid16_t; typedef l_int l_timer_t; typedef l_int l_mqd_t; +typedef l_ulong l_fd_mask; typedef struct { l_int val[2]; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:48:52 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FFD6A67B8E; Sat, 9 Jan 2016 16:48:52 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C29518E3; Sat, 9 Jan 2016 16:48:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GmpeY044909; Sat, 9 Jan 2016 16:48:51 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GmoQq044900; Sat, 9 Jan 2016 16:48:50 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091648.u09GmoQq044900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293549 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:48:52 -0000 Author: dchagin Date: Sat Jan 9 16:48:50 2016 New Revision: 293549 URL: https://svnweb.freebsd.org/changeset/base/293549 Log: MFC r283444: Implement eventfd system call. Modified: stable/10/sys/amd64/linux/linux_dummy.c stable/10/sys/amd64/linux/syscalls.master stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_event.c stable/10/sys/compat/linux/linux_event.h stable/10/sys/i386/linux/linux_dummy.c stable/10/sys/i386/linux/syscalls.master stable/10/sys/sys/file.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 16:47:36 2016 (r293548) +++ stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 16:48:50 2016 (r293549) @@ -103,12 +103,10 @@ DUMMY(utimensat); DUMMY(epoll_pwait); DUMMY(signalfd); DUMMY(timerfd); -DUMMY(eventfd); DUMMY(fallocate); DUMMY(timerfd_settime); DUMMY(timerfd_gettime); DUMMY(signalfd4); -DUMMY(eventfd2); DUMMY(inotify_init1); DUMMY(preadv); DUMMY(pwritev); Modified: stable/10/sys/amd64/linux/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 16:47:36 2016 (r293548) +++ stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 16:48:50 2016 (r293549) @@ -472,14 +472,14 @@ l_int maxevents, l_int timeout, l_sigset_t *mask); } 282 AUE_NULL STD { int linux_signalfd(void); } 283 AUE_NULL STD { int linux_timerfd(void); } -284 AUE_NULL STD { int linux_eventfd(void); } +284 AUE_NULL STD { int linux_eventfd(l_uint initval); } 285 AUE_NULL STD { int linux_fallocate(void); } 286 AUE_NULL STD { int linux_timerfd_settime(void); } 287 AUE_NULL STD { int linux_timerfd_gettime(void); } 288 AUE_ACCEPT STD { int linux_accept4(l_int s, l_uintptr_t addr, \ l_uintptr_t namelen, int flags); } 289 AUE_NULL STD { int linux_signalfd4(void); } -290 AUE_NULL STD { int linux_eventfd2(void); } +290 AUE_NULL STD { int linux_eventfd2(l_uint initval, l_int flags); } 291 AUE_NULL STD { int linux_epoll_create1(l_int flags); } 292 AUE_NULL STD { int linux_dup3(l_int oldfd, \ l_int newfd, l_int flags); } Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 16:47:36 2016 (r293548) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 16:48:50 2016 (r293549) @@ -109,7 +109,6 @@ DUMMY(epoll_pwait); DUMMY(utimensat); DUMMY(signalfd); DUMMY(timerfd_create); -DUMMY(eventfd); /* linux 2.6.23: */ DUMMY(fallocate); /* linux 2.6.25: */ @@ -117,7 +116,6 @@ DUMMY(timerfd_settime); DUMMY(timerfd_gettime); /* linux 2.6.27: */ DUMMY(signalfd4); -DUMMY(eventfd2); DUMMY(inotify_init1); /* linux 2.6.30: */ DUMMY(preadv); Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 16:47:36 2016 (r293548) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 16:48:50 2016 (r293549) @@ -535,7 +535,7 @@ 320 AUE_NULL STD { int linux_utimensat(void); } 321 AUE_NULL STD { int linux_signalfd(void); } 322 AUE_NULL STD { int linux_timerfd_create(void); } -323 AUE_NULL STD { int linux_eventfd(void); } +323 AUE_NULL STD { int linux_eventfd(l_uint initval); } ; linux 2.6.23: 324 AUE_NULL STD { int linux_fallocate(void); } ; linux 2.6.25: @@ -543,7 +543,7 @@ 326 AUE_NULL STD { int linux_timerfd_gettime(void); } ; linux 2.6.27: 327 AUE_NULL STD { int linux_signalfd4(void); } -328 AUE_NULL STD { int linux_eventfd2(void); } +328 AUE_NULL STD { int linux_eventfd2(l_uint initval, l_int flags); } 329 AUE_NULL STD { int linux_epoll_create1(l_int flags); } 330 AUE_NULL STD { int linux_dup3(l_int oldfd, \ l_int newfd, l_int flags); } Modified: stable/10/sys/compat/linux/linux_event.c ============================================================================== --- stable/10/sys/compat/linux/linux_event.c Sat Jan 9 16:47:36 2016 (r293548) +++ stable/10/sys/compat/linux/linux_event.c Sat Jan 9 16:48:50 2016 (r293549) @@ -43,7 +43,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -114,6 +116,57 @@ struct epoll_copyout_args { int error; }; +/* eventfd */ +typedef uint64_t eventfd_t; + +static fo_rdwr_t eventfd_read; +static fo_rdwr_t eventfd_write; +static fo_truncate_t eventfd_truncate; +static fo_ioctl_t eventfd_ioctl; +static fo_poll_t eventfd_poll; +static fo_kqfilter_t eventfd_kqfilter; +static fo_stat_t eventfd_stat; +static fo_close_t eventfd_close; + +static struct fileops eventfdops = { + .fo_read = eventfd_read, + .fo_write = eventfd_write, + .fo_truncate = eventfd_truncate, + .fo_ioctl = eventfd_ioctl, + .fo_poll = eventfd_poll, + .fo_kqfilter = eventfd_kqfilter, + .fo_stat = eventfd_stat, + .fo_close = eventfd_close, + .fo_chmod = invfo_chmod, + .fo_chown = invfo_chown, + .fo_sendfile = invfo_sendfile, + .fo_flags = DFLAG_PASSABLE +}; + +static void filt_eventfddetach(struct knote *kn); +static int filt_eventfdread(struct knote *kn, long hint); +static int filt_eventfdwrite(struct knote *kn, long hint); + +static struct filterops eventfd_rfiltops = { + .f_isfd = 1, + .f_detach = filt_eventfddetach, + .f_event = filt_eventfdread +}; +static struct filterops eventfd_wfiltops = { + .f_isfd = 1, + .f_detach = filt_eventfddetach, + .f_event = filt_eventfdwrite +}; + +struct eventfd { + eventfd_t efd_count; + uint32_t efd_flags; + struct selinfo efd_sel; + struct mtx efd_lock; +}; + +static int eventfd_create(struct thread *td, uint32_t initval, int flags); + static void epoll_fd_install(struct thread *td, int fd, epoll_udata_t udata) @@ -498,3 +551,280 @@ epoll_delete_all_events(struct thread *t /* report any errors we got */ return (error1 == 0 ? error2 : error1); } + +static int +eventfd_create(struct thread *td, uint32_t initval, int flags) +{ + struct filedesc *fdp; + struct eventfd *efd; + struct file *fp; + int fflags, fd, error; + + fflags = 0; + if ((flags & LINUX_O_CLOEXEC) != 0) + fflags |= O_CLOEXEC; + + fdp = td->td_proc->p_fd; + error = falloc(td, &fp, &fd, fflags); + if (error) + return (error); + + efd = malloc(sizeof(*efd), M_EPOLL, M_WAITOK | M_ZERO); + efd->efd_flags = flags; + efd->efd_count = initval; + mtx_init(&efd->efd_lock, "eventfd", NULL, MTX_DEF); + + knlist_init_mtx(&efd->efd_sel.si_note, &efd->efd_lock); + + fflags = FREAD | FWRITE; + if ((flags & LINUX_O_NONBLOCK) != 0) + fflags |= FNONBLOCK; + + finit(fp, fflags, DTYPE_LINUXEFD, efd, &eventfdops); + fdrop(fp, td); + + td->td_retval[0] = fd; + return (error); +} + +int +linux_eventfd(struct thread *td, struct linux_eventfd_args *args) +{ + + return (eventfd_create(td, args->initval, 0)); +} + +int +linux_eventfd2(struct thread *td, struct linux_eventfd2_args *args) +{ + + if ((args->flags & ~(LINUX_O_CLOEXEC|LINUX_O_NONBLOCK|LINUX_EFD_SEMAPHORE)) != 0) + return (EINVAL); + + return (eventfd_create(td, args->initval, args->flags)); +} + +static int +eventfd_close(struct file *fp, struct thread *td) +{ + struct eventfd *efd; + + efd = fp->f_data; + if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) + return (EBADF); + + seldrain(&efd->efd_sel); + knlist_destroy(&efd->efd_sel.si_note); + + fp->f_ops = &badfileops; + mtx_destroy(&efd->efd_lock); + free(efd, M_EPOLL); + + return (0); +} + +static int +eventfd_read(struct file *fp, struct uio *uio, struct ucred *active_cred, + int flags, struct thread *td) +{ + struct eventfd *efd; + eventfd_t count; + int error; + + efd = fp->f_data; + if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) + return (EBADF); + + if (uio->uio_resid < sizeof(eventfd_t)) + return (EINVAL); + + error = 0; + mtx_lock(&efd->efd_lock); +retry: + if (efd->efd_count == 0) { + if ((efd->efd_flags & LINUX_O_NONBLOCK) != 0) { + mtx_unlock(&efd->efd_lock); + return (EAGAIN); + } + error = mtx_sleep(&efd->efd_count, &efd->efd_lock, PCATCH, "lefdrd", 0); + if (error == 0) + goto retry; + } + if (error == 0) { + if ((efd->efd_flags & LINUX_EFD_SEMAPHORE) != 0) { + count = 1; + --efd->efd_count; + } else { + count = efd->efd_count; + efd->efd_count = 0; + } + KNOTE_LOCKED(&efd->efd_sel.si_note, 0); + selwakeup(&efd->efd_sel); + wakeup(&efd->efd_count); + mtx_unlock(&efd->efd_lock); + error = uiomove(&count, sizeof(eventfd_t), uio); + } else + mtx_unlock(&efd->efd_lock); + + return (error); +} + +static int +eventfd_write(struct file *fp, struct uio *uio, struct ucred *active_cred, + int flags, struct thread *td) +{ + struct eventfd *efd; + eventfd_t count; + int error; + + efd = fp->f_data; + if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) + return (EBADF); + + if (uio->uio_resid < sizeof(eventfd_t)) + return (EINVAL); + + error = uiomove(&count, sizeof(eventfd_t), uio); + if (error) + return (error); + if (count == UINT64_MAX) + return (EINVAL); + + mtx_lock(&efd->efd_lock); +retry: + if (UINT64_MAX - efd->efd_count <= count) { + if ((efd->efd_flags & LINUX_O_NONBLOCK) != 0) { + mtx_unlock(&efd->efd_lock); + return (EAGAIN); + } + error = mtx_sleep(&efd->efd_count, &efd->efd_lock, + PCATCH, "lefdwr", 0); + if (error == 0) + goto retry; + } + if (error == 0) { + efd->efd_count += count; + KNOTE_LOCKED(&efd->efd_sel.si_note, 0); + selwakeup(&efd->efd_sel); + wakeup(&efd->efd_count); + } + mtx_unlock(&efd->efd_lock); + + return (error); +} + +static int +eventfd_poll(struct file *fp, int events, struct ucred *active_cred, + struct thread *td) +{ + struct eventfd *efd; + int revents = 0; + + efd = fp->f_data; + if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) + return (POLLERR); + + mtx_lock(&efd->efd_lock); + if ((events & (POLLIN|POLLRDNORM)) && efd->efd_count > 0) + revents |= events & (POLLIN|POLLRDNORM); + if ((events & (POLLOUT|POLLWRNORM)) && UINT64_MAX - 1 > efd->efd_count) + revents |= events & (POLLOUT|POLLWRNORM); + if (revents == 0) + selrecord(td, &efd->efd_sel); + mtx_unlock(&efd->efd_lock); + + return (revents); +} + +/*ARGSUSED*/ +static int +eventfd_kqfilter(struct file *fp, struct knote *kn) +{ + struct eventfd *efd; + + efd = fp->f_data; + if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) + return (EINVAL); + + mtx_lock(&efd->efd_lock); + switch (kn->kn_filter) { + case EVFILT_READ: + kn->kn_fop = &eventfd_rfiltops; + break; + case EVFILT_WRITE: + kn->kn_fop = &eventfd_wfiltops; + break; + default: + mtx_unlock(&efd->efd_lock); + return (EINVAL); + } + + kn->kn_hook = efd; + knlist_add(&efd->efd_sel.si_note, kn, 1); + mtx_unlock(&efd->efd_lock); + + return (0); +} + +static void +filt_eventfddetach(struct knote *kn) +{ + struct eventfd *efd = kn->kn_hook; + + mtx_lock(&efd->efd_lock); + knlist_remove(&efd->efd_sel.si_note, kn, 1); + mtx_unlock(&efd->efd_lock); +} + +/*ARGSUSED*/ +static int +filt_eventfdread(struct knote *kn, long hint) +{ + struct eventfd *efd = kn->kn_hook; + int ret; + + mtx_assert(&efd->efd_lock, MA_OWNED); + ret = (efd->efd_count > 0); + + return (ret); +} + +/*ARGSUSED*/ +static int +filt_eventfdwrite(struct knote *kn, long hint) +{ + struct eventfd *efd = kn->kn_hook; + int ret; + + mtx_assert(&efd->efd_lock, MA_OWNED); + ret = (UINT64_MAX - 1 > efd->efd_count); + + return (ret); +} + +/*ARGSUSED*/ +static int +eventfd_truncate(struct file *fp, off_t length, struct ucred *active_cred, + struct thread *td) +{ + + return (ENXIO); +} + +/*ARGSUSED*/ +static int +eventfd_ioctl(struct file *fp, u_long cmd, void *data, + struct ucred *active_cred, struct thread *td) +{ + + return (ENXIO); +} + +/*ARGSUSED*/ +static int +eventfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred, + struct thread *td) +{ + + return (ENXIO); +} Modified: stable/10/sys/compat/linux/linux_event.h ============================================================================== --- stable/10/sys/compat/linux/linux_event.h Sat Jan 9 16:47:36 2016 (r293548) +++ stable/10/sys/compat/linux/linux_event.h Sat Jan 9 16:48:50 2016 (r293549) @@ -55,4 +55,6 @@ #define LINUX_EPOLL_CTL_DEL 2 #define LINUX_EPOLL_CTL_MOD 3 +#define LINUX_EFD_SEMAPHORE (1 << 0) + #endif /* !_LINUX_EVENT_H_ */ Modified: stable/10/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 16:47:36 2016 (r293548) +++ stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 16:48:50 2016 (r293549) @@ -105,7 +105,6 @@ DUMMY(epoll_pwait); DUMMY(utimensat); DUMMY(signalfd); DUMMY(timerfd_create); -DUMMY(eventfd); /* linux 2.6.23: */ DUMMY(fallocate); /* linux 2.6.25: */ @@ -113,7 +112,6 @@ DUMMY(timerfd_settime); DUMMY(timerfd_gettime); /* linux 2.6.27: */ DUMMY(signalfd4); -DUMMY(eventfd2); DUMMY(inotify_init1); /* linux 2.6.30: */ DUMMY(preadv); Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 16:47:36 2016 (r293548) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 16:48:50 2016 (r293549) @@ -543,7 +543,7 @@ 320 AUE_NULL STD { int linux_utimensat(void); } 321 AUE_NULL STD { int linux_signalfd(void); } 322 AUE_NULL STD { int linux_timerfd_create(void); } -323 AUE_NULL STD { int linux_eventfd(void); } +323 AUE_NULL STD { int linux_eventfd(l_uint initval); } ; linux 2.6.23: 324 AUE_NULL STD { int linux_fallocate(void); } ; linux 2.6.25: @@ -551,7 +551,7 @@ 326 AUE_NULL STD { int linux_timerfd_gettime(void); } ; linux 2.6.27: 327 AUE_NULL STD { int linux_signalfd4(void); } -328 AUE_NULL STD { int linux_eventfd2(void); } +328 AUE_NULL STD { int linux_eventfd2(l_uint initval, l_int flags); } 329 AUE_NULL STD { int linux_epoll_create1(l_int flags); } 330 AUE_NULL STD { int linux_dup3(l_int oldfd, \ l_int newfd, l_int flags); } Modified: stable/10/sys/sys/file.h ============================================================================== --- stable/10/sys/sys/file.h Sat Jan 9 16:47:36 2016 (r293548) +++ stable/10/sys/sys/file.h Sat Jan 9 16:48:50 2016 (r293549) @@ -65,6 +65,7 @@ struct socket; #define DTYPE_PTS 10 /* pseudo teletype master device */ #define DTYPE_DEV 11 /* Device specific fd type */ #define DTYPE_PROCDESC 12 /* process descriptor */ +#define DTYPE_LINUXEFD 13 /* emulation eventfd type */ #ifdef _KERNEL From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:50:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17E06A67C2E; Sat, 9 Jan 2016 16:50:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D82921A84; Sat, 9 Jan 2016 16:50:11 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GoBUD045027; Sat, 9 Jan 2016 16:50:11 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Go9Hq045011; Sat, 9 Jan 2016 16:50:09 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091650.u09Go9Hq045011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293550 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:50:12 -0000 Author: dchagin Date: Sat Jan 9 16:50:09 2016 New Revision: 293550 URL: https://svnweb.freebsd.org/changeset/base/293550 Log: Regen for r293549. Modified: stable/10/sys/amd64/linux/linux_proto.h stable/10/sys/amd64/linux/linux_syscall.h stable/10/sys/amd64/linux/linux_syscalls.c stable/10/sys/amd64/linux/linux_sysent.c stable/10/sys/amd64/linux/linux_systrace_args.c stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 16:50:09 2016 (r293550) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -997,7 +997,7 @@ struct linux_timerfd_args { register_t dummy; }; struct linux_eventfd_args { - register_t dummy; + char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)]; }; struct linux_fallocate_args { register_t dummy; @@ -1018,7 +1018,8 @@ struct linux_signalfd4_args { register_t dummy; }; struct linux_eventfd2_args { - register_t dummy; + char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_epoll_create1_args { char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; Modified: stable/10/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 16:50:09 2016 (r293550) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin */ #define LINUX_SYS_read 0 Modified: stable/10/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 16:50:09 2016 (r293550) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 16:50:09 2016 (r293550) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin */ #include @@ -302,13 +302,13 @@ struct sysent linux_sysent[] = { { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 281 = linux_epoll_pwait */ { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 282 = linux_signalfd */ { 0, (sy_call_t *)linux_timerfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_timerfd */ - { 0, (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_eventfd */ + { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_eventfd */ { 0, (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 285 = linux_fallocate */ { 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 286 = linux_timerfd_settime */ { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 287 = linux_timerfd_gettime */ { AS(linux_accept4_args), (sy_call_t *)linux_accept4, AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 288 = linux_accept4 */ { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 289 = linux_signalfd4 */ - { 0, (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 290 = linux_eventfd2 */ + { AS(linux_eventfd2_args), (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 290 = linux_eventfd2 */ { AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 291 = linux_epoll_create1 */ { AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 292 = linux_dup3 */ { AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 293 = linux_pipe2 */ Modified: stable/10/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 16:50:09 2016 (r293550) @@ -2072,7 +2072,9 @@ systrace_args(int sysnum, void *params, } /* linux_eventfd */ case 284: { - *n_args = 0; + struct linux_eventfd_args *p = params; + iarg[0] = p->initval; /* l_uint */ + *n_args = 1; break; } /* linux_fallocate */ @@ -2107,7 +2109,10 @@ systrace_args(int sysnum, void *params, } /* linux_eventfd2 */ case 290: { - *n_args = 0; + struct linux_eventfd2_args *p = params; + iarg[0] = p->initval; /* l_uint */ + iarg[1] = p->flags; /* l_int */ + *n_args = 2; break; } /* linux_epoll_create1 */ @@ -5351,6 +5356,13 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_eventfd */ case 284: + switch(ndx) { + case 0: + p = "l_uint"; + break; + default: + break; + }; break; /* linux_fallocate */ case 285: @@ -5385,6 +5397,16 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_eventfd2 */ case 290: + switch(ndx) { + case 0: + p = "l_uint"; + break; + case 1: + p = "l_int"; + break; + default: + break; + }; break; /* linux_epoll_create1 */ case 291: @@ -6638,6 +6660,9 @@ systrace_return_setargdesc(int sysnum, i case 283: /* linux_eventfd */ case 284: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_fallocate */ case 285: /* linux_timerfd_settime */ @@ -6653,6 +6678,9 @@ systrace_return_setargdesc(int sysnum, i case 289: /* linux_eventfd2 */ case 290: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_epoll_create1 */ case 291: if (ndx == 0 || ndx == 1) Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 16:50:09 2016 (r293550) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293546 2016-01-09 16:44:17Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293549 2016-01-09 16:48:50Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1057,7 +1057,7 @@ struct linux_timerfd_create_args { register_t dummy; }; struct linux_eventfd_args { - register_t dummy; + char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)]; }; struct linux_fallocate_args { register_t dummy; @@ -1072,7 +1072,8 @@ struct linux_signalfd4_args { register_t dummy; }; struct linux_eventfd2_args { - register_t dummy; + char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_epoll_create1_args { char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 16:50:09 2016 (r293550) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293546 2016-01-09 16:44:17Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293549 2016-01-09 16:48:50Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 16:50:09 2016 (r293550) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293546 2016-01-09 16:44:17Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293549 2016-01-09 16:48:50Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 16:50:09 2016 (r293550) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293546 2016-01-09 16:44:17Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293549 2016-01-09 16:48:50Z dchagin */ #include "opt_compat.h" @@ -342,12 +342,12 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_utimensat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */ { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */ { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ - { 0, (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */ + { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */ { 0, (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */ { 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_timerfd_settime */ { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */ { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */ - { 0, (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */ + { AS(linux_eventfd2_args), (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */ { AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */ { AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */ { AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pipe2 */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 16:50:09 2016 (r293550) @@ -2179,7 +2179,9 @@ systrace_args(int sysnum, void *params, } /* linux_eventfd */ case 323: { - *n_args = 0; + struct linux_eventfd_args *p = params; + iarg[0] = p->initval; /* l_uint */ + *n_args = 1; break; } /* linux_fallocate */ @@ -2204,7 +2206,10 @@ systrace_args(int sysnum, void *params, } /* linux_eventfd2 */ case 328: { - *n_args = 0; + struct linux_eventfd2_args *p = params; + iarg[0] = p->initval; /* l_uint */ + iarg[1] = p->flags; /* l_int */ + *n_args = 2; break; } /* linux_epoll_create1 */ @@ -5558,6 +5563,13 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_eventfd */ case 323: + switch(ndx) { + case 0: + p = "l_uint"; + break; + default: + break; + }; break; /* linux_fallocate */ case 324: @@ -5573,6 +5585,16 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_eventfd2 */ case 328: + switch(ndx) { + case 0: + p = "l_uint"; + break; + case 1: + p = "l_int"; + break; + default: + break; + }; break; /* linux_epoll_create1 */ case 329: @@ -6901,6 +6923,9 @@ systrace_return_setargdesc(int sysnum, i case 322: /* linux_eventfd */ case 323: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_fallocate */ case 324: /* linux_timerfd_settime */ @@ -6911,6 +6936,9 @@ systrace_return_setargdesc(int sysnum, i case 327: /* linux_eventfd2 */ case 328: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_epoll_create1 */ case 329: if (ndx == 0 || ndx == 1) Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 16:50:09 2016 (r293550) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1075,7 +1075,7 @@ struct linux_timerfd_create_args { register_t dummy; }; struct linux_eventfd_args { - register_t dummy; + char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)]; }; struct linux_fallocate_args { register_t dummy; @@ -1090,7 +1090,8 @@ struct linux_signalfd4_args { register_t dummy; }; struct linux_eventfd2_args { - register_t dummy; + char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_epoll_create1_args { char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 16:50:09 2016 (r293550) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 16:50:09 2016 (r293550) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 16:50:09 2016 (r293550) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293546 2016-01-09 16:44:17Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin */ #include @@ -341,12 +341,12 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_utimensat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */ { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */ { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ - { 0, (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */ + { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */ { 0, (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */ { 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_timerfd_settime */ { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */ { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */ - { 0, (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */ + { AS(linux_eventfd2_args), (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */ { AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */ { AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */ { AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pipe2 */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 16:48:50 2016 (r293549) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 16:50:09 2016 (r293550) @@ -2255,7 +2255,9 @@ systrace_args(int sysnum, void *params, } /* linux_eventfd */ case 323: { - *n_args = 0; + struct linux_eventfd_args *p = params; + iarg[0] = p->initval; /* l_uint */ + *n_args = 1; break; } /* linux_fallocate */ @@ -2280,7 +2282,10 @@ systrace_args(int sysnum, void *params, } /* linux_eventfd2 */ case 328: { - *n_args = 0; + struct linux_eventfd2_args *p = params; + iarg[0] = p->initval; /* l_uint */ + iarg[1] = p->flags; /* l_int */ + *n_args = 2; break; } /* linux_epoll_create1 */ @@ -5789,6 +5794,13 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_eventfd */ case 323: + switch(ndx) { + case 0: + p = "l_uint"; + break; + default: + break; + }; break; /* linux_fallocate */ case 324: @@ -5804,6 +5816,16 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_eventfd2 */ case 328: + switch(ndx) { + case 0: + p = "l_uint"; + break; + case 1: + p = "l_int"; + break; + default: + break; + }; break; /* linux_epoll_create1 */ case 329: @@ -7179,6 +7201,9 @@ systrace_return_setargdesc(int sysnum, i case 322: /* linux_eventfd */ case 323: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_fallocate */ case 324: /* linux_timerfd_settime */ @@ -7189,6 +7214,9 @@ systrace_return_setargdesc(int sysnum, i case 327: /* linux_eventfd2 */ case 328: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_epoll_create1 */ case 329: if (ndx == 0 || ndx == 1) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:52:27 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A131A67CEE; Sat, 9 Jan 2016 16:52:27 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C92411DB3; Sat, 9 Jan 2016 16:52:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GqPaW047094; Sat, 9 Jan 2016 16:52:25 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GqPoQ047093; Sat, 9 Jan 2016 16:52:25 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091652.u09GqPoQ047093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293551 - stable/10/sys/amd64/linux32 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:52:27 -0000 Author: dchagin Date: Sat Jan 9 16:52:25 2016 New Revision: 293551 URL: https://svnweb.freebsd.org/changeset/base/293551 Log: MFC r283446: Include opt_compat.h, so that COMPAT_LINUX32 is defined, and we can access to the semop structs and functions. Modified: stable/10/sys/amd64/linux32/linux32_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 16:50:09 2016 (r293550) +++ stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 16:52:25 2016 (r293551) @@ -31,6 +31,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #include #include #include From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:55:46 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 142DBA67F00; Sat, 9 Jan 2016 16:55:46 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA0D41098; Sat, 9 Jan 2016 16:55:45 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Gtjtd047979; Sat, 9 Jan 2016 16:55:45 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Gtjba047978; Sat, 9 Jan 2016 16:55:45 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091655.u09Gtjba047978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293552 - stable/10/sys/modules X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:55:46 -0000 Author: dchagin Date: Sat Jan 9 16:55:44 2016 New Revision: 293552 URL: https://svnweb.freebsd.org/changeset/base/293552 Log: MFC r283448: Connect linux64 module to the build. Modified: stable/10/sys/modules/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/modules/Makefile ============================================================================== --- stable/10/sys/modules/Makefile Sat Jan 9 16:52:25 2016 (r293551) +++ stable/10/sys/modules/Makefile Sat Jan 9 16:55:44 2016 (r293552) @@ -198,6 +198,7 @@ SUBDIR= \ ${_linsysfs} \ ${_linux} \ ${_linux_common} \ + ${_linux64} \ lmc \ lpt \ mac_biba \ @@ -801,6 +802,7 @@ _virtio= virtio .if ${MK_BHYVE} != "no" || defined(ALL_MODULES) _vmm= vmm _linux_common= linux_common +_linux64= linux64 .endif _vxge= vxge _x86bios= x86bios From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:57:05 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D674A67FA1; Sat, 9 Jan 2016 16:57:05 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF5C41232; Sat, 9 Jan 2016 16:57:04 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Gv3CY048083; Sat, 9 Jan 2016 16:57:03 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Gv36q048082; Sat, 9 Jan 2016 16:57:03 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091657.u09Gv36q048082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293553 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:57:05 -0000 Author: dchagin Date: Sat Jan 9 16:57:03 2016 New Revision: 293553 URL: https://svnweb.freebsd.org/changeset/base/293553 Log: MFC r283449: Update Linux compat revision to 32. Modified: stable/10/sys/compat/linux/linux_mib.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_mib.h ============================================================================== --- stable/10/sys/compat/linux/linux_mib.h Sat Jan 9 16:55:44 2016 (r293552) +++ stable/10/sys/compat/linux/linux_mib.h Sat Jan 9 16:57:03 2016 (r293553) @@ -48,7 +48,7 @@ int linux_kernver(struct thread *td); #define LINUX_KVERSION 2 #define LINUX_KPATCHLEVEL 6 -#define LINUX_KSUBLEVEL 18 +#define LINUX_KSUBLEVEL 32 #define LINUX_KERNVER(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #define LINUX_VERSION_CODE LINUX_KERNVER(LINUX_KVERSION, \ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:58:04 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9582A6806C; Sat, 9 Jan 2016 16:58:04 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA473139D; Sat, 9 Jan 2016 16:58:04 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Gw3eS048176; Sat, 9 Jan 2016 16:58:03 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Gw39A048175; Sat, 9 Jan 2016 16:58:03 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091658.u09Gw39A048175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293554 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:58:05 -0000 Author: dchagin Date: Sat Jan 9 16:58:03 2016 New Revision: 293554 URL: https://svnweb.freebsd.org/changeset/base/293554 Log: MFC r283450: td_sigmask of a newly created thread copied from td. Remove excess initialization of td_sigmask. Modified: stable/10/sys/compat/linux/linux_fork.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_fork.c ============================================================================== --- stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 16:57:03 2016 (r293553) +++ stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 16:58:03 2016 (r293554) @@ -329,7 +329,6 @@ linux_clone_thread(struct thread *td, st PROC_LOCK(p); p->p_flag |= P_HADTHREADS; - newtd->td_sigmask = td->td_sigmask; bcopy(p->p_comm, newtd->td_name, sizeof(newtd->td_name)); if (args->flags & LINUX_CLONE_PARENT) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 16:58:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38D68A680E1; Sat, 9 Jan 2016 16:58:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1573E156A; Sat, 9 Jan 2016 16:58:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09GwwP3048266; Sat, 9 Jan 2016 16:58:58 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09GwvQW048259; Sat, 9 Jan 2016 16:58:57 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091658.u09GwvQW048259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 16:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293555 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 16:58:59 -0000 Author: dchagin Date: Sat Jan 9 16:58:57 2016 New Revision: 293555 URL: https://svnweb.freebsd.org/changeset/base/293555 Log: MFC r283451: Implement ppoll() system call. Modified: stable/10/sys/amd64/linux/linux_dummy.c stable/10/sys/amd64/linux/syscalls.master stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_misc.c stable/10/sys/i386/linux/linux_dummy.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 16:58:03 2016 (r293554) +++ stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 16:58:57 2016 (r293555) @@ -92,7 +92,6 @@ DUMMY(inotify_init); DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); DUMMY(migrate_pages); -DUMMY(ppoll); DUMMY(unshare); DUMMY(splice); DUMMY(tee); Modified: stable/10/sys/amd64/linux/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 16:58:03 2016 (r293554) +++ stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 16:58:57 2016 (r293555) @@ -456,7 +456,8 @@ 270 AUE_SELECT STD { int linux_pselect6(l_int nfds, \ l_fd_set *readfds, l_fd_set *writefds, l_fd_set *exceptfds, \ struct l_timespec *tsp, l_uintptr_t *sig); } -271 AUE_NULL STD { int linux_ppoll(void); } +271 AUE_POLL STD { int linux_ppoll(struct pollfd *fds, uint32_t nfds, \ + struct l_timespec *tsp, l_sigset_t *sset, l_size_t ssize); } 272 AUE_NULL STD { int linux_unshare(void); } 273 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ l_size_t len); } Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 16:58:03 2016 (r293554) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 16:58:57 2016 (r293555) @@ -93,7 +93,6 @@ DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); /* linux 2.6.16: */ DUMMY(migrate_pages); -DUMMY(ppoll); DUMMY(unshare); /* linux 2.6.17: */ DUMMY(splice); Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 16:58:03 2016 (r293554) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 16:58:57 2016 (r293555) @@ -514,7 +514,8 @@ 308 AUE_SELECT STD { int linux_pselect6(l_int nfds, l_fd_set *readfds, \ l_fd_set *writefds, l_fd_set *exceptfds, \ struct l_timespec *tsp, l_uintptr_t *sig); } -309 AUE_NULL STD { int linux_ppoll(void); } +309 AUE_POLL STD { int linux_ppoll(struct pollfd *fds, uint32_t nfds, \ + struct l_timespec *tsp, l_sigset_t *sset, l_size_t ssize); } 310 AUE_NULL STD { int linux_unshare(void); } ; linux 2.6.17: 311 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 16:58:03 2016 (r293554) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 16:58:57 2016 (r293555) @@ -2207,6 +2207,59 @@ linux_pselect6(struct thread *td, struct return (error); } +int +linux_ppoll(struct thread *td, struct linux_ppoll_args *args) +{ + struct timespec ts0, ts1; + struct l_timespec lts; + struct timespec uts, *tsp; + l_sigset_t l_ss; + sigset_t *ssp; + sigset_t ss; + int error; + + if (args->sset != NULL) { + if (args->ssize != sizeof(l_ss)) + return (EINVAL); + error = copyin(args->sset, &l_ss, sizeof(l_ss)); + if (error) + return (error); + linux_to_bsd_sigset(&l_ss, &ss); + ssp = &ss; + } else + ssp = NULL; + if (args->tsp != NULL) { + error = copyin(args->tsp, <s, sizeof(lts)); + if (error) + return (error); + uts.tv_sec = lts.tv_sec; + uts.tv_nsec = lts.tv_nsec; + + nanotime(&ts0); + tsp = &uts; + } else + tsp = NULL; + + error = kern_poll(td, args->fds, args->nfds, tsp, ssp); + + if (error == 0 && args->tsp != NULL) { + if (td->td_retval[0]) { + nanotime(&ts1); + timespecsub(&ts1, &ts0); + timespecsub(&uts, &ts1); + if (uts.tv_sec < 0) + timespecclear(&uts); + } else + timespecclear(&uts); + + lts.tv_sec = uts.tv_sec; + lts.tv_nsec = uts.tv_nsec; + error = copyout(<s, args->tsp, sizeof(lts)); + } + + return (error); +} + #if defined(DEBUG) || defined(KTR) /* XXX: can be removed when every ldebug(...) and KTR stuff are removed. */ Modified: stable/10/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 16:58:03 2016 (r293554) +++ stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 16:58:57 2016 (r293555) @@ -89,7 +89,6 @@ DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); /* linux 2.6.16: */ DUMMY(migrate_pages); -DUMMY(ppoll); DUMMY(unshare); /* linux 2.6.17: */ DUMMY(splice); Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 16:58:03 2016 (r293554) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 16:58:57 2016 (r293555) @@ -522,7 +522,8 @@ 308 AUE_SELECT STD { int linux_pselect6(l_int nfds, l_fd_set *readfds, \ l_fd_set *writefds, l_fd_set *exceptfds, \ struct l_timespec *tsp, l_uintptr_t *sig); } -309 AUE_NULL STD { int linux_ppoll(void); } +309 AUE_POLL STD { int linux_ppoll(struct pollfd *fds, uint32_t nfds, \ + struct l_timespec *tsp, l_sigset_t *sset, l_size_t ssize); } 310 AUE_NULL STD { int linux_unshare(void); } ; linux 2.6.17: 311 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:00:17 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5B9FA682A0; Sat, 9 Jan 2016 17:00:17 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ED8A1821; Sat, 9 Jan 2016 17:00:17 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09H0GjF048413; Sat, 9 Jan 2016 17:00:16 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09H0FAu048398; Sat, 9 Jan 2016 17:00:15 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091700.u09H0FAu048398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293556 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:00:17 -0000 Author: dchagin Date: Sat Jan 9 17:00:15 2016 New Revision: 293556 URL: https://svnweb.freebsd.org/changeset/base/293556 Log: Regen for r293555. Modified: stable/10/sys/amd64/linux/linux_proto.h stable/10/sys/amd64/linux/linux_syscall.h stable/10/sys/amd64/linux/linux_syscalls.c stable/10/sys/amd64/linux/linux_sysent.c stable/10/sys/amd64/linux/linux_systrace_args.c stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 17:00:15 2016 (r293556) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -951,7 +951,11 @@ struct linux_pselect6_args { char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)]; }; struct linux_ppoll_args { - register_t dummy; + char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; + char nfds_l_[PADL_(uint32_t)]; uint32_t nfds; char nfds_r_[PADR_(uint32_t)]; + char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)]; + char sset_l_[PADL_(l_sigset_t *)]; l_sigset_t * sset; char sset_r_[PADR_(l_sigset_t *)]; + char ssize_l_[PADL_(l_size_t)]; l_size_t ssize; char ssize_r_[PADR_(l_size_t)]; }; struct linux_unshare_args { register_t dummy; @@ -1596,7 +1600,7 @@ int linux_finit_module(struct thread *, #define LINUX_SYS_AUE_linux_fchmodat AUE_FCHMODAT #define LINUX_SYS_AUE_linux_faccessat AUE_FACCESSAT #define LINUX_SYS_AUE_linux_pselect6 AUE_SELECT -#define LINUX_SYS_AUE_linux_ppoll AUE_NULL +#define LINUX_SYS_AUE_linux_ppoll AUE_POLL #define LINUX_SYS_AUE_linux_unshare AUE_NULL #define LINUX_SYS_AUE_linux_set_robust_list AUE_NULL #define LINUX_SYS_AUE_linux_get_robust_list AUE_NULL Modified: stable/10/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 17:00:15 2016 (r293556) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin */ #define LINUX_SYS_read 0 Modified: stable/10/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 17:00:15 2016 (r293556) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 17:00:15 2016 (r293556) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin */ #include @@ -289,7 +289,7 @@ struct sysent linux_sysent[] = { { AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 268 = linux_fchmodat */ { AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_faccessat */ { AS(linux_pselect6_args), (sy_call_t *)linux_pselect6, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 270 = linux_pselect6 */ - { 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_ppoll */ + { AS(linux_ppoll_args), (sy_call_t *)linux_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_ppoll */ { 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_unshare */ { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 273 = linux_set_robust_list */ { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = linux_get_robust_list */ Modified: stable/10/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 17:00:15 2016 (r293556) @@ -1994,7 +1994,13 @@ systrace_args(int sysnum, void *params, } /* linux_ppoll */ case 271: { - *n_args = 0; + struct linux_ppoll_args *p = params; + uarg[0] = (intptr_t) p->fds; /* struct pollfd * */ + uarg[1] = p->nfds; /* uint32_t */ + uarg[2] = (intptr_t) p->tsp; /* struct l_timespec * */ + uarg[3] = (intptr_t) p->sset; /* l_sigset_t * */ + iarg[4] = p->ssize; /* l_size_t */ + *n_args = 5; break; } /* linux_unshare */ @@ -5275,6 +5281,25 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_ppoll */ case 271: + switch(ndx) { + case 0: + p = "struct pollfd *"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "struct l_timespec *"; + break; + case 3: + p = "l_sigset_t *"; + break; + case 4: + p = "l_size_t"; + break; + default: + break; + }; break; /* linux_unshare */ case 272: @@ -6625,6 +6650,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_ppoll */ case 271: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_unshare */ case 272: /* linux_set_robust_list */ Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 17:00:15 2016 (r293556) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293549 2016-01-09 16:48:50Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293555 2016-01-09 16:58:57Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1008,7 +1008,11 @@ struct linux_pselect6_args { char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)]; }; struct linux_ppoll_args { - register_t dummy; + char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; + char nfds_l_[PADL_(uint32_t)]; uint32_t nfds; char nfds_r_[PADR_(uint32_t)]; + char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)]; + char sset_l_[PADL_(l_sigset_t *)]; l_sigset_t * sset; char sset_r_[PADR_(l_sigset_t *)]; + char ssize_l_[PADL_(l_size_t)]; l_size_t ssize; char ssize_r_[PADR_(l_size_t)]; }; struct linux_unshare_args { register_t dummy; @@ -1684,7 +1688,7 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_fchmodat AUE_FCHMODAT #define LINUX_SYS_AUE_linux_faccessat AUE_FACCESSAT #define LINUX_SYS_AUE_linux_pselect6 AUE_SELECT -#define LINUX_SYS_AUE_linux_ppoll AUE_NULL +#define LINUX_SYS_AUE_linux_ppoll AUE_POLL #define LINUX_SYS_AUE_linux_unshare AUE_NULL #define LINUX_SYS_AUE_linux_set_robust_list AUE_NULL #define LINUX_SYS_AUE_linux_get_robust_list AUE_NULL Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 17:00:15 2016 (r293556) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293549 2016-01-09 16:48:50Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293555 2016-01-09 16:58:57Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 17:00:15 2016 (r293556) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293549 2016-01-09 16:48:50Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293555 2016-01-09 16:58:57Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 17:00:15 2016 (r293556) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293549 2016-01-09 16:48:50Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293555 2016-01-09 16:58:57Z dchagin */ #include "opt_compat.h" @@ -328,7 +328,7 @@ struct sysent linux_sysent[] = { { AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 306 = linux_fchmodat */ { AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = linux_faccessat */ { AS(linux_pselect6_args), (sy_call_t *)linux_pselect6, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_pselect6 */ - { 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_ppoll */ + { AS(linux_ppoll_args), (sy_call_t *)linux_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_ppoll */ { 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_unshare */ { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_set_robust_list */ { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = linux_get_robust_list */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 17:00:15 2016 (r293556) @@ -2096,7 +2096,13 @@ systrace_args(int sysnum, void *params, } /* linux_ppoll */ case 309: { - *n_args = 0; + struct linux_ppoll_args *p = params; + uarg[0] = (intptr_t) p->fds; /* struct pollfd * */ + uarg[1] = p->nfds; /* uint32_t */ + uarg[2] = (intptr_t) p->tsp; /* struct l_timespec * */ + uarg[3] = (intptr_t) p->sset; /* l_sigset_t * */ + iarg[4] = p->ssize; /* l_size_t */ + *n_args = 5; break; } /* linux_unshare */ @@ -5479,6 +5485,25 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_ppoll */ case 309: + switch(ndx) { + case 0: + p = "struct pollfd *"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "struct l_timespec *"; + break; + case 3: + p = "l_sigset_t *"; + break; + case 4: + p = "l_size_t"; + break; + default: + break; + }; break; /* linux_unshare */ case 310: @@ -6886,6 +6911,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_ppoll */ case 309: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_unshare */ case 310: /* linux_set_robust_list */ Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 17:00:15 2016 (r293556) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1026,7 +1026,11 @@ struct linux_pselect6_args { char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)]; }; struct linux_ppoll_args { - register_t dummy; + char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; + char nfds_l_[PADL_(uint32_t)]; uint32_t nfds; char nfds_r_[PADR_(uint32_t)]; + char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)]; + char sset_l_[PADL_(l_sigset_t *)]; l_sigset_t * sset; char sset_r_[PADR_(l_sigset_t *)]; + char ssize_l_[PADL_(l_size_t)]; l_size_t ssize; char ssize_r_[PADR_(l_size_t)]; }; struct linux_unshare_args { register_t dummy; @@ -1706,7 +1710,7 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_fchmodat AUE_FCHMODAT #define LINUX_SYS_AUE_linux_faccessat AUE_FACCESSAT #define LINUX_SYS_AUE_linux_pselect6 AUE_SELECT -#define LINUX_SYS_AUE_linux_ppoll AUE_NULL +#define LINUX_SYS_AUE_linux_ppoll AUE_POLL #define LINUX_SYS_AUE_linux_unshare AUE_NULL #define LINUX_SYS_AUE_linux_set_robust_list AUE_NULL #define LINUX_SYS_AUE_linux_get_robust_list AUE_NULL Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 17:00:15 2016 (r293556) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 17:00:15 2016 (r293556) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 17:00:15 2016 (r293556) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293549 2016-01-09 16:48:50Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin */ #include @@ -327,7 +327,7 @@ struct sysent linux_sysent[] = { { AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 306 = linux_fchmodat */ { AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = linux_faccessat */ { AS(linux_pselect6_args), (sy_call_t *)linux_pselect6, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_pselect6 */ - { 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_ppoll */ + { AS(linux_ppoll_args), (sy_call_t *)linux_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_ppoll */ { 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_unshare */ { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_set_robust_list */ { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = linux_get_robust_list */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 16:58:57 2016 (r293555) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 17:00:15 2016 (r293556) @@ -2172,7 +2172,13 @@ systrace_args(int sysnum, void *params, } /* linux_ppoll */ case 309: { - *n_args = 0; + struct linux_ppoll_args *p = params; + uarg[0] = (intptr_t) p->fds; /* struct pollfd * */ + uarg[1] = p->nfds; /* uint32_t */ + uarg[2] = (intptr_t) p->tsp; /* struct l_timespec * */ + uarg[3] = (intptr_t) p->sset; /* l_sigset_t * */ + iarg[4] = p->ssize; /* l_size_t */ + *n_args = 5; break; } /* linux_unshare */ @@ -5710,6 +5716,25 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_ppoll */ case 309: + switch(ndx) { + case 0: + p = "struct pollfd *"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "struct l_timespec *"; + break; + case 3: + p = "l_sigset_t *"; + break; + case 4: + p = "l_size_t"; + break; + default: + break; + }; break; /* linux_unshare */ case 310: @@ -7164,6 +7189,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_ppoll */ case 309: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_unshare */ case 310: /* linux_set_robust_list */ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:01:28 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18233A68347; Sat, 9 Jan 2016 17:01:28 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB0D21AE6; Sat, 9 Jan 2016 17:01:27 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09H1RDq048518; Sat, 9 Jan 2016 17:01:27 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09H1Rvl048517; Sat, 9 Jan 2016 17:01:27 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091701.u09H1Rvl048517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293557 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:01:28 -0000 Author: dchagin Date: Sat Jan 9 17:01:26 2016 New Revision: 293557 URL: https://svnweb.freebsd.org/changeset/base/293557 Log: MFC r283453: Remove the unnecessary cast. Modified: stable/10/sys/compat/linux/linux_emul.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_emul.c ============================================================================== --- stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 17:00:15 2016 (r293556) +++ stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 17:01:26 2016 (r293557) @@ -265,7 +265,7 @@ linux_schedtail(struct thread *td) child_set_tid = em->child_set_tid; if (child_set_tid != NULL) { - error = copyout(&em->em_tid, (int *)child_set_tid, + error = copyout(&em->em_tid, child_set_tid, sizeof(em->em_tid)); LINUX_CTR4(clone, "schedtail(%d) %p stored %d error %d", td->td_tid, child_set_tid, em->em_tid, error); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:03:54 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAF18A684DC; Sat, 9 Jan 2016 17:03:54 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80FB31E31; Sat, 9 Jan 2016 17:03:54 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09H3rYN051266; Sat, 9 Jan 2016 17:03:53 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09H3rgA051265; Sat, 9 Jan 2016 17:03:53 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091703.u09H3rgA051265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293559 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:03:54 -0000 Author: dchagin Date: Sat Jan 9 17:03:53 2016 New Revision: 293559 URL: https://svnweb.freebsd.org/changeset/base/293559 Log: MFC r283455: Use local struct proc * varable instead of dereferencing td->td_proc. Modified: stable/10/sys/compat/linux/linux_emul.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_emul.c ============================================================================== --- stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 17:02:35 2016 (r293558) +++ stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 17:03:53 2016 (r293559) @@ -85,8 +85,11 @@ linux_proc_init(struct thread *td, struc struct linux_emuldata *em; struct linux_pemuldata *pem; struct epoll_emuldata *emd; + struct proc *p; if (newtd != NULL) { + p = newtd->td_proc; + /* non-exec call */ em = malloc(sizeof(*em), M_TEMP, M_WAITOK | M_ZERO); if (flags & LINUX_CLONE_THREAD) { @@ -95,26 +98,26 @@ linux_proc_init(struct thread *td, struc em->em_tid = newtd->td_tid; } else { - LINUX_CTR1(proc_init, "fork newtd(%d)", - newtd->td_proc->p_pid); + LINUX_CTR1(proc_init, "fork newtd(%d)", p->p_pid); - em->em_tid = newtd->td_proc->p_pid; + em->em_tid = p->p_pid; pem = malloc(sizeof(*pem), M_LINUX, M_WAITOK | M_ZERO); sx_init(&pem->pem_sx, "lpemlk"); - newtd->td_proc->p_emuldata = pem; + p->p_emuldata = pem; } newtd->td_emuldata = em; } else { + p = td->td_proc; + /* exec */ - LINUX_CTR1(proc_init, "exec newtd(%d)", - td->td_proc->p_pid); + LINUX_CTR1(proc_init, "exec newtd(%d)", p->p_pid); /* lookup the old one */ em = em_find(td); KASSERT(em != NULL, ("proc_init: emuldata not found in exec case.\n")); - em->em_tid = td->td_proc->p_pid; + em->em_tid = p->p_pid; em->flags = 0; em->pdeath_signal = 0; em->robust_futexes = NULL; @@ -122,7 +125,7 @@ linux_proc_init(struct thread *td, struc em->child_set_tid = NULL; /* epoll should be destroyed in a case of exec. */ - pem = pem_find(td->td_proc); + pem = pem_find(p); KASSERT(pem != NULL, ("proc_exit: proc emuldata not found.\n")); if (pem->epoll != NULL) { From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:02:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B640FA684AD; Sat, 9 Jan 2016 17:02:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 879DF1D14; Sat, 9 Jan 2016 17:02:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09H2ZwJ051164; Sat, 9 Jan 2016 17:02:35 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09H2ZTD051163; Sat, 9 Jan 2016 17:02:35 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091702.u09H2ZTD051163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293558 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:02:36 -0000 Author: dchagin Date: Sat Jan 9 17:02:35 2016 New Revision: 293558 URL: https://svnweb.freebsd.org/changeset/base/293558 Log: MFC r283454: Avoid unnecessary em zeroing in non-exec path as it already zeroed by malloc with M_ZERO flag and move zeroing to the proper place in exec path. Modified: stable/10/sys/compat/linux/linux_emul.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_emul.c ============================================================================== --- stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 17:01:26 2016 (r293557) +++ stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 17:02:35 2016 (r293558) @@ -89,8 +89,6 @@ linux_proc_init(struct thread *td, struc if (newtd != NULL) { /* non-exec call */ em = malloc(sizeof(*em), M_TEMP, M_WAITOK | M_ZERO); - em->pdeath_signal = 0; - em->robust_futexes = NULL; if (flags & LINUX_CLONE_THREAD) { LINUX_CTR1(proc_init, "thread newtd(%d)", newtd->td_tid); @@ -117,6 +115,11 @@ linux_proc_init(struct thread *td, struc KASSERT(em != NULL, ("proc_init: emuldata not found in exec case.\n")); em->em_tid = td->td_proc->p_pid; + em->flags = 0; + em->pdeath_signal = 0; + em->robust_futexes = NULL; + em->child_clear_tid = NULL; + em->child_set_tid = NULL; /* epoll should be destroyed in a case of exec. */ pem = pem_find(td->td_proc); @@ -129,8 +132,6 @@ linux_proc_init(struct thread *td, struc } } - em->child_clear_tid = NULL; - em->child_set_tid = NULL; } void From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:05:02 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06DA8A68641; Sat, 9 Jan 2016 17:05:02 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF19C10C8; Sat, 9 Jan 2016 17:05:01 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09H50Vv051371; Sat, 9 Jan 2016 17:05:00 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09H50fO051369; Sat, 9 Jan 2016 17:05:00 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091705.u09H50fO051369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293560 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:05:02 -0000 Author: dchagin Date: Sat Jan 9 17:05:00 2016 New Revision: 293560 URL: https://svnweb.freebsd.org/changeset/base/293560 Log: MFC r283456: Improve ktr(9) records in thread managment code. Modified: stable/10/sys/compat/linux/linux_emul.c stable/10/sys/compat/linux/linux_fork.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_emul.c ============================================================================== --- stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 17:03:53 2016 (r293559) +++ stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 17:05:00 2016 (r293560) @@ -147,6 +147,9 @@ linux_proc_exit(void *arg __unused, stru if (__predict_false(SV_CURPROC_ABI() != SV_ABI_LINUX)) return; + LINUX_CTR3(proc_exit, "thread(%d) proc(%d) p %p", + td->td_tid, p->p_pid, p); + pem = pem_find(p); if (pem == NULL) return; @@ -249,7 +252,7 @@ linux_thread_dtor(void *arg __unused, st return; td->td_emuldata = NULL; - LINUX_CTR1(exit, "thread dtor(%d)", em->em_tid); + LINUX_CTR1(thread_dtor, "thread(%d)", em->em_tid); free(em, M_TEMP); } @@ -271,8 +274,8 @@ linux_schedtail(struct thread *td) if (child_set_tid != NULL) { error = copyout(&em->em_tid, child_set_tid, sizeof(em->em_tid)); - LINUX_CTR4(clone, "schedtail(%d) %p stored %d error %d", + LINUX_CTR4(schedtail, "thread(%d) %p stored %d error %d", td->td_tid, child_set_tid, em->em_tid, error); } else - LINUX_CTR1(clone, "schedtail(%d)", em->em_tid); + LINUX_CTR1(schedtail, "thread(%d)", em->em_tid); } Modified: stable/10/sys/compat/linux/linux_fork.c ============================================================================== --- stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 17:03:53 2016 (r293559) +++ stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 17:05:00 2016 (r293560) @@ -275,7 +275,7 @@ linux_clone_thread(struct thread *td, st } #endif - LINUX_CTR4(clone, "thread(%d) flags %x ptid %p ctid %p", + LINUX_CTR4(clone_thread, "thread(%d) flags %x ptid %p ctid %p", td->td_tid, (unsigned)args->flags, args->parent_tidptr, args->child_tidptr); @@ -352,7 +352,7 @@ linux_clone_thread(struct thread *td, st (int)newtd->td_tid, args->stack); #endif - LINUX_CTR2(clone, "thread(%d) successful clone to %d", + LINUX_CTR2(clone_thread, "thread(%d) successful clone to %d", td->td_tid, newtd->td_tid); if (args->flags & LINUX_CLONE_PARENT_SETTID) { @@ -435,7 +435,7 @@ linux_thread_detach(struct thread *td) em = em_find(td); KASSERT(em != NULL, ("thread_detach: emuldata not found.\n")); - LINUX_CTR1(exit, "thread detach(%d)", em->em_tid); + LINUX_CTR1(thread_detach, "thread(%d)", em->em_tid); release_futexes(td, em); @@ -443,7 +443,7 @@ linux_thread_detach(struct thread *td) if (child_clear_tid != NULL) { - LINUX_CTR2(exit, "thread detach(%d) %p", + LINUX_CTR2(thread_detach, "thread(%d) %p", em->em_tid, child_clear_tid); error = suword32(child_clear_tid, 0); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:05:38 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32B94A686C3; Sat, 9 Jan 2016 17:05:38 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AD9B1279; Sat, 9 Jan 2016 17:05:37 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aHwxI-000757-Ti; Sat, 09 Jan 2016 20:05:32 +0300 Date: Sat, 9 Jan 2016 20:05:32 +0300 From: Slawa Olhovchenkov To: Dmitry Chagin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r293553 - stable/10/sys/compat/linux Message-ID: <20160109170532.GL70867@zxy.spb.ru> References: <201601091657.u09Gv36q048082@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201601091657.u09Gv36q048082@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:05:38 -0000 On Sat, Jan 09, 2016 at 04:57:03PM +0000, Dmitry Chagin wrote: > Author: dchagin > Date: Sat Jan 9 16:57:03 2016 > New Revision: 293553 > URL: https://svnweb.freebsd.org/changeset/base/293553 > > Log: > MFC r283449: > > Update Linux compat revision to 32. Bump OSVERSION for net-im/skype4? > Modified: > stable/10/sys/compat/linux/linux_mib.h > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sys/compat/linux/linux_mib.h > ============================================================================== > --- stable/10/sys/compat/linux/linux_mib.h Sat Jan 9 16:55:44 2016 (r293552) > +++ stable/10/sys/compat/linux/linux_mib.h Sat Jan 9 16:57:03 2016 (r293553) > @@ -48,7 +48,7 @@ int linux_kernver(struct thread *td); > > #define LINUX_KVERSION 2 > #define LINUX_KPATCHLEVEL 6 > -#define LINUX_KSUBLEVEL 18 > +#define LINUX_KSUBLEVEL 32 > > #define LINUX_KERNVER(a,b,c) (((a) << 16) + ((b) << 8) + (c)) > #define LINUX_VERSION_CODE LINUX_KERNVER(LINUX_KVERSION, \ > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:06:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FF0EA6873B; Sat, 9 Jan 2016 17:06:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67FCA13C9; Sat, 9 Jan 2016 17:06:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09H6Lnq051480; Sat, 9 Jan 2016 17:06:21 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09H6LVl051478; Sat, 9 Jan 2016 17:06:21 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091706.u09H6LVl051478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293561 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:06:22 -0000 Author: dchagin Date: Sat Jan 9 17:06:21 2016 New Revision: 293561 URL: https://svnweb.freebsd.org/changeset/base/293561 Log: MFC r283459: Add some clock mappings used in glibc 2.20. Modified: stable/10/sys/compat/linux/linux_time.c stable/10/sys/compat/linux/linux_timer.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_time.c ============================================================================== --- stable/10/sys/compat/linux/linux_time.c Sat Jan 9 17:05:00 2016 (r293560) +++ stable/10/sys/compat/linux/linux_time.c Sat Jan 9 17:06:21 2016 (r293561) @@ -40,8 +40,11 @@ __KERNEL_RCSID(0, "$NetBSD: linux_time.c #include #include +#include #include #include +#include +#include #include #include #include @@ -60,7 +63,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_time.c #endif #include -#include +#include /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); @@ -158,6 +161,20 @@ linux_to_native_clockid(clockid_t *n, cl LIN_SDT_PROBE2(time, linux_to_native_clockid, entry, n, l); + if (l < 0) { + /* cpu-clock */ + if ((l & LINUX_CLOCKFD_MASK) == LINUX_CLOCKFD) + return (EINVAL); + if (LINUX_CPUCLOCK_WHICH(l) >= LINUX_CPUCLOCK_MAX) + return (EINVAL); + + if (LINUX_CPUCLOCK_PERTHREAD(l)) + *n = CLOCK_THREAD_CPUTIME_ID; + else + *n = CLOCK_PROCESS_CPUTIME_ID; + return (0); + } + switch (l) { case LINUX_CLOCK_REALTIME: *n = CLOCK_REALTIME; @@ -165,21 +182,27 @@ linux_to_native_clockid(clockid_t *n, cl case LINUX_CLOCK_MONOTONIC: *n = CLOCK_MONOTONIC; break; - case LINUX_CLOCK_PROCESS_CPUTIME_ID: - case LINUX_CLOCK_THREAD_CPUTIME_ID: - case LINUX_CLOCK_REALTIME_HR: - case LINUX_CLOCK_MONOTONIC_HR: + case LINUX_CLOCK_REALTIME_COARSE: + *n = CLOCK_REALTIME_FAST; + break; + case LINUX_CLOCK_MONOTONIC_COARSE: + *n = CLOCK_MONOTONIC_FAST; + break; + case LINUX_CLOCK_MONOTONIC_RAW: + case LINUX_CLOCK_BOOTTIME: + case LINUX_CLOCK_REALTIME_ALARM: + case LINUX_CLOCK_BOOTTIME_ALARM: + case LINUX_CLOCK_SGI_CYCLE: + case LINUX_CLOCK_TAI: LIN_SDT_PROBE1(time, linux_to_native_clockid, unsupported_clockid, l); LIN_SDT_PROBE1(time, linux_to_native_clockid, return, EINVAL); return (EINVAL); - break; default: LIN_SDT_PROBE1(time, linux_to_native_clockid, unknown_clockid, l); LIN_SDT_PROBE1(time, linux_to_native_clockid, return, EINVAL); return (EINVAL); - break; } LIN_SDT_PROBE1(time, linux_to_native_clockid, return, 0); @@ -190,9 +213,14 @@ int linux_clock_gettime(struct thread *td, struct linux_clock_gettime_args *args) { struct l_timespec lts; - int error; - clockid_t nwhich = 0; /* XXX: GCC */ struct timespec tp; + struct rusage ru; + struct thread *targettd; + struct proc *p; + int error, clockwhich; + clockid_t nwhich = 0; /* XXX: GCC */ + pid_t pid; + lwpid_t tid; LIN_SDT_PROBE2(time, linux_clock_gettime, entry, args->which, args->tp); @@ -203,7 +231,100 @@ linux_clock_gettime(struct thread *td, s LIN_SDT_PROBE1(time, linux_clock_gettime, return, error); return (error); } - error = kern_clock_gettime(td, nwhich, &tp); + + switch (nwhich) { + case CLOCK_PROCESS_CPUTIME_ID: + clockwhich = LINUX_CPUCLOCK_WHICH(args->which); + pid = LINUX_CPUCLOCK_ID(args->which); + if (pid == 0) { + p = td->td_proc; + PROC_LOCK(p); + } else { + error = pget(pid, PGET_CANSEE, &p); + if (error != 0) + return (EINVAL); + } + switch (clockwhich) { + case LINUX_CPUCLOCK_PROF: + PROC_STATLOCK(p); + calcru(p, &ru.ru_utime, &ru.ru_stime); + PROC_STATUNLOCK(p); + PROC_UNLOCK(p); + timevaladd(&ru.ru_utime, &ru.ru_stime); + TIMEVAL_TO_TIMESPEC(&ru.ru_utime, &tp); + break; + case LINUX_CPUCLOCK_VIRT: + PROC_STATLOCK(p); + calcru(p, &ru.ru_utime, &ru.ru_stime); + PROC_STATUNLOCK(p); + PROC_UNLOCK(p); + TIMEVAL_TO_TIMESPEC(&ru.ru_utime, &tp); + break; + case LINUX_CPUCLOCK_SCHED: + PROC_UNLOCK(p); + error = kern_clock_getcpuclockid2(td, pid, + CPUCLOCK_WHICH_PID, &nwhich); + if (error != 0) + return (EINVAL); + error = kern_clock_gettime(td, nwhich, &tp); + break; + default: + PROC_UNLOCK(p); + return (EINVAL); + } + + break; + + case CLOCK_THREAD_CPUTIME_ID: + clockwhich = LINUX_CPUCLOCK_WHICH(args->which); + p = td->td_proc; + tid = LINUX_CPUCLOCK_ID(args->which); + if (tid == 0) { + targettd = td; + PROC_LOCK(p); + } else { + targettd = tdfind(tid, p->p_pid); + if (targettd == NULL) + return (EINVAL); + } + switch (clockwhich) { + case LINUX_CPUCLOCK_PROF: + PROC_STATLOCK(p); + thread_lock(targettd); + rufetchtd(targettd, &ru); + thread_unlock(targettd); + PROC_STATUNLOCK(p); + PROC_UNLOCK(p); + timevaladd(&ru.ru_utime, &ru.ru_stime); + TIMEVAL_TO_TIMESPEC(&ru.ru_utime, &tp); + break; + case LINUX_CPUCLOCK_VIRT: + PROC_STATLOCK(p); + thread_lock(targettd); + rufetchtd(targettd, &ru); + thread_unlock(targettd); + PROC_STATUNLOCK(p); + PROC_UNLOCK(p); + TIMEVAL_TO_TIMESPEC(&ru.ru_utime, &tp); + break; + case LINUX_CPUCLOCK_SCHED: + error = kern_clock_getcpuclockid2(td, tid, + CPUCLOCK_WHICH_TID, &nwhich); + PROC_UNLOCK(p); + if (error != 0) + return (EINVAL); + error = kern_clock_gettime(td, nwhich, &tp); + break; + default: + PROC_UNLOCK(p); + return (EINVAL); + } + break; + + default: + error = kern_clock_gettime(td, nwhich, &tp); + break; + } if (error != 0) { LIN_SDT_PROBE1(time, linux_clock_gettime, gettime_error, error); LIN_SDT_PROBE1(time, linux_clock_gettime, return, error); @@ -261,19 +382,16 @@ linux_clock_settime(struct thread *td, s int linux_clock_getres(struct thread *td, struct linux_clock_getres_args *args) { + struct proc *p; struct timespec ts; struct l_timespec lts; - int error; + int error, clockwhich; clockid_t nwhich = 0; /* XXX: GCC */ + pid_t pid; + lwpid_t tid; LIN_SDT_PROBE2(time, linux_clock_getres, entry, args->which, args->tp); - if (args->tp == NULL) { - LIN_SDT_PROBE0(time, linux_clock_getres, nullcall); - LIN_SDT_PROBE1(time, linux_clock_getres, return, 0); - return (0); - } - error = linux_to_native_clockid(&nwhich, args->which); if (error != 0) { LIN_SDT_PROBE1(time, linux_clock_getres, conversion_error, @@ -281,6 +399,59 @@ linux_clock_getres(struct thread *td, st LIN_SDT_PROBE1(time, linux_clock_getres, return, error); return (error); } + + /* + * Check user supplied clock id in case of per-process + * or thread-specific cpu-time clock. + */ + switch (nwhich) { + case CLOCK_THREAD_CPUTIME_ID: + tid = LINUX_CPUCLOCK_ID(args->which); + if (tid != 0) { + p = td->td_proc; + if (tdfind(tid, p->p_pid) == NULL) + return (ESRCH); + PROC_UNLOCK(p); + } + break; + case CLOCK_PROCESS_CPUTIME_ID: + pid = LINUX_CPUCLOCK_ID(args->which); + if (pid != 0) { + error = pget(pid, PGET_CANSEE, &p); + if (error != 0) + return (EINVAL); + PROC_UNLOCK(p); + } + break; + } + + if (args->tp == NULL) { + LIN_SDT_PROBE0(time, linux_clock_getres, nullcall); + LIN_SDT_PROBE1(time, linux_clock_getres, return, 0); + return (0); + } + + switch (nwhich) { + case CLOCK_THREAD_CPUTIME_ID: + case CLOCK_PROCESS_CPUTIME_ID: + clockwhich = LINUX_CPUCLOCK_WHICH(args->which); + switch (clockwhich) { + case LINUX_CPUCLOCK_PROF: + nwhich = CLOCK_PROF; + break; + case LINUX_CPUCLOCK_VIRT: + nwhich = CLOCK_VIRTUAL; + break; + case LINUX_CPUCLOCK_SCHED: + break; + default: + return (EINVAL); + } + break; + + default: + break; + } error = kern_clock_getres(td, nwhich, &ts); if (error != 0) { LIN_SDT_PROBE1(time, linux_clock_getres, getres_error, error); Modified: stable/10/sys/compat/linux/linux_timer.h ============================================================================== --- stable/10/sys/compat/linux/linux_timer.h Sat Jan 9 17:05:00 2016 (r293560) +++ stable/10/sys/compat/linux/linux_timer.h Sat Jan 9 17:06:21 2016 (r293561) @@ -56,6 +56,23 @@ #define LINUX_CLOCK_SGI_CYCLE 10 #define LINUX_CLOCK_TAI 11 +#define LINUX_CPUCLOCK_PERTHREAD_MASK 4 +#define LINUX_CPUCLOCK_MASK 3 +#define LINUX_CPUCLOCK_WHICH(clock) \ + ((clock) & (clockid_t) LINUX_CPUCLOCK_MASK) +#define LINUX_CPUCLOCK_PROF 0 +#define LINUX_CPUCLOCK_VIRT 1 +#define LINUX_CPUCLOCK_SCHED 2 +#define LINUX_CPUCLOCK_MAX 3 +#define LINUX_CLOCKFD LINUX_CPUCLOCK_MAX +#define LINUX_CLOCKFD_MASK \ + (LINUX_CPUCLOCK_PERTHREAD_MASK|LINUX_CPUCLOCK_MASK) + +#define LINUX_CPUCLOCK_ID(clock) ((pid_t) ~((clock) >> 3)) +#define LINUX_CPUCLOCK_PERTHREAD(clock) \ + (((clock) & (clockid_t) LINUX_CPUCLOCK_PERTHREAD_MASK) != 0) + + #define L_SIGEV_SIGNAL 0 #define L_SIGEV_NONE 1 #define L_SIGEV_THREAD 2 From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:07:18 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFCC5A6885F; Sat, 9 Jan 2016 17:07:18 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AF481594; Sat, 9 Jan 2016 17:07:18 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09H7HGf051569; Sat, 9 Jan 2016 17:07:17 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09H7HGn051567; Sat, 9 Jan 2016 17:07:17 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091707.u09H7HGn051567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293562 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:07:18 -0000 Author: dchagin Date: Sat Jan 9 17:07:17 2016 New Revision: 293562 URL: https://svnweb.freebsd.org/changeset/base/293562 Log: MFC r283460: Print out unsupported futex operation message only once for the process. Modified: stable/10/sys/compat/linux/linux_emul.h stable/10/sys/compat/linux/linux_futex.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_emul.h ============================================================================== --- stable/10/sys/compat/linux/linux_emul.h Sat Jan 9 17:06:21 2016 (r293561) +++ stable/10/sys/compat/linux/linux_emul.h Sat Jan 9 17:07:17 2016 (r293562) @@ -61,6 +61,7 @@ int linux_common_execve(struct thread *, #define LINUX_XDEPR_REQUEUEOP 0x00000001 /* uses deprecated futex REQUEUE op*/ #define LINUX_XUNSUP_EPOLL 0x00000002 /* unsupported epoll events */ +#define LINUX_XUNSUP_FUTEXPIOP 0x00000004 /* uses unsupported pi futex */ struct linux_pemuldata { uint32_t flags; /* process emuldata flags */ Modified: stable/10/sys/compat/linux/linux_futex.c ============================================================================== --- stable/10/sys/compat/linux/linux_futex.c Sat Jan 9 17:06:21 2016 (r293561) +++ stable/10/sys/compat/linux/linux_futex.c Sat Jan 9 17:07:17 2016 (r293562) @@ -937,29 +937,43 @@ linux_sys_futex(struct thread *td, struc case LINUX_FUTEX_LOCK_PI: /* not yet implemented */ - linux_msg(td, - "linux_sys_futex: " - "op LINUX_FUTEX_LOCK_PI not implemented\n"); - LIN_SDT_PROBE0(futex, linux_sys_futex, unimplemented_lock_pi); + pem = pem_find(td->td_proc); + if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) { + linux_msg(td, + "linux_sys_futex: " + "unsupported futex_pi op\n"); + pem->flags |= LINUX_XUNSUP_FUTEXPIOP; + LIN_SDT_PROBE0(futex, linux_sys_futex, + unimplemented_lock_pi); + } LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS); return (ENOSYS); case LINUX_FUTEX_UNLOCK_PI: /* not yet implemented */ - linux_msg(td, - "linux_sys_futex: " - "op LINUX_FUTEX_UNLOCK_PI not implemented\n"); - LIN_SDT_PROBE0(futex, linux_sys_futex, unimplemented_unlock_pi); + pem = pem_find(td->td_proc); + if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) { + linux_msg(td, + "linux_sys_futex: " + "unsupported futex_pi op\n"); + pem->flags |= LINUX_XUNSUP_FUTEXPIOP; + LIN_SDT_PROBE0(futex, linux_sys_futex, + unimplemented_unlock_pi); + } LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS); return (ENOSYS); case LINUX_FUTEX_TRYLOCK_PI: /* not yet implemented */ - linux_msg(td, - "linux_sys_futex: " - "op LINUX_FUTEX_TRYLOCK_PI not implemented\n"); - LIN_SDT_PROBE0(futex, linux_sys_futex, - unimplemented_trylock_pi); + pem = pem_find(td->td_proc); + if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) { + linux_msg(td, + "linux_sys_futex: " + "unsupported futex_pi op\n"); + pem->flags |= LINUX_XUNSUP_FUTEXPIOP; + LIN_SDT_PROBE0(futex, linux_sys_futex, + unimplemented_trylock_pi); + } LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS); return (ENOSYS); @@ -986,21 +1000,29 @@ linux_sys_futex(struct thread *td, struc case LINUX_FUTEX_WAIT_REQUEUE_PI: /* not yet implemented */ - linux_msg(td, - "linux_sys_futex: " - "op FUTEX_WAIT_REQUEUE_PI not implemented\n"); - LIN_SDT_PROBE0(futex, linux_sys_futex, - unimplemented_wait_requeue_pi); + pem = pem_find(td->td_proc); + if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) { + linux_msg(td, + "linux_sys_futex: " + "unsupported futex_pi op\n"); + pem->flags |= LINUX_XUNSUP_FUTEXPIOP; + LIN_SDT_PROBE0(futex, linux_sys_futex, + unimplemented_wait_requeue_pi); + } LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS); return (ENOSYS); case LINUX_FUTEX_CMP_REQUEUE_PI: /* not yet implemented */ - linux_msg(td, - "linux_sys_futex: " - "op LINUX_FUTEX_CMP_REQUEUE_PI not implemented\n"); - LIN_SDT_PROBE0(futex, linux_sys_futex, - unimplemented_cmp_requeue_pi); + pem = pem_find(td->td_proc); + if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) { + linux_msg(td, + "linux_sys_futex: " + "unsupported futex_pi op\n"); + pem->flags |= LINUX_XUNSUP_FUTEXPIOP; + LIN_SDT_PROBE0(futex, linux_sys_futex, + unimplemented_cmp_requeue_pi); + } LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS); return (ENOSYS); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:08:34 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 763B1A6894D; Sat, 9 Jan 2016 17:08:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E1FD17E1; Sat, 9 Jan 2016 17:08:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09H8Xk9051668; Sat, 9 Jan 2016 17:08:33 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09H8XMW051667; Sat, 9 Jan 2016 17:08:33 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091708.u09H8XMW051667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293563 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:08:34 -0000 Author: dchagin Date: Sat Jan 9 17:08:33 2016 New Revision: 293563 URL: https://svnweb.freebsd.org/changeset/base/293563 Log: MFC r283461: As for now our tmpfs is no longer being considered "highly experimental" remove /dev/shm magic commited in r218497 and convert tmpfs type to an expected magic number. Modified: stable/10/sys/compat/linux/linux_stats.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_stats.c ============================================================================== --- stable/10/sys/compat/linux/linux_stats.c Sat Jan 9 17:07:17 2016 (r293562) +++ stable/10/sys/compat/linux/linux_stats.c Sat Jan 9 17:08:33 2016 (r293563) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define LINUX_SHMFS_MAGIC 0x01021994 static void translate_vnhook_major_minor(struct vnode *vp, struct stat *sb) @@ -352,6 +351,7 @@ struct l_statfs { #define LINUX_PROC_SUPER_MAGIC 0x9fa0L #define LINUX_UFS_SUPER_MAGIC 0x00011954L /* XXX - UFS_MAGIC in Linux */ #define LINUX_DEVFS_SUPER_MAGIC 0x1373L +#define LINUX_SHMFS_MAGIC 0x01021994 static long bsd_to_linux_ftype(const char *fstypename) @@ -369,6 +369,7 @@ bsd_to_linux_ftype(const char *fstypenam {"hpfs", LINUX_HPFS_SUPER_MAGIC}, {"coda", LINUX_CODA_SUPER_MAGIC}, {"devfs", LINUX_DEVFS_SUPER_MAGIC}, + {"tmpfs", LINUX_SHMFS_MAGIC}, {NULL, 0L}}; for (i = 0; b2l_tbl[i].bsd_name != NULL; i++) @@ -400,7 +401,7 @@ linux_statfs(struct thread *td, struct l struct l_statfs linux_statfs; struct statfs bsd_statfs; char *path; - int error, dev_shm; + int error; LCONVPATHEXIST(td, args->path, &path); @@ -408,17 +409,11 @@ linux_statfs(struct thread *td, struct l if (ldebug(statfs)) printf(ARGS(statfs, "%s, *"), path); #endif - dev_shm = 0; error = kern_statfs(td, path, UIO_SYSSPACE, &bsd_statfs); - if (strncmp(path, "/dev/shm", sizeof("/dev/shm") - 1) == 0) - dev_shm = (path[8] == '\0' - || (path[8] == '/' && path[9] == '\0')); LFREEPATH(path); if (error) return (error); bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); - if (dev_shm) - linux_statfs.f_type = LINUX_SHMFS_MAGIC; return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:09:19 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73616A689B4; Sat, 9 Jan 2016 17:09:19 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 343AF1984; Sat, 9 Jan 2016 17:09:18 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from chd.heemeyer.club ([78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id u09H9Ee5032273 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 9 Jan 2016 17:09:16 GMT (envelope-from dchagin@chd.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host [78.107.232.239] claimed to be chd.heemeyer.club Received: from chd.heemeyer.club (localhost [127.0.0.1]) by chd.heemeyer.club (8.15.2/8.15.1) with ESMTPS id u09H9CCx007505 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 9 Jan 2016 20:09:12 +0300 (MSK) (envelope-from dchagin@chd.heemeyer.club) Received: (from dchagin@localhost) by chd.heemeyer.club (8.15.2/8.15.1/Submit) id u09H9Crf007504; Sat, 9 Jan 2016 20:09:12 +0300 (MSK) (envelope-from dchagin) Date: Sat, 9 Jan 2016 20:09:12 +0300 From: Chagin Dmitry To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r293553 - stable/10/sys/compat/linux Message-ID: <20160109170912.GA7497@chd.heemeyer.club> References: <201601091657.u09Gv36q048082@repo.freebsd.org> <20160109170532.GL70867@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160109170532.GL70867@zxy.spb.ru> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:09:19 -0000 On Sat, Jan 09, 2016 at 08:05:32PM +0300, Slawa Olhovchenkov wrote: > On Sat, Jan 09, 2016 at 04:57:03PM +0000, Dmitry Chagin wrote: > > > Author: dchagin > > Date: Sat Jan 9 16:57:03 2016 > > New Revision: 293553 > > URL: https://svnweb.freebsd.org/changeset/base/293553 > > > > Log: > > MFC r283449: > > > > Update Linux compat revision to 32. > > Bump OSVERSION for net-im/skype4? > after full merge > > Modified: > > stable/10/sys/compat/linux/linux_mib.h > > Directory Properties: > > stable/10/ (props changed) > > > > Modified: stable/10/sys/compat/linux/linux_mib.h > > ============================================================================== > > --- stable/10/sys/compat/linux/linux_mib.h Sat Jan 9 16:55:44 2016 (r293552) > > +++ stable/10/sys/compat/linux/linux_mib.h Sat Jan 9 16:57:03 2016 (r293553) > > @@ -48,7 +48,7 @@ int linux_kernver(struct thread *td); > > > > #define LINUX_KVERSION 2 > > #define LINUX_KPATCHLEVEL 6 > > -#define LINUX_KSUBLEVEL 18 > > +#define LINUX_KSUBLEVEL 32 > > > > #define LINUX_KERNVER(a,b,c) (((a) << 16) + ((b) << 8) + (c)) > > #define LINUX_VERSION_CODE LINUX_KERNVER(LINUX_KVERSION, \ > > _______________________________________________ > > svn-src-all@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-all > > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Have fun! chd From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:10:23 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40538A68A54; Sat, 9 Jan 2016 17:10:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11E401ADD; Sat, 9 Jan 2016 17:10:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HAMnu051797; Sat, 9 Jan 2016 17:10:22 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HAMqs051796; Sat, 9 Jan 2016 17:10:22 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091710.u09HAMqs051796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293564 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:10:23 -0000 Author: dchagin Date: Sat Jan 9 17:10:22 2016 New Revision: 293564 URL: https://svnweb.freebsd.org/changeset/base/293564 Log: MFC r283462: Add prototypes for static futex functions. Modified: stable/10/sys/compat/linux/linux_futex.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_futex.c ============================================================================== --- stable/10/sys/compat/linux/linux_futex.c Sat Jan 9 17:08:33 2016 (r293563) +++ stable/10/sys/compat/linux/linux_futex.c Sat Jan 9 17:10:22 2016 (r293564) @@ -247,6 +247,21 @@ struct mtx futex_mtx; /* protects the * wp_list to prevent double wakeup. */ +static void futex_put(struct futex *, struct waiting_proc *); +static int futex_get0(uint32_t *, struct futex **f, uint32_t); +static int futex_get(uint32_t *, struct waiting_proc **, struct futex **, + uint32_t); +static int futex_sleep(struct futex *, struct waiting_proc *, int); +static int futex_wake(struct futex *, int, uint32_t); +static int futex_requeue(struct futex *, int, struct futex *, int); +static int futex_wait(struct futex *, struct waiting_proc *, int, + uint32_t); +static int futex_atomic_op(struct thread *, int, uint32_t *); +static int handle_futex_death(struct linux_emuldata *, uint32_t *, + unsigned int); +static int fetch_robust_entry(struct linux_robust_list **, + struct linux_robust_list **, unsigned int *); + /* support.s */ int futex_xchgl(int oparg, uint32_t *uaddr, int *oldval); int futex_addl(int oparg, uint32_t *uaddr, int *oldval); @@ -254,6 +269,7 @@ int futex_orl(int oparg, uint32_t *uaddr int futex_andl(int oparg, uint32_t *uaddr, int *oldval); int futex_xorl(int oparg, uint32_t *uaddr, int *oldval); + static void futex_put(struct futex *f, struct waiting_proc *wp) { From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:11:27 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 193B4A68AD9; Sat, 9 Jan 2016 17:11:27 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6A4E1CD6; Sat, 9 Jan 2016 17:11:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HBQRo054348; Sat, 9 Jan 2016 17:11:26 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HBP1a054344; Sat, 9 Jan 2016 17:11:25 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091711.u09HBP1a054344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293565 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:11:27 -0000 Author: dchagin Date: Sat Jan 9 17:11:25 2016 New Revision: 293565 URL: https://svnweb.freebsd.org/changeset/base/293565 Log: MFC r283463: Do not use struct l_timespec without conversion. While here move args->timeout handling before acquiring the futex key at FUTEX_WAIT path. Modified: stable/10/sys/compat/linux/linux_futex.c stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/linux/linux_time.c stable/10/sys/compat/linux/linux_timer.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_futex.c ============================================================================== --- stable/10/sys/compat/linux/linux_futex.c Sat Jan 9 17:10:22 2016 (r293564) +++ stable/10/sys/compat/linux/linux_futex.c Sat Jan 9 17:11:25 2016 (r293565) @@ -66,6 +66,7 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #include #include #include +#include #include /* DTrace init */ @@ -670,7 +671,8 @@ linux_sys_futex(struct thread *td, struc struct linux_pemuldata *pem; struct waiting_proc *wp; struct futex *f, *f2; - struct l_timespec timeout; + struct l_timespec ltimeout; + struct timespec timeout; struct timeval utv, ctv; int timeout_hz; int error; @@ -714,6 +716,38 @@ linux_sys_futex(struct thread *td, struc LINUX_CTR3(sys_futex, "WAIT uaddr %p val 0x%x bitset 0x%x", args->uaddr, args->val, args->val3); + if (args->timeout != NULL) { + error = copyin(args->timeout, <imeout, sizeof(ltimeout)); + if (error) { + LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, + error); + LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); + return (error); + } + error = linux_to_native_timespec(&timeout, <imeout); + if (error) + return (error); + TIMESPEC_TO_TIMEVAL(&utv, &timeout); + error = itimerfix(&utv); + if (error) { + LIN_SDT_PROBE1(futex, linux_sys_futex, itimerfix_error, + error); + LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); + return (error); + } + if (clockrt) { + microtime(&ctv); + timevalsub(&utv, &ctv); + } else if (args->op == LINUX_FUTEX_WAIT_BITSET) { + microuptime(&ctv); + timevalsub(&utv, &ctv); + } + if (utv.tv_sec < 0) + timevalclear(&utv); + timeout_hz = tvtohz(&utv); + } else + timeout_hz = 0; + error = futex_get(args->uaddr, &wp, &f, flags | FUTEX_CREATE_WP); if (error) { @@ -746,37 +780,6 @@ linux_sys_futex(struct thread *td, struc return (EWOULDBLOCK); } - if (args->timeout != NULL) { - error = copyin(args->timeout, &timeout, sizeof(timeout)); - if (error) { - LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, - error); - LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); - futex_put(f, wp); - return (error); - } - TIMESPEC_TO_TIMEVAL(&utv, &timeout); - error = itimerfix(&utv); - if (error) { - LIN_SDT_PROBE1(futex, linux_sys_futex, itimerfix_error, - error); - LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); - futex_put(f, wp); - return (error); - } - if (clockrt) { - microtime(&ctv); - timevalsub(&utv, &ctv); - } else if (args->op == LINUX_FUTEX_WAIT_BITSET) { - microuptime(&ctv); - timevalsub(&utv, &ctv); - } - if (utv.tv_sec < 0) - timevalclear(&utv); - timeout_hz = tvtohz(&utv); - } else - timeout_hz = 0; - error = futex_wait(f, wp, timeout_hz, args->val3); break; Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 17:10:22 2016 (r293564) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 17:11:25 2016 (r293565) @@ -89,6 +89,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2166,8 +2167,9 @@ linux_pselect6(struct thread *td, struct error = copyin(args->tsp, <s, sizeof(lts)); if (error != 0) return (error); - uts.tv_sec = lts.tv_sec; - uts.tv_nsec = lts.tv_nsec; + error = linux_to_native_timespec(&uts, <s); + if (error != 0) + return (error); TIMESPEC_TO_TIMEVAL(&utv, &uts); if (itimerfix(&utv)) @@ -2199,8 +2201,8 @@ linux_pselect6(struct thread *td, struct timevalclear(&utv); TIMEVAL_TO_TIMESPEC(&utv, &uts); - lts.tv_sec = uts.tv_sec; - lts.tv_nsec = uts.tv_nsec; + + native_to_linux_timespec(<s, &uts); error = copyout(<s, args->tsp, sizeof(lts)); } @@ -2232,8 +2234,9 @@ linux_ppoll(struct thread *td, struct li error = copyin(args->tsp, <s, sizeof(lts)); if (error) return (error); - uts.tv_sec = lts.tv_sec; - uts.tv_nsec = lts.tv_nsec; + error = linux_to_native_timespec(&uts, <s); + if (error != 0) + return (error); nanotime(&ts0); tsp = &uts; @@ -2252,8 +2255,7 @@ linux_ppoll(struct thread *td, struct li } else timespecclear(&uts); - lts.tv_sec = uts.tv_sec; - lts.tv_nsec = uts.tv_nsec; + native_to_linux_timespec(<s, &uts); error = copyout(<s, args->tsp, sizeof(lts)); } @@ -2341,8 +2343,7 @@ linux_sched_rr_get_interval(struct threa PROC_UNLOCK(tdt->td_proc); if (error != 0) return (error); - lts.tv_sec = ts.tv_sec; - lts.tv_nsec = ts.tv_nsec; + native_to_linux_timespec(<s, &ts); return (copyout(<s, uap->interval, sizeof(lts))); } Modified: stable/10/sys/compat/linux/linux_time.c ============================================================================== --- stable/10/sys/compat/linux/linux_time.c Sat Jan 9 17:10:22 2016 (r293564) +++ stable/10/sys/compat/linux/linux_time.c Sat Jan 9 17:11:25 2016 (r293565) @@ -120,13 +120,10 @@ LIN_SDT_PROBE_DEFINE1(time, linux_clock_ LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, unsupported_clockid, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, return, "int"); -static void native_to_linux_timespec(struct l_timespec *, - struct timespec *); -static int linux_to_native_timespec(struct timespec *, - struct l_timespec *); static int linux_to_native_clockid(clockid_t *, clockid_t); -static void + +void native_to_linux_timespec(struct l_timespec *ltp, struct timespec *ntp) { @@ -138,7 +135,7 @@ native_to_linux_timespec(struct l_timesp LIN_SDT_PROBE0(time, native_to_linux_timespec, return); } -static int +int linux_to_native_timespec(struct timespec *ntp, struct l_timespec *ltp) { Modified: stable/10/sys/compat/linux/linux_timer.h ============================================================================== --- stable/10/sys/compat/linux/linux_timer.h Sat Jan 9 17:10:22 2016 (r293564) +++ stable/10/sys/compat/linux/linux_timer.h Sat Jan 9 17:11:25 2016 (r293565) @@ -111,4 +111,9 @@ struct l_itimerspec { struct l_timespec it_value; }; +void native_to_linux_timespec(struct l_timespec *, + struct timespec *); +int linux_to_native_timespec(struct timespec *, + struct l_timespec *); + #endif /* _LINUX_TIMER_H */ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:12:46 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF2FCA68C9D; Sat, 9 Jan 2016 17:12:46 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 977CA1F83; Sat, 9 Jan 2016 17:12:46 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HCjOq054461; Sat, 9 Jan 2016 17:12:45 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HCjh2054458; Sat, 9 Jan 2016 17:12:45 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091712.u09HCjh2054458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293566 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:12:47 -0000 Author: dchagin Date: Sat Jan 9 17:12:45 2016 New Revision: 293566 URL: https://svnweb.freebsd.org/changeset/base/293566 Log: MFC r283464: Delete the duplicate of linux_to_native_clockid() function. Modified: stable/10/sys/compat/linux/linux_time.c stable/10/sys/compat/linux/linux_timer.c stable/10/sys/compat/linux/linux_timer.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_time.c ============================================================================== --- stable/10/sys/compat/linux/linux_time.c Sat Jan 9 17:11:25 2016 (r293565) +++ stable/10/sys/compat/linux/linux_time.c Sat Jan 9 17:12:45 2016 (r293566) @@ -120,8 +120,6 @@ LIN_SDT_PROBE_DEFINE1(time, linux_clock_ LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, unsupported_clockid, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, return, "int"); -static int linux_to_native_clockid(clockid_t *, clockid_t); - void native_to_linux_timespec(struct l_timespec *ltp, struct timespec *ntp) @@ -152,7 +150,7 @@ linux_to_native_timespec(struct timespec return (0); } -static int +int linux_to_native_clockid(clockid_t *n, clockid_t l) { Modified: stable/10/sys/compat/linux/linux_timer.c ============================================================================== --- stable/10/sys/compat/linux/linux_timer.c Sat Jan 9 17:11:25 2016 (r293565) +++ stable/10/sys/compat/linux/linux_timer.c Sat Jan 9 17:12:45 2016 (r293566) @@ -49,23 +49,6 @@ __FBSDID("$FreeBSD$"); #endif #include -static int -linux_convert_l_clockid(clockid_t *clock_id) -{ - - switch (*clock_id) { - case LINUX_CLOCK_REALTIME: - *clock_id = CLOCK_REALTIME; - break; - case LINUX_CLOCK_MONOTONIC: - *clock_id = CLOCK_MONOTONIC; - break; - default: - return (EINVAL); - } - - return (0); -} static int linux_convert_l_sigevent(struct l_sigevent *l_sig, struct sigevent *sig) @@ -106,6 +89,7 @@ linux_timer_create(struct thread *td, st { struct l_sigevent l_ev; struct sigevent ev, *evp; + clockid_t nwhich; int error, id; if (uap->evp == NULL) { @@ -119,10 +103,10 @@ linux_timer_create(struct thread *td, st return (error); evp = &ev; } - error = linux_convert_l_clockid(&uap->clock_id); + error = linux_to_native_clockid(&nwhich, uap->clock_id); if (error != 0) return (error); - error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1); + error = kern_ktimer_create(td, nwhich, evp, &id, -1); if (error == 0) { error = copyout(&id, uap->timerid, sizeof(int)); if (error != 0) @@ -179,4 +163,3 @@ linux_timer_delete(struct thread *td, st return (kern_ktimer_delete(td, uap->timerid)); } - Modified: stable/10/sys/compat/linux/linux_timer.h ============================================================================== --- stable/10/sys/compat/linux/linux_timer.h Sat Jan 9 17:11:25 2016 (r293565) +++ stable/10/sys/compat/linux/linux_timer.h Sat Jan 9 17:12:45 2016 (r293566) @@ -115,5 +115,6 @@ void native_to_linux_timespec(struct l_t struct timespec *); int linux_to_native_timespec(struct timespec *, struct l_timespec *); +int linux_to_native_clockid(clockid_t *, clockid_t); #endif /* _LINUX_TIMER_H */ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:13:44 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F285AA68D0F; Sat, 9 Jan 2016 17:13:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4CFE110D; Sat, 9 Jan 2016 17:13:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HDhTQ054566; Sat, 9 Jan 2016 17:13:43 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HDhZK054558; Sat, 9 Jan 2016 17:13:43 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091713.u09HDhZK054558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293567 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:13:45 -0000 Author: dchagin Date: Sat Jan 9 17:13:43 2016 New Revision: 293567 URL: https://svnweb.freebsd.org/changeset/base/293567 Log: MFC r283465: Add preliminary fallocate system call implementation to emulate posix_fallocate() function. Modified: stable/10/sys/amd64/linux/linux_dummy.c stable/10/sys/amd64/linux/syscalls.master stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_file.c stable/10/sys/i386/linux/linux_dummy.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 17:12:45 2016 (r293566) +++ stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 17:13:43 2016 (r293567) @@ -102,7 +102,6 @@ DUMMY(utimensat); DUMMY(epoll_pwait); DUMMY(signalfd); DUMMY(timerfd); -DUMMY(fallocate); DUMMY(timerfd_settime); DUMMY(timerfd_gettime); DUMMY(signalfd4); Modified: stable/10/sys/amd64/linux/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 17:12:45 2016 (r293566) +++ stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 17:13:43 2016 (r293567) @@ -474,7 +474,8 @@ 282 AUE_NULL STD { int linux_signalfd(void); } 283 AUE_NULL STD { int linux_timerfd(void); } 284 AUE_NULL STD { int linux_eventfd(l_uint initval); } -285 AUE_NULL STD { int linux_fallocate(void); } +285 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \ + l_loff_t offset, l_loff_t len); } 286 AUE_NULL STD { int linux_timerfd_settime(void); } 287 AUE_NULL STD { int linux_timerfd_gettime(void); } 288 AUE_ACCEPT STD { int linux_accept4(l_int s, l_uintptr_t addr, \ Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 17:12:45 2016 (r293566) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 17:13:43 2016 (r293567) @@ -108,8 +108,6 @@ DUMMY(epoll_pwait); DUMMY(utimensat); DUMMY(signalfd); DUMMY(timerfd_create); -/* linux 2.6.23: */ -DUMMY(fallocate); /* linux 2.6.25: */ DUMMY(timerfd_settime); DUMMY(timerfd_gettime); Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 17:12:45 2016 (r293566) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 17:13:43 2016 (r293567) @@ -538,7 +538,8 @@ 322 AUE_NULL STD { int linux_timerfd_create(void); } 323 AUE_NULL STD { int linux_eventfd(l_uint initval); } ; linux 2.6.23: -324 AUE_NULL STD { int linux_fallocate(void); } +324 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \ + l_loff_t offset, l_loff_t len); } ; linux 2.6.25: 325 AUE_NULL STD { int linux_timerfd_settime(void); } 326 AUE_NULL STD { int linux_timerfd_gettime(void); } Modified: stable/10/sys/compat/linux/linux_file.c ============================================================================== --- stable/10/sys/compat/linux/linux_file.c Sat Jan 9 17:12:45 2016 (r293566) +++ stable/10/sys/compat/linux/linux_file.c Sat Jan 9 17:13:43 2016 (r293567) @@ -1628,3 +1628,18 @@ linux_dup3(struct thread *td, struct lin newfd = args->newfd; return (kern_fcntl(td, args->oldfd, cmd, newfd)); } + +int +linux_fallocate(struct thread *td, struct linux_fallocate_args *args) +{ + + /* + * We emulate only posix_fallocate system call for which + * mode should be 0. + */ + if (args->mode != 0) + return (ENOSYS); + + return (kern_posix_fallocate(td, args->fd, args->offset, + args->len)); +} Modified: stable/10/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 17:12:45 2016 (r293566) +++ stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 17:13:43 2016 (r293567) @@ -104,8 +104,6 @@ DUMMY(epoll_pwait); DUMMY(utimensat); DUMMY(signalfd); DUMMY(timerfd_create); -/* linux 2.6.23: */ -DUMMY(fallocate); /* linux 2.6.25: */ DUMMY(timerfd_settime); DUMMY(timerfd_gettime); Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 17:12:45 2016 (r293566) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 17:13:43 2016 (r293567) @@ -546,7 +546,8 @@ 322 AUE_NULL STD { int linux_timerfd_create(void); } 323 AUE_NULL STD { int linux_eventfd(l_uint initval); } ; linux 2.6.23: -324 AUE_NULL STD { int linux_fallocate(void); } +324 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \ + l_loff_t offset, l_loff_t len); } ; linux 2.6.25: 325 AUE_NULL STD { int linux_timerfd_settime(void); } 326 AUE_NULL STD { int linux_timerfd_gettime(void); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:15:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30957A68DAF; Sat, 9 Jan 2016 17:15:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDC6112CB; Sat, 9 Jan 2016 17:15:05 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HF5DY054705; Sat, 9 Jan 2016 17:15:05 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HF3tw054689; Sat, 9 Jan 2016 17:15:03 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091715.u09HF3tw054689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293568 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:15:06 -0000 Author: dchagin Date: Sat Jan 9 17:15:03 2016 New Revision: 293568 URL: https://svnweb.freebsd.org/changeset/base/293568 Log: Regen for r293567. Modified: stable/10/sys/amd64/linux/linux_proto.h stable/10/sys/amd64/linux/linux_syscall.h stable/10/sys/amd64/linux/linux_syscalls.c stable/10/sys/amd64/linux/linux_sysent.c stable/10/sys/amd64/linux/linux_systrace_args.c stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 17:15:03 2016 (r293568) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1004,7 +1004,10 @@ struct linux_eventfd_args { char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)]; }; struct linux_fallocate_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; }; struct linux_timerfd_settime_args { register_t dummy; Modified: stable/10/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 17:15:03 2016 (r293568) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin */ #define LINUX_SYS_read 0 Modified: stable/10/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 17:15:03 2016 (r293568) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 17:15:03 2016 (r293568) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin */ #include @@ -303,7 +303,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 282 = linux_signalfd */ { 0, (sy_call_t *)linux_timerfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_timerfd */ { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_eventfd */ - { 0, (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 285 = linux_fallocate */ + { AS(linux_fallocate_args), (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 285 = linux_fallocate */ { 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 286 = linux_timerfd_settime */ { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 287 = linux_timerfd_gettime */ { AS(linux_accept4_args), (sy_call_t *)linux_accept4, AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 288 = linux_accept4 */ Modified: stable/10/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 17:15:03 2016 (r293568) @@ -2085,7 +2085,12 @@ systrace_args(int sysnum, void *params, } /* linux_fallocate */ case 285: { - *n_args = 0; + struct linux_fallocate_args *p = params; + iarg[0] = p->fd; /* l_int */ + iarg[1] = p->mode; /* l_int */ + iarg[2] = p->offset; /* l_loff_t */ + iarg[3] = p->len; /* l_loff_t */ + *n_args = 4; break; } /* linux_timerfd_settime */ @@ -5391,6 +5396,22 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_fallocate */ case 285: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "l_loff_t"; + break; + case 3: + p = "l_loff_t"; + break; + default: + break; + }; break; /* linux_timerfd_settime */ case 286: @@ -6693,6 +6714,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_fallocate */ case 285: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_timerfd_settime */ case 286: /* linux_timerfd_gettime */ Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 17:15:03 2016 (r293568) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293555 2016-01-09 16:58:57Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293567 2016-01-09 17:13:43Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1064,7 +1064,10 @@ struct linux_eventfd_args { char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)]; }; struct linux_fallocate_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; }; struct linux_timerfd_settime_args { register_t dummy; Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 17:15:03 2016 (r293568) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293555 2016-01-09 16:58:57Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293567 2016-01-09 17:13:43Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 17:15:03 2016 (r293568) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293555 2016-01-09 16:58:57Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293567 2016-01-09 17:13:43Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 17:15:03 2016 (r293568) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293555 2016-01-09 16:58:57Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293567 2016-01-09 17:13:43Z dchagin */ #include "opt_compat.h" @@ -343,7 +343,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */ { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */ - { 0, (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */ + { AS(linux_fallocate_args), (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */ { 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_timerfd_settime */ { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */ { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 17:15:03 2016 (r293568) @@ -2192,7 +2192,12 @@ systrace_args(int sysnum, void *params, } /* linux_fallocate */ case 324: { - *n_args = 0; + struct linux_fallocate_args *p = params; + iarg[0] = p->fd; /* l_int */ + iarg[1] = p->mode; /* l_int */ + iarg[2] = p->offset; /* l_loff_t */ + iarg[3] = p->len; /* l_loff_t */ + *n_args = 4; break; } /* linux_timerfd_settime */ @@ -5598,6 +5603,22 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_fallocate */ case 324: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "l_loff_t"; + break; + case 3: + p = "l_loff_t"; + break; + default: + break; + }; break; /* linux_timerfd_settime */ case 325: @@ -6956,6 +6977,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_fallocate */ case 324: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_timerfd_settime */ case 325: /* linux_timerfd_gettime */ Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 17:15:03 2016 (r293568) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1082,7 +1082,10 @@ struct linux_eventfd_args { char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)]; }; struct linux_fallocate_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; }; struct linux_timerfd_settime_args { register_t dummy; Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 17:15:03 2016 (r293568) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 17:15:03 2016 (r293568) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 17:15:03 2016 (r293568) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293555 2016-01-09 16:58:57Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin */ #include @@ -342,7 +342,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */ { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */ - { 0, (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */ + { AS(linux_fallocate_args), (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */ { 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_timerfd_settime */ { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */ { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 17:13:43 2016 (r293567) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 17:15:03 2016 (r293568) @@ -2268,7 +2268,12 @@ systrace_args(int sysnum, void *params, } /* linux_fallocate */ case 324: { - *n_args = 0; + struct linux_fallocate_args *p = params; + iarg[0] = p->fd; /* l_int */ + iarg[1] = p->mode; /* l_int */ + iarg[2] = p->offset; /* l_loff_t */ + iarg[3] = p->len; /* l_loff_t */ + *n_args = 4; break; } /* linux_timerfd_settime */ @@ -5829,6 +5834,22 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_fallocate */ case 324: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "l_loff_t"; + break; + case 3: + p = "l_loff_t"; + break; + default: + break; + }; break; /* linux_timerfd_settime */ case 325: @@ -7234,6 +7255,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_fallocate */ case 324: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_timerfd_settime */ case 325: /* linux_timerfd_gettime */ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:18:05 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A34B3A68EDF; Sat, 9 Jan 2016 17:18:05 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 810F015EA; Sat, 9 Jan 2016 17:18:05 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HI4w2054864; Sat, 9 Jan 2016 17:18:04 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HI4b5054858; Sat, 9 Jan 2016 17:18:04 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091718.u09HI4b5054858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293569 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:18:05 -0000 Author: dchagin Date: Sat Jan 9 17:18:03 2016 New Revision: 293569 URL: https://svnweb.freebsd.org/changeset/base/293569 Log: MFC r283467: Call nosys in case when the incorrect syscall number is specified. Its my fault, fixed by mjg@ at r289055. Modified: stable/10/sys/amd64/linux/linux_sysvec.c stable/10/sys/amd64/linux/syscalls.master stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/i386/linux/linux_sysvec.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysvec.c Sat Jan 9 17:15:03 2016 (r293568) +++ stable/10/sys/amd64/linux/linux_sysvec.c Sat Jan 9 17:18:03 2016 (r293569) @@ -254,10 +254,10 @@ linux_fetch_syscall_args(struct thread * sa->args[5] = frame->tf_r9; sa->code = frame->tf_rax; - if (sa->code >= p->p_sysent->sv_size) { - PROC_LOCK(p); - sigexit(td, SIGILL); - } else + if (sa->code >= p->p_sysent->sv_size) + /* nosys */ + sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL]; + else sa->callp = &p->p_sysent->sv_table[sa->code]; sa->narg = sa->callp->sy_narg; Modified: stable/10/sys/amd64/linux/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 17:15:03 2016 (r293568) +++ stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 17:18:03 2016 (r293569) @@ -506,3 +506,5 @@ 310 AUE_NULL STD { int linux_process_vm_writev(void); } 311 AUE_NULL STD { int linux_kcmp(void); } 312 AUE_NULL STD { int linux_finit_module(void); } +; please, keep this line at the end. +313 AUE_NULL UNIMPL nosys Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 17:15:03 2016 (r293568) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 17:18:03 2016 (r293569) @@ -764,7 +764,8 @@ linux32_fetch_syscall_args(struct thread sa->code = frame->tf_rax; if (sa->code >= p->p_sysent->sv_size) - sa->callp = &p->p_sysent->sv_table[0]; + /* nosys */ + sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL]; else sa->callp = &p->p_sysent->sv_table[sa->code]; sa->narg = sa->callp->sy_narg; Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 17:15:03 2016 (r293568) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 17:18:03 2016 (r293569) @@ -575,3 +575,5 @@ 346 AUE_NULL STD { int linux_setns(void); } 347 AUE_NULL STD { int linux_process_vm_readv(void); } 348 AUE_NULL STD { int linux_process_vm_writev(void); } +; please, keep this line at the end. +349 AUE_NULL UNIMPL nosys Modified: stable/10/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysvec.c Sat Jan 9 17:15:03 2016 (r293568) +++ stable/10/sys/i386/linux/linux_sysvec.c Sat Jan 9 17:18:03 2016 (r293569) @@ -890,7 +890,8 @@ linux_fetch_syscall_args(struct thread * sa->args[5] = frame->tf_ebp; /* Unconfirmed */ if (sa->code >= p->p_sysent->sv_size) - sa->callp = &p->p_sysent->sv_table[0]; + /* nosys */ + sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL]; else sa->callp = &p->p_sysent->sv_table[sa->code]; sa->narg = sa->callp->sy_narg; Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 17:15:03 2016 (r293568) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 17:18:03 2016 (r293569) @@ -583,3 +583,5 @@ 346 AUE_NULL STD { int linux_setns(void); } 347 AUE_NULL STD { int linux_process_vm_readv(void); } 348 AUE_NULL STD { int linux_process_vm_writev(void); } +; please, keep this line at the end. +349 AUE_NULL UNIMPL nosys From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:20:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20E09A68FB8; Sat, 9 Jan 2016 17:20:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D77A81835; Sat, 9 Jan 2016 17:20:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HKKNw055011; Sat, 9 Jan 2016 17:20:20 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HKJkx054998; Sat, 9 Jan 2016 17:20:19 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091720.u09HKJkx054998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293570 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:20:22 -0000 Author: dchagin Date: Sat Jan 9 17:20:19 2016 New Revision: 293570 URL: https://svnweb.freebsd.org/changeset/base/293570 Log: Regen for r293569. Modified: stable/10/sys/amd64/linux/linux_proto.h stable/10/sys/amd64/linux/linux_syscall.h stable/10/sys/amd64/linux/linux_syscalls.c stable/10/sys/amd64/linux/linux_sysent.c stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c Modified: stable/10/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 17:18:03 2016 (r293569) +++ stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 17:20:19 2016 (r293570) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ Modified: stable/10/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 17:18:03 2016 (r293569) +++ stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 17:20:19 2016 (r293570) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin */ #define LINUX_SYS_read 0 @@ -307,4 +307,4 @@ #define LINUX_SYS_linux_process_vm_writev 310 #define LINUX_SYS_linux_kcmp 311 #define LINUX_SYS_linux_finit_module 312 -#define LINUX_SYS_MAXSYSCALL 313 +#define LINUX_SYS_MAXSYSCALL 314 Modified: stable/10/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 17:18:03 2016 (r293569) +++ stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 17:20:19 2016 (r293570) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin */ const char *linux_syscallnames[] = { @@ -321,4 +321,5 @@ const char *linux_syscallnames[] = { "linux_process_vm_writev", /* 310 = linux_process_vm_writev */ "linux_kcmp", /* 311 = linux_kcmp */ "linux_finit_module", /* 312 = linux_finit_module */ + "#313", /* 313 = nosys */ }; Modified: stable/10/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 17:18:03 2016 (r293569) +++ stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 17:20:19 2016 (r293570) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin */ #include @@ -331,4 +331,5 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_process_vm_writev */ { 0, (sy_call_t *)linux_kcmp, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_kcmp */ { 0, (sy_call_t *)linux_finit_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = linux_finit_module */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 313 = nosys */ }; Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 17:18:03 2016 (r293569) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 17:20:19 2016 (r293570) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293567 2016-01-09 17:13:43Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293569 2016-01-09 17:18:03Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 17:18:03 2016 (r293569) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 17:20:19 2016 (r293570) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293567 2016-01-09 17:13:43Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293569 2016-01-09 17:18:03Z dchagin */ #define LINUX_SYS_linux_exit 1 @@ -321,4 +321,4 @@ #define LINUX_SYS_linux_setns 346 #define LINUX_SYS_linux_process_vm_readv 347 #define LINUX_SYS_linux_process_vm_writev 348 -#define LINUX_SYS_MAXSYSCALL 349 +#define LINUX_SYS_MAXSYSCALL 350 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 17:18:03 2016 (r293569) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 17:20:19 2016 (r293570) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293567 2016-01-09 17:13:43Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293569 2016-01-09 17:18:03Z dchagin */ const char *linux_syscallnames[] = { @@ -357,4 +357,5 @@ const char *linux_syscallnames[] = { "linux_setns", /* 346 = linux_setns */ "linux_process_vm_readv", /* 347 = linux_process_vm_readv */ "linux_process_vm_writev", /* 348 = linux_process_vm_writev */ + "#349", /* 349 = nosys */ }; Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 17:18:03 2016 (r293569) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 17:20:19 2016 (r293570) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293567 2016-01-09 17:13:43Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293569 2016-01-09 17:18:03Z dchagin */ #include "opt_compat.h" @@ -368,4 +368,5 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 346 = linux_setns */ { 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = linux_process_vm_readv */ { 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = linux_process_vm_writev */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 349 = nosys */ }; Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 17:18:03 2016 (r293569) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 17:20:19 2016 (r293570) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 17:18:03 2016 (r293569) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 17:20:19 2016 (r293570) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin */ #define LINUX_SYS_linux_exit 1 @@ -328,4 +328,4 @@ #define LINUX_SYS_linux_setns 346 #define LINUX_SYS_linux_process_vm_readv 347 #define LINUX_SYS_linux_process_vm_writev 348 -#define LINUX_SYS_MAXSYSCALL 349 +#define LINUX_SYS_MAXSYSCALL 350 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 17:18:03 2016 (r293569) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 17:20:19 2016 (r293570) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin */ const char *linux_syscallnames[] = { @@ -357,4 +357,5 @@ const char *linux_syscallnames[] = { "linux_setns", /* 346 = linux_setns */ "linux_process_vm_readv", /* 347 = linux_process_vm_readv */ "linux_process_vm_writev", /* 348 = linux_process_vm_writev */ + "#349", /* 349 = nosys */ }; Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 17:18:03 2016 (r293569) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 17:20:19 2016 (r293570) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293567 2016-01-09 17:13:43Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin */ #include @@ -367,4 +367,5 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 346 = linux_setns */ { 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = linux_process_vm_readv */ { 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = linux_process_vm_writev */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 349 = nosys */ }; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:21:30 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D7D5A69037; Sat, 9 Jan 2016 17:21:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00E5F1A44; Sat, 9 Jan 2016 17:21:29 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HLTqE055717; Sat, 9 Jan 2016 17:21:29 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HLSZi055715; Sat, 9 Jan 2016 17:21:28 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091721.u09HLSZi055715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293571 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:21:30 -0000 Author: dchagin Date: Sat Jan 9 17:21:28 2016 New Revision: 293571 URL: https://svnweb.freebsd.org/changeset/base/293571 Log: MFC r283470: Add EPOLLERR flag handling to epoll. Modified: stable/10/sys/compat/linux/linux_event.c stable/10/sys/compat/linux/linux_event.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_event.c ============================================================================== --- stable/10/sys/compat/linux/linux_event.c Sat Jan 9 17:20:19 2016 (r293570) +++ stable/10/sys/compat/linux/linux_event.c Sat Jan 9 17:21:28 2016 (r293571) @@ -255,6 +255,8 @@ epoll_to_kevent(struct thread *td, struc *kev_flags |= EV_ONESHOT; if ((levents & LINUX_EPOLLET) != 0) *kev_flags |= EV_CLEAR; + if ((levents & LINUX_EPOLLERR) != 0) + *kev_flags |= EV_ERROR; /* flags related to what event is registered */ if ((levents & LINUX_EPOLL_EVRD) != 0) { @@ -296,8 +298,10 @@ static void kevent_to_epoll(struct kevent *kevent, struct epoll_event *l_event) { - if ((kevent->flags & EV_ERROR) != 0) + if ((kevent->flags & EV_ERROR) != 0) { + l_event->events = LINUX_EPOLLERR; return; + } switch (kevent->filter) { case EVFILT_READ: Modified: stable/10/sys/compat/linux/linux_event.h ============================================================================== --- stable/10/sys/compat/linux/linux_event.h Sat Jan 9 17:20:19 2016 (r293570) +++ stable/10/sys/compat/linux/linux_event.h Sat Jan 9 17:21:28 2016 (r293571) @@ -46,7 +46,7 @@ #define LINUX_EPOLLET 1u<<31 #define LINUX_EPOLL_EVRD (LINUX_EPOLLIN|LINUX_EPOLLRDNORM \ - |LINUX_EPOLLHUP|LINUX_EPOLLPRI) + |LINUX_EPOLLHUP|LINUX_EPOLLERR|LINUX_EPOLLPRI) #define LINUX_EPOLL_EVWR (LINUX_EPOLLOUT|LINUX_EPOLLWRNORM) #define LINUX_EPOLL_EVSUP (LINUX_EPOLLET|LINUX_EPOLLONESHOT \ |LINUX_EPOLL_EVRD|LINUX_EPOLL_EVWR) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:22:53 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 622D4A69195; Sat, 9 Jan 2016 17:22:53 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F7B61D04; Sat, 9 Jan 2016 17:22:53 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HMqNC057774; Sat, 9 Jan 2016 17:22:52 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HMpiU057766; Sat, 9 Jan 2016 17:22:51 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091722.u09HMpiU057766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293572 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:22:53 -0000 Author: dchagin Date: Sat Jan 9 17:22:51 2016 New Revision: 293572 URL: https://svnweb.freebsd.org/changeset/base/293572 Log: MFC r283471: According to Linux man sigaltstack(3) shall return EINVAL if the ss argument is not a null pointer, and the ss_flags member pointed to by ss contains flags other than SS_DISABLE. However, in fact, Linux also allows SS_ONSTACK flag which is simply ignored. For buggy apps (at least mono) ignore other than SS_DISABLE flags as a Linux do. While here move MI part of sigaltstack code to the appropriate place. Modified: stable/10/sys/amd64/linux/linux.h stable/10/sys/amd64/linux/linux_machdep.c stable/10/sys/amd64/linux32/linux.h stable/10/sys/amd64/linux32/linux32_machdep.c stable/10/sys/compat/linux/linux_signal.c stable/10/sys/compat/linux/linux_signal.h stable/10/sys/i386/linux/linux.h stable/10/sys/i386/linux/linux_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux.h ============================================================================== --- stable/10/sys/amd64/linux/linux.h Sat Jan 9 17:21:28 2016 (r293571) +++ stable/10/sys/amd64/linux/linux.h Sat Jan 9 17:22:51 2016 (r293572) @@ -250,9 +250,6 @@ struct l_newstat { #define LINUX_SS_ONSTACK 1 #define LINUX_SS_DISABLE 2 -int linux_to_bsd_sigaltstack(int lsa); -int bsd_to_linux_sigaltstack(int bsa); - typedef void (*l_handler_t)(l_int); typedef struct { Modified: stable/10/sys/amd64/linux/linux_machdep.c ============================================================================== --- stable/10/sys/amd64/linux/linux_machdep.c Sat Jan 9 17:21:28 2016 (r293571) +++ stable/10/sys/amd64/linux/linux_machdep.c Sat Jan 9 17:22:51 2016 (r293572) @@ -87,29 +87,6 @@ __FBSDID("$FreeBSD$"); #include #include -int -linux_to_bsd_sigaltstack(int lsa) -{ - int bsa = 0; - - if (lsa & LINUX_SS_DISABLE) - bsa |= SS_DISABLE; - if (lsa & LINUX_SS_ONSTACK) - bsa |= SS_ONSTACK; - return (bsa); -} - -int -bsd_to_linux_sigaltstack(int bsa) -{ - int lsa = 0; - - if (bsa & SS_DISABLE) - lsa |= LINUX_SS_DISABLE; - if (bsa & SS_ONSTACK) - lsa |= LINUX_SS_ONSTACK; - return (lsa); -} int linux_execve(struct thread *td, struct linux_execve_args *args) Modified: stable/10/sys/amd64/linux32/linux.h ============================================================================== --- stable/10/sys/amd64/linux32/linux.h Sat Jan 9 17:21:28 2016 (r293571) +++ stable/10/sys/amd64/linux32/linux.h Sat Jan 9 17:22:51 2016 (r293572) @@ -328,9 +328,6 @@ struct l_statfs64 { #define LINUX_SS_ONSTACK 1 #define LINUX_SS_DISABLE 2 -int linux_to_bsd_sigaltstack(int lsa); -int bsd_to_linux_sigaltstack(int bsa); - typedef l_uintptr_t l_handler_t; typedef l_ulong l_osigset_t; Modified: stable/10/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 17:21:28 2016 (r293571) +++ stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 17:22:51 2016 (r293572) @@ -84,34 +84,10 @@ struct l_old_select_argv { l_uintptr_t timeout; } __packed; -int -linux_to_bsd_sigaltstack(int lsa) -{ - int bsa = 0; - - if (lsa & LINUX_SS_DISABLE) - bsa |= SS_DISABLE; - if (lsa & LINUX_SS_ONSTACK) - bsa |= SS_ONSTACK; - return (bsa); -} - static int linux_mmap_common(struct thread *td, l_uintptr_t addr, l_size_t len, l_int prot, l_int flags, l_int fd, l_loff_t pos); -int -bsd_to_linux_sigaltstack(int bsa) -{ - int lsa = 0; - - if (bsa & SS_DISABLE) - lsa |= LINUX_SS_DISABLE; - if (bsa & SS_ONSTACK) - lsa |= LINUX_SS_ONSTACK; - return (lsa); -} - static void bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru) { Modified: stable/10/sys/compat/linux/linux_signal.c ============================================================================== --- stable/10/sys/compat/linux/linux_signal.c Sat Jan 9 17:21:28 2016 (r293571) +++ stable/10/sys/compat/linux/linux_signal.c Sat Jan 9 17:22:51 2016 (r293572) @@ -754,6 +754,32 @@ siginfo_to_lsiginfo(const siginfo_t *si, } } +int +linux_to_bsd_sigaltstack(int lsa) +{ + int bsa = 0; + + if (lsa & LINUX_SS_DISABLE) + bsa |= SS_DISABLE; + /* + * Linux ignores SS_ONSTACK flag for ss + * parameter while FreeBSD prohibits it. + */ + return (bsa); +} + +int +bsd_to_linux_sigaltstack(int bsa) +{ + int lsa = 0; + + if (bsa & SS_DISABLE) + lsa |= LINUX_SS_DISABLE; + if (bsa & SS_ONSTACK) + lsa |= LINUX_SS_ONSTACK; + return (lsa); +} + void lsiginfo_to_ksiginfo(const l_siginfo_t *lsi, ksiginfo_t *ksi, int sig) { Modified: stable/10/sys/compat/linux/linux_signal.h ============================================================================== --- stable/10/sys/compat/linux/linux_signal.h Sat Jan 9 17:21:28 2016 (r293571) +++ stable/10/sys/compat/linux/linux_signal.h Sat Jan 9 17:22:51 2016 (r293572) @@ -46,6 +46,8 @@ extern int bsd_to_linux_signal[]; extern int linux_to_bsd_signal[]; +int linux_to_bsd_sigaltstack(int lsa); +int bsd_to_linux_sigaltstack(int bsa); void linux_to_bsd_sigset(l_sigset_t *, sigset_t *); void bsd_to_linux_sigset(sigset_t *, l_sigset_t *); int linux_do_sigaction(struct thread *, int, l_sigaction_t *, l_sigaction_t *); Modified: stable/10/sys/i386/linux/linux.h ============================================================================== --- stable/10/sys/i386/linux/linux.h Sat Jan 9 17:21:28 2016 (r293571) +++ stable/10/sys/i386/linux/linux.h Sat Jan 9 17:22:51 2016 (r293572) @@ -303,9 +303,6 @@ struct l_statfs64 { #define LINUX_SS_ONSTACK 1 #define LINUX_SS_DISABLE 2 -int linux_to_bsd_sigaltstack(int lsa); -int bsd_to_linux_sigaltstack(int bsa); - typedef void (*l_handler_t)(l_int); typedef l_ulong l_osigset_t; Modified: stable/10/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/10/sys/i386/linux/linux_machdep.c Sat Jan 9 17:21:28 2016 (r293571) +++ stable/10/sys/i386/linux/linux_machdep.c Sat Jan 9 17:22:51 2016 (r293572) @@ -99,29 +99,6 @@ static int linux_mmap_common(struct thre l_size_t len, l_int prot, l_int flags, l_int fd, l_loff_t pos); -int -linux_to_bsd_sigaltstack(int lsa) -{ - int bsa = 0; - - if (lsa & LINUX_SS_DISABLE) - bsa |= SS_DISABLE; - if (lsa & LINUX_SS_ONSTACK) - bsa |= SS_ONSTACK; - return (bsa); -} - -int -bsd_to_linux_sigaltstack(int bsa) -{ - int lsa = 0; - - if (bsa & SS_DISABLE) - lsa |= LINUX_SS_DISABLE; - if (bsa & SS_ONSTACK) - lsa |= LINUX_SS_ONSTACK; - return (lsa); -} int linux_execve(struct thread *td, struct linux_execve_args *args) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:23:58 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65141A69219; Sat, 9 Jan 2016 17:23:58 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E4E21E58; Sat, 9 Jan 2016 17:23:58 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HNvZc057881; Sat, 9 Jan 2016 17:23:57 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HNv1X057880; Sat, 9 Jan 2016 17:23:57 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091723.u09HNv1X057880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293573 - stable/10/sys/compat/linprocfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:23:58 -0000 Author: dchagin Date: Sat Jan 9 17:23:57 2016 New Revision: 293573 URL: https://svnweb.freebsd.org/changeset/base/293573 Log: MFC r283472: Add vdso and stack names to the /proc/self/maps. Modified: stable/10/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/10/sys/compat/linprocfs/linprocfs.c Sat Jan 9 17:22:51 2016 (r293572) +++ stable/10/sys/compat/linprocfs/linprocfs.c Sat Jan 9 17:23:57 2016 (r293573) @@ -961,6 +961,8 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) static char l32_map_str[] = "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n"; static char l64_map_str[] = "%016lx-%016lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n"; +static char vdso_str[] = " [vdso]"; +static char stack_str[] = " [stack]"; /* * Filler function for proc/pid/maps @@ -997,6 +999,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) vm = vmspace_acquire_ref(p); if (vm == NULL) return (ESRCH); + + if (SV_CURPROC_FLAG(SV_LP64)) + l_map_str = l64_map_str; + else + l_map_str = l32_map_str; map = &vm->vm_map; vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; @@ -1035,6 +1042,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) VOP_GETATTR(vp, &vat, td->td_ucred); ino = vat.va_fileid; vput(vp); + } else if (SV_PROC_ABI(p) == SV_ABI_LINUX) { + if (e_start == p->p_sysent->sv_shared_page_base) + name = vdso_str; + if (e_end == p->p_sysent->sv_usrstack) + name = stack_str; } } else { flags = 0; @@ -1046,10 +1058,6 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) * format: * start, end, access, offset, major, minor, inode, name. */ - if (SV_CURPROC_FLAG(SV_LP64)) - l_map_str = l64_map_str; - else - l_map_str = l32_map_str; error = sbuf_printf(sb, l_map_str, (u_long)e_start, (u_long)e_end, (e_prot & VM_PROT_READ)?"r":"-", From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:27:37 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94CA0A69367; Sat, 9 Jan 2016 17:27:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 499221FEB; Sat, 9 Jan 2016 17:27:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HRaLZ058120; Sat, 9 Jan 2016 17:27:36 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HRa76058119; Sat, 9 Jan 2016 17:27:36 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091727.u09HRa76058119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293574 - stable/10/sys/compat/linprocfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:27:37 -0000 Author: dchagin Date: Sat Jan 9 17:27:36 2016 New Revision: 293574 URL: https://svnweb.freebsd.org/changeset/base/293574 Log: MFC r283473: Add support for /proc//auxv. Modified: stable/10/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/10/sys/compat/linprocfs/linprocfs.c Sat Jan 9 17:23:57 2016 (r293573) +++ stable/10/sys/compat/linprocfs/linprocfs.c Sat Jan 9 17:27:36 2016 (r293574) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1364,6 +1366,52 @@ linprocfs_douuid(PFS_FILL_ARGS) return(0); } +/* + * Filler function for proc/pid/auxv + */ +static int +linprocfs_doauxv(PFS_FILL_ARGS) +{ + struct sbuf *asb; + off_t buflen, resid; + int error; + + /* + * Mimic linux behavior and pass only processes with usermode + * address space as valid. Return zero silently otherwise. + */ + if (p->p_vmspace == &vmspace0) + return (0); + + if (uio->uio_resid == 0) + return (0); + if (uio->uio_offset < 0 || uio->uio_resid < 0) + return (EINVAL); + + asb = sbuf_new_auto(); + if (asb == NULL) + return (ENOMEM); + error = proc_getauxv(td, p, asb); + if (error == 0) + error = sbuf_finish(asb); + + resid = sbuf_len(asb) - uio->uio_offset; + if (resid > uio->uio_resid) + buflen = uio->uio_resid; + else + buflen = resid; + if (buflen > IOSIZE_MAX) + return (EINVAL); + if (buflen > MAXPHYS) + buflen = MAXPHYS; + if (resid <= 0) + return (0); + + if (error == 0) + error = uiomove(sbuf_data(asb) + uio->uio_offset, buflen, uio); + sbuf_delete(asb); + return (error); +} /* * Constructor @@ -1439,6 +1487,8 @@ linprocfs_init(PFS_INIT_ARGS) NULL, NULL, NULL, PFS_RD); pfs_create_link(dir, "fd", &linprocfs_dofdescfs, NULL, NULL, NULL, 0); + pfs_create_file(dir, "auxv", &linprocfs_doauxv, + NULL, &procfs_candebug, NULL, PFS_RD|PFS_RAWRD); /* /proc/scsi/... */ dir = pfs_create_dir(root, "scsi", NULL, NULL, NULL, 0); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:29:10 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87370A693E0; Sat, 9 Jan 2016 17:29:10 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B58D117E; Sat, 9 Jan 2016 17:29:10 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HT93l058241; Sat, 9 Jan 2016 17:29:09 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HT8q1058228; Sat, 9 Jan 2016 17:29:08 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091729.u09HT8q1058228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293575 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux conf i386/linux modules/linux modules/linux_common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:29:10 -0000 Author: dchagin Date: Sat Jan 9 17:29:08 2016 New Revision: 293575 URL: https://svnweb.freebsd.org/changeset/base/293575 Log: MFC r283474: Rework signal code to allow using it by other modules, like linprocfs: 1. Linux sigset always 64 bit on all platforms. In order to move Linux sigset code to the linux_common module define it as 64 bit int. Move Linux sigset manipulation routines to the MI path. 2. Move Linux signal number definitions to the MI path. In general, they are the same on all platforms except for a few signals. 3. Map Linux RT signals to the FreeBSD RT signals and hide signal conversion tables to avoid conversion errors. 4. Emulate Linux SIGPWR signal via FreeBSD SIGRTMIN signal which is outside of allowed on Linux signal numbers. PR: 197216 Added: stable/10/sys/compat/linux/linux.c - copied unchanged from r283474, head/sys/compat/linux/linux.c stable/10/sys/compat/linux/linux.h - copied unchanged from r283474, head/sys/compat/linux/linux.h Modified: stable/10/sys/amd64/linux/linux.h stable/10/sys/amd64/linux/linux_machdep.c stable/10/sys/amd64/linux/linux_sysvec.c stable/10/sys/amd64/linux32/linux.h stable/10/sys/amd64/linux32/linux32_machdep.c stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/compat/linux/linux_fork.c stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/linux/linux_signal.c stable/10/sys/compat/linux/linux_signal.h stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/i386/linux/linux.h stable/10/sys/i386/linux/linux_machdep.c stable/10/sys/i386/linux/linux_ptrace.c stable/10/sys/i386/linux/linux_sysvec.c stable/10/sys/modules/linux/Makefile stable/10/sys/modules/linux_common/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux.h ============================================================================== --- stable/10/sys/amd64/linux/linux.h Sat Jan 9 17:27:36 2016 (r293574) +++ stable/10/sys/amd64/linux/linux.h Sat Jan 9 17:29:08 2016 (r293575) @@ -32,6 +32,7 @@ #ifndef _AMD64_LINUX_H_ #define _AMD64_LINUX_H_ +#include #include /* @@ -173,49 +174,6 @@ struct l_newstat { l_long __unused3; }; -/* - * Signalling - */ -#define LINUX_SIGHUP 1 -#define LINUX_SIGINT 2 -#define LINUX_SIGQUIT 3 -#define LINUX_SIGILL 4 -#define LINUX_SIGTRAP 5 -#define LINUX_SIGABRT 6 -#define LINUX_SIGIOT LINUX_SIGABRT -#define LINUX_SIGBUS 7 -#define LINUX_SIGFPE 8 -#define LINUX_SIGKILL 9 -#define LINUX_SIGUSR1 10 -#define LINUX_SIGSEGV 11 -#define LINUX_SIGUSR2 12 -#define LINUX_SIGPIPE 13 -#define LINUX_SIGALRM 14 -#define LINUX_SIGTERM 15 -#define LINUX_SIGSTKFLT 16 -#define LINUX_SIGCHLD 17 -#define LINUX_SIGCONT 18 -#define LINUX_SIGSTOP 19 -#define LINUX_SIGTSTP 20 -#define LINUX_SIGTTIN 21 -#define LINUX_SIGTTOU 22 -#define LINUX_SIGURG 23 -#define LINUX_SIGXCPU 24 -#define LINUX_SIGXFSZ 25 -#define LINUX_SIGVTALRM 26 -#define LINUX_SIGPROF 27 -#define LINUX_SIGWINCH 28 -#define LINUX_SIGIO 29 -#define LINUX_SIGPOLL LINUX_SIGIO -#define LINUX_SIGPWR 30 -#define LINUX_SIGSYS 31 -#define LINUX_SIGRTMIN 32 - -#define LINUX_SIGTBLSZ 31 -#define LINUX_NSIG 64 -#define LINUX_NBPW 64 -#define LINUX_NSIG_WORDS (LINUX_NSIG / LINUX_NBPW) - /* sigaction flags */ #define LINUX_SA_NOCLDSTOP 0x00000001 #define LINUX_SA_NOCLDWAIT 0x00000002 @@ -232,31 +190,12 @@ struct l_newstat { #define LINUX_SIG_UNBLOCK 1 #define LINUX_SIG_SETMASK 2 -/* primitives to manipulate sigset_t */ - -#define LINUX_SIGEMPTYSET(set) \ - do { \ - (set).__bits[0] = 0; \ - } while(0) - -#define LINUX_SIGISMEMBER(set, sig) \ - (1UL & ((set).__bits[0] >> _SIG_IDX(sig))) - -#define LINUX_SIGADDSET(set, sig) \ - (set).__bits[0] |= 1UL << _SIG_IDX(sig) - /* sigaltstack */ #define LINUX_MINSIGSTKSZ 2048 -#define LINUX_SS_ONSTACK 1 -#define LINUX_SS_DISABLE 2 typedef void (*l_handler_t)(l_int); typedef struct { - l_ulong __bits[LINUX_NSIG_WORDS]; -} l_sigset_t; - -typedef struct { l_handler_t lsa_handler; l_ulong lsa_flags; l_uintptr_t lsa_restorer; Modified: stable/10/sys/amd64/linux/linux_machdep.c ============================================================================== --- stable/10/sys/amd64/linux/linux_machdep.c Sat Jan 9 17:27:36 2016 (r293574) +++ stable/10/sys/amd64/linux/linux_machdep.c Sat Jan 9 17:29:08 2016 (r293575) @@ -431,39 +431,3 @@ linux_set_cloned_tls(struct thread *td, return (0); } - -void -linux_to_bsd_sigset(l_sigset_t *lss, sigset_t *bss) -{ - int b, l; - - SIGEMPTYSET(*bss); - for (l = 1; l <= LINUX_NSIG; l++) { - if (LINUX_SIGISMEMBER(*lss, l)) { - if (l <= LINUX_SIGTBLSZ) - b = linux_to_bsd_signal[_SIG_IDX(l)]; - else - b = l; - if (b) - SIGADDSET(*bss, b); - } - } -} - -void -bsd_to_linux_sigset(sigset_t *bss, l_sigset_t *lss) -{ - int b, l; - - LINUX_SIGEMPTYSET(*lss); - for (b = 1; b <= LINUX_NSIG; b++) { - if (SIGISMEMBER(*bss, b)) { - if (b <= LINUX_SIGTBLSZ) - l = bsd_to_linux_signal[_SIG_IDX(b)]; - else - l = b; - if (l) - LINUX_SIGADDSET(*lss, l); - } - } -} Modified: stable/10/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysvec.c Sat Jan 9 17:27:36 2016 (r293574) +++ stable/10/sys/amd64/linux/linux_sysvec.c Sat Jan 9 17:29:08 2016 (r293575) @@ -150,28 +150,6 @@ static int bsd_to_linux_errno[ELAST + 1] -72, -67, -71 }; -int bsd_to_linux_signal[LINUX_SIGTBLSZ] = { - LINUX_SIGHUP, LINUX_SIGINT, LINUX_SIGQUIT, LINUX_SIGILL, - LINUX_SIGTRAP, LINUX_SIGABRT, 0, LINUX_SIGFPE, - LINUX_SIGKILL, LINUX_SIGBUS, LINUX_SIGSEGV, LINUX_SIGSYS, - LINUX_SIGPIPE, LINUX_SIGALRM, LINUX_SIGTERM, LINUX_SIGURG, - LINUX_SIGSTOP, LINUX_SIGTSTP, LINUX_SIGCONT, LINUX_SIGCHLD, - LINUX_SIGTTIN, LINUX_SIGTTOU, LINUX_SIGIO, LINUX_SIGXCPU, - LINUX_SIGXFSZ, LINUX_SIGVTALRM, LINUX_SIGPROF, LINUX_SIGWINCH, - 0, LINUX_SIGUSR1, LINUX_SIGUSR2 -}; - -int linux_to_bsd_signal[LINUX_SIGTBLSZ] = { - SIGHUP, SIGINT, SIGQUIT, SIGILL, - SIGTRAP, SIGABRT, SIGBUS, SIGFPE, - SIGKILL, SIGUSR1, SIGSEGV, SIGUSR2, - SIGPIPE, SIGALRM, SIGTERM, SIGBUS, - SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP, - SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, - SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH, - SIGIO, SIGURG, SIGSYS -}; - #define LINUX_T_UNKNOWN 255 static int _bsd_to_linux_trapcode[] = { LINUX_T_UNKNOWN, /* 0 */ @@ -657,8 +635,8 @@ linux_rt_sendsig(sig_t catcher, ksiginfo sfp = (struct l_rt_sigframe *)((unsigned long)sp & ~0xFul); mtx_unlock(&psp->ps_mtx); - /* Translate the signal if appropriate. */ - sig = BSD_TO_LINUX_SIGNAL(sig); + /* Translate the signal. */ + sig = bsd_to_linux_signal(sig); /* Save user context. */ bzero(&sf, sizeof(sf)); @@ -772,8 +750,8 @@ struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, .sv_mask = 0, - .sv_sigsize = LINUX_SIGTBLSZ, - .sv_sigtbl = bsd_to_linux_signal, + .sv_sigsize = 0, + .sv_sigtbl = NULL, .sv_errsize = ELAST + 1, .sv_errtbl = bsd_to_linux_errno, .sv_transtrap = translate_traps, Modified: stable/10/sys/amd64/linux32/linux.h ============================================================================== --- stable/10/sys/amd64/linux32/linux.h Sat Jan 9 17:27:36 2016 (r293574) +++ stable/10/sys/amd64/linux32/linux.h Sat Jan 9 17:29:08 2016 (r293575) @@ -33,6 +33,7 @@ #ifndef _AMD64_LINUX_H_ #define _AMD64_LINUX_H_ +#include #include /* @@ -259,49 +260,6 @@ struct l_statfs64 { l_int f_spare[6]; } __packed; -/* - * Signalling - */ -#define LINUX_SIGHUP 1 -#define LINUX_SIGINT 2 -#define LINUX_SIGQUIT 3 -#define LINUX_SIGILL 4 -#define LINUX_SIGTRAP 5 -#define LINUX_SIGABRT 6 -#define LINUX_SIGIOT LINUX_SIGABRT -#define LINUX_SIGBUS 7 -#define LINUX_SIGFPE 8 -#define LINUX_SIGKILL 9 -#define LINUX_SIGUSR1 10 -#define LINUX_SIGSEGV 11 -#define LINUX_SIGUSR2 12 -#define LINUX_SIGPIPE 13 -#define LINUX_SIGALRM 14 -#define LINUX_SIGTERM 15 -#define LINUX_SIGSTKFLT 16 -#define LINUX_SIGCHLD 17 -#define LINUX_SIGCONT 18 -#define LINUX_SIGSTOP 19 -#define LINUX_SIGTSTP 20 -#define LINUX_SIGTTIN 21 -#define LINUX_SIGTTOU 22 -#define LINUX_SIGURG 23 -#define LINUX_SIGXCPU 24 -#define LINUX_SIGXFSZ 25 -#define LINUX_SIGVTALRM 26 -#define LINUX_SIGPROF 27 -#define LINUX_SIGWINCH 28 -#define LINUX_SIGIO 29 -#define LINUX_SIGPOLL LINUX_SIGIO -#define LINUX_SIGPWR 30 -#define LINUX_SIGSYS 31 -#define LINUX_SIGRTMIN 32 - -#define LINUX_SIGTBLSZ 31 -#define LINUX_NSIG_WORDS 2 -#define LINUX_NBPW 32 -#define LINUX_NSIG (LINUX_NBPW * LINUX_NSIG_WORDS) - /* sigaction flags */ #define LINUX_SA_NOCLDSTOP 0x00000001 #define LINUX_SA_NOCLDWAIT 0x00000002 @@ -318,24 +276,13 @@ struct l_statfs64 { #define LINUX_SIG_UNBLOCK 1 #define LINUX_SIG_SETMASK 2 -/* sigset_t macros */ -#define LINUX_SIGEMPTYSET(set) (set).__bits[0] = (set).__bits[1] = 0 -#define LINUX_SIGISMEMBER(set, sig) SIGISMEMBER(set, sig) -#define LINUX_SIGADDSET(set, sig) SIGADDSET(set, sig) - /* sigaltstack */ #define LINUX_MINSIGSTKSZ 2048 -#define LINUX_SS_ONSTACK 1 -#define LINUX_SS_DISABLE 2 typedef l_uintptr_t l_handler_t; typedef l_ulong l_osigset_t; typedef struct { - l_uint __bits[LINUX_NSIG_WORDS]; -} __packed l_sigset_t; - -typedef struct { l_handler_t lsa_handler; l_osigset_t lsa_mask; l_ulong lsa_flags; @@ -504,7 +451,7 @@ struct l_sigframe { l_int sf_sig; struct l_sigcontext sf_sc; struct l_fpstate sf_fpstate; - l_uint sf_extramask[LINUX_NSIG_WORDS-1]; + l_uint sf_extramask[1]; l_handler_t sf_handler; } __packed; Modified: stable/10/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 17:27:36 2016 (r293574) +++ stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 17:29:08 2016 (r293575) @@ -716,7 +716,7 @@ linux_sigaction(struct thread *td, struc act.lsa_flags = osa.lsa_flags; act.lsa_restorer = osa.lsa_restorer; LINUX_SIGEMPTYSET(act.lsa_mask); - act.lsa_mask.__bits[0] = osa.lsa_mask; + act.lsa_mask.__mask = osa.lsa_mask; } error = linux_do_sigaction(td, args->sig, args->nsa ? &act : NULL, @@ -726,7 +726,7 @@ linux_sigaction(struct thread *td, struc osa.lsa_handler = oact.lsa_handler; osa.lsa_flags = oact.lsa_flags; osa.lsa_restorer = oact.lsa_restorer; - osa.lsa_mask = oact.lsa_mask.__bits[0]; + osa.lsa_mask = oact.lsa_mask.__mask; error = copyout(&osa, args->osa, sizeof(l_osigaction_t)); } @@ -750,7 +750,7 @@ linux_sigsuspend(struct thread *td, stru #endif LINUX_SIGEMPTYSET(mask); - mask.__bits[0] = args->mask; + mask.__mask = args->mask; linux_to_bsd_sigset(&mask, &sigmask); return (kern_sigsuspend(td, sigmask)); } Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 17:27:36 2016 (r293574) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 17:29:08 2016 (r293575) @@ -150,28 +150,6 @@ static int bsd_to_linux_errno[ELAST + 1] -72, -67, -71 }; -int bsd_to_linux_signal[LINUX_SIGTBLSZ] = { - LINUX_SIGHUP, LINUX_SIGINT, LINUX_SIGQUIT, LINUX_SIGILL, - LINUX_SIGTRAP, LINUX_SIGABRT, 0, LINUX_SIGFPE, - LINUX_SIGKILL, LINUX_SIGBUS, LINUX_SIGSEGV, LINUX_SIGSYS, - LINUX_SIGPIPE, LINUX_SIGALRM, LINUX_SIGTERM, LINUX_SIGURG, - LINUX_SIGSTOP, LINUX_SIGTSTP, LINUX_SIGCONT, LINUX_SIGCHLD, - LINUX_SIGTTIN, LINUX_SIGTTOU, LINUX_SIGIO, LINUX_SIGXCPU, - LINUX_SIGXFSZ, LINUX_SIGVTALRM, LINUX_SIGPROF, LINUX_SIGWINCH, - 0, LINUX_SIGUSR1, LINUX_SIGUSR2 -}; - -int linux_to_bsd_signal[LINUX_SIGTBLSZ] = { - SIGHUP, SIGINT, SIGQUIT, SIGILL, - SIGTRAP, SIGABRT, SIGBUS, SIGFPE, - SIGKILL, SIGUSR1, SIGSEGV, SIGUSR2, - SIGPIPE, SIGALRM, SIGTERM, SIGBUS, - SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP, - SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, - SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH, - SIGIO, SIGURG, SIGSYS -}; - #define LINUX_T_UNKNOWN 255 static int _bsd_to_linux_trapcode[] = { LINUX_T_UNKNOWN, /* 0 */ @@ -344,7 +322,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo /* * Build the argument list for the signal handler. */ - sig = BSD_TO_LINUX_SIGNAL(sig); + sig = bsd_to_linux_signal(sig); bzero(&frame, sizeof(frame)); @@ -371,7 +349,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo bsd_to_linux_sigset(mask, &frame.sf_sc.uc_sigmask); - frame.sf_sc.uc_mcontext.sc_mask = frame.sf_sc.uc_sigmask.__bits[0]; + frame.sf_sc.uc_mcontext.sc_mask = frame.sf_sc.uc_sigmask.__mask; frame.sf_sc.uc_mcontext.sc_edi = regs->tf_rdi; frame.sf_sc.uc_mcontext.sc_esi = regs->tf_rsi; frame.sf_sc.uc_mcontext.sc_ebp = regs->tf_rbp; @@ -452,7 +430,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t struct trapframe *regs; struct l_sigframe *fp, frame; l_sigset_t lmask; - int oonstack, i; + int oonstack; int sig, code; sig = ksi->ksi_signo; @@ -490,7 +468,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t /* * Build the argument list for the signal handler. */ - sig = BSD_TO_LINUX_SIGNAL(sig); + sig = bsd_to_linux_signal(sig); bzero(&frame, sizeof(frame)); @@ -502,7 +480,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t /* * Build the signal context to be used by sigreturn. */ - frame.sf_sc.sc_mask = lmask.__bits[0]; + frame.sf_sc.sc_mask = lmask.__mask; frame.sf_sc.sc_gs = regs->tf_gs; frame.sf_sc.sc_fs = regs->tf_fs; frame.sf_sc.sc_es = regs->tf_es; @@ -524,8 +502,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t frame.sf_sc.sc_cr2 = (u_int32_t)(uintptr_t)ksi->ksi_addr; frame.sf_sc.sc_trapno = bsd_to_linux_trapcode(code); - for (i = 0; i < (LINUX_NSIG_WORDS-1); i++) - frame.sf_extramask[i] = lmask.__bits[i+1]; + frame.sf_extramask[0] = lmask.__mask; if (copyout(&frame, fp, sizeof(frame)) != 0) { /* @@ -571,7 +548,7 @@ linux_sigreturn(struct thread *td, struc struct trapframe *regs; sigset_t bmask; l_sigset_t lmask; - int eflags, i; + int eflags; ksiginfo_t ksi; regs = td->td_frame; @@ -612,9 +589,8 @@ linux_sigreturn(struct thread *td, struc return(EINVAL); } - lmask.__bits[0] = frame.sf_sc.sc_mask; - for (i = 0; i < (LINUX_NSIG_WORDS-1); i++) - lmask.__bits[i+1] = frame.sf_extramask[i]; + lmask.__mask = frame.sf_sc.sc_mask; + lmask.__mask = frame.sf_extramask[0]; linux_to_bsd_sigset(&lmask, &bmask); kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); @@ -1035,8 +1011,8 @@ struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, .sv_mask = 0, - .sv_sigsize = LINUX_SIGTBLSZ, - .sv_sigtbl = bsd_to_linux_signal, + .sv_sigsize = 0, + .sv_sigtbl = NULL, .sv_errsize = ELAST + 1, .sv_errtbl = bsd_to_linux_errno, .sv_transtrap = translate_traps, Copied: stable/10/sys/compat/linux/linux.c (from r283474, head/sys/compat/linux/linux.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/compat/linux/linux.c Sat Jan 9 17:29:08 2016 (r293575, copy of r283474, head/sys/compat/linux/linux.c) @@ -0,0 +1,205 @@ +/*- + * Copyright (c) 2015 Dmitry Chagin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + + +static int bsd_to_linux_sigtbl[LINUX_SIGTBLSZ] = { + LINUX_SIGHUP, /* SIGHUP */ + LINUX_SIGINT, /* SIGINT */ + LINUX_SIGQUIT, /* SIGQUIT */ + LINUX_SIGILL, /* SIGILL */ + LINUX_SIGTRAP, /* SIGTRAP */ + LINUX_SIGABRT, /* SIGABRT */ + 0, /* SIGEMT */ + LINUX_SIGFPE, /* SIGFPE */ + LINUX_SIGKILL, /* SIGKILL */ + LINUX_SIGBUS, /* SIGBUS */ + LINUX_SIGSEGV, /* SIGSEGV */ + LINUX_SIGSYS, /* SIGSYS */ + LINUX_SIGPIPE, /* SIGPIPE */ + LINUX_SIGALRM, /* SIGALRM */ + LINUX_SIGTERM, /* SIGTERM */ + LINUX_SIGURG, /* SIGURG */ + LINUX_SIGSTOP, /* SIGSTOP */ + LINUX_SIGTSTP, /* SIGTSTP */ + LINUX_SIGCONT, /* SIGCONT */ + LINUX_SIGCHLD, /* SIGCHLD */ + LINUX_SIGTTIN, /* SIGTTIN */ + LINUX_SIGTTOU, /* SIGTTOU */ + LINUX_SIGIO, /* SIGIO */ + LINUX_SIGXCPU, /* SIGXCPU */ + LINUX_SIGXFSZ, /* SIGXFSZ */ + LINUX_SIGVTALRM,/* SIGVTALRM */ + LINUX_SIGPROF, /* SIGPROF */ + LINUX_SIGWINCH, /* SIGWINCH */ + 0, /* SIGINFO */ + LINUX_SIGUSR1, /* SIGUSR1 */ + LINUX_SIGUSR2 /* SIGUSR2 */ +}; + +static int linux_to_bsd_sigtbl[LINUX_SIGTBLSZ] = { + SIGHUP, /* LINUX_SIGHUP */ + SIGINT, /* LINUX_SIGINT */ + SIGQUIT, /* LINUX_SIGQUIT */ + SIGILL, /* LINUX_SIGILL */ + SIGTRAP, /* LINUX_SIGTRAP */ + SIGABRT, /* LINUX_SIGABRT */ + SIGBUS, /* LINUX_SIGBUS */ + SIGFPE, /* LINUX_SIGFPE */ + SIGKILL, /* LINUX_SIGKILL */ + SIGUSR1, /* LINUX_SIGUSR1 */ + SIGSEGV, /* LINUX_SIGSEGV */ + SIGUSR2, /* LINUX_SIGUSR2 */ + SIGPIPE, /* LINUX_SIGPIPE */ + SIGALRM, /* LINUX_SIGALRM */ + SIGTERM, /* LINUX_SIGTERM */ + SIGBUS, /* LINUX_SIGSTKFLT */ + SIGCHLD, /* LINUX_SIGCHLD */ + SIGCONT, /* LINUX_SIGCONT */ + SIGSTOP, /* LINUX_SIGSTOP */ + SIGTSTP, /* LINUX_SIGTSTP */ + SIGTTIN, /* LINUX_SIGTTIN */ + SIGTTOU, /* LINUX_SIGTTOU */ + SIGURG, /* LINUX_SIGURG */ + SIGXCPU, /* LINUX_SIGXCPU */ + SIGXFSZ, /* LINUX_SIGXFSZ */ + SIGVTALRM, /* LINUX_SIGVTALARM */ + SIGPROF, /* LINUX_SIGPROF */ + SIGWINCH, /* LINUX_SIGWINCH */ + SIGIO, /* LINUX_SIGIO */ + /* + * FreeBSD does not have SIGPWR signal, map Linux SIGPWR signal + * to the first unused FreeBSD signal number. Since Linux supports + * signals from 1 to 64 we are ok here as our SIGRTMIN = 65. + */ + SIGRTMIN, /* LINUX_SIGPWR */ + SIGSYS /* LINUX_SIGSYS */ +}; + +/* + * Map Linux RT signals to the FreeBSD RT signals. + */ +static inline int +linux_to_bsd_rt_signal(int sig) +{ + + return (SIGRTMIN + 1 + sig - LINUX_SIGRTMIN); +} + +static inline int +bsd_to_linux_rt_signal(int sig) +{ + + return (sig - SIGRTMIN - 1 + LINUX_SIGRTMIN); +} + +int +linux_to_bsd_signal(int sig) +{ + + KASSERT(sig > 0 && sig <= LINUX_SIGRTMAX, ("Invalid Linux signal\n")); + + if (sig < LINUX_SIGRTMIN) + return (linux_to_bsd_sigtbl[_SIG_IDX(sig)]); + + return (linux_to_bsd_rt_signal(sig)); +} + +int +bsd_to_linux_signal(int sig) +{ + + if (sig <= LINUX_SIGTBLSZ) + return (bsd_to_linux_sigtbl[_SIG_IDX(sig)]); + if (sig == SIGRTMIN) + return (LINUX_SIGPWR); + + return (bsd_to_linux_rt_signal(sig)); +} + +int +linux_to_bsd_sigaltstack(int lsa) +{ + int bsa = 0; + + if (lsa & LINUX_SS_DISABLE) + bsa |= SS_DISABLE; + /* + * Linux ignores SS_ONSTACK flag for ss + * parameter while FreeBSD prohibits it. + */ + return (bsa); +} + +int +bsd_to_linux_sigaltstack(int bsa) +{ + int lsa = 0; + + if (bsa & SS_DISABLE) + lsa |= LINUX_SS_DISABLE; + if (bsa & SS_ONSTACK) + lsa |= LINUX_SS_ONSTACK; + return (lsa); +} + +void +linux_to_bsd_sigset(l_sigset_t *lss, sigset_t *bss) +{ + int b, l; + + SIGEMPTYSET(*bss); + for (l = 1; l <= LINUX_SIGRTMAX; l++) { + if (LINUX_SIGISMEMBER(*lss, l)) { + b = linux_to_bsd_signal(l); + if (b) + SIGADDSET(*bss, b); + } + } +} + +void +bsd_to_linux_sigset(sigset_t *bss, l_sigset_t *lss) +{ + int b, l; + + LINUX_SIGEMPTYSET(*lss); + for (b = 1; b <= SIGRTMAX; b++) { + if (SIGISMEMBER(*bss, b)) { + l = bsd_to_linux_signal(b); + if (l) + LINUX_SIGADDSET(*lss, l); + } + } +} Copied: stable/10/sys/compat/linux/linux.h (from r283474, head/sys/compat/linux/linux.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/compat/linux/linux.h Sat Jan 9 17:29:08 2016 (r293575, copy of r283474, head/sys/compat/linux/linux.h) @@ -0,0 +1,95 @@ +/*- + * Copyright (c) 2015 Dmitry Chagin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_MI_H_ +#define _LINUX_MI_H_ + +/* sigaltstack */ +#define LINUX_SS_ONSTACK 1 +#define LINUX_SS_DISABLE 2 + +int linux_to_bsd_sigaltstack(int lsa); +int bsd_to_linux_sigaltstack(int bsa); + +/* sigset */ +typedef struct { + uint64_t __mask; +} l_sigset_t; + +/* primitives to manipulate sigset_t */ +#define LINUX_SIGEMPTYSET(set) (set).__mask = 0 +#define LINUX_SIGISMEMBER(set, sig) (1UL & ((set).__mask >> _SIG_IDX(sig))) +#define LINUX_SIGADDSET(set, sig) (set).__mask |= 1UL << _SIG_IDX(sig) + +void linux_to_bsd_sigset(l_sigset_t *, sigset_t *); +void bsd_to_linux_sigset(sigset_t *, l_sigset_t *); + +/* signaling */ +#define LINUX_SIGHUP 1 +#define LINUX_SIGINT 2 +#define LINUX_SIGQUIT 3 +#define LINUX_SIGILL 4 +#define LINUX_SIGTRAP 5 +#define LINUX_SIGABRT 6 +#define LINUX_SIGIOT LINUX_SIGABRT +#define LINUX_SIGBUS 7 +#define LINUX_SIGFPE 8 +#define LINUX_SIGKILL 9 +#define LINUX_SIGUSR1 10 +#define LINUX_SIGSEGV 11 +#define LINUX_SIGUSR2 12 +#define LINUX_SIGPIPE 13 +#define LINUX_SIGALRM 14 +#define LINUX_SIGTERM 15 +#define LINUX_SIGSTKFLT 16 +#define LINUX_SIGCHLD 17 +#define LINUX_SIGCONT 18 +#define LINUX_SIGSTOP 19 +#define LINUX_SIGTSTP 20 +#define LINUX_SIGTTIN 21 +#define LINUX_SIGTTOU 22 +#define LINUX_SIGURG 23 +#define LINUX_SIGXCPU 24 +#define LINUX_SIGXFSZ 25 +#define LINUX_SIGVTALRM 26 +#define LINUX_SIGPROF 27 +#define LINUX_SIGWINCH 28 +#define LINUX_SIGIO 29 +#define LINUX_SIGPOLL LINUX_SIGIO +#define LINUX_SIGPWR 30 +#define LINUX_SIGSYS 31 +#define LINUX_SIGTBLSZ 31 +#define LINUX_SIGRTMIN 32 +#define LINUX_SIGRTMAX 64 + +#define LINUX_SIG_VALID(sig) ((sig) <= LINUX_SIGRTMAX && (sig) > 0) + +int linux_to_bsd_signal(int sig); +int bsd_to_linux_signal(int sig); + +#endif /* _LINUX_MI_H_ */ Modified: stable/10/sys/compat/linux/linux_fork.c ============================================================================== --- stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 17:27:36 2016 (r293574) +++ stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 17:29:08 2016 (r293575) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #endif -#include #include #include #include @@ -160,9 +159,7 @@ linux_clone_proc(struct thread *td, stru exit_signal = args->flags & 0x000000ff; if (LINUX_SIG_VALID(exit_signal)) { - if (exit_signal <= LINUX_SIGTBLSZ) - exit_signal = - linux_to_bsd_signal[_SIG_IDX(exit_signal)]; + exit_signal = linux_to_bsd_signal(exit_signal); } else if (exit_signal != 0) return (EINVAL); Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 17:27:36 2016 (r293574) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 17:29:08 2016 (r293575) @@ -870,10 +870,10 @@ linux_common_wait(struct thread *td, int tmpstat &= 0xffff; if (WIFSIGNALED(tmpstat)) tmpstat = (tmpstat & 0xffffff80) | - BSD_TO_LINUX_SIGNAL(WTERMSIG(tmpstat)); + bsd_to_linux_signal(WTERMSIG(tmpstat)); else if (WIFSTOPPED(tmpstat)) tmpstat = (tmpstat & 0xffff00ff) | - (BSD_TO_LINUX_SIGNAL(WSTOPSIG(tmpstat)) << 8); + (bsd_to_linux_signal(WSTOPSIG(tmpstat)) << 8); else if (WIFCONTINUED(tmpstat)) tmpstat = 0xffff; error = copyout(&tmpstat, status, sizeof(int)); @@ -986,7 +986,7 @@ linux_waitid(struct thread *td, struct l if (td->td_retval[0] == 0) bzero(&lsi, sizeof(lsi)); else { - sig = BSD_TO_LINUX_SIGNAL(siginfo.si_signo); + sig = bsd_to_linux_signal(siginfo.si_signo); siginfo_to_lsiginfo(&siginfo, &lsi, sig); } error = copyout(&lsi, args->info, sizeof(lsi)); Modified: stable/10/sys/compat/linux/linux_signal.c ============================================================================== --- stable/10/sys/compat/linux/linux_signal.c Sat Jan 9 17:27:36 2016 (r293574) +++ stable/10/sys/compat/linux/linux_signal.c Sat Jan 9 17:29:08 2016 (r293575) @@ -60,42 +60,6 @@ static int linux_do_tkill(struct thread static void sicode_to_lsicode(int si_code, int *lsi_code); -#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) -void -linux_to_bsd_sigset(l_sigset_t *lss, sigset_t *bss) -{ - int b, l; - - SIGEMPTYSET(*bss); - bss->__bits[0] = lss->__bits[0] & ~((1U << LINUX_SIGTBLSZ) - 1); - bss->__bits[1] = lss->__bits[1]; - for (l = 1; l <= LINUX_SIGTBLSZ; l++) { - if (LINUX_SIGISMEMBER(*lss, l)) { - b = linux_to_bsd_signal[_SIG_IDX(l)]; - if (b) - SIGADDSET(*bss, b); - } - } -} - -void -bsd_to_linux_sigset(sigset_t *bss, l_sigset_t *lss) -{ - int b, l; - - LINUX_SIGEMPTYSET(*lss); - lss->__bits[0] = bss->__bits[0] & ~((1U << LINUX_SIGTBLSZ) - 1); - lss->__bits[1] = bss->__bits[1]; - for (b = 1; b <= LINUX_SIGTBLSZ; b++) { - if (SIGISMEMBER(*bss, b)) { - l = bsd_to_linux_signal[_SIG_IDX(b)]; - if (l) - LINUX_SIGADDSET(*lss, l); - } - } -} -#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ - static void linux_to_bsd_sigaction(l_sigaction_t *lsa, struct sigaction *bsa) { @@ -163,11 +127,7 @@ linux_do_sigaction(struct thread *td, in linux_to_bsd_sigaction(linux_nsa, nsa); } else nsa = NULL; - - if (linux_sig <= LINUX_SIGTBLSZ) - sig = linux_to_bsd_signal[_SIG_IDX(linux_sig)]; - else - sig = linux_sig; + sig = linux_to_bsd_signal(linux_sig); error = kern_sigaction(td, sig, nsa, osa, 0); if (error) @@ -289,7 +249,7 @@ linux_sigprocmask(struct thread *td, str if (error) return (error); LINUX_SIGEMPTYSET(set); - set.__bits[0] = mask; + set.__mask = mask; } error = linux_do_sigprocmask(td, args->how, @@ -297,7 +257,7 @@ linux_sigprocmask(struct thread *td, str args->omask ? &oset : NULL); if (args->omask != NULL && !error) { - mask = oset.__bits[0]; + mask = oset.__mask; error = copyout(&mask, args->omask, sizeof(l_osigset_t)); } @@ -353,7 +313,7 @@ linux_sgetmask(struct thread *td, struct PROC_LOCK(p); bsd_to_linux_sigset(&td->td_sigmask, &mask); PROC_UNLOCK(p); - td->td_retval[0] = mask.__bits[0]; + td->td_retval[0] = mask.__mask; return (0); } @@ -371,9 +331,9 @@ linux_ssetmask(struct thread *td, struct PROC_LOCK(p); bsd_to_linux_sigset(&td->td_sigmask, &lset); - td->td_retval[0] = lset.__bits[0]; + td->td_retval[0] = lset.__mask; LINUX_SIGEMPTYSET(lset); - lset.__bits[0] = args->mask; + lset.__mask = args->mask; linux_to_bsd_sigset(&lset, &bset); td->td_sigmask = bset; SIG_CANTMASK(td->td_sigmask); @@ -401,7 +361,7 @@ linux_sigpending(struct thread *td, stru SIGSETAND(bset, td->td_sigmask); PROC_UNLOCK(p); bsd_to_linux_sigset(&bset, &lset); - mask = lset.__bits[0]; + mask = lset.__mask; return (copyout(&mask, args->mask, sizeof(mask))); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ @@ -505,7 +465,7 @@ linux_rt_sigtimedwait(struct thread *td, if (error) return (error); - sig = BSD_TO_LINUX_SIGNAL(info.ksi_signo); + sig = bsd_to_linux_signal(info.ksi_signo); if (args->ptr) { memset(&linfo, 0, sizeof(linfo)); @@ -537,10 +497,10 @@ linux_kill(struct thread *td, struct lin if (!LINUX_SIG_VALID(args->signum) && args->signum != 0) return (EINVAL); - if (args->signum > 0 && args->signum <= LINUX_SIGTBLSZ) - tmp.signum = linux_to_bsd_signal[_SIG_IDX(args->signum)]; + if (args->signum > 0) + tmp.signum = linux_to_bsd_signal(args->signum); else - tmp.signum = args->signum; + tmp.signum = 0; tmp.pid = args->pid; return (sys_kill(td, &tmp)); @@ -590,10 +550,10 @@ linux_tgkill(struct thread *td, struct l if (!LINUX_SIG_VALID(args->sig) && args->sig != 0) return (EINVAL); - if (args->sig > 0 && args->sig <= LINUX_SIGTBLSZ) - sig = linux_to_bsd_signal[_SIG_IDX(args->sig)]; + if (args->sig > 0) + sig = linux_to_bsd_signal(args->sig); else - sig = args->sig; + sig = 0; tdt = linux_tdfind(td, args->pid, args->tgid); if (tdt == NULL) @@ -628,8 +588,7 @@ linux_tkill(struct thread *td, struct li if (!LINUX_SIG_VALID(args->sig)) return (EINVAL); - - sig = BSD_TO_LINUX_SIGNAL(args->sig); + sig = linux_to_bsd_signal(args->sig); tdt = linux_tdfind(td, args->tid, -1); if (tdt == NULL) @@ -727,9 +686,9 @@ siginfo_to_lsiginfo(const siginfo_t *si, lsi->lsi_uid = si->si_uid; if (si->si_code == CLD_STOPPED) - lsi->lsi_status = BSD_TO_LINUX_SIGNAL(si->si_status); + lsi->lsi_status = bsd_to_linux_signal(si->si_status); else if (si->si_code == CLD_CONTINUED) - lsi->lsi_status = BSD_TO_LINUX_SIGNAL(SIGCONT); + lsi->lsi_status = bsd_to_linux_signal(SIGCONT); else lsi->lsi_status = si->si_status; break; @@ -754,32 +713,6 @@ siginfo_to_lsiginfo(const siginfo_t *si, } } -int -linux_to_bsd_sigaltstack(int lsa) -{ - int bsa = 0; - - if (lsa & LINUX_SS_DISABLE) - bsa |= SS_DISABLE; - /* - * Linux ignores SS_ONSTACK flag for ss - * parameter while FreeBSD prohibits it. - */ - return (bsa); -} - -int -bsd_to_linux_sigaltstack(int bsa) -{ - int lsa = 0; - - if (bsa & SS_DISABLE) - lsa |= LINUX_SS_DISABLE; - if (bsa & SS_ONSTACK) - lsa |= LINUX_SS_ONSTACK; - return (lsa); -} - void lsiginfo_to_ksiginfo(const l_siginfo_t *lsi, ksiginfo_t *ksi, int sig) { @@ -812,7 +745,7 @@ linux_rt_sigqueueinfo(struct thread *td, if (linfo.lsi_code >= 0) return (EPERM); - sig = BSD_TO_LINUX_SIGNAL(args->sig); + sig = linux_to_bsd_signal(args->sig); error = ESRCH; if ((p = pfind(args->pid)) != NULL || Modified: stable/10/sys/compat/linux/linux_signal.h ============================================================================== --- stable/10/sys/compat/linux/linux_signal.h Sat Jan 9 17:27:36 2016 (r293574) +++ stable/10/sys/compat/linux/linux_signal.h Sat Jan 9 17:29:08 2016 (r293575) @@ -43,21 +43,9 @@ #define LINUX_SI_SIGIO -5 /* sent by queued SIGIO */ #define LINUX_SI_TKILL -6 /* sent by tkill system call */ -extern int bsd_to_linux_signal[]; -extern int linux_to_bsd_signal[]; - -int linux_to_bsd_sigaltstack(int lsa); -int bsd_to_linux_sigaltstack(int bsa); -void linux_to_bsd_sigset(l_sigset_t *, sigset_t *); -void bsd_to_linux_sigset(sigset_t *, l_sigset_t *); int linux_do_sigaction(struct thread *, int, l_sigaction_t *, l_sigaction_t *); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:30:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D652A69510; Sat, 9 Jan 2016 17:30:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E47FD13DF; Sat, 9 Jan 2016 17:30:11 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HUAgV058363; Sat, 9 Jan 2016 17:30:10 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HUAkG058362; Sat, 9 Jan 2016 17:30:10 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091730.u09HUAkG058362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293576 - stable/10/sys/compat/linprocfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:30:12 -0000 Author: dchagin Date: Sat Jan 9 17:30:10 2016 New Revision: 293576 URL: https://svnweb.freebsd.org/changeset/base/293576 Log: MFC r283475: Convert Linux sigsets before showing. Linux kernel displays sigset always as 16x4 bit mask. Modified: stable/10/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/10/sys/compat/linprocfs/linprocfs.c Sat Jan 9 17:29:08 2016 (r293575) +++ stable/10/sys/compat/linprocfs/linprocfs.c Sat Jan 9 17:30:10 2016 (r293576) @@ -99,6 +99,7 @@ __FBSDID("$FreeBSD$"); #include #endif /* __i386__ || __amd64__ */ +#include #include #include #include @@ -730,6 +731,7 @@ linprocfs_doprocstatus(PFS_FILL_ARGS) segsz_t lsize; struct thread *td2; struct sigacts *ps; + l_sigset_t siglist, sigignore, sigcatch; int i; PROC_LOCK(p); @@ -818,29 +820,25 @@ linprocfs_doprocstatus(PFS_FILL_ARGS) /* * Signal masks - * - * We support up to 128 signals, while Linux supports 32, - * but we only define 32 (the same 32 as Linux, to boot), so - * just show the lower 32 bits of each mask. XXX hack. - * - * NB: on certain platforms (Sparc at least) Linux actually - * supports 64 signals, but this code is a long way from - * running on anything but i386, so ignore that for now. */ PROC_LOCK(p); - sbuf_printf(sb, "SigPnd:\t%08x\n", p->p_siglist.__bits[0]); - /* - * I can't seem to find out where the signal mask is in - * relation to struct proc, so SigBlk is left unimplemented. - */ - sbuf_printf(sb, "SigBlk:\t%08x\n", 0); /* XXX */ + bsd_to_linux_sigset(&p->p_siglist, &siglist); ps = p->p_sigacts; mtx_lock(&ps->ps_mtx); - sbuf_printf(sb, "SigIgn:\t%08x\n", ps->ps_sigignore.__bits[0]); - sbuf_printf(sb, "SigCgt:\t%08x\n", ps->ps_sigcatch.__bits[0]); + bsd_to_linux_sigset(&ps->ps_sigignore, &sigignore); + bsd_to_linux_sigset(&ps->ps_sigcatch, &sigcatch); mtx_unlock(&ps->ps_mtx); PROC_UNLOCK(p); + sbuf_printf(sb, "SigPnd:\t%016jx\n", siglist.__mask); + /* + * XXX. SigBlk - target thread's signal mask, td_sigmask. + * To implement SigBlk pseudofs should support proc/tid dir entries. + */ + sbuf_printf(sb, "SigBlk:\t%016x\n", 0); + sbuf_printf(sb, "SigIgn:\t%016jx\n", sigignore.__mask); + sbuf_printf(sb, "SigCgt:\t%016jx\n", sigcatch.__mask); + /* * Linux also prints the capability masks, but we don't have * capabilities yet, and when we do get them they're likely to From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:31:21 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2087A695B9; Sat, 9 Jan 2016 17:31:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 925D91733; Sat, 9 Jan 2016 17:31:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HVKcA061051; Sat, 9 Jan 2016 17:31:20 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HVKeQ061050; Sat, 9 Jan 2016 17:31:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091731.u09HVKeQ061050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293578 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:31:21 -0000 Author: dchagin Date: Sat Jan 9 17:31:20 2016 New Revision: 293578 URL: https://svnweb.freebsd.org/changeset/base/293578 Log: MFC r283476: Convert Linux signal number to the FreeBSD. Modified: stable/10/sys/compat/linux/linux_timer.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_timer.c ============================================================================== --- stable/10/sys/compat/linux/linux_timer.c Sat Jan 9 17:31:16 2016 (r293577) +++ stable/10/sys/compat/linux/linux_timer.c Sat Jan 9 17:31:20 2016 (r293578) @@ -58,7 +58,7 @@ linux_convert_l_sigevent(struct l_sigeve switch (l_sig->sigev_notify) { case L_SIGEV_SIGNAL: sig->sigev_notify = SIGEV_SIGNAL; - CP(*l_sig, *sig, sigev_signo); + sig->sigev_signo = linux_to_bsd_signal(l_sig->sigev_signo); PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr); break; case L_SIGEV_NONE: @@ -75,7 +75,7 @@ linux_convert_l_sigevent(struct l_sigeve case L_SIGEV_THREAD_ID: sig->sigev_notify = SIGEV_THREAD_ID; CP2(*l_sig, *sig, _l_sigev_un._tid, sigev_notify_thread_id); - CP(*l_sig, *sig, sigev_signo); + sig->sigev_signo = linux_to_bsd_signal(l_sig->sigev_signo); PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr); break; default: From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:35:10 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 804CCA69971; Sat, 9 Jan 2016 17:35:10 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F34610EA; Sat, 9 Jan 2016 17:35:10 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HZ9Sr061657; Sat, 9 Jan 2016 17:35:09 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HZ9px061656; Sat, 9 Jan 2016 17:35:09 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091735.u09HZ9px061656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293580 - stable/10/sys/compat/linprocfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:35:10 -0000 Author: dchagin Date: Sat Jan 9 17:35:09 2016 New Revision: 293580 URL: https://svnweb.freebsd.org/changeset/base/293580 Log: MFC r283478: Simplify linprocfs_doprocenviron(). Remove extra proc visibility checks and initialize pn_vis by well known procfs_candebug(). Modified: stable/10/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/10/sys/compat/linprocfs/linprocfs.c Sat Jan 9 17:33:13 2016 (r293579) +++ stable/10/sys/compat/linprocfs/linprocfs.c Sat Jan 9 17:35:09 2016 (r293580) @@ -931,32 +931,15 @@ linprocfs_doproccmdline(PFS_FILL_ARGS) static int linprocfs_doprocenviron(PFS_FILL_ARGS) { - int ret; - - PROC_LOCK(p); - if ((ret = p_candebug(td, p)) != 0) { - PROC_UNLOCK(p); - return (ret); - } /* * Mimic linux behavior and pass only processes with usermode * address space as valid. Return zero silently otherwize. */ - if (p->p_vmspace == &vmspace0) { - PROC_UNLOCK(p); - return (0); - } - - if ((p->p_flag & P_SYSTEM) != 0) { - PROC_UNLOCK(p); + if (p->p_vmspace == &vmspace0) return (0); - } - PROC_UNLOCK(p); - - ret = proc_getenvv(td, p, sb); - return (ret); + return (proc_getenvv(td, p, sb)); } static char l32_map_str[] = "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n"; @@ -1468,7 +1451,7 @@ linprocfs_init(PFS_INIT_ARGS) pfs_create_link(dir, "cwd", &linprocfs_doproccwd, NULL, NULL, NULL, 0); pfs_create_file(dir, "environ", &linprocfs_doprocenviron, - NULL, NULL, NULL, PFS_RD); + NULL, &procfs_candebug, NULL, PFS_RD); pfs_create_link(dir, "exe", &procfs_doprocfile, NULL, &procfs_notsystem, NULL, 0); pfs_create_file(dir, "maps", &linprocfs_doprocmaps, From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:39:43 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A716DA69AC6; Sat, 9 Jan 2016 17:39:43 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AAF01560; Sat, 9 Jan 2016 17:39:43 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Hdgs3062010; Sat, 9 Jan 2016 17:39:42 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HdfpG062002; Sat, 9 Jan 2016 17:39:41 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091739.u09HdfpG062002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293581 - in stable/10/sys: amd64/amd64 amd64/ia32 arm/arm i386/i386 mips/mips powerpc/powerpc sparc64/sparc64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:39:43 -0000 Author: dchagin Date: Sat Jan 9 17:39:41 2016 New Revision: 293581 URL: https://svnweb.freebsd.org/changeset/base/293581 Log: MFC r283479: The kernel sends signals to the processes via ABI specific sv_sendsig method. Native ABI do not need signal conversion, only emulators may want this. Usually emulators implements its own sv_sendsig method. For now only ibcs2 emulator does not have own sv_sendsig implementation and depends on native sendsig() method. So, remove any extra attempts to convert signal numbers from native sendsig() methods except from i386 where ibsc2 is living. Modified: stable/10/sys/amd64/amd64/machdep.c stable/10/sys/amd64/ia32/ia32_signal.c stable/10/sys/arm/arm/machdep.c stable/10/sys/i386/i386/machdep.c stable/10/sys/mips/mips/freebsd32_machdep.c stable/10/sys/mips/mips/pm_machdep.c stable/10/sys/powerpc/powerpc/exec_machdep.c stable/10/sys/sparc64/sparc64/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/machdep.c Sat Jan 9 17:35:09 2016 (r293580) +++ stable/10/sys/amd64/amd64/machdep.c Sat Jan 9 17:39:41 2016 (r293581) @@ -384,10 +384,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Align to 16 bytes. */ sfp = (struct sigframe *)((unsigned long)sp & ~0xFul); - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* Build the argument list for the signal handler. */ regs->tf_rdi = sig; /* arg 1 in %rdi */ regs->tf_rdx = (register_t)&sfp->sf_uc; /* arg 3 in %rdx */ Modified: stable/10/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/10/sys/amd64/ia32/ia32_signal.c Sat Jan 9 17:35:09 2016 (r293580) +++ stable/10/sys/amd64/ia32/ia32_signal.c Sat Jan 9 17:39:41 2016 (r293581) @@ -360,10 +360,6 @@ ia32_osendsig(sig_t catcher, ksiginfo_t } else fp = (struct ia32_sigframe3 *)regs->tf_rsp - 1; - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* Build the argument list for the signal handler. */ sf.sf_signum = sig; sf.sf_scp = (register_t)&fp->sf_siginfo.si_sc; @@ -498,10 +494,6 @@ freebsd4_ia32_sendsig(sig_t catcher, ksi sfp = (struct ia32_sigframe4 *)regs->tf_rsp - 1; PROC_UNLOCK(p); - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* Build the argument list for the signal handler. */ sf.sf_signum = sig; sf.sf_ucontext = (register_t)&sfp->sf_uc; @@ -643,10 +635,6 @@ ia32_sendsig(sig_t catcher, ksiginfo_t * sfp = (struct ia32_sigframe *)((uintptr_t)sp & ~0xF); PROC_UNLOCK(p); - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* Build the argument list for the signal handler. */ sf.sf_signum = sig; sf.sf_ucontext = (register_t)&sfp->sf_uc; Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Sat Jan 9 17:35:09 2016 (r293580) +++ stable/10/sys/arm/arm/machdep.c Sat Jan 9 17:39:41 2016 (r293581) @@ -259,10 +259,6 @@ sendsig(catcher, ksi, mask) sigexit(td, SIGILL); } - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* * Build context to run handler in. We invoke the handler * directly, only returning via the trampoline. Note the Modified: stable/10/sys/i386/i386/machdep.c ============================================================================== --- stable/10/sys/i386/i386/machdep.c Sat Jan 9 17:35:09 2016 (r293580) +++ stable/10/sys/i386/i386/machdep.c Sat Jan 9 17:39:41 2016 (r293581) @@ -400,10 +400,6 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, } else fp = (struct osigframe *)regs->tf_esp - 1; - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* Build the argument list for the signal handler. */ sf.sf_signum = sig; sf.sf_scp = (register_t)&fp->sf_siginfo.si_sc; @@ -551,10 +547,6 @@ freebsd4_sendsig(sig_t catcher, ksiginfo } else sfp = (struct sigframe4 *)regs->tf_esp - 1; - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* Build the argument list for the signal handler. */ sf.sf_signum = sig; sf.sf_ucontext = (register_t)&sfp->sf_uc; Modified: stable/10/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- stable/10/sys/mips/mips/freebsd32_machdep.c Sat Jan 9 17:35:09 2016 (r293580) +++ stable/10/sys/mips/mips/freebsd32_machdep.c Sat Jan 9 17:39:41 2016 (r293581) @@ -419,12 +419,6 @@ freebsd32_sendsig(sig_t catcher, ksiginf sfp = (struct sigframe32 *)((vm_offset_t)(td->td_frame->sp - sizeof(struct sigframe32)) & ~(sizeof(__int64_t) - 1)); - /* Translate the signal if appropriate */ - if (p->p_sysent->sv_sigtbl) { - if (sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - } - /* Build the argument list for the signal handler. */ td->td_frame->a0 = sig; td->td_frame->a2 = (register_t)(intptr_t)&sfp->sf_uc; Modified: stable/10/sys/mips/mips/pm_machdep.c ============================================================================== --- stable/10/sys/mips/mips/pm_machdep.c Sat Jan 9 17:35:09 2016 (r293580) +++ stable/10/sys/mips/mips/pm_machdep.c Sat Jan 9 17:39:41 2016 (r293581) @@ -133,12 +133,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sfp = (struct sigframe *)((vm_offset_t)(regs->sp - sizeof(struct sigframe)) & ~(sizeof(__int64_t) - 1)); - /* Translate the signal if appropriate */ - if (p->p_sysent->sv_sigtbl) { - if (sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - } - /* Build the argument list for the signal handler. */ regs->a0 = sig; regs->a2 = (register_t)(intptr_t)&sfp->sf_uc; Modified: stable/10/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/exec_machdep.c Sat Jan 9 17:35:09 2016 (r293580) +++ stable/10/sys/powerpc/powerpc/exec_machdep.c Sat Jan 9 17:39:41 2016 (r293581) @@ -231,12 +231,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, } /* - * Translate the signal if appropriate (Linux emu ?) - */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - - /* * Save the floating-point state, if necessary, then copy it. */ /* XXX */ Modified: stable/10/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/10/sys/sparc64/sparc64/machdep.c Sat Jan 9 17:35:09 2016 (r293580) +++ stable/10/sys/sparc64/sparc64/machdep.c Sat Jan 9 17:39:41 2016 (r293581) @@ -658,10 +658,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, fp = (struct frame *)sfp - 1; - /* Translate the signal if appropriate. */ - if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - /* Build the argument list for the signal handler. */ tf->tf_out[0] = sig; tf->tf_out[2] = (register_t)&sfp->sf_uc; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:41:02 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 496C7A69B40; Sat, 9 Jan 2016 17:41:02 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CE1718B1; Sat, 9 Jan 2016 17:41:01 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Hf13G062134; Sat, 9 Jan 2016 17:41:01 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Hf0l2062126; Sat, 9 Jan 2016 17:41:00 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091741.u09Hf0l2062126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293582 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:41:02 -0000 Author: dchagin Date: Sat Jan 9 17:41:00 2016 New Revision: 293582 URL: https://svnweb.freebsd.org/changeset/base/293582 Log: MFC r283480: Add utimensat() system call. Modified: stable/10/sys/amd64/linux/linux_dummy.c stable/10/sys/amd64/linux/syscalls.master stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_misc.c stable/10/sys/compat/linux/linux_misc.h stable/10/sys/i386/linux/linux_dummy.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 17:39:41 2016 (r293581) +++ stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 17:41:00 2016 (r293582) @@ -98,7 +98,6 @@ DUMMY(tee); DUMMY(sync_file_range); DUMMY(vmsplice); DUMMY(move_pages); -DUMMY(utimensat); DUMMY(epoll_pwait); DUMMY(signalfd); DUMMY(timerfd); Modified: stable/10/sys/amd64/linux/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 17:39:41 2016 (r293581) +++ stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 17:41:00 2016 (r293582) @@ -468,7 +468,8 @@ 277 AUE_NULL STD { int linux_sync_file_range(void); } 278 AUE_NULL STD { int linux_vmsplice(void); } 279 AUE_NULL STD { int linux_move_pages(void); } -280 AUE_NULL STD { int linux_utimensat(void); } +280 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ + const struct l_timespec *times, l_int flags); } 281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ l_int maxevents, l_int timeout, l_sigset_t *mask); } 282 AUE_NULL STD { int linux_signalfd(void); } Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 17:39:41 2016 (r293581) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 17:41:00 2016 (r293582) @@ -105,7 +105,6 @@ DUMMY(move_pages); DUMMY(getcpu); DUMMY(epoll_pwait); /* linux 2.6.22: */ -DUMMY(utimensat); DUMMY(signalfd); DUMMY(timerfd_create); /* linux 2.6.25: */ Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 17:39:41 2016 (r293581) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 17:41:00 2016 (r293582) @@ -533,7 +533,8 @@ 319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ l_int maxevents, l_int timeout, l_osigset_t *mask); } ; linux 2.6.22: -320 AUE_NULL STD { int linux_utimensat(void); } +320 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ + const struct l_timespec *times, l_int flags); } 321 AUE_NULL STD { int linux_signalfd(void); } 322 AUE_NULL STD { int linux_timerfd_create(void); } 323 AUE_NULL STD { int linux_eventfd(l_uint initval); } Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 17:39:41 2016 (r293581) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 17:41:00 2016 (r293582) @@ -823,6 +823,87 @@ linux_utimes(struct thread *td, struct l return (error); } +int +linux_utimensat(struct thread *td, struct linux_utimensat_args *args) +{ + struct l_timespec l_times[2]; + struct timespec times[2], *timesp = NULL; + char *path = NULL; + int error, dfd, flags = 0; + + dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; + +#ifdef DEBUG + if (ldebug(utimensat)) + printf(ARGS(utimensat, "%d, *"), dfd); +#endif + + if (args->flags & ~LINUX_AT_SYMLINK_NOFOLLOW) + return (EINVAL); + + if (args->times != NULL) { + error = copyin(args->times, l_times, sizeof(l_times)); + if (error != 0) + return (error); + + if (l_times[0].tv_nsec > 999999999 || + l_times[1].tv_nsec > 999999999) + return (EINVAL); + + times[0].tv_sec = l_times[0].tv_sec; + switch (l_times[0].tv_nsec) + { + case LINUX_UTIME_OMIT: + times[0].tv_nsec = UTIME_OMIT; + break; + case LINUX_UTIME_NOW: + times[0].tv_nsec = UTIME_NOW; + break; + default: + times[0].tv_nsec = l_times[0].tv_nsec; + } + + times[1].tv_sec = l_times[1].tv_sec; + switch (l_times[1].tv_nsec) + { + case LINUX_UTIME_OMIT: + times[1].tv_nsec = UTIME_OMIT; + break; + case LINUX_UTIME_NOW: + times[1].tv_nsec = UTIME_NOW; + break; + default: + times[1].tv_nsec = l_times[1].tv_nsec; + break; + } + timesp = times; + } + + if (times[0].tv_nsec == UTIME_OMIT && times[1].tv_nsec == UTIME_OMIT) + /* This breaks POSIX, but is what the Linux kernel does + * _on purpose_ (documented in the man page for utimensat(2)), + * so we must follow that behaviour. */ + return (0); + + if (args->pathname != NULL) + LCONVPATHEXIST_AT(td, args->pathname, &path, dfd); + else if (args->flags != 0) + return (EINVAL); + + if (args->flags & LINUX_AT_SYMLINK_NOFOLLOW) + flags |= AT_SYMLINK_NOFOLLOW; + + if (path == NULL) + error = kern_futimens(td, dfd, timesp, UIO_SYSSPACE); + else { + error = kern_utimensat(td, dfd, path, UIO_SYSSPACE, timesp, + UIO_SYSSPACE, flags); + LFREEPATH(path); + } + + return (error); +} + int linux_futimesat(struct thread *td, struct linux_futimesat_args *args) { Modified: stable/10/sys/compat/linux/linux_misc.h ============================================================================== --- stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 17:39:41 2016 (r293581) +++ stable/10/sys/compat/linux/linux_misc.h Sat Jan 9 17:41:00 2016 (r293582) @@ -119,6 +119,9 @@ struct l_new_utsname { #define LINUX_CLOCK_REALTIME_HR 4 #define LINUX_CLOCK_MONOTONIC_HR 5 +#define LINUX_UTIME_NOW 0x3FFFFFFF +#define LINUX_UTIME_OMIT 0x3FFFFFFE + extern int stclohz; #define LINUX_WNOHANG 0x00000001 Modified: stable/10/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 17:39:41 2016 (r293581) +++ stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 17:41:00 2016 (r293582) @@ -101,7 +101,6 @@ DUMMY(move_pages); DUMMY(getcpu); DUMMY(epoll_pwait); /* linux 2.6.22: */ -DUMMY(utimensat); DUMMY(signalfd); DUMMY(timerfd_create); /* linux 2.6.25: */ Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 17:39:41 2016 (r293581) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 17:41:00 2016 (r293582) @@ -541,7 +541,8 @@ 319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ l_int maxevents, l_int timeout, l_osigset_t *mask); } ; linux 2.6.22: -320 AUE_NULL STD { int linux_utimensat(void); } +320 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ + const struct l_timespec *times, l_int flags); } 321 AUE_NULL STD { int linux_signalfd(void); } 322 AUE_NULL STD { int linux_timerfd_create(void); } 323 AUE_NULL STD { int linux_eventfd(l_uint initval); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:42:28 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38CD2A69CE4; Sat, 9 Jan 2016 17:42:28 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 013B61B03; Sat, 9 Jan 2016 17:42:27 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HgRTl064796; Sat, 9 Jan 2016 17:42:27 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HgPgm064165; Sat, 9 Jan 2016 17:42:25 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091742.u09HgPgm064165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293583 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:42:28 -0000 Author: dchagin Date: Sat Jan 9 17:42:25 2016 New Revision: 293583 URL: https://svnweb.freebsd.org/changeset/base/293583 Log: Regen for r293582. Modified: stable/10/sys/amd64/linux/linux_proto.h stable/10/sys/amd64/linux/linux_syscall.h stable/10/sys/amd64/linux/linux_syscalls.c stable/10/sys/amd64/linux/linux_sysent.c stable/10/sys/amd64/linux/linux_systrace_args.c stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 17:42:25 2016 (r293583) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -985,7 +985,10 @@ struct linux_move_pages_args { register_t dummy; }; struct linux_utimensat_args { - register_t dummy; + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char times_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * times; char times_r_[PADR_(const struct l_timespec *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_epoll_pwait_args { char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; @@ -1612,7 +1615,7 @@ int linux_finit_module(struct thread *, #define LINUX_SYS_AUE_linux_sync_file_range AUE_NULL #define LINUX_SYS_AUE_linux_vmsplice AUE_NULL #define LINUX_SYS_AUE_linux_move_pages AUE_NULL -#define LINUX_SYS_AUE_linux_utimensat AUE_NULL +#define LINUX_SYS_AUE_linux_utimensat AUE_FUTIMESAT #define LINUX_SYS_AUE_linux_epoll_pwait AUE_NULL #define LINUX_SYS_AUE_linux_signalfd AUE_NULL #define LINUX_SYS_AUE_linux_timerfd AUE_NULL Modified: stable/10/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 17:42:25 2016 (r293583) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin */ #define LINUX_SYS_read 0 Modified: stable/10/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 17:42:25 2016 (r293583) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 17:42:25 2016 (r293583) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin */ #include @@ -298,7 +298,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 277 = linux_sync_file_range */ { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 278 = linux_vmsplice */ { 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 279 = linux_move_pages */ - { 0, (sy_call_t *)linux_utimensat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 280 = linux_utimensat */ + { AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 280 = linux_utimensat */ { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 281 = linux_epoll_pwait */ { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 282 = linux_signalfd */ { 0, (sy_call_t *)linux_timerfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_timerfd */ Modified: stable/10/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 17:42:25 2016 (r293583) @@ -2052,7 +2052,12 @@ systrace_args(int sysnum, void *params, } /* linux_utimensat */ case 280: { - *n_args = 0; + struct linux_utimensat_args *p = params; + iarg[0] = p->dfd; /* l_int */ + uarg[1] = (intptr_t) p->pathname; /* const char * */ + uarg[2] = (intptr_t) p->times; /* const struct l_timespec * */ + iarg[3] = p->flags; /* l_int */ + *n_args = 4; break; } /* linux_epoll_pwait */ @@ -5355,6 +5360,22 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_utimensat */ case 280: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "const char *"; + break; + case 2: + p = "const struct l_timespec *"; + break; + case 3: + p = "l_int"; + break; + default: + break; + }; break; /* linux_epoll_pwait */ case 281: @@ -6698,6 +6719,9 @@ systrace_return_setargdesc(int sysnum, i case 279: /* linux_utimensat */ case 280: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_epoll_pwait */ case 281: if (ndx == 0 || ndx == 1) Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 17:42:25 2016 (r293583) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293569 2016-01-09 17:18:03Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293582 2016-01-09 17:41:00Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1052,7 +1052,10 @@ struct linux_epoll_pwait_args { char mask_l_[PADL_(l_osigset_t *)]; l_osigset_t * mask; char mask_r_[PADR_(l_osigset_t *)]; }; struct linux_utimensat_args { - register_t dummy; + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char times_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * times; char times_r_[PADR_(const struct l_timespec *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_signalfd_args { register_t dummy; @@ -1702,7 +1705,7 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_move_pages AUE_NULL #define LINUX_SYS_AUE_linux_getcpu AUE_NULL #define LINUX_SYS_AUE_linux_epoll_pwait AUE_NULL -#define LINUX_SYS_AUE_linux_utimensat AUE_NULL +#define LINUX_SYS_AUE_linux_utimensat AUE_FUTIMESAT #define LINUX_SYS_AUE_linux_signalfd AUE_NULL #define LINUX_SYS_AUE_linux_timerfd_create AUE_NULL #define LINUX_SYS_AUE_linux_eventfd AUE_NULL Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 17:42:25 2016 (r293583) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293569 2016-01-09 17:18:03Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293582 2016-01-09 17:41:00Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 17:42:25 2016 (r293583) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293569 2016-01-09 17:18:03Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293582 2016-01-09 17:41:00Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 17:42:25 2016 (r293583) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293569 2016-01-09 17:18:03Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293582 2016-01-09 17:41:00Z dchagin */ #include "opt_compat.h" @@ -339,7 +339,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_move_pages */ { 0, (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getcpu */ { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */ - { 0, (sy_call_t *)linux_utimensat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */ + { AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */ { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */ { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 17:42:25 2016 (r293583) @@ -2170,7 +2170,12 @@ systrace_args(int sysnum, void *params, } /* linux_utimensat */ case 320: { - *n_args = 0; + struct linux_utimensat_args *p = params; + iarg[0] = p->dfd; /* l_int */ + uarg[1] = (intptr_t) p->pathname; /* const char * */ + uarg[2] = (intptr_t) p->times; /* const struct l_timespec * */ + iarg[3] = p->flags; /* l_int */ + *n_args = 4; break; } /* linux_signalfd */ @@ -5584,6 +5589,22 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_utimensat */ case 320: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "const char *"; + break; + case 2: + p = "const struct l_timespec *"; + break; + case 3: + p = "l_int"; + break; + default: + break; + }; break; /* linux_signalfd */ case 321: @@ -6966,6 +6987,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_utimensat */ case 320: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_signalfd */ case 321: /* linux_timerfd_create */ Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 17:42:25 2016 (r293583) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1070,7 +1070,10 @@ struct linux_epoll_pwait_args { char mask_l_[PADL_(l_osigset_t *)]; l_osigset_t * mask; char mask_r_[PADR_(l_osigset_t *)]; }; struct linux_utimensat_args { - register_t dummy; + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char times_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * times; char times_r_[PADR_(const struct l_timespec *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_signalfd_args { register_t dummy; @@ -1724,7 +1727,7 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_move_pages AUE_NULL #define LINUX_SYS_AUE_linux_getcpu AUE_NULL #define LINUX_SYS_AUE_linux_epoll_pwait AUE_NULL -#define LINUX_SYS_AUE_linux_utimensat AUE_NULL +#define LINUX_SYS_AUE_linux_utimensat AUE_FUTIMESAT #define LINUX_SYS_AUE_linux_signalfd AUE_NULL #define LINUX_SYS_AUE_linux_timerfd_create AUE_NULL #define LINUX_SYS_AUE_linux_eventfd AUE_NULL Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 17:42:25 2016 (r293583) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 17:42:25 2016 (r293583) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 17:42:25 2016 (r293583) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293569 2016-01-09 17:18:03Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin */ #include @@ -338,7 +338,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_move_pages */ { 0, (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getcpu */ { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */ - { 0, (sy_call_t *)linux_utimensat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */ + { AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */ { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */ { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ { AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 17:41:00 2016 (r293582) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 17:42:25 2016 (r293583) @@ -2246,7 +2246,12 @@ systrace_args(int sysnum, void *params, } /* linux_utimensat */ case 320: { - *n_args = 0; + struct linux_utimensat_args *p = params; + iarg[0] = p->dfd; /* l_int */ + uarg[1] = (intptr_t) p->pathname; /* const char * */ + uarg[2] = (intptr_t) p->times; /* const struct l_timespec * */ + iarg[3] = p->flags; /* l_int */ + *n_args = 4; break; } /* linux_signalfd */ @@ -5815,6 +5820,22 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_utimensat */ case 320: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "const char *"; + break; + case 2: + p = "const struct l_timespec *"; + break; + case 3: + p = "l_int"; + break; + default: + break; + }; break; /* linux_signalfd */ case 321: @@ -7244,6 +7265,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_utimensat */ case 320: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_signalfd */ case 321: /* linux_timerfd_create */ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:44:09 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F5CEA69D64; Sat, 9 Jan 2016 17:44:09 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D7141CAE; Sat, 9 Jan 2016 17:44:09 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Hi85o064923; Sat, 9 Jan 2016 17:44:08 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Hi8ju064922; Sat, 9 Jan 2016 17:44:08 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091744.u09Hi8ju064922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293584 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:44:09 -0000 Author: dchagin Date: Sat Jan 9 17:44:08 2016 New Revision: 293584 URL: https://svnweb.freebsd.org/changeset/base/293584 Log: MFC r283483: Convert signal number to native for VT_SETMODE ioctl and remove strange and invalid ISSIGVALID macro. The code has not been tested right way but it was originally broken. Modified: stable/10/sys/compat/linux/linux_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.c Sat Jan 9 17:42:25 2016 (r293583) +++ stable/10/sys/compat/linux/linux_ioctl.c Sat Jan 9 17:44:08 2016 (r293584) @@ -1976,8 +1976,6 @@ linux_ioctl_sound(struct thread *td, str * Console related ioctls */ -#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG) - static int linux_ioctl_console(struct thread *td, struct linux_ioctl_args *args) { @@ -2060,8 +2058,16 @@ linux_ioctl_console(struct thread *td, s struct vt_mode mode; if ((error = copyin((void *)args->arg, &mode, sizeof(mode)))) break; - if (!ISSIGVALID(mode.frsig) && ISSIGVALID(mode.acqsig)) - mode.frsig = mode.acqsig; + if (LINUX_SIG_VALID(mode.relsig)) + mode.relsig = linux_to_bsd_signal(mode.relsig); + else + mode.relsig = 0; + if (LINUX_SIG_VALID(mode.acqsig)) + mode.acqsig = linux_to_bsd_signal(mode.acqsig); + else + mode.acqsig = 0; + /* XXX. Linux ignores frsig and set it to 0. */ + mode.frsig = 0; if ((error = copyout(&mode, (void *)args->arg, sizeof(mode)))) break; args->cmd = VT_SETMODE; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:45:04 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2409EA69DEF; Sat, 9 Jan 2016 17:45:04 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFACD1E05; Sat, 9 Jan 2016 17:45:03 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Hj3OU065029; Sat, 9 Jan 2016 17:45:03 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Hj2Ul065022; Sat, 9 Jan 2016 17:45:02 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091745.u09Hj2Ul065022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293585 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:45:04 -0000 Author: dchagin Date: Sat Jan 9 17:45:02 2016 New Revision: 293585 URL: https://svnweb.freebsd.org/changeset/base/293585 Log: MFC r283484: Implement epoll_pwait() system call. Modified: stable/10/sys/amd64/linux/linux_dummy.c stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_event.c stable/10/sys/i386/linux/linux_dummy.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 17:44:08 2016 (r293584) +++ stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 17:45:02 2016 (r293585) @@ -98,7 +98,6 @@ DUMMY(tee); DUMMY(sync_file_range); DUMMY(vmsplice); DUMMY(move_pages); -DUMMY(epoll_pwait); DUMMY(signalfd); DUMMY(timerfd); DUMMY(timerfd_settime); Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 17:44:08 2016 (r293584) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 17:45:02 2016 (r293585) @@ -103,7 +103,6 @@ DUMMY(vmsplice); DUMMY(move_pages); /* linux 2.6.19: */ DUMMY(getcpu); -DUMMY(epoll_pwait); /* linux 2.6.22: */ DUMMY(signalfd); DUMMY(timerfd_create); Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 17:44:08 2016 (r293584) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 17:45:02 2016 (r293585) @@ -531,7 +531,7 @@ ; linux 2.6.19: 318 AUE_NULL STD { int linux_getcpu(void); } 319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ - l_int maxevents, l_int timeout, l_osigset_t *mask); } + l_int maxevents, l_int timeout, l_sigset_t *mask); } ; linux 2.6.22: 320 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ const struct l_timespec *times, l_int flags); } Modified: stable/10/sys/compat/linux/linux_event.c ============================================================================== --- stable/10/sys/compat/linux/linux_event.c Sat Jan 9 17:44:08 2016 (r293584) +++ stable/10/sys/compat/linux/linux_event.c Sat Jan 9 17:45:02 2016 (r293585) @@ -468,8 +468,9 @@ leave1: /* * Wait for a filter to be triggered on the epoll file descriptor. */ -int -linux_epoll_wait(struct thread *td, struct linux_epoll_wait_args *args) +static int +linux_epoll_wait_common(struct thread *td, int epfd, struct epoll_event *events, + int maxevents, int timeout, sigset_t *uset) { struct file *epfp; struct timespec ts, *tsp; @@ -480,33 +481,49 @@ linux_epoll_wait(struct thread *td, stru NULL}; int error; - if (args->maxevents <= 0 || args->maxevents > LINUX_MAX_EVENTS) + if (maxevents <= 0 || maxevents > LINUX_MAX_EVENTS) return (EINVAL); - error = fget(td, args->epfd, + if (uset != NULL) { + error = kern_sigprocmask(td, SIG_SETMASK, uset, + &td->td_oldsigmask, 0); + if (error != 0) + return (error); + td->td_pflags |= TDP_OLDMASK; + /* + * Make sure that ast() is called on return to + * usermode and TDP_OLDMASK is cleared, restoring old + * sigmask. + */ + thread_lock(td); + td->td_flags |= TDF_ASTPENDING; + thread_unlock(td); + } + + error = fget(td, epfd, cap_rights_init(&rights, CAP_KQUEUE_EVENT), &epfp); if (error != 0) return (error); - coargs.leventlist = args->events; + coargs.leventlist = events; coargs.p = td->td_proc; coargs.count = 0; coargs.error = 0; - if (args->timeout != -1) { - if (args->timeout < 0) { + if (timeout != -1) { + if (timeout < 0) { error = EINVAL; goto leave; } /* Convert from milliseconds to timespec. */ - ts.tv_sec = args->timeout / 1000; - ts.tv_nsec = (args->timeout % 1000) * 1000000; + ts.tv_sec = timeout / 1000; + ts.tv_nsec = (timeout % 1000) * 1000000; tsp = &ts; } else { tsp = NULL; } - error = kern_kevent_fp(td, epfp, 0, args->maxevents, &k_ops, tsp); + error = kern_kevent_fp(td, epfp, 0, maxevents, &k_ops, tsp); if (error == 0 && coargs.error != 0) error = coargs.error; @@ -521,6 +538,33 @@ leave: return (error); } +int +linux_epoll_wait(struct thread *td, struct linux_epoll_wait_args *args) +{ + + return (linux_epoll_wait_common(td, args->epfd, args->events, + args->maxevents, args->timeout, NULL)); +} + +int +linux_epoll_pwait(struct thread *td, struct linux_epoll_pwait_args *args) +{ + sigset_t mask, *pmask; + l_sigset_t lmask; + int error; + + if (args->mask != NULL) { + error = copyin(args->mask, &lmask, sizeof(l_sigset_t)); + if (error != 0) + return (error); + linux_to_bsd_sigset(&lmask, &mask); + pmask = &mask; + } else + pmask = NULL; + return (linux_epoll_wait_common(td, args->epfd, args->events, + args->maxevents, args->timeout, pmask)); +} + static int epoll_delete_event(struct thread *td, struct file *epfp, int fd, int filter) { Modified: stable/10/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 17:44:08 2016 (r293584) +++ stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 17:45:02 2016 (r293585) @@ -99,7 +99,6 @@ DUMMY(vmsplice); DUMMY(move_pages); /* linux 2.6.19: */ DUMMY(getcpu); -DUMMY(epoll_pwait); /* linux 2.6.22: */ DUMMY(signalfd); DUMMY(timerfd_create); Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 17:44:08 2016 (r293584) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 17:45:02 2016 (r293585) @@ -539,7 +539,7 @@ ; linux 2.6.19: 318 AUE_NULL STD { int linux_getcpu(void); } 319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ - l_int maxevents, l_int timeout, l_osigset_t *mask); } + l_int maxevents, l_int timeout, l_sigset_t *mask); } ; linux 2.6.22: 320 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ const struct l_timespec *times, l_int flags); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:47:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65BC7A69ECA; Sat, 9 Jan 2016 17:47:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 237A21FBC; Sat, 9 Jan 2016 17:47:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HlwJi065166; Sat, 9 Jan 2016 17:47:58 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HlvVt065156; Sat, 9 Jan 2016 17:47:57 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091747.u09HlvVt065156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:47:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293586 - in stable/10/sys: amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:47:59 -0000 Author: dchagin Date: Sat Jan 9 17:47:57 2016 New Revision: 293586 URL: https://svnweb.freebsd.org/changeset/base/293586 Log: Regen for r293585. Modified: stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 17:45:02 2016 (r293585) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 17:47:57 2016 (r293586) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293582 2016-01-09 17:41:00Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293585 2016-01-09 17:45:02Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1049,7 +1049,7 @@ struct linux_epoll_pwait_args { char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)]; char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)]; char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)]; - char mask_l_[PADL_(l_osigset_t *)]; l_osigset_t * mask; char mask_r_[PADR_(l_osigset_t *)]; + char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; }; struct linux_utimensat_args { char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 17:45:02 2016 (r293585) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 17:47:57 2016 (r293586) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293582 2016-01-09 17:41:00Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293585 2016-01-09 17:45:02Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 17:45:02 2016 (r293585) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 17:47:57 2016 (r293586) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293582 2016-01-09 17:41:00Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293585 2016-01-09 17:45:02Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 17:45:02 2016 (r293585) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 17:47:57 2016 (r293586) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293582 2016-01-09 17:41:00Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293585 2016-01-09 17:45:02Z dchagin */ #include "opt_compat.h" Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 17:45:02 2016 (r293585) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 17:47:57 2016 (r293586) @@ -2164,7 +2164,7 @@ systrace_args(int sysnum, void *params, uarg[1] = (intptr_t) p->events; /* struct epoll_event * */ iarg[2] = p->maxevents; /* l_int */ iarg[3] = p->timeout; /* l_int */ - uarg[4] = (intptr_t) p->mask; /* l_osigset_t * */ + uarg[4] = (intptr_t) p->mask; /* l_sigset_t * */ *n_args = 5; break; } @@ -5581,7 +5581,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 4: - p = "l_osigset_t *"; + p = "l_sigset_t *"; break; default: break; Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 17:45:02 2016 (r293585) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 17:47:57 2016 (r293586) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293585 2016-01-09 17:45:02Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1067,7 +1067,7 @@ struct linux_epoll_pwait_args { char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)]; char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)]; char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)]; - char mask_l_[PADL_(l_osigset_t *)]; l_osigset_t * mask; char mask_r_[PADR_(l_osigset_t *)]; + char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; }; struct linux_utimensat_args { char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 17:45:02 2016 (r293585) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 17:47:57 2016 (r293586) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293585 2016-01-09 17:45:02Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 17:45:02 2016 (r293585) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 17:47:57 2016 (r293586) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293585 2016-01-09 17:45:02Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 17:45:02 2016 (r293585) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 17:47:57 2016 (r293586) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293585 2016-01-09 17:45:02Z dchagin */ #include Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 17:45:02 2016 (r293585) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 17:47:57 2016 (r293586) @@ -2240,7 +2240,7 @@ systrace_args(int sysnum, void *params, uarg[1] = (intptr_t) p->events; /* struct epoll_event * */ iarg[2] = p->maxevents; /* l_int */ iarg[3] = p->timeout; /* l_int */ - uarg[4] = (intptr_t) p->mask; /* l_osigset_t * */ + uarg[4] = (intptr_t) p->mask; /* l_sigset_t * */ *n_args = 5; break; } @@ -5812,7 +5812,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 4: - p = "l_osigset_t *"; + p = "l_sigset_t *"; break; default: break; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:49:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75A3AA69F42; Sat, 9 Jan 2016 17:49:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50812114C; Sat, 9 Jan 2016 17:49:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Hn6XQ065269; Sat, 9 Jan 2016 17:49:06 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Hn6Qj065265; Sat, 9 Jan 2016 17:49:06 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091749.u09Hn6Qj065265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293587 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:49:07 -0000 Author: dchagin Date: Sat Jan 9 17:49:05 2016 New Revision: 293587 URL: https://svnweb.freebsd.org/changeset/base/293587 Log: MFC r283487: Reduce duplication between MD Linux code by moving msg related struct definitions out into the compat/linux/linux_socket.h Modified: stable/10/sys/amd64/linux/linux.h stable/10/sys/amd64/linux32/linux.h stable/10/sys/compat/linux/linux_socket.h stable/10/sys/i386/linux/linux.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux.h ============================================================================== --- stable/10/sys/amd64/linux/linux.h Sat Jan 9 17:47:57 2016 (r293586) +++ stable/10/sys/amd64/linux/linux.h Sat Jan 9 17:49:05 2016 (r293587) @@ -447,22 +447,6 @@ struct l_sockaddr { char sa_data[14]; }; -struct l_msghdr { - l_uintptr_t msg_name; - l_int msg_namelen; - l_uintptr_t msg_iov; - l_size_t msg_iovlen; - l_uintptr_t msg_control; - l_size_t msg_controllen; - l_uint msg_flags; -}; - -struct l_cmsghdr { - l_size_t cmsg_len; - l_int cmsg_level; - l_int cmsg_type; -}; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; Modified: stable/10/sys/amd64/linux32/linux.h ============================================================================== --- stable/10/sys/amd64/linux32/linux.h Sat Jan 9 17:47:57 2016 (r293586) +++ stable/10/sys/amd64/linux32/linux.h Sat Jan 9 17:49:05 2016 (r293587) @@ -525,22 +525,6 @@ struct l_sockaddr { char sa_data[14]; } __packed; -struct l_msghdr { - l_uintptr_t msg_name; - l_int msg_namelen; - l_uintptr_t msg_iov; - l_size_t msg_iovlen; - l_uintptr_t msg_control; - l_size_t msg_controllen; - l_uint msg_flags; -}; - -struct l_cmsghdr { - l_size_t cmsg_len; - l_int cmsg_level; - l_int cmsg_type; -}; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; Modified: stable/10/sys/compat/linux/linux_socket.h ============================================================================== --- stable/10/sys/compat/linux/linux_socket.h Sat Jan 9 17:47:57 2016 (r293586) +++ stable/10/sys/compat/linux/linux_socket.h Sat Jan 9 17:49:05 2016 (r293587) @@ -55,6 +55,22 @@ #define LINUX_SCM_RIGHTS 0x01 #define LINUX_SCM_CREDENTIALS 0x02 +struct l_msghdr { + l_uintptr_t msg_name; + l_int msg_namelen; + l_uintptr_t msg_iov; + l_size_t msg_iovlen; + l_uintptr_t msg_control; + l_size_t msg_controllen; + l_uint msg_flags; +}; + +struct l_cmsghdr { + l_size_t cmsg_len; + l_int cmsg_level; + l_int cmsg_type; +}; + /* Ancilliary data object information macros */ #define LINUX_CMSG_ALIGN(len) roundup2(len, sizeof(l_ulong)) Modified: stable/10/sys/i386/linux/linux.h ============================================================================== --- stable/10/sys/i386/linux/linux.h Sat Jan 9 17:47:57 2016 (r293586) +++ stable/10/sys/i386/linux/linux.h Sat Jan 9 17:49:05 2016 (r293587) @@ -504,22 +504,6 @@ struct l_sockaddr { char sa_data[14]; }; -struct l_msghdr { - l_uintptr_t msg_name; - l_int msg_namelen; - l_uintptr_t msg_iov; - l_size_t msg_iovlen; - l_uintptr_t msg_control; - l_size_t msg_controllen; - l_uint msg_flags; -}; - -struct l_cmsghdr { - l_size_t cmsg_len; - l_int cmsg_level; - l_int cmsg_type; -}; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:50:15 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 349FCA69FF4; Sat, 9 Jan 2016 17:50:15 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04ED712E1; Sat, 9 Jan 2016 17:50:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HoEcC065384; Sat, 9 Jan 2016 17:50:14 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HoDYw065376; Sat, 9 Jan 2016 17:50:13 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091750.u09HoDYw065376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293588 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:50:15 -0000 Author: dchagin Date: Sat Jan 9 17:50:13 2016 New Revision: 293588 URL: https://svnweb.freebsd.org/changeset/base/293588 Log: MFC r283488: Implement recvmmsg() and sendmmsg() system calls. Modified: stable/10/sys/amd64/linux/linux_dummy.c stable/10/sys/amd64/linux/syscalls.master stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_socket.c stable/10/sys/compat/linux/linux_socket.h stable/10/sys/i386/linux/linux_dummy.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 17:49:05 2016 (r293587) +++ stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 17:50:13 2016 (r293588) @@ -108,14 +108,12 @@ DUMMY(preadv); DUMMY(pwritev); DUMMY(rt_tsigqueueinfo); DUMMY(perf_event_open); -DUMMY(recvmmsg); DUMMY(fanotify_init); DUMMY(fanotify_mark); DUMMY(name_to_handle_at); DUMMY(open_by_handle_at); DUMMY(clock_adjtime); DUMMY(syncfs); -DUMMY(sendmmsg); DUMMY(setns); DUMMY(process_vm_readv); DUMMY(process_vm_writev); Modified: stable/10/sys/amd64/linux/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 17:49:05 2016 (r293587) +++ stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 17:50:13 2016 (r293588) @@ -492,7 +492,9 @@ 296 AUE_NULL STD { int linux_pwritev(void); } 297 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); } 298 AUE_NULL STD { int linux_perf_event_open(void); } -299 AUE_NULL STD { int linux_recvmmsg(void); } +299 AUE_NULL STD { int linux_recvmmsg(l_int s, \ + struct l_mmsghdr *msg, l_uint vlen, \ + l_uint flags, struct l_timespec *timeout); } 300 AUE_NULL STD { int linux_fanotify_init(void); } 301 AUE_NULL STD { int linux_fanotify_mark(void); } 302 AUE_NULL STD { int linux_prlimit64(l_pid_t pid, l_uint resource, \ @@ -501,7 +503,9 @@ 304 AUE_NULL STD { int linux_open_by_handle_at(void); } 305 AUE_NULL STD { int linux_clock_adjtime(void); } 306 AUE_NULL STD { int linux_syncfs(void); } -307 AUE_NULL STD { int linux_sendmmsg(void); } +307 AUE_NULL STD { int linux_sendmmsg(l_int s, \ + struct l_mmsghdr *msg, l_uint vlen, \ + l_uint flags); } 308 AUE_NULL STD { int linux_setns(void); } 309 AUE_NULL STD { int linux_process_vm_readv(void); } 310 AUE_NULL STD { int linux_process_vm_writev(void); } Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 17:49:05 2016 (r293587) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 17:50:13 2016 (r293588) @@ -119,7 +119,6 @@ DUMMY(pwritev); DUMMY(rt_tsigqueueinfo); DUMMY(perf_event_open); /* linux 2.6.33: */ -DUMMY(recvmmsg); DUMMY(fanotify_init); DUMMY(fanotify_mark); /* later: */ @@ -127,7 +126,6 @@ DUMMY(name_to_handle_at); DUMMY(open_by_handle_at); DUMMY(clock_adjtime); DUMMY(syncfs); -DUMMY(sendmmsg); DUMMY(setns); DUMMY(process_vm_readv); DUMMY(process_vm_writev); Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 17:49:05 2016 (r293587) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 17:50:13 2016 (r293588) @@ -559,7 +559,9 @@ 335 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); } 336 AUE_NULL STD { int linux_perf_event_open(void); } ; linux 2.6.33: -337 AUE_NULL STD { int linux_recvmmsg(void); } +337 AUE_NULL STD { int linux_recvmmsg(l_int s, \ + struct l_mmsghdr *msg, l_uint vlen, \ + l_uint flags, struct l_timespec *timeout); } 338 AUE_NULL STD { int linux_fanotify_init(void); } 339 AUE_NULL STD { int linux_fanotify_mark(void); } ; linux 2.6.36: @@ -572,7 +574,9 @@ 342 AUE_NULL STD { int linux_open_by_handle_at(void); } 343 AUE_NULL STD { int linux_clock_adjtime(void); } 344 AUE_NULL STD { int linux_syncfs(void); } -345 AUE_NULL STD { int linux_sendmmsg(void); } +345 AUE_NULL STD { int linux_sendmmsg(l_int s, \ + struct l_mmsghdr *msg, l_uint vlen, \ + l_uint flags); } 346 AUE_NULL STD { int linux_setns(void); } 347 AUE_NULL STD { int linux_process_vm_readv(void); } 348 AUE_NULL STD { int linux_process_vm_writev(void); } Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 17:49:05 2016 (r293587) +++ stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 17:50:13 2016 (r293588) @@ -72,9 +72,14 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #include static int linux_to_bsd_domain(int); +static int linux_sendmsg_common(struct thread *, l_int, struct l_msghdr *, + l_uint); +static int linux_recvmsg_common(struct thread *, l_int, struct l_msghdr *, + l_uint, struct msghdr *); /* * Reads a linux sockaddr and does any necessary translation. @@ -1073,8 +1078,9 @@ linux_recvfrom(struct thread *td, struct return (error); } -int -linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) +static int +linux_sendmsg_common(struct thread *td, l_int s, struct l_msghdr *msghdr, + l_uint flags) { struct cmsghdr *cmsg; struct cmsgcred cmcred; @@ -1090,8 +1096,8 @@ linux_sendmsg(struct thread *td, struct void *data; int error; - error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg)); - if (error) + error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); + if (error != 0) return (error); /* @@ -1105,7 +1111,7 @@ linux_sendmsg(struct thread *td, struct linux_msg.msg_control = PTROUT(NULL); error = linux_to_bsd_msghdr(&msg, &linux_msg); - if (error) + if (error != 0) return (error); #ifdef COMPAT_LINUX32 @@ -1114,21 +1120,21 @@ linux_sendmsg(struct thread *td, struct #else error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); #endif - if (error) + if (error != 0) return (error); control = NULL; cmsg = NULL; if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { - error = kern_getsockname(td, args->s, &sa, &datalen); - if (error) + error = kern_getsockname(td, s, &sa, &datalen); + if (error != 0) goto bad; sa_family = sa->sa_family; free(sa, M_SONAME); error = ENOBUFS; - cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK | M_ZERO); + cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK|M_ZERO); control = m_get(M_WAITOK, MT_CONTROL); if (control == NULL) goto bad; @@ -1136,7 +1142,7 @@ linux_sendmsg(struct thread *td, struct do { error = copyin(ptr_cmsg, &linux_cmsg, sizeof(struct l_cmsghdr)); - if (error) + if (error != 0) goto bad; error = EINVAL; @@ -1200,8 +1206,7 @@ linux_sendmsg(struct thread *td, struct msg.msg_iov = iov; msg.msg_flags = 0; - error = linux_sendit(td, args->s, &msg, args->flags, control, - UIO_USERSPACE); + error = linux_sendit(td, s, &msg, flags, control, UIO_USERSPACE); bad: free(iov, M_IOV); @@ -1211,11 +1216,49 @@ bad: } int -linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args) +linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) +{ + + return (linux_sendmsg_common(td, args->s, PTRIN(args->msg), + args->flags)); +} + +int +linux_sendmmsg(struct thread *td, struct linux_sendmmsg_args *args) +{ + struct l_mmsghdr *msg; + l_uint retval; + int error, datagrams; + + if (args->vlen > UIO_MAXIOV) + args->vlen = UIO_MAXIOV; + + msg = PTRIN(args->msg); + datagrams = 0; + while (datagrams < args->vlen) { + error = linux_sendmsg_common(td, args->s, &msg->msg_hdr, + args->flags); + if (error != 0) + break; + + retval = td->td_retval[0]; + error = copyout(&retval, &msg->msg_len, sizeof(msg->msg_len)); + if (error != 0) + break; + ++msg; + ++datagrams; + } + if (error == 0) + td->td_retval[0] = datagrams; + return (error); +} + +static int +linux_recvmsg_common(struct thread *td, l_int s, struct l_msghdr *msghdr, + l_uint flags, struct msghdr *msg) { struct cmsghdr *cm; struct cmsgcred *cmcred; - struct msghdr msg; struct l_cmsghdr *linux_cmsg = NULL; struct l_ucred linux_ucred; socklen_t datalen, outlen; @@ -1227,51 +1270,51 @@ linux_recvmsg(struct thread *td, struct void *data; int error, i, fd, fds, *fdp; - error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg)); - if (error) + error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); + if (error != 0) return (error); - error = linux_to_bsd_msghdr(&msg, &linux_msg); - if (error) + error = linux_to_bsd_msghdr(msg, &linux_msg); + if (error != 0) return (error); #ifdef COMPAT_LINUX32 - error = linux32_copyiniov(PTRIN(msg.msg_iov), msg.msg_iovlen, + error = linux32_copyiniov(PTRIN(msg->msg_iov), msg->msg_iovlen, &iov, EMSGSIZE); #else - error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); + error = copyiniov(msg->msg_iov, msg->msg_iovlen, &iov, EMSGSIZE); #endif - if (error) + if (error != 0) return (error); - if (msg.msg_name) { - error = linux_to_bsd_sockaddr((struct sockaddr *)msg.msg_name, - msg.msg_namelen); - if (error) + if (msg->msg_name) { + error = linux_to_bsd_sockaddr((struct sockaddr *)msg->msg_name, + msg->msg_namelen); + if (error != 0) goto bad; } - uiov = msg.msg_iov; - msg.msg_iov = iov; - controlp = (msg.msg_control != NULL) ? &control : NULL; - error = kern_recvit(td, args->s, &msg, UIO_USERSPACE, controlp); - msg.msg_iov = uiov; - if (error) + uiov = msg->msg_iov; + msg->msg_iov = iov; + controlp = (msg->msg_control != NULL) ? &control : NULL; + error = kern_recvit(td, s, msg, UIO_USERSPACE, controlp); + msg->msg_iov = uiov; + if (error != 0) goto bad; - error = bsd_to_linux_msghdr(&msg, &linux_msg); - if (error) + error = bsd_to_linux_msghdr(msg, &linux_msg); + if (error != 0) goto bad; if (linux_msg.msg_name) { error = bsd_to_linux_sockaddr((struct sockaddr *) PTRIN(linux_msg.msg_name)); - if (error) + if (error != 0) goto bad; } if (linux_msg.msg_name && linux_msg.msg_namelen > 2) { error = linux_sa_put(PTRIN(linux_msg.msg_name)); - if (error) + if (error != 0) goto bad; } @@ -1281,10 +1324,10 @@ linux_recvmsg(struct thread *td, struct if (control) { linux_cmsg = malloc(L_CMSG_HDRSZ, M_LINUX, M_WAITOK | M_ZERO); - msg.msg_control = mtod(control, struct cmsghdr *); - msg.msg_controllen = control->m_len; + msg->msg_control = mtod(control, struct cmsghdr *); + msg->msg_controllen = control->m_len; - cm = CMSG_FIRSTHDR(&msg); + cm = CMSG_FIRSTHDR(msg); while (cm != NULL) { linux_cmsg->cmsg_type = @@ -1304,7 +1347,7 @@ linux_recvmsg(struct thread *td, struct switch (cm->cmsg_type) { case SCM_RIGHTS: - if (args->flags & LINUX_MSG_CMSG_CLOEXEC) { + if (flags & LINUX_MSG_CMSG_CLOEXEC) { fds = datalen / sizeof(int); fdp = data; for (i = 0; i < fds; i++) { @@ -1361,13 +1404,13 @@ linux_recvmsg(struct thread *td, struct outbuf += LINUX_CMSG_ALIGN(datalen); outlen += LINUX_CMSG_LEN(datalen); - cm = CMSG_NXTHDR(&msg, cm); + cm = CMSG_NXTHDR(msg, cm); } } out: linux_msg.msg_controllen = outlen; - error = copyout(&linux_msg, PTRIN(args->msg), sizeof(linux_msg)); + error = copyout(&linux_msg, msghdr, sizeof(linux_msg)); bad: free(iov, M_IOV); @@ -1378,6 +1421,75 @@ bad: } int +linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args) +{ + struct msghdr bsd_msg; + + return (linux_recvmsg_common(td, args->s, PTRIN(args->msg), + args->flags, &bsd_msg)); +} + +int +linux_recvmmsg(struct thread *td, struct linux_recvmmsg_args *args) +{ + struct l_mmsghdr *msg; + struct msghdr bsd_msg; + struct l_timespec lts; + struct timespec ts, tts; + l_uint retval; + int error, datagrams; + + if (args->timeout) { + error = copyin(args->timeout, <s, sizeof(struct l_timespec)); + if (error != 0) + return (error); + error = linux_to_native_timespec(&ts, <s); + if (error != 0) + return (error); + getnanotime(&tts); + timespecadd(&tts, &ts); + } + + msg = PTRIN(args->msg); + datagrams = 0; + while (datagrams < args->vlen) { + error = linux_recvmsg_common(td, args->s, &msg->msg_hdr, + args->flags & ~LINUX_MSG_WAITFORONE, &bsd_msg); + if (error != 0) + break; + + retval = td->td_retval[0]; + error = copyout(&retval, &msg->msg_len, sizeof(msg->msg_len)); + if (error != 0) + break; + ++msg; + ++datagrams; + + /* + * MSG_WAITFORONE turns on MSG_DONTWAIT after one packet. + */ + if (args->flags & LINUX_MSG_WAITFORONE) + args->flags |= LINUX_MSG_DONTWAIT; + + /* + * See BUGS section of recvmmsg(2). + */ + if (args->timeout) { + getnanotime(&ts); + timespecsub(&ts, &tts); + if (!timespecisset(&ts) || ts.tv_sec > 0) + break; + } + /* Out of band data, return right away. */ + if (bsd_msg.msg_flags & MSG_OOB) + break; + } + if (error == 0) + td->td_retval[0] = datagrams; + return (error); +} + +int linux_shutdown(struct thread *td, struct linux_shutdown_args *args) { struct shutdown_args /* { @@ -1555,7 +1667,8 @@ static const unsigned char lxs_args[] = LINUX_AL(6) /* recvfrom */, LINUX_AL(2) /* shutdown */, LINUX_AL(5) /* setsockopt */, LINUX_AL(5) /* getsockopt */, LINUX_AL(3) /* sendmsg */, LINUX_AL(3) /* recvmsg */, - LINUX_AL(4) /* accept4 */ + LINUX_AL(4) /* accept4 */, LINUX_AL(5) /* recvmmsg */, + LINUX_AL(4) /* sendmmsg */ }; #define LINUX_AL_SIZE sizeof(lxs_args) / sizeof(lxs_args[0]) - 1 @@ -1611,6 +1724,10 @@ linux_socketcall(struct thread *td, stru return (linux_recvmsg(td, arg)); case LINUX_ACCEPT4: return (linux_accept4(td, arg)); + case LINUX_RECVMMSG: + return (linux_recvmmsg(td, arg)); + case LINUX_SENDMMSG: + return (linux_sendmmsg(td, arg)); } uprintf("LINUX: 'socket' typ=%d not implemented\n", args->what); Modified: stable/10/sys/compat/linux/linux_socket.h ============================================================================== --- stable/10/sys/compat/linux/linux_socket.h Sat Jan 9 17:49:05 2016 (r293587) +++ stable/10/sys/compat/linux/linux_socket.h Sat Jan 9 17:50:13 2016 (r293588) @@ -48,6 +48,7 @@ #define LINUX_MSG_RST 0x1000 #define LINUX_MSG_ERRQUEUE 0x2000 #define LINUX_MSG_NOSIGNAL 0x4000 +#define LINUX_MSG_WAITFORONE 0x10000 #define LINUX_MSG_CMSG_CLOEXEC 0x40000000 /* Socket-level control message types */ @@ -65,6 +66,12 @@ struct l_msghdr { l_uint msg_flags; }; +struct l_mmsghdr { + struct l_msghdr msg_hdr; + l_uint msg_len; + +}; + struct l_cmsghdr { l_size_t cmsg_len; l_int cmsg_level; @@ -279,6 +286,8 @@ int linux_getsockopt(struct thread *td, #define LINUX_SENDMSG 16 #define LINUX_RECVMSG 17 #define LINUX_ACCEPT4 18 +#define LINUX_RECVMMSG 19 +#define LINUX_SENDMMSG 20 /* Socket options */ #define LINUX_IP_TOS 1 Modified: stable/10/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 17:49:05 2016 (r293587) +++ stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 17:50:13 2016 (r293588) @@ -115,7 +115,6 @@ DUMMY(pwritev); DUMMY(rt_tsigqueueinfo); DUMMY(perf_event_open); /* linux 2.6.33: */ -DUMMY(recvmmsg); DUMMY(fanotify_init); DUMMY(fanotify_mark); /* later: */ @@ -123,7 +122,6 @@ DUMMY(name_to_handle_at); DUMMY(open_by_handle_at); DUMMY(clock_adjtime); DUMMY(syncfs); -DUMMY(sendmmsg); DUMMY(setns); DUMMY(process_vm_readv); DUMMY(process_vm_writev); Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 17:49:05 2016 (r293587) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 17:50:13 2016 (r293588) @@ -567,7 +567,9 @@ 335 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); } 336 AUE_NULL STD { int linux_perf_event_open(void); } ; linux 2.6.33: -337 AUE_NULL STD { int linux_recvmmsg(void); } +337 AUE_NULL STD { int linux_recvmmsg(l_int s, \ + struct l_mmsghdr *msg, l_uint vlen, \ + l_uint flags, struct l_timespec *timeout); } 338 AUE_NULL STD { int linux_fanotify_init(void); } 339 AUE_NULL STD { int linux_fanotify_mark(void); } ; linux 2.6.36: @@ -580,7 +582,9 @@ 342 AUE_NULL STD { int linux_open_by_handle_at(void); } 343 AUE_NULL STD { int linux_clock_adjtime(void); } 344 AUE_NULL STD { int linux_syncfs(void); } -345 AUE_NULL STD { int linux_sendmmsg(void); } +345 AUE_NULL STD { int linux_sendmmsg(l_int s, \ + struct l_mmsghdr *msg, l_uint vlen, \ + l_uint flags); } 346 AUE_NULL STD { int linux_setns(void); } 347 AUE_NULL STD { int linux_process_vm_readv(void); } 348 AUE_NULL STD { int linux_process_vm_writev(void); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:51:20 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7875FA69131; Sat, 9 Jan 2016 17:51:20 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C73314E3; Sat, 9 Jan 2016 17:51:20 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HpJUS066091; Sat, 9 Jan 2016 17:51:19 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HpHp4066075; Sat, 9 Jan 2016 17:51:17 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091751.u09HpHp4066075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293589 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:51:20 -0000 Author: dchagin Date: Sat Jan 9 17:51:17 2016 New Revision: 293589 URL: https://svnweb.freebsd.org/changeset/base/293589 Log: Regen for r293588. Modified: stable/10/sys/amd64/linux/linux_proto.h stable/10/sys/amd64/linux/linux_syscall.h stable/10/sys/amd64/linux/linux_syscalls.c stable/10/sys/amd64/linux/linux_sysent.c stable/10/sys/amd64/linux/linux_systrace_args.c stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 17:51:17 2016 (r293589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1059,7 +1059,11 @@ struct linux_perf_event_open_args { register_t dummy; }; struct linux_recvmmsg_args { - register_t dummy; + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)]; + char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; + char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; }; struct linux_fanotify_init_args { register_t dummy; @@ -1086,7 +1090,10 @@ struct linux_syncfs_args { register_t dummy; }; struct linux_sendmmsg_args { - register_t dummy; + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)]; + char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; }; struct linux_setns_args { register_t dummy; Modified: stable/10/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 17:51:17 2016 (r293589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin */ #define LINUX_SYS_read 0 Modified: stable/10/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 17:51:17 2016 (r293589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 17:51:17 2016 (r293589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293582 2016-01-09 17:41:00Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin */ #include @@ -317,7 +317,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 296 = linux_pwritev */ { 0, (sy_call_t *)linux_rt_tsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 297 = linux_rt_tsigqueueinfo */ { 0, (sy_call_t *)linux_perf_event_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 298 = linux_perf_event_open */ - { 0, (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 299 = linux_recvmmsg */ + { AS(linux_recvmmsg_args), (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 299 = linux_recvmmsg */ { 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 300 = linux_fanotify_init */ { 0, (sy_call_t *)linux_fanotify_mark, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 301 = linux_fanotify_mark */ { AS(linux_prlimit64_args), (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 302 = linux_prlimit64 */ @@ -325,7 +325,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 304 = linux_open_by_handle_at */ { 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 305 = linux_clock_adjtime */ { 0, (sy_call_t *)linux_syncfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 306 = linux_syncfs */ - { 0, (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = linux_sendmmsg */ + { AS(linux_sendmmsg_args), (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = linux_sendmmsg */ { 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_setns */ { 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_process_vm_readv */ { 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_process_vm_writev */ Modified: stable/10/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 17:51:17 2016 (r293589) @@ -2182,7 +2182,13 @@ systrace_args(int sysnum, void *params, } /* linux_recvmmsg */ case 299: { - *n_args = 0; + struct linux_recvmmsg_args *p = params; + iarg[0] = p->s; /* l_int */ + uarg[1] = (intptr_t) p->msg; /* struct l_mmsghdr * */ + iarg[2] = p->vlen; /* l_uint */ + iarg[3] = p->flags; /* l_uint */ + uarg[4] = (intptr_t) p->timeout; /* struct l_timespec * */ + *n_args = 5; break; } /* linux_fanotify_init */ @@ -2227,7 +2233,12 @@ systrace_args(int sysnum, void *params, } /* linux_sendmmsg */ case 307: { - *n_args = 0; + struct linux_sendmmsg_args *p = params; + iarg[0] = p->s; /* l_int */ + uarg[1] = (intptr_t) p->msg; /* struct l_mmsghdr * */ + iarg[2] = p->vlen; /* l_uint */ + iarg[3] = p->flags; /* l_uint */ + *n_args = 4; break; } /* linux_setns */ @@ -5531,6 +5542,25 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_recvmmsg */ case 299: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct l_mmsghdr *"; + break; + case 2: + p = "l_uint"; + break; + case 3: + p = "l_uint"; + break; + case 4: + p = "struct l_timespec *"; + break; + default: + break; + }; break; /* linux_fanotify_init */ case 300: @@ -5571,6 +5601,22 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_sendmmsg */ case 307: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct l_mmsghdr *"; + break; + case 2: + p = "l_uint"; + break; + case 3: + p = "l_uint"; + break; + default: + break; + }; break; /* linux_setns */ case 308: @@ -6784,6 +6830,9 @@ systrace_return_setargdesc(int sysnum, i case 298: /* linux_recvmmsg */ case 299: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_fanotify_init */ case 300: /* linux_fanotify_mark */ @@ -6803,6 +6852,9 @@ systrace_return_setargdesc(int sysnum, i case 306: /* linux_sendmmsg */ case 307: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_setns */ case 308: /* linux_process_vm_readv */ Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 17:51:17 2016 (r293589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293585 2016-01-09 17:45:02Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293588 2016-01-09 17:50:13Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1113,7 +1113,11 @@ struct linux_perf_event_open_args { register_t dummy; }; struct linux_recvmmsg_args { - register_t dummy; + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)]; + char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; + char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; }; struct linux_fanotify_init_args { register_t dummy; @@ -1140,7 +1144,10 @@ struct linux_syncfs_args { register_t dummy; }; struct linux_sendmmsg_args { - register_t dummy; + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)]; + char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; }; struct linux_setns_args { register_t dummy; Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 17:51:17 2016 (r293589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293585 2016-01-09 17:45:02Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293588 2016-01-09 17:50:13Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 17:51:17 2016 (r293589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293585 2016-01-09 17:45:02Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293588 2016-01-09 17:50:13Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 17:51:17 2016 (r293589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293585 2016-01-09 17:45:02Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293588 2016-01-09 17:50:13Z dchagin */ #include "opt_compat.h" @@ -356,7 +356,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = linux_pwritev */ { 0, (sy_call_t *)linux_rt_tsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 335 = linux_rt_tsigqueueinfo */ { 0, (sy_call_t *)linux_perf_event_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 336 = linux_perf_event_open */ - { 0, (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = linux_recvmmsg */ + { AS(linux_recvmmsg_args), (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = linux_recvmmsg */ { 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = linux_fanotify_init */ { 0, (sy_call_t *)linux_fanotify_mark, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 339 = linux_fanotify_mark */ { AS(linux_prlimit64_args), (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = linux_prlimit64 */ @@ -364,7 +364,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 342 = linux_open_by_handle_at */ { 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = linux_clock_adjtime */ { 0, (sy_call_t *)linux_syncfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_syncfs */ - { 0, (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = linux_sendmmsg */ + { AS(linux_sendmmsg_args), (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = linux_sendmmsg */ { 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 346 = linux_setns */ { 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = linux_process_vm_readv */ { 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = linux_process_vm_writev */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 17:51:17 2016 (r293589) @@ -2279,7 +2279,13 @@ systrace_args(int sysnum, void *params, } /* linux_recvmmsg */ case 337: { - *n_args = 0; + struct linux_recvmmsg_args *p = params; + iarg[0] = p->s; /* l_int */ + uarg[1] = (intptr_t) p->msg; /* struct l_mmsghdr * */ + iarg[2] = p->vlen; /* l_uint */ + iarg[3] = p->flags; /* l_uint */ + uarg[4] = (intptr_t) p->timeout; /* struct l_timespec * */ + *n_args = 5; break; } /* linux_fanotify_init */ @@ -2324,7 +2330,12 @@ systrace_args(int sysnum, void *params, } /* linux_sendmmsg */ case 345: { - *n_args = 0; + struct linux_sendmmsg_args *p = params; + iarg[0] = p->s; /* l_int */ + uarg[1] = (intptr_t) p->msg; /* struct l_mmsghdr * */ + iarg[2] = p->vlen; /* l_uint */ + iarg[3] = p->flags; /* l_uint */ + *n_args = 4; break; } /* linux_setns */ @@ -5719,6 +5730,25 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_recvmmsg */ case 337: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct l_mmsghdr *"; + break; + case 2: + p = "l_uint"; + break; + case 3: + p = "l_uint"; + break; + case 4: + p = "struct l_timespec *"; + break; + default: + break; + }; break; /* linux_fanotify_init */ case 338: @@ -5759,6 +5789,22 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_sendmmsg */ case 345: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct l_mmsghdr *"; + break; + case 2: + p = "l_uint"; + break; + case 3: + p = "l_uint"; + break; + default: + break; + }; break; /* linux_setns */ case 346: @@ -7042,6 +7088,9 @@ systrace_return_setargdesc(int sysnum, i case 336: /* linux_recvmmsg */ case 337: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_fanotify_init */ case 338: /* linux_fanotify_mark */ @@ -7061,6 +7110,9 @@ systrace_return_setargdesc(int sysnum, i case 344: /* linux_sendmmsg */ case 345: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_setns */ case 346: /* linux_process_vm_readv */ Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 17:51:17 2016 (r293589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293585 2016-01-09 17:45:02Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1131,7 +1131,11 @@ struct linux_perf_event_open_args { register_t dummy; }; struct linux_recvmmsg_args { - register_t dummy; + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)]; + char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; + char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; }; struct linux_fanotify_init_args { register_t dummy; @@ -1158,7 +1162,10 @@ struct linux_syncfs_args { register_t dummy; }; struct linux_sendmmsg_args { - register_t dummy; + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)]; + char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; }; struct linux_setns_args { register_t dummy; Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 17:51:17 2016 (r293589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293585 2016-01-09 17:45:02Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 17:51:17 2016 (r293589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293585 2016-01-09 17:45:02Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 17:51:17 2016 (r293589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293585 2016-01-09 17:45:02Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin */ #include @@ -355,7 +355,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = linux_pwritev */ { 0, (sy_call_t *)linux_rt_tsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 335 = linux_rt_tsigqueueinfo */ { 0, (sy_call_t *)linux_perf_event_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 336 = linux_perf_event_open */ - { 0, (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = linux_recvmmsg */ + { AS(linux_recvmmsg_args), (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = linux_recvmmsg */ { 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = linux_fanotify_init */ { 0, (sy_call_t *)linux_fanotify_mark, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 339 = linux_fanotify_mark */ { AS(linux_prlimit64_args), (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = linux_prlimit64 */ @@ -363,7 +363,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 342 = linux_open_by_handle_at */ { 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = linux_clock_adjtime */ { 0, (sy_call_t *)linux_syncfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_syncfs */ - { 0, (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = linux_sendmmsg */ + { AS(linux_sendmmsg_args), (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = linux_sendmmsg */ { 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 346 = linux_setns */ { 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = linux_process_vm_readv */ { 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = linux_process_vm_writev */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 17:50:13 2016 (r293588) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 17:51:17 2016 (r293589) @@ -2355,7 +2355,13 @@ systrace_args(int sysnum, void *params, } /* linux_recvmmsg */ case 337: { - *n_args = 0; + struct linux_recvmmsg_args *p = params; + iarg[0] = p->s; /* l_int */ + uarg[1] = (intptr_t) p->msg; /* struct l_mmsghdr * */ + iarg[2] = p->vlen; /* l_uint */ + iarg[3] = p->flags; /* l_uint */ + uarg[4] = (intptr_t) p->timeout; /* struct l_timespec * */ + *n_args = 5; break; } /* linux_fanotify_init */ @@ -2400,7 +2406,12 @@ systrace_args(int sysnum, void *params, } /* linux_sendmmsg */ case 345: { - *n_args = 0; + struct linux_sendmmsg_args *p = params; + iarg[0] = p->s; /* l_int */ + uarg[1] = (intptr_t) p->msg; /* struct l_mmsghdr * */ + iarg[2] = p->vlen; /* l_uint */ + iarg[3] = p->flags; /* l_uint */ + *n_args = 4; break; } /* linux_setns */ @@ -5950,6 +5961,25 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_recvmmsg */ case 337: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct l_mmsghdr *"; + break; + case 2: + p = "l_uint"; + break; + case 3: + p = "l_uint"; + break; + case 4: + p = "struct l_timespec *"; + break; + default: + break; + }; break; /* linux_fanotify_init */ case 338: @@ -5990,6 +6020,22 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_sendmmsg */ case 345: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "struct l_mmsghdr *"; + break; + case 2: + p = "l_uint"; + break; + case 3: + p = "l_uint"; + break; + default: + break; + }; break; /* linux_setns */ case 346: @@ -7320,6 +7366,9 @@ systrace_return_setargdesc(int sysnum, i case 336: /* linux_recvmmsg */ case 337: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_fanotify_init */ case 338: /* linux_fanotify_mark */ @@ -7339,6 +7388,9 @@ systrace_return_setargdesc(int sysnum, i case 344: /* linux_sendmmsg */ case 345: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_setns */ case 346: /* linux_process_vm_readv */ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:52:28 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBD7DA69223; Sat, 9 Jan 2016 17:52:28 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E13D18C2; Sat, 9 Jan 2016 17:52:28 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HqRpk068120; Sat, 9 Jan 2016 17:52:27 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HqRbT068119; Sat, 9 Jan 2016 17:52:27 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091752.u09HqRbT068119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293590 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:52:28 -0000 Author: dchagin Date: Sat Jan 9 17:52:27 2016 New Revision: 293590 URL: https://svnweb.freebsd.org/changeset/base/293590 Log: MFC r283490: Since FreeBSD supports SOCK_CLOEXEC & SOCK_NONBLOCK options remove its emulation via fcntl call from Linuxulator. Modified: stable/10/sys/compat/linux/linux_socket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 17:51:17 2016 (r293589) +++ stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 17:52:27 2016 (r293590) @@ -80,6 +80,7 @@ static int linux_sendmsg_common(struct t l_uint); static int linux_recvmsg_common(struct thread *, l_int, struct l_msghdr *, l_uint, struct msghdr *); +static int linux_set_socket_flags(int, int *); /* * Reads a linux sockaddr and does any necessary translation. @@ -534,20 +535,15 @@ bsd_to_linux_msghdr(const struct msghdr } static int -linux_set_socket_flags(struct thread *td, int s, int flags) +linux_set_socket_flags(int lflags, int *flags) { - int error; - if (flags & LINUX_SOCK_NONBLOCK) { - error = kern_fcntl(td, s, F_SETFL, O_NONBLOCK); - if (error) - return (error); - } - if (flags & LINUX_SOCK_CLOEXEC) { - error = kern_fcntl(td, s, F_SETFD, FD_CLOEXEC); - if (error) - return (error); - } + if (lflags & ~(LINUX_SOCK_CLOEXEC | LINUX_SOCK_NONBLOCK)) + return (EINVAL); + if (lflags & LINUX_SOCK_NONBLOCK) + *flags |= SOCK_NONBLOCK; + if (lflags & LINUX_SOCK_CLOEXEC) + *flags |= SOCK_CLOEXEC; return (0); } @@ -649,15 +645,16 @@ linux_socket(struct thread *td, struct l int type; int protocol; } */ bsd_args; - int retval_socket, socket_flags; + int retval_socket; bsd_args.protocol = args->protocol; - socket_flags = args->type & ~LINUX_SOCK_TYPE_MASK; - if (socket_flags & ~(LINUX_SOCK_CLOEXEC | LINUX_SOCK_NONBLOCK)) - return (EINVAL); bsd_args.type = args->type & LINUX_SOCK_TYPE_MASK; if (bsd_args.type < 0 || bsd_args.type > LINUX_SOCK_MAX) return (EINVAL); + retval_socket = linux_set_socket_flags(args->type & ~LINUX_SOCK_TYPE_MASK, + &bsd_args.type); + if (retval_socket != 0) + return (retval_socket); bsd_args.domain = linux_to_bsd_domain(args->domain); if (bsd_args.domain == -1) return (EAFNOSUPPORT); @@ -666,13 +663,6 @@ linux_socket(struct thread *td, struct l if (retval_socket) return (retval_socket); - retval_socket = linux_set_socket_flags(td, td->td_retval[0], - socket_flags); - if (retval_socket) { - (void)kern_close(td, td->td_retval[0]); - goto out; - } - if (bsd_args.type == SOCK_RAW && (bsd_args.protocol == IPPROTO_RAW || bsd_args.protocol == 0) && bsd_args.domain == PF_INET) { @@ -701,7 +691,6 @@ linux_socket(struct thread *td, struct l } #endif -out: return (retval_socket); } @@ -784,43 +773,30 @@ static int linux_accept_common(struct thread *td, int s, l_uintptr_t addr, l_uintptr_t namelen, int flags) { - struct accept_args /* { + struct accept4_args /* { int s; struct sockaddr * __restrict name; socklen_t * __restrict anamelen; + int flags; } */ bsd_args; int error; - if (flags & ~(LINUX_SOCK_CLOEXEC | LINUX_SOCK_NONBLOCK)) - return (EINVAL); - bsd_args.s = s; /* XXX: */ bsd_args.name = (struct sockaddr * __restrict)PTRIN(addr); bsd_args.anamelen = PTRIN(namelen);/* XXX */ - error = sys_accept(td, &bsd_args); + error = linux_set_socket_flags(flags, &bsd_args.flags); + if (error != 0) + return (error); + error = sys_accept4(td, &bsd_args); bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.name); if (error) { if (error == EFAULT && namelen != sizeof(struct sockaddr_in)) return (EINVAL); return (error); } - - /* - * linux appears not to copy flags from the parent socket to the - * accepted one, so we must clear the flags in the new descriptor - * and apply the requested flags. - */ - error = kern_fcntl(td, td->td_retval[0], F_SETFL, 0); - if (error) - goto out; - error = linux_set_socket_flags(td, td->td_retval[0], flags); - if (error) - goto out; if (addr) error = linux_sa_put(PTRIN(addr)); - -out: if (error) { (void)kern_close(td, td->td_retval[0]); td->td_retval[0] = 0; @@ -900,20 +876,18 @@ linux_socketpair(struct thread *td, stru int protocol; int *rsv; } */ bsd_args; - int error, socket_flags; - int sv[2]; + int error; bsd_args.domain = linux_to_bsd_domain(args->domain); if (bsd_args.domain != PF_LOCAL) return (EAFNOSUPPORT); - - socket_flags = args->type & ~LINUX_SOCK_TYPE_MASK; - if (socket_flags & ~(LINUX_SOCK_CLOEXEC | LINUX_SOCK_NONBLOCK)) - return (EINVAL); bsd_args.type = args->type & LINUX_SOCK_TYPE_MASK; if (bsd_args.type < 0 || bsd_args.type > LINUX_SOCK_MAX) return (EINVAL); - + error = linux_set_socket_flags(args->type & ~LINUX_SOCK_TYPE_MASK, + &bsd_args.type); + if (error != 0) + return (error); if (args->protocol != 0 && args->protocol != PF_UNIX) /* @@ -926,25 +900,7 @@ linux_socketpair(struct thread *td, stru else bsd_args.protocol = 0; bsd_args.rsv = (int *)PTRIN(args->rsv); - error = kern_socketpair(td, bsd_args.domain, bsd_args.type, - bsd_args.protocol, sv); - if (error) - return (error); - error = linux_set_socket_flags(td, sv[0], socket_flags); - if (error) - goto out; - error = linux_set_socket_flags(td, sv[1], socket_flags); - if (error) - goto out; - - error = copyout(sv, bsd_args.rsv, 2 * sizeof(int)); - -out: - if (error) { - (void)kern_close(td, sv[0]); - (void)kern_close(td, sv[1]); - } - return (error); + return (sys_socketpair(td, &bsd_args)); } #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:53:33 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7A6EA692D8; Sat, 9 Jan 2016 17:53:33 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9995F1A82; Sat, 9 Jan 2016 17:53:33 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HrWSU068223; Sat, 9 Jan 2016 17:53:32 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HrWHg068222; Sat, 9 Jan 2016 17:53:32 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091753.u09HrWHg068222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293591 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:53:33 -0000 Author: dchagin Date: Sat Jan 9 17:53:32 2016 New Revision: 293591 URL: https://svnweb.freebsd.org/changeset/base/293591 Log: MFC r283491: Properly check tv_nsec value. The tv_nsec field can also be one of the special value UTIME_NOW or UTIME_OMIT. Modified: stable/10/sys/compat/linux/linux_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_misc.c ============================================================================== --- stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 17:52:27 2016 (r293590) +++ stable/10/sys/compat/linux/linux_misc.c Sat Jan 9 17:53:32 2016 (r293591) @@ -139,6 +139,9 @@ struct l_pselect6arg { l_size_t ss_len; }; +static int linux_utimensat_nsec_valid(l_long); + + int linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args) { @@ -823,6 +826,17 @@ linux_utimes(struct thread *td, struct l return (error); } +static int +linux_utimensat_nsec_valid(l_long nsec) +{ + + if (nsec == LINUX_UTIME_OMIT || nsec == LINUX_UTIME_NOW) + return (0); + if (nsec >= 0 && nsec <= 999999999) + return (0); + return (1); +} + int linux_utimensat(struct thread *td, struct linux_utimensat_args *args) { @@ -846,8 +860,8 @@ linux_utimensat(struct thread *td, struc if (error != 0) return (error); - if (l_times[0].tv_nsec > 999999999 || - l_times[1].tv_nsec > 999999999) + if (linux_utimensat_nsec_valid(l_times[0].tv_nsec) != 0 || + linux_utimensat_nsec_valid(l_times[1].tv_nsec) != 0) return (EINVAL); times[0].tv_sec = l_times[0].tv_sec; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:54:39 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66CFEA69361; Sat, 9 Jan 2016 17:54:39 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 291121BF1; Sat, 9 Jan 2016 17:54:39 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HscCh068320; Sat, 9 Jan 2016 17:54:38 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HsbEB068313; Sat, 9 Jan 2016 17:54:37 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091754.u09HsbEB068313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293592 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:54:39 -0000 Author: dchagin Date: Sat Jan 9 17:54:37 2016 New Revision: 293592 URL: https://svnweb.freebsd.org/changeset/base/293592 Log: MFC r283492: Implement Linux specific syncfs() system call. Modified: stable/10/sys/amd64/linux/linux_dummy.c stable/10/sys/amd64/linux/syscalls.master stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_stats.c stable/10/sys/i386/linux/linux_dummy.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 17:53:32 2016 (r293591) +++ stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 17:54:37 2016 (r293592) @@ -113,7 +113,6 @@ DUMMY(fanotify_mark); DUMMY(name_to_handle_at); DUMMY(open_by_handle_at); DUMMY(clock_adjtime); -DUMMY(syncfs); DUMMY(setns); DUMMY(process_vm_readv); DUMMY(process_vm_writev); Modified: stable/10/sys/amd64/linux/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 17:53:32 2016 (r293591) +++ stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 17:54:37 2016 (r293592) @@ -502,7 +502,7 @@ 303 AUE_NULL STD { int linux_name_to_handle_at(void); } 304 AUE_NULL STD { int linux_open_by_handle_at(void); } 305 AUE_NULL STD { int linux_clock_adjtime(void); } -306 AUE_NULL STD { int linux_syncfs(void); } +306 AUE_SYNC STD { int linux_syncfs(l_int fd); } 307 AUE_NULL STD { int linux_sendmmsg(l_int s, \ struct l_mmsghdr *msg, l_uint vlen, \ l_uint flags); } Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 17:53:32 2016 (r293591) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 17:54:37 2016 (r293592) @@ -125,7 +125,6 @@ DUMMY(fanotify_mark); DUMMY(name_to_handle_at); DUMMY(open_by_handle_at); DUMMY(clock_adjtime); -DUMMY(syncfs); DUMMY(setns); DUMMY(process_vm_readv); DUMMY(process_vm_writev); Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 17:53:32 2016 (r293591) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 17:54:37 2016 (r293592) @@ -573,7 +573,7 @@ 341 AUE_NULL STD { int linux_name_to_handle_at(void); } 342 AUE_NULL STD { int linux_open_by_handle_at(void); } 343 AUE_NULL STD { int linux_clock_adjtime(void); } -344 AUE_NULL STD { int linux_syncfs(void); } +344 AUE_SYNC STD { int linux_syncfs(l_int fd); } 345 AUE_NULL STD { int linux_sendmmsg(l_int s, \ struct l_mmsghdr *msg, l_uint vlen, \ l_uint flags); } Modified: stable/10/sys/compat/linux/linux_stats.c ============================================================================== --- stable/10/sys/compat/linux/linux_stats.c Sat Jan 9 17:53:32 2016 (r293591) +++ stable/10/sys/compat/linux/linux_stats.c Sat Jan 9 17:54:37 2016 (r293592) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include +#include #include #include #include @@ -653,3 +654,43 @@ linux_newfstatat(struct thread *td, stru } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ + +int +linux_syncfs(struct thread *td, struct linux_syncfs_args *args) +{ + cap_rights_t rights; + struct mount *mp; + struct vnode *vp; + int error, save; + + error = fgetvp(td, args->fd, cap_rights_init(&rights, CAP_FSYNC), &vp); + if (error != 0) + /* + * Linux syncfs() returns only EBADF, however fgetvp() + * can return EINVAL in case of file descriptor does + * not represent a vnode. XXX. + */ + return (error); + + mp = vp->v_mount; + mtx_lock(&mountlist_mtx); + error = vfs_busy(mp, MBF_MNTLSTLOCK); + if (error != 0) { + /* See comment above. */ + mtx_unlock(&mountlist_mtx); + goto out; + } + if ((mp->mnt_flag & MNT_RDONLY) == 0 && + vn_start_write(NULL, &mp, V_NOWAIT) == 0) { + save = curthread_pflags_set(TDP_SYNCIO); + vfs_msync(mp, MNT_NOWAIT); + VFS_SYNC(mp, MNT_NOWAIT); + curthread_pflags_restore(save); + vn_finished_write(mp); + } + vfs_unbusy(mp); + + out: + vrele(vp); + return (error); +} Modified: stable/10/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 17:53:32 2016 (r293591) +++ stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 17:54:37 2016 (r293592) @@ -121,7 +121,6 @@ DUMMY(fanotify_mark); DUMMY(name_to_handle_at); DUMMY(open_by_handle_at); DUMMY(clock_adjtime); -DUMMY(syncfs); DUMMY(setns); DUMMY(process_vm_readv); DUMMY(process_vm_writev); Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 17:53:32 2016 (r293591) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 17:54:37 2016 (r293592) @@ -581,7 +581,7 @@ 341 AUE_NULL STD { int linux_name_to_handle_at(void); } 342 AUE_NULL STD { int linux_open_by_handle_at(void); } 343 AUE_NULL STD { int linux_clock_adjtime(void); } -344 AUE_NULL STD { int linux_syncfs(void); } +344 AUE_SYNC STD { int linux_syncfs(l_int fd); } 345 AUE_NULL STD { int linux_sendmmsg(l_int s, \ struct l_mmsghdr *msg, l_uint vlen, \ l_uint flags); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:56:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5921A693EE; Sat, 9 Jan 2016 17:56:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E7A41D5A; Sat, 9 Jan 2016 17:56:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Hu6Tq068448; Sat, 9 Jan 2016 17:56:06 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Hu5BW068433; Sat, 9 Jan 2016 17:56:05 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091756.u09Hu5BW068433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293593 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:56:07 -0000 Author: dchagin Date: Sat Jan 9 17:56:04 2016 New Revision: 293593 URL: https://svnweb.freebsd.org/changeset/base/293593 Log: Regen for r293592. Modified: stable/10/sys/amd64/linux/linux_proto.h stable/10/sys/amd64/linux/linux_syscall.h stable/10/sys/amd64/linux/linux_syscalls.c stable/10/sys/amd64/linux/linux_sysent.c stable/10/sys/amd64/linux/linux_systrace_args.c stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/amd64/linux/linux_proto.h Sat Jan 9 17:56:04 2016 (r293593) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1087,7 +1087,7 @@ struct linux_clock_adjtime_args { register_t dummy; }; struct linux_syncfs_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; }; struct linux_sendmmsg_args { char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; @@ -1648,7 +1648,7 @@ int linux_finit_module(struct thread *, #define LINUX_SYS_AUE_linux_name_to_handle_at AUE_NULL #define LINUX_SYS_AUE_linux_open_by_handle_at AUE_NULL #define LINUX_SYS_AUE_linux_clock_adjtime AUE_NULL -#define LINUX_SYS_AUE_linux_syncfs AUE_NULL +#define LINUX_SYS_AUE_linux_syncfs AUE_SYNC #define LINUX_SYS_AUE_linux_sendmmsg AUE_NULL #define LINUX_SYS_AUE_linux_setns AUE_NULL #define LINUX_SYS_AUE_linux_process_vm_readv AUE_NULL Modified: stable/10/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/amd64/linux/linux_syscall.h Sat Jan 9 17:56:04 2016 (r293593) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin */ #define LINUX_SYS_read 0 Modified: stable/10/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/amd64/linux/linux_syscalls.c Sat Jan 9 17:56:04 2016 (r293593) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/amd64/linux/linux_sysent.c Sat Jan 9 17:56:04 2016 (r293593) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin */ #include @@ -324,7 +324,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_name_to_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 303 = linux_name_to_handle_at */ { 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 304 = linux_open_by_handle_at */ { 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 305 = linux_clock_adjtime */ - { 0, (sy_call_t *)linux_syncfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 306 = linux_syncfs */ + { AS(linux_syncfs_args), (sy_call_t *)linux_syncfs, AUE_SYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 306 = linux_syncfs */ { AS(linux_sendmmsg_args), (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = linux_sendmmsg */ { 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_setns */ { 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_process_vm_readv */ Modified: stable/10/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/amd64/linux/linux_systrace_args.c Sat Jan 9 17:56:04 2016 (r293593) @@ -2228,7 +2228,9 @@ systrace_args(int sysnum, void *params, } /* linux_syncfs */ case 306: { - *n_args = 0; + struct linux_syncfs_args *p = params; + iarg[0] = p->fd; /* l_int */ + *n_args = 1; break; } /* linux_sendmmsg */ @@ -5598,6 +5600,13 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_syncfs */ case 306: + switch(ndx) { + case 0: + p = "l_int"; + break; + default: + break; + }; break; /* linux_sendmmsg */ case 307: @@ -6850,6 +6859,9 @@ systrace_return_setargdesc(int sysnum, i case 305: /* linux_syncfs */ case 306: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_sendmmsg */ case 307: if (ndx == 0 || ndx == 1) Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/amd64/linux32/linux32_proto.h Sat Jan 9 17:56:04 2016 (r293593) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293588 2016-01-09 17:50:13Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293592 2016-01-09 17:54:37Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1141,7 +1141,7 @@ struct linux_clock_adjtime_args { register_t dummy; }; struct linux_syncfs_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; }; struct linux_sendmmsg_args { char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; @@ -1736,7 +1736,7 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_name_to_handle_at AUE_NULL #define LINUX_SYS_AUE_linux_open_by_handle_at AUE_NULL #define LINUX_SYS_AUE_linux_clock_adjtime AUE_NULL -#define LINUX_SYS_AUE_linux_syncfs AUE_NULL +#define LINUX_SYS_AUE_linux_syncfs AUE_SYNC #define LINUX_SYS_AUE_linux_sendmmsg AUE_NULL #define LINUX_SYS_AUE_linux_setns AUE_NULL #define LINUX_SYS_AUE_linux_process_vm_readv AUE_NULL Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Sat Jan 9 17:56:04 2016 (r293593) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293588 2016-01-09 17:50:13Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293592 2016-01-09 17:54:37Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Sat Jan 9 17:56:04 2016 (r293593) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293588 2016-01-09 17:50:13Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293592 2016-01-09 17:54:37Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Sat Jan 9 17:56:04 2016 (r293593) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293588 2016-01-09 17:50:13Z dchagin + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 293592 2016-01-09 17:54:37Z dchagin */ #include "opt_compat.h" @@ -363,7 +363,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_name_to_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 341 = linux_name_to_handle_at */ { 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 342 = linux_open_by_handle_at */ { 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = linux_clock_adjtime */ - { 0, (sy_call_t *)linux_syncfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_syncfs */ + { AS(linux_syncfs_args), (sy_call_t *)linux_syncfs, AUE_SYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_syncfs */ { AS(linux_sendmmsg_args), (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = linux_sendmmsg */ { 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 346 = linux_setns */ { 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = linux_process_vm_readv */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Sat Jan 9 17:56:04 2016 (r293593) @@ -2325,7 +2325,9 @@ systrace_args(int sysnum, void *params, } /* linux_syncfs */ case 344: { - *n_args = 0; + struct linux_syncfs_args *p = params; + iarg[0] = p->fd; /* l_int */ + *n_args = 1; break; } /* linux_sendmmsg */ @@ -5786,6 +5788,13 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_syncfs */ case 344: + switch(ndx) { + case 0: + p = "l_int"; + break; + default: + break; + }; break; /* linux_sendmmsg */ case 345: @@ -7108,6 +7117,9 @@ systrace_return_setargdesc(int sysnum, i case 343: /* linux_syncfs */ case 344: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_sendmmsg */ case 345: if (ndx == 0 || ndx == 1) Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/i386/linux/linux_proto.h Sat Jan 9 17:56:04 2016 (r293593) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1159,7 +1159,7 @@ struct linux_clock_adjtime_args { register_t dummy; }; struct linux_syncfs_args { - register_t dummy; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; }; struct linux_sendmmsg_args { char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; @@ -1758,7 +1758,7 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_name_to_handle_at AUE_NULL #define LINUX_SYS_AUE_linux_open_by_handle_at AUE_NULL #define LINUX_SYS_AUE_linux_clock_adjtime AUE_NULL -#define LINUX_SYS_AUE_linux_syncfs AUE_NULL +#define LINUX_SYS_AUE_linux_syncfs AUE_SYNC #define LINUX_SYS_AUE_linux_sendmmsg AUE_NULL #define LINUX_SYS_AUE_linux_setns AUE_NULL #define LINUX_SYS_AUE_linux_process_vm_readv AUE_NULL Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/i386/linux/linux_syscall.h Sat Jan 9 17:56:04 2016 (r293593) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/i386/linux/linux_syscalls.c Sat Jan 9 17:56:04 2016 (r293593) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/i386/linux/linux_sysent.c Sat Jan 9 17:56:04 2016 (r293593) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293588 2016-01-09 17:50:13Z dchagin + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 293592 2016-01-09 17:54:37Z dchagin */ #include @@ -362,7 +362,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_name_to_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 341 = linux_name_to_handle_at */ { 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 342 = linux_open_by_handle_at */ { 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = linux_clock_adjtime */ - { 0, (sy_call_t *)linux_syncfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_syncfs */ + { AS(linux_syncfs_args), (sy_call_t *)linux_syncfs, AUE_SYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_syncfs */ { AS(linux_sendmmsg_args), (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = linux_sendmmsg */ { 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 346 = linux_setns */ { 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = linux_process_vm_readv */ Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 17:54:37 2016 (r293592) +++ stable/10/sys/i386/linux/linux_systrace_args.c Sat Jan 9 17:56:04 2016 (r293593) @@ -2401,7 +2401,9 @@ systrace_args(int sysnum, void *params, } /* linux_syncfs */ case 344: { - *n_args = 0; + struct linux_syncfs_args *p = params; + iarg[0] = p->fd; /* l_int */ + *n_args = 1; break; } /* linux_sendmmsg */ @@ -6017,6 +6019,13 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_syncfs */ case 344: + switch(ndx) { + case 0: + p = "l_int"; + break; + default: + break; + }; break; /* linux_sendmmsg */ case 345: @@ -7386,6 +7395,9 @@ systrace_return_setargdesc(int sysnum, i case 343: /* linux_syncfs */ case 344: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_sendmmsg */ case 345: if (ndx == 0 || ndx == 1) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:00:52 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A35AFA695E7; Sat, 9 Jan 2016 18:00:52 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 708AD1FFB; Sat, 9 Jan 2016 18:00:52 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09I0pGW069288; Sat, 9 Jan 2016 18:00:51 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09I0peR069287; Sat, 9 Jan 2016 18:00:51 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091800.u09I0peR069287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293594 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:00:52 -0000 Author: dchagin Date: Sat Jan 9 18:00:51 2016 New Revision: 293594 URL: https://svnweb.freebsd.org/changeset/base/293594 Log: MFC r283494: Fix an mbuf(9) leak in sendmsg() under failure condition and remove unneeded check for failed M_WAITOK allocation. Modified: stable/10/sys/compat/linux/linux_socket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 17:56:04 2016 (r293593) +++ stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 18:00:51 2016 (r293594) @@ -1092,8 +1092,6 @@ linux_sendmsg_common(struct thread *td, error = ENOBUFS; cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK|M_ZERO); control = m_get(M_WAITOK, MT_CONTROL); - if (control == NULL) - goto bad; do { error = copyin(ptr_cmsg, &linux_cmsg, @@ -1165,6 +1163,7 @@ linux_sendmsg_common(struct thread *td, error = linux_sendit(td, s, &msg, flags, control, UIO_USERSPACE); bad: + m_freem(control); free(iov, M_IOV); if (cmsg) free(cmsg, M_LINUX); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:02:09 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2C44A6968A; Sat, 9 Jan 2016 18:02:09 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2BAC127E; Sat, 9 Jan 2016 18:02:09 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09I285U071325; Sat, 9 Jan 2016 18:02:08 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09I28E4071323; Sat, 9 Jan 2016 18:02:08 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091802.u09I28E4071323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293595 - in stable/10/sys: fs/pseudofs modules/pseudofs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:02:10 -0000 Author: dchagin Date: Sat Jan 9 18:02:08 2016 New Revision: 293595 URL: https://svnweb.freebsd.org/changeset/base/293595 Log: MFC r283495: Hide vfs.pfs.trace variable if it is not used. Modified: stable/10/sys/fs/pseudofs/pseudofs.c stable/10/sys/modules/pseudofs/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/pseudofs/pseudofs.c ============================================================================== --- stable/10/sys/fs/pseudofs/pseudofs.c Sat Jan 9 18:00:51 2016 (r293594) +++ stable/10/sys/fs/pseudofs/pseudofs.c Sat Jan 9 18:02:08 2016 (r293595) @@ -52,9 +52,11 @@ static MALLOC_DEFINE(M_PFSNODES, "pfs_no SYSCTL_NODE(_vfs, OID_AUTO, pfs, CTLFLAG_RW, 0, "pseudofs"); +#ifdef PSEUDOFS_TRACE int pfs_trace; SYSCTL_INT(_vfs_pfs, OID_AUTO, trace, CTLFLAG_RW, &pfs_trace, 0, "enable tracing of pseudofs vnode operations"); +#endif #if PFS_FSNAMELEN != MFSNAMELEN #error "PFS_FSNAMELEN is not equal to MFSNAMELEN" Modified: stable/10/sys/modules/pseudofs/Makefile ============================================================================== --- stable/10/sys/modules/pseudofs/Makefile Sat Jan 9 18:00:51 2016 (r293594) +++ stable/10/sys/modules/pseudofs/Makefile Sat Jan 9 18:02:08 2016 (r293595) @@ -23,4 +23,10 @@ EXPORT_SYMS= pfs_mount \ pfs_enable \ pfs_destroy +.if !defined(KERNBUILDDIR) +.if defined(PSEUDOFS_TRACE) +CFLAGS+=-DPSEUDOFS_TRACE +.endif +.endif + .include From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:03:11 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BD31A69709; Sat, 9 Jan 2016 18:03:11 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 154011431; Sat, 9 Jan 2016 18:03:11 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09I3Ac7071419; Sat, 9 Jan 2016 18:03:10 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09I3AdT071417; Sat, 9 Jan 2016 18:03:10 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091803.u09I3AdT071417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293596 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:03:11 -0000 Author: dchagin Date: Sat Jan 9 18:03:09 2016 New Revision: 293596 URL: https://svnweb.freebsd.org/changeset/base/293596 Log: MFC r283496: The latest cp tool is trying to use the btrfs clone operation that is implemented via ioctl interface. First of all return ENOTSUP for this operation as a cp fallback to usual method in that case. Secondly, do not print out the message about unimplemented operation. Modified: stable/10/sys/compat/linux/linux_ioctl.c stable/10/sys/compat/linux/linux_ioctl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.c Sat Jan 9 18:02:08 2016 (r293595) +++ stable/10/sys/compat/linux/linux_ioctl.c Sat Jan 9 18:03:09 2016 (r293596) @@ -3595,9 +3595,16 @@ linux_ioctl(struct thread *td, struct li sx_sunlock(&linux_ioctl_sx); fdrop(fp, td); - linux_msg(td, "ioctl fd=%d, cmd=0x%x ('%c',%d) is not implemented", - args->fd, (int)(args->cmd & 0xffff), - (int)(args->cmd & 0xff00) >> 8, (int)(args->cmd & 0xff)); + switch (args->cmd & 0xffff) { + case LINUX_BTRFS_IOC_CLONE: + return (ENOTSUP); + + default: + linux_msg(td, "ioctl fd=%d, cmd=0x%x ('%c',%d) is not implemented", + args->fd, (int)(args->cmd & 0xffff), + (int)(args->cmd & 0xff00) >> 8, (int)(args->cmd & 0xff)); + break; + } return (EINVAL); } Modified: stable/10/sys/compat/linux/linux_ioctl.h ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.h Sat Jan 9 18:02:08 2016 (r293595) +++ stable/10/sys/compat/linux/linux_ioctl.h Sat Jan 9 18:03:09 2016 (r293596) @@ -745,6 +745,12 @@ #define FBSD_LUSB_MIN 0xffdd /* + * Linux btrfs clone operation + */ +#define LINUX_BTRFS_IOC_CLONE 0x9409 /* 0x40049409 */ + + +/* * Pluggable ioctl handlers */ struct linux_ioctl_args; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:04:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F48FA697A3; Sat, 9 Jan 2016 18:04:12 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03BAD180B; Sat, 9 Jan 2016 18:04:11 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09I4BBQ071513; Sat, 9 Jan 2016 18:04:11 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09I4AQs071511; Sat, 9 Jan 2016 18:04:10 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091804.u09I4AQs071511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293597 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:04:12 -0000 Author: dchagin Date: Sat Jan 9 18:04:10 2016 New Revision: 293597 URL: https://svnweb.freebsd.org/changeset/base/293597 Log: MFC r283497: Convert SCM_TIMESTAMP in recvmsg(). Modified: stable/10/sys/compat/linux/linux_socket.c stable/10/sys/compat/linux/linux_socket.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 18:03:09 2016 (r293596) +++ stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 18:04:10 2016 (r293597) @@ -483,6 +483,8 @@ bsd_to_linux_cmsg_type(int cmsg_type) return (LINUX_SCM_RIGHTS); case SCM_CREDS: return (LINUX_SCM_CREDENTIALS); + case SCM_TIMESTAMP: + return (LINUX_SCM_TIMESTAMP); } return (-1); } @@ -1221,6 +1223,8 @@ linux_recvmsg_common(struct thread *td, struct iovec *iov, *uiov; struct mbuf *control = NULL; struct mbuf **controlp; + struct timeval *ftmvl; + l_timeval ltmvl; caddr_t outbuf; void *data; int error, i, fd, fds, *fdp; @@ -1331,6 +1335,18 @@ linux_recvmsg_common(struct thread *td, data = &linux_ucred; datalen = sizeof(linux_ucred); break; + + case SCM_TIMESTAMP: + if (datalen != sizeof(struct timeval)) { + error = EMSGSIZE; + goto bad; + } + ftmvl = (struct timeval *)data; + ltmvl.tv_sec = ftmvl->tv_sec; + ltmvl.tv_usec = ftmvl->tv_usec; + data = <mvl; + datalen = sizeof(ltmvl); + break; } if (outlen + LINUX_CMSG_LEN(datalen) > Modified: stable/10/sys/compat/linux/linux_socket.h ============================================================================== --- stable/10/sys/compat/linux/linux_socket.h Sat Jan 9 18:03:09 2016 (r293596) +++ stable/10/sys/compat/linux/linux_socket.h Sat Jan 9 18:04:10 2016 (r293597) @@ -54,7 +54,8 @@ /* Socket-level control message types */ #define LINUX_SCM_RIGHTS 0x01 -#define LINUX_SCM_CREDENTIALS 0x02 +#define LINUX_SCM_CREDENTIALS 0x02 +#define LINUX_SCM_TIMESTAMP 0x1D struct l_msghdr { l_uintptr_t msg_name; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:05:05 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A12DEA6982E; Sat, 9 Jan 2016 18:05:05 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FD3119CC; Sat, 9 Jan 2016 18:05:05 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09I54vD071605; Sat, 9 Jan 2016 18:05:04 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09I541S071604; Sat, 9 Jan 2016 18:05:04 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091805.u09I541S071604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293598 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:05:05 -0000 Author: dchagin Date: Sat Jan 9 18:05:04 2016 New Revision: 293598 URL: https://svnweb.freebsd.org/changeset/base/293598 Log: MFC r283498: Linux nanosleep() and clock_nanosleep() system calls always writes the remaining time into the structure pointed to by rmtp unless rmtp is NULL. The value of *rmtp can then be used to call nanosleep() again and complete the specified pause if the previous call was interrupted. Note. clock_nanosleep() with an absolute time value does not write the remaining time. While here fix whitespaces and typo in SDT_PROBE. Modified: stable/10/sys/compat/linux/linux_time.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_time.c ============================================================================== --- stable/10/sys/compat/linux/linux_time.c Sat Jan 9 18:04:10 2016 (r293597) +++ stable/10/sys/compat/linux/linux_time.c Sat Jan 9 18:05:04 2016 (r293598) @@ -106,14 +106,12 @@ LIN_SDT_PROBE_DEFINE1(time, linux_clock_ LIN_SDT_PROBE_DEFINE2(time, linux_nanosleep, entry, "const struct l_timespec *", "struct l_timespec *"); LIN_SDT_PROBE_DEFINE1(time, linux_nanosleep, conversion_error, "int"); -LIN_SDT_PROBE_DEFINE1(time, linux_nanosleep, nanosleep_error, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_nanosleep, copyout_error, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_nanosleep, copyin_error, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_nanosleep, return, "int"); LIN_SDT_PROBE_DEFINE4(time, linux_clock_nanosleep, entry, "clockid_t", "int", "struct l_timespec *", "struct l_timespec *"); LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, conversion_error, "int"); -LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, nanosleep_error, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, copyout_error, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, copyin_error, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, unsupported_flags, "int"); @@ -469,7 +467,7 @@ linux_nanosleep(struct thread *td, struc struct timespec *rmtp; struct l_timespec lrqts, lrmts; struct timespec rqts, rmts; - int error; + int error, error2; LIN_SDT_PROBE2(time, linux_nanosleep, entry, args->rqtp, args->rmtp); @@ -481,9 +479,9 @@ linux_nanosleep(struct thread *td, struc } if (args->rmtp != NULL) - rmtp = &rmts; + rmtp = &rmts; else - rmtp = NULL; + rmtp = NULL; error = linux_to_native_timespec(&rqts, &lrqts); if (error != 0) { @@ -492,25 +490,19 @@ linux_nanosleep(struct thread *td, struc return (error); } error = kern_nanosleep(td, &rqts, rmtp); - if (error != 0) { - LIN_SDT_PROBE1(time, linux_nanosleep, nanosleep_error, error); - LIN_SDT_PROBE1(time, linux_nanosleep, return, error); - return (error); - } - if (args->rmtp != NULL) { - native_to_linux_timespec(&lrmts, rmtp); - error = copyout(&lrmts, args->rmtp, sizeof(lrmts)); - if (error != 0) { + native_to_linux_timespec(&lrmts, rmtp); + error2 = copyout(&lrmts, args->rmtp, sizeof(lrmts)); + if (error2 != 0) { LIN_SDT_PROBE1(time, linux_nanosleep, copyout_error, - error); - LIN_SDT_PROBE1(time, linux_nanosleep, return, error); - return (error); + error2); + LIN_SDT_PROBE1(time, linux_nanosleep, return, error2); + return (error2); } } - LIN_SDT_PROBE1(time, linux_nanosleep, return, 0); - return (0); + LIN_SDT_PROBE1(time, linux_nanosleep, return, error); + return (error); } int @@ -519,7 +511,7 @@ linux_clock_nanosleep(struct thread *td, struct timespec *rmtp; struct l_timespec lrqts, lrmts; struct timespec rqts, rmts; - int error; + int error, error2; LIN_SDT_PROBE4(time, linux_clock_nanosleep, entry, args->which, args->flags, args->rqtp, args->rmtp); @@ -539,7 +531,7 @@ linux_clock_nanosleep(struct thread *td, return (EINVAL); } - error = copyin(args->rqtp, &lrqts, sizeof lrqts); + error = copyin(args->rqtp, &lrqts, sizeof(lrqts)); if (error != 0) { LIN_SDT_PROBE1(time, linux_clock_nanosleep, copyin_error, error); @@ -548,9 +540,9 @@ linux_clock_nanosleep(struct thread *td, } if (args->rmtp != NULL) - rmtp = &rmts; + rmtp = &rmts; else - rmtp = NULL; + rmtp = NULL; error = linux_to_native_timespec(&rqts, &lrqts); if (error != 0) { @@ -560,24 +552,19 @@ linux_clock_nanosleep(struct thread *td, return (error); } error = kern_nanosleep(td, &rqts, rmtp); - if (error != 0) { - LIN_SDT_PROBE1(time, linux_clock_nanosleep, nanosleep_error, - error); - LIN_SDT_PROBE1(time, linux_clock_nanosleep, return, error); - return (error); - } - if (args->rmtp != NULL) { + /* XXX. Not for TIMER_ABSTIME */ native_to_linux_timespec(&lrmts, rmtp); - error = copyout(&lrmts, args->rmtp, sizeof lrmts ); - if (error != 0) { + error2 = copyout(&lrmts, args->rmtp, sizeof(lrmts)); + if (error2 != 0) { + LIN_SDT_PROBE1(time, linux_clock_nanosleep, + copyout_error, error2); LIN_SDT_PROBE1(time, linux_clock_nanosleep, - copyout_error, error); - LIN_SDT_PROBE1(time, linux_nanosleep, return, error); - return (error); + return, error2); + return (error2); } } - LIN_SDT_PROBE1(time, linux_clock_nanosleep, return, 0); - return (0); + LIN_SDT_PROBE1(time, linux_clock_nanosleep, return, error); + return (error); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:06:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBC16A698C5; Sat, 9 Jan 2016 18:06:39 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B93C91B14; Sat, 9 Jan 2016 18:06:39 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09I6c6V071715; Sat, 9 Jan 2016 18:06:38 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09I6cuj071711; Sat, 9 Jan 2016 18:06:38 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091806.u09I6cuj071711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293599 - in stable/10/sys: conf modules/linux modules/linux64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:06:40 -0000 Author: dchagin Date: Sat Jan 9 18:06:38 2016 New Revision: 293599 URL: https://svnweb.freebsd.org/changeset/base/293599 Log: MFC r283506 (by rodrigc): For objcopy, use --input-target and --output-target When building with gcc 4.9 and binutils 2.25, using '--input' and '--output' returns an error message: objcopy: option `--input' is ambiguous Modified: stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/modules/linux/Makefile stable/10/sys/modules/linux64/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Sat Jan 9 18:05:04 2016 (r293598) +++ stable/10/sys/conf/files.amd64 Sat Jan 9 18:06:38 2016 (r293599) @@ -28,7 +28,7 @@ linux32_locore.o optional compat_linux32 # linux32_vdso.so optional compat_linux32 \ dependency "linux32_locore.o" \ - compile-with "${OBJCOPY} --input binary --output elf64-x86-64-freebsd --binary-architecture i386 linux32_locore.o ${.TARGET}" \ + compile-with "${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd --binary-architecture i386 linux32_locore.o ${.TARGET}" \ no-implicit-rule \ clean "linux32_vdso.so" # Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Sat Jan 9 18:05:04 2016 (r293598) +++ stable/10/sys/conf/files.i386 Sat Jan 9 18:06:38 2016 (r293599) @@ -27,7 +27,7 @@ linux_locore.o optional compat_linux # linux_vdso.so optional compat_linux \ dependency "linux_locore.o" \ - compile-with "${OBJCOPY} --input binary --output elf32-i386-freebsd --binary-architecture i386 linux_locore.o ${.TARGET}" \ + compile-with "${OBJCOPY} --input-target binary --output-target elf32-i386-freebsd --binary-architecture i386 linux_locore.o ${.TARGET}" \ no-implicit-rule \ clean "linux_vdso.so" # Modified: stable/10/sys/modules/linux/Makefile ============================================================================== --- stable/10/sys/modules/linux/Makefile Sat Jan 9 18:05:04 2016 (r293598) +++ stable/10/sys/modules/linux/Makefile Sat Jan 9 18:06:38 2016 (r293599) @@ -62,11 +62,11 @@ linux${SFX}_support.o: linux${SFX}_assym .if ${MACHINE_CPUARCH} == "amd64" ${VDSO}.so: linux${SFX}_locore.o - ${OBJCOPY} --input binary --output elf64-x86-64-freebsd \ + ${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd \ --binary-architecture i386 linux${SFX}_locore.o ${.TARGET} .else ${VDSO}.so: linux${SFX}_locore.o - ${OBJCOPY} --input binary --output elf32-i386-freebsd \ + ${OBJCOPY} --input-target binary --output-target elf32-i386-freebsd \ --binary-architecture i386 linux${SFX}_locore.o ${.TARGET} .endif Modified: stable/10/sys/modules/linux64/Makefile ============================================================================== --- stable/10/sys/modules/linux64/Makefile Sat Jan 9 18:05:04 2016 (r293598) +++ stable/10/sys/modules/linux64/Makefile Sat Jan 9 18:06:38 2016 (r293599) @@ -33,7 +33,7 @@ linux_locore.o: linux_locore.s linux_ass ${.IMPSRC} -o ${.TARGET} ${VDSO}.so: linux_locore.o - ${OBJCOPY} --input binary --output elf64-x86-64-freebsd \ + ${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd \ -S -g --binary-architecture i386:x86-64 linux_locore.o ${.TARGET} linux_support.o: assym.s linux_assym.h From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:07:50 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5736DA6996A; Sat, 9 Jan 2016 18:07:50 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32CF01C9A; Sat, 9 Jan 2016 18:07:50 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09I7nbb071811; Sat, 9 Jan 2016 18:07:49 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09I7n48071808; Sat, 9 Jan 2016 18:07:49 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091807.u09I7n48071808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:07:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293600 - in stable/10/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:07:50 -0000 Author: dchagin Date: Sat Jan 9 18:07:48 2016 New Revision: 293600 URL: https://svnweb.freebsd.org/changeset/base/293600 Log: MFC r283544: When I merged the lemul branch I missied kib@'s r282708 commit. This is not the final fix as I need properly cleanup thread resources before other threads suicide. Modified: stable/10/sys/amd64/linux32/linux32_machdep.c stable/10/sys/compat/linux/linux_emul.c stable/10/sys/i386/linux/linux_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 18:06:38 2016 (r293599) +++ stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 18:07:48 2016 (r293600) @@ -126,7 +126,6 @@ int linux_execve(struct thread *td, struct linux_execve_args *args) { struct image_args eargs; - struct vmspace *oldvmspace; char *path; int error; @@ -137,19 +136,11 @@ linux_execve(struct thread *td, struct l printf(ARGS(execve, "%s"), path); #endif - error = pre_execve(td, &oldvmspace); - if (error != 0) { - free(path, M_TEMP); - return (error); - } error = freebsd32_exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp, args->envp); free(path, M_TEMP); if (error == 0) - error = kern_execve(td, &eargs, NULL); - if (error == 0) error = linux_common_execve(td, &eargs); - post_execve(td, error, oldvmspace); return (error); } Modified: stable/10/sys/compat/linux/linux_emul.c ============================================================================== --- stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 18:06:38 2016 (r293599) +++ stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 18:07:48 2016 (r293600) @@ -172,27 +172,19 @@ linux_common_execve(struct thread *td, s { struct linux_pemuldata *pem; struct epoll_emuldata *emd; + struct vmspace *oldvmspace; struct linux_emuldata *em; struct proc *p; int error; p = td->td_proc; - /* - * Unlike FreeBSD abort all other threads before - * proceeding exec. - */ - PROC_LOCK(p); - /* See exit1() comments. */ - thread_suspend_check(0); - while (p->p_flag & P_HADTHREADS) { - if (!thread_single(p, SINGLE_EXIT)) - break; - thread_suspend_check(0); - } - PROC_UNLOCK(p); + error = pre_execve(td, &oldvmspace); + if (error != 0) + return (error); error = kern_execve(td, eargs, NULL); + post_execve(td, error, oldvmspace); if (error != 0) return (error); Modified: stable/10/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/10/sys/i386/linux/linux_machdep.c Sat Jan 9 18:06:38 2016 (r293599) +++ stable/10/sys/i386/linux/linux_machdep.c Sat Jan 9 18:07:48 2016 (r293600) @@ -104,7 +104,6 @@ int linux_execve(struct thread *td, struct linux_execve_args *args) { struct image_args eargs; - struct vmspace *oldvmspace; char *newpath; int error; @@ -115,19 +114,11 @@ linux_execve(struct thread *td, struct l printf(ARGS(execve, "%s"), newpath); #endif - error = pre_execve(td, &oldvmspace); - if (error != 0) { - free(newpath, M_TEMP); - return (error); - } error = exec_copyin_args(&eargs, newpath, UIO_SYSSPACE, args->argp, args->envp); free(newpath, M_TEMP); if (error == 0) - error = kern_execve(td, &eargs, NULL); - if (error == 0) error = linux_common_execve(td, &eargs); - post_execve(td, error, oldvmspace); return (error); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:09:09 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 542DCA699DA; Sat, 9 Jan 2016 18:09:09 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09B4A1DF2; Sat, 9 Jan 2016 18:09:08 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09I98Vk071917; Sat, 9 Jan 2016 18:09:08 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09I98ps071916; Sat, 9 Jan 2016 18:09:08 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091809.u09I98ps071916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293601 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:09:09 -0000 Author: dchagin Date: Sat Jan 9 18:09:07 2016 New Revision: 293601 URL: https://svnweb.freebsd.org/changeset/base/293601 Log: MFC r283569 (by nyan): MFi386: r283407 Implement vdso - virtual dynamic shared object. MFi386: r283474 Rework signal code to allow using it by other modules, like linprocfs. MFi386: r283506 For objcopy, use --input-target and --output-target. This fixes pc98 build. Modified: stable/10/sys/conf/files.pc98 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.pc98 ============================================================================== --- stable/10/sys/conf/files.pc98 Sat Jan 9 18:07:48 2016 (r293600) +++ stable/10/sys/conf/files.pc98 Sat Jan 9 18:09:07 2016 (r293601) @@ -21,6 +21,18 @@ linux_assym.h optional compat_linux \ no-obj no-implicit-rule before-depend \ clean "linux_assym.h" # +linux_locore.o optional compat_linux \ + dependency "linux_assym.h $S/i386/linux/linux_locore.s" \ + compile-with "${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S -Werror -Wall -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-fPIC,-warn-common ${.IMPSRC} -o ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "linux_locore.o" +# +linux_vdso.so optional compat_linux \ + dependency "linux_locore.o" \ + compile-with "${OBJCOPY} --input-target binary --output-target elf32-i386-freebsd --binary-architecture i386 linux_locore.o ${.TARGET}" \ + no-implicit-rule \ + clean "linux_vdso.so" +# svr4_genassym.o optional compat_svr4 \ dependency "$S/i386/svr4/svr4_genassym.c" \ compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \ @@ -59,6 +71,8 @@ compat/linux/linux_time.c optional compa compat/linux/linux_timer.c optional compat_linux compat/linux/linux_uid16.c optional compat_linux compat/linux/linux_util.c optional compat_linux +compat/linux/linux_vdso.c optional compat_linux +compat/linux/linux.c optional compat_linux compat/svr4/imgact_svr4.c optional compat_svr4 compat/svr4/svr4_fcntl.c optional compat_svr4 compat/svr4/svr4_filio.c optional compat_svr4 @@ -193,8 +207,6 @@ i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine i386/linux/imgact_linux.c optional compat_linux i386/linux/linux_dummy.c optional compat_linux -i386/linux/linux_locore.s optional compat_linux \ - dependency "linux_assym.h" i386/linux/linux_machdep.c optional compat_linux i386/linux/linux_ptrace.c optional compat_linux i386/linux/linux_support.s optional compat_linux \ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:16:37 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2699A69E2E; Sat, 9 Jan 2016 18:16:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A566B1464; Sat, 9 Jan 2016 18:16:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09IGakk074955; Sat, 9 Jan 2016 18:16:36 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09IGawV074954; Sat, 9 Jan 2016 18:16:36 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091816.u09IGawV074954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:16:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293602 - stable/10/sys/modules X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:16:37 -0000 Author: dchagin Date: Sat Jan 9 18:16:36 2016 New Revision: 293602 URL: https://svnweb.freebsd.org/changeset/base/293602 Log: MFC r283680, r283681: Move linux64 and linux_common to it's right place and make them not depend on bhyve. Modified: stable/10/sys/modules/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/modules/Makefile ============================================================================== --- stable/10/sys/modules/Makefile Sat Jan 9 18:09:07 2016 (r293601) +++ stable/10/sys/modules/Makefile Sat Jan 9 18:16:36 2016 (r293602) @@ -751,6 +751,8 @@ _lindev= lindev _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux +_linux64= linux64 +_linux_common= linux_common _mly= mly .if ${MK_OFED} != "no" || defined(ALL_MODULES) _mlx4= mlx4 @@ -801,8 +803,6 @@ _viawd= viawd _virtio= virtio .if ${MK_BHYVE} != "no" || defined(ALL_MODULES) _vmm= vmm -_linux_common= linux_common -_linux64= linux64 .endif _vxge= vxge _x86bios= x86bios From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:17:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FC9EA69F19; Sat, 9 Jan 2016 18:17:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50400179F; Sat, 9 Jan 2016 18:17:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09IHwvw075179; Sat, 9 Jan 2016 18:17:58 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09IHwe0075178; Sat, 9 Jan 2016 18:17:58 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091817.u09IHwe0075178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293603 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:17:59 -0000 Author: dchagin Date: Sat Jan 9 18:17:58 2016 New Revision: 293603 URL: https://svnweb.freebsd.org/changeset/base/293603 Log: MFC r284051: Finish r283544. In exec case properly detach threads from user space before suicide. Modified: stable/10/sys/compat/linux/linux_emul.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_emul.c ============================================================================== --- stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 18:16:36 2016 (r293602) +++ stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 18:17:58 2016 (r293603) @@ -219,6 +219,18 @@ void linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp) { struct thread *td = curthread; + struct thread *othertd; + + /* + * In a case of execing from linux binary properly detach + * other threads from the user space. + */ + if (__predict_false(SV_PROC_ABI(p) == SV_ABI_LINUX)) { + FOREACH_THREAD_IN_PROC(p, othertd) { + if (td != othertd) + (p->p_sysent->sv_thread_detach)(othertd); + } + } /* * In a case of execing to linux binary we create linux From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:19:20 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A9B4A69FC7; Sat, 9 Jan 2016 18:19:20 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5B771A3B; Sat, 9 Jan 2016 18:19:19 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09IJJeA075422; Sat, 9 Jan 2016 18:19:19 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09IJInU075421; Sat, 9 Jan 2016 18:19:18 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091819.u09IJInU075421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293604 - stable/10/sys/amd64/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:19:20 -0000 Author: dchagin Date: Sat Jan 9 18:19:18 2016 New Revision: 293604 URL: https://svnweb.freebsd.org/changeset/base/293604 Log: MFC r284159: Futex is an aligned 32-bit integer. Use the proper instruction and operand when dereferencing futex pointer. Modified: stable/10/sys/amd64/linux/linux_support.s Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_support.s ============================================================================== --- stable/10/sys/amd64/linux/linux_support.s Sat Jan 9 18:17:58 2016 (r293603) +++ stable/10/sys/amd64/linux/linux_support.s Sat Jan 9 18:19:18 2016 (r293604) @@ -45,9 +45,9 @@ ENTRY(futex_xchgl) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi ja futex_fault - xchgq %rdi,(%rsi) - movq %rdi,(%rdx) - xorq %rax,%rax + xchgl %edi,(%rsi) + movl %edi,(%rdx) + xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret @@ -60,9 +60,9 @@ ENTRY(futex_addl) #ifdef SMP lock #endif - xaddq %rdi,(%rsi) - movq %rdi,(%rdx) - xorq %rax,%rax + xaddl %edi,(%rsi) + movl %edi,(%rdx) + xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret @@ -72,16 +72,16 @@ ENTRY(futex_orl) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi ja futex_fault - movq (%rsi),%rax -1: movq %rax,%rcx - orq %rdi,%rcx + movl (%rsi),%eax +1: movl %eax,%ecx + orl %edi,%ecx #ifdef SMP lock #endif - cmpxchgq %rcx,(%rsi) + cmpxchgl %ecx,(%rsi) jnz 1b - movq %rax,(%rdx) - xorq %rax,%rax + movl %eax,(%rdx) + xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret @@ -91,16 +91,16 @@ ENTRY(futex_andl) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi ja futex_fault - movq (%rsi),%rax -1: movq %rax,%rcx - andq %rdi,%rcx + movl (%rsi),%eax +1: movl %eax,%ecx + andl %edi,%ecx #ifdef SMP lock #endif - cmpxchgq %rcx,(%rsi) + cmpxchgl %ecx,(%rsi) jnz 1b - movq %rax,(%rdx) - xorq %rax,%rax + movl %eax,(%rdx) + xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret @@ -110,15 +110,15 @@ ENTRY(futex_xorl) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi ja futex_fault - movq (%rsi),%rax -1: movq %rax,%rcx - xorq %rdi,%rcx + movl (%rsi),%eax +1: movl %eax,%ecx + xorl %edi,%ecx #ifdef SMP lock #endif - cmpxchgq %rcx,(%rsi) + cmpxchgl %ecx,(%rsi) jnz 1b - movq %rax,(%rdx) - xorq %rax,%rax + movl %eax,(%rdx) + xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:22:11 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 290CFA6818F; Sat, 9 Jan 2016 18:22:11 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7F771D43; Sat, 9 Jan 2016 18:22:10 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09IM94m078183; Sat, 9 Jan 2016 18:22:09 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09IM9a8078182; Sat, 9 Jan 2016 18:22:09 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091822.u09IM9a8078182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293605 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:22:11 -0000 Author: dchagin Date: Sat Jan 9 18:22:09 2016 New Revision: 293605 URL: https://svnweb.freebsd.org/changeset/base/293605 Log: MFC r284166 (by jkim): Properly initialize flags for accept4(2) not to return spurious EINVAL. Note this fixes a Linuxulator regression introduced in r283490. PR: 200662 Modified: stable/10/sys/compat/linux/linux_socket.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 18:19:18 2016 (r293604) +++ stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 18:22:09 2016 (r293605) @@ -787,6 +787,7 @@ linux_accept_common(struct thread *td, i /* XXX: */ bsd_args.name = (struct sockaddr * __restrict)PTRIN(addr); bsd_args.anamelen = PTRIN(namelen);/* XXX */ + bsd_args.flags = 0; error = linux_set_socket_flags(flags, &bsd_args.flags); if (error != 0) return (error); From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:23:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25FE0A68231; Sat, 9 Jan 2016 18:23:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE7191EEF; Sat, 9 Jan 2016 18:23:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09INYLn078299; Sat, 9 Jan 2016 18:23:34 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09INY4F078297; Sat, 9 Jan 2016 18:23:34 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091823.u09INY4F078297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293606 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:23:36 -0000 Author: dchagin Date: Sat Jan 9 18:23:34 2016 New Revision: 293606 URL: https://svnweb.freebsd.org/changeset/base/293606 Log: MFC r284626: Add EPOLLRDHUP support. Modified: stable/10/sys/compat/linux/linux_event.c stable/10/sys/compat/linux/linux_event.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_event.c ============================================================================== --- stable/10/sys/compat/linux/linux_event.c Sat Jan 9 18:22:09 2016 (r293605) +++ stable/10/sys/compat/linux/linux_event.c Sat Jan 9 18:23:34 2016 (r293606) @@ -257,6 +257,8 @@ epoll_to_kevent(struct thread *td, struc *kev_flags |= EV_CLEAR; if ((levents & LINUX_EPOLLERR) != 0) *kev_flags |= EV_ERROR; + if ((levents & LINUX_EPOLLRDHUP) != 0) + *kev_flags |= EV_EOF; /* flags related to what event is registered */ if ((levents & LINUX_EPOLL_EVRD) != 0) { @@ -306,6 +308,8 @@ kevent_to_epoll(struct kevent *kevent, s switch (kevent->filter) { case EVFILT_READ: l_event->events = LINUX_EPOLLIN|LINUX_EPOLLRDNORM|LINUX_EPOLLPRI; + if ((kevent->flags & EV_EOF) != 0) + l_event->events |= LINUX_EPOLLRDHUP; break; case EVFILT_WRITE: l_event->events = LINUX_EPOLLOUT|LINUX_EPOLLWRNORM; Modified: stable/10/sys/compat/linux/linux_event.h ============================================================================== --- stable/10/sys/compat/linux/linux_event.h Sat Jan 9 18:22:09 2016 (r293605) +++ stable/10/sys/compat/linux/linux_event.h Sat Jan 9 18:23:34 2016 (r293606) @@ -49,7 +49,7 @@ |LINUX_EPOLLHUP|LINUX_EPOLLERR|LINUX_EPOLLPRI) #define LINUX_EPOLL_EVWR (LINUX_EPOLLOUT|LINUX_EPOLLWRNORM) #define LINUX_EPOLL_EVSUP (LINUX_EPOLLET|LINUX_EPOLLONESHOT \ - |LINUX_EPOLL_EVRD|LINUX_EPOLL_EVWR) + |LINUX_EPOLL_EVRD|LINUX_EPOLL_EVWR|LINUX_EPOLLRDHUP) #define LINUX_EPOLL_CTL_ADD 1 #define LINUX_EPOLL_CTL_DEL 2 From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:24:54 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2D20A6829D; Sat, 9 Jan 2016 18:24:54 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B02C3107B; Sat, 9 Jan 2016 18:24:54 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09IOruU078403; Sat, 9 Jan 2016 18:24:53 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09IOrRp078402; Sat, 9 Jan 2016 18:24:53 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091824.u09IOrRp078402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293607 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:24:55 -0000 Author: dchagin Date: Sat Jan 9 18:24:53 2016 New Revision: 293607 URL: https://svnweb.freebsd.org/changeset/base/293607 Log: MFC r287395 (by trasz): Fixes a panic triggered by threaded Linux applications when running with RACCT/RCTL enabled. Modified: stable/10/sys/compat/linux/linux_fork.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_fork.c ============================================================================== --- stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 18:23:34 2016 (r293606) +++ stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 18:24:53 2016 (r293607) @@ -286,10 +286,20 @@ linux_clone_thread(struct thread *td, st p = td->td_proc; +#ifdef RACCT + if (racct_enable) { + PROC_LOCK(p); + error = racct_add(p, RACCT_NTHR, 1); + PROC_UNLOCK(p); + if (error != 0) + return (EPROCLIM); + } +#endif + /* Initialize our td */ error = kern_thr_alloc(p, 0, &newtd); if (error) - return (error); + goto fail; cpu_set_upcall(newtd, td); @@ -370,6 +380,16 @@ linux_clone_thread(struct thread *td, st td->td_retval[0] = newtd->td_tid; return (0); + +fail: +#ifdef RACCT + if (racct_enable) { + PROC_LOCK(p); + racct_sub(p, RACCT_NTHR, 1); + PROC_UNLOCK(p); + } +#endif + return (error); } int From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:28:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C29F1A68405; Sat, 9 Jan 2016 18:28:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 826271323; Sat, 9 Jan 2016 18:28:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09ISFRP078685; Sat, 9 Jan 2016 18:28:15 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09ISFmg078684; Sat, 9 Jan 2016 18:28:15 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091828.u09ISFmg078684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293608 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:28:17 -0000 Author: dchagin Date: Sat Jan 9 18:28:15 2016 New Revision: 293608 URL: https://svnweb.freebsd.org/changeset/base/293608 Log: MFC r288994 (by bdrewery): Remove redundant RFFPWAIT/vfork(2) handling in Linux fork(2) and clone(2) wrappers. r161611 added some of the code from sys_vfork() directly into the Linux module wrappers since they use RFSTOPPED. In r232240, the RFFPWAIT handling was moved to syscallret(), thus this code in the Linux module is no longer needed as it will be called later. This also allows the Linux wrappers to benefit from the fix in r275616 for threads not getting suspended if their vforked child is stopped while they wait on them. Modified: stable/10/sys/compat/linux/linux_fork.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_fork.c ============================================================================== --- stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 18:24:53 2016 (r293607) +++ stable/10/sys/compat/linux/linux_fork.c Sat Jan 9 18:28:15 2016 (r293608) @@ -107,20 +107,14 @@ linux_vfork(struct thread *td, struct li printf(ARGS(vfork, "")); #endif - /* Exclude RFPPWAIT */ - if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFSTOPPED, 0, &p2, - NULL, 0)) != 0) + if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFPPWAIT | RFSTOPPED, + 0, &p2, NULL, 0)) != 0) return (error); - td2 = FIRST_THREAD_IN_PROC(p2); linux_proc_init(td, td2, 0); - PROC_LOCK(p2); - p2->p_flag |= P_PPWAIT; - PROC_UNLOCK(p2); - td->td_retval[0] = p2->p_pid; /* @@ -131,12 +125,6 @@ linux_vfork(struct thread *td, struct li sched_add(td2, SRQ_BORING); thread_unlock(td2); - /* wait for the children to exit, ie. emulate vfork */ - PROC_LOCK(p2); - while (p2->p_flag & P_PPWAIT) - cv_wait(&p2->p_pwait, &p2->p_mtx); - PROC_UNLOCK(p2); - return (0); } @@ -180,6 +168,9 @@ linux_clone_proc(struct thread *td, stru if (args->parent_tidptr == NULL) return (EINVAL); + if (args->flags & LINUX_CLONE_VFORK) + ff |= RFPPWAIT; + error = fork1(td, ff, 0, &p2, NULL, 0); if (error) return (error); @@ -229,12 +220,6 @@ linux_clone_proc(struct thread *td, stru exit_signal); #endif - if (args->flags & LINUX_CLONE_VFORK) { - PROC_LOCK(p2); - p2->p_flag |= P_PPWAIT; - PROC_UNLOCK(p2); - } - /* * Make this runnable after we are finished with it. */ @@ -245,14 +230,6 @@ linux_clone_proc(struct thread *td, stru td->td_retval[0] = p2->p_pid; - if (args->flags & LINUX_CLONE_VFORK) { - /* wait for the children to exit, ie. emulate vfork */ - PROC_LOCK(p2); - while (p2->p_flag & P_PPWAIT) - cv_wait(&p2->p_pwait, &p2->p_mtx); - PROC_UNLOCK(p2); - } - return (0); } From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:32:54 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D65EA6869C; Sat, 9 Jan 2016 18:32:54 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F23CC1858; Sat, 9 Jan 2016 18:32:53 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09IWrqv081364; Sat, 9 Jan 2016 18:32:53 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09IWqt8081361; Sat, 9 Jan 2016 18:32:52 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091832.u09IWqt8081361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293609 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:32:54 -0000 Author: dchagin Date: Sat Jan 9 18:32:52 2016 New Revision: 293609 URL: https://svnweb.freebsd.org/changeset/base/293609 Log: MFC r289055 (by mjg@): linux: fix handling of out-of-bounds syscall attempts Due to an off by one the code would read an entry past the table, as opposed to the last entry which contains the nosys handler. This fixes my fault. MFC r289058 (by cem@): Fix missing semi-colon from r289055. MFC r289768 (by jhb@): Merge r289055 to amd64/linux32: linux: fix handling of out-of-bounds syscall attempts Due to an off by one the code would read an entry past the table, as opposed to the last entry which contains the nosys handler. Modified: stable/10/sys/amd64/linux/linux_sysvec.c stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/i386/linux/linux_sysvec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysvec.c Sat Jan 9 18:28:15 2016 (r293608) +++ stable/10/sys/amd64/linux/linux_sysvec.c Sat Jan 9 18:32:52 2016 (r293609) @@ -234,7 +234,7 @@ linux_fetch_syscall_args(struct thread * if (sa->code >= p->p_sysent->sv_size) /* nosys */ - sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL]; + sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1]; else sa->callp = &p->p_sysent->sv_table[sa->code]; sa->narg = sa->callp->sy_narg; Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 18:28:15 2016 (r293608) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Sat Jan 9 18:32:52 2016 (r293609) @@ -741,7 +741,7 @@ linux32_fetch_syscall_args(struct thread if (sa->code >= p->p_sysent->sv_size) /* nosys */ - sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL]; + sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1]; else sa->callp = &p->p_sysent->sv_table[sa->code]; sa->narg = sa->callp->sy_narg; Modified: stable/10/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysvec.c Sat Jan 9 18:28:15 2016 (r293608) +++ stable/10/sys/i386/linux/linux_sysvec.c Sat Jan 9 18:32:52 2016 (r293609) @@ -866,7 +866,7 @@ linux_fetch_syscall_args(struct thread * if (sa->code >= p->p_sysent->sv_size) /* nosys */ - sa->callp = &p->p_sysent->sv_table[LINUX_SYS_MAXSYSCALL]; + sa->callp = &p->p_sysent->sv_table[p->p_sysent->sv_size - 1]; else sa->callp = &p->p_sysent->sv_table[sa->code]; sa->narg = sa->callp->sy_narg; From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:40:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25DFAA68AC0; Sat, 9 Jan 2016 18:40:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E70AF1CBE; Sat, 9 Jan 2016 18:40:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09IeKih081767; Sat, 9 Jan 2016 18:40:20 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09IeKwL081766; Sat, 9 Jan 2016 18:40:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091840.u09IeKwL081766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293610 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:40:22 -0000 Author: dchagin Date: Sat Jan 9 18:40:20 2016 New Revision: 293610 URL: https://svnweb.freebsd.org/changeset/base/293610 Log: Bump __FreeBSD_version after Linux changes merge. Modified: stable/10/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Sat Jan 9 18:32:52 2016 (r293609) +++ stable/10/sys/sys/param.h Sat Jan 9 18:40:20 2016 (r293610) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1002506 /* Master, propagated to newvers */ +#define __FreeBSD_version 1002507 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-10@freebsd.org Sat Jan 9 19:01:45 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CB30A69466; Sat, 9 Jan 2016 19:01:45 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0EAD1DF8; Sat, 9 Jan 2016 19:01:44 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id u09IoTp0039103; Sat, 9 Jan 2016 21:50:30 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Sat, 9 Jan 2016 21:50:29 +0300 (MSK) From: Dmitry Morozovsky To: Dmitry Chagin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r293610 - stable/10/sys/sys In-Reply-To: <201601091840.u09IeKwL081766@repo.freebsd.org> Message-ID: References: <201601091840.u09IeKwL081766@repo.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Sat, 09 Jan 2016 21:50:30 +0300 (MSK) X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 19:01:45 -0000 On Sat, 9 Jan 2016, Dmitry Chagin wrote: > Author: dchagin > Date: Sat Jan 9 18:40:20 2016 > New Revision: 293610 > URL: https://svnweb.freebsd.org/changeset/base/293610 > > Log: > Bump __FreeBSD_version after Linux changes merge. 134 commits in four and a half hours. Tremendous work. Thank you so much! -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-stable-10@freebsd.org Sat Jan 9 19:05:31 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F2B3A695D1; Sat, 9 Jan 2016 19:05:31 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 78CA91128; Sat, 9 Jan 2016 19:05:31 +0000 (UTC) (envelope-from dchagin@chd.heemeyer.club) Received: from chd.heemeyer.club ([78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id u09J5Ppe032597 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 9 Jan 2016 19:05:27 GMT (envelope-from dchagin@chd.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host [78.107.232.239] claimed to be chd.heemeyer.club Received: from chd.heemeyer.club (localhost [127.0.0.1]) by chd.heemeyer.club (8.15.2/8.15.1) with ESMTPS id u09J5O3L018807 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 9 Jan 2016 22:05:24 +0300 (MSK) (envelope-from dchagin@chd.heemeyer.club) Received: (from dchagin@localhost) by chd.heemeyer.club (8.15.2/8.15.1/Submit) id u09J5Oik018806; Sat, 9 Jan 2016 22:05:24 +0300 (MSK) (envelope-from dchagin) Date: Sat, 9 Jan 2016 22:05:24 +0300 From: Chagin Dmitry To: Dmitry Morozovsky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r293610 - stable/10/sys/sys Message-ID: <20160109190524.GA18797@chd.heemeyer.club> References: <201601091840.u09IeKwL081766@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 19:05:31 -0000 On Sat, Jan 09, 2016 at 09:50:29PM +0300, Dmitry Morozovsky wrote: > On Sat, 9 Jan 2016, Dmitry Chagin wrote: > > > Author: dchagin > > Date: Sat Jan 9 18:40:20 2016 > > New Revision: 293610 > > URL: https://svnweb.freebsd.org/changeset/base/293610 > > > > Log: > > Bump __FreeBSD_version after Linux changes merge. > > 134 commits in four and a half hours. Tremendous work. > > Thank you so much! > got tired, so, will collect bugs now -- Have fun! chd From owner-svn-src-stable-10@freebsd.org Sat Jan 9 21:27:51 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30D0DA6AAE8; Sat, 9 Jan 2016 21:27:51 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E26A01371; Sat, 9 Jan 2016 21:27:50 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aI135-000DSJ-1F; Sun, 10 Jan 2016 00:27:47 +0300 Date: Sun, 10 Jan 2016 00:27:46 +0300 From: Slawa Olhovchenkov To: Chagin Dmitry Cc: Dmitry Morozovsky , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r293610 - stable/10/sys/sys Message-ID: <20160109212746.GM70867@zxy.spb.ru> References: <201601091840.u09IeKwL081766@repo.freebsd.org> <20160109190524.GA18797@chd.heemeyer.club> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160109190524.GA18797@chd.heemeyer.club> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 21:27:51 -0000 On Sat, Jan 09, 2016 at 10:05:24PM +0300, Chagin Dmitry wrote: > On Sat, Jan 09, 2016 at 09:50:29PM +0300, Dmitry Morozovsky wrote: > > On Sat, 9 Jan 2016, Dmitry Chagin wrote: > > > > > Author: dchagin > > > Date: Sat Jan 9 18:40:20 2016 > > > New Revision: 293610 > > > URL: https://svnweb.freebsd.org/changeset/base/293610 > > > > > > Log: > > > Bump __FreeBSD_version after Linux changes merge. > > > > 134 commits in four and a half hours. Tremendous work. > > > > Thank you so much! > > > got tired, so, will collect bugs now skype 4.3 (not from port) work for me (w/o sound, need ports install). flash fully work for me. citrix have trouble (don't know source, may be trouble on server) From owner-svn-src-stable-10@freebsd.org Sat Jan 9 23:33:46 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75F26A69728; Sat, 9 Jan 2016 23:33:46 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D2DB1A58; Sat, 9 Jan 2016 23:33:46 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09NXjqG070128; Sat, 9 Jan 2016 23:33:45 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09NXiNR070122; Sat, 9 Jan 2016 23:33:44 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601092333.u09NXiNR070122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sat, 9 Jan 2016 23:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293619 - in stable/10: lib/libdpv lib/libfigpar sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 23:33:46 -0000 Author: dteske Date: Sat Jan 9 23:33:44 2016 New Revision: 293619 URL: https://svnweb.freebsd.org/changeset/base/293619 Log: MFC r290275: Make figpar(3) types/macros [more] unique (s/fp_/figpar_/gi) Modified: stable/10/lib/libdpv/dialogrc.c stable/10/lib/libdpv/dialogrc.h stable/10/lib/libfigpar/figpar.3 stable/10/lib/libfigpar/figpar.c stable/10/lib/libfigpar/figpar.h stable/10/sys/sys/param.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libdpv/dialogrc.c ============================================================================== --- stable/10/lib/libdpv/dialogrc.c Sat Jan 9 23:22:28 2016 (r293618) +++ stable/10/lib/libdpv/dialogrc.c Sat Jan 9 23:33:44 2016 (r293619) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2015 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -49,58 +49,58 @@ char gauge_color[STR_BUFSIZE] = "47b"; / char separator[STR_BUFSIZE] = ""; /* Function prototypes */ -static int setattr(struct fp_config *, uint32_t, char *, char *); -static int setbool(struct fp_config *, uint32_t, char *, char *); -static int setnum(struct fp_config *, uint32_t, char *, char *); -static int setstr(struct fp_config *, uint32_t, char *, char *); +static int setattr(struct figpar_config *, uint32_t, char *, char *); +static int setbool(struct figpar_config *, uint32_t, char *, char *); +static int setnum(struct figpar_config *, uint32_t, char *, char *); +static int setstr(struct figpar_config *, uint32_t, char *, char *); /* * Anatomy of DIALOGRC (~/.dialogrc by default) * NOTE: Must appear after private function prototypes (above) * NB: Brace-initialization of union requires cast to *first* member of union */ -static struct fp_config dialogrc_config[] = { - /* TYPE Directive DEFAULT HANDLER */ - {FP_TYPE_INT, "aspect", {(void *)0}, &setnum}, - {FP_TYPE_STR, "separate_widget", {separator}, &setstr}, - {FP_TYPE_INT, "tab_len", {(void *)0}, &setnum}, - {FP_TYPE_BOOL, "visit_items", {(void *)0}, &setbool}, - {FP_TYPE_BOOL, "use_shadow", {(void *)1}, &setbool}, - {FP_TYPE_BOOL, "use_colors", {(void *)1}, &setbool}, - {FP_TYPE_STR, "screen_color", {NULL}, &setattr}, - {FP_TYPE_STR, "shadow_color", {NULL}, &setattr}, - {FP_TYPE_STR, "dialog_color", {NULL}, &setattr}, - {FP_TYPE_STR, "title_color", {NULL}, &setattr}, - {FP_TYPE_STR, "border_color", {NULL}, &setattr}, - {FP_TYPE_STR, "button_active_color", {NULL}, &setattr}, - {FP_TYPE_STR, "button_inactive_color", {NULL}, &setattr}, - {FP_TYPE_STR, "button_key_active_color", {NULL}, &setattr}, - {FP_TYPE_STR, "button_key_inactive_color", {NULL}, &setattr}, - {FP_TYPE_STR, "button_label_active_color", {NULL}, &setattr}, - {FP_TYPE_STR, "button_label_inactive_color",{NULL}, &setattr}, - {FP_TYPE_STR, "inputbox_color", {NULL}, &setattr}, - {FP_TYPE_STR, "inputbox_border_color", {NULL}, &setattr}, - {FP_TYPE_STR, "searchbox_color", {NULL}, &setattr}, - {FP_TYPE_STR, "searchbox_title_color", {NULL}, &setattr}, - {FP_TYPE_STR, "searchbox_border_color", {NULL}, &setattr}, - {FP_TYPE_STR, "position_indicator_color", {NULL}, &setattr}, - {FP_TYPE_STR, "menubox_color", {NULL}, &setattr}, - {FP_TYPE_STR, "menubox_border_color", {NULL}, &setattr}, - {FP_TYPE_STR, "item_color", {NULL}, &setattr}, - {FP_TYPE_STR, "item_selected_color", {NULL}, &setattr}, - {FP_TYPE_STR, "tag_color", {NULL}, &setattr}, - {FP_TYPE_STR, "tag_selected_color", {NULL}, &setattr}, - {FP_TYPE_STR, "tag_key_color", {NULL}, &setattr}, - {FP_TYPE_STR, "tag_key_selected_color", {NULL}, &setattr}, - {FP_TYPE_STR, "check_color", {NULL}, &setattr}, - {FP_TYPE_STR, "check_selected_color", {NULL}, &setattr}, - {FP_TYPE_STR, "uarrow_color", {NULL}, &setattr}, - {FP_TYPE_STR, "darrow_color", {NULL}, &setattr}, - {FP_TYPE_STR, "itemhelp_color", {NULL}, &setattr}, - {FP_TYPE_STR, "form_active_text_color", {NULL}, &setattr}, - {FP_TYPE_STR, "form_text_color", {NULL}, &setattr}, - {FP_TYPE_STR, "form_item_readonly_color", {NULL}, &setattr}, - {FP_TYPE_STR, "gauge_color", {gauge_color}, &setattr}, +static struct figpar_config dialogrc_config[] = { + /* TYPE DIRECTIVE DEFAULT HANDLER */ + {FIGPAR_TYPE_INT, "aspect", {(void *)0}, &setnum}, + {FIGPAR_TYPE_STR, "separate_widget", {separator}, &setstr}, + {FIGPAR_TYPE_INT, "tab_len", {(void *)0}, &setnum}, + {FIGPAR_TYPE_BOOL, "visit_items", {(void *)0}, &setbool}, + {FIGPAR_TYPE_BOOL, "use_shadow", {(void *)1}, &setbool}, + {FIGPAR_TYPE_BOOL, "use_colors", {(void *)1}, &setbool}, + {FIGPAR_TYPE_STR, "screen_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "shadow_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "dialog_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "title_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "border_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "button_active_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "button_inactive_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "button_key_active_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "button_key_inactive_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "button_label_active_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "button_label_inactive_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "inputbox_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "inputbox_border_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "searchbox_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "searchbox_title_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "searchbox_border_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "position_indicator_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "menubox_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "menubox_border_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "item_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "item_selected_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "tag_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "tag_selected_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "tag_key_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "tag_key_selected_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "check_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "check_selected_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "uarrow_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "darrow_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "itemhelp_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "form_active_text_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "form_text_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "form_item_readonly_color", {NULL}, &setattr}, + {FIGPAR_TYPE_STR, "gauge_color", {gauge_color}, &setattr}, {0, NULL, {0}, NULL} }; @@ -108,7 +108,7 @@ static struct fp_config dialogrc_config[ * figpar call-back for interpreting value as .dialogrc `Attribute' */ static int -setattr(struct fp_config *option, uint32_t line __unused, +setattr(struct figpar_config *option, uint32_t line __unused, char *directive __unused, char *value) { char *cp = value; @@ -204,7 +204,7 @@ write_attrbuf: * figpar call-back for interpreting value as .dialogrc `Boolean' */ static int -setbool(struct fp_config *option, uint32_t line __unused, +setbool(struct figpar_config *option, uint32_t line __unused, char *directive __unused, char *value) { @@ -227,7 +227,7 @@ setbool(struct fp_config *option, uint32 * figpar call-back for interpreting value as .dialogrc `Number' */ static int -setnum(struct fp_config *option, uint32_t line __unused, +setnum(struct figpar_config *option, uint32_t line __unused, char *directive __unused, char *value) { @@ -247,7 +247,7 @@ setnum(struct fp_config *option, uint32_ * figpar call-back for interpreting value as .dialogrc `String' */ static int -setstr(struct fp_config *option, uint32_t line __unused, +setstr(struct figpar_config *option, uint32_t line __unused, char *directive __unused, char *value) { size_t len; @@ -315,7 +315,8 @@ parse_dialogrc(void) } /* Process file (either $DIALOGRC if set, or `$HOME/.dialogrc') */ - res = parse_config(dialogrc_config, path, NULL, FP_BREAK_ON_EQUALS); + res = parse_config(dialogrc_config, + path, NULL, FIGPAR_BREAK_ON_EQUALS); /* Set some globals based on what we parsed */ use_shadow = dialogrc_config_option("use_shadow")->value.boolean; @@ -328,10 +329,10 @@ parse_dialogrc(void) /* * Return a pointer to the `.dialogrc' config option specific to `directive' or - * static fp_dummy_config (full of NULLs) if none found (see + * static figpar_dummy_config (full of NULLs) if none found (see * get_config_option(3); part of figpar(3)). */ -struct fp_config * +struct figpar_config * dialogrc_config_option(const char *directive) { return (get_config_option(dialogrc_config, directive)); Modified: stable/10/lib/libdpv/dialogrc.h ============================================================================== --- stable/10/lib/libdpv/dialogrc.h Sat Jan 9 23:22:28 2016 (r293618) +++ stable/10/lib/libdpv/dialogrc.h Sat Jan 9 23:33:44 2016 (r293619) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2015 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ extern char separator[]; __BEGIN_DECLS void dialogrc_free(void); int parse_dialogrc(void); -struct fp_config *dialogrc_config_option(const char *_directive); +struct figpar_config *dialogrc_config_option(const char *_directive); __END_DECLS #endif /* !_DIALOGRC_H_ */ Modified: stable/10/lib/libfigpar/figpar.3 ============================================================================== --- stable/10/lib/libfigpar/figpar.3 Sat Jan 9 23:22:28 2016 (r293618) +++ stable/10/lib/libfigpar/figpar.3 Sat Jan 9 23:33:44 2016 (r293619) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Oct 22, 2015 +.Dd Nov 2, 2015 .Dt FIGPAR 3 .Os .Sh NAME @@ -38,13 +38,13 @@ .In figpar.h .Ft int .Fo parse_config -.Fa "struct fp_config options[], const char *path" -.Fa "int \*[lp]*unknown\*[rp]\*[lp]struct fp_config *option, uint32_t line" +.Fa "struct figpar_config options[], const char *path" +.Fa "int \*[lp]*unknown\*[rp]\*[lp]struct figpar_config *option, uint32_t line" .Fa "char *directive, char *value\*[rp], uint8_t processing_options" .Fc -.Ft "struct fp_config *" +.Ft "struct figpar_config *" .Fo get_config_option -.Fa "struct fp_config options[], const char *directive" +.Fa "struct figpar_config options[], const char *directive" .Fc .In string_m.h .Ft int @@ -91,32 +91,32 @@ Configuration directives, types, and cal data structures defined in .In figpar.h : .Bd -literal -offset indent -struct fp_config { - enum fp_cfgtype type; /* value type */ - const char *directive; /* keyword */ - union fp_cfgvalue value; /* value */ +struct figpar_config { + enum figpar_cfgtype type; /* value type */ + const char *directive; /* keyword */ + union figpar_cfgvalue value; /* value */ /* Pointer to function used when directive is found */ - int (*action)(struct fp_config *option, uint32_t line, + int (*action)(struct figpar_config *option, uint32_t line, char *directive, char *value); }; -enum fp_cfgtype { - FP_TYPE_NONE = 0x0000, /* for directives with no value */ - FP_TYPE_BOOL = 0x0001, /* boolean */ - FP_TYPE_INT = 0x0002, /* signed 32 bit integer */ - FP_TYPE_UINT = 0x0004, /* unsigned 32 bit integer */ - FP_TYPE_STR = 0x0008, /* string pointer */ - FP_TYPE_STRARRAY = 0x0010, /* string array pointer */ - FP_TYPE_DATA1 = 0x0020, /* void data type-1 (whatever) */ - FP_TYPE_DATA2 = 0x0040, /* void data type-2 (whatever) */ - FP_TYPE_DATA3 = 0x0080, /* void data type-3 (whatever) */ - FP_TYPE_RESERVED1 = 0x0100, /* reserved data type-1 (future) */ - FP_TYPE_RESERVED2 = 0x0200, /* reserved data type-2 (future) */ - FP_TYPE_RESERVED3 = 0x0400, /* reserved data type-3 (future) */ +enum figpar_cfgtype { + FIGPAR_TYPE_NONE = 0x0000, /* directives with no value */ + FIGPAR_TYPE_BOOL = 0x0001, /* boolean */ + FIGPAR_TYPE_INT = 0x0002, /* signed 32 bit integer */ + FIGPAR_TYPE_UINT = 0x0004, /* unsigned 32 bit integer */ + FIGPAR_TYPE_STR = 0x0008, /* string pointer */ + FIGPAR_TYPE_STRARRAY = 0x0010, /* string array pointer */ + FIGPAR_TYPE_DATA1 = 0x0020, /* void data type-1 (open) */ + FIGPAR_TYPE_DATA2 = 0x0040, /* void data type-2 (open) */ + FIGPAR_TYPE_DATA3 = 0x0080, /* void data type-3 (open) */ + FIGPAR_TYPE_RESERVED1 = 0x0100, /* reserved data type-1 */ + FIGPAR_TYPE_RESERVED2 = 0x0200, /* reserved data type-2 */ + FIGPAR_TYPE_RESERVED3 = 0x0400, /* reserved data type-3 */ }; -union fp_cfgvalue { +union figpar_cfgvalue { void *data; /* Pointer to NUL-terminated string */ char *str; /* Pointer to NUL-terminated string */ char **strarray; /* Pointer to an array of strings */ @@ -133,26 +133,26 @@ argument to is a mask of bit fields which indicate various processing options. The possible flags are as follows: -.Bl -tag -width FP_BREAK_ON_SEMICOLON -.It Dv FP_BREAK_ON_EQUALS +.Bl -tag -width FIGPAR_BREAK_ON_SEMICOLON +.It Dv FIGPAR_BREAK_ON_EQUALS An equals sign .Pq Ql Li = is normally considered part of the directive. This flag enables terminating the directive at the equals sign. Also makes equals sign optional and transient. -.It Dv FP_BREAK_ON_SEMICOLON +.It Dv FIGPAR_BREAK_ON_SEMICOLON A semicolon .Pq Ql Li \; is normally considered part of the value. This flag enables terminating the value at the semicolon. Also allows multiple statements on a single line separated by semicolon. -.It Dv FP_CASE_SENSITIVE +.It Dv FIGPAR_CASE_SENSITIVE Normally directives are matched case insensitively using .Xr fnmatch 3 . This flag enables directive matching to be case sensitive. -.It Dv FP_REQUIRE_EQUALS +.It Dv FIGPAR_REQUIRE_EQUALS If a directive is not followed by an equals, processing is aborted. -.It Dv FP_STRICT_EQUALS +.It Dv FIGPAR_STRICT_EQUALS Equals must be part of the directive to be considered a delimiter between directive and value. .El @@ -163,14 +163,14 @@ struct array pointer can be NULL and eve .Fn unknown function argument. .Pp -The directive for each fp_config item in the +The directive for each figpar_config item in the .Fn parse_config options argument is matched against each parsed directive using .Xr fnmatch 3 until a match is found. If a match is found, the .Fn action -function for that fp_config directive is invoked with the line number, +function for that figpar_config directive is invoked with the line number, directive, and value. Otherwise if no match, the .Fn unknown @@ -192,11 +192,11 @@ or if no match a pointer to a static dum .Pq whose values are all zero or NULL . .Pp The use of -.Fa "struct fp_config" +.Fa "struct figpar_config" is entirely optional as-is the use of -.Fa "enum fp_cfgtype" +.Fa "enum figpar_cfgtype" or -.Fa "union fp_cfgvalue" . +.Fa "union figpar_cfgvalue" . For example, you could choose to pass a NULL pointer to .Fn parse_config for the first argument and then provide a simple Modified: stable/10/lib/libfigpar/figpar.c ============================================================================== --- stable/10/lib/libfigpar/figpar.c Sat Jan 9 23:22:28 2016 (r293618) +++ stable/10/lib/libfigpar/figpar.c Sat Jan 9 23:33:44 2016 (r293619) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002-2014 Devin Teske + * Copyright (c) 2002-2015 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,24 +40,25 @@ __FBSDID("$FreeBSD$"); #include "figpar.h" #include "string_m.h" -struct fp_config fp_dummy_config = {0, NULL, {0}, NULL}; +struct figpar_config figpar_dummy_config = {0, NULL, {0}, NULL}; /* - * Search for config option (struct fp_config) in the array of config options, - * returning the struct whose directive matches the given parameter. If no - * match is found, a pointer to the static dummy array (above) is returned. + * Search for config option (struct figpar_config) in the array of config + * options, returning the struct whose directive matches the given parameter. + * If no match is found, a pointer to the static dummy array (above) is + * returned. * * This is to eliminate dependency on the index position of an item in the * array, since the index position is more apt to be changed as code grows. */ -struct fp_config * -get_config_option(struct fp_config options[], const char *directive) +struct figpar_config * +get_config_option(struct figpar_config options[], const char *directive) { uint32_t n; /* Check arguments */ if (options == NULL || directive == NULL) - return (&fp_dummy_config); + return (&figpar_dummy_config); /* Loop through the array, return the index of the first match */ for (n = 0; options[n].directive != NULL; n++) @@ -65,12 +66,12 @@ get_config_option(struct fp_config optio return (&(options[n])); /* Re-initialize the dummy variable in case it was written to */ - fp_dummy_config.directive = NULL; - fp_dummy_config.type = 0; - fp_dummy_config.action = NULL; - fp_dummy_config.value.u_num = 0; + figpar_dummy_config.directive = NULL; + figpar_dummy_config.type = 0; + figpar_dummy_config.action = NULL; + figpar_dummy_config.value.u_num = 0; - return (&fp_dummy_config); + return (&figpar_dummy_config); } /* @@ -84,9 +85,9 @@ get_config_option(struct fp_config optio * Returns zero on success; otherwise returns -1 and errno should be consulted. */ int -parse_config(struct fp_config options[], const char *path, - int (*unknown)(struct fp_config *option, uint32_t line, char *directive, - char *value), uint16_t processing_options) +parse_config(struct figpar_config options[], const char *path, + int (*unknown)(struct figpar_config *option, uint32_t line, + char *directive, char *value), uint16_t processing_options) { uint8_t bequals; uint8_t bsemicolon; @@ -119,11 +120,15 @@ parse_config(struct fp_config options[], return (-1); /* Processing options */ - bequals = (processing_options & FP_BREAK_ON_EQUALS) == 0 ? 0 : 1; - bsemicolon = (processing_options & FP_BREAK_ON_SEMICOLON) == 0 ? 0 : 1; - case_sensitive = (processing_options & FP_CASE_SENSITIVE) == 0 ? 0 : 1; - require_equals = (processing_options & FP_REQUIRE_EQUALS) == 0 ? 0 : 1; - strict_equals = (processing_options & FP_STRICT_EQUALS) == 0 ? 0 : 1; + bequals = (processing_options & FIGPAR_BREAK_ON_EQUALS) == 0 ? 0 : 1; + bsemicolon = + (processing_options & FIGPAR_BREAK_ON_SEMICOLON) == 0 ? 0 : 1; + case_sensitive = + (processing_options & FIGPAR_CASE_SENSITIVE) == 0 ? 0 : 1; + require_equals = + (processing_options & FIGPAR_REQUIRE_EQUALS) == 0 ? 0 : 1; + strict_equals = + (processing_options & FIGPAR_STRICT_EQUALS) == 0 ? 0 : 1; /* Initialize strings */ directive = value = 0; Modified: stable/10/lib/libfigpar/figpar.h ============================================================================== --- stable/10/lib/libfigpar/figpar.h Sat Jan 9 23:22:28 2016 (r293618) +++ stable/10/lib/libfigpar/figpar.h Sat Jan 9 23:33:44 2016 (r293619) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002-2014 Devin Teske + * Copyright (c) 2002-2015 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,7 +34,7 @@ /* * Union for storing various types of data in a single common container. */ -union fp_cfgvalue { +union figpar_cfgvalue { void *data; /* Pointer to NUL-terminated string */ char *str; /* Pointer to NUL-terminated string */ char **strarray; /* Pointer to an array of strings */ @@ -46,53 +46,53 @@ union fp_cfgvalue { /* * Option types (based on above cfgvalue union) */ -enum fp_cfgtype { - FP_TYPE_NONE = 0x0000, /* for directives with no value */ - FP_TYPE_BOOL = 0x0001, /* boolean */ - FP_TYPE_INT = 0x0002, /* signed 32 bit integer */ - FP_TYPE_UINT = 0x0004, /* unsigned 32 bit integer */ - FP_TYPE_STR = 0x0008, /* string pointer */ - FP_TYPE_STRARRAY = 0x0010, /* string array pointer */ - FP_TYPE_DATA1 = 0x0020, /* void data type-1 (whatever) */ - FP_TYPE_DATA2 = 0x0040, /* void data type-2 (whatever) */ - FP_TYPE_DATA3 = 0x0080, /* void data type-3 (whatever) */ - FP_TYPE_RESERVED1 = 0x0100, /* reserved data type-1 (future) */ - FP_TYPE_RESERVED2 = 0x0200, /* reserved data type-2 (future) */ - FP_TYPE_RESERVED3 = 0x0400, /* reserved data type-3 (future) */ +enum figpar_cfgtype { + FIGPAR_TYPE_NONE = 0x0000, /* directives with no value */ + FIGPAR_TYPE_BOOL = 0x0001, /* boolean */ + FIGPAR_TYPE_INT = 0x0002, /* signed 32 bit integer */ + FIGPAR_TYPE_UINT = 0x0004, /* unsigned 32 bit integer */ + FIGPAR_TYPE_STR = 0x0008, /* string pointer */ + FIGPAR_TYPE_STRARRAY = 0x0010, /* string array pointer */ + FIGPAR_TYPE_DATA1 = 0x0020, /* void data type-1 (open) */ + FIGPAR_TYPE_DATA2 = 0x0040, /* void data type-2 (open) */ + FIGPAR_TYPE_DATA3 = 0x0080, /* void data type-3 (open) */ + FIGPAR_TYPE_RESERVED1 = 0x0100, /* reserved data type-1 */ + FIGPAR_TYPE_RESERVED2 = 0x0200, /* reserved data type-2 */ + FIGPAR_TYPE_RESERVED3 = 0x0400, /* reserved data type-3 */ }; /* * Options to parse_config() for processing_options bitmask */ -#define FP_BREAK_ON_EQUALS 0x0001 /* stop reading directive at `=' */ -#define FP_BREAK_ON_SEMICOLON 0x0002 /* `;' starts a new line */ -#define FP_CASE_SENSITIVE 0x0004 /* directives are case sensitive */ -#define FP_REQUIRE_EQUALS 0x0008 /* assignment directives only */ -#define FP_STRICT_EQUALS 0x0010 /* `=' must be part of directive */ +#define FIGPAR_BREAK_ON_EQUALS 0x0001 /* stop reading directive at `=' */ +#define FIGPAR_BREAK_ON_SEMICOLON 0x0002 /* `;' starts a new line */ +#define FIGPAR_CASE_SENSITIVE 0x0004 /* directives are case sensitive */ +#define FIGPAR_REQUIRE_EQUALS 0x0008 /* assignment directives only */ +#define FIGPAR_STRICT_EQUALS 0x0010 /* `=' must be part of directive */ /* * Anatomy of a config file option */ -struct fp_config { - enum fp_cfgtype type; /* Option value type */ +struct figpar_config { + enum figpar_cfgtype type; /* Option value type */ const char *directive; /* config file keyword */ - union fp_cfgvalue value; /* NB: set by action */ + union figpar_cfgvalue value; /* NB: set by action */ /* * Function pointer; action to be taken when the directive is found */ - int (*action)(struct fp_config *option, uint32_t line, char *directive, - char *value); + int (*action)(struct figpar_config *option, uint32_t line, + char *directive, char *value); }; -extern struct fp_config fp_dummy_config; +extern struct figpar_config figpar_dummy_config; __BEGIN_DECLS -int parse_config(struct fp_config _options[], +int parse_config(struct figpar_config _options[], const char *_path, - int (*_unknown)(struct fp_config *_option, + int (*_unknown)(struct figpar_config *_option, uint32_t _line, char *_directive, char *_value), uint16_t _processing_options); -struct fp_config *get_config_option(struct fp_config _options[], +struct figpar_config *get_config_option(struct figpar_config _options[], const char *_directive); __END_DECLS Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Sat Jan 9 23:22:28 2016 (r293618) +++ stable/10/sys/sys/param.h Sat Jan 9 23:33:44 2016 (r293619) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1002507 /* Master, propagated to newvers */ +#define __FreeBSD_version 1002508 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-10@freebsd.org Sat Jan 9 23:44:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6555A69B3E; Sat, 9 Jan 2016 23:44:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75315107F; Sat, 9 Jan 2016 23:44:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09Nif5j073154; Sat, 9 Jan 2016 23:44:41 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09Nif1O073153; Sat, 9 Jan 2016 23:44:41 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601092344.u09Nif1O073153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sat, 9 Jan 2016 23:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293620 - stable/10/lib/libdpv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 23:44:42 -0000 Author: dteske Date: Sat Jan 9 23:44:41 2016 New Revision: 293620 URL: https://svnweb.freebsd.org/changeset/base/293620 Log: MFC SVN revisions 293340, 293379 r293340: Increase maximum buffer size for `-x cmd' value r293379: Bump copyright Modified: stable/10/lib/libdpv/util.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libdpv/util.h ============================================================================== --- stable/10/lib/libdpv/util.h Sat Jan 9 23:33:44 2016 (r293619) +++ stable/10/lib/libdpv/util.h Sat Jan 9 23:44:41 2016 (r293620) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2016 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,7 @@ #define PATH_SHELL "/bin/sh" #endif -#define CMDBUFMAX 4096 +#define CMDBUFMAX 65536 __BEGIN_DECLS int shell_spawn_pipecmd(const char *_cmd, const char *_label, pid_t *_pid);