From owner-svn-src-stable@freebsd.org Sun Jul 24 04:38:51 2016 Return-Path: Delivered-To: svn-src-stable@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 95E96BA0678; Sun, 24 Jul 2016 04:38:51 +0000 (UTC) (envelope-from jhb@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 6DD981F56; Sun, 24 Jul 2016 04:38:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6O4coGS090418; Sun, 24 Jul 2016 04:38:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6O4coKF090414; Sun, 24 Jul 2016 04:38:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607240438.u6O4coKF090414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 24 Jul 2016 04:38: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: r303254 - in stable: 10 10/share/man/man9 10/sys/sys 9 9/share/man/man9 9/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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2016 04:38:51 -0000 Author: jhb Date: Sun Jul 24 04:38:50 2016 New Revision: 303254 URL: https://svnweb.freebsd.org/changeset/base/303254 Log: MFC 300253: Remove dangling references to rman_await_resource(). This function was removed when RF_TIMESHARE was removed a couple of years ago. Modified: stable/10/ObsoleteFiles.inc stable/10/share/man/man9/Makefile stable/10/share/man/man9/rman.9 stable/10/sys/sys/rman.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/ObsoleteFiles.inc (contents, props changed) stable/9/share/man/man9/Makefile stable/9/share/man/man9/rman.9 stable/9/sys/sys/rman.h Directory Properties: stable/9/ (props changed) stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Sun Jul 24 01:31:41 2016 (r303253) +++ stable/10/ObsoleteFiles.inc Sun Jul 24 04:38:50 2016 (r303254) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160723: stale MLINK removed +OLD_FILES+=usr/share/man/man9/rman_await_resource.9.gz # 20160216: Remove obsolete unbound-control-setup OLD_FILES+=usr/sbin/unbound-control-setup # 20151222: liblzma header Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Sun Jul 24 01:31:41 2016 (r303253) +++ stable/10/share/man/man9/Makefile Sun Jul 24 04:38:50 2016 (r303254) @@ -1074,7 +1074,6 @@ MLINKS+=resource_int_value.9 resource_lo resource_int_value.9 resource_string_value.9 MLINKS+=rman.9 rman_activate_resource.9 \ rman.9 rman_adjust_resource.9 \ - rman.9 rman_await_resource.9 \ rman.9 rman_deactivate_resource.9 \ rman.9 rman_fini.9 \ rman.9 rman_first_free_region.9 \ Modified: stable/10/share/man/man9/rman.9 ============================================================================== --- stable/10/share/man/man9/rman.9 Sun Jul 24 01:31:41 2016 (r303253) +++ stable/10/share/man/man9/rman.9 Sun Jul 24 04:38:50 2016 (r303254) @@ -25,14 +25,13 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2014 +.Dd May 19, 2016 .Dt RMAN 9 .Os .Sh NAME .Nm rman , .Nm rman_activate_resource , .Nm rman_adjust_resource , -.Nm rman_await_resource , .Nm rman_deactivate_resource , .Nm rman_fini , .Nm rman_init , @@ -67,8 +66,6 @@ .Ft int .Fn rman_adjust_resource "struct resource *r" "u_long start" "u_long end" .Ft int -.Fn rman_await_resource "struct resource *r" "int pri2" "int timo" -.Ft int .Fn rman_deactivate_resource "struct resource *r" .Ft int .Fn rman_fini "struct rman *rm" @@ -387,23 +384,6 @@ flag. If other consumers are waiting for this range, it will wakeup their threads. .Pp The -.Fn rman_await_resource -function performs an asynchronous wait for a resource -.Fa r -to become inactive, that is, for the -.Dv RF_ACTIVE -flag to be cleared. -It is used to enable cooperative sharing of a resource -which can only be safely used by one thread at a time. -The arguments -.Fa pri -and -.Fa timo -are passed to the -.Fn rman_await_resource -function. -.Pp -The .Fn rman_get_start , .Fn rman_get_end , .Fn rman_get_size , Modified: stable/10/sys/sys/rman.h ============================================================================== --- stable/10/sys/sys/rman.h Sun Jul 24 01:31:41 2016 (r303253) +++ stable/10/sys/sys/rman.h Sun Jul 24 04:38:50 2016 (r303254) @@ -117,7 +117,6 @@ TAILQ_HEAD(rman_head, rman); int rman_activate_resource(struct resource *r); int rman_adjust_resource(struct resource *r, u_long start, u_long end); -int rman_await_resource(struct resource *r, int pri, int timo); int rman_first_free_region(struct rman *rm, u_long *start, u_long *end); bus_space_handle_t rman_get_bushandle(struct resource *); bus_space_tag_t rman_get_bustag(struct resource *); From owner-svn-src-stable@freebsd.org Sun Jul 24 04:38:52 2016 Return-Path: Delivered-To: svn-src-stable@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 05EB8BA067E; Sun, 24 Jul 2016 04:38:52 +0000 (UTC) (envelope-from jhb@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 D7D8C1F57; Sun, 24 Jul 2016 04:38:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6O4cpHb090427; Sun, 24 Jul 2016 04:38:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6O4corb090423; Sun, 24 Jul 2016 04:38:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607240438.u6O4corb090423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 24 Jul 2016 04:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r303254 - in stable: 10 10/share/man/man9 10/sys/sys 9 9/share/man/man9 9/sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2016 04:38:52 -0000 Author: jhb Date: Sun Jul 24 04:38:50 2016 New Revision: 303254 URL: https://svnweb.freebsd.org/changeset/base/303254 Log: MFC 300253: Remove dangling references to rman_await_resource(). This function was removed when RF_TIMESHARE was removed a couple of years ago. Modified: stable/9/ObsoleteFiles.inc (contents, props changed) stable/9/share/man/man9/Makefile stable/9/share/man/man9/rman.9 stable/9/sys/sys/rman.h Directory Properties: stable/9/ (props changed) stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/ObsoleteFiles.inc stable/10/share/man/man9/Makefile stable/10/share/man/man9/rman.9 stable/10/sys/sys/rman.h Directory Properties: stable/10/ (props changed) Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Sun Jul 24 01:31:41 2016 (r303253) +++ stable/9/ObsoleteFiles.inc Sun Jul 24 04:38:50 2016 (r303254) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160723: stale MLINK removed +OLD_FILES+=usr/share/man/man9/rman_await_resource.9.gz # 20151025: remove links to removed/unimplemented mbuf(9) macros OLD_FILES+=usr/share/man/man9/MEXT_ADD_REF.9.gz OLD_FILES+=usr/share/man/man9/MEXTFREE.9.gz Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Sun Jul 24 01:31:41 2016 (r303253) +++ stable/9/share/man/man9/Makefile Sun Jul 24 04:38:50 2016 (r303254) @@ -1035,7 +1035,6 @@ MLINKS+=resource_int_value.9 resource_lo resource_int_value.9 resource_string_value.9 MLINKS+=rman.9 rman_activate_resource.9 \ rman.9 rman_adjust_resource.9 \ - rman.9 rman_await_resource.9 \ rman.9 rman_deactivate_resource.9 \ rman.9 rman_fini.9 \ rman.9 rman_first_free_region.9 \ Modified: stable/9/share/man/man9/rman.9 ============================================================================== --- stable/9/share/man/man9/rman.9 Sun Jul 24 01:31:41 2016 (r303253) +++ stable/9/share/man/man9/rman.9 Sun Jul 24 04:38:50 2016 (r303254) @@ -25,14 +25,13 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2014 +.Dd May 19, 2016 .Dt RMAN 9 .Os .Sh NAME .Nm rman , .Nm rman_activate_resource , .Nm rman_adjust_resource , -.Nm rman_await_resource , .Nm rman_deactivate_resource , .Nm rman_fini , .Nm rman_init , @@ -67,8 +66,6 @@ .Ft int .Fn rman_adjust_resource "struct resource *r" "u_long start" "u_long end" .Ft int -.Fn rman_await_resource "struct resource *r" "int pri2" "int timo" -.Ft int .Fn rman_deactivate_resource "struct resource *r" .Ft int .Fn rman_fini "struct rman *rm" @@ -387,23 +384,6 @@ flag. If other consumers are waiting for this range, it will wakeup their threads. .Pp The -.Fn rman_await_resource -function performs an asynchronous wait for a resource -.Fa r -to become inactive, that is, for the -.Dv RF_ACTIVE -flag to be cleared. -It is used to enable cooperative sharing of a resource -which can only be safely used by one thread at a time. -The arguments -.Fa pri -and -.Fa timo -are passed to the -.Fn rman_await_resource -function. -.Pp -The .Fn rman_get_start , .Fn rman_get_end , .Fn rman_get_size , Modified: stable/9/sys/sys/rman.h ============================================================================== --- stable/9/sys/sys/rman.h Sun Jul 24 01:31:41 2016 (r303253) +++ stable/9/sys/sys/rman.h Sun Jul 24 04:38:50 2016 (r303254) @@ -117,7 +117,6 @@ TAILQ_HEAD(rman_head, rman); int rman_activate_resource(struct resource *r); int rman_adjust_resource(struct resource *r, u_long start, u_long end); -int rman_await_resource(struct resource *r, int pri, int timo); int rman_first_free_region(struct rman *rm, u_long *start, u_long *end); bus_space_handle_t rman_get_bushandle(struct resource *); bus_space_tag_t rman_get_bustag(struct resource *); From owner-svn-src-stable@freebsd.org Sun Jul 24 05:24:12 2016 Return-Path: Delivered-To: svn-src-stable@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 5A8B7BA10CB; Sun, 24 Jul 2016 05:24:12 +0000 (UTC) (envelope-from jhb@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 1E66015E7; Sun, 24 Jul 2016 05:24:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6O5OBCD008955; Sun, 24 Jul 2016 05:24:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6O5OBNs008952; Sun, 24 Jul 2016 05:24:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607240524.u6O5OBNs008952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 24 Jul 2016 05:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r303255 - in stable: 10/share/man/man9 10/sys/dev/pci 9/share/man/man9 9/sys/dev/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2016 05:24:12 -0000 Author: jhb Date: Sun Jul 24 05:24:10 2016 New Revision: 303255 URL: https://svnweb.freebsd.org/changeset/base/303255 Log: MFC 302175: Add pci_get_max_payload() to fetch the PCI-express maximum payload size. Modified: stable/9/share/man/man9/pci.9 stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pcivar.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man9/pci.9 stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pcivar.h Directory Properties: stable/10/ (props changed) Modified: stable/9/share/man/man9/pci.9 ============================================================================== --- stable/9/share/man/man9/pci.9 Sun Jul 24 04:38:50 2016 (r303254) +++ stable/9/share/man/man9/pci.9 Sun Jul 24 05:24:10 2016 (r303255) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2015 +.Dd June 24, 2016 .Dt PCI 9 .Os .Sh NAME @@ -41,6 +41,7 @@ .Nm pci_find_dbsf , .Nm pci_find_device , .Nm pci_find_pcie_root_port , +.Nm pci_get_max_payload , .Nm pci_get_max_read_req , .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , @@ -87,6 +88,8 @@ .Ft device_t .Fn pci_find_pcie_root_port "device_t dev" .Ft int +.Fn pci_get_max_payload "device_t dev" +.Ft int .Fn pci_get_max_read_req "device_t dev" .Ft int .Fn pci_get_powerstate "device_t dev" @@ -381,6 +384,16 @@ or .Xr bus_activate_resource 9 . .Pp The +.Fn pci_get_max_payload +function returns the current maximum TLP payload size in bytes for a +PCI-express device. +If the +.Fa dev +device is not a PCI-express device, +.Fn pci_get_max_payload +returns zero. +.Pp +The .Fn pci_get_max_read_req function returns the current maximum read request size in bytes for a PCI-express device. Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Sun Jul 24 04:38:50 2016 (r303254) +++ stable/9/sys/dev/pci/pci.c Sun Jul 24 05:24:10 2016 (r303255) @@ -1775,6 +1775,22 @@ pci_ht_map_msi(device_t dev, uint64_t ad } int +pci_get_max_payload(device_t dev) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + int cap; + uint16_t val; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) + return (0); + val = pci_read_config(dev, cap + PCIER_DEVICE_CTL, 2); + val &= PCIEM_CTL_MAX_PAYLOAD; + val >>= 5; + return (1 << (val + 7)); +} + +int pci_get_max_read_req(device_t dev) { struct pci_devinfo *dinfo = device_get_ivars(dev); Modified: stable/9/sys/dev/pci/pcivar.h ============================================================================== --- stable/9/sys/dev/pci/pcivar.h Sun Jul 24 04:38:50 2016 (r303254) +++ stable/9/sys/dev/pci/pcivar.h Sun Jul 24 05:24:10 2016 (r303255) @@ -476,6 +476,7 @@ int pci_msix_device_blacklisted(device_t void pci_ht_map_msi(device_t dev, uint64_t addr); device_t pci_find_pcie_root_port(device_t dev); +int pci_get_max_payload(device_t dev); int pci_get_max_read_req(device_t dev); void pci_restore_state(device_t dev); void pci_save_state(device_t dev); From owner-svn-src-stable@freebsd.org Sun Jul 24 05:24:12 2016 Return-Path: Delivered-To: svn-src-stable@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 11287BA10BD; Sun, 24 Jul 2016 05:24:12 +0000 (UTC) (envelope-from jhb@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 C4AC015E5; Sun, 24 Jul 2016 05:24:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6O5OAmM008947; Sun, 24 Jul 2016 05:24:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6O5OANG008944; Sun, 24 Jul 2016 05:24:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607240524.u6O5OANG008944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 24 Jul 2016 05:24: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: r303255 - in stable: 10/share/man/man9 10/sys/dev/pci 9/share/man/man9 9/sys/dev/pci 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2016 05:24:12 -0000 Author: jhb Date: Sun Jul 24 05:24:10 2016 New Revision: 303255 URL: https://svnweb.freebsd.org/changeset/base/303255 Log: MFC 302175: Add pci_get_max_payload() to fetch the PCI-express maximum payload size. Modified: stable/10/share/man/man9/pci.9 stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pcivar.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/share/man/man9/pci.9 stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pcivar.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/10/share/man/man9/pci.9 ============================================================================== --- stable/10/share/man/man9/pci.9 Sun Jul 24 04:38:50 2016 (r303254) +++ stable/10/share/man/man9/pci.9 Sun Jul 24 05:24:10 2016 (r303255) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 2015 +.Dd June 24, 2016 .Dt PCI 9 .Os .Sh NAME @@ -43,6 +43,7 @@ .Nm pci_find_extcap , .Nm pci_find_htcap , .Nm pci_find_pcie_root_port , +.Nm pci_get_max_payload , .Nm pci_get_max_read_req , .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , @@ -95,6 +96,8 @@ .Ft device_t .Fn pci_find_pcie_root_port "device_t dev" .Ft int +.Fn pci_get_max_payload "device_t dev" +.Ft int .Fn pci_get_max_read_req "device_t dev" .Ft int .Fn pci_get_powerstate "device_t dev" @@ -436,6 +439,16 @@ or .Xr bus_activate_resource 9 . .Pp The +.Fn pci_get_max_payload +function returns the current maximum TLP payload size in bytes for a +PCI-express device. +If the +.Fa dev +device is not a PCI-express device, +.Fn pci_get_max_payload +returns zero. +.Pp +The .Fn pci_get_max_read_req function returns the current maximum read request size in bytes for a PCI-express device. Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Sun Jul 24 04:38:50 2016 (r303254) +++ stable/10/sys/dev/pci/pci.c Sun Jul 24 05:24:10 2016 (r303255) @@ -1881,6 +1881,22 @@ pci_ht_map_msi(device_t dev, uint64_t ad } int +pci_get_max_payload(device_t dev) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + int cap; + uint16_t val; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) + return (0); + val = pci_read_config(dev, cap + PCIER_DEVICE_CTL, 2); + val &= PCIEM_CTL_MAX_PAYLOAD; + val >>= 5; + return (1 << (val + 7)); +} + +int pci_get_max_read_req(device_t dev) { struct pci_devinfo *dinfo = device_get_ivars(dev); Modified: stable/10/sys/dev/pci/pcivar.h ============================================================================== --- stable/10/sys/dev/pci/pcivar.h Sun Jul 24 04:38:50 2016 (r303254) +++ stable/10/sys/dev/pci/pcivar.h Sun Jul 24 05:24:10 2016 (r303255) @@ -534,6 +534,7 @@ int pci_msix_device_blacklisted(device_t void pci_ht_map_msi(device_t dev, uint64_t addr); device_t pci_find_pcie_root_port(device_t dev); +int pci_get_max_payload(device_t dev); int pci_get_max_read_req(device_t dev); void pci_restore_state(device_t dev); void pci_save_state(device_t dev); From owner-svn-src-stable@freebsd.org Sun Jul 24 08:12:24 2016 Return-Path: Delivered-To: svn-src-stable@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 48F30BA3A62; Sun, 24 Jul 2016 08:12:24 +0000 (UTC) (envelope-from bapt@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 196C61CB1; Sun, 24 Jul 2016 08:12:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6O8CNCo070621; Sun, 24 Jul 2016 08:12:23 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6O8CNr7070619; Sun, 24 Jul 2016 08:12:23 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201607240812.u6O8CNr7070619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 24 Jul 2016 08:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303256 - in stable/11/usr.sbin/pw: . tests X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2016 08:12:24 -0000 Author: bapt Date: Sun Jul 24 08:12:23 2016 New Revision: 303256 URL: https://svnweb.freebsd.org/changeset/base/303256 Log: iDo not try to delete the home of the user if is is not a directory for example "/dev/null" PR: 211195 Submitted by: rday Reported by: eniorm Approved by: re (kib) Modified: stable/11/usr.sbin/pw/rm_r.c stable/11/usr.sbin/pw/tests/pw_userdel.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/pw/rm_r.c ============================================================================== --- stable/11/usr.sbin/pw/rm_r.c Sun Jul 24 05:24:10 2016 (r303255) +++ stable/11/usr.sbin/pw/rm_r.c Sun Jul 24 08:12:23 2016 (r303256) @@ -50,6 +50,9 @@ rm_r(int rootfd, const char *path, uid_t path++; dirfd = openat(rootfd, path, O_DIRECTORY); + if (dirfd == -1) { + return; + } d = fdopendir(dirfd); while ((e = readdir(d)) != NULL) { Modified: stable/11/usr.sbin/pw/tests/pw_userdel.sh ============================================================================== --- stable/11/usr.sbin/pw/tests/pw_userdel.sh Sun Jul 24 05:24:10 2016 (r303255) +++ stable/11/usr.sbin/pw/tests/pw_userdel.sh Sun Jul 24 08:12:23 2016 (r303256) @@ -59,9 +59,18 @@ delete_numeric_name_body() { ${PW} userdel -n 4001 } +atf_test_case home_not_a_dir +home_not_a_dir_body() { + populate_root_etc_skel + touch ${HOME}/foo + atf_check ${RPW} useradd foo -d /foo + atf_check ${RPW} userdel foo -r +} + atf_init_test_cases() { atf_add_test_case rmuser_seperate_group atf_add_test_case user_do_not_try_to_delete_root_if_user_unknown atf_add_test_case delete_files atf_add_test_case delete_numeric_name + atf_add_test_case home_not_a_dir } From owner-svn-src-stable@freebsd.org Sun Jul 24 08:21:22 2016 Return-Path: Delivered-To: svn-src-stable@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 7C323BA3C5A; Sun, 24 Jul 2016 08:21:22 +0000 (UTC) (envelope-from bapt@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 4E9071FCB; Sun, 24 Jul 2016 08:21:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6O8LLGo070994; Sun, 24 Jul 2016 08:21:21 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6O8LLX9070991; Sun, 24 Jul 2016 08:21:21 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201607240821.u6O8LLX9070991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 24 Jul 2016 08:21: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: r303257 - in stable/10/usr.sbin/pw: . tests 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2016 08:21:22 -0000 Author: bapt Date: Sun Jul 24 08:21:21 2016 New Revision: 303257 URL: https://svnweb.freebsd.org/changeset/base/303257 Log: Do not try to delete the home of the user if is is not a directory for example "/dev/null" PR: 211195 Submitted by: rday Reported by: eniorm Modified: stable/10/usr.sbin/pw/rm_r.c stable/10/usr.sbin/pw/tests/pw_userdel.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pw/rm_r.c ============================================================================== --- stable/10/usr.sbin/pw/rm_r.c Sun Jul 24 08:12:23 2016 (r303256) +++ stable/10/usr.sbin/pw/rm_r.c Sun Jul 24 08:21:21 2016 (r303257) @@ -50,6 +50,9 @@ rm_r(int rootfd, const char *path, uid_t path++; dirfd = openat(rootfd, path, O_DIRECTORY); + if (dirfd == -1) { + return; + } d = fdopendir(dirfd); while ((e = readdir(d)) != NULL) { Modified: stable/10/usr.sbin/pw/tests/pw_userdel.sh ============================================================================== --- stable/10/usr.sbin/pw/tests/pw_userdel.sh Sun Jul 24 08:12:23 2016 (r303256) +++ stable/10/usr.sbin/pw/tests/pw_userdel.sh Sun Jul 24 08:21:21 2016 (r303257) @@ -59,9 +59,18 @@ delete_numeric_name_body() { ${PW} userdel -n 4001 } +atf_test_case home_not_a_dir +home_not_a_dir_body() { + populate_root_etc_skel + touch ${HOME}/foo + atf_check ${RPW} useradd foo -d /foo + atf_check ${RPW} userdel foo -r +} + atf_init_test_cases() { atf_add_test_case rmuser_seperate_group atf_add_test_case user_do_not_try_to_delete_root_if_user_unknown atf_add_test_case delete_files atf_add_test_case delete_numeric_name + atf_add_test_case home_not_a_dir } From owner-svn-src-stable@freebsd.org Sun Jul 24 09:00:20 2016 Return-Path: Delivered-To: svn-src-stable@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 4A896BA396D; Sun, 24 Jul 2016 09:00:20 +0000 (UTC) (envelope-from bapt@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 194F91D44; Sun, 24 Jul 2016 09:00:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6O90JUS086102; Sun, 24 Jul 2016 09:00:19 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6O90HZj086080; Sun, 24 Jul 2016 09:00:17 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201607240900.u6O90HZj086080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 24 Jul 2016 09:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303260 - stable/11/share/timedef X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2016 09:00:20 -0000 Author: bapt Date: Sun Jul 24 09:00:16 2016 New Revision: 303260 URL: https://svnweb.freebsd.org/changeset/base/303260 Log: MFC: r303219 Add weekday to the date format of more locales Approved by: re (kib) Modified: stable/11/share/timedef/cs_CZ.ISO8859-2.src stable/11/share/timedef/cs_CZ.UTF-8.src stable/11/share/timedef/da_DK.ISO8859-15.src stable/11/share/timedef/da_DK.UTF-8.src stable/11/share/timedef/de_AT.ISO8859-15.src stable/11/share/timedef/de_AT.UTF-8.src stable/11/share/timedef/de_DE.ISO8859-15.src stable/11/share/timedef/de_DE.UTF-8.src stable/11/share/timedef/et_EE.ISO8859-15.src stable/11/share/timedef/et_EE.UTF-8.src stable/11/share/timedef/fi_FI.ISO8859-15.src stable/11/share/timedef/fi_FI.UTF-8.src stable/11/share/timedef/hr_HR.ISO8859-2.src stable/11/share/timedef/hr_HR.UTF-8.src stable/11/share/timedef/is_IS.ISO8859-15.src stable/11/share/timedef/is_IS.UTF-8.src stable/11/share/timedef/nb_NO.ISO8859-15.src stable/11/share/timedef/nb_NO.UTF-8.src stable/11/share/timedef/nn_NO.ISO8859-15.src stable/11/share/timedef/nn_NO.UTF-8.src stable/11/share/timedef/sk_SK.ISO8859-2.src stable/11/share/timedef/sk_SK.UTF-8.src Directory Properties: stable/11/ (props changed) Modified: stable/11/share/timedef/cs_CZ.ISO8859-2.src ============================================================================== --- stable/11/share/timedef/cs_CZ.ISO8859-2.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/cs_CZ.ISO8859-2.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ sobota %d.%m.%y # # c_fmt -%e. %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM dopoledne odpoledne # # date_fmt -%e. %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) leden Modified: stable/11/share/timedef/cs_CZ.UTF-8.src ============================================================================== --- stable/11/share/timedef/cs_CZ.UTF-8.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/cs_CZ.UTF-8.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ sobota %d.%m.%y # # c_fmt -%e. %B %Y %H:%M:%S +%A %e %B %Y %H:%M:%S # # AM/PM dopoledne odpoledne # # date_fmt -%e. %B %Y %H:%M:%S %Z +%A %e %B %Y %H:%M:%S %Z # # Long month names (without case ending) leden Modified: stable/11/share/timedef/da_DK.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/da_DK.ISO8859-15.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/da_DK.ISO8859-15.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ lrdag %d/%m/%Y # # c_fmt -%e. %B %Y kl. %H.%M.%S +%A %e %B %Y kl. %H.%M.%S # # AM/PM AM PM # # date_fmt -%e. %B %Y kl. %H.%M.%S %Z +%A %e %B %Y kl. %H.%M.%S %Z # # Long month names (without case ending) januar Modified: stable/11/share/timedef/da_DK.UTF-8.src ============================================================================== --- stable/11/share/timedef/da_DK.UTF-8.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/da_DK.UTF-8.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ lørdag %d/%m/%Y # # c_fmt -%e. %B %Y kl. %H.%M.%S +%A %e %B %Y kl. %H.%M.%S # # AM/PM AM PM # # date_fmt -%e. %B %Y kl. %H.%M.%S %Z +%A %e %B %Y kl. %H.%M.%S %Z # # Long month names (without case ending) januar Modified: stable/11/share/timedef/de_AT.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/de_AT.ISO8859-15.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/de_AT.ISO8859-15.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ Samstag %d.%m.%y # # c_fmt -%e. %B %Y um %H:%M:%S +%A %e %B %Y um %H:%M:%S # # AM/PM vorm. nachm. # # date_fmt -%e. %B %Y um %H:%M:%S %Z +%A %e %B %Y um %H:%M:%S %Z # # Long month names (without case ending) Jnner Modified: stable/11/share/timedef/de_AT.UTF-8.src ============================================================================== --- stable/11/share/timedef/de_AT.UTF-8.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/de_AT.UTF-8.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ Samstag %d.%m.%y # # c_fmt -%e. %B %Y um %H:%M:%S +%A %e %B %Y um %H:%M:%S # # AM/PM vorm. nachm. # # date_fmt -%e. %B %Y um %H:%M:%S %Z +%A %e %B %Y um %H:%M:%S %Z # # Long month names (without case ending) Jänner Modified: stable/11/share/timedef/de_DE.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/de_DE.ISO8859-15.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/de_DE.ISO8859-15.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ Samstag %d.%m.%y # # c_fmt -%e. %B %Y um %H:%M:%S +%A %e %B %Y um %H:%M:%S # # AM/PM vorm. nachm. # # date_fmt -%e. %B %Y um %H:%M:%S %Z +%A %e %B %Y um %H:%M:%S %Z # # Long month names (without case ending) Januar Modified: stable/11/share/timedef/de_DE.UTF-8.src ============================================================================== --- stable/11/share/timedef/de_DE.UTF-8.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/de_DE.UTF-8.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ Samstag %d.%m.%y # # c_fmt -%e. %B %Y um %H:%M:%S +%A %e %B %Y um %H:%M:%S # # AM/PM vorm. nachm. # # date_fmt -%e. %B %Y um %H:%M:%S %Z +%A %e %B %Y um %H:%M:%S %Z # # Long month names (without case ending) Januar Modified: stable/11/share/timedef/et_EE.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/et_EE.ISO8859-15.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/et_EE.ISO8859-15.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ laupev %d.%m.%y # # c_fmt -%e. %B %Y %H:%M.%S +%A %e %B %Y %H:%M.%S # # AM/PM AM PM # # date_fmt -%e. %B %Y %H:%M.%S %Z +%A %e %B %Y %H:%M.%S %Z # # Long month names (without case ending) jaanuar Modified: stable/11/share/timedef/et_EE.UTF-8.src ============================================================================== --- stable/11/share/timedef/et_EE.UTF-8.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/et_EE.UTF-8.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ laupäev %d.%m.%y # # c_fmt -%e. %B %Y %H:%M.%S +%A %e %B %Y %H:%M.%S # # AM/PM AM PM # # date_fmt -%e. %B %Y %H:%M.%S %Z +%A %e %B %Y %H:%M.%S %Z # # Long month names (without case ending) jaanuar Modified: stable/11/share/timedef/fi_FI.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/fi_FI.ISO8859-15.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/fi_FI.ISO8859-15.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ lauantaina %d.%m.%Y # # c_fmt -%e. %B %Y klo %H.%M.%S +%A %e %B %Y klo %H.%M.%S # # AM/PM ap. ip. # # date_fmt -%e. %B %Y klo %H.%M.%S %Z +%A %e %B %Y klo %H.%M.%S %Z # # Long month names (without case ending) tammikuuta Modified: stable/11/share/timedef/fi_FI.UTF-8.src ============================================================================== --- stable/11/share/timedef/fi_FI.UTF-8.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/fi_FI.UTF-8.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ lauantaina %d.%m.%Y # # c_fmt -%e. %B %Y klo %H.%M.%S +%A %e %B %Y klo %H.%M.%S # # AM/PM ap. ip. # # date_fmt -%e. %B %Y klo %H.%M.%S %Z +%A %e %B %Y klo %H.%M.%S %Z # # Long month names (without case ending) tammikuuta Modified: stable/11/share/timedef/hr_HR.ISO8859-2.src ============================================================================== --- stable/11/share/timedef/hr_HR.ISO8859-2.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/hr_HR.ISO8859-2.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ subota %d.%m.%Y. # # c_fmt -%e. %B %Y. u %H:%M:%S +%A %e %B %Y. u %H:%M:%S # # AM/PM AM PM # # date_fmt -%e. %B %Y. u %H:%M:%S %Z +%A %e %B %Y. u %H:%M:%S %Z # # Long month names (without case ending) sijenja Modified: stable/11/share/timedef/hr_HR.UTF-8.src ============================================================================== --- stable/11/share/timedef/hr_HR.UTF-8.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/hr_HR.UTF-8.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ subota %d.%m.%Y. # # c_fmt -%e. %B %Y. u %H:%M:%S +%A %e %B %Y. u %H:%M:%S # # AM/PM AM PM # # date_fmt -%e. %B %Y. u %H:%M:%S %Z +%A %e %B %Y. u %H:%M:%S %Z # # Long month names (without case ending) siječnja Modified: stable/11/share/timedef/is_IS.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/is_IS.ISO8859-15.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/is_IS.ISO8859-15.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ laugardagur %d.%m.%Y # # c_fmt -%e. %B %Y kl. %H:%M:%S +%A %e %B %Y kl. %H:%M:%S # # AM/PM f.h. e.h. # # date_fmt -%e. %B %Y kl. %H:%M:%S %Z +%A %e %B %Y kl. %H:%M:%S %Z # # Long month names (without case ending) janar Modified: stable/11/share/timedef/is_IS.UTF-8.src ============================================================================== --- stable/11/share/timedef/is_IS.UTF-8.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/is_IS.UTF-8.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ laugardagur %d.%m.%Y # # c_fmt -%e. %B %Y kl. %H:%M:%S +%A %e %B %Y kl. %H:%M:%S # # AM/PM f.h. e.h. # # date_fmt -%e. %B %Y kl. %H:%M:%S %Z +%A %e %B %Y kl. %H:%M:%S %Z # # Long month names (without case ending) janúar Modified: stable/11/share/timedef/nb_NO.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/nb_NO.ISO8859-15.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/nb_NO.ISO8859-15.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ lrdag %d.%m.%Y # # c_fmt -%e. %B %Y kl. %H.%M.%S +%A %e %B %Y kl. %H.%M.%S # # AM/PM a.m. p.m. # # date_fmt -%e. %B %Y kl. %H.%M.%S %Z +%A %e %B %Y kl. %H.%M.%S %Z # # Long month names (without case ending) januar Modified: stable/11/share/timedef/nb_NO.UTF-8.src ============================================================================== --- stable/11/share/timedef/nb_NO.UTF-8.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/nb_NO.UTF-8.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ lørdag %d.%m.%Y # # c_fmt -%e. %B %Y kl. %H.%M.%S +%A %e %B %Y kl. %H.%M.%S # # AM/PM a.m. p.m. # # date_fmt -%e. %B %Y kl. %H.%M.%S %Z +%A %e %B %Y kl. %H.%M.%S %Z # # Long month names (without case ending) januar Modified: stable/11/share/timedef/nn_NO.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/nn_NO.ISO8859-15.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/nn_NO.ISO8859-15.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ laurdag %d.%m.%Y # # c_fmt -%e. %B %Y kl. %H:%M:%S +%A %e %B %Y kl. %H:%M:%S # # AM/PM formiddag ettermiddag # # date_fmt -%e. %B %Y kl. %H:%M:%S %Z +%A %e %B %Y kl. %H:%M:%S %Z # # Long month names (without case ending) januar Modified: stable/11/share/timedef/nn_NO.UTF-8.src ============================================================================== --- stable/11/share/timedef/nn_NO.UTF-8.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/nn_NO.UTF-8.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ laurdag %d.%m.%Y # # c_fmt -%e. %B %Y kl. %H:%M:%S +%A %e %B %Y kl. %H:%M:%S # # AM/PM formiddag ettermiddag # # date_fmt -%e. %B %Y kl. %H:%M:%S %Z +%A %e %B %Y kl. %H:%M:%S %Z # # Long month names (without case ending) januar Modified: stable/11/share/timedef/sk_SK.ISO8859-2.src ============================================================================== --- stable/11/share/timedef/sk_SK.ISO8859-2.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/sk_SK.ISO8859-2.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ sobota %d.%m.%y # # c_fmt -%e. %B %Y, %H:%M:%S +%A %e %B %Y, %H:%M:%S # # AM/PM dopoludnia odpoludnia # # date_fmt -%e. %B %Y, %H:%M:%S %Z +%A %e %B %Y, %H:%M:%S %Z # # Long month names (without case ending) janura Modified: stable/11/share/timedef/sk_SK.UTF-8.src ============================================================================== --- stable/11/share/timedef/sk_SK.UTF-8.src Sun Jul 24 08:52:49 2016 (r303259) +++ stable/11/share/timedef/sk_SK.UTF-8.src Sun Jul 24 09:00:16 2016 (r303260) @@ -56,14 +56,14 @@ sobota %d.%m.%y # # c_fmt -%e. %B %Y, %H:%M:%S +%A %e %B %Y, %H:%M:%S # # AM/PM dopoludnia odpoludnia # # date_fmt -%e. %B %Y, %H:%M:%S %Z +%A %e %B %Y, %H:%M:%S %Z # # Long month names (without case ending) januára From owner-svn-src-stable@freebsd.org Sun Jul 24 10:00:30 2016 Return-Path: Delivered-To: svn-src-stable@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 9A09DB9B8CB; Sun, 24 Jul 2016 10:00:30 +0000 (UTC) (envelope-from trasz@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 757921D27; Sun, 24 Jul 2016 10:00:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6OA0TPS008858; Sun, 24 Jul 2016 10:00:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6OA0TK7008856; Sun, 24 Jul 2016 10:00:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201607241000.u6OA0TK7008856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 24 Jul 2016 10:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303262 - stable/11/usr.sbin/ctld X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2016 10:00:30 -0000 Author: trasz Date: Sun Jul 24 10:00:29 2016 New Revision: 303262 URL: https://svnweb.freebsd.org/changeset/base/303262 Log: MFC r303132: Add documentation for "ctld -u", the UCL configuration file format. Submitted by: jceel@ Approved by: re (kib) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D7222 Modified: stable/11/usr.sbin/ctld/ctl.conf.5 stable/11/usr.sbin/ctld/ctld.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- stable/11/usr.sbin/ctld/ctl.conf.5 Sun Jul 24 09:15:11 2016 (r303261) +++ stable/11/usr.sbin/ctld/ctl.conf.5 Sun Jul 24 10:00:29 2016 (r303262) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 9, 2015 +.Dd July 21, 2016 .Dt CTL.CONF 5 .Os .Sh NAME @@ -481,6 +481,97 @@ target naa.50015178f369f092 { lun 0 example_1 } .Ed +.Pp +An equivalent configuration in UCL format, for use with +.Fl u : +.Bd -literal +auth-group { + ag0 { + chap-mutual = [ + { + user = "user" + secret = "secretsecret" + mutual-user = "mutualuser" + mutual-secret = "mutualsecret" + }, + { + user = "user2" + secret = "secret2secret2" + mutual-user = "mutualuser" + mutual-secret = "mutualsecret" + } + ] + } + + ag1 { + auth-type = none + initiator-name = [ + "iqn.2012-06.com.example:initiatorhost1", + "iqn.2012-06.com.example:initiatorhost2" + ] + initiator-portal = [192.168.1.1/24, "[2001:db8::de:ef]"] + } +} + +portal-group { + pg0 { + discovery-auth-group = no-authentication + listen = [ + 0.0.0.0:3260, + "[::]:3260", + "[fe80::be:ef]:3261" + ] + } +} + +lun { + example_0 { + path = /dev/zvol/tank/example_0 + blocksize = 4096 + size = "4G" + } + + example_1 { + path = /dev/zvol/tank/example_1 + options { + naa = "0x50015178f369f093" + } + } + + example_2 { + path = /dev/zvol/tank/example_2 + options { + vendor = "FreeBSD" + } + } +} + +target { + "iqn.2012-06.com.example:target0" { + alias = "Example target" + auth-group = no-authentication + lun = [ + { number = 0, name = example_0 }, + ] + } + + "iqn.2012-06.com.example:target1" { + auth-group = ag0 + portal-group { name = pg0 } + lun = [ + { number = 0, name = example_1 }, + { number = 1, name = example_2 } + ] + } + + naa.50015178f369f092 { + port = isp0 + lun = [ + { number = 0, name = example_1 } + ] + } +} +.Ed .Sh SEE ALSO .Xr ctl 4 , .Xr ctladm 8 , Modified: stable/11/usr.sbin/ctld/ctld.8 ============================================================================== --- stable/11/usr.sbin/ctld/ctld.8 Sun Jul 24 09:15:11 2016 (r303261) +++ stable/11/usr.sbin/ctld/ctld.8 Sun Jul 24 10:00:29 2016 (r303262) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 22, 2015 +.Dd July 21, 2016 .Dt CTLD 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Nm .Op Fl d .Op Fl f Ar config-file +.Op Fl u .Sh DESCRIPTION The .Nm @@ -84,6 +85,8 @@ The daemon sends verbose debug output to put itself in the background. The daemon will also not fork and will exit after processing one connection. This option is only intended for debugging the target. +.It Fl u +Use UCL configuration file format instead of the traditional non-UCL format. .El .Sh FILES .Bl -tag -width ".Pa /var/run/ctld.pid" -compact From owner-svn-src-stable@freebsd.org Sun Jul 24 14:50:18 2016 Return-Path: Delivered-To: svn-src-stable@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 D1733BA3FB0; Sun, 24 Jul 2016 14:50:18 +0000 (UTC) (envelope-from tuexen@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 9C0ED1E2B; Sun, 24 Jul 2016 14:50:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6OEoH24018524; Sun, 24 Jul 2016 14:50:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6OEoH0W018514; Sun, 24 Jul 2016 14:50:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201607241450.u6OEoH0W018514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 24 Jul 2016 14:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303267 - in stable/11: sys/netinet usr.bin/netstat X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2016 14:50:18 -0000 Author: tuexen Date: Sun Jul 24 14:50:16 2016 New Revision: 303267 URL: https://svnweb.freebsd.org/changeset/base/303267 Log: MFC r302904: Fix a bug which results in a core dump when running netstat with the -W option and having a listening SCTP socket. The bug was introduced in r279122 when adding support for libxo. MFC r302907: When calling netstat -Laptcp the local address values are not aligned with the corresponding entry in the table header. r295136 increased the value width from 14 to 32 without the corresponding change to the table header. This commit adds the change to the table header width. MFC r302917: Ensure that the -a, -W, -L options for SCTP behave similar as for TCP. MFC r302928: Address a potential memory leak found a the clang static code analyzer running on the userland stack. MFC r302930: Don't free a data chunk twice. Found by the clang static code analyzer running for the userland stack. MFC r302935: Deal with a portential memory allocation failure, which was reported by the clang static code analyzer. Joint work with rrs@. MFC r302942: Add missing sctps_reasmusrmsgs counter. Joint work with rrs@. MFC r302945: Don't duplicate code for SCTP, just use the ones used for UDP and TCP. This fixes a bug with link local addresses. This will require and upcoming change in the kernel to bring SCTP to the same behaviour as UDP and TCP. MFC r302949: Fix the PR-SCTP behaviour. This is done by rrs@. MFC r302950: Add a constant required by RFC 7496. MFC r303024: netstat and sockstat expect the IPv6 link local addresses to have an embedded scope. So don't recover. MFC r303025: Use correct order of conditions to avoid NULL deref. MFC r303073: Fix a bug in deferred stream reset processing which results in using a length field before it is set. Thanks to Taylor Brandstetter for reporting the issue and providing a fix. Approved by: re (kib) Modified: stable/11/sys/netinet/sctp_auth.c stable/11/sys/netinet/sctp_constants.h stable/11/sys/netinet/sctp_header.h stable/11/sys/netinet/sctp_indata.c stable/11/sys/netinet/sctp_output.c stable/11/sys/netinet/sctp_sysctl.c stable/11/sys/netinet/sctp_uio.h stable/11/usr.bin/netstat/inet.c stable/11/usr.bin/netstat/sctp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_auth.c ============================================================================== --- stable/11/sys/netinet/sctp_auth.c Sun Jul 24 14:42:11 2016 (r303266) +++ stable/11/sys/netinet/sctp_auth.c Sun Jul 24 14:50:16 2016 (r303267) @@ -542,7 +542,7 @@ sctp_insert_sharedkey(struct sctp_keyhea } } /* shouldn't reach here */ - return (0); + return (EINVAL); } void @@ -622,8 +622,11 @@ sctp_copy_skeylist(const struct sctp_key LIST_FOREACH(skey, src, next) { new_skey = sctp_copy_sharedkey(skey); if (new_skey != NULL) { - (void)sctp_insert_sharedkey(dest, new_skey); - count++; + if (sctp_insert_sharedkey(dest, new_skey)) { + sctp_free_sharedkey(new_skey); + } else { + count++; + } } } return (count); Modified: stable/11/sys/netinet/sctp_constants.h ============================================================================== --- stable/11/sys/netinet/sctp_constants.h Sun Jul 24 14:42:11 2016 (r303266) +++ stable/11/sys/netinet/sctp_constants.h Sun Jul 24 14:50:16 2016 (r303267) @@ -345,6 +345,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_RTT_FROM_NON_DATA 0 #define SCTP_RTT_FROM_DATA 1 +#define PR_SCTP_UNORDERED_FLAG 0x0001 /* IP hdr (20/40) + 12+2+2 (enet) + sctp common 12 */ #define SCTP_FIRST_MBUF_RESV 68 Modified: stable/11/sys/netinet/sctp_header.h ============================================================================== --- stable/11/sys/netinet/sctp_header.h Sun Jul 24 14:42:11 2016 (r303266) +++ stable/11/sys/netinet/sctp_header.h Sun Jul 24 14:50:16 2016 (r303267) @@ -397,7 +397,7 @@ struct sctp_strseq { struct sctp_strseq_mid { uint16_t stream; - uint16_t reserved; + uint16_t flags; uint32_t msg_id; }; Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sun Jul 24 14:42:11 2016 (r303266) +++ stable/11/sys/netinet/sctp_indata.c Sun Jul 24 14:50:16 2016 (r303267) @@ -753,7 +753,7 @@ sctp_handle_old_data(struct sctp_tcb *st */ struct sctp_tmit_chunk *chk, *lchk, *tchk; uint32_t fsn; - struct sctp_queued_to_read *nc = NULL; + struct sctp_queued_to_read *nc; int cnt_added; if (control->first_frag_seen == 0) { @@ -768,6 +768,11 @@ restart: TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, lchk) { if (chk->rec.data.fsn_num == fsn) { /* Ok lets add it */ + sctp_alloc_a_readq(stcb, nc); + if (nc == NULL) { + break; + } + memset(nc, 0, sizeof(struct sctp_queued_to_read)); TAILQ_REMOVE(&control->reasm, chk, sctp_next); sctp_add_chk_to_control(control, strm, stcb, asoc, chk); fsn++; @@ -781,7 +786,6 @@ restart: * on the control queue to a new * control. */ - sctp_alloc_a_readq(stcb, nc); sctp_build_readq_entry_from_ctl(nc, control); tchk = TAILQ_FIRST(&control->reasm); if (tchk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) { @@ -819,6 +823,7 @@ restart: if (control->on_strm_q) { TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm); control->on_strm_q = 0; + SCTP_STAT_INCR_COUNTER64(sctps_reasmusrmsgs); } if (control->on_read_q == 0) { sctp_add_to_readq(stcb->sctp_ep, stcb, control, @@ -826,16 +831,19 @@ restart: SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); } sctp_wakeup_the_read_socket(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); - if ((nc) && (nc->first_frag_seen)) { + if ((nc->first_frag_seen) && !TAILQ_EMPTY(&nc->reasm)) { /* * Switch to the new guy and * continue */ control = nc; - nc = NULL; goto restart; + } else { + sctp_free_a_readq(stcb, nc); } return (1); + } else { + sctp_free_a_readq(stcb, nc); } } else { /* Can't add more */ @@ -961,11 +969,6 @@ place_chunk: * should not happen since the FSN is a TSN and it * should have been dropped earlier. */ - if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; - } - sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); sctp_abort_in_reasm(stcb, control, chk, abort_flag, SCTP_FROM_SCTP_INDATA + SCTP_LOC_5); @@ -1026,6 +1029,7 @@ sctp_deliver_reasm_check(struct sctp_tcb control, control->on_strm_q); } #endif + SCTP_STAT_INCR_COUNTER64(sctps_reasmusrmsgs); TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm); control->on_strm_q = 0; } @@ -1080,6 +1084,7 @@ done_un: control, control->on_strm_q); } #endif + SCTP_STAT_INCR_COUNTER64(sctps_reasmusrmsgs); TAILQ_REMOVE(&strm->inqueue, control, next_instrm); control->on_strm_q = 0; } @@ -1125,6 +1130,7 @@ deliver_more: control, control->on_strm_q); } #endif + SCTP_STAT_INCR_COUNTER64(sctps_reasmusrmsgs); TAILQ_REMOVE(&strm->inqueue, control, next_instrm); control->on_strm_q = 0; } @@ -5277,10 +5283,11 @@ sctp_kick_prsctp_reorder_queue(struct sc } } + static void sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, struct sctp_association *asoc, - uint16_t stream, uint32_t seq) + uint16_t stream, uint32_t seq, int ordered, int old) { struct sctp_queued_to_read *control; struct sctp_stream_in *strm; @@ -5295,7 +5302,7 @@ sctp_flush_reassm_for_str_seq(struct sct * queue. */ strm = &asoc->strmin[stream]; - control = find_reasm_entry(strm, (uint32_t) seq, 0, 0); + control = find_reasm_entry(strm, (uint32_t) seq, ordered, old); if (control == NULL) { /* Not found */ return; @@ -5427,6 +5434,7 @@ sctp_handle_forward_tsn(struct sctp_tcb unsigned int num_str; uint32_t sequence; uint16_t stream; + uint16_t ordered, flags; int old; struct sctp_strseq *stseq, strseqbuf; struct sctp_strseq_mid *stseq_m, strseqbuf_m; @@ -5452,6 +5460,12 @@ sctp_handle_forward_tsn(struct sctp_tcb } stream = ntohs(stseq_m->stream); sequence = ntohl(stseq_m->msg_id); + flags = ntohs(stseq_m->flags); + if (flags & PR_SCTP_UNORDERED_FLAG) { + ordered = 0; + } else { + ordered = 1; + } } else { stseq = (struct sctp_strseq *)sctp_m_getptr(m, offset, sizeof(struct sctp_strseq), @@ -5462,6 +5476,7 @@ sctp_handle_forward_tsn(struct sctp_tcb } stream = ntohs(stseq->stream); sequence = (uint32_t) ntohs(stseq->sequence); + ordered = 1; } /* Convert */ @@ -5487,7 +5502,7 @@ sctp_handle_forward_tsn(struct sctp_tcb asoc->fragmented_delivery_inprogress = 0; } strm = &asoc->strmin[stream]; - sctp_flush_reassm_for_str_seq(stcb, asoc, stream, sequence); + sctp_flush_reassm_for_str_seq(stcb, asoc, stream, sequence, ordered, old); TAILQ_FOREACH(ctl, &stcb->sctp_ep->read_queue, next) { if ((ctl->sinfo_stream == stream) && (ctl->sinfo_ssn == sequence)) { Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sun Jul 24 14:42:11 2016 (r303266) +++ stable/11/sys/netinet/sctp_output.c Sun Jul 24 14:50:16 2016 (r303267) @@ -10383,7 +10383,7 @@ sctp_fill_in_rest: /* no more to look at */ break; } - if (at->rec.data.rcv_flags & SCTP_DATA_UNORDERED) { + if ((at->rec.data.rcv_flags & SCTP_DATA_UNORDERED) && old) { /* We don't report these */ continue; } @@ -10504,7 +10504,7 @@ sctp_fill_in_rest: tp1 = TAILQ_NEXT(at, sctp_next); if (tp1 == NULL) break; - if (at->rec.data.rcv_flags & SCTP_DATA_UNORDERED) { + if (old && (at->rec.data.rcv_flags & SCTP_DATA_UNORDERED)) { /* We don't report these */ i--; at = tp1; @@ -10519,8 +10519,11 @@ sctp_fill_in_rest: strseq++; } else { strseq_m->stream = ntohs(at->rec.data.stream_number); - strseq_m->reserved = ntohs(0); strseq_m->msg_id = ntohl(at->rec.data.stream_seq); + if (at->rec.data.rcv_flags & SCTP_DATA_UNORDERED) + strseq_m->flags = ntohs(PR_SCTP_UNORDERED_FLAG); + else + strseq_m->flags = 0; strseq_m++; } at = tp1; @@ -11937,7 +11940,6 @@ sctp_send_deferred_reset_response(struct return; } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); - sctp_add_stream_reset_result(chk, ent->seq, response); /* setup chunk parameters */ chk->sent = SCTP_DATAGRAM_UNSENT; chk->snd_count = 0; @@ -11952,6 +11954,7 @@ sctp_send_deferred_reset_response(struct ch->chunk_length = htons(chk->book_size); atomic_add_int(&chk->whoTo->ref_count, 1); SCTP_BUF_LEN(chk->data) = chk->send_size; + sctp_add_stream_reset_result(chk, ent->seq, response); /* insert the chunk for sending */ TAILQ_INSERT_TAIL(&asoc->control_send_queue, chk, Modified: stable/11/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/11/sys/netinet/sctp_sysctl.c Sun Jul 24 14:42:11 2016 (r303266) +++ stable/11/sys/netinet/sctp_sysctl.c Sun Jul 24 14:50:16 2016 (r303267) @@ -279,15 +279,6 @@ sctp_sysctl_copy_out_local_addresses(str if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { if (local_scope == 0) continue; - if (sin6->sin6_scope_id == 0) { - /* - * bad link - * local - * address - */ - if (sa6_recoverscope(sin6) != 0) - continue; - } } if ((site_scope == 0) && (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) continue; Modified: stable/11/sys/netinet/sctp_uio.h ============================================================================== --- stable/11/sys/netinet/sctp_uio.h Sun Jul 24 14:42:11 2016 (r303266) +++ stable/11/sys/netinet/sctp_uio.h Sun Jul 24 14:50:16 2016 (r303267) @@ -259,7 +259,8 @@ struct sctp_snd_all_completes { /* The lower four bits is an enumeration of PR-SCTP policies */ #define SCTP_PR_SCTP_NONE 0x0000/* Reliable transfer */ #define SCTP_PR_SCTP_TTL 0x0001/* Time based PR-SCTP */ -#define SCTP_PR_SCTP_BUF 0x0002/* Buffer based PR-SCTP */ +#define SCTP_PR_SCTP_PRIO 0x0002/* Buffer based PR-SCTP */ +#define SCTP_PR_SCTP_BUF SCTP_PR_SCTP_PRIO /* For backwards compatibility */ #define SCTP_PR_SCTP_RTX 0x0003/* Number of retransmissions based PR-SCTP */ #define SCTP_PR_SCTP_MAX SCTP_PR_SCTP_RTX #define SCTP_PR_SCTP_ALL 0x000f/* Used for aggregated stats */ Modified: stable/11/usr.bin/netstat/inet.c ============================================================================== --- stable/11/usr.bin/netstat/inet.c Sun Jul 24 14:42:11 2016 (r303266) +++ stable/11/usr.bin/netstat/inet.c Sun Jul 24 14:50:16 2016 (r303267) @@ -418,10 +418,10 @@ protopr(u_long off, const char *name, in "Tcpcb"); if (Lflag) xo_emit((Aflag && !Wflag) ? - "{T:/%-5.5s} {T:/%-14.14s} {T:/%-18.18s}" : + "{T:/%-5.5s} {T:/%-32.32s} {T:/%-18.18s}" : ((!Wflag || af1 == AF_INET) ? - "{T:/%-5.5s} {T:/%-14.14s} {T:/%-22.22s}" : - "{T:/%-5.5s} {T:/%-14.14s} {T:/%-45.45s}"), + "{T:/%-5.5s} {T:/%-32.32s} {T:/%-22.22s}" : + "{T:/%-5.5s} {T:/%-32.32s} {T:/%-45.45s}"), "Proto", "Listen", "Local Address"); else if (Tflag) xo_emit((Aflag && !Wflag) ? Modified: stable/11/usr.bin/netstat/sctp.c ============================================================================== --- stable/11/usr.bin/netstat/sctp.c Sun Jul 24 14:42:11 2016 (r303266) +++ stable/11/usr.bin/netstat/sctp.c Sun Jul 24 14:50:16 2016 (r303267) @@ -104,93 +104,14 @@ struct xraddr_entry { LIST_ENTRY(xraddr_entry) xraddr_entries; }; -/* - * Construct an Internet address representation. - * If numeric_addr has been supplied, give - * numeric value, otherwise try for symbolic name. - */ #ifdef INET -static char * -inetname(struct in_addr *inp) -{ - char *cp; - static char line[MAXHOSTNAMELEN]; - struct hostent *hp; - struct netent *np; - - cp = 0; - if (!numeric_addr && inp->s_addr != INADDR_ANY) { - int net = inet_netof(*inp); - int lna = inet_lnaof(*inp); - - if (lna == INADDR_ANY) { - np = getnetbyaddr(net, AF_INET); - if (np) - cp = np->n_name; - } - if (cp == NULL) { - hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET); - if (hp) { - cp = hp->h_name; - trimdomain(cp, strlen(cp)); - } - } - } - if (inp->s_addr == INADDR_ANY) - strcpy(line, "*"); - else if (cp) { - strlcpy(line, cp, sizeof(line)); - } else { - inp->s_addr = ntohl(inp->s_addr); -#define C(x) ((u_int)((x) & 0xff)) - sprintf(line, "%u.%u.%u.%u", C(inp->s_addr >> 24), - C(inp->s_addr >> 16), C(inp->s_addr >> 8), C(inp->s_addr)); - inp->s_addr = htonl(inp->s_addr); - } - return (line); -} +char * +inetname(struct in_addr *inp); #endif #ifdef INET6 -static char ntop_buf[INET6_ADDRSTRLEN]; - -static char * -inet6name(struct in6_addr *in6p) -{ - char *cp; - static char line[50]; - struct hostent *hp; - static char domain[MAXHOSTNAMELEN]; - static int first = 1; - - if (first && !numeric_addr) { - first = 0; - if (gethostname(domain, MAXHOSTNAMELEN) == 0 && - (cp = strchr(domain, '.'))) - (void) strcpy(domain, cp + 1); - else - domain[0] = 0; - } - cp = 0; - if (!numeric_addr && !IN6_IS_ADDR_UNSPECIFIED(in6p)) { - hp = gethostbyaddr((char *)in6p, sizeof(*in6p), AF_INET6); - if (hp) { - if ((cp = strchr(hp->h_name, '.')) && - !strcmp(cp + 1, domain)) - *cp = 0; - cp = hp->h_name; - } - } - if (IN6_IS_ADDR_UNSPECIFIED(in6p)) - strcpy(line, "*"); - else if (cp) - strcpy(line, cp); - else - sprintf(line, "%s", - inet_ntop(AF_INET6, (void *)in6p, ntop_buf, - sizeof(ntop_buf))); - return (line); -} +char * +inet6name(struct in6_addr *in6p); #endif static void @@ -447,7 +368,8 @@ sctp_process_inpcb(struct xsctp_inpcb *x first = 0; } xladdr = (struct xsctp_laddr *)(buf + *offset); - if (Lflag && !is_listening) { + if ((!aflag && is_listening) || + (Lflag && !is_listening)) { sctp_skip_xinpcb_ifneed(buf, buflen, offset); return; } @@ -513,8 +435,10 @@ retry: xo_open_instance("local-address"); if (xladdr_total == 0) { - xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ", - pname, tname); + if (!Lflag) { + xo_emit("{:protocol/%-6.6s/%s} " + "{:type/%-5.5s/%s} ", pname, tname); + } } else { xo_emit("\n"); xo_emit(Lflag ? "{P:/%-21.21s} " : "{P:/%-12.12s} ", @@ -529,7 +453,7 @@ retry: "{:state/CLOSED}", " "); } else { xo_emit("{P:/%-45.45s} " - "{:state:LISTEN}", " "); + "{:state/LISTEN}", " "); } } else { if (process_closed) { From owner-svn-src-stable@freebsd.org Sun Jul 24 16:32:35 2016 Return-Path: Delivered-To: svn-src-stable@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 5DD8FBA3798; Sun, 24 Jul 2016 16:32:35 +0000 (UTC) (envelope-from sbruno@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 2C647163C; Sun, 24 Jul 2016 16:32:35 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6OGWYui059594; Sun, 24 Jul 2016 16:32:34 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6OGWYwH059593; Sun, 24 Jul 2016 16:32:34 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201607241632.u6OGWYwH059593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sun, 24 Jul 2016 16:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303268 - stable/11/sys/dev/ixgbe X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2016 16:32:35 -0000 Author: sbruno Date: Sun Jul 24 16:32:34 2016 New Revision: 303268 URL: https://svnweb.freebsd.org/changeset/base/303268 Log: MFC r303032 Fixup DA cable detection routines to not set the cable type to unknown if they do not match one of two cable types. PR: 150249 Approved by: re (gjb) Modified: stable/11/sys/dev/ixgbe/ixgbe_phy.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ixgbe/ixgbe_phy.c ============================================================================== --- stable/11/sys/dev/ixgbe/ixgbe_phy.c Sun Jul 24 14:50:16 2016 (r303267) +++ stable/11/sys/dev/ixgbe/ixgbe_phy.c Sun Jul 24 16:32:34 2016 (r303268) @@ -1534,21 +1534,18 @@ s32 ixgbe_identify_sfp_module_generic(st hw->phy.type = ixgbe_phy_sfp_intel; break; default: - if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE) - hw->phy.type = - ixgbe_phy_sfp_passive_unknown; - else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE) - hw->phy.type = - ixgbe_phy_sfp_active_unknown; - else - hw->phy.type = ixgbe_phy_sfp_unknown; + hw->phy.type = ixgbe_phy_sfp_unknown; break; } } /* Allow any DA cable vendor */ if (cable_tech & (IXGBE_SFF_DA_PASSIVE_CABLE | - IXGBE_SFF_DA_ACTIVE_CABLE)) { + IXGBE_SFF_DA_ACTIVE_CABLE)) { + if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE) + hw->phy.type = ixgbe_phy_sfp_passive_unknown; + else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE) + hw->phy.type = ixgbe_phy_sfp_active_unknown; status = IXGBE_SUCCESS; goto out; } From owner-svn-src-stable@freebsd.org Sun Jul 24 16:33:49 2016 Return-Path: Delivered-To: svn-src-stable@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 C014BBA3808; Sun, 24 Jul 2016 16:33:49 +0000 (UTC) (envelope-from sbruno@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 8FBDC17A8; Sun, 24 Jul 2016 16:33:49 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6OGXm4R059714; Sun, 24 Jul 2016 16:33:48 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6OGXmVd059713; Sun, 24 Jul 2016 16:33:48 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201607241633.u6OGXmVd059713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sun, 24 Jul 2016 16: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: r303269 - stable/10/sys/dev/ixgbe 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2016 16:33:49 -0000 Author: sbruno Date: Sun Jul 24 16:33:48 2016 New Revision: 303269 URL: https://svnweb.freebsd.org/changeset/base/303269 Log: MFC r303032 Fixup DA cable detection routines to not set the cable type to unknown if they do not match one of two cable types. PR: 150249 Modified: stable/10/sys/dev/ixgbe/ixgbe_phy.c Modified: stable/10/sys/dev/ixgbe/ixgbe_phy.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe_phy.c Sun Jul 24 16:32:34 2016 (r303268) +++ stable/10/sys/dev/ixgbe/ixgbe_phy.c Sun Jul 24 16:33:48 2016 (r303269) @@ -1534,21 +1534,18 @@ s32 ixgbe_identify_sfp_module_generic(st hw->phy.type = ixgbe_phy_sfp_intel; break; default: - if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE) - hw->phy.type = - ixgbe_phy_sfp_passive_unknown; - else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE) - hw->phy.type = - ixgbe_phy_sfp_active_unknown; - else - hw->phy.type = ixgbe_phy_sfp_unknown; + hw->phy.type = ixgbe_phy_sfp_unknown; break; } } /* Allow any DA cable vendor */ if (cable_tech & (IXGBE_SFF_DA_PASSIVE_CABLE | - IXGBE_SFF_DA_ACTIVE_CABLE)) { + IXGBE_SFF_DA_ACTIVE_CABLE)) { + if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE) + hw->phy.type = ixgbe_phy_sfp_passive_unknown; + else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE) + hw->phy.type = ixgbe_phy_sfp_active_unknown; status = IXGBE_SUCCESS; goto out; } From owner-svn-src-stable@freebsd.org Mon Jul 25 00:46:02 2016 Return-Path: Delivered-To: svn-src-stable@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 8AA0FBA31AA; Mon, 25 Jul 2016 00:46:02 +0000 (UTC) (envelope-from delphij@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 4C8AB13B0; Mon, 25 Jul 2016 00:46:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6P0k1Gb041295; Mon, 25 Jul 2016 00:46:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6P0k1i1041294; Mon, 25 Jul 2016 00:46:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201607250046.u6P0k1i1041294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 25 Jul 2016 00:46: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: r303280 - stable/10/usr.bin/mail 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 00:46:02 -0000 Author: delphij Date: Mon Jul 25 00:46:01 2016 New Revision: 303280 URL: https://svnweb.freebsd.org/changeset/base/303280 Log: MFC r302542: Use _PATH_DEVNULL instead of hardcoding. Modified: stable/10/usr.bin/mail/collect.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mail/collect.c ============================================================================== --- stable/10/usr.bin/mail/collect.c Sun Jul 24 23:40:33 2016 (r303279) +++ stable/10/usr.bin/mail/collect.c Mon Jul 25 00:46:01 2016 (r303280) @@ -339,9 +339,9 @@ cont: int nullfd, tempfd, rc; char tempname2[PATHSIZE]; - if ((nullfd = open("/dev/null", O_RDONLY, 0)) + if ((nullfd = open(_PATH_DEVNULL, O_RDONLY, 0)) == -1) { - warn("/dev/null"); + warn(_PATH_DEVNULL); break; } From owner-svn-src-stable@freebsd.org Mon Jul 25 00:46:47 2016 Return-Path: Delivered-To: svn-src-stable@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 0D001BA3208; Mon, 25 Jul 2016 00:46:47 +0000 (UTC) (envelope-from delphij@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 D0FE31586; Mon, 25 Jul 2016 00:46:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6P0kkUT041371; Mon, 25 Jul 2016 00:46:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6P0kkMG041370; Mon, 25 Jul 2016 00:46:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201607250046.u6P0kkMG041370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 25 Jul 2016 00:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r303281 - stable/9/usr.bin/mail X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 00:46:47 -0000 Author: delphij Date: Mon Jul 25 00:46:45 2016 New Revision: 303281 URL: https://svnweb.freebsd.org/changeset/base/303281 Log: MFC r302542: Use _PATH_DEVNULL instead of hardcoding. Modified: stable/9/usr.bin/mail/collect.c Directory Properties: stable/9/usr.bin/mail/ (props changed) Modified: stable/9/usr.bin/mail/collect.c ============================================================================== --- stable/9/usr.bin/mail/collect.c Mon Jul 25 00:46:01 2016 (r303280) +++ stable/9/usr.bin/mail/collect.c Mon Jul 25 00:46:45 2016 (r303281) @@ -339,9 +339,9 @@ cont: int nullfd, tempfd, rc; char tempname2[PATHSIZE]; - if ((nullfd = open("/dev/null", O_RDONLY, 0)) + if ((nullfd = open(_PATH_DEVNULL, O_RDONLY, 0)) == -1) { - warn("/dev/null"); + warn(_PATH_DEVNULL); break; } From owner-svn-src-stable@freebsd.org Mon Jul 25 05:33:21 2016 Return-Path: Delivered-To: svn-src-stable@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 CFE0BBA48BD; Mon, 25 Jul 2016 05:33:21 +0000 (UTC) (envelope-from delphij@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 9A64E1AA4; Mon, 25 Jul 2016 05:33:21 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6P5XKmX048882; Mon, 25 Jul 2016 05:33:20 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6P5XJFr048868; Mon, 25 Jul 2016 05:33:19 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201607250533.u6P5XJFr048868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 25 Jul 2016 05:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r303286 - in stable/9: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/src lib/libmagic X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 05:33:22 -0000 Author: delphij Date: Mon Jul 25 05:33:19 2016 New Revision: 303286 URL: https://svnweb.freebsd.org/changeset/base/303286 Log: MFC r302221,302222: MFV r302218: file 5.28. Relnotes: yes Added: stable/9/contrib/file/magic/Magdir/ber - copied unchanged from r302221, head/contrib/file/magic/Magdir/ber stable/9/contrib/file/magic/Magdir/coverage - copied unchanged from r302221, head/contrib/file/magic/Magdir/coverage stable/9/contrib/file/magic/Magdir/pc88 - copied unchanged from r302221, head/contrib/file/magic/Magdir/pc88 stable/9/contrib/file/magic/Magdir/pc98 - copied unchanged from r302221, head/contrib/file/magic/Magdir/pc98 stable/9/contrib/file/magic/Magdir/x68000 - copied unchanged from r302221, head/contrib/file/magic/Magdir/x68000 Deleted: stable/9/contrib/file/src/magic.h Modified: stable/9/contrib/file/ChangeLog stable/9/contrib/file/config.h.in stable/9/contrib/file/configure stable/9/contrib/file/configure.ac stable/9/contrib/file/doc/file.man stable/9/contrib/file/magic/Magdir/c-lang stable/9/contrib/file/magic/Magdir/console stable/9/contrib/file/magic/Magdir/database stable/9/contrib/file/magic/Magdir/elf stable/9/contrib/file/magic/Magdir/msdos stable/9/contrib/file/magic/Magdir/msx stable/9/contrib/file/magic/Magdir/perl stable/9/contrib/file/magic/Makefile.am stable/9/contrib/file/magic/Makefile.in stable/9/contrib/file/src/Makefile.am stable/9/contrib/file/src/Makefile.in stable/9/contrib/file/src/apprentice.c stable/9/contrib/file/src/cdf.c stable/9/contrib/file/src/compress.c stable/9/contrib/file/src/der.c stable/9/contrib/file/src/file.c stable/9/contrib/file/src/softmagic.c stable/9/lib/libmagic/Makefile stable/9/lib/libmagic/config.h Directory Properties: stable/9/contrib/file/ (props changed) stable/9/lib/libmagic/ (props changed) Modified: stable/9/contrib/file/ChangeLog ============================================================================== --- stable/9/contrib/file/ChangeLog Mon Jul 25 03:58:19 2016 (r303285) +++ stable/9/contrib/file/ChangeLog Mon Jul 25 05:33:19 2016 (r303286) @@ -1,3 +1,15 @@ +2016-06-13 19:40 Christos Zoulas + + * release 5.28 + * fix leak on allocation failure + +2016-06-01 1:20 Christos Zoulas + + * PR/555: Avoid overflow for offset > nbytes + * PR/550: Segv on DER parsing: + - use the correct variable for length + - set offset to 0 on failure. + 2016-05-13 12:00 Christos Zoulas * release 5.27 Modified: stable/9/contrib/file/config.h.in ============================================================================== --- stable/9/contrib/file/config.h.in Mon Jul 25 03:58:19 2016 (r303285) +++ stable/9/contrib/file/config.h.in Mon Jul 25 05:33:19 2016 (r303286) @@ -328,6 +328,9 @@ # endif #endif +/* Enable zlib compression support */ +#undef ZLIBSUPPORT + /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 Modified: stable/9/contrib/file/configure ============================================================================== --- stable/9/contrib/file/configure Mon Jul 25 03:58:19 2016 (r303285) +++ stable/9/contrib/file/configure Mon Jul 25 05:33:19 2016 (r303286) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.27. +# Generated by GNU Autoconf 2.69 for file 5.28. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.27' -PACKAGE_STRING='file 5.27' +PACKAGE_VERSION='5.28' +PACKAGE_STRING='file 5.28' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -766,6 +766,7 @@ enable_option_checking enable_silent_rules enable_elf enable_elf_core +enable_zlib enable_fsect_man5 enable_dependency_tracking enable_static @@ -1327,7 +1328,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.27 to adapt to many kinds of systems. +\`configure' configures file 5.28 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1398,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.27:";; + short | recursive ) echo "Configuration of file 5.28:";; esac cat <<\_ACEOF @@ -1409,6 +1410,7 @@ Optional Features: --disable-silent-rules verbose build output (undo: "make V=0") --disable-elf disable builtin ELF support --disable-elf-core disable ELF core file support + --disable-zlib disable zlib compression support [default=auto] --enable-fsect-man5 enable file formats in man section 5 --enable-dependency-tracking do not reject slow dependency extractors @@ -1507,7 +1509,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.27 +file configure 5.28 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2163,7 +2165,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.27, which was +It was created by file $as_me 5.28, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3029,7 +3031,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.27' + VERSION='5.28' cat >>confdefs.h <<_ACEOF @@ -3218,6 +3220,16 @@ $as_echo "#define ELFCORE 1" >>confdefs. fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib support" >&5 +$as_echo_n "checking for zlib support... " >&6; } +# Check whether --enable-zlib was given. +if test "${enable_zlib+set}" = set; then : + enableval=$enable_zlib; +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_zlib" >&5 +$as_echo "$enable_zlib" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file formats in man section 5" >&5 $as_echo_n "checking for file formats in man section 5... " >&6; } # Check whether --enable-fsect-man5 was given. @@ -12812,7 +12824,8 @@ fi done -for ac_header in zlib.h +if test "$enable_zlib" != "no"; then + for ac_header in zlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : @@ -12824,6 +12837,7 @@ fi done +fi ac_fn_c_check_type "$LINENO" "sig_t" "ac_cv_type_sig_t" " #ifdef HAVE_SIGNAL_H #include @@ -14400,7 +14414,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 +if test "$enable_zlib" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 $as_echo_n "checking for gzopen in -lz... " >&6; } if ${ac_cv_lib_z_gzopen+:} false; then : $as_echo_n "(cached) " >&6 @@ -14445,6 +14460,7 @@ _ACEOF fi +fi if test "$MINGW" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for regexec in -lgnurx" >&5 $as_echo_n "checking for regexec in -lgnurx... " >&6; } @@ -14504,6 +14520,16 @@ else fi +if test "$enable_zlib" = "yes"; then + if test "$ac_cv_header_zlib_h$ac_cv_lib_z_gzopen" != "yesyes"; then + as_fn_error $? "zlib support requested but not found" "$LINENO" 5 + fi +elif test "$ac_cv_header_zlib_h$ac_cv_lib_z_gzopen" = "yesyes"; then + +$as_echo "#define ZLIBSUPPORT 1" >>confdefs.h + +fi + ac_config_files="$ac_config_files Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile" cat >confcache <<\_ACEOF @@ -15049,7 +15075,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.27, which was +This file was extended by file $as_me 5.28, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15115,7 +15141,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.27 +file config.status 5.28 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/9/contrib/file/configure.ac ============================================================================== --- stable/9/contrib/file/configure.ac Mon Jul 25 03:58:19 2016 (r303285) +++ stable/9/contrib/file/configure.ac Mon Jul 25 05:33:19 2016 (r303286) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.27],[christos@astron.com]) +AC_INIT([file],[5.28],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -34,6 +34,11 @@ fi], [ AC_DEFINE([ELFCORE], 1, [Define for ELF core file support]) ]) +AC_MSG_CHECKING(for zlib support) +AC_ARG_ENABLE(zlib, +[AS_HELP_STRING([--disable-zlib], [disable zlib compression support @<:@default=auto@:>@])]) +AC_MSG_RESULT($enable_zlib) + AC_MSG_CHECKING(for file formats in man section 5) AC_ARG_ENABLE(fsect-man5, [ --enable-fsect-man5 enable file formats in man section 5], @@ -84,7 +89,9 @@ AC_CHECK_HEADERS(stdint.h fcntl.h locale AC_CHECK_HEADERS(stddef.h utime.h wchar.h wctype.h limits.h) AC_CHECK_HEADERS(getopt.h err.h xlocale.h signal.h) AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h) -AC_CHECK_HEADERS(zlib.h) +if test "$enable_zlib" != "no"; then + AC_CHECK_HEADERS(zlib.h) +fi AC_CHECK_TYPE([sig_t],[AC_DEFINE([HAVE_SIG_T],1,[Have sig_t type])],,[ #ifdef HAVE_SIGNAL_H #include @@ -148,7 +155,9 @@ dnl Provide implementation of some requi AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck dprintf) dnl Checks for libraries -AC_CHECK_LIB(z,gzopen) +if test "$enable_zlib" != "no"; then + AC_CHECK_LIB(z, gzopen) +fi if test "$MINGW" = 1; then AC_CHECK_LIB(gnurx,regexec,,AC_MSG_ERROR([libgnurx is required to build file(1) with MinGW])) fi @@ -156,5 +165,14 @@ fi dnl See if we are cross-compiling AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes) +dnl Final sanity checks +if test "$enable_zlib" = "yes"; then + if test "$ac_cv_header_zlib_h$ac_cv_lib_z_gzopen" != "yesyes"; then + AC_MSG_ERROR([zlib support requested but not found]) + fi +elif test "$ac_cv_header_zlib_h$ac_cv_lib_z_gzopen" = "yesyes"; then + AC_DEFINE([ZLIBSUPPORT], 1, [Enable zlib compression support]) +fi + AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile]) AC_OUTPUT Modified: stable/9/contrib/file/doc/file.man ============================================================================== --- stable/9/contrib/file/doc/file.man Mon Jul 25 03:58:19 2016 (r303285) +++ stable/9/contrib/file/doc/file.man Mon Jul 25 05:33:19 2016 (r303286) @@ -1,4 +1,4 @@ -.\" $File: file.man,v 1.120 2016/03/31 17:51:12 christos Exp $ +.\" $File: file.man,v 1.121 2016/06/07 22:09:20 rrt Exp $ .Dd March 13, 2016 .Dt FILE __CSECTION__ .Os @@ -213,6 +213,9 @@ Prints ELF file details. Consults magic files. .It tar Examines tar files. +.It text +A synonym for +.Sq ascii . .El .It Fl Fl extension Print a slash-separated list of valid extensions for the file type found. Copied: stable/9/contrib/file/magic/Magdir/ber (from r302221, head/contrib/file/magic/Magdir/ber) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/file/magic/Magdir/ber Mon Jul 25 05:33:19 2016 (r303286, copy of r302221, head/contrib/file/magic/Magdir/ber) @@ -0,0 +1,65 @@ + +#------------------------------------------------------------------------------ +# $File: ber,v 1.1 2016/06/05 00:21:30 christos Exp $ +# ber: file(1) magic for several BER formats used in the mobile +# telecommunications industry (Georg Sauthoff) + +# The file formats are standardized by the GSMA (GSM association). +# They are specified via ASN.1 schemas and some prose. Basic encoding +# rules (BER) is the used encoding. The formats are used for exchanging +# call data records (CDRs) between mobile operators and associated +# parties for roaming clearing purposes and fraud detection. + +# The magic file covers: + +# - TAP files (TD.57) - CDR batches and notifications +# - RAP files (TD.32) - return batches and acknowledgements +# - NRT files (TD.35) - CDR batches for 'near real time' processing + +# +# TAP 3 Files +# TAP -> Transferred Account Procedure +# cf. http://www.gsma.com/newsroom/wp-content/uploads/TD.57-v32.31.pdf +# TransferBatch short tag +0 byte 0x61 +# BatchControlInfo short tag +>&1 search/b5 \x64 +# Sender long tag #TAP 3.x (BER encoded) +>>&1 search/b8 \x5f\x81\x44 +# 3 block +>>>&64 search/b64 \x5f\x81\x49\x01\x03\x5f\x81\x3d\x01 +>>>>&0 byte x TAP 3.%d Batch (TD.57, Transferred Account) + +# Notification short tag +0 byte 0x62 +# Sender long tag +>2 search/b8 \x5f\x81\x44 +# 3 block +>>&64 search/b64 \x5f\x81\x49\x01\x03\x5f\x81\x3d\x01 +>>>&0 byte x TAP 3.%d Notification (TD.57, Transferred Account) + + +# NRT Files +# NRT a.k.a. NRTRDE +0 byte 0x61 +# 2 block +>&1 search/b8 \x5f\x29\x01\x02\x5f\x25\x01 +>>&0 byte x NRT 2.%d (TD.35, Near Real Time Roaming Data Exchange) + +# RAP Files +# cf. http://www.gsma.com/newsroom/wp-content/uploads/TD.32-v6.11.pdf +# Long ReturnBatch tag +0 string \x7f\x84\x16 +# Long RapBatchControlInfo tag +>&1 search/b8 \x7f\x84\x19 +# 3 block +>>&64 search/b64 \x5f\x81\x49\x01\x03\x5f\x81\x3d\x01 +# 1 block +>>>&1 string/b \x5f\x84\x20\x01\x01\x5f\x84\x1f\x01 +>>>>&0 byte x RAP 1.%d Batch (TD.32, Returned Account Procedure), +>>>&0 byte x TAP 3.%d + +# Long Acknowledgement tag +0 string \x7f\x84\x17 +# Long Sender tag +>&1 search/b5 \x5f\x81\x44 RAP Acknowledgement (TD.32, Returned Account Procedure) Modified: stable/9/contrib/file/magic/Magdir/c-lang ============================================================================== --- stable/9/contrib/file/magic/Magdir/c-lang Mon Jul 25 03:58:19 2016 (r303285) +++ stable/9/contrib/file/magic/Magdir/c-lang Mon Jul 25 05:33:19 2016 (r303286) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: c-lang,v 1.22 2015/10/29 18:49:11 christos Exp $ +# $File: c-lang,v 1.23 2016/05/21 14:28:27 christos Exp $ # c-lang: file(1) magic for C and related languages programs # # The strength is to beat standard HTML @@ -38,7 +38,8 @@ !:strength + 30 !:mime text/x-c++ 0 regex \^class[\ \t\n]+ C++ source text -!:strength + 30 +# But class is reduced to avoid beating php (Jens Schleusener) +!:strength + 13 !:mime text/x-c++ 0 regex \^public: C++ source text !:strength + 30 Modified: stable/9/contrib/file/magic/Magdir/console ============================================================================== --- stable/9/contrib/file/magic/Magdir/console Mon Jul 25 03:58:19 2016 (r303285) +++ stable/9/contrib/file/magic/Magdir/console Mon Jul 25 05:33:19 2016 (r303286) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: console,v 1.25 2016/04/18 20:22:10 christos Exp $ +# $File: console,v 1.26 2016/06/12 15:20:37 christos Exp $ # Console game magic # Toby Deshane @@ -56,6 +56,32 @@ >4 lelong <16 UNIF v%d format NES ROM image #------------------------------------------------------------------------------ +# fds: file(1) magic for Famciom Disk System disk images +# Reference: http://wiki.nesdev.com/w/index.php/Family_Computer_Disk_System#.FDS_format +# From: David Korth +# TODO: Check "Disk info block" and get info from that in addition to the optional header. + +# Disk info block. (block 1) +0 name nintendo-fds-disk-info-block +>1 string *NINTENDO-HVC* Famicom Disk System disk image: +>23 byte !1 FMC- +>23 byte 1 FSC- +>16 string x \b%.3s +>15 byte x \b, mfr 0x%02X +>20 byte x (Rev.%02u) + +# Headered version. +0 string FDS\x1A +>0x11 string *NINTENDO-HVC* +>>0x10 use nintendo-fds-disk-info-block +>4 byte 1 (%u side) +>4 byte !1 (%u sides) + +# Unheadered version. +1 string *NINTENDO-HVC* +>0 use nintendo-fds-disk-info-block + +#------------------------------------------------------------------------------ # gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format # Reference: http://gbdev.gg8.se/wiki/articles/The_Cartridge_Header # @@ -569,6 +595,15 @@ 0x1C belong 0xC2339F3D Nintendo GameCube disc image: >0 use nintendo-gcn-disc-common +# Type: Nintendo GameCube embedded disc image +# Commonly found on demo discs. +# From: David Korth +# Reference: http://hitmen.c02.at/files/yagcd/yagcd/index.html#idx14.8 +0 belong 0xAE0F38A2 +>0x0C belong 0x00100000 +>>(8.L+0x1C) belong 0xC2339F3D Nintendo GameCube embedded disc image: +>>>(8.L) use nintendo-gcn-disc-common + # Type: Nintendo Wii disc image # From: David Korth # Reference: http://wiibrew.org/wiki/Wii_Disc @@ -586,22 +621,15 @@ # Nintendo 3DS file formats. # -# Type: Nintendo 3DS "NCCH" header. -# Contained within either a CXI executable or an NCSD image. -# From: David Korth -# Reference: https://www.3dbrew.org/wiki/NCCH -0 name nintendo-3ds-NCCH ->0x100 string NCCH ->>0x150 string >\0 \b: "%.16s" ->>0x112 leshort x (v%u) ->>0x18C byte 2 (New3DS only) - # Type: Nintendo 3DS "NCSD" image. (game cards and eMMC) # From: David Korth # Reference: https://www.3dbrew.org/wiki/NCSD 0x100 string NCSD >0x118 lequad 0 Nintendo 3DS Game Card image ->>0x1000 use nintendo-3ds-NCCH +# NCCH header for partition 0. (game data) +>>0x1150 string >\0 \b: "%.16s" +>>0x312 byte x (Rev.%02u) +>>0x118C byte 2 (New3DS only) >>0x18D byte 0 (inner device) >>0x18D byte 1 (Card1) >>0x18D byte 2 (Card2) @@ -609,12 +637,74 @@ >0x118 bequad 0x0102020202000000 Nintendo 3DS eMMC dump (Old3DS) >0x118 bequad 0x0102020203000000 Nintendo 3DS eMMC dump (New3DS) +# Nintendo 3DS version code. +# Reference: https://www.3dbrew.org/wiki/Titles +# Format: leshort containing three fields: +# - 6-bit: Major +# - 6-bit: Minor +# - 4-bit: Revision +# NOTE: Only supporting major/minor versions from 0-15 right now. +# NOTE: Should be prefixed with "v". +0 name nintendo-3ds-version-code +# Raw version. +>0 leshort x \b%u, +# Major version. +>0 leshort&0xFC00 0x0000 0 +>0 leshort&0xFC00 0x0400 1 +>0 leshort&0xFC00 0x0800 2 +>0 leshort&0xFC00 0x0C00 3 +>0 leshort&0xFC00 0x1000 4 +>0 leshort&0xFC00 0x1400 5 +>0 leshort&0xFC00 0x1800 6 +>0 leshort&0xFC00 0x1C00 7 +>0 leshort&0xFC00 0x2000 8 +>0 leshort&0xFC00 0x2400 9 +>0 leshort&0xFC00 0x2800 10 +>0 leshort&0xFC00 0x2C00 11 +>0 leshort&0xFC00 0x3000 12 +>0 leshort&0xFC00 0x3400 13 +>0 leshort&0xFC00 0x3800 14 +>0 leshort&0xFC00 0x3C00 15 +# Minor version. +>0 leshort&0x03F0 0x0000 \b.0 +>0 leshort&0x03F0 0x0010 \b.1 +>0 leshort&0x03F0 0x0020 \b.2 +>0 leshort&0x03F0 0x0030 \b.3 +>0 leshort&0x03F0 0x0040 \b.4 +>0 leshort&0x03F0 0x0050 \b.5 +>0 leshort&0x03F0 0x0060 \b.6 +>0 leshort&0x03F0 0x0070 \b.7 +>0 leshort&0x03F0 0x0080 \b.8 +>0 leshort&0x03F0 0x0090 \b.9 +>0 leshort&0x03F0 0x00A0 \b.10 +>0 leshort&0x03F0 0x00B0 \b.11 +>0 leshort&0x03F0 0x00C0 \b.12 +>0 leshort&0x03F0 0x00D0 \b.13 +>0 leshort&0x03F0 0x00E0 \b.14 +>0 leshort&0x03F0 0x00F0 \b.15 +# Revision. +>0 leshort&0x000F x \b.%u + # Type: Nintendo 3DS "NCCH" container. # https://www.3dbrew.org/wiki/NCCH -0x100 string NCCH Nintendo 3DS ->0x18D byte&2 0 File Archive (CFA) ->0x18D byte&2 2 Executable Image (CXI) ->0 use nintendo-3ds-NCCH +0x100 string NCCH Nintendo 3DS +>0x18D byte&2 0 File Archive (CFA) +>0x18D byte&2 2 Executable Image (CXI) +>0x150 string >\0 \b: "%.16s" +>0x18D byte 0x05 +>>0x10E leshort x (Old3DS System Update v +>>0x10E use nintendo-3ds-version-code +>>0x10E leshort x \b) +>0x18D byte 0x15 +>>0x10E leshort x (New3DS System Update v +>>0x10E use nintendo-3ds-version-code +>>0x10E leshort x \b) +>0x18D byte !0x05 +>>0x18D byte !0x15 +>>>0x112 byte x (v +>>>0x112 use nintendo-3ds-version-code +>>>0x112 byte x \b) +>0x18C byte 2 (New3DS only) # Type: Nintendo 3DS "SMDH" file. (application description) # From: David Korth Copied: stable/9/contrib/file/magic/Magdir/coverage (from r302221, head/contrib/file/magic/Magdir/coverage) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/file/magic/Magdir/coverage Mon Jul 25 05:33:19 2016 (r303286, copy of r302221, head/contrib/file/magic/Magdir/coverage) @@ -0,0 +1,91 @@ + +#------------------------------------------------------------------------------ +# $File: coverage,v 1.1 2016/06/05 00:26:32 christos Exp $ +# xoverage: file(1) magic for test coverage data + +# File formats used to store test coverage data +# 2016-05-21, Georg Sauthoff + + +# - GCC gcno - written by GCC at compile time when compiling with +# gcc -ftest-coverage +# - GCC gcda - written by a program that was compiled with +# gcc -fprofile-arcs +# - LLVM raw profiles - generated by a program compiled with +# clang -fprofile-instr-generate -fcoverage-mapping ... +# - LLVM indexed profiles - generated by +# llvm-profdata +# - GCOV reports, i.e. the annotated source code +# - LCOV trace files, i.e. aggregated GCC profiles +# +# GCC coverage tracefiles +# .gcno file are created during compile time, +# while data collected during runtime is stored in .gcda files +# cf. gcov-io.h +# https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gcc/Gcov-Data-Files.html +# Examples: +# Fedora 23/x86-64/gcc-5.3.1: 6f 6e 63 67 52 33 30 35 +# Debian 8 PPC64/gcc-4.9.2 : 67 63 6e 6f 34 30 39 2a +0 lelong 0x67636e6f GCC gcno coverage (-ftest-coverage), +>&3 byte x version %c. +>&1 byte x \b%c + +# big endian +0 belong 0x67636e6f GCC gcno coverage (-ftest-coverage), +>&0 byte x version %c. +>&2 byte x \b%c (big-endian) + +# Examples: +# Fedora 23/x86-64/gcc-5.3.1: 61 64 63 67 52 33 30 35 +# Debian 8 PPC64/gcc-4.9.2 : 67 63 64 61 34 30 39 2a +0 lelong 0x67636461 GCC gcda coverage (-fprofile-arcs), +>&3 byte x version %c. +>&1 byte x \b%c + +# big endian +0 belong 0x67636461 GCC gcda coverage (-fprofile-arcs), +>&0 byte x version %c. +>&2 byte x \b%c (big-endian) + + +# LCOV tracefiles +# cf. http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php +0 string TN: +>&0 search/64 \nSF:/ LCOV coverage tracefile + + +# Coverage reports generated by gcov +# i.e. source code annoted with coverage information +0 string \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Source: +>&0 search/128 \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Graph: +>>&0 search/128 \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Data: GCOV coverage report + + +# LLVM coverage files + +# raw data after running a program compiled with: +# `clang -fprofile-instr-generate -fcoverage-mapping ...` +# default name: default.profraw +# magic is: \xFF lprofr \x81 +# cf. http://llvm.org/docs/doxygen/html/InstrProfData_8inc_source.html +0 lequad 0xff6c70726f667281 LLVM raw profile data, +>&0 byte x version %d + +# big endian +0 bequad 0xff6c70726f667281 LLVM raw profile data, +>&7 byte x version %d (big-endian) + + +# LLVM indexed instruction profile (as generated by llvm-profdata) +# magic is: reverse(\xFF lprofi \x81) +# cf. http://llvm.org/docs/CoverageMappingFormat.html +# http://llvm.org/docs/doxygen/html/namespacellvm_1_1IndexedInstrProf.html +# http://llvm.org/docs/CommandGuide/llvm-cov.html +# http://llvm.org/docs/CommandGuide/llvm-profdata.html +0 lequad 0x8169666f72706cff LLVM indexed profile data, +>&0 byte x version %d + +# big endian +0 bequad 0x8169666f72706cff LLVM indexed profile data, +>&7 byte x version %d (big-endian) + Modified: stable/9/contrib/file/magic/Magdir/database ============================================================================== --- stable/9/contrib/file/magic/Magdir/database Mon Jul 25 03:58:19 2016 (r303285) +++ stable/9/contrib/file/magic/Magdir/database Mon Jul 25 05:33:19 2016 (r303286) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: database,v 1.48 2016/04/14 20:34:28 christos Exp $ +# $File: database,v 1.49 2016/06/11 17:01:51 christos Exp $ # database: file(1) magic for various databases # # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk) @@ -611,3 +611,14 @@ !:ext pan # database name >>>5 pstring x \b, "%s" + +# +# +# askSam Database by Stefan A. Haubenthal +0 string askw40\0 askSam DB + +# +# +# MUIbase Database Tool by Stefan A. Haubenthal +0 string MBSTV\040 MUIbase DB +>6 string x version %s Modified: stable/9/contrib/file/magic/Magdir/elf ============================================================================== --- stable/9/contrib/file/magic/Magdir/elf Mon Jul 25 03:58:19 2016 (r303285) +++ stable/9/contrib/file/magic/Magdir/elf Mon Jul 25 05:33:19 2016 (r303286) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: elf,v 1.69 2015/06/16 17:23:08 christos Exp $ +# $File: elf,v 1.70 2016/06/02 12:36:30 christos Exp $ # elf: file(1) magic for ELF executables # # We have to check the byte order flag to see what byte order all the @@ -301,25 +301,23 @@ >>0 use elf-le >5 byte 2 MSB >>0 use \^elf-le -# Up to now only 0, 1 and 2 are defined; I've seen a file with 0x83, it seemed -# like proper ELF, but extracting the string had bad results. ->4 byte <0x80 ->>8 string >\0 (%s) ->8 string \0 ->>7 byte 0 (SYSV) ->>7 byte 1 (HP-UX) ->>7 byte 2 (NetBSD) ->>7 byte 3 (GNU/Linux) ->>7 byte 4 (GNU/Hurd) ->>7 byte 5 (86Open) ->>7 byte 6 (Solaris) ->>7 byte 7 (Monterey) ->>7 byte 8 (IRIX) ->>7 byte 9 (FreeBSD) ->>7 byte 10 (Tru64) ->>7 byte 11 (Novell Modesto) ->>7 byte 12 (OpenBSD) ->8 string \2 ->>7 byte 13 (OpenVMS) ->>7 byte 97 (ARM) ->>7 byte 255 (embedded) +>7 byte 0 (SYSV) +>7 byte 1 (HP-UX) +>7 byte 2 (NetBSD) +>7 byte 3 (GNU/Linux) +>7 byte 4 (GNU/Hurd) +>7 byte 5 (86Open) +>7 byte 6 (Solaris) +>7 byte 7 (Monterey) +>7 byte 8 (IRIX) +>7 byte 9 (FreeBSD) +>7 byte 10 (Tru64) +>7 byte 11 (Novell Modesto) +>7 byte 12 (OpenBSD) +>7 byte 13 (OpenVMS) +>7 byte 14 (HP NonStop Kernel) +>7 byte 15 (AROS Research Operating System) +>7 byte 16 (FenixOS) +>7 byte 17 (Nuxi CloudABI) +>7 byte 97 (ARM) +>7 byte 255 (embedded) Modified: stable/9/contrib/file/magic/Magdir/msdos ============================================================================== --- stable/9/contrib/file/magic/Magdir/msdos Mon Jul 25 03:58:19 2016 (r303285) +++ stable/9/contrib/file/magic/Magdir/msdos Mon Jul 25 05:33:19 2016 (r303286) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: msdos,v 1.105 2016/03/03 18:58:14 christos Exp $ +# $File: msdos,v 1.106 2016/06/11 00:52:14 christos Exp $ # msdos: file(1) magic for MS-DOS files # @@ -633,47 +633,86 @@ 0 string/b \102\101\050\000\000\000\056\000\000\000\000\000\000\000 Icon for MS Windows # Windows icons -0 name ico-dir -# not entirely accurate, the number of icons is part of the header ->0 byte 1 - 1 icon ->0 ubyte >1 - %d icons ->2 byte 0 \b, 256x ->2 byte !0 \b, %dx ->3 byte 0 \b256 ->3 byte !0 \b%d ->4 ubyte !0 \b, %d colors - +# Update: Joerg Jenderek +# URL: https://en.wikipedia.org/wiki/CUR_(file_format) +# Note: similiar to Windows CURsor. container for BMP (only DIB part) or PNG 0 belong 0x00000100 >9 byte 0 ->>0 byte x MS Windows icon resource -!:mime image/x-icon ->>4 use ico-dir +>>0 byte x +>>0 use cur-ico-dir >9 ubyte 0xff ->>0 byte x MS Windows icon resource -!:mime image/x-icon ->>4 use ico-dir +>>0 byte x +>>0 use cur-ico-dir +# displays number of icons and information for icon or cursor +0 name cur-ico-dir +# skip some Lotus 1-2-3 worksheets, CYCLE.PIC and keep Windows cursors with +# 1st data offset = dir header size + n * dir entry size = 6 + n * 10h = ?6h +>18 ulelong &0x00000006 +# skip remaining worksheets, because valid only for DIB image (40) or PNG image (\x89PNG) +>>(18.l) ulelong x MS Windows +>>>0 ubelong 0x00000100 icon resource +#!:mime image/vnd.microsoft.icon +!:mime image/x-icon +!:ext ico +>>>>4 uleshort x - %d icon +# plural s +>>>>4 uleshort >1 \bs +# 1st icon +>>>>0x06 use ico-entry +# 2nd icon +>>>>4 uleshort >1 +>>>>>0x16 use ico-entry +>>>0 ubelong 0x00000200 cursor resource +#!:mime image/x-cur +!:mime image/x-win-bitmap +!:ext cur +>>>>4 uleshort x - %d icon +>>>>4 uleshort >1 \bs +# 1st cursor +>>>>0x06 use cur-entry +#>>>>0x16 use cur-entry +# display information of one cursor entry +0 name cur-entry +>0 use cur-ico-entry +>4 uleshort x \b, hotspot @%dx +>6 uleshort x \b%d +# display information of one icon entry +0 name ico-entry +>0 use cur-ico-entry +# normally 0 1 but also found 14 +>4 uleshort >1 \b, %d planes +# normally 0 1 but also found some 3, 4, some 6, 8, 24, many 32, two 256 +>6 uleshort >1 \b, %d bits/pixel +# display shared information of cursor or icon entry +0 name cur-ico-entry +>0 byte =0 \b, 256x +>0 byte !0 \b, %dx +>1 byte =0 \b256 +>1 byte !0 \b%d +# number of colors in palette +>2 ubyte !0 \b, %d colors +# reserved 0 FFh +#>3 ubyte x \b, reserved %x +#>8 ulelong x \b, image size %d +# offset of PNG or DIB image +#>12 ulelong x \b, offset 0x%x +# PNG header (\x89PNG) +>(12.l) ubelong =0x89504e47 +>>&-4 indirect x \b with +# DIB image +>(12.l) ubelong !0x89504e47 +#>>&-4 use dib-image # Windows non-animated cursors -0 name cur-dir -# not entirely accurate, the number of icons is part of the header ->0 byte 1 - 1 icon ->0 ubyte >1 - %d icons ->2 byte 0 \b, 256x ->2 byte !0 \b, %dx ->3 byte 0 \b256 ->3 byte !0 \b%d ->6 uleshort x \b, hotspot @%dx ->8 uleshort x \b%d - +# Update: Joerg Jenderek +# URL: https://en.wikipedia.org/wiki/CUR_(file_format) +# Note: similiar to Windows ICOn. container for BMP ( only DIB part) +# GRR: line below is too general as it catches also Lotus 1-2-3 files 0 belong 0x00000200 >9 byte 0 ->>0 byte x MS Windows cursor resource -!:mime image/x-cur ->>4 use cur-dir +>>0 use cur-ico-dir >9 ubyte 0xff ->>0 byte x MS Windows cursor resource -!:mime image/x-cur ->>4 use cur-dir +>>0 use cur-ico-dir # .chr files 0 string/b PK\010\010BGI Borland font Modified: stable/9/contrib/file/magic/Magdir/msx ============================================================================== --- stable/9/contrib/file/magic/Magdir/msx Mon Jul 25 03:58:19 2016 (r303285) +++ stable/9/contrib/file/magic/Magdir/msx Mon Jul 25 05:33:19 2016 (r303286) @@ -1,7 +1,7 @@ #------------------------------------------------------------------------------ # msx: file(1) magic for the MSX Home Computer -# v1.1 +# v1.3 # Fabio R. Schmidlin ############## MSX Music file formats ############## @@ -99,34 +99,6 @@ >>5 uleshort 0 >>>3 uleshort >0x013D MSX Graph Saurus compressed image -# Maki-chan Graphic format -0 string/b MAKI02\ \ Maki-chan image, ->8 byte x system ID: %c ->9 byte x \b%c ->10 byte x \b%c ->11 byte x \b%c, ->13 search/0x200 \x1A -# >>&3 ubyte 0 , video mode: PC-98 400 lines, 16 analog colors -# >>&3 ubyte 1 , video mode: MSX SC7, 16 analog colors -# >>&3 ubyte 2 , video mode: VM-98 400 lines, 8 analog colors -# >>&3 ubyte 3 , video mode: PC-88 analog, 200 lines, 8 analog colors -# >>&3 ubyte 4 , video mode: 400 lines, 16 digital colors -# >>&3 ubyte 5 , video mode: 200 lines, 16 digital colors -# >>&3 ubyte 6 , video mode: old PC-98 digital 400 lines, 8 colors -# >>&3 ubyte 7 , video mode: PC-88 400 lines, 8 digital colors ->>&8 uleshort+1 x %dx ->>&10 uleshort+1 x \b%d, ->>&3 ubyte&0x82 0x80 256 colors ->>&3 ubyte&0x82 0x00 16 colors ->>&3 ubyte&0x82 0x01 8 colors ->>&3 ubyte&0x04 4 digital ->>&3 ubyte&0x04 0 analog ->>&3 ubyte&0x01 1 \b, 2:1 dot aspect ratio - -# Japanese PIC file -0 string/b PIC\x1A ->4 lelong 0 Japanese PIC image file - # MSX G9B image file 0 string/b G9B >1 uleshort 11 @@ -146,70 +118,152 @@ ############## Other MSX file formats ############## -# MSX ROMs +# MSX internal ROMs +0 ubeshort 0xF3C3 +>2 uleshort <0x4000 +>>8 ubyte 0xC3 +>>>9 uleshort <0x4000 +>>>>0x0B ubeshort 0x00C3 +>>>>>0x0D uleshort <0x4000 +>>>>>>0x0F ubeshort 0x00C3 +>>>>>>>0x11 uleshort <0x4000 +>>>>>>>>0x13 ubeshort 0x00C3 +>>>>>>>>>0x15 uleshort <0x4000 +>>>>>>>>>>0x50 ubyte 0xC3 +>>>>>>>>>>>0x51 uleshort <0x4000 +>>>>>>>>>>>>(9.s) ubyte 0xC3 +>>>>>>>>>>>>>&0 uleshort >0x4000 +>>>>>>>>>>>>>>&0 ubyte 0xC3 MSX BIOS+BASIC +>>>>>>>>>>>>>>>0x002D ubyte+1 <3 \b. version=MSX%d +>>>>>>>>>>>>>>>0x002D ubyte 2 \b, version=MSX2+ +>>>>>>>>>>>>>>>0x002D ubyte 3 \b, version=MSX Turbo-R +>>>>>>>>>>>>>>>0x002D ubyte >3 \b, version=Unknown MSX %d version +>>>>>>>>>>>>>>>0x0006 ubyte x \b, VDP.DR=0x%2x +>>>>>>>>>>>>>>>0x0007 ubyte x \b, VDP.DW=0x%2x +>>>>>>>>>>>>>>>0x002B ubyte&0xF 0 \b, charset=Japanese +>>>>>>>>>>>>>>>0x002B ubyte&0xF 1 \b, charset=International +>>>>>>>>>>>>>>>0x002B ubyte&0xF 2 \b, charset=Korean +>>>>>>>>>>>>>>>0x002B ubyte&0xF >2 \b, charset=Unknown id:%d +>>>>>>>>>>>>>>>0x002B ubyte&0x70 0x00 \b, date format=Y-M-D +>>>>>>>>>>>>>>>0x002B ubyte&0x70 0x10 \b, date format=M-D-Y +>>>>>>>>>>>>>>>0x002B ubyte&0x70 0x20 \b, date format=D-M-Y +>>>>>>>>>>>>>>>0x002B ubyte&0x80 0x00 \b, vfreq=60Hz +>>>>>>>>>>>>>>>0x002B ubyte&0x80 0x80 \b, vfreq=50Hz +>>>>>>>>>>>>>>>0x002C ubyte&0x0F 0 \b, keyboard=Japanese +>>>>>>>>>>>>>>>0x002C ubyte&0x0F 1 \b, keyboard=International +>>>>>>>>>>>>>>>0x002C ubyte&0x0F 2 \b, keyboard=French +>>>>>>>>>>>>>>>0x002C ubyte&0x0F 3 \b, keyboard=UK +>>>>>>>>>>>>>>>0x002C ubyte&0x0F 4 \b, keyboard=German +>>>>>>>>>>>>>>>0x002C ubyte&0x0F 5 \b, keyboard=Unknown id:%d +>>>>>>>>>>>>>>>0x002C ubyte&0x0F 6 \b, keyboard=Spanish +>>>>>>>>>>>>>>>0x002C ubyte&0x0F >6 \b, keyboard=Unknown id:%d +>>>>>>>>>>>>>>>0x002C ubyte&0xF0 0x00 \b, basic=Japanese +>>>>>>>>>>>>>>>0x002C ubyte&0xF0 0x10 \b, basic=International +>>>>>>>>>>>>>>>0x002C ubyte&0xF0 >0x10 \b, basic=Unknown id:%d +>>>>>>>>>>>>>>>0x002E ubyte&1 1 \b, built-in MIDI + + +0 string/b CD +>2 uleshort >0x10 +>>2 uleshort <0x4000 +>>>4 uleshort <0x4000 +>>>>6 uleshort <0x4000 +>>>>>8 ubyte 0xC3 +>>>>>>9 uleshort <0x4000 +>>>>>>>0x10 ubyte 0xC3 +>>>>>>>>0x11 uleshort <0x4000 +>>>>>>>>>0x14 ubyte 0xC3 +>>>>>>>>>>0x15 uleshort <0x4000 MSX2/2+/TR SubROM + +0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 +>0x5F0 ubequad 0x8282828244380000 +>>0x150 ubyte 0x38 +>>>0x170 string \20\20\20 +>>>>0x1E32 string ()) +>>>>>0x2130 ubequad 0xA5A5594924231807 +>>>>>0x2138 ubequad 0x4A4A3424488830C0 MSX Kanji Font + + + +# MSX extension ROMs 0 string/b AB >2 uleshort 0x0010 MSX ROM >>2 uleshort x \b, init=0x%4x ->>4 uleshort >0 \b, stat=0x%4x ->>6 uleshort >0 \b, dev=0x%4x +>>4 uleshort >0 \b, stahdl=0x%4x +>>6 uleshort >0 \b, devhdl=0x%4x >>8 uleshort >0 \b, bas=0x%4x >2 uleshort 0x4010 MSX ROM >>2 uleshort x \b, init=0x%04x ->>4 uleshort >0 \b, stat=0x%04x ->>6 uleshort >0 \b, dev=0x%04x +>>4 uleshort >0 \b, stahdl=0x%04x +>>6 uleshort >0 \b, devhdl=0x%04x >>8 uleshort >0 \b, bas=0x%04x >2 uleshort 0x8010 MSX ROM >>2 uleshort x \b, init=0x%04x ->>4 uleshort >0 \b, stat=0x%04x ->>6 uleshort >0 \b, dev=0x%04x +>>4 uleshort >0 \b, stahdl=0x%04x +>>6 uleshort >0 \b, devhdl=0x%04x >>8 uleshort >0 \b, bas=0x%04x +0 string/b AB\0\0 +>6 uleshort 0 +>>4 uleshort >0x400F MSX-BASIC extension ROM +>>>4 uleshort >0 \b, stahdl=0x%04x +>>>6 uleshort >0 \b, devhdl=0x%04x +>>>0x1C string OPLL \b, MSX-Music +>>>>0x18 string PAC2 \b (external) +>>>>0x18 string APRL \b (internal) + +0 string/b AB\0\0\0\0 +>6 uleshort >0x400F MSX device BIOS +>>6 uleshort >0 \b, devhdl=0x%04x + 0 string/b AB #>2 string 5JSuperLAYDOCK MSX Super Laydock ROM #>3 string @HYDLIDE3MSX MSX Hydlide-3 ROM #>3 string @3\x80IA862 Golvellius MSX1 ROM ->2 uleshort >10 ->>10 string \0\0\0\0\0\0 MSX ROM ->>>0x10 string YZ\0\0\0\0 Konami Game Master 2 MSX ROM ->>>0x10 string CD \b, Konami RC- ->>>>0x12 ubyte x \b%d ->>>>0x13 ubyte/16 x \b%d ->>>>0x13 ubyte&0xF x \b%d ->>>0x10 string EF \b, Konami RC- *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Mon Jul 25 13:29:00 2016 Return-Path: Delivered-To: svn-src-stable@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 4B0D7BA3FBE; Mon, 25 Jul 2016 13:29:00 +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 163C41206; Mon, 25 Jul 2016 13:29:00 +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 u6PDSxMP020854; Mon, 25 Jul 2016 13:28:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PDSxHe020852; Mon, 25 Jul 2016 13:28:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607251328.u6PDSxHe020852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 25 Jul 2016 13:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303290 - in stable/11/sys: kern vm X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 13:29:00 -0000 Author: kib Date: Mon Jul 25 13:28:59 2016 New Revision: 303290 URL: https://svnweb.freebsd.org/changeset/base/303290 Log: MFC r302567: In vgonel(), postpone setting BO_DEAD until VOP_RECLAIM() is called, if vnode is VMIO. For VMIO vnodes, set BO_DEAD in vm_object_terminate(). MFC r302580: Fix grammar. Approved by: re (gjb) Modified: stable/11/sys/kern/vfs_subr.c stable/11/sys/vm/vm_object.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Mon Jul 25 11:25:33 2016 (r303289) +++ stable/11/sys/kern/vfs_subr.c Mon Jul 25 13:28:59 2016 (r303290) @@ -3232,7 +3232,13 @@ vgonel(struct vnode *vp) TAILQ_EMPTY(&vp->v_bufobj.bo_clean.bv_hd) && vp->v_bufobj.bo_clean.bv_cnt == 0, ("vp %p bufobj not invalidated", vp)); - vp->v_bufobj.bo_flag |= BO_DEAD; + + /* + * For VMIO bufobj, BO_DEAD is set in vm_object_terminate() + * after the object's page queue is flushed. + */ + if (vp->v_bufobj.bo_object == NULL) + vp->v_bufobj.bo_flag |= BO_DEAD; BO_UNLOCK(&vp->v_bufobj); /* Modified: stable/11/sys/vm/vm_object.c ============================================================================== --- stable/11/sys/vm/vm_object.c Mon Jul 25 11:25:33 2016 (r303289) +++ stable/11/sys/vm/vm_object.c Mon Jul 25 13:28:59 2016 (r303290) @@ -741,6 +741,10 @@ vm_object_terminate(vm_object_t object) vinvalbuf(vp, V_SAVE, 0, 0); + BO_LOCK(&vp->v_bufobj); + vp->v_bufobj.bo_flag |= BO_DEAD; + BO_UNLOCK(&vp->v_bufobj); + VM_OBJECT_WLOCK(object); } From owner-svn-src-stable@freebsd.org Mon Jul 25 13:31:19 2016 Return-Path: Delivered-To: svn-src-stable@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 694FFBA40F9; Mon, 25 Jul 2016 13:31:19 +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 3A10F1517; Mon, 25 Jul 2016 13:31:19 +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 u6PDVI0Q021571; Mon, 25 Jul 2016 13:31:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PDVIPV021569; Mon, 25 Jul 2016 13:31:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607251331.u6PDVIPV021569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 25 Jul 2016 13:31: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: r303291 - in stable/10/sys: kern vm 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 13:31:19 -0000 Author: kib Date: Mon Jul 25 13:31:18 2016 New Revision: 303291 URL: https://svnweb.freebsd.org/changeset/base/303291 Log: MFC r302567: In vgonel(), postpone setting BO_DEAD until VOP_RECLAIM() is called, if vnode is VMIO. For VMIO vnodes, set BO_DEAD in vm_object_terminate(). MFC r302580: Fix grammar. Modified: stable/10/sys/kern/vfs_subr.c stable/10/sys/vm/vm_object.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Mon Jul 25 13:28:59 2016 (r303290) +++ stable/10/sys/kern/vfs_subr.c Mon Jul 25 13:31:18 2016 (r303291) @@ -2934,7 +2934,13 @@ vgonel(struct vnode *vp) TAILQ_EMPTY(&vp->v_bufobj.bo_clean.bv_hd) && vp->v_bufobj.bo_clean.bv_cnt == 0, ("vp %p bufobj not invalidated", vp)); - vp->v_bufobj.bo_flag |= BO_DEAD; + + /* + * For VMIO bufobj, BO_DEAD is set in vm_object_terminate() + * after the object's page queue is flushed. + */ + if (vp->v_bufobj.bo_object == NULL) + vp->v_bufobj.bo_flag |= BO_DEAD; BO_UNLOCK(&vp->v_bufobj); /* Modified: stable/10/sys/vm/vm_object.c ============================================================================== --- stable/10/sys/vm/vm_object.c Mon Jul 25 13:28:59 2016 (r303290) +++ stable/10/sys/vm/vm_object.c Mon Jul 25 13:31:18 2016 (r303291) @@ -737,6 +737,10 @@ vm_object_terminate(vm_object_t object) vinvalbuf(vp, V_SAVE, 0, 0); + BO_LOCK(&vp->v_bufobj); + vp->v_bufobj.bo_flag |= BO_DEAD; + BO_UNLOCK(&vp->v_bufobj); + VM_OBJECT_WLOCK(object); } From owner-svn-src-stable@freebsd.org Mon Jul 25 14:16:30 2016 Return-Path: Delivered-To: svn-src-stable@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 0D665BA4A7A; Mon, 25 Jul 2016 14:16:30 +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 B4BBB1C3F; Mon, 25 Jul 2016 14:16: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 u6PEGSKH038883; Mon, 25 Jul 2016 14:16:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PEGSts038882; Mon, 25 Jul 2016 14:16:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607251416.u6PEGSts038882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 25 Jul 2016 14:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303292 - stable/11/contrib/libcxxrt X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 14:16:30 -0000 Author: emaste Date: Mon Jul 25 14:16:28 2016 New Revision: 303292 URL: https://svnweb.freebsd.org/changeset/base/303292 Log: MFC r303157: libcxxrt: add padding in __cxa_allocate_* to fix alignment The addition of the referenceCount to __cxa_allocate_exception put the unwindHeader at offset 0x58 in __cxa_exception, but it requires 16-byte alignment. In order to avoid changing the current __cxa_exception ABI (and thus breaking its consumers), add explicit padding in the allocation routines (and account for it when freeing). This is intended as a lower-risk change for FreeBSD 11. A "more correct" fix should be prepared for upstream and -CURRENT. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/libcxxrt/exception.cc Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libcxxrt/exception.cc ============================================================================== --- stable/11/contrib/libcxxrt/exception.cc Mon Jul 25 13:31:18 2016 (r303291) +++ stable/11/contrib/libcxxrt/exception.cc Mon Jul 25 14:16:28 2016 (r303292) @@ -572,6 +572,19 @@ static void free_exception(char *e) } } +#ifdef __LP64__ +/** + * There's an ABI bug in __cxa_exception: unwindHeader requires 16-byte + * alignment but it was broken by the addition of the referenceCount. + * The unwindHeader is at offset 0x58 in __cxa_exception. In order to keep + * compatibility with consumers of the broken __cxa_exception, explicitly add + * padding on allocation (and account for it on free). + */ +static const int exception_alignment_padding = 8; +#else +static const int exception_alignment_padding = 0; +#endif + /** * Allocates an exception structure. Returns a pointer to the space that can * be used to store an object of thrown_size bytes. This function will use an @@ -580,16 +593,19 @@ static void free_exception(char *e) */ extern "C" void *__cxa_allocate_exception(size_t thrown_size) { - size_t size = thrown_size + sizeof(__cxa_exception); + size_t size = exception_alignment_padding + sizeof(__cxa_exception) + + thrown_size; char *buffer = alloc_or_die(size); - return buffer+sizeof(__cxa_exception); + return buffer + exception_alignment_padding + sizeof(__cxa_exception); } extern "C" void *__cxa_allocate_dependent_exception(void) { - size_t size = sizeof(__cxa_dependent_exception); + size_t size = exception_alignment_padding + + sizeof(__cxa_dependent_exception); char *buffer = alloc_or_die(size); - return buffer+sizeof(__cxa_dependent_exception); + return buffer + exception_alignment_padding + + sizeof(__cxa_dependent_exception); } /** @@ -617,7 +633,8 @@ extern "C" void __cxa_free_exception(voi } } - free_exception(reinterpret_cast(ex)); + free_exception(reinterpret_cast(ex) - + exception_alignment_padding); } static void releaseException(__cxa_exception *exception) @@ -644,7 +661,8 @@ void __cxa_free_dependent_exception(void { releaseException(realExceptionFromException(reinterpret_cast<__cxa_exception*>(ex))); } - free_exception(reinterpret_cast(ex)); + free_exception(reinterpret_cast(ex) - + exception_alignment_padding); } /** From owner-svn-src-stable@freebsd.org Mon Jul 25 14:26:35 2016 Return-Path: Delivered-To: svn-src-stable@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 0C3B2BA4C5F; Mon, 25 Jul 2016 14:26:35 +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 B8CEC12CC; Mon, 25 Jul 2016 14:26: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 u6PEQX5g042846; Mon, 25 Jul 2016 14:26:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PEQXKV042845; Mon, 25 Jul 2016 14:26:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607251426.u6PEQXKV042845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 25 Jul 2016 14:26: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: r303293 - stable/10/lib/libcxxrt 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 14:26:35 -0000 Author: emaste Date: Mon Jul 25 14:26:33 2016 New Revision: 303293 URL: https://svnweb.freebsd.org/changeset/base/303293 Log: MFC r302278: libcxxrt: correct mangled "typeinfo name" symbols in Version.map r261644 (MFC of r260553) added missing C++ typinfos to libcxxrt's version script. It appears that a number of duplicate mangled symbols were added due to a cut and paste error. Switch the second instances to _ZTS*, typeinfo name for *. Found by lld, which produces an error or warning for duplicate symbols. Sponsored by: The FreeBSD Foundation Modified: stable/10/lib/libcxxrt/Version.map Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcxxrt/Version.map ============================================================================== --- stable/10/lib/libcxxrt/Version.map Mon Jul 25 14:16:28 2016 (r303292) +++ stable/10/lib/libcxxrt/Version.map Mon Jul 25 14:26:33 2016 (r303293) @@ -209,19 +209,19 @@ CXXABI_1.3 { "typeinfo name for void*"; "typeinfo name for unsigned int*"; "typeinfo name for float*"; - # C++11 typeinfo not understood by our linker + # C++11 typeinfo name not understood by our linker # std::nullptr_t - _ZTSDn;_ZTIPDn;_ZTIPKDn; + _ZTSDn;_ZTSPDn;_ZTSPKDn; # char16_t - _ZTSDi;_ZTIPDi;_ZTIPKDi; + _ZTSDi;_ZTSPDi;_ZTSPKDi; # char32_t - _ZTSDs;_ZTIPDs;_ZTIPKDs; + _ZTSDs;_ZTSPDs;_ZTSPKDs; # IEEE 754r decimal floating point - _ZTSDd;_ZTIPDd;_ZTIPKDd; - _ZTSDe;_ZTIPDe;_ZTIPKDe; - _ZTSDf;_ZTIPDf;_ZTIPKDf; + _ZTSDd;_ZTSPDd;_ZTSPKDd; + _ZTSDe;_ZTSPDe;_ZTSPKDe; + _ZTSDf;_ZTSPDf;_ZTSPKDf; # IEEE 754r half-precision floating point - _ZTSDh;_ZTIPDh;_ZTIPKDh; + _ZTSDh;_ZTSPDh;_ZTSPKDh; "typeinfo name for __cxxabiv1::__array_type_info"; "typeinfo name for __cxxabiv1::__class_type_info"; From owner-svn-src-stable@freebsd.org Mon Jul 25 14:28:51 2016 Return-Path: Delivered-To: svn-src-stable@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 58943BA4D12; Mon, 25 Jul 2016 14:28: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 2AFF214D0; Mon, 25 Jul 2016 14:28: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 u6PESodI042981; Mon, 25 Jul 2016 14:28:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PESo3s042980; Mon, 25 Jul 2016 14:28:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607251428.u6PESo3s042980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 25 Jul 2016 14:28: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: r303294 - 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 14:28:51 -0000 Author: emaste Date: Mon Jul 25 14:28:50 2016 New Revision: 303294 URL: https://svnweb.freebsd.org/changeset/base/303294 Log: MFC r302335: boot1.efi: fix assignment / comparison expression PR: 210706 Submitted by: David Binderman Modified: stable/10/sys/boot/efi/boot1/boot1.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Mon Jul 25 14:26:33 2016 (r303293) +++ stable/10/sys/boot/efi/boot1/boot1.c Mon Jul 25 14:28:50 2016 (r303294) @@ -629,7 +629,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_T case EFI_BUFFER_TOO_SMALL: (void)bs->FreePool(handles); if ((status = bs->AllocatePool(EfiLoaderData, hsize, - (void **)&handles) != EFI_SUCCESS)) { + (void **)&handles)) != EFI_SUCCESS) { panic("Failed to allocate %zu handles (%lu)", hsize / sizeof(*handles), EFI_ERROR_CODE(status)); } From owner-svn-src-stable@freebsd.org Mon Jul 25 14:35:15 2016 Return-Path: Delivered-To: svn-src-stable@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 611FDBA4F12; Mon, 25 Jul 2016 14:35:15 +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 1B2F919A2; Mon, 25 Jul 2016 14:35:15 +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 u6PEZEQx046537; Mon, 25 Jul 2016 14:35:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PEZE3C046535; Mon, 25 Jul 2016 14:35:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607251435.u6PEZE3C046535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 25 Jul 2016 14:35: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: r303295 - stable/10/usr.bin/ar 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 14:35:15 -0000 Author: emaste Date: Mon Jul 25 14:35:14 2016 New Revision: 303295 URL: https://svnweb.freebsd.org/changeset/base/303295 Log: MFC r301974: ar: enable reproducible output by default when invoked as 'ar -s' ar output is already deterministic by default for ar -q and ar -r, and when invoked as ranlib. Make ar -s equivalent to ranlib and enable deterministic output by default in that case too. PR: 210330 Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/ar/ar.1 stable/10/usr.bin/ar/ar.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/ar/ar.1 ============================================================================== --- stable/10/usr.bin/ar/ar.1 Mon Jul 25 14:28:50 2016 (r303294) +++ stable/10/usr.bin/ar/ar.1 Mon Jul 25 14:35:14 2016 (r303295) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 24, 2015 +.Dd July 25, 2016 .Dt AR 1 .Os .Sh NAME @@ -205,7 +205,12 @@ When used in combination with the .Fl r or .Fl q -option, insert 0's instead of the real mtime, uid and gid values +option, +with the +.Fl s +option without other options, or when invoked as +.Nm ranlib , +insert 0's instead of the real mtime, uid and gid values and 0644 instead of file mode from the members named by arguments .Ar . This ensures that checksums on the resulting archives are reproducible Modified: stable/10/usr.bin/ar/ar.c ============================================================================== --- stable/10/usr.bin/ar/ar.c Mon Jul 25 14:28:50 2016 (r303294) +++ stable/10/usr.bin/ar/ar.c Mon Jul 25 14:35:14 2016 (r303295) @@ -283,7 +283,8 @@ main(int argc, char **argv) } /* Set determinstic mode for -D, and by default without -U. */ - if (Dflag || (Uflag == 0 && (bsdar->mode == 'q' || bsdar->mode == 'r'))) + if (Dflag || (Uflag == 0 && (bsdar->mode == 'q' || bsdar->mode == 'r' || + (bsdar->mode == '\0' && bsdar->options & AR_S)))) bsdar->options |= AR_D; if (bsdar->options & AR_A) From owner-svn-src-stable@freebsd.org Mon Jul 25 14:35:49 2016 Return-Path: Delivered-To: svn-src-stable@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 B6522BA4F80; Mon, 25 Jul 2016 14:35:49 +0000 (UTC) (envelope-from delphij@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 870271B01; Mon, 25 Jul 2016 14:35:49 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PEZmgg046618; Mon, 25 Jul 2016 14:35:48 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PEZmR4046617; Mon, 25 Jul 2016 14:35:48 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201607251435.u6PEZmR4046617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 25 Jul 2016 14:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303296 - stable/11/usr.bin/mail X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 14:35:49 -0000 Author: delphij Date: Mon Jul 25 14:35:48 2016 New Revision: 303296 URL: https://svnweb.freebsd.org/changeset/base/303296 Log: MFC r302542: Use _PATH_DEVNULL instead of hardcoding. Approved by: re (kib) Modified: stable/11/usr.bin/mail/collect.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/mail/collect.c ============================================================================== --- stable/11/usr.bin/mail/collect.c Mon Jul 25 14:35:14 2016 (r303295) +++ stable/11/usr.bin/mail/collect.c Mon Jul 25 14:35:48 2016 (r303296) @@ -339,9 +339,9 @@ cont: int nullfd, tempfd, rc; char tempname2[PATHSIZE]; - if ((nullfd = open("/dev/null", O_RDONLY, 0)) + if ((nullfd = open(_PATH_DEVNULL, O_RDONLY, 0)) == -1) { - warn("/dev/null"); + warn(_PATH_DEVNULL); break; } From owner-svn-src-stable@freebsd.org Mon Jul 25 14:36:57 2016 Return-Path: Delivered-To: svn-src-stable@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 12878BA3049; Mon, 25 Jul 2016 14:36: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 D905F1C94; Mon, 25 Jul 2016 14:36:56 +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 u6PEaugv046710; Mon, 25 Jul 2016 14:36:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PEau7O046709; Mon, 25 Jul 2016 14:36:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607251436.u6PEau7O046709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 25 Jul 2016 14:36: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: r303297 - 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 14:36:57 -0000 Author: emaste Date: Mon Jul 25 14:36:55 2016 New Revision: 303297 URL: https://svnweb.freebsd.org/changeset/base/303297 Log: MFC r297871: boot1.efifat: provide a fallback startup.nsh In case the firmware falls through to executing startup.sh, populate it with the name of our boot loader. In normal operation this should not be necessary but may allow the system to boot if it would otherwise just remain at a shell prompt. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/boot/efi/boot1/generate-fat.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/generate-fat.sh ============================================================================== --- stable/10/sys/boot/efi/boot1/generate-fat.sh Mon Jul 25 14:35:48 2016 (r303296) +++ stable/10/sys/boot/efi/boot1/generate-fat.sh Mon Jul 25 14:36:55 2016 (r303297) @@ -41,6 +41,8 @@ mkdir -p stub/efi/boot # Make a dummy file for boot1 echo 'Boot1 START' | dd of=stub/efi/boot/$FILENAME cbs=$BOOT1_SIZE count=1 conv=block +# Provide a fallback startup.nsh +echo $FILENAME > stub/efi/boot/startup.nsh umount stub mdconfig -d -u $DEVICE From owner-svn-src-stable@freebsd.org Mon Jul 25 14:52:13 2016 Return-Path: Delivered-To: svn-src-stable@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 C6A96BA34A5; Mon, 25 Jul 2016 14:52:13 +0000 (UTC) (envelope-from delphij@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 990181A63; Mon, 25 Jul 2016 14:52:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PEqCnd054009; Mon, 25 Jul 2016 14:52:12 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PEqC4t054008; Mon, 25 Jul 2016 14:52:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201607251452.u6PEqC4t054008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 25 Jul 2016 14:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303300 - stable/11/usr.bin/bsdiff/bspatch X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 14:52:13 -0000 Author: delphij Date: Mon Jul 25 14:52:12 2016 New Revision: 303300 URL: https://svnweb.freebsd.org/changeset/base/303300 Log: Fix bspatch heap overflow vulnerability. Obtained from: Chromium Reported by: Lu Tung-Pin Security: FreeBSD-SA-16:25.bspatch Approved by: re (so@ blanket) Modified: stable/11/usr.bin/bsdiff/bspatch/bspatch.c Modified: stable/11/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- stable/11/usr.bin/bsdiff/bspatch/bspatch.c Mon Jul 25 14:49:15 2016 (r303299) +++ stable/11/usr.bin/bsdiff/bspatch/bspatch.c Mon Jul 25 14:52:12 2016 (r303300) @@ -164,6 +164,10 @@ int main(int argc,char * argv[]) } /* Sanity-check */ + if ((ctrl[0] < 0) || (ctrl[1] < 0)) + errx(1,"Corrupt patch\n"); + + /* Sanity-check */ if(newpos+ctrl[0]>newsize) errx(1,"Corrupt patch\n"); From owner-svn-src-stable@freebsd.org Mon Jul 25 14:53:05 2016 Return-Path: Delivered-To: svn-src-stable@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 C6C1BBA361B; Mon, 25 Jul 2016 14:53:05 +0000 (UTC) (envelope-from delphij@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 961BF1CE6; Mon, 25 Jul 2016 14:53:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PEr4BP054246; Mon, 25 Jul 2016 14:53:04 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PEr4VJ054245; Mon, 25 Jul 2016 14:53:04 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201607251453.u6PEr4VJ054245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 25 Jul 2016 14:53: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: r303301 - in stable: 10/usr.bin/bsdiff/bspatch 9/usr.bin/bsdiff/bspatch 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 14:53:05 -0000 Author: delphij Date: Mon Jul 25 14:53:04 2016 New Revision: 303301 URL: https://svnweb.freebsd.org/changeset/base/303301 Log: Fix bspatch heap overflow vulnerability. Obtained from: Chromium Reported by: Lu Tung-Pin Security: FreeBSD-SA-16:25.bspatch Modified: stable/10/usr.bin/bsdiff/bspatch/bspatch.c Changes in other areas also in this revision: Modified: stable/9/usr.bin/bsdiff/bspatch/bspatch.c Modified: stable/10/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- stable/10/usr.bin/bsdiff/bspatch/bspatch.c Mon Jul 25 14:52:12 2016 (r303300) +++ stable/10/usr.bin/bsdiff/bspatch/bspatch.c Mon Jul 25 14:53:04 2016 (r303301) @@ -155,6 +155,10 @@ int main(int argc,char * argv[]) }; /* Sanity-check */ + if ((ctrl[0] < 0) || (ctrl[1] < 0)) + errx(1,"Corrupt patch\n"); + + /* Sanity-check */ if(newpos+ctrl[0]>newsize) errx(1,"Corrupt patch\n"); From owner-svn-src-stable@freebsd.org Mon Jul 25 14:53:05 2016 Return-Path: Delivered-To: svn-src-stable@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 90B7BBA3615; Mon, 25 Jul 2016 14:53:05 +0000 (UTC) (envelope-from delphij@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 5FE331CE4; Mon, 25 Jul 2016 14:53:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PEr40R054240; Mon, 25 Jul 2016 14:53:04 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PEr4gv054239; Mon, 25 Jul 2016 14:53:04 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201607251453.u6PEr4gv054239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 25 Jul 2016 14:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r303301 - in stable: 10/usr.bin/bsdiff/bspatch 9/usr.bin/bsdiff/bspatch X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 14:53:05 -0000 Author: delphij Date: Mon Jul 25 14:53:04 2016 New Revision: 303301 URL: https://svnweb.freebsd.org/changeset/base/303301 Log: Fix bspatch heap overflow vulnerability. Obtained from: Chromium Reported by: Lu Tung-Pin Security: FreeBSD-SA-16:25.bspatch Modified: stable/9/usr.bin/bsdiff/bspatch/bspatch.c Changes in other areas also in this revision: Modified: stable/10/usr.bin/bsdiff/bspatch/bspatch.c Modified: stable/9/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- stable/9/usr.bin/bsdiff/bspatch/bspatch.c Mon Jul 25 14:52:12 2016 (r303300) +++ stable/9/usr.bin/bsdiff/bspatch/bspatch.c Mon Jul 25 14:53:04 2016 (r303301) @@ -155,6 +155,10 @@ int main(int argc,char * argv[]) }; /* Sanity-check */ + if ((ctrl[0] < 0) || (ctrl[1] < 0)) + errx(1,"Corrupt patch\n"); + + /* Sanity-check */ if(newpos+ctrl[0]>newsize) errx(1,"Corrupt patch\n"); From owner-svn-src-stable@freebsd.org Mon Jul 25 15:03:16 2016 Return-Path: Delivered-To: svn-src-stable@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 39460BA38E9; Mon, 25 Jul 2016 15:03:16 +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 01FBF1576; Mon, 25 Jul 2016 15:03:15 +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 u6PF3FjX058070; Mon, 25 Jul 2016 15:03:15 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PF3FEV058068; Mon, 25 Jul 2016 15:03:15 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607251503.u6PF3FEV058068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 25 Jul 2016 15:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303302 - stable/11/usr.bin/mail X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 15:03:16 -0000 Author: pfg Date: Mon Jul 25 15:03:14 2016 New Revision: 303302 URL: https://svnweb.freebsd.org/changeset/base/303302 Log: MFC r302911: mail(1): Avoid closing negative file descriptors. CID: 1008105, 1008106 Approved by: re (gjb) Modified: stable/11/usr.bin/mail/quit.c stable/11/usr.bin/mail/v7.local.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/mail/quit.c ============================================================================== --- stable/11/usr.bin/mail/quit.c Mon Jul 25 14:53:04 2016 (r303301) +++ stable/11/usr.bin/mail/quit.c Mon Jul 25 15:03:14 2016 (r303302) @@ -228,7 +228,8 @@ quit(void) return; } (void)Fclose(obuf); - (void)close(open(mbox, O_CREAT | O_TRUNC | O_WRONLY, 0600)); + if ((fd = open(mbox, O_CREAT | O_TRUNC | O_WRONLY, 0600)) >= 0) + (void)close(fd); if ((obuf = Fopen(mbox, "r+")) == NULL) { warn("%s", mbox); (void)Fclose(ibuf); Modified: stable/11/usr.bin/mail/v7.local.c ============================================================================== --- stable/11/usr.bin/mail/v7.local.c Mon Jul 25 14:53:04 2016 (r303301) +++ stable/11/usr.bin/mail/v7.local.c Mon Jul 25 15:03:14 2016 (r303302) @@ -68,9 +68,12 @@ findmail(char *user, char *buf, int bufl void demail(void) { + int fd; if (value("keep") != NULL || rm(mailname) < 0) - (void)close(open(mailname, O_CREAT | O_TRUNC | O_WRONLY, 0600)); + if ((fd = open(mailname, O_CREAT | O_TRUNC | O_WRONLY, 0600)) >= + 0) + (void)close(fd); } /* From owner-svn-src-stable@freebsd.org Mon Jul 25 15:04:16 2016 Return-Path: Delivered-To: svn-src-stable@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 C54E0BA39A0; Mon, 25 Jul 2016 15:04:16 +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 97AAF16DB; Mon, 25 Jul 2016 15:04:16 +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 u6PF4FAN058147; Mon, 25 Jul 2016 15:04:15 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PF4FFd058145; Mon, 25 Jul 2016 15:04:15 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607251504.u6PF4FFd058145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 25 Jul 2016 15:04: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: r303303 - stable/10/usr.bin/mail 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 15:04:16 -0000 Author: pfg Date: Mon Jul 25 15:04:15 2016 New Revision: 303303 URL: https://svnweb.freebsd.org/changeset/base/303303 Log: MFC r302911: mail(1): Avoid closing negative file descriptors. CID: 1008105, 1008106 Modified: stable/10/usr.bin/mail/quit.c stable/10/usr.bin/mail/v7.local.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mail/quit.c ============================================================================== --- stable/10/usr.bin/mail/quit.c Mon Jul 25 15:03:14 2016 (r303302) +++ stable/10/usr.bin/mail/quit.c Mon Jul 25 15:04:15 2016 (r303303) @@ -228,7 +228,8 @@ quit(void) return; } (void)Fclose(obuf); - (void)close(open(mbox, O_CREAT | O_TRUNC | O_WRONLY, 0600)); + if ((fd = open(mbox, O_CREAT | O_TRUNC | O_WRONLY, 0600)) >= 0) + (void)close(fd); if ((obuf = Fopen(mbox, "r+")) == NULL) { warn("%s", mbox); (void)Fclose(ibuf); Modified: stable/10/usr.bin/mail/v7.local.c ============================================================================== --- stable/10/usr.bin/mail/v7.local.c Mon Jul 25 15:03:14 2016 (r303302) +++ stable/10/usr.bin/mail/v7.local.c Mon Jul 25 15:04:15 2016 (r303303) @@ -68,9 +68,12 @@ findmail(char *user, char *buf, int bufl void demail(void) { + int fd; if (value("keep") != NULL || rm(mailname) < 0) - (void)close(open(mailname, O_CREAT | O_TRUNC | O_WRONLY, 0600)); + if ((fd = open(mailname, O_CREAT | O_TRUNC | O_WRONLY, 0600)) >= + 0) + (void)close(fd); } /* From owner-svn-src-stable@freebsd.org Mon Jul 25 15:05:02 2016 Return-Path: Delivered-To: svn-src-stable@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 4EE76BA3ABF; Mon, 25 Jul 2016 15:05: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 2178F1A15; Mon, 25 Jul 2016 15:05:02 +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 u6PF51Im058284; Mon, 25 Jul 2016 15:05:01 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PF51It058282; Mon, 25 Jul 2016 15:05:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607251505.u6PF51It058282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 25 Jul 2016 15:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r303305 - stable/9/usr.bin/mail X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 15:05:02 -0000 Author: pfg Date: Mon Jul 25 15:05:01 2016 New Revision: 303305 URL: https://svnweb.freebsd.org/changeset/base/303305 Log: MFC r302911: mail(1): Avoid closing negative file descriptors. CID: 1008105, 1008106 Modified: stable/9/usr.bin/mail/quit.c stable/9/usr.bin/mail/v7.local.c Directory Properties: stable/9/usr.bin/mail/ (props changed) Modified: stable/9/usr.bin/mail/quit.c ============================================================================== --- stable/9/usr.bin/mail/quit.c Mon Jul 25 15:04:17 2016 (r303304) +++ stable/9/usr.bin/mail/quit.c Mon Jul 25 15:05:01 2016 (r303305) @@ -228,7 +228,8 @@ quit(void) return; } (void)Fclose(obuf); - (void)close(open(mbox, O_CREAT | O_TRUNC | O_WRONLY, 0600)); + if ((fd = open(mbox, O_CREAT | O_TRUNC | O_WRONLY, 0600)) >= 0) + (void)close(fd); if ((obuf = Fopen(mbox, "r+")) == NULL) { warn("%s", mbox); (void)Fclose(ibuf); Modified: stable/9/usr.bin/mail/v7.local.c ============================================================================== --- stable/9/usr.bin/mail/v7.local.c Mon Jul 25 15:04:17 2016 (r303304) +++ stable/9/usr.bin/mail/v7.local.c Mon Jul 25 15:05:01 2016 (r303305) @@ -68,9 +68,12 @@ findmail(char *user, char *buf, int bufl void demail(void) { + int fd; if (value("keep") != NULL || rm(mailname) < 0) - (void)close(open(mailname, O_CREAT | O_TRUNC | O_WRONLY, 0600)); + if ((fd = open(mailname, O_CREAT | O_TRUNC | O_WRONLY, 0600)) >= + 0) + (void)close(fd); } /* From owner-svn-src-stable@freebsd.org Mon Jul 25 15:56:39 2016 Return-Path: Delivered-To: svn-src-stable@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 07450BA4557; Mon, 25 Jul 2016 15:56:39 +0000 (UTC) (envelope-from jhb@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 B1B6513D8; Mon, 25 Jul 2016 15:56:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PFubKp077246; Mon, 25 Jul 2016 15:56:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PFub3S077245; Mon, 25 Jul 2016 15:56:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607251556.u6PFub3S077245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 25 Jul 2016 15:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303306 - stable/11/lib/librt X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 15:56:39 -0000 Author: jhb Date: Mon Jul 25 15:56:37 2016 New Revision: 303306 URL: https://svnweb.freebsd.org/changeset/base/303306 Log: MFC 302860: Fix aio system call wrappers in librt. - Update aio_return/waitcomplete wrappers for the ssize_t return type. - Fix the aio_return() wrapper to fail with EINVAL on a pending job. This matches the semantics of the in-kernel system call. Also, aio_return() returns errors via errno, not via the return value. Approved by: re (gjb) Sponsored by: Chelsio Communications Modified: stable/11/lib/librt/aio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/librt/aio.c ============================================================================== --- stable/11/lib/librt/aio.c Mon Jul 25 15:05:01 2016 (r303305) +++ stable/11/lib/librt/aio.c Mon Jul 25 15:56:37 2016 (r303306) @@ -54,8 +54,8 @@ typedef void (*aio_func)(union sigval va extern int __sys_aio_read(struct aiocb *iocb); extern int __sys_aio_write(struct aiocb *iocb); -extern int __sys_aio_waitcomplete(struct aiocb **iocbp, struct timespec *timeout); -extern int __sys_aio_return(struct aiocb *iocb); +extern ssize_t __sys_aio_waitcomplete(struct aiocb **iocbp, struct timespec *timeout); +extern ssize_t __sys_aio_return(struct aiocb *iocb); extern int __sys_aio_error(struct aiocb *iocb); extern int __sys_aio_fsync(int op, struct aiocb *iocb); @@ -136,12 +136,13 @@ __aio_write(struct aiocb *iocb) return aio_io(iocb, &__sys_aio_write); } -int +ssize_t __aio_waitcomplete(struct aiocb **iocbp, struct timespec *timeout) { + ssize_t ret; int err; - int ret = __sys_aio_waitcomplete(iocbp, timeout); + ret = __sys_aio_waitcomplete(iocbp, timeout); if (*iocbp) { if ((*iocbp)->aio_sigevent.sigev_notify == SIGEV_THREAD) { err = errno; @@ -155,13 +156,20 @@ __aio_waitcomplete(struct aiocb **iocbp, return (ret); } -int +ssize_t __aio_return(struct aiocb *iocb) { if (iocb->aio_sigevent.sigev_notify == SIGEV_THREAD) { - if (__sys_aio_error(iocb) == EINPROGRESS) - return (EINPROGRESS); + if (__sys_aio_error(iocb) == EINPROGRESS) { + /* + * Fail with EINVAL to match the semantics of + * __sys_aio_return() for an in-progress + * request. + */ + errno = EINVAL; + return (-1); + } __sigev_list_lock(); __sigev_delete(SI_ASYNCIO, (sigev_id_t)iocb); __sigev_list_unlock(); From owner-svn-src-stable@freebsd.org Mon Jul 25 17:18:00 2016 Return-Path: Delivered-To: svn-src-stable@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 A5B00BA33BA; Mon, 25 Jul 2016 17:18:00 +0000 (UTC) (envelope-from np@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 7230C10CD; Mon, 25 Jul 2016 17:18:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PHHxdO006979; Mon, 25 Jul 2016 17:17:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PHHx6m006978; Mon, 25 Jul 2016 17:17:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201607251717.u6PHHx6m006978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 25 Jul 2016 17:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303311 - stable/11/usr.sbin/ctld X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 17:18:00 -0000 Author: np Date: Mon Jul 25 17:17:59 2016 New Revision: 303311 URL: https://svnweb.freebsd.org/changeset/base/303311 Log: MFC r303199: ctld(8): Fix MaxBurstLength negotiation. The target must reply with the selected value of MaxBurstSize instead of just echoing back the initiator's offered value. Reviewed by: mav@ Approved by: re@ (gjb@) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7278 Modified: stable/11/usr.sbin/ctld/login.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/ctld/login.c ============================================================================== --- stable/11/usr.sbin/ctld/login.c Mon Jul 25 16:28:02 2016 (r303310) +++ stable/11/usr.sbin/ctld/login.c Mon Jul 25 17:17:59 2016 (r303311) @@ -569,7 +569,7 @@ login_negotiate_key(struct pdu *request, tmp = MAX_BURST_LENGTH; } conn->conn_max_burst_length = tmp; - keys_add(response_keys, name, value); + keys_add_int(response_keys, name, tmp); } else if (strcmp(name, "FirstBurstLength") == 0) { tmp = strtoul(value, NULL, 10); if (tmp <= 0) { From owner-svn-src-stable@freebsd.org Mon Jul 25 17:37:03 2016 Return-Path: Delivered-To: svn-src-stable@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 EC21FBA3B48; Mon, 25 Jul 2016 17:37:03 +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 CA09D1CD7; Mon, 25 Jul 2016 17:37:03 +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 u6PHb3fR014404; Mon, 25 Jul 2016 17:37:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PHb2Z4014400; Mon, 25 Jul 2016 17:37:02 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201607251737.u6PHb2Z4014400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 25 Jul 2016 17:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303312 - in stable/11: share/man/man4 sys/dev/vt sys/dev/vt/hw/fb X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 17:37:04 -0000 Author: bdrewery Date: Mon Jul 25 17:37:02 2016 New Revision: 303312 URL: https://svnweb.freebsd.org/changeset/base/303312 Log: MFC r303043: Increase vt(4) framebuffer maximum size PR: 210382 Approved by: re (gjb) Modified: stable/11/share/man/man4/vt.4 stable/11/sys/dev/vt/hw/fb/vt_fb.c stable/11/sys/dev/vt/vt.h stable/11/sys/dev/vt/vt_core.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/vt.4 ============================================================================== --- stable/11/share/man/man4/vt.4 Mon Jul 25 17:17:59 2016 (r303311) +++ stable/11/share/man/man4/vt.4 Mon Jul 25 17:37:02 2016 (r303312) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 21, 2016 +.Dd July 19, 2016 .Dt "VIRTUAL TERMINALS" 4 .Os .Sh NAME @@ -36,8 +36,8 @@ .Cd "options VT_MAXWINDOWS=N" .Cd "options VT_ALT_TO_ESC_HACK=1" .Cd "options VT_TWOBUTTON_MOUSE" -.Cd "options VT_FB_DEFAULT_WIDTH=X" -.Cd "options VT_FB_DEFAULT_HEIGHT=Y" +.Cd "options VT_FB_MAX_WIDTH=X" +.Cd "options VT_FB_MAX_HEIGHT=Y" .Cd "options SC_NO_CUTPASTE" .Cd "device vt" .Pp Modified: stable/11/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- stable/11/sys/dev/vt/hw/fb/vt_fb.c Mon Jul 25 17:17:59 2016 (r303311) +++ stable/11/sys/dev/vt/hw/fb/vt_fb.c Mon Jul 25 17:37:02 2016 (r303312) @@ -416,10 +416,10 @@ vt_fb_init(struct vt_device *vd) int err; info = vd->vd_softc; - vd->vd_height = MIN(VT_FB_DEFAULT_HEIGHT, info->fb_height); + vd->vd_height = MIN(VT_FB_MAX_HEIGHT, info->fb_height); margin = (info->fb_height - vd->vd_height) >> 1; vd->vd_transpose = margin * info->fb_stride; - vd->vd_width = MIN(VT_FB_DEFAULT_WIDTH, info->fb_width); + vd->vd_width = MIN(VT_FB_MAX_WIDTH, info->fb_width); margin = (info->fb_width - vd->vd_width) >> 1; vd->vd_transpose += margin * (info->fb_bpp / NBBY); vd->vd_video_dev = info->fb_video_dev; Modified: stable/11/sys/dev/vt/vt.h ============================================================================== --- stable/11/sys/dev/vt/vt.h Mon Jul 25 17:17:59 2016 (r303311) +++ stable/11/sys/dev/vt/vt.h Mon Jul 25 17:37:02 2016 (r303312) @@ -377,11 +377,11 @@ void vt_upgrade(struct vt_device *vd); #define PIXEL_WIDTH(w) ((w) / 8) #define PIXEL_HEIGHT(h) ((h) / 16) -#ifndef VT_FB_DEFAULT_WIDTH -#define VT_FB_DEFAULT_WIDTH 2048 +#ifndef VT_FB_MAX_WIDTH +#define VT_FB_MAX_WIDTH 4096 #endif -#ifndef VT_FB_DEFAULT_HEIGHT -#define VT_FB_DEFAULT_HEIGHT 1200 +#ifndef VT_FB_MAX_HEIGHT +#define VT_FB_MAX_HEIGHT 2400 #endif /* name argument is not used yet. */ Modified: stable/11/sys/dev/vt/vt_core.c ============================================================================== --- stable/11/sys/dev/vt/vt_core.c Mon Jul 25 17:17:59 2016 (r303311) +++ stable/11/sys/dev/vt/vt_core.c Mon Jul 25 17:37:02 2016 (r303312) @@ -181,8 +181,8 @@ static void vt_resume_handler(void *priv SET_DECLARE(vt_drv_set, struct vt_driver); -#define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT)) -#define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH)) +#define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_MAX_HEIGHT)) +#define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_MAX_WIDTH)) struct terminal vt_consterm; static struct vt_window vt_conswindow; From owner-svn-src-stable@freebsd.org Mon Jul 25 18:25:20 2016 Return-Path: Delivered-To: svn-src-stable@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 56FA0B9CCC5; Mon, 25 Jul 2016 18:25:20 +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 269D41EB8; Mon, 25 Jul 2016 18:25:20 +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 u6PIPJQQ033005; Mon, 25 Jul 2016 18:25:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PIPJI5033003; Mon, 25 Jul 2016 18:25:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201607251825.u6PIPJI5033003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 25 Jul 2016 18:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303314 - stable/11/sys/conf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 18:25:20 -0000 Author: bdrewery Date: Mon Jul 25 18:25:19 2016 New Revision: 303314 URL: https://svnweb.freebsd.org/changeset/base/303314 Log: MFC r303195: Don't run find(1) for __MPATH with NO_MODULES set. Approved by: re (gjb) Modified: stable/11/sys/conf/config.mk stable/11/sys/conf/kern.pre.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/config.mk ============================================================================== --- stable/11/sys/conf/config.mk Mon Jul 25 18:24:54 2016 (r303313) +++ stable/11/sys/conf/config.mk Mon Jul 25 18:25:19 2016 (r303314) @@ -54,7 +54,7 @@ KERN_OPTS!=cat ${KERNBUILDDIR}/opt*.h | .export KERN_OPTS .endif -.if !defined(__MPATH) +.if !defined(NO_MODULES) && !defined(__MPATH) __MPATH!=find ${SYSDIR:tA}/ -name \*_if.m .export __MPATH .endif Modified: stable/11/sys/conf/kern.pre.mk ============================================================================== --- stable/11/sys/conf/kern.pre.mk Mon Jul 25 18:24:54 2016 (r303313) +++ stable/11/sys/conf/kern.pre.mk Mon Jul 25 18:25:19 2016 (r303314) @@ -192,7 +192,7 @@ SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symb SYSTEM_DEP+= ${LDSCRIPT} # Calculate path for .m files early, if needed. -.if !defined(__MPATH) +.if !defined(NO_MODULES) && !defined(__MPATH) __MPATH!=find ${S:tA}/ -name \*_if.m .endif @@ -212,7 +212,9 @@ MKMODULESENV+= MODULES_OVERRIDE="${MODUL .if defined(DEBUG) MKMODULESENV+= DEBUG_FLAGS="${DEBUG}" .endif +.if !defined(NO_MODULES) MKMODULESENV+= __MPATH="${__MPATH}" +.endif # Architecture and output format arguments for objdump to convert image to # object file From owner-svn-src-stable@freebsd.org Mon Jul 25 19:16:51 2016 Return-Path: Delivered-To: svn-src-stable@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 3B88FBA0EAA; Mon, 25 Jul 2016 19:16:51 +0000 (UTC) (envelope-from jhb@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 E98E31ED6; Mon, 25 Jul 2016 19:16:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PJGoh3051873; Mon, 25 Jul 2016 19:16:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PJGo7x051872; Mon, 25 Jul 2016 19:16:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607251916.u6PJGo7x051872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 25 Jul 2016 19:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303316 - stable/11/share/man/man3 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 19:16:51 -0000 Author: jhb Date: Mon Jul 25 19:16:49 2016 New Revision: 303316 URL: https://svnweb.freebsd.org/changeset/base/303316 Log: MFC 302861: Fix rendering issues. - Use Ta to separate column headers. - Correct width of the 'Code' column in the last table. Approved by: re (gjb) Modified: stable/11/share/man/man3/siginfo.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man3/siginfo.3 ============================================================================== --- stable/11/share/man/man3/siginfo.3 Mon Jul 25 19:16:30 2016 (r303315) +++ stable/11/share/man/man3/siginfo.3 Mon Jul 25 19:16:49 2016 (r303316) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2012 +.Dd July 14, 2016 .Dt SIGINFO 3 .Os .Sh NAME @@ -54,7 +54,7 @@ In either case, the system returns the i .Vt siginfo_t , which includes the following information: .Bl -column ".Vt union signal" ".Va si_overrun" -.It Sy "Type Member Description" +.It Sy Type Ta Sy Member Ta Sy Description .It Vt int Ta Va si_signo Ta signal number .It Vt int Ta Va si_errno Ta @@ -107,7 +107,7 @@ for use as values of that are signal-specific or non-signal-specific reasons why the signal was generated: .Bl -column ".Dv SIGPOLL" ".Dv CLD_CONTINUED" -.It Sy "Signal Code Reason" +.It Sy Signal Ta Sy Code Ta Sy Reason .It Dv SIGILL Ta Dv ILL_ILLOPC Ta illegal opcode .It Ta Dv ILL_ILLOPN Ta @@ -206,7 +206,7 @@ signal sent by .Pp In addition, the following signal-specific information is available: .Bl -column ".Dv SIGPOLL" ".Dv CLD_CONTINUED" -.It Sy "Signal Member Value" +.It Sy Signal Ta Sy Member Ta Sy Value .It Dv SIGILL Ta Va si_addr Ta address of faulting instruction .It Ta Va si_trapno Ta @@ -240,8 +240,8 @@ or .El .Pp Finally, the following code-specific information is available: -.Bl -column ".Dv SI_QUEUE" ".Va si_overrun" -.It Sy "Code Member Value" +.Bl -column ".Dv SI_ASYNCIO" ".Va si_overrun" +.It Sy Code Ta Sy Member Ta Sy Value .It Dv SI_USER Ta Va si_pid Ta the process ID that sent the signal .It Ta Va si_uid Ta From owner-svn-src-stable@freebsd.org Mon Jul 25 19:18:44 2016 Return-Path: Delivered-To: svn-src-stable@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 53F16BA0FD0; Mon, 25 Jul 2016 19:18:44 +0000 (UTC) (envelope-from jhb@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 0AEAA11D1; Mon, 25 Jul 2016 19:18:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PJIh5p051985; Mon, 25 Jul 2016 19:18:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PJIhu0051984; Mon, 25 Jul 2016 19:18:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607251918.u6PJIhu0051984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 25 Jul 2016 19:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r303317 - in stable: 10/share/man/man3 9/share/man/man3 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 19:18:44 -0000 Author: jhb Date: Mon Jul 25 19:18:42 2016 New Revision: 303317 URL: https://svnweb.freebsd.org/changeset/base/303317 Log: MFC 302861: Fix rendering issues. - Use Ta to separate column headers. - Correct width of the 'Code' column in the last table. Modified: stable/9/share/man/man3/siginfo.3 Directory Properties: stable/9/share/man/man3/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man3/siginfo.3 Directory Properties: stable/10/ (props changed) Modified: stable/9/share/man/man3/siginfo.3 ============================================================================== --- stable/9/share/man/man3/siginfo.3 Mon Jul 25 19:16:49 2016 (r303316) +++ stable/9/share/man/man3/siginfo.3 Mon Jul 25 19:18:42 2016 (r303317) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2012 +.Dd July 14, 2016 .Dt SIGINFO 3 .Os .Sh NAME @@ -54,7 +54,7 @@ In either case, the system returns the i .Vt siginfo_t , which includes the following information: .Bl -column ".Vt union signal" ".Va si_overrun" -.It Sy "Type Member Description" +.It Sy Type Ta Sy Member Ta Sy Description .It Vt int Ta Va si_signo Ta signal number .It Vt int Ta Va si_errno Ta @@ -107,7 +107,7 @@ for use as values of that are signal-specific or non-signal-specific reasons why the signal was generated: .Bl -column ".Dv SIGPOLL" ".Dv CLD_CONTINUED" -.It Sy "Signal Code Reason" +.It Sy Signal Ta Sy Code Ta Sy Reason .It Dv SIGILL Ta Dv ILL_ILLOPC Ta illegal opcode .It Ta Dv ILL_ILLOPN Ta @@ -206,7 +206,7 @@ signal sent by .Pp In addition, the following signal-specific information is available: .Bl -column ".Dv SIGPOLL" ".Dv CLD_CONTINUED" -.It Sy "Signal Member Value" +.It Sy Signal Ta Sy Member Ta Sy Value .It Dv SIGILL Ta Va si_addr Ta address of faulting instruction .It Ta Va si_trapno Ta @@ -240,8 +240,8 @@ or .El .Pp Finally, the following code-specific information is available: -.Bl -column ".Dv SI_QUEUE" ".Va si_overrun" -.It Sy "Code Member Value" +.Bl -column ".Dv SI_ASYNCIO" ".Va si_overrun" +.It Sy Code Ta Sy Member Ta Sy Value .It Dv SI_USER Ta Va si_pid Ta the process ID that sent the signal .It Ta Va si_uid Ta From owner-svn-src-stable@freebsd.org Mon Jul 25 19:18:44 2016 Return-Path: Delivered-To: svn-src-stable@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 1DDF1BA0FCC; Mon, 25 Jul 2016 19:18:44 +0000 (UTC) (envelope-from jhb@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 C916511D0; Mon, 25 Jul 2016 19:18:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PJIhuq051979; Mon, 25 Jul 2016 19:18:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PJIh8h051978; Mon, 25 Jul 2016 19:18:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607251918.u6PJIh8h051978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 25 Jul 2016 19:18: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: r303317 - in stable: 10/share/man/man3 9/share/man/man3 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 19:18:44 -0000 Author: jhb Date: Mon Jul 25 19:18:42 2016 New Revision: 303317 URL: https://svnweb.freebsd.org/changeset/base/303317 Log: MFC 302861: Fix rendering issues. - Use Ta to separate column headers. - Correct width of the 'Code' column in the last table. Modified: stable/10/share/man/man3/siginfo.3 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/share/man/man3/siginfo.3 Directory Properties: stable/9/share/man/man3/ (props changed) Modified: stable/10/share/man/man3/siginfo.3 ============================================================================== --- stable/10/share/man/man3/siginfo.3 Mon Jul 25 19:16:49 2016 (r303316) +++ stable/10/share/man/man3/siginfo.3 Mon Jul 25 19:18:42 2016 (r303317) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2012 +.Dd July 14, 2016 .Dt SIGINFO 3 .Os .Sh NAME @@ -54,7 +54,7 @@ In either case, the system returns the i .Vt siginfo_t , which includes the following information: .Bl -column ".Vt union signal" ".Va si_overrun" -.It Sy "Type Member Description" +.It Sy Type Ta Sy Member Ta Sy Description .It Vt int Ta Va si_signo Ta signal number .It Vt int Ta Va si_errno Ta @@ -107,7 +107,7 @@ for use as values of that are signal-specific or non-signal-specific reasons why the signal was generated: .Bl -column ".Dv SIGPOLL" ".Dv CLD_CONTINUED" -.It Sy "Signal Code Reason" +.It Sy Signal Ta Sy Code Ta Sy Reason .It Dv SIGILL Ta Dv ILL_ILLOPC Ta illegal opcode .It Ta Dv ILL_ILLOPN Ta @@ -206,7 +206,7 @@ signal sent by .Pp In addition, the following signal-specific information is available: .Bl -column ".Dv SIGPOLL" ".Dv CLD_CONTINUED" -.It Sy "Signal Member Value" +.It Sy Signal Ta Sy Member Ta Sy Value .It Dv SIGILL Ta Va si_addr Ta address of faulting instruction .It Ta Va si_trapno Ta @@ -240,8 +240,8 @@ or .El .Pp Finally, the following code-specific information is available: -.Bl -column ".Dv SI_QUEUE" ".Va si_overrun" -.It Sy "Code Member Value" +.Bl -column ".Dv SI_ASYNCIO" ".Va si_overrun" +.It Sy Code Ta Sy Member Ta Sy Value .It Dv SI_USER Ta Va si_pid Ta the process ID that sent the signal .It Ta Va si_uid Ta From owner-svn-src-stable@freebsd.org Mon Jul 25 19:37:11 2016 Return-Path: Delivered-To: svn-src-stable@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 DB92BBA1630; Mon, 25 Jul 2016 19:37:11 +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 B6D341D14; Mon, 25 Jul 2016 19:37:11 +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 u6PJbAni059307; Mon, 25 Jul 2016 19:37:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PJbAum059304; Mon, 25 Jul 2016 19:37:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607251937.u6PJbAum059304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 25 Jul 2016 19:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303318 - in stable/11/contrib/llvm/projects/libunwind: include src X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 19:37:12 -0000 Author: emaste Date: Mon Jul 25 19:37:10 2016 New Revision: 303318 URL: https://svnweb.freebsd.org/changeset/base/303318 Log: Merge LLVM libunwind fixes r302475: libunwind: limit stack usage in unwind cursor This may be reworked upstream but in the interim should address the stack usage issue reported in the PR. r303061: libunwind: Properly align _Unwind_Exception. _Unwind_Exception is required to be double word aligned. GCC has interpreted this to mean "use the maximum useful alignment for the target" so follow that lead. PR: 206384 (r302475) Obtained from: LLVM review D22543 (r303061) Approved by: re (gjb) Modified: stable/11/contrib/llvm/projects/libunwind/include/__libunwind_config.h stable/11/contrib/llvm/projects/libunwind/include/unwind.h stable/11/contrib/llvm/projects/libunwind/src/DwarfParser.hpp Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/projects/libunwind/include/__libunwind_config.h ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/include/__libunwind_config.h Mon Jul 25 19:18:42 2016 (r303317) +++ stable/11/contrib/llvm/projects/libunwind/include/__libunwind_config.h Mon Jul 25 19:37:10 2016 (r303318) @@ -22,30 +22,37 @@ # define _LIBUNWIND_TARGET_I386 1 # define _LIBUNWIND_CONTEXT_SIZE 8 # define _LIBUNWIND_CURSOR_SIZE 19 +# define _LIBUNWIND_MAX_REGISTER 9 # elif defined(__x86_64__) # define _LIBUNWIND_TARGET_X86_64 1 # define _LIBUNWIND_CONTEXT_SIZE 21 # define _LIBUNWIND_CURSOR_SIZE 33 +# define _LIBUNWIND_MAX_REGISTER 17 # elif defined(__ppc__) # define _LIBUNWIND_TARGET_PPC 1 # define _LIBUNWIND_CONTEXT_SIZE 117 # define _LIBUNWIND_CURSOR_SIZE 128 +# define _LIBUNWIND_MAX_REGISTER 113 # elif defined(__aarch64__) # define _LIBUNWIND_TARGET_AARCH64 1 # define _LIBUNWIND_CONTEXT_SIZE 66 # define _LIBUNWIND_CURSOR_SIZE 78 +# define _LIBUNWIND_MAX_REGISTER 96 # elif defined(__arm__) # define _LIBUNWIND_TARGET_ARM 1 # define _LIBUNWIND_CONTEXT_SIZE 60 # define _LIBUNWIND_CURSOR_SIZE 67 +# define _LIBUNWIND_MAX_REGISTER 96 # elif defined(__or1k__) # define _LIBUNWIND_TARGET_OR1K 1 # define _LIBUNWIND_CONTEXT_SIZE 16 # define _LIBUNWIND_CURSOR_SIZE 28 +# define _LIBUNWIND_MAX_REGISTER 32 # elif defined(__riscv__) # define _LIBUNWIND_TARGET_RISCV 1 # define _LIBUNWIND_CONTEXT_SIZE 128 /* XXX */ # define _LIBUNWIND_CURSOR_SIZE 140 /* XXX */ +# define _LIBUNWIND_MAX_REGISTER 96 # else # error "Unsupported architecture." # endif @@ -58,6 +65,7 @@ # define _LIBUNWIND_TARGET_OR1K 1 # define _LIBUNWIND_CONTEXT_SIZE 128 # define _LIBUNWIND_CURSOR_SIZE 140 +# define _LIBUNWIND_MAX_REGISTER 120 #endif // _LIBUNWIND_IS_NATIVE_ONLY #endif // ____LIBUNWIND_CONFIG_H__ Modified: stable/11/contrib/llvm/projects/libunwind/include/unwind.h ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/include/unwind.h Mon Jul 25 19:18:42 2016 (r303317) +++ stable/11/contrib/llvm/projects/libunwind/include/unwind.h Mon Jul 25 19:37:10 2016 (r303318) @@ -128,7 +128,7 @@ struct _Unwind_Exception { // added for binary compatibility. uint32_t reserved[3]; #endif -}; +} __attribute__((__aligned__)); typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int version, Modified: stable/11/contrib/llvm/projects/libunwind/src/DwarfParser.hpp ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/DwarfParser.hpp Mon Jul 25 19:18:42 2016 (r303317) +++ stable/11/contrib/llvm/projects/libunwind/src/DwarfParser.hpp Mon Jul 25 19:37:10 2016 (r303318) @@ -62,7 +62,7 @@ public: }; enum { - kMaxRegisterNumber = 120 + kMaxRegisterNumber = _LIBUNWIND_MAX_REGISTER }; enum RegisterSavedWhere { kRegisterUnused, From owner-svn-src-stable@freebsd.org Mon Jul 25 20:02:13 2016 Return-Path: Delivered-To: svn-src-stable@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 1A5C1BA41D6; Mon, 25 Jul 2016 20:02:13 +0000 (UTC) (envelope-from asomers@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 DE3DB105D; Mon, 25 Jul 2016 20:02:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PK2CYZ073649; Mon, 25 Jul 2016 20:02:12 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PK2CVS073648; Mon, 25 Jul 2016 20:02:12 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201607252002.u6PK2CVS073648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 25 Jul 2016 20:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303319 - stable/11/usr.sbin/camdd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 20:02:13 -0000 Author: asomers Date: Mon Jul 25 20:02:11 2016 New Revision: 303319 URL: https://svnweb.freebsd.org/changeset/base/303319 Log: MFC r303091 Fix camdd for host-aware and host-managed SMR disks. This should've gone in as part of r300207 Approved by: re (gjb) Modified: stable/11/usr.sbin/camdd/camdd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/camdd/camdd.c ============================================================================== --- stable/11/usr.sbin/camdd/camdd.c Mon Jul 25 19:37:10 2016 (r303318) +++ stable/11/usr.sbin/camdd/camdd.c Mon Jul 25 20:02:11 2016 (r303319) @@ -1292,6 +1292,7 @@ camdd_probe_pass(struct cam_device *cam_ case T_CDROM: case T_OPTICAL: case T_RBC: + case T_ZBC_HM: break; default: errx(1, "Unsupported SCSI device type %d", scsi_dev_type); From owner-svn-src-stable@freebsd.org Mon Jul 25 23:37:49 2016 Return-Path: Delivered-To: svn-src-stable@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 38967BA51AC; Mon, 25 Jul 2016 23:37:49 +0000 (UTC) (envelope-from jhb@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 01BFA1756; Mon, 25 Jul 2016 23:37:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PNbmbf055558; Mon, 25 Jul 2016 23:37:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PNbl2V055548; Mon, 25 Jul 2016 23:37:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607252337.u6PNbl2V055548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 25 Jul 2016 23:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303324 - in stable/11: lib/libc/sys share/man/man3 share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 23:37:49 -0000 Author: jhb Date: Mon Jul 25 23:37:47 2016 New Revision: 303324 URL: https://svnweb.freebsd.org/changeset/base/303324 Log: MFC 302899: Add documentation for the sigevent structure. - Add a sigevent(3) manpage to give a general overview of the sigevent structure and the available notification mechanisms. - Document that AIO requests contain a nested sigevent structure that can be used to request completion notification. - Expand the sigevent details in other manuals to note details such as the extra values stored in a queued signal's information or in a posted kevent. Approved by: re (gjb) Added: stable/11/share/man/man3/sigevent.3 - copied unchanged from r302899, head/share/man/man3/sigevent.3 Modified: stable/11/lib/libc/sys/aio_fsync.2 stable/11/lib/libc/sys/aio_mlock.2 stable/11/lib/libc/sys/aio_read.2 stable/11/lib/libc/sys/aio_write.2 stable/11/lib/libc/sys/lio_listio.2 stable/11/lib/libc/sys/mq_notify.2 stable/11/lib/libc/sys/timer_create.2 stable/11/share/man/man3/Makefile stable/11/share/man/man4/aio.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/aio_fsync.2 ============================================================================== --- stable/11/lib/libc/sys/aio_fsync.2 Mon Jul 25 23:06:37 2016 (r303323) +++ stable/11/lib/libc/sys/aio_fsync.2 Mon Jul 25 23:37:47 2016 (r303324) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 27, 2013 +.Dd July 15, 2016 .Dt AIO_FSYNC 2 .Os .Sh NAME @@ -71,6 +71,29 @@ while it is in progress. .Pp If the request could not be enqueued (generally due to invalid arguments), the call returns without having enqueued the request. +.Pp +The +.Fa iocb->aio_sigevent +structure can be used to request notification of the request's +completion as described in +.Xr aio 4 . +.Sh RESTRICTIONS +The asynchronous I/O Control Block structure pointed to by +.Fa iocb +must remain valid until the +operation has completed. +For this reason, use of auto (stack) variables +for these objects is discouraged. +.Pp +The asynchronous I/O control buffer +.Fa iocb +should be zeroed before the +.Fn aio_fsync +call to avoid passing bogus context information to the kernel. +.Pp +Modifications of the Asynchronous I/O Control Block structure or the +buffer contents after the request has been enqueued, but before the +request has completed, are not allowed. .Sh RETURN VALUES .Rv -std aio_fsync .Sh ERRORS @@ -80,6 +103,10 @@ system call will fail if: .Bl -tag -width Er .It Bq Er EAGAIN The request was not queued because of system resource limitations. +.It Bq Er EINVAL +The asynchronous notification method in +.Fa iocb->aio_sigevent.sigev_notify +is invalid or not supported. .It Bq Er ENOSYS The .Fn aio_fsync @@ -138,6 +165,7 @@ system calls. .Xr aio_waitcomplete 2 , .Xr aio_write 2 , .Xr fsync 2 , +.Xr sigevent 3 , .Xr siginfo 3 , .Xr aio 4 .Sh STANDARDS Modified: stable/11/lib/libc/sys/aio_mlock.2 ============================================================================== --- stable/11/lib/libc/sys/aio_mlock.2 Mon Jul 25 23:06:37 2016 (r303323) +++ stable/11/lib/libc/sys/aio_mlock.2 Mon Jul 25 23:37:47 2016 (r303324) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 3, 2013 +.Dd July 15, 2016 .Dt AIO_MLOCK 2 .Os .Sh NAME @@ -64,6 +64,12 @@ If the request could not be enqueued (ge .Xr aio 4 limits), then the call returns without having enqueued the request. +.Pp +The +.Fa iocb->aio_sigevent +structure can be used to request notification of the request's +completion as described in +.Xr aio 4 . .Sh RESTRICTIONS The Asynchronous I/O Control Block structure pointed to by .Fa iocb @@ -92,6 +98,10 @@ system call will fail if: .Bl -tag -width Er .It Bq Er EAGAIN The request was not queued because of system resource limitations. +.It Bq Er EINVAL +The asynchronous notification method in +.Fa iocb->aio_sigevent.sigev_notify +is invalid or not supported. .It Bq Er ENOSYS The .Fn aio_mlock @@ -116,6 +126,7 @@ if the request was explicitly cancelled .Xr aio_error 2 , .Xr aio_return 2 , .Xr mlock 2 , +.Xr sigevent 3 , .Xr aio 4 .Sh PORTABILITY The Modified: stable/11/lib/libc/sys/aio_read.2 ============================================================================== --- stable/11/lib/libc/sys/aio_read.2 Mon Jul 25 23:06:37 2016 (r303323) +++ stable/11/lib/libc/sys/aio_read.2 Mon Jul 25 23:37:47 2016 (r303324) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 1998 +.Dd July 15, 2016 .Dt AIO_READ 2 .Os .Sh NAME @@ -79,6 +79,12 @@ If the request is successfully enqueued, .Fa iocb->aio_offset can be modified during the request as context, so this value must not be referenced after the request is enqueued. +.Pp +The +.Fa iocb->aio_sigevent +structure can be used to request notification of the request's +completion as described in +.Xr aio 4 . .Sh RESTRICTIONS The Asynchronous I/O Control Block structure pointed to by .Fa iocb @@ -115,6 +121,10 @@ system call will fail if: .Bl -tag -width Er .It Bq Er EAGAIN The request was not queued because of system resource limitations. +.It Bq Er EINVAL +The asynchronous notification method in +.Fa iocb->aio_sigevent.sigev_notify +is invalid or not supported. .It Bq Er ENOSYS The .Fn aio_read @@ -191,6 +201,7 @@ would be invalid. .Xr aio_suspend 2 , .Xr aio_waitcomplete 2 , .Xr aio_write 2 , +.Xr sigevent 3 , .Xr siginfo 3 , .Xr aio 4 .Sh STANDARDS Modified: stable/11/lib/libc/sys/aio_write.2 ============================================================================== --- stable/11/lib/libc/sys/aio_write.2 Mon Jul 25 23:06:37 2016 (r303323) +++ stable/11/lib/libc/sys/aio_write.2 Mon Jul 25 23:37:47 2016 (r303324) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 1999 +.Dd July 15, 2016 .Dt AIO_WRITE 2 .Os .Sh NAME @@ -85,6 +85,12 @@ If the request is successfully enqueued, .Fa iocb->aio_offset can be modified during the request as context, so this value must not be referenced after the request is enqueued. +.Pp +The +.Fa iocb->aio_sigevent +structure can be used to request notification of the request's +completion as described in +.Xr aio 4 . .Sh RESTRICTIONS The Asynchronous I/O Control Block structure pointed to by .Fa iocb @@ -119,6 +125,10 @@ system call will fail if: .Bl -tag -width Er .It Bq Er EAGAIN The request was not queued because of system resource limitations. +.It Bq Er EINVAL +The asynchronous notification method in +.Fa iocb->aio_sigevent.sigev_notify +is invalid or not supported. .It Bq Er ENOSYS The .Fn aio_write @@ -186,6 +196,7 @@ would be invalid. .Xr aio_return 2 , .Xr aio_suspend 2 , .Xr aio_waitcomplete 2 , +.Xr sigevent 3 , .Xr siginfo 3 , .Xr aio 4 .Sh STANDARDS Modified: stable/11/lib/libc/sys/lio_listio.2 ============================================================================== --- stable/11/lib/libc/sys/lio_listio.2 Mon Jul 25 23:06:37 2016 (r303323) +++ stable/11/lib/libc/sys/lio_listio.2 Mon Jul 25 23:37:47 2016 (r303324) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2003 +.Dd July 15, 2016 .Dt LIO_LISTIO 2 .Os .Sh NAME @@ -83,14 +83,52 @@ If .Fa mode is .Dv LIO_NOWAIT , -the requests are processed asynchronously, and the signal specified by .Fa sig -is sent when all operations have completed. +can be used to request asynchronous notification when all operations have +completed. If .Fa sig is .Dv NULL , -the calling process is not notified of I/O completion. +no notification is sent. +.Pp +For +.Dv SIGEV_KEVENT +notifications, +the posted kevent will contain: +.Bl -column ".Va filter" +.It Sy Member Ta Sy Value +.It Va ident Ta Fa list +.It Va filter Ta Dv EVFILT_LIO +.It Va udata Ta +value stored in +.Fa sig->sigev_value +.El +.Pp +For +.Dv SIGEV_SIGNO +and +.Dv SIGEV_THREAD_ID +notifications, +the information for the queued signal will include +.Dv SI_ASYNCIO +in the +.Va si_code +field and the value stored in +.Fa sig->sigev_value +in the +.Va si_value +field. +.Pp +For +.Dv SIGEV_THREAD +notifications, +the value stored in +.Fa sig->sigev_value +is passed to the +.Fa sig->sigev_notify_function +as described in +.Xr sigevent 3 . .Pp The order in which the requests are carried out is not specified; in particular, there is no guarantee that they will be executed in @@ -136,6 +174,10 @@ or .Fa nent is greater than .Dv AIO_LISTIO_MAX . +.It Bq Er EINVAL +The asynchronous notification method in +.Fa sig->sigev_notify +is invalid or not supported. .It Bq Er EINTR A signal interrupted the system call before it could be completed. .It Bq Er EIO @@ -166,6 +208,7 @@ structure individually by calling .Xr aio_write 2 , .Xr read 2 , .Xr write 2 , +.Xr sigevent 3 , .Xr siginfo 3 , .Xr aio 4 .Sh STANDARDS Modified: stable/11/lib/libc/sys/mq_notify.2 ============================================================================== --- stable/11/lib/libc/sys/mq_notify.2 Mon Jul 25 23:06:37 2016 (r303323) +++ stable/11/lib/libc/sys/mq_notify.2 Mon Jul 25 23:37:47 2016 (r303324) @@ -37,7 +37,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2005 +.Dd July 15, 2016 .Dt MQ_NOTIFY 2 .Os .Sh NAME @@ -77,18 +77,27 @@ is .Dv SIGEV_NONE , then no signal will be posted, but the error status and the return status for the operation will be set appropriately. -If -.Fa notification->sigev_notify -is -.Dv SIGEV_SIGNAL , -then the signal specified in +For +.Dv SIGEV_SIGNO +and +.Dv SIGEV_THREAD_ID +notifications, +the signal specified in .Fa notification->sigev_signo -will be sent to the process. -The signal will be queued to the process and the value specified in +will be sent to the calling process +.Pq Dv SIGEV_SIGNO +or to the thread whose LWP ID is +.Fa notification->sigev_notify_thread_id +.Pq Dv SIGEV_THREAD_ID . +The information for the queued signal will include: +.Bl -column ".Va si_value" +.It Sy Member Ta Sy Value +.It Va si_code Ta Dv SI_MESGQ +.It Va si_value Ta +the value stored in .Fa notification->sigev_value -will be the -.Va si_value -component of the generated signal. +.It Va si_mqd Ta Fa mqdes +.El .Pp If .Fa notification @@ -123,11 +132,16 @@ The argument is not a valid message queue descriptor. .It Bq Er EBUSY Process is already registered for notification by the message queue. +.It Bq Er EINVAL +The asynchronous notification method in +.Fa notification->sigev_notify +is invalid or not supported. .El .Sh SEE ALSO .Xr mq_open 2 , .Xr mq_send 2 , .Xr mq_timedsend 2 , +.Xr sigevent 3 , .Xr siginfo 3 .Sh STANDARDS The Modified: stable/11/lib/libc/sys/timer_create.2 ============================================================================== --- stable/11/lib/libc/sys/timer_create.2 Mon Jul 25 23:06:37 2016 (r303323) +++ stable/11/lib/libc/sys/timer_create.2 Mon Jul 25 23:37:47 2016 (r303324) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2009 +.Dd July 15, 2016 .Dt TIMER_CREATE 2 .Os .Sh NAME @@ -74,6 +74,36 @@ structure. This structure, allocated by the application, defines the asynchronous notification to occur when the timer expires. +.Pp +If +.Fa evp->sigev_notify +is +.Dv SIGEV_SIGNO +or +.Dv SIGEV_THREAD_ID , +the signal specified in +.Fa evp->sigev_signo +will be sent to the calling process +.Pq Dv SIGEV_SIGNO +or to the thread whose LWP ID is +.Fa evp->sigev_notify_thread_id +.Pq Dv SIGEV_THREAD_ID . +The information for the queued signal will include: +.Bl -column ".Va si_value" +.It Sy Member Ta Sy Value +.It Va si_code Ta Dv SI_TIMER +.It Va si_value Ta +the value stored in +.Fa evp->sigev_value +.It Va si_timerid Ta timer ID +.It Va si_overrun Ta timer overrun count +.It Va si_errno Ta +If timer overrun is +.Brq Dv DELAYTIMER_MAX , +an error code defined in +.In errno.h +.El +.Pp If the .Fa evp argument is @@ -88,12 +118,14 @@ member having the value .Dv SIGEV_SIGNAL , the .Va sigev_signo -having a default signal number, and the +having a default signal number +.Pq Dv SIGALRM , +and the .Va sigev_value member having the value of the timer ID. .Pp -The implementations supports a +This implementation supports a .Fa clock_id of .Dv CLOCK_REALTIME @@ -144,6 +176,8 @@ The calling process has already created this implementation. .It Bq Er EINVAL The specified clock ID is not supported. +.It Bq Er EINVAL +The specified asynchronous notification method is not supported. .It Bq Er EFAULT Any arguments point outside the allocated address space or there is a memory protection fault. @@ -152,6 +186,7 @@ memory protection fault. .Xr clock_getres 2 , .Xr timer_delete 2 , .Xr timer_getoverrun 2 , +.Xr sigevent 3 , .Xr siginfo 3 .Sh STANDARDS The Modified: stable/11/share/man/man3/Makefile ============================================================================== --- stable/11/share/man/man3/Makefile Mon Jul 25 23:06:37 2016 (r303323) +++ stable/11/share/man/man3/Makefile Mon Jul 25 23:37:47 2016 (r303324) @@ -15,6 +15,7 @@ MAN= assert.3 \ offsetof.3 \ ${PTHREAD_MAN} \ queue.3 \ + sigevent.3 \ siginfo.3 \ stdarg.3 \ sysexits.3 \ Copied: stable/11/share/man/man3/sigevent.3 (from r302899, head/share/man/man3/sigevent.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man3/sigevent.3 Mon Jul 25 23:37:47 2016 (r303324, copy of r302899, head/share/man/man3/sigevent.3) @@ -0,0 +1,127 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2016 John H. Baldwin +.\" 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$ +.\" +.Dd July 15, 2016 +.Dt SIGEVENT 3 +.Os +.Sh NAME +.Nm sigevent +.Nd "asynchronous event notification" +.Sh SYNOPSIS +.In signal.h +.Sh DESCRIPTION +Some operations permit threads to request asychronous notification of events +via a +.Vt struct sigevent +structure. +This structure contains several fields that describe the requested notification: +.Bl -column ".Vt void (*)(union sigval)" ".Va sigev_notify_kevent_flags" +.It Sy Type Ta Sy Member Ta Sy Description +.It Vt int Ta sigev_notify Ta notification method +.It Vt int Ta sigev_signo Ta signal number +.It Vt union sigval Ta sigev_value Ta signal value +.It Vt int Ta sigev_notify_kqueue Ta +.Xr kqueue 2 +file descriptor +.It Vt unsigned short Ta sigev_notify_kevent_flags Ta kevent flags +.It Vt lwpid_t Ta sigev_notify_thread_id Ta LWP ID +.It Vt void (*)(union sigval) Ta sigev_notify_function Ta +callback function pointer +.It Vt pthread_attr_t * Ta sigev_notify_attributes Ta +callback thread attributes +.El +.Pp +The +.Va sigev_notify +field specifies the notification method used when the event triggers: +.Bl -tag -width ".Dv SIGEV_THREAD_ID" +.It Dv SIGEV_NONE +No notification is sent. +.It Dv SIGEV_SIGNAL +The signal +.Va sigev_signo +is queued as a real-time signal to the calling process. +The value stored in +.Va sigev_value +will be present in the +.Va si_value +of the +.Vt siginfo_t +structure of the queued signal. +.It Dv SIGEV_THREAD +The notification function in +.Va sigev_notify_function +is called in a separate thread context. +The thread is created with the attributes specified in +.Va *sigev_notify_attributes . +The value stored in +.Va sigev_value +is passed as the sole argument to +.Va sigev_notify_function . +If +.Va sigev_notify_attributes +is +.Dv NULL , +the thread is created with default attributes. +.It Dv SIGEV_KEVENT +A new kevent is posted to the kqueue +.Va sigev_notify_kqueue . +The +.Va udata +member of the kevent structure contains the value stored in +.Va sigev_value . +The meaning of other fields in the kevent are specific to the type of triggered +event. +.It Dv SIGEV_THREAD_ID +The signal +.Va sigev_signo +is queued to the thread whose LWP ID is +.Va sigev_notify_thread_id . +The value stored in +.Va sigev_value +will be present in the +.Va si_value +of the +.Vt siginfo_t +structure of the queued signal. +.El +.Sh NOTES +Note that programs wishing to use +.Dv SIGEV_THREAD +notifications must link against the +.Lb librt . +.Sh SEE ALSO +.Xr aio_read 2 , +.Xr mq_notify 2 , +.Xr timer_create 2 , +.Xr siginfo 3 +.Sh STANDARDS +The +.Vt struct sigevent +type conforms to +.St -p1003.1-2004 . Modified: stable/11/share/man/man4/aio.4 ============================================================================== --- stable/11/share/man/man4/aio.4 Mon Jul 25 23:06:37 2016 (r303323) +++ stable/11/share/man/man4/aio.4 Mon Jul 25 23:37:47 2016 (r303324) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2016 +.Dd July 15, 2016 .Dt AIO 4 .Os .Sh NAME @@ -137,6 +137,54 @@ The number of outstanding asynchronous I The maximum number of outstanding asynchronous I/O requests permitted system-wide. .El +.Pp +Asynchronous I/O control buffers should be zeroed before initializing +individual fields. +This ensures all fields are initialized. +.Pp +All asynchronous I/O control buffers contain a +.Vt sigevent +structure in the +.Va aio_sigevent +field which can be used to request notification when an operation completes. +.Pp +For +.Dv SIGEV_KEVENT +notifications, +the posted kevent will contain: +.Bl -column ".Va filter" +.It Sy Member Ta Sy Value +.It Va ident Ta asynchronous I/O control buffer pointer +.It Va filter Ta Dv EVFILT_AIO +.It Va udata Ta +value stored in +.Va aio_sigevent.sigev_value +.El +.Pp +For +.Dv SIGEV_SIGNO +and +.Dv SIGEV_THREAD_ID +notifications, +the information for the queued signal will include +.Dv SI_ASYNCIO +in the +.Va si_code +field and the value stored in +.Va sigevent.sigev_value +in the +.Va si_value +field. +.Pp +For +.Dv SIGEV_THREAD +notifications, +the value stored in +.Va aio_sigevent.sigev_value +is passed to the +.Va aio_sigevent.sigev_notify_function +as described in +.Xr sigevent 3 . .Sh SEE ALSO .Xr aio_cancel 2 , .Xr aio_error 2 , @@ -146,6 +194,7 @@ system-wide. .Xr aio_waitcomplete 2 , .Xr aio_write 2 , .Xr lio_listio 2 , +.Xr sigevent 3 , .Xr sysctl 8 .Sh HISTORY The From owner-svn-src-stable@freebsd.org Mon Jul 25 23:38:16 2016 Return-Path: Delivered-To: svn-src-stable@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 A908DBA5207; Mon, 25 Jul 2016 23:38:16 +0000 (UTC) (envelope-from jhb@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 7818818CB; Mon, 25 Jul 2016 23:38:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PNcFpo055632; Mon, 25 Jul 2016 23:38:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PNcErg055622; Mon, 25 Jul 2016 23:38:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607252338.u6PNcErg055622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 25 Jul 2016 23:38: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: r303325 - in stable: 10/lib/libc/sys 10/share/man/man3 10/share/man/man4 9/lib/libc/sys 9/share/man/man3 9/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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 23:38:16 -0000 Author: jhb Date: Mon Jul 25 23:38:14 2016 New Revision: 303325 URL: https://svnweb.freebsd.org/changeset/base/303325 Log: MFC 302899: Add documentation for the sigevent structure. - Add a sigevent(3) manpage to give a general overview of the sigevent structure and the available notification mechanisms. - Document that AIO requests contain a nested sigevent structure that can be used to request completion notification. - Expand the sigevent details in other manuals to note details such as the extra values stored in a queued signal's information or in a posted kevent. Added: stable/10/share/man/man3/sigevent.3 - copied unchanged from r302899, head/share/man/man3/sigevent.3 Modified: stable/10/lib/libc/sys/aio_fsync.2 stable/10/lib/libc/sys/aio_mlock.2 stable/10/lib/libc/sys/aio_read.2 stable/10/lib/libc/sys/aio_write.2 stable/10/lib/libc/sys/lio_listio.2 stable/10/lib/libc/sys/mq_notify.2 stable/10/lib/libc/sys/timer_create.2 stable/10/share/man/man3/Makefile stable/10/share/man/man4/aio.4 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Added: stable/9/share/man/man3/sigevent.3 - copied unchanged from r302899, head/share/man/man3/sigevent.3 Modified: stable/9/lib/libc/sys/aio_fsync.2 stable/9/lib/libc/sys/aio_read.2 stable/9/lib/libc/sys/aio_write.2 stable/9/lib/libc/sys/lio_listio.2 stable/9/lib/libc/sys/mq_notify.2 stable/9/lib/libc/sys/timer_create.2 stable/9/share/man/man3/Makefile stable/9/share/man/man4/aio.4 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) stable/9/share/man/man3/ (props changed) stable/9/share/man/man4/ (props changed) Modified: stable/10/lib/libc/sys/aio_fsync.2 ============================================================================== --- stable/10/lib/libc/sys/aio_fsync.2 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/10/lib/libc/sys/aio_fsync.2 Mon Jul 25 23:38:14 2016 (r303325) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 27, 2013 +.Dd July 15, 2016 .Dt AIO_FSYNC 2 .Os .Sh NAME @@ -71,6 +71,29 @@ while it is in progress. .Pp If the request could not be enqueued (generally due to invalid arguments), the call returns without having enqueued the request. +.Pp +The +.Fa iocb->aio_sigevent +structure can be used to request notification of the request's +completion as described in +.Xr aio 4 . +.Sh RESTRICTIONS +The asynchronous I/O Control Block structure pointed to by +.Fa iocb +must remain valid until the +operation has completed. +For this reason, use of auto (stack) variables +for these objects is discouraged. +.Pp +The asynchronous I/O control buffer +.Fa iocb +should be zeroed before the +.Fn aio_fsync +call to avoid passing bogus context information to the kernel. +.Pp +Modifications of the Asynchronous I/O Control Block structure or the +buffer contents after the request has been enqueued, but before the +request has completed, are not allowed. .Sh RETURN VALUES .Rv -std aio_fsync .Sh ERRORS @@ -80,6 +103,10 @@ system call will fail if: .Bl -tag -width Er .It Bq Er EAGAIN The request was not queued because of system resource limitations. +.It Bq Er EINVAL +The asynchronous notification method in +.Fa iocb->aio_sigevent.sigev_notify +is invalid or not supported. .It Bq Er ENOSYS The .Fn aio_fsync @@ -138,6 +165,7 @@ system calls. .Xr aio_waitcomplete 2 , .Xr aio_write 2 , .Xr fsync 2 , +.Xr sigevent 3 , .Xr siginfo 3 , .Xr aio 4 .Sh STANDARDS Modified: stable/10/lib/libc/sys/aio_mlock.2 ============================================================================== --- stable/10/lib/libc/sys/aio_mlock.2 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/10/lib/libc/sys/aio_mlock.2 Mon Jul 25 23:38:14 2016 (r303325) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 3, 2013 +.Dd July 15, 2016 .Dt AIO_MLOCK 2 .Os .Sh NAME @@ -64,6 +64,12 @@ If the request could not be enqueued (ge .Xr aio 4 limits), then the call returns without having enqueued the request. +.Pp +The +.Fa iocb->aio_sigevent +structure can be used to request notification of the request's +completion as described in +.Xr aio 4 . .Sh RESTRICTIONS The Asynchronous I/O Control Block structure pointed to by .Fa iocb @@ -92,6 +98,10 @@ system call will fail if: .Bl -tag -width Er .It Bq Er EAGAIN The request was not queued because of system resource limitations. +.It Bq Er EINVAL +The asynchronous notification method in +.Fa iocb->aio_sigevent.sigev_notify +is invalid or not supported. .It Bq Er ENOSYS The .Fn aio_mlock @@ -116,6 +126,7 @@ if the request was explicitly cancelled .Xr aio_error 2 , .Xr aio_return 2 , .Xr mlock 2 , +.Xr sigevent 3 , .Xr aio 4 .Sh PORTABILITY The Modified: stable/10/lib/libc/sys/aio_read.2 ============================================================================== --- stable/10/lib/libc/sys/aio_read.2 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/10/lib/libc/sys/aio_read.2 Mon Jul 25 23:38:14 2016 (r303325) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 1998 +.Dd July 15, 2016 .Dt AIO_READ 2 .Os .Sh NAME @@ -79,6 +79,12 @@ If the request is successfully enqueued, .Fa iocb->aio_offset can be modified during the request as context, so this value must not be referenced after the request is enqueued. +.Pp +The +.Fa iocb->aio_sigevent +structure can be used to request notification of the request's +completion as described in +.Xr aio 4 . .Sh RESTRICTIONS The Asynchronous I/O Control Block structure pointed to by .Fa iocb @@ -115,6 +121,10 @@ system call will fail if: .Bl -tag -width Er .It Bq Er EAGAIN The request was not queued because of system resource limitations. +.It Bq Er EINVAL +The asynchronous notification method in +.Fa iocb->aio_sigevent.sigev_notify +is invalid or not supported. .It Bq Er ENOSYS The .Fn aio_read @@ -191,6 +201,7 @@ would be invalid. .Xr aio_suspend 2 , .Xr aio_waitcomplete 2 , .Xr aio_write 2 , +.Xr sigevent 3 , .Xr siginfo 3 , .Xr aio 4 .Sh STANDARDS Modified: stable/10/lib/libc/sys/aio_write.2 ============================================================================== --- stable/10/lib/libc/sys/aio_write.2 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/10/lib/libc/sys/aio_write.2 Mon Jul 25 23:38:14 2016 (r303325) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 1999 +.Dd July 15, 2016 .Dt AIO_WRITE 2 .Os .Sh NAME @@ -85,6 +85,12 @@ If the request is successfully enqueued, .Fa iocb->aio_offset can be modified during the request as context, so this value must not be referenced after the request is enqueued. +.Pp +The +.Fa iocb->aio_sigevent +structure can be used to request notification of the request's +completion as described in +.Xr aio 4 . .Sh RESTRICTIONS The Asynchronous I/O Control Block structure pointed to by .Fa iocb @@ -119,6 +125,10 @@ system call will fail if: .Bl -tag -width Er .It Bq Er EAGAIN The request was not queued because of system resource limitations. +.It Bq Er EINVAL +The asynchronous notification method in +.Fa iocb->aio_sigevent.sigev_notify +is invalid or not supported. .It Bq Er ENOSYS The .Fn aio_write @@ -186,6 +196,7 @@ would be invalid. .Xr aio_return 2 , .Xr aio_suspend 2 , .Xr aio_waitcomplete 2 , +.Xr sigevent 3 , .Xr siginfo 3 , .Xr aio 4 .Sh STANDARDS Modified: stable/10/lib/libc/sys/lio_listio.2 ============================================================================== --- stable/10/lib/libc/sys/lio_listio.2 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/10/lib/libc/sys/lio_listio.2 Mon Jul 25 23:38:14 2016 (r303325) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2003 +.Dd July 15, 2016 .Dt LIO_LISTIO 2 .Os .Sh NAME @@ -83,14 +83,52 @@ If .Fa mode is .Dv LIO_NOWAIT , -the requests are processed asynchronously, and the signal specified by .Fa sig -is sent when all operations have completed. +can be used to request asynchronous notification when all operations have +completed. If .Fa sig is .Dv NULL , -the calling process is not notified of I/O completion. +no notification is sent. +.Pp +For +.Dv SIGEV_KEVENT +notifications, +the posted kevent will contain: +.Bl -column ".Va filter" +.It Sy Member Ta Sy Value +.It Va ident Ta Fa list +.It Va filter Ta Dv EVFILT_LIO +.It Va udata Ta +value stored in +.Fa sig->sigev_value +.El +.Pp +For +.Dv SIGEV_SIGNO +and +.Dv SIGEV_THREAD_ID +notifications, +the information for the queued signal will include +.Dv SI_ASYNCIO +in the +.Va si_code +field and the value stored in +.Fa sig->sigev_value +in the +.Va si_value +field. +.Pp +For +.Dv SIGEV_THREAD +notifications, +the value stored in +.Fa sig->sigev_value +is passed to the +.Fa sig->sigev_notify_function +as described in +.Xr sigevent 3 . .Pp The order in which the requests are carried out is not specified; in particular, there is no guarantee that they will be executed in @@ -136,6 +174,10 @@ or .Fa nent is greater than .Dv AIO_LISTIO_MAX . +.It Bq Er EINVAL +The asynchronous notification method in +.Fa sig->sigev_notify +is invalid or not supported. .It Bq Er EINTR A signal interrupted the system call before it could be completed. .It Bq Er EIO @@ -166,6 +208,7 @@ structure individually by calling .Xr aio_write 2 , .Xr read 2 , .Xr write 2 , +.Xr sigevent 3 , .Xr siginfo 3 , .Xr aio 4 .Sh STANDARDS Modified: stable/10/lib/libc/sys/mq_notify.2 ============================================================================== --- stable/10/lib/libc/sys/mq_notify.2 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/10/lib/libc/sys/mq_notify.2 Mon Jul 25 23:38:14 2016 (r303325) @@ -37,7 +37,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2005 +.Dd July 15, 2016 .Dt MQ_NOTIFY 2 .Os .Sh NAME @@ -77,18 +77,27 @@ is .Dv SIGEV_NONE , then no signal will be posted, but the error status and the return status for the operation will be set appropriately. -If -.Fa notification->sigev_notify -is -.Dv SIGEV_SIGNAL , -then the signal specified in +For +.Dv SIGEV_SIGNO +and +.Dv SIGEV_THREAD_ID +notifications, +the signal specified in .Fa notification->sigev_signo -will be sent to the process. -The signal will be queued to the process and the value specified in +will be sent to the calling process +.Pq Dv SIGEV_SIGNO +or to the thread whose LWP ID is +.Fa notification->sigev_notify_thread_id +.Pq Dv SIGEV_THREAD_ID . +The information for the queued signal will include: +.Bl -column ".Va si_value" +.It Sy Member Ta Sy Value +.It Va si_code Ta Dv SI_MESGQ +.It Va si_value Ta +the value stored in .Fa notification->sigev_value -will be the -.Va si_value -component of the generated signal. +.It Va si_mqd Ta Fa mqdes +.El .Pp If .Fa notification @@ -123,11 +132,16 @@ The argument is not a valid message queue descriptor. .It Bq Er EBUSY Process is already registered for notification by the message queue. +.It Bq Er EINVAL +The asynchronous notification method in +.Fa notification->sigev_notify +is invalid or not supported. .El .Sh SEE ALSO .Xr mq_open 2 , .Xr mq_send 2 , .Xr mq_timedsend 2 , +.Xr sigevent 3 , .Xr siginfo 3 .Sh STANDARDS The Modified: stable/10/lib/libc/sys/timer_create.2 ============================================================================== --- stable/10/lib/libc/sys/timer_create.2 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/10/lib/libc/sys/timer_create.2 Mon Jul 25 23:38:14 2016 (r303325) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2009 +.Dd July 15, 2016 .Dt TIMER_CREATE 2 .Os .Sh NAME @@ -74,6 +74,36 @@ structure. This structure, allocated by the application, defines the asynchronous notification to occur when the timer expires. +.Pp +If +.Fa evp->sigev_notify +is +.Dv SIGEV_SIGNO +or +.Dv SIGEV_THREAD_ID , +the signal specified in +.Fa evp->sigev_signo +will be sent to the calling process +.Pq Dv SIGEV_SIGNO +or to the thread whose LWP ID is +.Fa evp->sigev_notify_thread_id +.Pq Dv SIGEV_THREAD_ID . +The information for the queued signal will include: +.Bl -column ".Va si_value" +.It Sy Member Ta Sy Value +.It Va si_code Ta Dv SI_TIMER +.It Va si_value Ta +the value stored in +.Fa evp->sigev_value +.It Va si_timerid Ta timer ID +.It Va si_overrun Ta timer overrun count +.It Va si_errno Ta +If timer overrun is +.Brq Dv DELAYTIMER_MAX , +an error code defined in +.In errno.h +.El +.Pp If the .Fa evp argument is @@ -88,12 +118,14 @@ member having the value .Dv SIGEV_SIGNAL , the .Va sigev_signo -having a default signal number, and the +having a default signal number +.Pq Dv SIGALRM , +and the .Va sigev_value member having the value of the timer ID. .Pp -The implementations supports a +This implementation supports a .Fa clock_id of .Dv CLOCK_REALTIME @@ -144,6 +176,8 @@ The calling process has already created this implementation. .It Bq Er EINVAL The specified clock ID is not supported. +.It Bq Er EINVAL +The specified asynchronous notification method is not supported. .It Bq Er EFAULT Any arguments point outside the allocated address space or there is a memory protection fault. @@ -152,6 +186,7 @@ memory protection fault. .Xr clock_getres 2 , .Xr timer_delete 2 , .Xr timer_getoverrun 2 , +.Xr sigevent 3 , .Xr siginfo 3 .Sh STANDARDS The Modified: stable/10/share/man/man3/Makefile ============================================================================== --- stable/10/share/man/man3/Makefile Mon Jul 25 23:37:47 2016 (r303324) +++ stable/10/share/man/man3/Makefile Mon Jul 25 23:38:14 2016 (r303325) @@ -13,6 +13,7 @@ MAN= assert.3 \ offsetof.3 \ ${PTHREAD_MAN} \ queue.3 \ + sigevent.3 \ siginfo.3 \ stdarg.3 \ sysexits.3 \ Copied: stable/10/share/man/man3/sigevent.3 (from r302899, head/share/man/man3/sigevent.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man3/sigevent.3 Mon Jul 25 23:38:14 2016 (r303325, copy of r302899, head/share/man/man3/sigevent.3) @@ -0,0 +1,127 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2016 John H. Baldwin +.\" 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$ +.\" +.Dd July 15, 2016 +.Dt SIGEVENT 3 +.Os +.Sh NAME +.Nm sigevent +.Nd "asynchronous event notification" +.Sh SYNOPSIS +.In signal.h +.Sh DESCRIPTION +Some operations permit threads to request asychronous notification of events +via a +.Vt struct sigevent +structure. +This structure contains several fields that describe the requested notification: +.Bl -column ".Vt void (*)(union sigval)" ".Va sigev_notify_kevent_flags" +.It Sy Type Ta Sy Member Ta Sy Description +.It Vt int Ta sigev_notify Ta notification method +.It Vt int Ta sigev_signo Ta signal number +.It Vt union sigval Ta sigev_value Ta signal value +.It Vt int Ta sigev_notify_kqueue Ta +.Xr kqueue 2 +file descriptor +.It Vt unsigned short Ta sigev_notify_kevent_flags Ta kevent flags +.It Vt lwpid_t Ta sigev_notify_thread_id Ta LWP ID +.It Vt void (*)(union sigval) Ta sigev_notify_function Ta +callback function pointer +.It Vt pthread_attr_t * Ta sigev_notify_attributes Ta +callback thread attributes +.El +.Pp +The +.Va sigev_notify +field specifies the notification method used when the event triggers: +.Bl -tag -width ".Dv SIGEV_THREAD_ID" +.It Dv SIGEV_NONE +No notification is sent. +.It Dv SIGEV_SIGNAL +The signal +.Va sigev_signo +is queued as a real-time signal to the calling process. +The value stored in +.Va sigev_value +will be present in the +.Va si_value +of the +.Vt siginfo_t +structure of the queued signal. +.It Dv SIGEV_THREAD +The notification function in +.Va sigev_notify_function +is called in a separate thread context. +The thread is created with the attributes specified in +.Va *sigev_notify_attributes . +The value stored in +.Va sigev_value +is passed as the sole argument to +.Va sigev_notify_function . +If +.Va sigev_notify_attributes +is +.Dv NULL , +the thread is created with default attributes. +.It Dv SIGEV_KEVENT +A new kevent is posted to the kqueue +.Va sigev_notify_kqueue . +The +.Va udata +member of the kevent structure contains the value stored in +.Va sigev_value . +The meaning of other fields in the kevent are specific to the type of triggered +event. +.It Dv SIGEV_THREAD_ID +The signal +.Va sigev_signo +is queued to the thread whose LWP ID is +.Va sigev_notify_thread_id . +The value stored in +.Va sigev_value +will be present in the +.Va si_value +of the +.Vt siginfo_t +structure of the queued signal. +.El +.Sh NOTES +Note that programs wishing to use +.Dv SIGEV_THREAD +notifications must link against the +.Lb librt . +.Sh SEE ALSO +.Xr aio_read 2 , +.Xr mq_notify 2 , +.Xr timer_create 2 , +.Xr siginfo 3 +.Sh STANDARDS +The +.Vt struct sigevent +type conforms to +.St -p1003.1-2004 . Modified: stable/10/share/man/man4/aio.4 ============================================================================== --- stable/10/share/man/man4/aio.4 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/10/share/man/man4/aio.4 Mon Jul 25 23:38:14 2016 (r303325) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 24, 2002 +.Dd July 15, 2016 .Dt AIO 4 .Os .Sh NAME @@ -45,6 +45,54 @@ The facility provides system calls for asynchronous I/O. It is available both as a kernel option for static inclusion and as a dynamic kernel module. +.Pp +Asynchronous I/O control buffers should be zeroed before initializing +individual fields. +This ensures all fields are initialized. +.Pp +All asynchronous I/O control buffers contain a +.Vt sigevent +structure in the +.Va aio_sigevent +field which can be used to request notification when an operation completes. +.Pp +For +.Dv SIGEV_KEVENT +notifications, +the posted kevent will contain: +.Bl -column ".Va filter" +.It Sy Member Ta Sy Value +.It Va ident Ta asynchronous I/O control buffer pointer +.It Va filter Ta Dv EVFILT_AIO +.It Va udata Ta +value stored in +.Va aio_sigevent.sigev_value +.El +.Pp +For +.Dv SIGEV_SIGNO +and +.Dv SIGEV_THREAD_ID +notifications, +the information for the queued signal will include +.Dv SI_ASYNCIO +in the +.Va si_code +field and the value stored in +.Va sigevent.sigev_value +in the +.Va si_value +field. +.Pp +For +.Dv SIGEV_THREAD +notifications, +the value stored in +.Va aio_sigevent.sigev_value +is passed to the +.Va aio_sigevent.sigev_notify_function +as described in +.Xr sigevent 3 . .Sh SEE ALSO .Xr aio_cancel 2 , .Xr aio_error 2 , @@ -54,6 +102,7 @@ dynamic kernel module. .Xr aio_waitcomplete 2 , .Xr aio_write 2 , .Xr lio_listio 2 , +.Xr sigevent 3 , .Xr config 8 , .Xr kldload 8 , .Xr kldunload 8 From owner-svn-src-stable@freebsd.org Mon Jul 25 23:38:17 2016 Return-Path: Delivered-To: svn-src-stable@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 BCB2DBA5210; Mon, 25 Jul 2016 23:38:17 +0000 (UTC) (envelope-from jhb@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 814B118CD; Mon, 25 Jul 2016 23:38:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6PNcGTM055646; Mon, 25 Jul 2016 23:38:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PNcFjF055637; Mon, 25 Jul 2016 23:38:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607252338.u6PNcFjF055637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 25 Jul 2016 23:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r303325 - in stable: 10/lib/libc/sys 10/share/man/man3 10/share/man/man4 9/lib/libc/sys 9/share/man/man3 9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 23:38:17 -0000 Author: jhb Date: Mon Jul 25 23:38:14 2016 New Revision: 303325 URL: https://svnweb.freebsd.org/changeset/base/303325 Log: MFC 302899: Add documentation for the sigevent structure. - Add a sigevent(3) manpage to give a general overview of the sigevent structure and the available notification mechanisms. - Document that AIO requests contain a nested sigevent structure that can be used to request completion notification. - Expand the sigevent details in other manuals to note details such as the extra values stored in a queued signal's information or in a posted kevent. Added: stable/9/share/man/man3/sigevent.3 - copied unchanged from r302899, head/share/man/man3/sigevent.3 Modified: stable/9/lib/libc/sys/aio_fsync.2 stable/9/lib/libc/sys/aio_read.2 stable/9/lib/libc/sys/aio_write.2 stable/9/lib/libc/sys/lio_listio.2 stable/9/lib/libc/sys/mq_notify.2 stable/9/lib/libc/sys/timer_create.2 stable/9/share/man/man3/Makefile stable/9/share/man/man4/aio.4 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) stable/9/share/man/man3/ (props changed) stable/9/share/man/man4/ (props changed) Changes in other areas also in this revision: Added: stable/10/share/man/man3/sigevent.3 - copied unchanged from r302899, head/share/man/man3/sigevent.3 Modified: stable/10/lib/libc/sys/aio_fsync.2 stable/10/lib/libc/sys/aio_mlock.2 stable/10/lib/libc/sys/aio_read.2 stable/10/lib/libc/sys/aio_write.2 stable/10/lib/libc/sys/lio_listio.2 stable/10/lib/libc/sys/mq_notify.2 stable/10/lib/libc/sys/timer_create.2 stable/10/share/man/man3/Makefile stable/10/share/man/man4/aio.4 Directory Properties: stable/10/ (props changed) Modified: stable/9/lib/libc/sys/aio_fsync.2 ============================================================================== --- stable/9/lib/libc/sys/aio_fsync.2 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/9/lib/libc/sys/aio_fsync.2 Mon Jul 25 23:38:14 2016 (r303325) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 27, 2013 +.Dd July 15, 2016 .Dt AIO_FSYNC 2 .Os .Sh NAME @@ -71,6 +71,29 @@ while it is in progress. .Pp If the request could not be enqueued (generally due to invalid arguments), the call returns without having enqueued the request. +.Pp +The +.Fa iocb->aio_sigevent +structure can be used to request notification of the request's +completion as described in +.Xr aio 4 . +.Sh RESTRICTIONS +The asynchronous I/O Control Block structure pointed to by +.Fa iocb +must remain valid until the +operation has completed. +For this reason, use of auto (stack) variables +for these objects is discouraged. +.Pp +The asynchronous I/O control buffer +.Fa iocb +should be zeroed before the +.Fn aio_fsync +call to avoid passing bogus context information to the kernel. +.Pp +Modifications of the Asynchronous I/O Control Block structure or the +buffer contents after the request has been enqueued, but before the +request has completed, are not allowed. .Sh RETURN VALUES .Rv -std aio_fsync .Sh ERRORS @@ -80,6 +103,10 @@ system call will fail if: .Bl -tag -width Er .It Bq Er EAGAIN The request was not queued because of system resource limitations. +.It Bq Er EINVAL +The asynchronous notification method in +.Fa iocb->aio_sigevent.sigev_notify +is invalid or not supported. .It Bq Er ENOSYS The .Fn aio_fsync @@ -138,6 +165,7 @@ system calls. .Xr aio_waitcomplete 2 , .Xr aio_write 2 , .Xr fsync 2 , +.Xr sigevent 3 , .Xr siginfo 3 , .Xr aio 4 .Sh STANDARDS Modified: stable/9/lib/libc/sys/aio_read.2 ============================================================================== --- stable/9/lib/libc/sys/aio_read.2 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/9/lib/libc/sys/aio_read.2 Mon Jul 25 23:38:14 2016 (r303325) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 1998 +.Dd July 15, 2016 .Dt AIO_READ 2 .Os .Sh NAME @@ -79,6 +79,12 @@ If the request is successfully enqueued, .Fa iocb->aio_offset can be modified during the request as context, so this value must not be referenced after the request is enqueued. +.Pp +The +.Fa iocb->aio_sigevent +structure can be used to request notification of the request's +completion as described in +.Xr aio 4 . .Sh RESTRICTIONS The Asynchronous I/O Control Block structure pointed to by .Fa iocb @@ -115,6 +121,10 @@ system call will fail if: .Bl -tag -width Er .It Bq Er EAGAIN The request was not queued because of system resource limitations. +.It Bq Er EINVAL +The asynchronous notification method in +.Fa iocb->aio_sigevent.sigev_notify +is invalid or not supported. .It Bq Er ENOSYS The .Fn aio_read @@ -191,6 +201,7 @@ would be invalid. .Xr aio_suspend 2 , .Xr aio_waitcomplete 2 , .Xr aio_write 2 , +.Xr sigevent 3 , .Xr siginfo 3 , .Xr aio 4 .Sh STANDARDS Modified: stable/9/lib/libc/sys/aio_write.2 ============================================================================== --- stable/9/lib/libc/sys/aio_write.2 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/9/lib/libc/sys/aio_write.2 Mon Jul 25 23:38:14 2016 (r303325) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 1999 +.Dd July 15, 2016 .Dt AIO_WRITE 2 .Os .Sh NAME @@ -85,6 +85,12 @@ If the request is successfully enqueued, .Fa iocb->aio_offset can be modified during the request as context, so this value must not be referenced after the request is enqueued. +.Pp +The +.Fa iocb->aio_sigevent +structure can be used to request notification of the request's +completion as described in +.Xr aio 4 . .Sh RESTRICTIONS The Asynchronous I/O Control Block structure pointed to by .Fa iocb @@ -119,6 +125,10 @@ system call will fail if: .Bl -tag -width Er .It Bq Er EAGAIN The request was not queued because of system resource limitations. +.It Bq Er EINVAL +The asynchronous notification method in +.Fa iocb->aio_sigevent.sigev_notify +is invalid or not supported. .It Bq Er ENOSYS The .Fn aio_write @@ -186,6 +196,7 @@ would be invalid. .Xr aio_return 2 , .Xr aio_suspend 2 , .Xr aio_waitcomplete 2 , +.Xr sigevent 3 , .Xr siginfo 3 , .Xr aio 4 .Sh STANDARDS Modified: stable/9/lib/libc/sys/lio_listio.2 ============================================================================== --- stable/9/lib/libc/sys/lio_listio.2 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/9/lib/libc/sys/lio_listio.2 Mon Jul 25 23:38:14 2016 (r303325) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2003 +.Dd July 15, 2016 .Dt LIO_LISTIO 2 .Os .Sh NAME @@ -83,14 +83,52 @@ If .Fa mode is .Dv LIO_NOWAIT , -the requests are processed asynchronously, and the signal specified by .Fa sig -is sent when all operations have completed. +can be used to request asynchronous notification when all operations have +completed. If .Fa sig is .Dv NULL , -the calling process is not notified of I/O completion. +no notification is sent. +.Pp +For +.Dv SIGEV_KEVENT +notifications, +the posted kevent will contain: +.Bl -column ".Va filter" +.It Sy Member Ta Sy Value +.It Va ident Ta Fa list +.It Va filter Ta Dv EVFILT_LIO +.It Va udata Ta +value stored in +.Fa sig->sigev_value +.El +.Pp +For +.Dv SIGEV_SIGNO +and +.Dv SIGEV_THREAD_ID +notifications, +the information for the queued signal will include +.Dv SI_ASYNCIO +in the +.Va si_code +field and the value stored in +.Fa sig->sigev_value +in the +.Va si_value +field. +.Pp +For +.Dv SIGEV_THREAD +notifications, +the value stored in +.Fa sig->sigev_value +is passed to the +.Fa sig->sigev_notify_function +as described in +.Xr sigevent 3 . .Pp The order in which the requests are carried out is not specified; in particular, there is no guarantee that they will be executed in @@ -136,6 +174,10 @@ or .Fa nent is greater than .Dv AIO_LISTIO_MAX . +.It Bq Er EINVAL +The asynchronous notification method in +.Fa sig->sigev_notify +is invalid or not supported. .It Bq Er EINTR A signal interrupted the system call before it could be completed. .It Bq Er EIO @@ -166,6 +208,7 @@ structure individually by calling .Xr aio_write 2 , .Xr read 2 , .Xr write 2 , +.Xr sigevent 3 , .Xr siginfo 3 , .Xr aio 4 .Sh STANDARDS Modified: stable/9/lib/libc/sys/mq_notify.2 ============================================================================== --- stable/9/lib/libc/sys/mq_notify.2 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/9/lib/libc/sys/mq_notify.2 Mon Jul 25 23:38:14 2016 (r303325) @@ -37,7 +37,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2005 +.Dd July 15, 2016 .Dt MQ_NOTIFY 2 .Os .Sh NAME @@ -77,18 +77,27 @@ is .Dv SIGEV_NONE , then no signal will be posted, but the error status and the return status for the operation will be set appropriately. -If -.Fa notification->sigev_notify -is -.Dv SIGEV_SIGNAL , -then the signal specified in +For +.Dv SIGEV_SIGNO +and +.Dv SIGEV_THREAD_ID +notifications, +the signal specified in .Fa notification->sigev_signo -will be sent to the process. -The signal will be queued to the process and the value specified in +will be sent to the calling process +.Pq Dv SIGEV_SIGNO +or to the thread whose LWP ID is +.Fa notification->sigev_notify_thread_id +.Pq Dv SIGEV_THREAD_ID . +The information for the queued signal will include: +.Bl -column ".Va si_value" +.It Sy Member Ta Sy Value +.It Va si_code Ta Dv SI_MESGQ +.It Va si_value Ta +the value stored in .Fa notification->sigev_value -will be the -.Va si_value -component of the generated signal. +.It Va si_mqd Ta Fa mqdes +.El .Pp If .Fa notification @@ -123,11 +132,16 @@ The argument is not a valid message queue descriptor. .It Bq Er EBUSY Process is already registered for notification by the message queue. +.It Bq Er EINVAL +The asynchronous notification method in +.Fa notification->sigev_notify +is invalid or not supported. .El .Sh SEE ALSO .Xr mq_open 2 , .Xr mq_send 2 , .Xr mq_timedsend 2 , +.Xr sigevent 3 , .Xr siginfo 3 .Sh STANDARDS The Modified: stable/9/lib/libc/sys/timer_create.2 ============================================================================== --- stable/9/lib/libc/sys/timer_create.2 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/9/lib/libc/sys/timer_create.2 Mon Jul 25 23:38:14 2016 (r303325) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2009 +.Dd July 15, 2016 .Dt TIMER_CREATE 2 .Os .Sh NAME @@ -74,6 +74,36 @@ structure. This structure, allocated by the application, defines the asynchronous notification to occur when the timer expires. +.Pp +If +.Fa evp->sigev_notify +is +.Dv SIGEV_SIGNO +or +.Dv SIGEV_THREAD_ID , +the signal specified in +.Fa evp->sigev_signo +will be sent to the calling process +.Pq Dv SIGEV_SIGNO +or to the thread whose LWP ID is +.Fa evp->sigev_notify_thread_id +.Pq Dv SIGEV_THREAD_ID . +The information for the queued signal will include: +.Bl -column ".Va si_value" +.It Sy Member Ta Sy Value +.It Va si_code Ta Dv SI_TIMER +.It Va si_value Ta +the value stored in +.Fa evp->sigev_value +.It Va si_timerid Ta timer ID +.It Va si_overrun Ta timer overrun count +.It Va si_errno Ta +If timer overrun is +.Brq Dv DELAYTIMER_MAX , +an error code defined in +.In errno.h +.El +.Pp If the .Fa evp argument is @@ -88,12 +118,14 @@ member having the value .Dv SIGEV_SIGNAL , the .Va sigev_signo -having a default signal number, and the +having a default signal number +.Pq Dv SIGALRM , +and the .Va sigev_value member having the value of the timer ID. .Pp -The implementations supports a +This implementation supports a .Fa clock_id of .Dv CLOCK_REALTIME @@ -144,6 +176,8 @@ The calling process has already created this implementation. .It Bq Er EINVAL The specified clock ID is not supported. +.It Bq Er EINVAL +The specified asynchronous notification method is not supported. .It Bq Er EFAULT Any arguments point outside the allocated address space or there is a memory protection fault. @@ -152,6 +186,7 @@ memory protection fault. .Xr clock_getres 2 , .Xr timer_delete 2 , .Xr timer_getoverrun 2 , +.Xr sigevent 3 , .Xr siginfo 3 .Sh STANDARDS The Modified: stable/9/share/man/man3/Makefile ============================================================================== --- stable/9/share/man/man3/Makefile Mon Jul 25 23:37:47 2016 (r303324) +++ stable/9/share/man/man3/Makefile Mon Jul 25 23:38:14 2016 (r303325) @@ -11,6 +11,7 @@ MAN= assert.3 \ makedev.3 \ ${PTHREAD_MAN} \ queue.3 \ + sigevent.3 \ siginfo.3 \ stdarg.3 \ sysexits.3 \ Copied: stable/9/share/man/man3/sigevent.3 (from r302899, head/share/man/man3/sigevent.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man3/sigevent.3 Mon Jul 25 23:38:14 2016 (r303325, copy of r302899, head/share/man/man3/sigevent.3) @@ -0,0 +1,127 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2016 John H. Baldwin +.\" 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$ +.\" +.Dd July 15, 2016 +.Dt SIGEVENT 3 +.Os +.Sh NAME +.Nm sigevent +.Nd "asynchronous event notification" +.Sh SYNOPSIS +.In signal.h +.Sh DESCRIPTION +Some operations permit threads to request asychronous notification of events +via a +.Vt struct sigevent +structure. +This structure contains several fields that describe the requested notification: +.Bl -column ".Vt void (*)(union sigval)" ".Va sigev_notify_kevent_flags" +.It Sy Type Ta Sy Member Ta Sy Description +.It Vt int Ta sigev_notify Ta notification method +.It Vt int Ta sigev_signo Ta signal number +.It Vt union sigval Ta sigev_value Ta signal value +.It Vt int Ta sigev_notify_kqueue Ta +.Xr kqueue 2 +file descriptor +.It Vt unsigned short Ta sigev_notify_kevent_flags Ta kevent flags +.It Vt lwpid_t Ta sigev_notify_thread_id Ta LWP ID +.It Vt void (*)(union sigval) Ta sigev_notify_function Ta +callback function pointer +.It Vt pthread_attr_t * Ta sigev_notify_attributes Ta +callback thread attributes +.El +.Pp +The +.Va sigev_notify +field specifies the notification method used when the event triggers: +.Bl -tag -width ".Dv SIGEV_THREAD_ID" +.It Dv SIGEV_NONE +No notification is sent. +.It Dv SIGEV_SIGNAL +The signal +.Va sigev_signo +is queued as a real-time signal to the calling process. +The value stored in +.Va sigev_value +will be present in the +.Va si_value +of the +.Vt siginfo_t +structure of the queued signal. +.It Dv SIGEV_THREAD +The notification function in +.Va sigev_notify_function +is called in a separate thread context. +The thread is created with the attributes specified in +.Va *sigev_notify_attributes . +The value stored in +.Va sigev_value +is passed as the sole argument to +.Va sigev_notify_function . +If +.Va sigev_notify_attributes +is +.Dv NULL , +the thread is created with default attributes. +.It Dv SIGEV_KEVENT +A new kevent is posted to the kqueue +.Va sigev_notify_kqueue . +The +.Va udata +member of the kevent structure contains the value stored in +.Va sigev_value . +The meaning of other fields in the kevent are specific to the type of triggered +event. +.It Dv SIGEV_THREAD_ID +The signal +.Va sigev_signo +is queued to the thread whose LWP ID is +.Va sigev_notify_thread_id . +The value stored in +.Va sigev_value +will be present in the +.Va si_value +of the +.Vt siginfo_t +structure of the queued signal. +.El +.Sh NOTES +Note that programs wishing to use +.Dv SIGEV_THREAD +notifications must link against the +.Lb librt . +.Sh SEE ALSO +.Xr aio_read 2 , +.Xr mq_notify 2 , +.Xr timer_create 2 , +.Xr siginfo 3 +.Sh STANDARDS +The +.Vt struct sigevent +type conforms to +.St -p1003.1-2004 . Modified: stable/9/share/man/man4/aio.4 ============================================================================== --- stable/9/share/man/man4/aio.4 Mon Jul 25 23:37:47 2016 (r303324) +++ stable/9/share/man/man4/aio.4 Mon Jul 25 23:38:14 2016 (r303325) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 24, 2002 +.Dd July 15, 2016 .Dt AIO 4 .Os .Sh NAME @@ -45,6 +45,54 @@ The facility provides system calls for asynchronous I/O. It is available both as a kernel option for static inclusion and as a dynamic kernel module. +.Pp +Asynchronous I/O control buffers should be zeroed before initializing +individual fields. +This ensures all fields are initialized. +.Pp +All asynchronous I/O control buffers contain a +.Vt sigevent +structure in the +.Va aio_sigevent +field which can be used to request notification when an operation completes. +.Pp +For +.Dv SIGEV_KEVENT +notifications, +the posted kevent will contain: +.Bl -column ".Va filter" +.It Sy Member Ta Sy Value +.It Va ident Ta asynchronous I/O control buffer pointer +.It Va filter Ta Dv EVFILT_AIO +.It Va udata Ta +value stored in +.Va aio_sigevent.sigev_value +.El +.Pp +For +.Dv SIGEV_SIGNO +and +.Dv SIGEV_THREAD_ID +notifications, +the information for the queued signal will include +.Dv SI_ASYNCIO +in the +.Va si_code +field and the value stored in +.Va sigevent.sigev_value +in the +.Va si_value +field. +.Pp +For +.Dv SIGEV_THREAD +notifications, +the value stored in +.Va aio_sigevent.sigev_value +is passed to the +.Va aio_sigevent.sigev_notify_function +as described in +.Xr sigevent 3 . .Sh SEE ALSO .Xr aio_cancel 2 , .Xr aio_error 2 , @@ -54,6 +102,7 @@ dynamic kernel module. .Xr aio_waitcomplete 2 , .Xr aio_write 2 , .Xr lio_listio 2 , +.Xr sigevent 3 , .Xr config 8 , .Xr kldload 8 , .Xr kldunload 8 From owner-svn-src-stable@freebsd.org Tue Jul 26 05:26:08 2016 Return-Path: Delivered-To: svn-src-stable@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 C8D69BA515F; Tue, 26 Jul 2016 05:26:08 +0000 (UTC) (envelope-from allanjude@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 8488E1F4E; Tue, 26 Jul 2016 05:26:08 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6Q5Q7ZQ086700; Tue, 26 Jul 2016 05:26:07 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6Q5Q7qK086699; Tue, 26 Jul 2016 05:26:07 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201607260526.u6Q5Q7qK086699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 26 Jul 2016 05:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303330 - stable/11/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2016 05:26:08 -0000 Author: allanjude Date: Tue Jul 26 05:26:07 2016 New Revision: 303330 URL: https://svnweb.freebsd.org/changeset/base/303330 Log: MFC: r302941 At the start of the installation process, all ZFS pools are exported and all GELI instances are detached, to allow a restarted install to proceed. PR: 210814 Approved by: re (gjb) Modified: stable/11/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/zfsboot Tue Jul 26 05:06:00 2016 (r303329) +++ stable/11/usr.sbin/bsdinstall/scripts/zfsboot Tue Jul 26 05:26:07 2016 (r303330) @@ -224,6 +224,7 @@ ZFS_UNMOUNT='zfs unmount "%s"' ZPOOL_CREATE_WITH_OPTIONS='zpool create %s "%s" %s %s' ZPOOL_DESTROY='zpool destroy "%s"' ZPOOL_EXPORT='zpool export "%s"' +ZPOOL_EXPORT_F='zpool export -f "%s"' ZPOOL_IMPORT_WITH_OPTIONS='zpool import %s "%s"' ZPOOL_LABELCLEAR_F='zpool labelclear -f "%s"' ZPOOL_SET='zpool set %s "%s"' @@ -783,6 +784,14 @@ zfs_create_diskpart() # NOTE: `-F' required to destroy if partitions still exist. # NOTE: Failure is ok here, blank disk will have nothing to destroy. # + f_dprintf "$funcname: Exporting ZFS pools..." + zpool list -Ho name | while read z_name; do + f_eval_catch -d $funcname zpool "$ZPOOL_EXPORT_F" $z_name + done + f_dprintf "$funcname: Detaching all GELI providers..." + geli status | tail -n +2 | while read g_name g_status g_component; do + f_eval_catch -d $funcname geli "$GELI_DETACH_F" $g_name + done f_dprintf "$funcname: Destroying all data/layouts on \`%s'..." "$disk" f_eval_catch -d $funcname gpart "$GPART_DESTROY_F" $disk f_eval_catch -d $funcname graid "$GRAID_DELETE" $disk From owner-svn-src-stable@freebsd.org Tue Jul 26 05:26:54 2016 Return-Path: Delivered-To: svn-src-stable@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 B15ACBA51C7; Tue, 26 Jul 2016 05:26:54 +0000 (UTC) (envelope-from allanjude@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 80CA2120E; Tue, 26 Jul 2016 05:26:54 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6Q5Qrtg086784; Tue, 26 Jul 2016 05:26:53 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6Q5QrWO086783; Tue, 26 Jul 2016 05:26:53 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201607260526.u6Q5QrWO086783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 26 Jul 2016 05:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303331 - stable/11/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2016 05:26:54 -0000 Author: allanjude Date: Tue Jul 26 05:26:53 2016 New Revision: 303331 URL: https://svnweb.freebsd.org/changeset/base/303331 Log: MFC: r302940 Fix error in bsdinstall triggered when doing a GELI encrypted install to an MBR formatted disk Approved by: re (gjb) Sponsored by: ScaleEngine Inc. Modified: stable/11/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/zfsboot Tue Jul 26 05:26:07 2016 (r303330) +++ stable/11/usr.sbin/bsdinstall/scripts/zfsboot Tue Jul 26 05:26:53 2016 (r303331) @@ -1393,8 +1393,9 @@ zfs_create_boot() "-o altroot=\"$BSDINSTALL_CHROOT\"" "$zroot_name" || return $FAILURE if [ "$ZFSBOOT_BOOT_POOL" ]; then + # Import the bootpool, but do not mount it yet f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"$BSDINSTALL_CHROOT\"" \ + "-o altroot=\"$BSDINSTALL_CHROOT\" -N" \ "$bootpool_name" || return $FAILURE fi fi From owner-svn-src-stable@freebsd.org Tue Jul 26 05:27:28 2016 Return-Path: Delivered-To: svn-src-stable@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 1BDC3BA5221; Tue, 26 Jul 2016 05:27:28 +0000 (UTC) (envelope-from allanjude@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 E0537136A; Tue, 26 Jul 2016 05:27:27 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6Q5RRBk086853; Tue, 26 Jul 2016 05:27:27 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6Q5RR1M086852; Tue, 26 Jul 2016 05:27:27 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201607260527.u6Q5RR1M086852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Tue, 26 Jul 2016 05:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303332 - stable/11/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2016 05:27:28 -0000 Author: allanjude Date: Tue Jul 26 05:27:26 2016 New Revision: 303332 URL: https://svnweb.freebsd.org/changeset/base/303332 Log: MFC: r302790, r302795 Add new menu to bsdinstall to allow user to set date and time after selecting timezone. The 'skip' button is the default selection. Submitted by: des Approved by: re (gjb) Modified: stable/11/usr.sbin/bsdinstall/scripts/time Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/scripts/time ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/time Tue Jul 26 05:26:53 2016 (r303331) +++ stable/11/usr.sbin/bsdinstall/scripts/time Tue Jul 26 05:27:26 2016 (r303332) @@ -26,4 +26,42 @@ # # $FreeBSD$ +# Select timezone chroot $BSDINSTALL_CHROOT tzsetup + +# Switch to target timezone +saved_TZ="$TZ" +TZ="${BSDINSTALL_CHROOT}/etc/localtime" +export TZ + +# Set date +exec 3>&1 +DATE=$(dialog --backtitle 'FreeBSD Installer' \ + --title 'Time & Date' \ + --ok-label 'Set Date' \ + --cancel-label 'Skip' \ + --defaultno \ + --date-format '%Y%m%d%H%M.%S' \ + --calendar '' 2 40 \ +2>&1 1>&3) && date $DATE +exec 3>&- + +# Set time +exec 3>&1 +TIME=$(dialog --backtitle 'FreeBSD Installer' \ + --title 'Time & Date' \ + --ok-label 'Set Time' \ + --cancel-label 'Skip' \ + --defaultno \ + --time-format '%H%M.%S' \ + --timebox '' 2 40 \ +2>&1 1>&3) && date $TIME +exec 3>&- + +# Switch back +if [ -n "$saved_TZ" ]; then + TZ="$saved_TZ" +else + unset TZ +fi +unset saved_TZ From owner-svn-src-stable@freebsd.org Tue Jul 26 05:52:55 2016 Return-Path: Delivered-To: svn-src-stable@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 0EF05BA5765; Tue, 26 Jul 2016 05:52:55 +0000 (UTC) (envelope-from manu@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 D39DD119B; Tue, 26 Jul 2016 05:52:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6Q5qsJt097525; Tue, 26 Jul 2016 05:52:54 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6Q5qs1e097524; Tue, 26 Jul 2016 05:52:54 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201607260552.u6Q5qs1e097524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Jul 2016 05:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303333 - stable/11/sys/boot/efi/libefi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2016 05:52:55 -0000 Author: manu Date: Tue Jul 26 05:52:53 2016 New Revision: 303333 URL: https://svnweb.freebsd.org/changeset/base/303333 Log: MFC: r303039 Do not use TERM_EMU on arm and arm64 as it doesn't behave well with serial console. Approved by: re (gjb) Modified: stable/11/sys/boot/efi/libefi/Makefile Modified: stable/11/sys/boot/efi/libefi/Makefile ============================================================================== --- stable/11/sys/boot/efi/libefi/Makefile Tue Jul 26 05:27:26 2016 (r303332) +++ stable/11/sys/boot/efi/libefi/Makefile Tue Jul 26 05:52:53 2016 (r303333) @@ -35,6 +35,10 @@ CFLAGS+= -I${.CURDIR}/../../common # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} + +# Do not use TERM_EMU on arm and arm64 as it doesn't behave well with serial console +.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "aarch64" CFLAGS+= -DTERM_EMU +.endif .include From owner-svn-src-stable@freebsd.org Tue Jul 26 14:12:12 2016 Return-Path: Delivered-To: svn-src-stable@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 CBDABBA429D; Tue, 26 Jul 2016 14:12:12 +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 85AF51F51; Tue, 26 Jul 2016 14:12:12 +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 u6QECBSC085541; Tue, 26 Jul 2016 14:12:11 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QECBYI085540; Tue, 26 Jul 2016 14:12:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201607261412.u6QECBYI085540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 26 Jul 2016 14:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303336 - stable/11/lib/libc/locale X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2016 14:12:12 -0000 Author: pfg Date: Tue Jul 26 14:12:11 2016 New Revision: 303336 URL: https://svnweb.freebsd.org/changeset/base/303336 Log: MFC r303046: libc: tag the rune initialization function prototypes visibility as hidden. It is good practice to export as few symbols as possible from your shared libraries, so use the GCC visibility attribute in this case, matching what Apple's libc does. Reference: https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html Hinted by: Apple's libc 1082.20.4 Approved by: re (gjb) Modified: stable/11/lib/libc/locale/mblocal.h Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/locale/mblocal.h ============================================================================== --- stable/11/lib/libc/locale/mblocal.h Tue Jul 26 13:36:28 2016 (r303335) +++ stable/11/lib/libc/locale/mblocal.h Tue Jul 26 14:12:11 2016 (r303336) @@ -65,18 +65,18 @@ extern struct xlocale_ctype __xlocale_gl /* * Rune initialization function prototypes. */ -int _none_init(struct xlocale_ctype *, _RuneLocale *); -int _UTF8_init(struct xlocale_ctype *, _RuneLocale *); -int _EUC_CN_init(struct xlocale_ctype *, _RuneLocale *); -int _EUC_JP_init(struct xlocale_ctype *, _RuneLocale *); -int _EUC_KR_init(struct xlocale_ctype *, _RuneLocale *); -int _EUC_TW_init(struct xlocale_ctype *, _RuneLocale *); -int _GB18030_init(struct xlocale_ctype *, _RuneLocale *); -int _GB2312_init(struct xlocale_ctype *, _RuneLocale *); -int _GBK_init(struct xlocale_ctype *, _RuneLocale *); -int _BIG5_init(struct xlocale_ctype *, _RuneLocale *); -int _MSKanji_init(struct xlocale_ctype *, _RuneLocale *); -int _ascii_init(struct xlocale_ctype *, _RuneLocale *); +__hidden int _none_init(struct xlocale_ctype *, _RuneLocale *); +__hidden int _ascii_init(struct xlocale_ctype *, _RuneLocale *); +__hidden int _UTF8_init(struct xlocale_ctype *, _RuneLocale *); +__hidden int _EUC_CN_init(struct xlocale_ctype *, _RuneLocale *); +__hidden int _EUC_JP_init(struct xlocale_ctype *, _RuneLocale *); +__hidden int _EUC_KR_init(struct xlocale_ctype *, _RuneLocale *); +__hidden int _EUC_TW_init(struct xlocale_ctype *, _RuneLocale *); +__hidden int _GB18030_init(struct xlocale_ctype *, _RuneLocale *); +__hidden int _GB2312_init(struct xlocale_ctype *, _RuneLocale *); +__hidden int _GBK_init(struct xlocale_ctype *, _RuneLocale *); +__hidden int _BIG5_init(struct xlocale_ctype *, _RuneLocale *); +__hidden int _MSKanji_init(struct xlocale_ctype *, _RuneLocale *); typedef size_t (*mbrtowc_pfn_t)(wchar_t * __restrict, const char * __restrict, size_t, mbstate_t * __restrict); From owner-svn-src-stable@freebsd.org Tue Jul 26 15:22:22 2016 Return-Path: Delivered-To: svn-src-stable@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 5E9CABA57EE; Tue, 26 Jul 2016 15:22:22 +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 2E9E6171B; Tue, 26 Jul 2016 15:22:22 +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 u6QFMLkB011476; Tue, 26 Jul 2016 15:22:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QFMLlr011475; Tue, 26 Jul 2016 15:22:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607261522.u6QFMLlr011475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 26 Jul 2016 15:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303337 - stable/11 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2016 15:22:22 -0000 Author: emaste Date: Tue Jul 26 15:22:21 2016 New Revision: 303337 URL: https://svnweb.freebsd.org/changeset/base/303337 Log: MFC r303034: Include makewhatis in ITOOLS when MK_MAN_UTILS is true Previously it was conditional on MK_MAN. It's possible to build FreeBSD with man pages but without man page tools. MK_MAN_UTILS is the conditional used in share/man/Makefile for determining whether makewhatis is executed at install time, so it is the proper one for ITOOLS as well. PR: 210142 Approved by: re (gjb) Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Tue Jul 26 14:12:11 2016 (r303336) +++ stable/11/Makefile.inc1 Tue Jul 26 15:22:21 2016 (r303337) @@ -884,7 +884,7 @@ ITOOLS= [ awk cap_mkdb cat chflags chmod ${LOCAL_ITOOLS} # Needed for share/man -.if ${MK_MAN} != "no" +.if ${MK_MAN_UTILS} != "no" ITOOLS+=makewhatis .endif From owner-svn-src-stable@freebsd.org Tue Jul 26 20:26:04 2016 Return-Path: Delivered-To: svn-src-stable@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 94D33BA4414; Tue, 26 Jul 2016 20:26:04 +0000 (UTC) (envelope-from avos@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 4AD5015CD; Tue, 26 Jul 2016 20:26:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6QKQ3SM048651; Tue, 26 Jul 2016 20:26:03 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6QKQ3FF048649; Tue, 26 Jul 2016 20:26:03 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201607262026.u6QKQ3FF048649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 26 Jul 2016 20:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303344 - stable/11/sys/dev/urtwn X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2016 20:26:04 -0000 Author: avos Date: Tue Jul 26 20:26:03 2016 New Revision: 303344 URL: https://svnweb.freebsd.org/changeset/base/303344 Log: MFC r303115: urtwn: fix A-MSDU tx aggregation when encryption is used. Clear unused (undocumented) CAM bytes while setting a key; without that, hardware does weird things when A-MSDU bit in QoS header is set. Tested with RTL8188CUS (AP) -> RTL8188EU (STA) (A-MSDU transmit). Reported by: many Approved by: re (gjb) Obtained from: https://github.com/s3erios/urtwm Modified: stable/11/sys/dev/urtwn/if_urtwn.c stable/11/sys/dev/urtwn/if_urtwnreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/urtwn/if_urtwn.c ============================================================================== --- stable/11/sys/dev/urtwn/if_urtwn.c Tue Jul 26 20:20:09 2016 (r303343) +++ stable/11/sys/dev/urtwn/if_urtwn.c Tue Jul 26 20:26:03 2016 (r303344) @@ -2318,6 +2318,10 @@ urtwn_key_set_cb(struct urtwn_softc *sc, k->wk_cipher->ic_cipher, algo, k->wk_flags, k->wk_keylen, ether_sprintf(k->wk_macaddr)); + /* Clear high bits. */ + urtwn_cam_write(sc, R92C_CAM_CTL6(k->wk_keyix), 0); + urtwn_cam_write(sc, R92C_CAM_CTL7(k->wk_keyix), 0); + /* Write key. */ for (i = 0; i < 4; i++) { error = urtwn_cam_write(sc, R92C_CAM_KEY(k->wk_keyix, i), Modified: stable/11/sys/dev/urtwn/if_urtwnreg.h ============================================================================== --- stable/11/sys/dev/urtwn/if_urtwnreg.h Tue Jul 26 20:20:09 2016 (r303343) +++ stable/11/sys/dev/urtwn/if_urtwnreg.h Tue Jul 26 20:26:03 2016 (r303344) @@ -871,6 +871,8 @@ #define R92C_CAM_CTL0(entry) ((entry) * 8 + 0) #define R92C_CAM_CTL1(entry) ((entry) * 8 + 1) #define R92C_CAM_KEY(entry, i) ((entry) * 8 + 2 + (i)) +#define R92C_CAM_CTL6(entry) ((entry) * 8 + 6) +#define R92C_CAM_CTL7(entry) ((entry) * 8 + 7) /* Bits for R92C_CAM_CTL0(i). */ #define R92C_CAM_KEYID_M 0x00000003 From owner-svn-src-stable@freebsd.org Wed Jul 27 05:17:56 2016 Return-Path: Delivered-To: svn-src-stable@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 F0A88A7AD91; Wed, 27 Jul 2016 05:17:56 +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 CB8261CCC; Wed, 27 Jul 2016 05:17: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 u6R5HuTB044109; Wed, 27 Jul 2016 05:17:56 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R5Ht1n044107; Wed, 27 Jul 2016 05:17:55 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201607270517.u6R5Ht1n044107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jul 2016 05:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303359 - stable/11 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 05:17:57 -0000 Author: bdrewery Date: Wed Jul 27 05:17:55 2016 New Revision: 303359 URL: https://svnweb.freebsd.org/changeset/base/303359 Log: MFC r303272,r303273: r303272: SYSTEM_COMPILER: Rework the logic to allow a 'make test-system-compiler'. r303273: Fix empty WANT_COMPILER_TYPE when neither compiler is bootstrapped. Approved by: re (kib) Modified: stable/11/Makefile stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile ============================================================================== --- stable/11/Makefile Wed Jul 27 05:03:58 2016 (r303358) +++ stable/11/Makefile Wed Jul 27 05:17:55 2016 (r303359) @@ -131,7 +131,8 @@ TGTS= all all-man buildenv buildenvvars builddtb xdev xdev-build xdev-install \ xdev-links native-xtools stageworld stagekernel stage-packages \ create-world-packages create-kernel-packages create-packages \ - packages installconfig real-packages sign-packages package-pkg + packages installconfig real-packages sign-packages package-pkg \ + test-system-compiler # XXX: r156740: This can't work since bsd.subdir.mk is not included ever. # It will only work for SUBDIR_TARGETS in make.conf. @@ -151,7 +152,8 @@ TGTS+= ${BITGTS} META_TGT_WHITELIST+= \ _* build32 buildfiles buildincludes buildkernel buildsoft \ buildworld everything kernel-toolchain kernel-toolchains kernel \ - kernels libraries native-xtools showconfig tinderbox toolchain \ + kernels libraries native-xtools showconfig test-system-compiler \ + tinderbox toolchain \ toolchains universe world worlds xdev xdev-build .ORDER: buildworld installworld Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Wed Jul 27 05:03:58 2016 (r303358) +++ stable/11/Makefile.inc1 Wed Jul 27 05:17:55 2016 (r303359) @@ -80,50 +80,68 @@ MK_CROSS_COMPILER= no .include "share/mk/src.opts.mk" # Check if there is a local compiler that can satisfy as an external compiler. -.if ${MK_SYSTEM_COMPILER} == "yes" && ${MK_CROSS_COMPILER} == "yes" && \ - (${MK_CLANG_BOOTSTRAP} == "yes" || ${MK_GCC_BOOTSTRAP} == "yes") && \ - !make(showconfig) && !make(native-xtools) && !make(xdev*) # Which compiler is expected to be used? .if ${MK_CLANG_BOOTSTRAP} == "yes" -_expected_compiler_type= clang +WANT_COMPILER_TYPE= clang .elif ${MK_GCC_BOOTSTRAP} == "yes" -_expected_compiler_type= gcc +WANT_COMPILER_TYPE= gcc +.else +WANT_COMPILER_TYPE= .endif -# If the expected vs CC is different then we can't skip. -# GCC cannot be used for cross-arch yet. For clang we pass -target later if -# TARGET_ARCH!=MACHINE_ARCH. -.if ${_expected_compiler_type} == ${COMPILER_TYPE} && \ - (${COMPILER_TYPE} == "clang" || ${TARGET_ARCH} == ${MACHINE_ARCH}) -# It needs to be the same revision as we would build for the bootstrap. -.if !defined(CROSS_COMPILER_FREEBSD_VERSION) -.if ${_expected_compiler_type} == "clang" -CROSS_COMPILER_FREEBSD_VERSION!= \ +.if !defined(WANT_COMPILER_FREEBSD_VERSION) +.if ${WANT_COMPILER_TYPE} == "clang" +WANT_COMPILER_FREEBSD_VERSION_FILE= lib/clang/freebsd_cc_version.h +WANT_COMPILER_FREEBSD_VERSION!= \ awk '$$2 == "FREEBSD_CC_VERSION" {printf("%d\n", $$3)}' \ - ${SRCDIR}/lib/clang/freebsd_cc_version.h || echo unknown -CROSS_COMPILER_VERSION!= \ + ${SRCDIR}/${WANT_COMPILER_FREEBSD_VERSION_FILE} || echo unknown +WANT_COMPILER_VERSION_FILE= lib/clang/include/clang/Basic/Version.inc +WANT_COMPILER_VERSION!= \ awk '$$2 == "CLANG_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \ - ${SRCDIR}/lib/clang/include/clang/Basic/Version.inc || echo unknown -.elif ${_expected_compiler_type} == "gcc" -CROSS_COMPILER_FREEBSD_VERSION!= \ + ${SRCDIR}/${WANT_COMPILER_VERSION_FILE} || echo unknown +.elif ${WANT_COMPILER_TYPE} == "gcc" +WANT_COMPILER_FREEBSD_VERSION_FILE= gnu/usr.bin/cc/cc_tools/freebsd-native.h +WANT_COMPILER_FREEBSD_VERSION!= \ awk '$$2 == "FBSD_CC_VER" {printf("%d\n", $$3)}' \ - ${SRCDIR}/gnu/usr.bin/cc/cc_tools/freebsd-native.h || echo unknown -CROSS_COMPILER_VERSION!= \ + ${SRCDIR}/${WANT_COMPILER_FREEBSD_VERSION_FILE} || echo unknown +WANT_COMPILER_VERSION_FILE= contrib/gcc/BASE-VER +WANT_COMPILER_VERSION!= \ awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3}' \ - ${SRCDIR}/contrib/gcc/BASE-VER || echo unknown + ${SRCDIR}/${WANT_COMPILER_VERSION_FILE} || echo unknown .endif -.export CROSS_COMPILER_FREEBSD_VERSION CROSS_COMPILER_VERSION -.endif # !defined(CROSS_COMPILER_FREEBSD_VERSION) -.if ${COMPILER_VERSION} == ${CROSS_COMPILER_VERSION} && \ - ${COMPILER_FREEBSD_VERSION} == ${CROSS_COMPILER_FREEBSD_VERSION} +.export WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_VERSION +.endif # !defined(WANT_COMPILER_FREEBSD_VERSION) +# It needs to be the same revision as we would build for the bootstrap. +# If the expected vs CC is different then we can't skip. +# GCC cannot be used for cross-arch yet. For clang we pass -target later if +# TARGET_ARCH!=MACHINE_ARCH. +.if ${MK_SYSTEM_COMPILER} == "yes" && ${MK_CROSS_COMPILER} == "yes" && \ + (${MK_CLANG_BOOTSTRAP} == "yes" || ${MK_GCC_BOOTSTRAP} == "yes") && \ + !make(showconfig) && !make(native-xtools) && !make(xdev*) && \ + ${WANT_COMPILER_TYPE} == ${COMPILER_TYPE} && \ + (${COMPILER_TYPE} == "clang" || ${TARGET_ARCH} == ${MACHINE_ARCH}) && \ + ${COMPILER_VERSION} == ${WANT_COMPILER_VERSION} && \ + ${COMPILER_FREEBSD_VERSION} == ${WANT_COMPILER_FREEBSD_VERSION} # Everything matches, disable the bootstrap compiler. MK_CLANG_BOOTSTRAP= no MK_GCC_BOOTSTRAP= no -.if make(buildworld) +USING_SYSTEM_COMPILER= yes +.endif # ${WANT_COMPILER_TYPE} == ${COMPILER_TYPE} +USING_SYSTEM_COMPILER?= no +TEST_SYSTEM_COMPILER_VARS= \ + USING_SYSTEM_COMPILER MK_SYSTEM_COMPILER \ + MK_CROSS_COMPILER MK_CLANG_BOOTSTRAP MK_GCC_BOOTSTRAP \ + WANT_COMPILER_TYPE WANT_COMPILER_VERSION WANT_COMPILER_VERSION_FILE \ + WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \ + CC COMPILER_TYPE COMPILER_VERSION COMPILER_FREEBSD_VERSION +test-system-compiler: .PHONY +.for v in ${TEST_SYSTEM_COMPILER_VARS} + ${_+_}@printf "%-35s= %s\n" "${v}" "${${v}}" +.endfor +.if ${USING_SYSTEM_COMPILER} == "yes" && \ + (make(buildworld) || make(buildkernel) || make(kernel-toolchain) || \ + make(toolchain) || make(_cross-tools)) .info SYSTEM_COMPILER: Determined that CC=${CC} matches the source tree. Not bootstrapping a cross-compiler. .endif -.endif # ${COMPILER_VERSION} == ${CROSS_COMPILER_VERSION} -.endif # ${_expected_compiler_type} == ${COMPILER_TYPE} -.endif # ${XCC:N${CCACHE_BIN}:M/*} # For installworld need to ensure that the looked-up compiler metadata is # passed along rather than trying to run cc from the restricted From owner-svn-src-stable@freebsd.org Wed Jul 27 05:38:11 2016 Return-Path: Delivered-To: svn-src-stable@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 ED50DBA6167; Wed, 27 Jul 2016 05:38:10 +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 BBDE615C4; Wed, 27 Jul 2016 05:38:10 +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 u6R5c9n3051359; Wed, 27 Jul 2016 05:38:09 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R5c9tm051357; Wed, 27 Jul 2016 05:38:09 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201607270538.u6R5c9tm051357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 27 Jul 2016 05:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303360 - stable/11 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 05:38:11 -0000 Author: bdrewery Date: Wed Jul 27 05:38:09 2016 New Revision: 303360 URL: https://svnweb.freebsd.org/changeset/base/303360 Log: MFC r303274: Don't disable binutils/elftoolchain bootstrapping with external compiler. Approved by: re (kib) Modified: stable/11/Makefile.inc1 stable/11/Makefile.libcompat Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Wed Jul 27 05:17:55 2016 (r303359) +++ stable/11/Makefile.inc1 Wed Jul 27 05:38:09 2016 (r303360) @@ -72,7 +72,8 @@ X${COMPILER}?= ${${COMPILER}} # If a full path to an external cross compiler is given, don't build # a cross compiler. .if ${XCC:N${CCACHE_BIN}:M/*} -MK_CROSS_COMPILER= no +MK_CLANG_BOOTSTRAP= no +MK_GCC_BOOTSTRAP= no .endif # Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. @@ -114,7 +115,7 @@ WANT_COMPILER_VERSION!= \ # If the expected vs CC is different then we can't skip. # GCC cannot be used for cross-arch yet. For clang we pass -target later if # TARGET_ARCH!=MACHINE_ARCH. -.if ${MK_SYSTEM_COMPILER} == "yes" && ${MK_CROSS_COMPILER} == "yes" && \ +.if ${MK_SYSTEM_COMPILER} == "yes" && \ (${MK_CLANG_BOOTSTRAP} == "yes" || ${MK_GCC_BOOTSTRAP} == "yes") && \ !make(showconfig) && !make(native-xtools) && !make(xdev*) && \ ${WANT_COMPILER_TYPE} == ${COMPILER_TYPE} && \ @@ -548,8 +549,7 @@ BFLAGS+= -B${CROSS_BINUTILS_PREFIX} .endif # External compiler needs sysroot and target flags. -.if ${MK_CROSS_COMPILER} == "no" || \ - (${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no") +.if ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no" .if !defined(CROSS_BINUTILS_PREFIX) || !exists(${CROSS_BINUTILS_PREFIX}) BFLAGS+= -B${WORLDTMP}/usr/bin .endif @@ -577,7 +577,7 @@ TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x8 XCFLAGS+= -target ${TARGET_TRIPLE} .endif XCFLAGS+= --sysroot=${WORLDTMP} -.endif # ${MK_CROSS_COMPILER} == "no" +.endif # ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no" .if !empty(BFLAGS) XCFLAGS+= ${BFLAGS} @@ -1818,7 +1818,6 @@ _elftctools= lib/libelftc \ usr.bin/elfcopy .endif -.if ${MK_CROSS_COMPILER} != "no" .if ${MK_CLANG_BOOTSTRAP} != "no" _clang= usr.bin/clang _clang_libs= lib/clang @@ -1826,7 +1825,6 @@ _clang_libs= lib/clang .if ${MK_GCC_BOOTSTRAP} != "no" _cc= gnu/usr.bin/cc .endif -.endif .if ${MK_USB} != "no" _usb_tools= sys/boot/usb/tools .endif Modified: stable/11/Makefile.libcompat ============================================================================== --- stable/11/Makefile.libcompat Wed Jul 27 05:17:55 2016 (r303359) +++ stable/11/Makefile.libcompat Wed Jul 27 05:38:09 2016 (r303360) @@ -81,8 +81,8 @@ LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/ LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include # Force using libc++ for external GCC. # XXX: This should be checking MK_GNUCXX == no -.if ${X_COMPILER_VERSION} >= 40800 && (${MK_CROSS_COMPILER} == "no" || \ - (${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no")) +.if ${X_COMPILER_VERSION} >= 40800 && \ + (${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no") LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ -L${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc++ .endif From owner-svn-src-stable@freebsd.org Wed Jul 27 06:29:28 2016 Return-Path: Delivered-To: svn-src-stable@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 121E2BA6ABF; Wed, 27 Jul 2016 06:29:28 +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 B26841E23; Wed, 27 Jul 2016 06:29:27 +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 u6R6TQZ7069997; Wed, 27 Jul 2016 06:29:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R6TQ79069996; Wed, 27 Jul 2016 06:29:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201607270629.u6R6TQ79069996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 27 Jul 2016 06:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303363 - stable/11 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 06:29:28 -0000 Author: ngie Date: Wed Jul 27 06:29:26 2016 New Revision: 303363 URL: https://svnweb.freebsd.org/changeset/base/303363 Log: MFC r302842: Don't delete usr/share/local/kk_KZ.UTF-8 with "make delete-old" after r302329 kk_KZ.UTF-8 was originally removed in r290494, but restored as an alias to en_US.UTF-8 in r302329 Approved by: re (kib) PR: 211046 Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-stable@freebsd.org Wed Jul 27 06:29:42 2016 Return-Path: Delivered-To: svn-src-stable@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 50B66BA6AFE; Wed, 27 Jul 2016 06:29: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 208321F74; Wed, 27 Jul 2016 06:29: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 u6R6TfPV070063; Wed, 27 Jul 2016 06:29:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R6TfUF070062; Wed, 27 Jul 2016 06:29:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201607270629.u6R6TfUF070062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 27 Jul 2016 06:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303364 - stable/11 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 06:29:42 -0000 Author: ngie Date: Wed Jul 27 06:29:41 2016 New Revision: 303364 URL: https://svnweb.freebsd.org/changeset/base/303364 Log: MFC r302842: Don't delete usr/share/local/kk_KZ.UTF-8 with "make delete-old" after r302329 kk_KZ.UTF-8 was originally removed in r290494, but restored as an alias to en_US.UTF-8 in r302329 Approved by: re (kib) PR: 211046 Modified: stable/11/ObsoleteFiles.inc Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Wed Jul 27 06:29:26 2016 (r303363) +++ stable/11/ObsoleteFiles.inc Wed Jul 27 06:29:41 2016 (r303364) @@ -460,13 +460,6 @@ OLD_FILES+=usr/share/locale/kk_KZ.PT154/ OLD_FILES+=usr/share/locale/kk_KZ.PT154/LC_NUMERIC OLD_FILES+=usr/share/locale/kk_KZ.PT154/LC_TIME OLD_DIRS+=usr/share/locale/kk_KZ.PT154/ -OLD_FILES+=usr/share/locale/kk_KZ.UTF-8/LC_COLLATE -OLD_FILES+=usr/share/locale/kk_KZ.UTF-8/LC_CTYPE -OLD_FILES+=usr/share/locale/kk_KZ.UTF-8/LC_MESSAGES -OLD_FILES+=usr/share/locale/kk_KZ.UTF-8/LC_MONETARY -OLD_FILES+=usr/share/locale/kk_KZ.UTF-8/LC_NUMERIC -OLD_FILES+=usr/share/locale/kk_KZ.UTF-8/LC_TIME -OLD_DIRS+=usr/share/locale/kk_KZ.UTF-8 OLD_FILES+=usr/share/locale/la_LN.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/la_LN.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/la_LN.ISO8859-1/LC_TIME From owner-svn-src-stable@freebsd.org Wed Jul 27 06:31:41 2016 Return-Path: Delivered-To: svn-src-stable@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 A0964BA6C1D; Wed, 27 Jul 2016 06:31:41 +0000 (UTC) (envelope-from jch@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 709A11346; Wed, 27 Jul 2016 06:31:41 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R6VeP8070852; Wed, 27 Jul 2016 06:31:40 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R6Venc070851; Wed, 27 Jul 2016 06:31:40 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201607270631.u6R6Venc070851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Wed, 27 Jul 2016 06:31: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: r303365 - 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 06:31:41 -0000 Author: jch Date: Wed Jul 27 06:31:40 2016 New Revision: 303365 URL: https://svnweb.freebsd.org/changeset/base/303365 Log: MFC r273014: A connection in TIME_WAIT state before calling close() actually did not received any RST packet. Do not set error to ECONNRESET in this case. Differential Revision: https://reviews.freebsd.org/D879 Reviewed by: rpaulo, adrian Approved by: jhb (mentor) Sponsored by: Verisign, Inc. Modified: stable/10/sys/netinet/tcp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/10/sys/netinet/tcp_usrreq.c Wed Jul 27 06:29:41 2016 (r303364) +++ stable/10/sys/netinet/tcp_usrreq.c Wed Jul 27 06:31:40 2016 (r303365) @@ -625,7 +625,9 @@ tcp_usr_disconnect(struct socket *so) inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_disconnect: inp == NULL")); INP_WLOCK(inp); - if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { + if (inp->inp_flags & INP_TIMEWAIT) + goto out; + if (inp->inp_flags & INP_DROPPED) { error = ECONNRESET; goto out; } From owner-svn-src-stable@freebsd.org Wed Jul 27 07:51:59 2016 Return-Path: Delivered-To: svn-src-stable@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 B4FC3BA65F6; Wed, 27 Jul 2016 07:51:59 +0000 (UTC) (envelope-from jch@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 762EB12E8; Wed, 27 Jul 2016 07:51:59 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6R7pwsh001014; Wed, 27 Jul 2016 07:51:58 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R7pwEu001011; Wed, 27 Jul 2016 07:51:58 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201607270751.u6R7pwEu001011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Wed, 27 Jul 2016 07:51: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: r303371 - 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 07:51:59 -0000 Author: jch Date: Wed Jul 27 07:51:58 2016 New Revision: 303371 URL: https://svnweb.freebsd.org/changeset/base/303371 Log: MFC r271119, r272081: r271119: In tcp_input(), don't acquire the pcbinfo global write lock for SYN packets targeting a listening socket. Permit to reduce TCP input processing starvation in context of high SYN load (e.g. short-lived TCP connections or SYN flood). Submitted by: Julien Charbon Reviewed by: adrian, hiren, jhb, Mike Bentkofsky r272081: Catch up with r271119. Modified: stable/10/sys/netinet/tcp_input.c stable/10/sys/netinet/tcp_syncache.c stable/10/sys/netinet/toecore.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_input.c ============================================================================== --- stable/10/sys/netinet/tcp_input.c Wed Jul 27 07:36:54 2016 (r303370) +++ stable/10/sys/netinet/tcp_input.c Wed Jul 27 07:51:58 2016 (r303371) @@ -751,12 +751,12 @@ tcp_input(struct mbuf *m, int off0) /* * Locate pcb for segment; if we're likely to add or remove a - * connection then first acquire pcbinfo lock. There are two cases + * connection then first acquire pcbinfo lock. There are three cases * where we might discover later we need a write lock despite the - * flags: ACKs moving a connection out of the syncache, and ACKs for - * a connection in TIMEWAIT. + * flags: ACKs moving a connection out of the syncache, ACKs for a + * connection in TIMEWAIT and SYNs not targeting a listening socket. */ - if ((thflags & (TH_SYN | TH_FIN | TH_RST)) != 0) { + if ((thflags & (TH_FIN | TH_RST)) != 0) { INP_INFO_WLOCK(&V_tcbinfo); ti_locked = TI_WLOCKED; } else @@ -983,10 +983,12 @@ relocked: * now be in TIMEWAIT. */ #ifdef INVARIANTS - if ((thflags & (TH_SYN | TH_FIN | TH_RST)) != 0) + if ((thflags & (TH_FIN | TH_RST)) != 0) INP_INFO_WLOCK_ASSERT(&V_tcbinfo); #endif - if (tp->t_state != TCPS_ESTABLISHED) { + if (!((tp->t_state == TCPS_ESTABLISHED && (thflags & TH_SYN) == 0) || + (tp->t_state == TCPS_LISTEN && (thflags & TH_SYN) && + !(tp->t_flags & TF_FASTOPEN)))) { if (ti_locked == TI_UNLOCKED) { if (INP_INFO_TRY_WLOCK(&V_tcbinfo) == 0) { in_pcbref(inp); @@ -1027,17 +1029,13 @@ relocked: /* * When the socket is accepting connections (the INPCB is in LISTEN * state) we look into the SYN cache if this is a new connection - * attempt or the completion of a previous one. Because listen - * sockets are never in TCPS_ESTABLISHED, the V_tcbinfo lock will be - * held in this case. + * attempt or the completion of a previous one. */ if (so->so_options & SO_ACCEPTCONN) { struct in_conninfo inc; KASSERT(tp->t_state == TCPS_LISTEN, ("%s: so accepting but " "tp not listening", __func__)); - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); - bzero(&inc, sizeof(inc)); #ifdef INET6 if (isipv6) { @@ -1060,6 +1058,8 @@ relocked: * socket appended to the listen queue in SYN_RECEIVED state. */ if ((thflags & (TH_RST|TH_ACK|TH_SYN)) == TH_ACK) { + + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); /* * Parse the TCP options here because * syncookies need access to the reflected @@ -1348,8 +1348,12 @@ new_tfo_socket: #endif /* * Entry added to syncache and mbuf consumed. - * Everything already unlocked by syncache_add(). + * Only the listen socket is unlocked by syncache_add(). */ + if (ti_locked == TI_WLOCKED) { + INP_INFO_WUNLOCK(&V_tcbinfo); + ti_locked = TI_UNLOCKED; + } INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); return; } else if (tp->t_state == TCPS_LISTEN) { Modified: stable/10/sys/netinet/tcp_syncache.c ============================================================================== --- stable/10/sys/netinet/tcp_syncache.c Wed Jul 27 07:36:54 2016 (r303370) +++ stable/10/sys/netinet/tcp_syncache.c Wed Jul 27 07:51:58 2016 (r303371) @@ -1107,7 +1107,7 @@ syncache_tfo_expand(struct syncache *sc, * Global TCP locks are held because we manipulate the PCB lists * and create a new socket. */ - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); pending_counter = intotcpcb(sotoinpcb(*lsop))->t_tfo_pending; *lsop = syncache_socket(sc, *lsop, m); @@ -1175,7 +1175,6 @@ syncache_add(struct in_conninfo *inc, st int tfo_response_cookie_valid = 0; #endif - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); /* listen socket */ KASSERT((th->th_flags & (TH_RST|TH_ACK|TH_SYN)) == TH_SYN, ("%s: unexpected tcp flags", __func__)); @@ -1229,21 +1228,15 @@ syncache_add(struct in_conninfo *inc, st #ifdef MAC if (mac_syncache_init(&maclabel) != 0) { INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); goto done; } else mac_syncache_create(maclabel, inp); #endif #ifdef TCP_RFC7413 - if (!tfo_cookie_valid) { - INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); - } -#else - INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); + if (!tfo_cookie_valid) #endif - + INP_WUNLOCK(inp); + /* * Remember the IP options, if any. */ @@ -1272,10 +1265,8 @@ syncache_add(struct in_conninfo *inc, st SCH_LOCK_ASSERT(sch); if (sc != NULL) { #ifdef TCP_RFC7413 - if (tfo_cookie_valid) { + if (tfo_cookie_valid) INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); - } #endif TCPSTAT_INC(tcps_sc_dupsyn); if (ipopts) { Modified: stable/10/sys/netinet/toecore.c ============================================================================== --- stable/10/sys/netinet/toecore.c Wed Jul 27 07:36:54 2016 (r303370) +++ stable/10/sys/netinet/toecore.c Wed Jul 27 07:51:58 2016 (r303371) @@ -328,7 +328,6 @@ toe_syncache_add(struct in_conninfo *inc { struct socket *lso = inp->inp_socket; - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); syncache_add(inc, to, th, inp, &lso, NULL, tod, todctx); From owner-svn-src-stable@freebsd.org Wed Jul 27 08:47:25 2016 Return-Path: Delivered-To: svn-src-stable@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 9929CBA59B2; Wed, 27 Jul 2016 08:47:25 +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 4F0AC1501; Wed, 27 Jul 2016 08:47:25 +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 u6R8lO6O022044; Wed, 27 Jul 2016 08:47:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R8lOID022042; Wed, 27 Jul 2016 08:47:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607270847.u6R8lOID022042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 27 Jul 2016 08:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303375 - stable/11/sys/ufs/ufs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 08:47:25 -0000 Author: kib Date: Wed Jul 27 08:47:24 2016 New Revision: 303375 URL: https://svnweb.freebsd.org/changeset/base/303375 Log: MFC r303090: Ensure that the UFS directory vnode' vm_object is properly sized before UFS_BALLOC() is called. Approved by: re (delphij) Modified: stable/11/sys/ufs/ufs/ufs_lookup.c stable/11/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_lookup.c Wed Jul 27 08:26:34 2016 (r303374) +++ stable/11/sys/ufs/ufs/ufs_lookup.c Wed Jul 27 08:47:24 2016 (r303375) @@ -881,6 +881,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir struct buf *bp; u_int dsize; struct direct *ep, *nep; + u_int64_t old_isize; int error, ret, blkoff, loc, spacefree, flags, namlen; char *dirbuf; @@ -909,16 +910,18 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir return (error); } #endif + old_isize = dp->i_size; + vnode_pager_setsize(dvp, (u_long)dp->i_offset + DIRBLKSIZ); if ((error = UFS_BALLOC(dvp, (off_t)dp->i_offset, DIRBLKSIZ, cr, flags, &bp)) != 0) { if (DOINGSOFTDEP(dvp) && newdirbp != NULL) bdwrite(newdirbp); + vnode_pager_setsize(dvp, (u_long)old_isize); return (error); } dp->i_size = dp->i_offset + DIRBLKSIZ; DIP_SET(dp, i_size, dp->i_size); dp->i_flag |= IN_CHANGE | IN_UPDATE; - vnode_pager_setsize(dvp, (u_long)dp->i_size); dirp->d_reclen = DIRBLKSIZ; blkoff = dp->i_offset & (VFSTOUFS(dvp->v_mount)->um_mountp->mnt_stat.f_iosize - 1); Modified: stable/11/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_vnops.c Wed Jul 27 08:26:34 2016 (r303374) +++ stable/11/sys/ufs/ufs/ufs_vnops.c Wed Jul 27 08:47:24 2016 (r303375) @@ -1913,13 +1913,13 @@ ufs_mkdir(ap) dirtemplate = *dtp; dirtemplate.dot_ino = ip->i_number; dirtemplate.dotdot_ino = dp->i_number; + vnode_pager_setsize(tvp, DIRBLKSIZ); if ((error = UFS_BALLOC(tvp, (off_t)0, DIRBLKSIZ, cnp->cn_cred, BA_CLRBUF, &bp)) != 0) goto bad; ip->i_size = DIRBLKSIZ; DIP_SET(ip, i_size, DIRBLKSIZ); ip->i_flag |= IN_CHANGE | IN_UPDATE; - vnode_pager_setsize(tvp, (u_long)ip->i_size); bcopy((caddr_t)&dirtemplate, (caddr_t)bp->b_data, sizeof dirtemplate); if (DOINGSOFTDEP(tvp)) { /* From owner-svn-src-stable@freebsd.org Wed Jul 27 08:53:12 2016 Return-Path: Delivered-To: svn-src-stable@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 850A7BA5E36; Wed, 27 Jul 2016 08:53:12 +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 3F3991B37; Wed, 27 Jul 2016 08:53:12 +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 u6R8rBW0025706; Wed, 27 Jul 2016 08:53:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6R8rBoZ025703; Wed, 27 Jul 2016 08:53:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607270853.u6R8rBoZ025703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 27 Jul 2016 08:53: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: r303376 - stable/10/sys/ufs/ufs 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 08:53:12 -0000 Author: kib Date: Wed Jul 27 08:53:11 2016 New Revision: 303376 URL: https://svnweb.freebsd.org/changeset/base/303376 Log: MFC r303090: Ensure that the UFS directory vnode' vm_object is properly sized before UFS_BALLOC() is called. Modified: stable/10/sys/ufs/ufs/ufs_lookup.c stable/10/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_lookup.c Wed Jul 27 08:47:24 2016 (r303375) +++ stable/10/sys/ufs/ufs/ufs_lookup.c Wed Jul 27 08:53:11 2016 (r303376) @@ -881,6 +881,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir struct buf *bp; u_int dsize; struct direct *ep, *nep; + u_int64_t old_isize; int error, ret, blkoff, loc, spacefree, flags, namlen; char *dirbuf; @@ -909,16 +910,18 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir return (error); } #endif + old_isize = dp->i_size; + vnode_pager_setsize(dvp, (u_long)dp->i_offset + DIRBLKSIZ); if ((error = UFS_BALLOC(dvp, (off_t)dp->i_offset, DIRBLKSIZ, cr, flags, &bp)) != 0) { if (DOINGSOFTDEP(dvp) && newdirbp != NULL) bdwrite(newdirbp); + vnode_pager_setsize(dvp, (u_long)old_isize); return (error); } dp->i_size = dp->i_offset + DIRBLKSIZ; DIP_SET(dp, i_size, dp->i_size); dp->i_flag |= IN_CHANGE | IN_UPDATE; - vnode_pager_setsize(dvp, (u_long)dp->i_size); dirp->d_reclen = DIRBLKSIZ; blkoff = dp->i_offset & (VFSTOUFS(dvp->v_mount)->um_mountp->mnt_stat.f_iosize - 1); Modified: stable/10/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_vnops.c Wed Jul 27 08:47:24 2016 (r303375) +++ stable/10/sys/ufs/ufs/ufs_vnops.c Wed Jul 27 08:53:11 2016 (r303376) @@ -1914,13 +1914,13 @@ ufs_mkdir(ap) dirtemplate = *dtp; dirtemplate.dot_ino = ip->i_number; dirtemplate.dotdot_ino = dp->i_number; + vnode_pager_setsize(tvp, DIRBLKSIZ); if ((error = UFS_BALLOC(tvp, (off_t)0, DIRBLKSIZ, cnp->cn_cred, BA_CLRBUF, &bp)) != 0) goto bad; ip->i_size = DIRBLKSIZ; DIP_SET(ip, i_size, DIRBLKSIZ); ip->i_flag |= IN_CHANGE | IN_UPDATE; - vnode_pager_setsize(tvp, (u_long)ip->i_size); bcopy((caddr_t)&dirtemplate, (caddr_t)bp->b_data, sizeof dirtemplate); if (DOINGSOFTDEP(tvp)) { /* From owner-svn-src-stable@freebsd.org Wed Jul 27 13:53:16 2016 Return-Path: Delivered-To: svn-src-stable@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 A6671BA62B4; Wed, 27 Jul 2016 13:53:16 +0000 (UTC) (envelope-from jch@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 53B0B1710; Wed, 27 Jul 2016 13:53:16 +0000 (UTC) (envelope-from jch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RDrFho037251; Wed, 27 Jul 2016 13:53:15 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RDrFd4037250; Wed, 27 Jul 2016 13:53:15 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201607271353.u6RDrFd4037250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Wed, 27 Jul 2016 13:53: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: r303389 - 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 13:53:16 -0000 Author: jch Date: Wed Jul 27 13:53:15 2016 New Revision: 303389 URL: https://svnweb.freebsd.org/changeset/base/303389 Log: MFC r286873: Make clear that TIME_WAIT timeout expiration is managed solely by tcp_tw_2msl_scan(). Sponsored by: Verisign, Inc. Modified: stable/10/sys/netinet/tcp_timer.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_timer.c ============================================================================== --- stable/10/sys/netinet/tcp_timer.c Wed Jul 27 11:54:24 2016 (r303388) +++ stable/10/sys/netinet/tcp_timer.c Wed Jul 27 13:53:15 2016 (r303389) @@ -292,21 +292,29 @@ tcp_timer_2msl(void *xtp) /* * 2 MSL timeout in shutdown went off. If we're closed but * still waiting for peer to close and connection has been idle - * too long, or if 2MSL time is up from TIME_WAIT, delete connection - * control block. Otherwise, check again in a bit. + * too long delete connection control block. Otherwise, check + * again in a bit. + * + * If in TIME_WAIT state just ignore as this timeout is handled in + * tcp_tw_2msl_scan(). * * If fastrecycle of FIN_WAIT_2, in FIN_WAIT_2 and receiver has closed, * there's no point in hanging onto FIN_WAIT_2 socket. Just close it. * Ignore fact that there were recent incoming segments. */ + if ((inp->inp_flags & INP_TIMEWAIT) != 0) { + INP_WUNLOCK(inp); + INP_INFO_WUNLOCK(&V_tcbinfo); + CURVNET_RESTORE(); + return; + } if (tcp_fast_finwait2_recycle && tp->t_state == TCPS_FIN_WAIT_2 && tp->t_inpcb && tp->t_inpcb->inp_socket && (tp->t_inpcb->inp_socket->so_rcv.sb_state & SBS_CANTRCVMORE)) { TCPSTAT_INC(tcps_finwait2_drops); tp = tcp_close(tp); } else { - if (tp->t_state != TCPS_TIME_WAIT && - ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) { + if (ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) { if (!callout_reset(&tp->t_timers->tt_2msl, TP_KEEPINTVL(tp), tcp_timer_2msl, tp)) { tp->t_timers->tt_flags &= ~TT_2MSL_RST; From owner-svn-src-stable@freebsd.org Wed Jul 27 16:27:42 2016 Return-Path: Delivered-To: svn-src-stable@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 91F53BA6E77; Wed, 27 Jul 2016 16:27:42 +0000 (UTC) (envelope-from julian@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 5B0971784; Wed, 27 Jul 2016 16:27:42 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RGRfp4096295; Wed, 27 Jul 2016 16:27:41 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RGRfAD096294; Wed, 27 Jul 2016 16:27:41 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201607271627.u6RGRfAD096294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Wed, 27 Jul 2016 16:27: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: r303395 - 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 16:27:42 -0000 Author: julian Date: Wed Jul 27 16:27:41 2016 New Revision: 303395 URL: https://svnweb.freebsd.org/changeset/base/303395 Log: MFH: r303287 Split MAKE_SYSENT into two parts so that the initializer part can be used separately if one wants to embed the sysent into a larger structure. Modified: stable/10/sys/sys/sysent.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/sysent.h ============================================================================== --- stable/10/sys/sys/sysent.h Wed Jul 27 16:01:44 2016 (r303394) +++ stable/10/sys/sys/sysent.h Wed Jul 27 16:27:41 2016 (r303395) @@ -173,13 +173,21 @@ struct syscall_module_data { struct sysent old_sysent; /* old sysent */ }; -#define MAKE_SYSENT(syscallname) \ -static struct sysent syscallname##_sysent = { \ - (sizeof(struct syscallname ## _args ) \ +/* separate initialization vector so it can be used in a substructure */ +#define SYSENT_INIT_VALS(_syscallname) { \ + .sy_narg = (sizeof(struct _syscallname ## _args ) \ / sizeof(register_t)), \ - (sy_call_t *)& sys_##syscallname, \ - SYS_AUE_##syscallname \ -} + .sy_call = (sy_call_t *)&sys_##_syscallname, \ + .sy_auevent = SYS_AUE_##_syscallname, \ + .sy_systrace_args_func = NULL, \ + .sy_entry = 0, \ + .sy_return = 0, \ + .sy_flags = 0, \ + .sy_thrcnt = 0 \ +} + +#define MAKE_SYSENT(syscallname) \ +static struct sysent syscallname##_sysent = SYSENT_INIT_VALS(syscallname); #define MAKE_SYSENT_COMPAT(syscallname) \ static struct sysent syscallname##_sysent = { \ From owner-svn-src-stable@freebsd.org Wed Jul 27 17:10:11 2016 Return-Path: Delivered-To: svn-src-stable@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 17623BA6B7F; Wed, 27 Jul 2016 17:10:11 +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 DB345166B; Wed, 27 Jul 2016 17:10:10 +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 u6RHAA4T011781; Wed, 27 Jul 2016 17:10:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RHAAGw011780; Wed, 27 Jul 2016 17:10:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201607271710.u6RHAAGw011780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 27 Jul 2016 17:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303398 - stable/11/contrib/elftoolchain/libelftc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 17:10:11 -0000 Author: emaste Date: Wed Jul 27 17:10:09 2016 New Revision: 303398 URL: https://svnweb.freebsd.org/changeset/base/303398 Log: MFC r303279: libelftc: fix demangling of wchar_t "wchar_t" is 7 characters long, not 6. PR: 208661 Submitted by: Daniel McRobb Approved by: re (kib) Obtained from: ELF Tool Chain r3480 Modified: stable/11/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c ============================================================================== --- stable/11/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Wed Jul 27 16:46:48 2016 (r303397) +++ stable/11/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Wed Jul 27 17:10:09 2016 (r303398) @@ -2551,7 +2551,7 @@ again: case 'w': /* wchar_t */ - if (!cpp_demangle_push_str(ddata, "wchar_t", 6)) + if (!cpp_demangle_push_str(ddata, "wchar_t", 7)) goto clean; ++ddata->cur; goto rtn; From owner-svn-src-stable@freebsd.org Wed Jul 27 17:55:15 2016 Return-Path: Delivered-To: svn-src-stable@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 52326BA6778; Wed, 27 Jul 2016 17:55:15 +0000 (UTC) (envelope-from jhb@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 165FD1472; Wed, 27 Jul 2016 17:55:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RHtEIc030518; Wed, 27 Jul 2016 17:55:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RHtEim030517; Wed, 27 Jul 2016 17:55:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607271755.u6RHtEim030517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Jul 2016 17:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303402 - stable/11/usr.sbin/crashinfo X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 17:55:15 -0000 Author: jhb Date: Wed Jul 27 17:55:14 2016 New Revision: 303402 URL: https://svnweb.freebsd.org/changeset/base/303402 Log: MFC 303109: Update crashinfo to work with newer gdb from ports. If gdb from ports is installed, use it instead of the base system gdb to extract variables from a kernel. Note that base gdb and ports gdb do not support the same options for invoking a single command in batch mode, so a wrapper shell function is used. In addition, prefer kgdb from ports when generating a backtrace if present. PR: 193335 Approved by: re (gjb) Modified: stable/11/usr.sbin/crashinfo/crashinfo.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/crashinfo/crashinfo.sh ============================================================================== --- stable/11/usr.sbin/crashinfo/crashinfo.sh Wed Jul 27 17:21:24 2016 (r303401) +++ stable/11/usr.sbin/crashinfo/crashinfo.sh Wed Jul 27 17:55:14 2016 (r303402) @@ -35,6 +35,22 @@ usage() exit 1 } +# Run a single gdb command against a kernel file in batch mode. +# The kernel file is specified as the first argument and the command +# is given in the remaining arguments. +gdb_command() +{ + local k + + k=$1 ; shift + + if [ -x /usr/local/bin/gdb ]; then + /usr/local/bin/gdb -batch -ex "$@" $k + else + echo -e "$@" | /usr/bin/gdb -x /dev/stdin -batch $k + fi +} + find_kernel() { local ivers k kvers @@ -55,8 +71,8 @@ find_kernel() # Look for a matching kernel version. for k in `sysctl -n kern.bootfile` $(ls -t /boot/*/kernel); do - kvers=$(echo 'printf " Version String: %s", version' | \ - gdb -x /dev/stdin -batch $k 2>/dev/null) + kvers=$(gdb_command $k 'printf " Version String: %s", version' \ + 2>/dev/null) if [ "$ivers" = "$kvers" ]; then KERNEL=$k break @@ -151,11 +167,10 @@ echo "Writing crash summary to $FILE." umask 077 # Simulate uname -ostype=$(echo -e printf '"%s", ostype' | gdb -x /dev/stdin -batch $KERNEL) -osrelease=$(echo -e printf '"%s", osrelease' | gdb -x /dev/stdin -batch $KERNEL) -version=$(echo -e printf '"%s", version' | gdb -x /dev/stdin -batch $KERNEL | \ - tr '\t\n' ' ') -machine=$(echo -e printf '"%s", machine' | gdb -x /dev/stdin -batch $KERNEL) +ostype=$(gdb_command $KERNEL 'printf "%s", ostype') +osrelease=$(gdb_command $KERNEL 'printf "%s", osrelease') +version=$(gdb_command $KERNEL 'printf "%s", version' | tr '\t\n' ' ') +machine=$(gdb_command $KERNEL 'printf "%s", machine') exec > $FILE 2>&1 @@ -174,7 +189,11 @@ file=`mktemp /tmp/crashinfo.XXXXXX` if [ $? -eq 0 ]; then echo "bt" >> $file echo "quit" >> $file - kgdb $KERNEL $VMCORE < $file + if [ -x /usr/local/bin/kgdb ]; then + /usr/local/bin/kgdb $KERNEL $VMCORE < $file + else + kgdb $KERNEL $VMCORE < $file + fi rm -f $file echo fi From owner-svn-src-stable@freebsd.org Wed Jul 27 17:55:41 2016 Return-Path: Delivered-To: svn-src-stable@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 4222EBA67D3; Wed, 27 Jul 2016 17:55:41 +0000 (UTC) (envelope-from jhb@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 07D31160A; Wed, 27 Jul 2016 17:55:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RHteLf030590; Wed, 27 Jul 2016 17:55:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RHtekp030589; Wed, 27 Jul 2016 17:55:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607271755.u6RHtekp030589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Jul 2016 17:55: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: r303403 - in stable: 10/usr.sbin/crashinfo 9/usr.sbin/crashinfo 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 17:55:41 -0000 Author: jhb Date: Wed Jul 27 17:55:40 2016 New Revision: 303403 URL: https://svnweb.freebsd.org/changeset/base/303403 Log: MFC 303109: Update crashinfo to work with newer gdb from ports. If gdb from ports is installed, use it instead of the base system gdb to extract variables from a kernel. Note that base gdb and ports gdb do not support the same options for invoking a single command in batch mode, so a wrapper shell function is used. In addition, prefer kgdb from ports when generating a backtrace if present. PR: 193335 Modified: stable/10/usr.sbin/crashinfo/crashinfo.sh Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/usr.sbin/crashinfo/crashinfo.sh Directory Properties: stable/9/usr.sbin/crashinfo/ (props changed) Modified: stable/10/usr.sbin/crashinfo/crashinfo.sh ============================================================================== --- stable/10/usr.sbin/crashinfo/crashinfo.sh Wed Jul 27 17:55:14 2016 (r303402) +++ stable/10/usr.sbin/crashinfo/crashinfo.sh Wed Jul 27 17:55:40 2016 (r303403) @@ -35,6 +35,22 @@ usage() exit 1 } +# Run a single gdb command against a kernel file in batch mode. +# The kernel file is specified as the first argument and the command +# is given in the remaining arguments. +gdb_command() +{ + local k + + k=$1 ; shift + + if [ -x /usr/local/bin/gdb ]; then + /usr/local/bin/gdb -batch -ex "$@" $k + else + echo -e "$@" | /usr/bin/gdb -x /dev/stdin -batch $k + fi +} + find_kernel() { local ivers k kvers @@ -55,8 +71,8 @@ find_kernel() # Look for a matching kernel version. for k in `sysctl -n kern.bootfile` $(ls -t /boot/*/kernel); do - kvers=$(echo 'printf " Version String: %s", version' | \ - gdb -x /dev/stdin -batch $k 2>/dev/null) + kvers=$(gdb_command $k 'printf " Version String: %s", version' \ + 2>/dev/null) if [ "$ivers" = "$kvers" ]; then KERNEL=$k break @@ -151,11 +167,10 @@ echo "Writing crash summary to $FILE." umask 077 # Simulate uname -ostype=$(echo -e printf '"%s", ostype' | gdb -x /dev/stdin -batch $KERNEL) -osrelease=$(echo -e printf '"%s", osrelease' | gdb -x /dev/stdin -batch $KERNEL) -version=$(echo -e printf '"%s", version' | gdb -x /dev/stdin -batch $KERNEL | \ - tr '\t\n' ' ') -machine=$(echo -e printf '"%s", machine' | gdb -x /dev/stdin -batch $KERNEL) +ostype=$(gdb_command $KERNEL 'printf "%s", ostype') +osrelease=$(gdb_command $KERNEL 'printf "%s", osrelease') +version=$(gdb_command $KERNEL 'printf "%s", version' | tr '\t\n' ' ') +machine=$(gdb_command $KERNEL 'printf "%s", machine') exec > $FILE 2>&1 @@ -174,7 +189,11 @@ file=`mktemp /tmp/crashinfo.XXXXXX` if [ $? -eq 0 ]; then echo "bt" >> $file echo "quit" >> $file - kgdb $KERNEL $VMCORE < $file + if [ -x /usr/local/bin/kgdb ]; then + /usr/local/bin/kgdb $KERNEL $VMCORE < $file + else + kgdb $KERNEL $VMCORE < $file + fi rm -f $file echo fi From owner-svn-src-stable@freebsd.org Wed Jul 27 17:55:41 2016 Return-Path: Delivered-To: svn-src-stable@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 78069BA67D8; Wed, 27 Jul 2016 17:55:41 +0000 (UTC) (envelope-from jhb@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 3DBDF160B; Wed, 27 Jul 2016 17:55:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RHteFc030596; Wed, 27 Jul 2016 17:55:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RHteZk030595; Wed, 27 Jul 2016 17:55:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607271755.u6RHteZk030595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Jul 2016 17:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r303403 - in stable: 10/usr.sbin/crashinfo 9/usr.sbin/crashinfo X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 17:55:41 -0000 Author: jhb Date: Wed Jul 27 17:55:40 2016 New Revision: 303403 URL: https://svnweb.freebsd.org/changeset/base/303403 Log: MFC 303109: Update crashinfo to work with newer gdb from ports. If gdb from ports is installed, use it instead of the base system gdb to extract variables from a kernel. Note that base gdb and ports gdb do not support the same options for invoking a single command in batch mode, so a wrapper shell function is used. In addition, prefer kgdb from ports when generating a backtrace if present. PR: 193335 Modified: stable/9/usr.sbin/crashinfo/crashinfo.sh Directory Properties: stable/9/usr.sbin/crashinfo/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/crashinfo/crashinfo.sh Directory Properties: stable/10/ (props changed) Modified: stable/9/usr.sbin/crashinfo/crashinfo.sh ============================================================================== --- stable/9/usr.sbin/crashinfo/crashinfo.sh Wed Jul 27 17:55:14 2016 (r303402) +++ stable/9/usr.sbin/crashinfo/crashinfo.sh Wed Jul 27 17:55:40 2016 (r303403) @@ -35,6 +35,22 @@ usage() exit 1 } +# Run a single gdb command against a kernel file in batch mode. +# The kernel file is specified as the first argument and the command +# is given in the remaining arguments. +gdb_command() +{ + local k + + k=$1 ; shift + + if [ -x /usr/local/bin/gdb ]; then + /usr/local/bin/gdb -batch -ex "$@" $k + else + echo -e "$@" | /usr/bin/gdb -x /dev/stdin -batch $k + fi +} + find_kernel() { local ivers k kvers @@ -55,8 +71,8 @@ find_kernel() # Look for a matching kernel version. for k in `sysctl -n kern.bootfile` $(ls -t /boot/*/kernel); do - kvers=$(echo 'printf " Version String: %s", version' | \ - gdb -x /dev/stdin -batch $k 2>/dev/null) + kvers=$(gdb_command $k 'printf " Version String: %s", version' \ + 2>/dev/null) if [ "$ivers" = "$kvers" ]; then KERNEL=$k break @@ -151,11 +167,10 @@ echo "Writing crash summary to $FILE." umask 077 # Simulate uname -ostype=$(echo -e printf '"%s", ostype' | gdb -x /dev/stdin -batch $KERNEL) -osrelease=$(echo -e printf '"%s", osrelease' | gdb -x /dev/stdin -batch $KERNEL) -version=$(echo -e printf '"%s", version' | gdb -x /dev/stdin -batch $KERNEL | \ - tr '\t\n' ' ') -machine=$(echo -e printf '"%s", machine' | gdb -x /dev/stdin -batch $KERNEL) +ostype=$(gdb_command $KERNEL 'printf "%s", ostype') +osrelease=$(gdb_command $KERNEL 'printf "%s", osrelease') +version=$(gdb_command $KERNEL 'printf "%s", version' | tr '\t\n' ' ') +machine=$(gdb_command $KERNEL 'printf "%s", machine') exec > $FILE 2>&1 @@ -174,7 +189,11 @@ file=`mktemp /tmp/crashinfo.XXXXXX` if [ $? -eq 0 ]; then echo "bt" >> $file echo "quit" >> $file - kgdb $KERNEL $VMCORE < $file + if [ -x /usr/local/bin/kgdb ]; then + /usr/local/bin/kgdb $KERNEL $VMCORE < $file + else + kgdb $KERNEL $VMCORE < $file + fi rm -f $file echo fi From owner-svn-src-stable@freebsd.org Wed Jul 27 19:39:26 2016 Return-Path: Delivered-To: svn-src-stable@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 EEDE6BA6588; Wed, 27 Jul 2016 19:39:26 +0000 (UTC) (envelope-from cy@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 ACC2E1F89; Wed, 27 Jul 2016 19:39:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RJdPge067872; Wed, 27 Jul 2016 19:39:25 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RJdPhE067871; Wed, 27 Jul 2016 19:39:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201607271939.u6RJdPhE067871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 27 Jul 2016 19:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303407 - stable/11/etc/ntp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 19:39:27 -0000 Author: cy Date: Wed Jul 27 19:39:25 2016 New Revision: 303407 URL: https://svnweb.freebsd.org/changeset/base/303407 Log: MFC r303160. Update leap-seconds to leap-seconds.3676752000. As per https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16: UTC TIME STEP on the 1st of January 2017 A positive leap second will be introduced at the end of December 2016. The sequence of dates of the UTC second markers will be: 2016 December 31, 23h 59m 59s 2016 December 31, 23h 59m 60s 2017 January 1, 0h 0m 0s The difference between UTC and the International Atomic Time TAI is: from 2015 July 1, 0h UTC, to 2017 January 1 0h UTC : UTC-TAI = - 36s from 2017 January 1, 0h UTC, until further notice : UTC-TAI = - 37s Obtained from: ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.3676752000 See also: https://www.iers.org/SharedDocs/News/EN/BulletinC.html https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16 Relnotes: yes Approved by: re@ (delphij@) Modified: stable/11/etc/ntp/leap-seconds Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/ntp/leap-seconds ============================================================================== --- stable/11/etc/ntp/leap-seconds Wed Jul 27 19:31:25 2016 (r303406) +++ stable/11/etc/ntp/leap-seconds Wed Jul 27 19:39:25 2016 (r303407) @@ -130,7 +130,7 @@ # Washington, DC # jeffrey.prillaman@usno.navy.mil # -# Last Update of leap second values: 11 Jan 2016 +# Last Update of leap second values: 6 Jul 2016 # # The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to @@ -138,7 +138,7 @@ # be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3661459200 +#$ 3676752000 # # The data in this file will be updated periodically as new leap # seconds are announced. In addition to being entered on the line @@ -170,10 +170,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C 51 -# File expires on: 1 Dec 2016 +# Updated through IERS Bulletin C 52 +# File expires on: 1 Jun 2017 # -#@ 3689539200 +#@ 3705264000 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -202,6 +202,7 @@ 3439756800 34 # 1 Jan 2009 3550089600 35 # 1 Jul 2012 3644697600 36 # 1 Jul 2015 +3692217600 37 # 1 Jan 2017 # # the following special comment contains the # hash value of the data in this file computed @@ -217,5 +218,5 @@ # the hash line is also ignored in the # computation. # -#h 63b4df04 0907d94f 2dadb7a1 684f7767 2a372421 +#h 63f8fea8 587c099d abcf130a ad525eae 3e105052 # From owner-svn-src-stable@freebsd.org Wed Jul 27 19:40:26 2016 Return-Path: Delivered-To: svn-src-stable@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 AFAF6BA6603; Wed, 27 Jul 2016 19:40:26 +0000 (UTC) (envelope-from cy@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 73AFF1247; Wed, 27 Jul 2016 19:40:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RJePnD067969; Wed, 27 Jul 2016 19:40:25 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RJePgL067968; Wed, 27 Jul 2016 19:40:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201607271940.u6RJePgL067968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 27 Jul 2016 19:40: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: r303408 - stable/10/etc/ntp 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 19:40:26 -0000 Author: cy Date: Wed Jul 27 19:40:25 2016 New Revision: 303408 URL: https://svnweb.freebsd.org/changeset/base/303408 Log: MFC r303160. Update leap-seconds to leap-seconds.3676752000. As per https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16: UTC TIME STEP on the 1st of January 2017 A positive leap second will be introduced at the end of December 2016. The sequence of dates of the UTC second markers will be: 2016 December 31, 23h 59m 59s 2016 December 31, 23h 59m 60s 2017 January 1, 0h 0m 0s The difference between UTC and the International Atomic Time TAI is: from 2015 July 1, 0h UTC, to 2017 January 1 0h UTC : UTC-TAI = - 36s from 2017 January 1, 0h UTC, until further notice : UTC-TAI = - 37s Obtained from: ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.3676752000 See also: https://www.iers.org/SharedDocs/News/EN/BulletinC.html https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16 Relnotes: yes Modified: stable/10/etc/ntp/leap-seconds Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/ntp/leap-seconds ============================================================================== --- stable/10/etc/ntp/leap-seconds Wed Jul 27 19:39:25 2016 (r303407) +++ stable/10/etc/ntp/leap-seconds Wed Jul 27 19:40:25 2016 (r303408) @@ -130,7 +130,7 @@ # Washington, DC # jeffrey.prillaman@usno.navy.mil # -# Last Update of leap second values: 11 Jan 2016 +# Last Update of leap second values: 6 Jul 2016 # # The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to @@ -138,7 +138,7 @@ # be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3661459200 +#$ 3676752000 # # The data in this file will be updated periodically as new leap # seconds are announced. In addition to being entered on the line @@ -170,10 +170,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C 51 -# File expires on: 1 Dec 2016 +# Updated through IERS Bulletin C 52 +# File expires on: 1 Jun 2017 # -#@ 3689539200 +#@ 3705264000 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -202,6 +202,7 @@ 3439756800 34 # 1 Jan 2009 3550089600 35 # 1 Jul 2012 3644697600 36 # 1 Jul 2015 +3692217600 37 # 1 Jan 2017 # # the following special comment contains the # hash value of the data in this file computed @@ -217,5 +218,5 @@ # the hash line is also ignored in the # computation. # -#h 63b4df04 0907d94f 2dadb7a1 684f7767 2a372421 +#h 63f8fea8 587c099d abcf130a ad525eae 3e105052 # From owner-svn-src-stable@freebsd.org Wed Jul 27 19:41:09 2016 Return-Path: Delivered-To: svn-src-stable@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 2A8D9BA6751; Wed, 27 Jul 2016 19:41:09 +0000 (UTC) (envelope-from cy@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 E0BEA145B; Wed, 27 Jul 2016 19:41:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RJf8EM068611; Wed, 27 Jul 2016 19:41:08 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RJf8SE068610; Wed, 27 Jul 2016 19:41:08 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201607271941.u6RJf8SE068610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 27 Jul 2016 19:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r303409 - stable/9/etc/ntp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 19:41:09 -0000 Author: cy Date: Wed Jul 27 19:41:07 2016 New Revision: 303409 URL: https://svnweb.freebsd.org/changeset/base/303409 Log: MFC r303160. Update leap-seconds to leap-seconds.3676752000. As per https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16: UTC TIME STEP on the 1st of January 2017 A positive leap second will be introduced at the end of December 2016. The sequence of dates of the UTC second markers will be: 2016 December 31, 23h 59m 59s 2016 December 31, 23h 59m 60s 2017 January 1, 0h 0m 0s The difference between UTC and the International Atomic Time TAI is: from 2015 July 1, 0h UTC, to 2017 January 1 0h UTC : UTC-TAI = - 36s from 2017 January 1, 0h UTC, until further notice : UTC-TAI = - 37s Obtained from: ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.3676752000 See also: https://www.iers.org/SharedDocs/News/EN/BulletinC.html https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16 Relnotes: yes Modified: stable/9/etc/ntp/leap-seconds Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/ntp/leap-seconds ============================================================================== --- stable/9/etc/ntp/leap-seconds Wed Jul 27 19:40:25 2016 (r303408) +++ stable/9/etc/ntp/leap-seconds Wed Jul 27 19:41:07 2016 (r303409) @@ -130,7 +130,7 @@ # Washington, DC # jeffrey.prillaman@usno.navy.mil # -# Last Update of leap second values: 11 Jan 2016 +# Last Update of leap second values: 6 Jul 2016 # # The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to @@ -138,7 +138,7 @@ # be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3661459200 +#$ 3676752000 # # The data in this file will be updated periodically as new leap # seconds are announced. In addition to being entered on the line @@ -170,10 +170,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C 51 -# File expires on: 1 Dec 2016 +# Updated through IERS Bulletin C 52 +# File expires on: 1 Jun 2017 # -#@ 3689539200 +#@ 3705264000 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -202,6 +202,7 @@ 3439756800 34 # 1 Jan 2009 3550089600 35 # 1 Jul 2012 3644697600 36 # 1 Jul 2015 +3692217600 37 # 1 Jan 2017 # # the following special comment contains the # hash value of the data in this file computed @@ -217,5 +218,5 @@ # the hash line is also ignored in the # computation. # -#h 63b4df04 0907d94f 2dadb7a1 684f7767 2a372421 +#h 63f8fea8 587c099d abcf130a ad525eae 3e105052 # From owner-svn-src-stable@freebsd.org Thu Jul 28 11:43:27 2016 Return-Path: Delivered-To: svn-src-stable@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 66EE6BA5DFA; Thu, 28 Jul 2016 11:43:27 +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 1A2D219BB; Thu, 28 Jul 2016 11:43:27 +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 u6SBhQs2026648; Thu, 28 Jul 2016 11:43:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SBhPQD026645; Thu, 28 Jul 2016 11:43:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607281143.u6SBhPQD026645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Jul 2016 11:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303432 - in stable/11/sys: dev/pty kern sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2016 11:43:27 -0000 Author: kib Date: Thu Jul 28 11:43:25 2016 New Revision: 303432 URL: https://svnweb.freebsd.org/changeset/base/303432 Log: MFC r303151: Provide counter_warning(9) KPI. MFC r303155: Hide counted_warning(9) under #ifdef _KERNEL braces. Approved by: re (gjb) Modified: stable/11/sys/dev/pty/pty.c stable/11/sys/kern/subr_prf.c stable/11/sys/sys/systm.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/pty/pty.c ============================================================================== --- stable/11/sys/dev/pty/pty.c Thu Jul 28 11:10:13 2016 (r303431) +++ stable/11/sys/dev/pty/pty.c Thu Jul 28 11:43:25 2016 (r303432) @@ -52,10 +52,10 @@ __FBSDID("$FreeBSD$"); * binary emulation. */ -static unsigned int pty_warningcnt = 1; +static unsigned pty_warningcnt = 1; SYSCTL_UINT(_kern, OID_AUTO, tty_pty_warningcnt, CTLFLAG_RW, - &pty_warningcnt, 0, - "Warnings that will be triggered upon legacy PTY allocation"); + &pty_warningcnt, 0, + "Warnings that will be triggered upon legacy PTY allocation"); static int ptydev_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *fp) @@ -77,12 +77,7 @@ ptydev_fdopen(struct cdev *dev, int ffla } /* Raise a warning when a legacy PTY has been allocated. */ - if (pty_warningcnt > 0) { - pty_warningcnt--; - log(LOG_INFO, "pid %d (%s) is using legacy pty devices%s\n", - td->td_proc->p_pid, td->td_name, - pty_warningcnt ? "" : " - not logging anymore"); - } + counted_warning(&pty_warningcnt, "is using legacy pty devices"); return (0); } Modified: stable/11/sys/kern/subr_prf.c ============================================================================== --- stable/11/sys/kern/subr_prf.c Thu Jul 28 11:10:13 2016 (r303431) +++ stable/11/sys/kern/subr_prf.c Thu Jul 28 11:43:25 2016 (r303432) @@ -1196,3 +1196,24 @@ sbuf_hexdump(struct sbuf *sb, const void } } +#ifdef _KERNEL +void +counted_warning(unsigned *counter, const char *msg) +{ + struct thread *td; + unsigned c; + + for (;;) { + c = *counter; + if (c == 0) + break; + if (atomic_cmpset_int(counter, c, c - 1)) { + td = curthread; + log(LOG_INFO, "pid %d (%s) %s%s\n", + td->td_proc->p_pid, td->td_name, msg, + c > 1 ? "" : " - not logging anymore"); + break; + } + } +} +#endif Modified: stable/11/sys/sys/systm.h ============================================================================== --- stable/11/sys/sys/systm.h Thu Jul 28 11:10:13 2016 (r303431) +++ stable/11/sys/sys/systm.h Thu Jul 28 11:43:25 2016 (r303432) @@ -447,4 +447,6 @@ void intr_prof_stack_use(struct thread * extern void (*softdep_ast_cleanup)(void); +void counted_warning(unsigned *counter, const char *msg); + #endif /* !_SYS_SYSTM_H_ */ From owner-svn-src-stable@freebsd.org Thu Jul 28 11:51:21 2016 Return-Path: Delivered-To: svn-src-stable@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 986B4BA5F5D; Thu, 28 Jul 2016 11:51:21 +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 4B8F31C6A; Thu, 28 Jul 2016 11:51:21 +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 u6SBpK2i030385; Thu, 28 Jul 2016 11:51:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SBpKFK030382; Thu, 28 Jul 2016 11:51:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607281151.u6SBpKFK030382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Jul 2016 11:51: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: r303433 - in stable/10/sys: dev/pty 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2016 11:51:21 -0000 Author: kib Date: Thu Jul 28 11:51:20 2016 New Revision: 303433 URL: https://svnweb.freebsd.org/changeset/base/303433 Log: MFC r303151: Provide counter_warning(9) KPI. MFC r303155: Hide counted_warning(9) under #ifdef _KERNEL braces. Modified: stable/10/sys/dev/pty/pty.c stable/10/sys/kern/subr_prf.c stable/10/sys/sys/systm.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/pty/pty.c ============================================================================== --- stable/10/sys/dev/pty/pty.c Thu Jul 28 11:43:25 2016 (r303432) +++ stable/10/sys/dev/pty/pty.c Thu Jul 28 11:51:20 2016 (r303433) @@ -52,10 +52,10 @@ __FBSDID("$FreeBSD$"); * binary emulation. */ -static unsigned int pty_warningcnt = 1; +static unsigned pty_warningcnt = 1; SYSCTL_UINT(_kern, OID_AUTO, tty_pty_warningcnt, CTLFLAG_RW, - &pty_warningcnt, 0, - "Warnings that will be triggered upon legacy PTY allocation"); + &pty_warningcnt, 0, + "Warnings that will be triggered upon legacy PTY allocation"); static int ptydev_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *fp) @@ -77,12 +77,7 @@ ptydev_fdopen(struct cdev *dev, int ffla } /* Raise a warning when a legacy PTY has been allocated. */ - if (pty_warningcnt > 0) { - pty_warningcnt--; - log(LOG_INFO, "pid %d (%s) is using legacy pty devices%s\n", - td->td_proc->p_pid, td->td_name, - pty_warningcnt ? "" : " - not logging anymore"); - } + counted_warning(&pty_warningcnt, "is using legacy pty devices"); return (0); } Modified: stable/10/sys/kern/subr_prf.c ============================================================================== --- stable/10/sys/kern/subr_prf.c Thu Jul 28 11:43:25 2016 (r303432) +++ stable/10/sys/kern/subr_prf.c Thu Jul 28 11:51:20 2016 (r303433) @@ -1185,3 +1185,24 @@ sbuf_hexdump(struct sbuf *sb, const void } } +#ifdef _KERNEL +void +counted_warning(unsigned *counter, const char *msg) +{ + struct thread *td; + unsigned c; + + for (;;) { + c = *counter; + if (c == 0) + break; + if (atomic_cmpset_int(counter, c, c - 1)) { + td = curthread; + log(LOG_INFO, "pid %d (%s) %s%s\n", + td->td_proc->p_pid, td->td_name, msg, + c > 1 ? "" : " - not logging anymore"); + break; + } + } +} +#endif Modified: stable/10/sys/sys/systm.h ============================================================================== --- stable/10/sys/sys/systm.h Thu Jul 28 11:43:25 2016 (r303432) +++ stable/10/sys/sys/systm.h Thu Jul 28 11:51:20 2016 (r303433) @@ -434,4 +434,6 @@ void intr_prof_stack_use(struct thread * extern void (*softdep_ast_cleanup)(void); +void counted_warning(unsigned *counter, const char *msg); + #endif /* !_SYS_SYSTM_H_ */ From owner-svn-src-stable@freebsd.org Thu Jul 28 12:06:41 2016 Return-Path: Delivered-To: svn-src-stable@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 5B265BA7D32; Thu, 28 Jul 2016 12:06:41 +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 2B1131A12; Thu, 28 Jul 2016 12:06:41 +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 u6SC6egG034196; Thu, 28 Jul 2016 12:06:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SC6eWI034195; Thu, 28 Jul 2016 12:06:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607281206.u6SC6eWI034195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Jul 2016 12:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303434 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2016 12:06:41 -0000 Author: kib Date: Thu Jul 28 12:06:40 2016 New Revision: 303434 URL: https://svnweb.freebsd.org/changeset/base/303434 Log: MFC r303154: Declare aio requests on files from local filesystems safe. Approved by: re (gjb) Modified: stable/11/sys/kern/vfs_aio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_aio.c ============================================================================== --- stable/11/sys/kern/vfs_aio.c Thu Jul 28 11:51:20 2016 (r303433) +++ stable/11/sys/kern/vfs_aio.c Thu Jul 28 12:06:40 2016 (r303434) @@ -1664,7 +1664,10 @@ aio_queue_file(struct file *fp, struct k struct aioliojob *lj; struct kaioinfo *ki; struct kaiocb *job2; + struct vnode *vp; + struct mount *mp; int error, opcode; + bool safe; lj = job->lio; ki = job->userproc->p_aioinfo; @@ -1685,7 +1688,16 @@ aio_queue_file(struct file *fp, struct k goto done; #endif queueit: - if (!enable_aio_unsafe) + safe = false; + if (fp->f_type == DTYPE_VNODE) { + vp = fp->f_vnode; + if (vp->v_type == VREG || vp->v_type == VDIR) { + mp = fp->f_vnode->v_mount; + if (mp == NULL || (mp->mnt_flag & MNT_LOCAL) != 0) + safe = true; + } + } + if (!(safe || enable_aio_unsafe)) return (EOPNOTSUPP); if (opcode == LIO_SYNC) { From owner-svn-src-stable@freebsd.org Thu Jul 28 15:54:19 2016 Return-Path: Delivered-To: svn-src-stable@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 62967BA74AA; Thu, 28 Jul 2016 15:54:19 +0000 (UTC) (envelope-from robak@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 5483D1A28; Thu, 28 Jul 2016 15:54:18 +0000 (UTC) (envelope-from robak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SFsHDj020114; Thu, 28 Jul 2016 15:54:17 GMT (envelope-from robak@FreeBSD.org) Received: (from robak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SFsHVJ020110; Thu, 28 Jul 2016 15:54:17 GMT (envelope-from robak@FreeBSD.org) Message-Id: <201607281554.u6SFsHVJ020110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: robak set sender to robak@FreeBSD.org using -f From: Bartek Rutkowski Date: Thu, 28 Jul 2016 15:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303447 - stable/11/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2016 15:54:19 -0000 Author: robak (ports committer) Date: Thu Jul 28 15:54:17 2016 New Revision: 303447 URL: https://svnweb.freebsd.org/changeset/base/303447 Log: MFC r302897: Add new System Hardening menu and options to bsdinstall. This patch add new 'hardening' file responsible for new bsdinstall 'System Hardening' menu allowing users to set some sane and carefully picked system security options (like random process id's, hiding other users/groups processes and others). All options are OFF by default in this patch due to POLA principle with intention to turn change some of them to ON by default in future. Reviewed by: adrian, allanjude, bdrewery, nwhitehorn Approved by: re@, adrian, allanjude Added: stable/11/usr.sbin/bsdinstall/scripts/hardening - copied unchanged from r302897, head/usr.sbin/bsdinstall/scripts/hardening Modified: stable/11/usr.sbin/bsdinstall/scripts/Makefile stable/11/usr.sbin/bsdinstall/scripts/auto stable/11/usr.sbin/bsdinstall/scripts/config Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/scripts/Makefile ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/Makefile Thu Jul 28 15:49:51 2016 (r303446) +++ stable/11/usr.sbin/bsdinstall/scripts/Makefile Thu Jul 28 15:54:17 2016 (r303447) @@ -1,6 +1,6 @@ # $FreeBSD$ -SCRIPTS= auto adduser checksum config docsinstall entropy hostname jail \ +SCRIPTS= auto adduser checksum config docsinstall entropy hardening hostname jail \ keymap mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 \ rootpass script services time umount wlanconfig zfsboot BINDIR= ${LIBEXECDIR}/bsdinstall Modified: stable/11/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/auto Thu Jul 28 15:49:51 2016 (r303446) +++ stable/11/usr.sbin/bsdinstall/scripts/auto Thu Jul 28 15:54:17 2016 (r303447) @@ -385,6 +385,7 @@ if [ "$NETCONFIG_DONE" != yes ]; then fi bsdinstall time bsdinstall services +bsdinstall hardening dialog --backtitle "FreeBSD Installer" --title "Add User Accounts" --yesno \ "Would you like to add users to the installed system now?" 0 0 && \ @@ -401,6 +402,7 @@ finalconfig() { "Hostname" "Set system hostname" \ "Network" "Networking configuration" \ "Services" "Set daemons to run on startup" \ + "System Hardening" "Set security options" \ "Time Zone" "Set system timezone" \ "Handbook" "Install FreeBSD Handbook (requires network)" 2>&1 1>&3) exec 3>&- @@ -426,6 +428,10 @@ finalconfig() { bsdinstall services finalconfig ;; + "System Hardening") + bsdinstall hardening + finalconfig + ;; "Time Zone") bsdinstall time finalconfig Modified: stable/11/usr.sbin/bsdinstall/scripts/config ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/config Thu Jul 28 15:49:51 2016 (r303446) +++ stable/11/usr.sbin/bsdinstall/scripts/config Thu Jul 28 15:54:17 2016 (r303447) @@ -32,6 +32,9 @@ cat $BSDINSTALL_TMPETC/rc.conf.* >> $BSDINSTALL_TMPETC/rc.conf rm $BSDINSTALL_TMPETC/rc.conf.* +cat $BSDINSTALL_CHROOT/etc/sysctl.conf $BSDINSTALL_TMPETC/sysctl.conf.hardening >> $BSDINSTALL_TMPETC/sysctl.conf +rm $BSDINSTALL_TMPETC/sysctl.conf.* + cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf Copied: stable/11/usr.sbin/bsdinstall/scripts/hardening (from r302897, head/usr.sbin/bsdinstall/scripts/hardening) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.sbin/bsdinstall/scripts/hardening Thu Jul 28 15:54:17 2016 (r303447, copy of r302897, head/usr.sbin/bsdinstall/scripts/hardening) @@ -0,0 +1,79 @@ +#!/bin/sh +#- +# Copyright (c) 2016 Bartek Rutkowski +# 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$ + +: ${DIALOG_OK=0} + +echo -n > $BSDINSTALL_TMPETC/rc.conf.services + +exec 3>&1 +FEATURES=$( dialog --backtitle "FreeBSD Installer" \ + --title "System Hardening" --nocancel --notags --separate-output \ + --checklist "Choose system security hardening options:" \ + 0 0 0 \ + "hide_uids" "Hide processes running as other users" ${hide_uids:-off} \ + "hide_gids" "Hide processes running as other groups" ${hide_gids:-off} \ + "read_msgbuf" "Disable reading kernel message buffer for unprivileged users" ${read_msgbuf:-off} \ + "proc_debug" "Disable process debugging facilities for unprivileged users" ${proc_debug:-off} \ + "random_pid" "Randomize the PID of newly created processes" ${random_id:-off} \ + "stack_guard" "Insert stack guard page ahead of the growable segments" ${stack_guard:-off} \ + "clear_tmp" "Clean the /tmp filesystem on system startup" ${clear_tmp:-off} \ + "disable_syslogd" "Disable opening Syslogd network socket (disables remote logging)" ${disable_syslogd:-off} \ + "disable_sendmail" "Disable Sendmail service" ${disable_sendmail:-off} \ +2>&1 1>&3 ) +exec 3>&- + +for feature in $FEATURES; do + if [ "$feature" = "hide_uids" ]; then + echo security.bsd.see_other_uids=0 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening + fi + if [ "$feature" = "hide_gids" ]; then + echo security.bsd.see_other_gids=0 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening + fi + if [ "$feature" = "read_msgbuf" ]; then + echo security.bsd.unprivileged_read_msgbuf=0 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening + fi + if [ "$feature" = "proc_debug" ]; then + echo security.bsd.unprivileged_proc_debug=0 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening + fi + if [ "$feature" = "random_id" ]; then + echo kern.randompid=$(jot -r 1 9999) >> $BSDINSTALL_TMPETC/sysctl.conf.hardening + fi + if [ "$feature" = "stack_guard" ]; then + echo security.bsd.stack_guard_page=1 >> $BSDINSTALL_TMPETC/sysctl.conf.hardening + fi + if [ "$feature" = "clear_tmp" ]; then + echo 'clear_tmp_enable="YES"' >> $BSDINSTALL_TMPETC/rc.conf.hardening + fi + if [ "$feature" = "disable_syslogd" ]; then + echo 'syslogd_flags="-ss"' >> $BSDINSTALL_TMPETC/rc.conf.hardening + fi + if [ "$feature" = "disable_sendmail" ]; then + echo 'sendmail_enable="NONE"' >> $BSDINSTALL_TMPETC/rc.conf.hardening + fi +done + From owner-svn-src-stable@freebsd.org Thu Jul 28 20:08:02 2016 Return-Path: Delivered-To: svn-src-stable@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 AD42CBA70B1; Thu, 28 Jul 2016 20:08:02 +0000 (UTC) (envelope-from sbruno@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 791861A8B; Thu, 28 Jul 2016 20:08:02 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SK81wY012741; Thu, 28 Jul 2016 20:08:01 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SK81AE012736; Thu, 28 Jul 2016 20:08:01 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201607282008.u6SK81AE012736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 28 Jul 2016 20:08: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: r303458 - 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2016 20:08:02 -0000 Author: sbruno Date: Thu Jul 28 20:08:01 2016 New Revision: 303458 URL: https://svnweb.freebsd.org/changeset/base/303458 Log: MFC r296063 r297397 r299213 296063: Lock the NDP default router list and count defrouter references. This addresses a number of race conditions that can cause crashes as a result of unsynchronized access to the list. 297397 Modify nd6_llinfo_timer() to acquire the nd6 lock before the LLE lock. When expiring a neighbour cache entry we may need to look up the associated default router, which requires the nd6 read lock. To avoid an LOR, the nd6 lock should be acquired first. 299213 Clean up callers of nd6_prelist_add(). nd6_prelist_add() sets *newp if and only if it is successful, so there's no need for code that handles the case where the return value is 0 and *newp == NULL. Fix some style bugs in nd6_prelist_add() while here. Submitted by: Jason Wolfe Modified: stable/10/sys/netinet6/in6.c stable/10/sys/netinet6/nd6.c stable/10/sys/netinet6/nd6.h stable/10/sys/netinet6/nd6_nbr.c stable/10/sys/netinet6/nd6_rtr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/in6.c ============================================================================== --- stable/10/sys/netinet6/in6.c Thu Jul 28 19:32:25 2016 (r303457) +++ stable/10/sys/netinet6/in6.c Thu Jul 28 20:08:01 2016 (r303458) @@ -732,14 +732,6 @@ in6_control(struct socket *so, u_long cm (*carp_detach_p)(&ia->ia_ifa); goto out; } - if (pr == NULL) { - if (carp_attached) - (*carp_detach_p)(&ia->ia_ifa); - log(LOG_ERR, "nd6_prelist_add succeeded but " - "no prefix\n"); - error = EINVAL; - goto out; - } } /* relate the address to the prefix */ Modified: stable/10/sys/netinet6/nd6.c ============================================================================== --- stable/10/sys/netinet6/nd6.c Thu Jul 28 19:32:25 2016 (r303457) +++ stable/10/sys/netinet6/nd6.c Thu Jul 28 20:08:01 2016 (r303458) @@ -114,6 +114,7 @@ VNET_DEFINE(int, nd6_debug) = 0; VNET_DEFINE(struct nd_drhead, nd_defrouter); VNET_DEFINE(struct nd_prhead, nd_prefix); +VNET_DEFINE(struct rwlock, nd6_lock); VNET_DEFINE(int, nd6_recalc_reachtm_interval) = ND6_RECALC_REACHTM_INTERVAL; #define V_nd6_recalc_reachtm_interval VNET(nd6_recalc_reachtm_interval) @@ -125,7 +126,7 @@ static int nd6_is_new_addr_neighbor(stru static void nd6_setmtu0(struct ifnet *, struct nd_ifinfo *); static void nd6_slowtimo(void *); static int regen_tmpaddr(struct in6_ifaddr *); -static struct llentry *nd6_free(struct llentry *, int); +static struct llentry *nd6_free(struct llentry **, int); static void nd6_llinfo_timer(void *); static void clear_llinfo_pqueue(struct llentry *); static int nd6_output_lle(struct ifnet *, struct ifnet *, struct mbuf *, @@ -142,6 +143,8 @@ void nd6_init(void) { + rw_init(&V_nd6_lock, "nd6"); + LIST_INIT(&V_nd_prefix); /* initialization of the default router list */ @@ -162,6 +165,7 @@ nd6_destroy() callout_drain(&V_nd6_slowtimo_ch); callout_drain(&V_nd6_timer_ch); + rw_destroy(&V_nd6_lock); } #endif @@ -466,10 +470,14 @@ nd6_llinfo_timer(void *arg) struct llentry *ln; struct in6_addr *dst; struct ifnet *ifp; - struct nd_ifinfo *ndi = NULL; + struct nd_ifinfo *ndi; KASSERT(arg != NULL, ("%s: arg NULL", __func__)); ln = (struct llentry *)arg; + ifp = ln->lle_tbl->llt_ifp; + CURVNET_SET(ifp->if_vnet); + + ND6_RLOCK(); LLE_WLOCK(ln); if (callout_pending(&ln->la_timer)) { /* @@ -489,10 +497,10 @@ nd6_llinfo_timer(void *arg) * would have been 1. */ LLE_WUNLOCK(ln); + ND6_RUNLOCK(); + CURVNET_RESTORE(); return; } - ifp = ln->lle_tbl->llt_ifp; - CURVNET_SET(ifp->if_vnet); if (ln->ln_ntick > 0) { if (ln->ln_ntick > INT_MAX) { @@ -512,8 +520,7 @@ nd6_llinfo_timer(void *arg) } if (ln->la_flags & LLE_DELETED) { - (void)nd6_free(ln, 0); - ln = NULL; + (void)nd6_free(&ln, 0); goto done; } @@ -539,9 +546,7 @@ nd6_llinfo_timer(void *arg) ln->la_hold = m0; clear_llinfo_pqueue(ln); } - EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_TIMEDOUT); - (void)nd6_free(ln, 0); - ln = NULL; + (void)nd6_free(&ln, 0); if (m != NULL) icmp6_error2(m, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_ADDR, 0, ifp); @@ -558,7 +563,7 @@ nd6_llinfo_timer(void *arg) /* Garbage Collection(RFC 2461 5.3) */ if (!ND6_LLINFO_PERMANENT(ln)) { EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_EXPIRED); - (void)nd6_free(ln, 1); + (void)nd6_free(&ln, 1); ln = NULL; } break; @@ -585,9 +590,7 @@ nd6_llinfo_timer(void *arg) nd6_ns_output(ifp, dst, dst, ln, NULL); LLE_WLOCK(ln); } else { - EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_EXPIRED); - (void)nd6_free(ln, 0); - ln = NULL; + (void)nd6_free(&ln, 0); } break; default: @@ -595,8 +598,10 @@ nd6_llinfo_timer(void *arg) __func__, ln->ln_state); } done: - if (ln != NULL) + if (ln != NULL) { + ND6_RUNLOCK(); LLE_FREE_LOCKED(ln); + } CURVNET_RESTORE(); } @@ -608,6 +613,7 @@ void nd6_timer(void *arg) { CURVNET_SET((struct vnet *) arg); + struct nd_drhead drq; struct nd_defrouter *dr, *ndr; struct nd_prefix *pr, *npr; struct in6_ifaddr *ia6, *nia6; @@ -615,10 +621,18 @@ nd6_timer(void *arg) callout_reset(&V_nd6_timer_ch, V_nd6_prune * hz, nd6_timer, curvnet); + TAILQ_INIT(&drq); + /* expire default router list */ - TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) { + ND6_WLOCK(); + TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) if (dr->expire && dr->expire < time_uptime) - defrtrlist_del(dr); + defrouter_unlink(dr, &drq); + ND6_WUNLOCK(); + + while ((dr = TAILQ_FIRST(&drq)) != NULL) { + TAILQ_REMOVE(&drq, dr, dr_entry); + defrouter_del(dr); } /* @@ -813,29 +827,37 @@ regen_tmpaddr(struct in6_ifaddr *ia6) void nd6_purge(struct ifnet *ifp) { + struct nd_drhead drq; struct nd_defrouter *dr, *ndr; struct nd_prefix *pr, *npr; + TAILQ_INIT(&drq); + /* * Nuke default router list entries toward ifp. * We defer removal of default router list entries that is installed * in the routing table, in order to keep additional side effects as * small as possible. */ + ND6_WLOCK(); TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) { if (dr->installed) continue; - if (dr->ifp == ifp) - defrtrlist_del(dr); + defrouter_unlink(dr, &drq); } TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, ndr) { if (!dr->installed) continue; - if (dr->ifp == ifp) - defrtrlist_del(dr); + defrouter_unlink(dr, &drq); + } + ND6_WUNLOCK(); + + while ((dr = TAILQ_FIRST(&drq)) != NULL) { + TAILQ_REMOVE(&drq, dr, dr_entry); + defrouter_del(dr); } /* Nuke prefix list entries toward ifp */ @@ -1046,13 +1068,27 @@ nd6_is_addr_neighbor(struct sockaddr_in6 * that the change is safe. */ static struct llentry * -nd6_free(struct llentry *ln, int gc) +nd6_free(struct llentry **lnp, int gc) { - struct llentry *next; - struct nd_defrouter *dr; struct ifnet *ifp; + struct llentry *ln, *next; + struct nd_defrouter *dr; + + ln = *lnp; + *lnp = NULL; LLE_WLOCK_ASSERT(ln); + ND6_RLOCK_ASSERT(); + + ifp = ln->lle_tbl->llt_ifp; + if ((ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) != 0) + dr = defrouter_lookup_locked(&L3_ADDR_SIN6(ln)->sin6_addr, ifp); + else + dr = NULL; + ND6_RUNLOCK(); + + if ((ln->la_flags & LLE_DELETED) == 0) + EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_EXPIRED); /* * we used to have pfctlinput(PRC_HOSTDEAD) here. @@ -1062,11 +1098,7 @@ nd6_free(struct llentry *ln, int gc) /* cancel timer */ nd6_llinfo_settimer_locked(ln, -1); - ifp = ln->lle_tbl->llt_ifp; - if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) { - dr = defrouter_lookup(&L3_ADDR_SIN6(ln)->sin6_addr, ifp); - if (dr != NULL && dr->expire && ln->ln_state == ND6_LLINFO_STALE && gc) { /* @@ -1091,6 +1123,7 @@ nd6_free(struct llentry *ln, int gc) next = LIST_NEXT(ln, lle_next); LLE_REMREF(ln); LLE_WUNLOCK(ln); + defrouter_rele(dr); return (next); } @@ -1173,6 +1206,8 @@ nd6_free(struct llentry *ln, int gc) IF_AFDATA_UNLOCK(ifp); + if (dr != NULL) + defrouter_rele(dr); return (next); } @@ -1251,12 +1286,13 @@ nd6_rtrequest(int req, struct rtentry *r /* * check for default route */ - if (IN6_ARE_ADDR_EQUAL(&in6addr_any, - &SIN6(rt_key(rt))->sin6_addr)) { - + if (IN6_ARE_ADDR_EQUAL(&in6addr_any, + &SIN6(rt_key(rt))->sin6_addr)) { dr = defrouter_lookup(&gateway->sin6_addr, ifp); - if (dr != NULL) + if (dr != NULL) { dr->installed = 0; + defrouter_rele(dr); + } } break; } @@ -1444,12 +1480,22 @@ nd6_ioctl(u_long cmd, caddr_t data, stru case SIOCSRTRFLUSH_IN6: { /* flush all the default routers */ - struct nd_defrouter *dr, *next; + struct nd_drhead drq; + struct nd_defrouter *dr; + + TAILQ_INIT(&drq); defrouter_reset(); - TAILQ_FOREACH_SAFE(dr, &V_nd_defrouter, dr_entry, next) { - defrtrlist_del(dr); + + ND6_WLOCK(); + while ((dr = TAILQ_FIRST(&V_nd_defrouter)) != NULL) + defrouter_unlink(dr, &drq); + ND6_WUNLOCK(); + while ((dr = TAILQ_FIRST(&drq)) != NULL) { + TAILQ_REMOVE(&drq, dr, dr_entry); + defrouter_del(dr); } + defrouter_select(); break; } @@ -2200,30 +2246,33 @@ nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) struct nd_defrouter *dr; int error; - if (req->newptr) + if (req->newptr != NULL) return (EPERM); + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + bzero(&d, sizeof(d)); d.rtaddr.sin6_family = AF_INET6; d.rtaddr.sin6_len = sizeof(d.rtaddr); - /* - * XXX locking - */ + ND6_RLOCK(); TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { d.rtaddr.sin6_addr = dr->rtaddr; error = sa6_recoverscope(&d.rtaddr); if (error != 0) - return (error); + break; d.flags = dr->raflags; d.rtlifetime = dr->rtlifetime; d.expire = dr->expire + (time_second - time_uptime); d.if_index = dr->ifp->if_index; error = SYSCTL_OUT(req, &d, sizeof(d)); if (error != 0) - return (error); + break; } - return (0); + ND6_RUNLOCK(); + return (error); } static int Modified: stable/10/sys/netinet6/nd6.h ============================================================================== --- stable/10/sys/netinet6/nd6.h Thu Jul 28 19:32:25 2016 (r303457) +++ stable/10/sys/netinet6/nd6.h Thu Jul 28 20:08:01 2016 (r303458) @@ -243,6 +243,7 @@ struct nd_defrouter { u_long expire; struct ifnet *ifp; int installed; /* is installed into kernel routing table */ + u_int refcnt; }; struct nd_prefixctl { @@ -342,6 +343,19 @@ VNET_DECLARE(int, nd6_onlink_ns_rfc4861) #define V_nd6_debug VNET(nd6_debug) #define V_nd6_onlink_ns_rfc4861 VNET(nd6_onlink_ns_rfc4861) +/* Lock for the prefix and default router lists. */ +VNET_DECLARE(struct rwlock, nd6_lock); +#define V_nd6_lock VNET(nd6_lock) + +#define ND6_RLOCK() rw_rlock(&V_nd6_lock) +#define ND6_RUNLOCK() rw_runlock(&V_nd6_lock) +#define ND6_WLOCK() rw_wlock(&V_nd6_lock) +#define ND6_WUNLOCK() rw_wunlock(&V_nd6_lock) +#define ND6_WLOCK_ASSERT() rw_assert(&V_nd6_lock, RA_WLOCKED) +#define ND6_RLOCK_ASSERT() rw_assert(&V_nd6_lock, RA_RLOCKED) +#define ND6_LOCK_ASSERT() rw_assert(&V_nd6_lock, RA_LOCKED) +#define ND6_UNLOCK_ASSERT() rw_assert(&V_nd6_lock, RA_UNLOCKED) + #define nd6log(x) do { if (V_nd6_debug) log x; } while (/*CONSTCOND*/ 0) VNET_DECLARE(struct callout, nd6_timer_ch); @@ -447,12 +461,17 @@ void nd6_rs_input(struct mbuf *, int, in void nd6_ra_input(struct mbuf *, int, int); void defrouter_reset(void); void defrouter_select(void); -void defrtrlist_del(struct nd_defrouter *); +void defrouter_ref(struct nd_defrouter *); +void defrouter_rele(struct nd_defrouter *); +bool defrouter_remove(struct in6_addr *, struct ifnet *); +void defrouter_unlink(struct nd_defrouter *, struct nd_drhead *); +void defrouter_del(struct nd_defrouter *); void prelist_remove(struct nd_prefix *); int nd6_prelist_add(struct nd_prefixctl *, struct nd_defrouter *, struct nd_prefix **); void pfxlist_onlink_check(void); struct nd_defrouter *defrouter_lookup(struct in6_addr *, struct ifnet *); +struct nd_defrouter *defrouter_lookup_locked(struct in6_addr *, struct ifnet *); struct nd_prefix *nd6_prefix_lookup(struct nd_prefixctl *); void rt6_flush(struct in6_addr *, struct ifnet *); int nd6_setdefaultiface(int); Modified: stable/10/sys/netinet6/nd6_nbr.c ============================================================================== --- stable/10/sys/netinet6/nd6_nbr.c Thu Jul 28 19:32:25 2016 (r303457) +++ stable/10/sys/netinet6/nd6_nbr.c Thu Jul 28 20:08:01 2016 (r303458) @@ -895,25 +895,17 @@ nd6_na_input(struct mbuf *m, int off, in * Remove the sender from the Default Router List and * update the Destination Cache entries. */ - struct nd_defrouter *dr; - struct in6_addr *in6; - - in6 = &L3_ADDR_SIN6(ln)->sin6_addr; - - dr = defrouter_lookup(in6, ln->lle_tbl->llt_ifp); - if (dr) - defrtrlist_del(dr); - else if (ND_IFINFO(ln->lle_tbl->llt_ifp)->flags & - ND6_IFF_ACCEPT_RTADV) { + if (!defrouter_remove(&L3_ADDR_SIN6(ln)->sin6_addr, + ln->lle_tbl->llt_ifp) && + (ND_IFINFO(ln->lle_tbl->llt_ifp)->flags & + ND6_IFF_ACCEPT_RTADV) != 0) /* * Even if the neighbor is not in the default - * router list, the neighbor may be used - * as a next hop for some destinations - * (e.g. redirect case). So we must - * call rt6_flush explicitly. + * router list, the neighbor may be used as a + * next hop for some destinations (e.g. redirect + * case). So we must call rt6_flush explicitly. */ rt6_flush(&ip6->ip6_src, ifp); - } } ln->ln_router = is_router; } Modified: stable/10/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/10/sys/netinet6/nd6_rtr.c Thu Jul 28 19:32:25 2016 (r303457) +++ stable/10/sys/netinet6/nd6_rtr.c Thu Jul 28 20:08:01 2016 (r303458) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -218,6 +219,8 @@ nd6_ra_input(struct mbuf *m, int off, in struct nd_defrouter *dr; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; + dr = NULL; + /* * We only accept RAs only when the per-interface flag * ND6_IFF_ACCEPT_RTADV is on the receiving interface. @@ -367,6 +370,10 @@ nd6_ra_input(struct mbuf *m, int off, in (void)prelist_update(&pr, dr, m, mcast); } } + if (dr != NULL) { + defrouter_rele(dr); + dr = NULL; + } /* * MTU @@ -444,10 +451,6 @@ nd6_ra_input(struct mbuf *m, int off, in m_freem(m); } -/* - * default router list proccessing sub routines - */ - /* tell the change to user processes watching the routing socket. */ static void nd6_rtmsg(int cmd, struct rtentry *rt) @@ -476,6 +479,10 @@ nd6_rtmsg(int cmd, struct rtentry *rt) ifa_free(ifa); } +/* + * default router list proccessing sub routines + */ + static void defrouter_addreq(struct nd_defrouter *new) { @@ -504,16 +511,43 @@ defrouter_addreq(struct nd_defrouter *ne } struct nd_defrouter * -defrouter_lookup(struct in6_addr *addr, struct ifnet *ifp) +defrouter_lookup_locked(struct in6_addr *addr, struct ifnet *ifp) { struct nd_defrouter *dr; - TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { - if (dr->ifp == ifp && IN6_ARE_ADDR_EQUAL(addr, &dr->rtaddr)) + ND6_LOCK_ASSERT(); + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) + if (dr->ifp == ifp && IN6_ARE_ADDR_EQUAL(addr, &dr->rtaddr)) { + defrouter_ref(dr); return (dr); - } + } + return (NULL); +} + +struct nd_defrouter * +defrouter_lookup(struct in6_addr *addr, struct ifnet *ifp) +{ + struct nd_defrouter *dr; - return (NULL); /* search failed */ + ND6_RLOCK(); + dr = defrouter_lookup_locked(addr, ifp); + ND6_RUNLOCK(); + return (dr); +} + +void +defrouter_ref(struct nd_defrouter *dr) +{ + + refcount_acquire(&dr->refcnt); +} + +void +defrouter_rele(struct nd_defrouter *dr) +{ + + if (refcount_release(&dr->refcnt)) + free(dr, M_IP6NDP); } /* @@ -548,15 +582,41 @@ defrouter_delreq(struct nd_defrouter *dr } /* - * remove all default routes from default router list + * Remove all default routes from default router list. */ void defrouter_reset(void) { - struct nd_defrouter *dr; + struct nd_defrouter *dr, **dra; + int count, i; + + count = i = 0; + /* + * We can't delete routes with the ND lock held, so make a copy of the + * current default router list and use that when deleting routes. + */ + ND6_RLOCK(); TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) - defrouter_delreq(dr); + count++; + ND6_RUNLOCK(); + + dra = malloc(count * sizeof(*dra), M_TEMP, M_WAITOK | M_ZERO); + + ND6_RLOCK(); + TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { + if (i == count) + break; + defrouter_ref(dr); + dra[i++] = dr; + } + ND6_RUNLOCK(); + + for (i = 0; i < count && dra[i] != NULL; i++) { + defrouter_delreq(dra[i]); + defrouter_rele(dra[i]); + } + free(dra, M_TEMP); /* * XXX should we also nuke any default routers in the kernel, by @@ -564,12 +624,53 @@ defrouter_reset(void) */ } +/* + * Look up a matching default router list entry and remove it. Returns true if a + * matching entry was found, false otherwise. + */ +bool +defrouter_remove(struct in6_addr *addr, struct ifnet *ifp) +{ + struct nd_defrouter *dr; + + ND6_WLOCK(); + dr = defrouter_lookup_locked(addr, ifp); + if (dr == NULL) { + ND6_WUNLOCK(); + return (false); + } + + defrouter_unlink(dr, NULL); + ND6_WUNLOCK(); + defrouter_del(dr); + defrouter_rele(dr); + return (true); +} + +/* + * Remove a router from the global list and optionally stash it in a + * caller-supplied queue. + * + * The ND lock must be held. + */ void -defrtrlist_del(struct nd_defrouter *dr) +defrouter_unlink(struct nd_defrouter *dr, struct nd_drhead *drq) +{ + + ND6_WLOCK_ASSERT(); + TAILQ_REMOVE(&V_nd_defrouter, dr, dr_entry); + if (drq != NULL) + TAILQ_INSERT_TAIL(drq, dr, dr_entry); +} + +void +defrouter_del(struct nd_defrouter *dr) { struct nd_defrouter *deldr = NULL; struct nd_prefix *pr; + ND6_UNLOCK_ASSERT(); + /* * Flush all the routing table entries that use the router * as a next hop. @@ -581,7 +682,6 @@ defrtrlist_del(struct nd_defrouter *dr) deldr = dr; defrouter_delreq(dr); } - TAILQ_REMOVE(&V_nd_defrouter, dr, dr_entry); /* * Also delete all the pointers to the router in each prefix lists. @@ -601,7 +701,10 @@ defrtrlist_del(struct nd_defrouter *dr) if (deldr) defrouter_select(); - free(dr, M_IP6NDP); + /* + * Release the list reference. + */ + defrouter_rele(dr); } /* @@ -628,27 +731,32 @@ defrtrlist_del(struct nd_defrouter *dr) void defrouter_select(void) { - struct nd_defrouter *dr, *selected_dr = NULL, *installed_dr = NULL; + struct nd_defrouter *dr, *selected_dr, *installed_dr; struct llentry *ln = NULL; + ND6_RLOCK(); /* * Let's handle easy case (3) first: * If default router list is empty, there's nothing to be done. */ - if (TAILQ_EMPTY(&V_nd_defrouter)) + if (TAILQ_EMPTY(&V_nd_defrouter)) { + ND6_RUNLOCK(); return; + } /* * Search for a (probably) reachable router from the list. * We just pick up the first reachable one (if any), assuming that * the ordering rule of the list described in defrtrlist_update(). */ + selected_dr = installed_dr = NULL; TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { IF_AFDATA_RLOCK(dr->ifp); if (selected_dr == NULL && (ln = nd6_lookup(&dr->rtaddr, 0, dr->ifp)) && ND6_IS_LLINFO_PROBREACH(ln)) { selected_dr = dr; + defrouter_ref(selected_dr); } IF_AFDATA_RUNLOCK(dr->ifp); if (ln != NULL) { @@ -656,12 +764,15 @@ defrouter_select(void) ln = NULL; } - if (dr->installed && installed_dr == NULL) - installed_dr = dr; - else if (dr->installed && installed_dr) { - /* this should not happen. warn for diagnosis. */ - log(LOG_ERR, "defrouter_select: more than one router" - " is installed\n"); + if (dr->installed) { + if (installed_dr == NULL) { + installed_dr = dr; + defrouter_ref(installed_dr); + } else { + /* this should not happen. warn for diagnosis. */ + log(LOG_ERR, + "defrouter_select: more than one router is installed\n"); + } } } /* @@ -673,21 +784,25 @@ defrouter_select(void) * or when the new one has a really higher preference value. */ if (selected_dr == NULL) { - if (installed_dr == NULL || !TAILQ_NEXT(installed_dr, dr_entry)) + if (installed_dr == NULL || + TAILQ_NEXT(installed_dr, dr_entry) == NULL) selected_dr = TAILQ_FIRST(&V_nd_defrouter); else selected_dr = TAILQ_NEXT(installed_dr, dr_entry); - } else if (installed_dr) { + defrouter_ref(selected_dr); + } else if (installed_dr != NULL) { IF_AFDATA_RLOCK(installed_dr->ifp); if ((ln = nd6_lookup(&installed_dr->rtaddr, 0, installed_dr->ifp)) && ND6_IS_LLINFO_PROBREACH(ln) && rtpref(selected_dr) <= rtpref(installed_dr)) { + defrouter_rele(selected_dr); selected_dr = installed_dr; } IF_AFDATA_RUNLOCK(installed_dr->ifp); if (ln != NULL) LLE_RUNLOCK(ln); } + ND6_RUNLOCK(); /* * If the selected router is different than the installed one, @@ -695,10 +810,13 @@ defrouter_select(void) * Note that the selected router is never NULL here. */ if (installed_dr != selected_dr) { - if (installed_dr) + if (installed_dr != NULL) { defrouter_delreq(installed_dr); + defrouter_rele(installed_dr); + } defrouter_addreq(selected_dr); } + defrouter_rele(selected_dr); } /* @@ -734,13 +852,14 @@ defrtrlist_update(struct nd_defrouter *n struct nd_defrouter *dr, *n; int oldpref; - if ((dr = defrouter_lookup(&new->rtaddr, new->ifp)) != NULL) { - /* entry exists */ - if (new->rtlifetime == 0) { - defrtrlist_del(dr); - return (NULL); - } + if (new->rtlifetime == 0) { + defrouter_remove(&new->rtaddr, new->ifp); + return (NULL); + } + ND6_WLOCK(); + dr = defrouter_lookup_locked(&new->rtaddr, new->ifp); + if (dr != NULL) { oldpref = rtpref(dr); /* override */ @@ -753,8 +872,10 @@ defrtrlist_update(struct nd_defrouter *n * to sort the entries. Also make sure the selected * router is still installed in the kernel. */ - if (dr->installed && rtpref(new) == oldpref) + if (dr->installed && rtpref(new) == oldpref) { + ND6_WUNLOCK(); return (dr); + } /* * The preferred router may have changed, so relocate this @@ -762,19 +883,17 @@ defrtrlist_update(struct nd_defrouter *n */ TAILQ_REMOVE(&V_nd_defrouter, dr, dr_entry); n = dr; - goto insert; + } else { + n = malloc(sizeof(*n), M_IP6NDP, M_NOWAIT | M_ZERO); + if (n == NULL) { + ND6_WUNLOCK(); + return (NULL); + } + memcpy(n, new, sizeof(*n)); + /* Initialize with an extra reference for the caller. */ + refcount_init(&n->refcnt, 2); } - /* entry does not exist */ - if (new->rtlifetime == 0) - return (NULL); - - n = malloc(sizeof(*n), M_IP6NDP, M_NOWAIT | M_ZERO); - if (n == NULL) - return (NULL); - memcpy(n, new, sizeof(*n)); - -insert: /* * Insert the new router in the Default Router List; * The Default Router List should be in the descending order @@ -787,10 +906,11 @@ insert: if (rtpref(n) > rtpref(dr)) break; } - if (dr) + if (dr != NULL) TAILQ_INSERT_BEFORE(dr, n, dr_entry); else TAILQ_INSERT_TAIL(&V_nd_defrouter, n, dr_entry); + ND6_WUNLOCK(); defrouter_select(); @@ -819,6 +939,7 @@ pfxrtr_add(struct nd_prefix *pr, struct if (new == NULL) return; new->router = dr; + defrouter_ref(dr); LIST_INSERT_HEAD(&pr->ndpr_advrtrs, new, pfr_entry); @@ -828,7 +949,9 @@ pfxrtr_add(struct nd_prefix *pr, struct static void pfxrtr_del(struct nd_pfxrouter *pfr) { + LIST_REMOVE(pfr, pfr_entry); + defrouter_rele(pfr->router); free(pfr, M_IP6NDP); } @@ -869,11 +992,9 @@ nd6_prelist_add(struct nd_prefixctl *pr, new->ndpr_flags = pr->ndpr_flags; if ((error = in6_init_prefix_ltimes(new)) != 0) { free(new, M_IP6NDP); - return(error); + return (error); } new->ndpr_lastupdate = time_uptime; - if (newp != NULL) - *newp = new; /* initialization */ LIST_INIT(&new->ndpr_advrtrs); @@ -899,10 +1020,11 @@ nd6_prelist_add(struct nd_prefixctl *pr, } } - if (dr) + if (dr != NULL) pfxrtr_add(new, dr); - - return 0; + if (newp != NULL) + *newp = new; + return (0); } void @@ -959,7 +1081,6 @@ prelist_update(struct nd_prefixctl *new, struct ifnet *ifp = new->ndpr_ifp; struct nd_prefix *pr; int error = 0; - int newprefix = 0; int auth; struct in6_addrlifetime lt6_tmp; char ip6buf[INET6_ADDRSTRLEN]; @@ -1017,23 +1138,17 @@ prelist_update(struct nd_prefixctl *new, if (dr && pfxrtr_lookup(pr, dr) == NULL) pfxrtr_add(pr, dr); } else { - struct nd_prefix *newpr = NULL; - - newprefix = 1; - if (new->ndpr_vltime == 0) goto end; if (new->ndpr_raf_onlink == 0 && new->ndpr_raf_auto == 0) goto end; - error = nd6_prelist_add(new, dr, &newpr); - if (error != 0 || newpr == NULL) { + error = nd6_prelist_add(new, dr, &pr); + if (error != 0) { nd6log((LOG_NOTICE, "prelist_update: " - "nd6_prelist_add failed for %s/%d on %s " - "errno=%d, returnpr=%p\n", + "nd6_prelist_add failed for %s/%d on %s errno=%d\n", ip6_sprintf(ip6buf, &new->ndpr_prefix.sin6_addr), - new->ndpr_plen, if_name(new->ndpr_ifp), - error, newpr)); + new->ndpr_plen, if_name(new->ndpr_ifp), error)); goto end; /* we should just give up in this case. */ } @@ -1044,13 +1159,11 @@ prelist_update(struct nd_prefixctl *new, * addresses. Thus, we explicitly make sure that the prefix * itself expires now. */ - if (newpr->ndpr_raf_onlink == 0) { - newpr->ndpr_vltime = 0; - newpr->ndpr_pltime = 0; - in6_init_prefix_ltimes(newpr); + if (pr->ndpr_raf_onlink == 0) { + pr->ndpr_vltime = 0; + pr->ndpr_pltime = 0; + in6_init_prefix_ltimes(pr); } - - pr = newpr; } /* @@ -1346,6 +1459,7 @@ pfxlist_onlink_check() * that does not advertise any prefixes. */ if (pr == NULL) { + ND6_RLOCK(); TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { struct nd_prefix *pr0; @@ -1356,6 +1470,7 @@ pfxlist_onlink_check() if (pfxrtr != NULL) break; } + ND6_RUNLOCK(); } if (pr != NULL || (!TAILQ_EMPTY(&V_nd_defrouter) && pfxrtr == NULL)) { /* From owner-svn-src-stable@freebsd.org Thu Jul 28 20:11:35 2016 Return-Path: Delivered-To: svn-src-stable@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 4B6CCBA74EA; Thu, 28 Jul 2016 20:11:35 +0000 (UTC) (envelope-from sbruno@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 1C0DD1170; Thu, 28 Jul 2016 20:11:35 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SKBYP1013547; Thu, 28 Jul 2016 20:11:34 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SKBY05013546; Thu, 28 Jul 2016 20:11:34 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201607282011.u6SKBY05013546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 28 Jul 2016 20:11: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: r303459 - 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2016 20:11:35 -0000 Author: sbruno Date: Thu Jul 28 20:11:34 2016 New Revision: 303459 URL: https://svnweb.freebsd.org/changeset/base/303459 Log: MFC r299829 Use Node Information flag names instead of hard-coding their values. Modified: stable/10/sys/netinet6/icmp6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/icmp6.c ============================================================================== --- stable/10/sys/netinet6/icmp6.c Thu Jul 28 20:08:01 2016 (r303458) +++ stable/10/sys/netinet6/icmp6.c Thu Jul 28 20:11:34 2016 (r303459) @@ -679,7 +679,9 @@ icmp6_input(struct mbuf **mp, int *offp, * XXX: this combination of flags is pointless, * but should we keep this for compatibility? */ - if ((V_icmp6_nodeinfo & 5) != 5) + if ((V_icmp6_nodeinfo & (ICMP6_NODEINFO_FQDNOK | + ICMP6_NODEINFO_TMPADDROK)) != + (ICMP6_NODEINFO_FQDNOK | ICMP6_NODEINFO_TMPADDROK)) break; if (code != 0) From owner-svn-src-stable@freebsd.org Thu Jul 28 20:31:32 2016 Return-Path: Delivered-To: svn-src-stable@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 CE2ADBA7800; Thu, 28 Jul 2016 20:31:32 +0000 (UTC) (envelope-from jhb@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 838DC18D1; Thu, 28 Jul 2016 20:31:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SKVVer021428; Thu, 28 Jul 2016 20:31:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SKVVZK020781; Thu, 28 Jul 2016 20:31:31 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607282031.u6SKVVZK020781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 28 Jul 2016 20:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303460 - in stable/11: lib/libc/sys share/man/man4 sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2016 20:31:32 -0000 Author: jhb Date: Thu Jul 28 20:31:30 2016 New Revision: 303460 URL: https://svnweb.freebsd.org/changeset/base/303460 Log: MFC 303164: Add more documentation regarding unsafe AIO requests. The asynchronous I/O changes made previously result in different behavior out of the box. Previously all AIO requests failed with ENOSYS / SIGSYS unless aio.ko was explicitly loaded. Now, some AIO requests complete and others ("unsafe" requests) fail with EOPNOTSUPP. Reword the introductory paragraph in aio(4) to add a general description of AIO before describing the vfs.aio.enable_unsafe sysctl. Remove the ENOSYS error description from aio_fsync(2), aio_read(2), and aio_write(2) and replace it with a description of EOPNOTSUPP. Remove the ENOSYS error description from aio_mlock(2). Log a message to the system log the first time a process requests an "unsafe" AIO request that fails with EOPNOTSUPP. This is modeled on the log message used for processes using the legacy pty devices. Approved by: re (gjb) Modified: stable/11/lib/libc/sys/aio_fsync.2 stable/11/lib/libc/sys/aio_mlock.2 stable/11/lib/libc/sys/aio_read.2 stable/11/lib/libc/sys/aio_write.2 stable/11/share/man/man4/aio.4 stable/11/sys/kern/vfs_aio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/aio_fsync.2 ============================================================================== --- stable/11/lib/libc/sys/aio_fsync.2 Thu Jul 28 20:11:34 2016 (r303459) +++ stable/11/lib/libc/sys/aio_fsync.2 Thu Jul 28 20:31:30 2016 (r303460) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2016 +.Dd July 21, 2016 .Dt AIO_FSYNC 2 .Os .Sh NAME @@ -107,10 +107,10 @@ The request was not queued because of sy The asynchronous notification method in .Fa iocb->aio_sigevent.sigev_notify is invalid or not supported. -.It Bq Er ENOSYS -The -.Fn aio_fsync -system call is not supported. +.It Bq Er EOPNOTSUPP +Asynchronous file synchronization operations on the file descriptor +.Fa iocb->aio_fildes +are unsafe and unsafe asynchronous I/O operations are disabled. .It Bq Er EINVAL A value of the .Fa op Modified: stable/11/lib/libc/sys/aio_mlock.2 ============================================================================== --- stable/11/lib/libc/sys/aio_mlock.2 Thu Jul 28 20:11:34 2016 (r303459) +++ stable/11/lib/libc/sys/aio_mlock.2 Thu Jul 28 20:31:30 2016 (r303460) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2016 +.Dd July 21, 2016 .Dt AIO_MLOCK 2 .Os .Sh NAME @@ -102,10 +102,6 @@ The request was not queued because of sy The asynchronous notification method in .Fa iocb->aio_sigevent.sigev_notify is invalid or not supported. -.It Bq Er ENOSYS -The -.Fn aio_mlock -system call is not supported. .El .Pp If the request is successfully enqueued, but subsequently cancelled Modified: stable/11/lib/libc/sys/aio_read.2 ============================================================================== --- stable/11/lib/libc/sys/aio_read.2 Thu Jul 28 20:11:34 2016 (r303459) +++ stable/11/lib/libc/sys/aio_read.2 Thu Jul 28 20:31:30 2016 (r303460) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2016 +.Dd July 21, 2016 .Dt AIO_READ 2 .Os .Sh NAME @@ -125,10 +125,10 @@ The request was not queued because of sy The asynchronous notification method in .Fa iocb->aio_sigevent.sigev_notify is invalid or not supported. -.It Bq Er ENOSYS -The -.Fn aio_read -system call is not supported. +.It Bq Er EOPNOTSUPP +Asynchronous read operations on the file descriptor +.Fa iocb->aio_fildes +are unsafe and unsafe asynchronous I/O operations are disabled. .El .Pp The following conditions may be synchronously detected when the Modified: stable/11/lib/libc/sys/aio_write.2 ============================================================================== --- stable/11/lib/libc/sys/aio_write.2 Thu Jul 28 20:11:34 2016 (r303459) +++ stable/11/lib/libc/sys/aio_write.2 Thu Jul 28 20:31:30 2016 (r303460) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2016 +.Dd July 21, 2016 .Dt AIO_WRITE 2 .Os .Sh NAME @@ -129,10 +129,10 @@ The request was not queued because of sy The asynchronous notification method in .Fa iocb->aio_sigevent.sigev_notify is invalid or not supported. -.It Bq Er ENOSYS -The -.Fn aio_write -system call is not supported. +.It Bq Er EOPNOTSUPP +Asynchronous write operations on the file descriptor +.Fa iocb->aio_fildes +are unsafe and unsafe asynchronous I/O operations are disabled. .El .Pp The following conditions may be synchronously detected when the Modified: stable/11/share/man/man4/aio.4 ============================================================================== --- stable/11/share/man/man4/aio.4 Thu Jul 28 20:11:34 2016 (r303459) +++ stable/11/share/man/man4/aio.4 Thu Jul 28 20:31:30 2016 (r303460) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2016 +.Dd July 21, 2016 .Dt AIO 4 .Os .Sh NAME @@ -37,17 +37,25 @@ The .Nm facility provides system calls for asynchronous I/O. -However, asynchronous I/O operations are only enabled for certain file -types by default. -Asynchronous I/O operations for other file types may block an AIO daemon -indefinitely resulting in process and/or system hangs. -Asynchronous I/O operations can be enabled for all file types by setting +Asynchronous I/O operations are not completed synchronously by the +calling thread. +Instead, the calling thread invokes one system call to request an +asynchronous I/O operation. +The status of a completed request is retrieved later via a separate +system call. +.Pp +Asynchronous I/O operations on some file descriptor types may block an +AIO daemon indefinitely resulting in process and/or system hangs. +Operations on these file descriptor types are considered +.Dq unsafe +and disabled by default. +They can be enabled by setting the .Va vfs.aio.enable_unsafe sysctl node to a non-zero value. .Pp Asynchronous I/O operations on sockets and raw disk devices do not block -indefinitely and are enabled by default. +indefinitely and are always enabled. .Pp The .Nm Modified: stable/11/sys/kern/vfs_aio.c ============================================================================== --- stable/11/sys/kern/vfs_aio.c Thu Jul 28 20:11:34 2016 (r303459) +++ stable/11/sys/kern/vfs_aio.c Thu Jul 28 20:31:30 2016 (r303460) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -110,6 +111,11 @@ static int enable_aio_unsafe = 0; SYSCTL_INT(_vfs_aio, OID_AUTO, enable_unsafe, CTLFLAG_RW, &enable_aio_unsafe, 0, "Permit asynchronous IO on all file types, not just known-safe types"); +static unsigned int unsafe_warningcnt = 1; +SYSCTL_UINT(_vfs_aio, OID_AUTO, unsafe_warningcnt, CTLFLAG_RW, + &unsafe_warningcnt, 0, + "Warnings that will be triggered upon failed IO requests on unsafe files"); + static int max_aio_procs = MAX_AIO_PROCS; SYSCTL_INT(_vfs_aio, OID_AUTO, max_aio_procs, CTLFLAG_RW, &max_aio_procs, 0, "Maximum number of kernel processes to use for handling async IO "); @@ -1697,8 +1703,11 @@ queueit: safe = true; } } - if (!(safe || enable_aio_unsafe)) + if (!(safe || enable_aio_unsafe)) { + counted_warning(&unsafe_warningcnt, + "is attempting to use unsafe AIO requests"); return (EOPNOTSUPP); + } if (opcode == LIO_SYNC) { AIO_LOCK(ki); From owner-svn-src-stable@freebsd.org Thu Jul 28 21:16:20 2016 Return-Path: Delivered-To: svn-src-stable@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 05030BA719A; Thu, 28 Jul 2016 21:16:20 +0000 (UTC) (envelope-from jhb@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 C57F211BF; Thu, 28 Jul 2016 21:16:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6SLGIwR038467; Thu, 28 Jul 2016 21:16:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6SLGIR3038466; Thu, 28 Jul 2016 21:16:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201607282116.u6SLGIR3038466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 28 Jul 2016 21:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303462 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2016 21:16:20 -0000 Author: jhb Date: Thu Jul 28 21:16:18 2016 New Revision: 303462 URL: https://svnweb.freebsd.org/changeset/base/303462 Log: MFC 303202: Update to note that operations on local files are safe. Approved by: re (gjb) Modified: stable/11/share/man/man4/aio.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/aio.4 ============================================================================== --- stable/11/share/man/man4/aio.4 Thu Jul 28 20:51:29 2016 (r303461) +++ stable/11/share/man/man4/aio.4 Thu Jul 28 21:16:18 2016 (r303462) @@ -54,7 +54,9 @@ the .Va vfs.aio.enable_unsafe sysctl node to a non-zero value. .Pp -Asynchronous I/O operations on sockets and raw disk devices do not block +Asynchronous I/O operations on sockets, +raw disk devices, +and regular files on local filesystems do not block indefinitely and are always enabled. .Pp The From owner-svn-src-stable@freebsd.org Fri Jul 29 00:00:55 2016 Return-Path: Delivered-To: svn-src-stable@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 96B6FBA7294; Fri, 29 Jul 2016 00:00:55 +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 5F2F61452; Fri, 29 Jul 2016 00:00:55 +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 u6T00sW9099327; Fri, 29 Jul 2016 00:00:54 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6T00sv9099326; Fri, 29 Jul 2016 00:00:54 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201607290000.u6T00sv9099326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 29 Jul 2016 00:00:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303469 - stable/11/sys/conf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2016 00:00:55 -0000 Author: gjb Date: Fri Jul 29 00:00:54 2016 New Revision: 303469 URL: https://svnweb.freebsd.org/changeset/base/303469 Log: Update stable/11 to BETA3 as part of the 11.0-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/conf/newvers.sh Modified: stable/11/sys/conf/newvers.sh ============================================================================== --- stable/11/sys/conf/newvers.sh Thu Jul 28 22:55:21 2016 (r303468) +++ stable/11/sys/conf/newvers.sh Fri Jul 29 00:00:54 2016 (r303469) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="11.0" -BRANCH="BETA2" +BRANCH="BETA3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-stable@freebsd.org Sat Jul 30 09:28:15 2016 Return-Path: Delivered-To: svn-src-stable@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 02FD3BA9A51; Sat, 30 Jul 2016 09:28:15 +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 CF1D0186D; Sat, 30 Jul 2016 09:28:14 +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 u6U9SDqG046591; Sat, 30 Jul 2016 09:28:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U9SDgc046587; Sat, 30 Jul 2016 09:28:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607300928.u6U9SDgc046587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 30 Jul 2016 09:28:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303549 - in stable/11: share/man/man9 sys/kern sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2016 09:28:15 -0000 Author: kib Date: Sat Jul 30 09:28:13 2016 New Revision: 303549 URL: https://svnweb.freebsd.org/changeset/base/303549 Log: MFC r303211: Implement mtx_trylock_spin(9). Approved by: re (gjb) Modified: stable/11/share/man/man9/Makefile stable/11/share/man/man9/mutex.9 stable/11/sys/kern/kern_mutex.c stable/11/sys/sys/mutex.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/Makefile ============================================================================== --- stable/11/share/man/man9/Makefile Sat Jul 30 09:25:57 2016 (r303548) +++ stable/11/share/man/man9/Makefile Sat Jul 30 09:28:13 2016 (r303549) @@ -1181,6 +1181,8 @@ MLINKS+=mutex.9 mtx_assert.9 \ mutex.9 MTX_SYSINIT.9 \ mutex.9 mtx_trylock.9 \ mutex.9 mtx_trylock_flags.9 \ + mutex.9 mtx_trylock_spin.9 \ + mutex.9 mtx_trylock_spin_flags.9 \ mutex.9 mtx_unlock.9 \ mutex.9 mtx_unlock_flags.9 \ mutex.9 mtx_unlock_spin.9 \ Modified: stable/11/share/man/man9/mutex.9 ============================================================================== --- stable/11/share/man/man9/mutex.9 Sat Jul 30 09:25:57 2016 (r303548) +++ stable/11/share/man/man9/mutex.9 Sat Jul 30 09:28:13 2016 (r303549) @@ -28,7 +28,7 @@ .\" from BSDI $Id: mutex.4,v 1.1.2.3 1998/04/27 22:53:13 ewv Exp $ .\" $FreeBSD$ .\" -.Dd December 13, 2014 +.Dd July 18, 2016 .Dt MUTEX 9 .Os .Sh NAME @@ -41,6 +41,8 @@ .Nm mtx_lock_spin_flags , .Nm mtx_trylock , .Nm mtx_trylock_flags , +.Nm mtx_trylock_spin , +.Nm mtx_trylock_spin_flags , .Nm mtx_unlock , .Nm mtx_unlock_spin , .Nm mtx_unlock_flags , @@ -73,6 +75,10 @@ .Ft int .Fn mtx_trylock_flags "struct mtx *mutex" "int flags" .Ft void +.Fn mtx_trylock_spin "struct mtx *mutex" +.Ft int +.Fn mtx_trylock_spin_flags "struct mtx *mutex" "int flags" +.Ft void .Fn mtx_unlock "struct mtx *mutex" .Ft void .Fn mtx_unlock_spin "struct mtx *mutex" @@ -249,26 +255,33 @@ argument, then the mutex can be acquired .Pp The .Fn mtx_trylock -attempts to acquire the +and +.Fn mtx_trylock_spin +functions attempt to acquire a .Dv MTX_DEF -mutex pointed to by +or +.Dv MTX_SPIN +mutex, respectively, pointed to by .Fa mutex . -If the mutex cannot be immediately acquired -.Fn mtx_trylock -will return 0, -otherwise the mutex will be acquired -and a non-zero value will be returned. +If the mutex cannot be immediately acquired, the functions will return 0, +otherwise the mutex will be acquired and a non-zero value will be returned. .Pp The .Fn mtx_trylock_flags -function has the same behavior as +and +.Fn mtx_trylock_spin_flags +functions have the same behavior as .Fn mtx_trylock -but should be used when the caller desires to pass in a +and +.Fn mtx_trylock_spin +respectively, but should be used when the caller desires to pass in a .Fa flags value. Presently, the only valid value in the .Fn mtx_trylock -case is +and +.Fn mtx_trylock_spin +cases is .Dv MTX_QUIET , and its effects are identical to those described for .Fn mtx_lock @@ -447,6 +460,13 @@ while any spin lock is held. .It Dv MTX_RECURSE Specifies that the initialized mutex is allowed to recurse. This bit must be present if the mutex is permitted to recurse. +.Pp +Note that neither +.Fn mtx_trylock +nor +.Fn mtx_trylock_spin +support recursion; +that is, attempting to acquire an already-owned mutex fails. .It Dv MTX_QUIET Do not log any mutex operations for this lock. .It Dv MTX_NOWITNESS @@ -534,3 +554,7 @@ functions appeared in .Bsx 4.1 and .Fx 5.0 . +The +.Fn mtx_trylock_spin +function was added in +.Fx 12.0 . Modified: stable/11/sys/kern/kern_mutex.c ============================================================================== --- stable/11/sys/kern/kern_mutex.c Sat Jul 30 09:25:57 2016 (r303548) +++ stable/11/sys/kern/kern_mutex.c Sat Jul 30 09:28:13 2016 (r303549) @@ -281,6 +281,34 @@ __mtx_lock_spin_flags(volatile uintptr_t WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line); } +int +__mtx_trylock_spin_flags(volatile uintptr_t *c, int opts, const char *file, + int line) +{ + struct mtx *m; + + if (SCHEDULER_STOPPED()) + return (1); + + m = mtxlock2mtx(c); + + KASSERT(m->mtx_lock != MTX_DESTROYED, + ("mtx_trylock_spin() of destroyed mutex @ %s:%d", file, line)); + KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin, + ("mtx_trylock_spin() of sleep mutex %s @ %s:%d", + m->lock_object.lo_name, file, line)); + KASSERT((opts & MTX_RECURSE) == 0, + ("mtx_trylock_spin: unsupp. opt MTX_RECURSE on mutex %s @ %s:%d\n", + m->lock_object.lo_name, file, line)); + if (__mtx_trylock_spin(m, curthread, opts, file, line)) { + LOCK_LOG_TRY("LOCK", &m->lock_object, opts, 1, file, line); + WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line); + return (1); + } + LOCK_LOG_TRY("LOCK", &m->lock_object, opts, 0, file, line); + return (0); +} + void __mtx_unlock_spin_flags(volatile uintptr_t *c, int opts, const char *file, int line) Modified: stable/11/sys/sys/mutex.h ============================================================================== --- stable/11/sys/sys/mutex.h Sat Jul 30 09:25:57 2016 (r303548) +++ stable/11/sys/sys/mutex.h Sat Jul 30 09:28:13 2016 (r303549) @@ -112,6 +112,8 @@ void __mtx_unlock_flags(volatile uintptr int line); void __mtx_lock_spin_flags(volatile uintptr_t *c, int opts, const char *file, int line); +int __mtx_trylock_spin_flags(volatile uintptr_t *c, int opts, + const char *file, int line); void __mtx_unlock_spin_flags(volatile uintptr_t *c, int opts, const char *file, int line); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) @@ -152,6 +154,8 @@ void thread_lock_flags_(struct thread *, __mtx_unlock_flags(&(m)->mtx_lock, o, f, l) #define _mtx_lock_spin_flags(m, o, f, l) \ __mtx_lock_spin_flags(&(m)->mtx_lock, o, f, l) +#define _mtx_trylock_spin_flags(m, o, f, l) \ + __mtx_trylock_spin_flags(&(m)->mtx_lock, o, f, l) #define _mtx_unlock_spin_flags(m, o, f, l) \ __mtx_unlock_spin_flags(&(m)->mtx_lock, o, f, l) #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) @@ -212,6 +216,21 @@ void thread_lock_flags_(struct thread *, LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, \ mp, 0, 0, file, line); \ } while (0) +#define __mtx_trylock_spin(mp, tid, opts, file, line) __extension__ ({ \ + uintptr_t _tid = (uintptr_t)(tid); \ + int _ret; \ + \ + spinlock_enter(); \ + if (((mp)->mtx_lock != MTX_UNOWNED || !_mtx_obtain_lock((mp), _tid))) {\ + spinlock_exit(); \ + _ret = 0; \ + } else { \ + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, \ + mp, 0, 0, file, line); \ + _ret = 1; \ + } \ + _ret; \ +}) #else /* SMP */ #define __mtx_lock_spin(mp, tid, opts, file, line) do { \ uintptr_t _tid = (uintptr_t)(tid); \ @@ -224,6 +243,20 @@ void thread_lock_flags_(struct thread *, (mp)->mtx_lock = _tid; \ } \ } while (0) +#define __mtx_trylock_spin(mp, tid, opts, file, line) __extension__ ({ \ + uintptr_t _tid = (uintptr_t)(tid); \ + int _ret; \ + \ + spinlock_enter(); \ + if ((mp)->mtx_lock != MTX_UNOWNED) { \ + spinlock_exit(); \ + _ret = 0; \ + } else { \ + (mp)->mtx_lock = _tid; \ + _ret = 1; \ + } \ + _ret; \ +}) #endif /* SMP */ /* Unlock a normal mutex. */ @@ -293,6 +326,10 @@ void thread_lock_flags_(struct thread *, * mtx_trylock_flags(m, opts) is used the same way as mtx_trylock() but accepts * relevant option flags `opts.' * + * mtx_trylock_spin(m) attempts to acquire MTX_SPIN mutex `m' but doesn't + * spin if it cannot. Rather, it returns 0 on failure and non-zero on + * success. It always returns failure for recursed lock attempts. + * * mtx_initialized(m) returns non-zero if the lock `m' has been initialized. * * mtx_owned(m) returns non-zero if the current thread owns the lock `m' @@ -302,6 +339,7 @@ void thread_lock_flags_(struct thread *, #define mtx_lock(m) mtx_lock_flags((m), 0) #define mtx_lock_spin(m) mtx_lock_spin_flags((m), 0) #define mtx_trylock(m) mtx_trylock_flags((m), 0) +#define mtx_trylock_spin(m) mtx_trylock_spin_flags((m), 0) #define mtx_unlock(m) mtx_unlock_flags((m), 0) #define mtx_unlock_spin(m) mtx_unlock_spin_flags((m), 0) @@ -335,6 +373,8 @@ extern struct mtx_pool *mtxpool_sleep; _mtx_unlock_flags((m), (opts), (file), (line)) #define mtx_lock_spin_flags_(m, opts, file, line) \ _mtx_lock_spin_flags((m), (opts), (file), (line)) +#define mtx_trylock_spin_flags_(m, opts, file, line) \ + _mtx_trylock_spin_flags((m), (opts), (file), (line)) #define mtx_unlock_spin_flags_(m, opts, file, line) \ _mtx_unlock_spin_flags((m), (opts), (file), (line)) #else /* LOCK_DEBUG == 0 && !MUTEX_NOINLINE */ @@ -344,6 +384,8 @@ extern struct mtx_pool *mtxpool_sleep; __mtx_unlock((m), curthread, (opts), (file), (line)) #define mtx_lock_spin_flags_(m, opts, file, line) \ __mtx_lock_spin((m), curthread, (opts), (file), (line)) +#define mtx_trylock_spin_flags_(m, opts, file, line) \ + __mtx_trylock_spin((m), curthread, (opts), (file), (line)) #define mtx_unlock_spin_flags_(m, opts, file, line) \ __mtx_unlock_spin((m)) #endif /* LOCK_DEBUG > 0 || MUTEX_NOINLINE */ @@ -369,6 +411,8 @@ extern struct mtx_pool *mtxpool_sleep; mtx_unlock_spin_flags_((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_trylock_flags(m, opts) \ mtx_trylock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) +#define mtx_trylock_spin_flags(m, opts) \ + mtx_trylock_spin_flags_((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_assert(m, what) \ mtx_assert_((m), (what), __FILE__, __LINE__) From owner-svn-src-stable@freebsd.org Sat Jul 30 09:46:30 2016 Return-Path: Delivered-To: svn-src-stable@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 B8D3DBA9EA9; Sat, 30 Jul 2016 09:46:30 +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 88F311435; Sat, 30 Jul 2016 09:46:30 +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 u6U9kTMf054139; Sat, 30 Jul 2016 09:46:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6U9kTQI054138; Sat, 30 Jul 2016 09:46:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607300946.u6U9kTQI054138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 30 Jul 2016 09:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303550 - stable/11/bin/ps X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2016 09:46:30 -0000 Author: kib Date: Sat Jul 30 09:46:29 2016 New Revision: 303550 URL: https://svnweb.freebsd.org/changeset/base/303550 Log: MFC r303213: Add missed required call to xo_finish() when only header is printed. Approved by: re (gjb) Modified: stable/11/bin/ps/ps.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ps/ps.c ============================================================================== --- stable/11/bin/ps/ps.c Sat Jul 30 09:28:13 2016 (r303549) +++ stable/11/bin/ps/ps.c Sat Jul 30 09:46:29 2016 (r303550) @@ -612,6 +612,7 @@ main(int argc, char *argv[]) if (nkept == 0) { printheader(); + xo_finish(); exit(1); } From owner-svn-src-stable@freebsd.org Sat Jul 30 14:47:06 2016 Return-Path: Delivered-To: svn-src-stable@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 5F57BBA8B88; Sat, 30 Jul 2016 14:47:06 +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 3D1E011DE; Sat, 30 Jul 2016 14:47:06 +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 u6UEl5il066593; Sat, 30 Jul 2016 14:47:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6UEl5fM066588; Sat, 30 Jul 2016 14:47:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201607301447.u6UEl5fM066588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 30 Jul 2016 14:47: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: r303552 - in stable/10: share/man/man9 sys/kern 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@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2016 14:47:06 -0000 Author: kib Date: Sat Jul 30 14:47:04 2016 New Revision: 303552 URL: https://svnweb.freebsd.org/changeset/base/303552 Log: MFC r303211: Implement mtx_trylock_spin(9). Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/mutex.9 stable/10/sys/kern/kern_mutex.c stable/10/sys/sys/mutex.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Sat Jul 30 10:32:28 2016 (r303551) +++ stable/10/share/man/man9/Makefile Sat Jul 30 14:47:04 2016 (r303552) @@ -994,6 +994,8 @@ MLINKS+=mutex.9 mtx_assert.9 \ mutex.9 MTX_SYSINIT.9 \ mutex.9 mtx_trylock.9 \ mutex.9 mtx_trylock_flags.9 \ + mutex.9 mtx_trylock_spin.9 \ + mutex.9 mtx_trylock_spin_flags.9 \ mutex.9 mtx_unlock.9 \ mutex.9 mtx_unlock_flags.9 \ mutex.9 mtx_unlock_spin.9 \ Modified: stable/10/share/man/man9/mutex.9 ============================================================================== --- stable/10/share/man/man9/mutex.9 Sat Jul 30 10:32:28 2016 (r303551) +++ stable/10/share/man/man9/mutex.9 Sat Jul 30 14:47:04 2016 (r303552) @@ -28,7 +28,7 @@ .\" from BSDI $Id: mutex.4,v 1.1.2.3 1998/04/27 22:53:13 ewv Exp $ .\" $FreeBSD$ .\" -.Dd November 16, 2011 +.Dd July 18, 2016 .Dt MUTEX 9 .Os .Sh NAME @@ -41,6 +41,8 @@ .Nm mtx_lock_spin_flags , .Nm mtx_trylock , .Nm mtx_trylock_flags , +.Nm mtx_trylock_spin , +.Nm mtx_trylock_spin_flags , .Nm mtx_unlock , .Nm mtx_unlock_spin , .Nm mtx_unlock_flags , @@ -73,6 +75,10 @@ .Ft int .Fn mtx_trylock_flags "struct mtx *mutex" "int flags" .Ft void +.Fn mtx_trylock_spin "struct mtx *mutex" +.Ft int +.Fn mtx_trylock_spin_flags "struct mtx *mutex" "int flags" +.Ft void .Fn mtx_unlock "struct mtx *mutex" .Ft void .Fn mtx_unlock_spin "struct mtx *mutex" @@ -245,26 +251,33 @@ argument, then the mutex can be acquired .Pp The .Fn mtx_trylock -attempts to acquire the +and +.Fn mtx_trylock_spin +functions attempt to acquire a .Dv MTX_DEF -mutex pointed to by +or +.Dv MTX_SPIN +mutex, respectively, pointed to by .Fa mutex . -If the mutex cannot be immediately acquired -.Fn mtx_trylock -will return 0, -otherwise the mutex will be acquired -and a non-zero value will be returned. +If the mutex cannot be immediately acquired, the functions will return 0, +otherwise the mutex will be acquired and a non-zero value will be returned. .Pp The .Fn mtx_trylock_flags -function has the same behavior as +and +.Fn mtx_trylock_spin_flags +functions have the same behavior as .Fn mtx_trylock -but should be used when the caller desires to pass in a +and +.Fn mtx_trylock_spin +respectively, but should be used when the caller desires to pass in a .Fa flags value. Presently, the only valid value in the .Fn mtx_trylock -case is +and +.Fn mtx_trylock_spin +cases is .Dv MTX_QUIET , and its effects are identical to those described for .Fn mtx_lock @@ -443,6 +456,13 @@ while any spin lock is held. .It Dv MTX_RECURSE Specifies that the initialized mutex is allowed to recurse. This bit must be present if the mutex is permitted to recurse. +.Pp +Note that neither +.Fn mtx_trylock +nor +.Fn mtx_trylock_spin +support recursion; +that is, attempting to acquire an already-owned mutex fails. .It Dv MTX_QUIET Do not log any mutex operations for this lock. .It Dv MTX_NOWITNESS @@ -528,3 +548,7 @@ functions appeared in .Bsx 4.1 and .Fx 5.0 . +The +.Fn mtx_trylock_spin +function was added in +.Fx 12.0 . Modified: stable/10/sys/kern/kern_mutex.c ============================================================================== --- stable/10/sys/kern/kern_mutex.c Sat Jul 30 10:32:28 2016 (r303551) +++ stable/10/sys/kern/kern_mutex.c Sat Jul 30 14:47:04 2016 (r303552) @@ -285,6 +285,34 @@ __mtx_lock_spin_flags(volatile uintptr_t WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line); } +int +__mtx_trylock_spin_flags(volatile uintptr_t *c, int opts, const char *file, + int line) +{ + struct mtx *m; + + if (SCHEDULER_STOPPED()) + return (1); + + m = mtxlock2mtx(c); + + KASSERT(m->mtx_lock != MTX_DESTROYED, + ("mtx_trylock_spin() of destroyed mutex @ %s:%d", file, line)); + KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin, + ("mtx_trylock_spin() of sleep mutex %s @ %s:%d", + m->lock_object.lo_name, file, line)); + KASSERT((opts & MTX_RECURSE) == 0, + ("mtx_trylock_spin: unsupp. opt MTX_RECURSE on mutex %s @ %s:%d\n", + m->lock_object.lo_name, file, line)); + if (__mtx_trylock_spin(m, curthread, opts, file, line)) { + LOCK_LOG_TRY("LOCK", &m->lock_object, opts, 1, file, line); + WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line); + return (1); + } + LOCK_LOG_TRY("LOCK", &m->lock_object, opts, 0, file, line); + return (0); +} + void __mtx_unlock_spin_flags(volatile uintptr_t *c, int opts, const char *file, int line) Modified: stable/10/sys/sys/mutex.h ============================================================================== --- stable/10/sys/sys/mutex.h Sat Jul 30 10:32:28 2016 (r303551) +++ stable/10/sys/sys/mutex.h Sat Jul 30 14:47:04 2016 (r303552) @@ -111,6 +111,8 @@ void __mtx_unlock_flags(volatile uintptr int line); void __mtx_lock_spin_flags(volatile uintptr_t *c, int opts, const char *file, int line); +int __mtx_trylock_spin_flags(volatile uintptr_t *c, int opts, + const char *file, int line); void __mtx_unlock_spin_flags(volatile uintptr_t *c, int opts, const char *file, int line); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) @@ -151,6 +153,8 @@ void thread_lock_flags_(struct thread *, __mtx_unlock_flags(&(m)->mtx_lock, o, f, l) #define _mtx_lock_spin_flags(m, o, f, l) \ __mtx_lock_spin_flags(&(m)->mtx_lock, o, f, l) +#define _mtx_trylock_spin_flags(m, o, f, l) \ + __mtx_trylock_spin_flags(&(m)->mtx_lock, o, f, l) #define _mtx_unlock_spin_flags(m, o, f, l) \ __mtx_unlock_spin_flags(&(m)->mtx_lock, o, f, l) #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) @@ -211,6 +215,21 @@ void thread_lock_flags_(struct thread *, LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_SPIN_LOCK_ACQUIRE, \ mp, 0, 0, (file), (line)); \ } while (0) +#define __mtx_trylock_spin(mp, tid, opts, file, line) __extension__ ({ \ + uintptr_t _tid = (uintptr_t)(tid); \ + int _ret; \ + \ + spinlock_enter(); \ + if (((mp)->mtx_lock != MTX_UNOWNED || !_mtx_obtain_lock((mp), _tid))) {\ + spinlock_exit(); \ + _ret = 0; \ + } else { \ + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_SPIN_LOCK_ACQUIRE, \ + mp, 0, 0, file, line); \ + _ret = 1; \ + } \ + _ret; \ +}) #else /* SMP */ #define __mtx_lock_spin(mp, tid, opts, file, line) do { \ uintptr_t _tid = (uintptr_t)(tid); \ @@ -223,6 +242,20 @@ void thread_lock_flags_(struct thread *, (mp)->mtx_lock = _tid; \ } \ } while (0) +#define __mtx_trylock_spin(mp, tid, opts, file, line) __extension__ ({ \ + uintptr_t _tid = (uintptr_t)(tid); \ + int _ret; \ + \ + spinlock_enter(); \ + if ((mp)->mtx_lock != MTX_UNOWNED) { \ + spinlock_exit(); \ + _ret = 0; \ + } else { \ + (mp)->mtx_lock = _tid; \ + _ret = 1; \ + } \ + _ret; \ +}) #endif /* SMP */ /* Unlock a normal mutex. */ @@ -292,6 +325,10 @@ void thread_lock_flags_(struct thread *, * mtx_trylock_flags(m, opts) is used the same way as mtx_trylock() but accepts * relevant option flags `opts.' * + * mtx_trylock_spin(m) attempts to acquire MTX_SPIN mutex `m' but doesn't + * spin if it cannot. Rather, it returns 0 on failure and non-zero on + * success. It always returns failure for recursed lock attempts. + * * mtx_initialized(m) returns non-zero if the lock `m' has been initialized. * * mtx_owned(m) returns non-zero if the current thread owns the lock `m' @@ -301,6 +338,7 @@ void thread_lock_flags_(struct thread *, #define mtx_lock(m) mtx_lock_flags((m), 0) #define mtx_lock_spin(m) mtx_lock_spin_flags((m), 0) #define mtx_trylock(m) mtx_trylock_flags((m), 0) +#define mtx_trylock_spin(m) mtx_trylock_spin_flags((m), 0) #define mtx_unlock(m) mtx_unlock_flags((m), 0) #define mtx_unlock_spin(m) mtx_unlock_spin_flags((m), 0) @@ -338,6 +376,8 @@ extern struct mtx_pool *mtxpool_sleep; _mtx_unlock_flags((m), (opts), (file), (line)) #define mtx_lock_spin_flags_(m, opts, file, line) \ _mtx_lock_spin_flags((m), (opts), (file), (line)) +#define mtx_trylock_spin_flags_(m, opts, file, line) \ + _mtx_trylock_spin_flags((m), (opts), (file), (line)) #define mtx_unlock_spin_flags_(m, opts, file, line) \ _mtx_unlock_spin_flags((m), (opts), (file), (line)) #else /* LOCK_DEBUG == 0 && !MUTEX_NOINLINE */ @@ -347,6 +387,8 @@ extern struct mtx_pool *mtxpool_sleep; __mtx_unlock((m), curthread, (opts), (file), (line)) #define mtx_lock_spin_flags_(m, opts, file, line) \ __mtx_lock_spin((m), curthread, (opts), (file), (line)) +#define mtx_trylock_spin_flags_(m, opts, file, line) \ + __mtx_trylock_spin((m), curthread, (opts), (file), (line)) #define mtx_unlock_spin_flags_(m, opts, file, line) \ __mtx_unlock_spin((m)) #endif /* LOCK_DEBUG > 0 || MUTEX_NOINLINE */ @@ -372,6 +414,8 @@ extern struct mtx_pool *mtxpool_sleep; mtx_unlock_spin_flags_((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_trylock_flags(m, opts) \ mtx_trylock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) +#define mtx_trylock_spin_flags(m, opts) \ + mtx_trylock_spin_flags_((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_assert(m, what) \ mtx_assert_((m), (what), __FILE__, __LINE__) From owner-svn-src-stable@freebsd.org Sat Jul 30 20:02:10 2016 Return-Path: Delivered-To: svn-src-stable@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 32BF8BA83FB; Sat, 30 Jul 2016 20:02:10 +0000 (UTC) (envelope-from cperciva@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 0168F1D86; Sat, 30 Jul 2016 20:02:09 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6UK29vN085293; Sat, 30 Jul 2016 20:02:09 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6UK29J6085292; Sat, 30 Jul 2016 20:02:09 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201607302002.u6UK29J6085292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sat, 30 Jul 2016 20:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303558 - stable/11/release/tools X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2016 20:02:10 -0000 Author: cperciva Date: Sat Jul 30 20:02:08 2016 New Revision: 303558 URL: https://svnweb.freebsd.org/changeset/base/303558 Log: MFC r302929: Now that potentially buggy versions of Xen are automatically detected (see r302635, MFCed as r302895), there is no need to force msix interrupt migration off via loader.conf. Reverts: r302184 Approved by: re (gjb) Modified: stable/11/release/tools/ec2.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/release/tools/ec2.conf ============================================================================== --- stable/11/release/tools/ec2.conf Sat Jul 30 19:03:32 2016 (r303557) +++ stable/11/release/tools/ec2.conf Sat Jul 30 20:02:08 2016 (r303558) @@ -72,12 +72,6 @@ vm_extra_pre_umount() { # nodes, but apply the workaround just in case. echo 'hw.broken_txfifo="1"' >> ${DESTDIR}/boot/loader.conf - # Some EC2 instances run on a version of Xen which has a bug relating - # to the migration of MSI-X interrupts; this is visible as SR-IOV - # networking (aka. "EC2 Enhanced Networking") not being able to pass - # packets. Disable MSI-X interrupt migration to work around this bug. - echo 'machdep.disable_msix_migration="1"' >> ${DESTDIR}/boot/loader.conf - # The first time the AMI boots, the installed "first boot" scripts # should be allowed to run: # * ec2_configinit (download and process EC2 user-data)