From owner-svn-src-head@freebsd.org Sun Sep 1 00:33:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4536FE410B; Sun, 1 Sep 2019 00:33:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46LZ2516Mpz4SWd; Sun, 1 Sep 2019 00:33:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A6AF212CF; Sun, 1 Sep 2019 00:33:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x810XGWr036905; Sun, 1 Sep 2019 00:33:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x810XGa9036904; Sun, 1 Sep 2019 00:33:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909010033.x810XGa9036904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 1 Sep 2019 00:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351650 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 351650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 00:33:17 -0000 Author: kevans Date: Sun Sep 1 00:33:16 2019 New Revision: 351650 URL: https://svnweb.freebsd.org/changeset/base/351650 Log: posixshm: switch to OBJT_SWAP in advance of other changes Future changes to posixshm will start tracking writeable mappings in order to support file sealing. Tracking writeable mappings for an OBJT_DEFAULT object is complicated as it may be swapped out and converted to an OBJT_SWAP. One may generically add this tracking for vm_object, but this is difficult to do without increasing memory footprint of vm_object and blowing up memory usage by a significant amount. On the other hand, the swap pager can be expanded to track writeable mappings without increasing vm_object size. This change is currently in D21456. Switch over to OBJT_SWAP in advance of the other changes to the swap pager and posixshm. Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Sat Aug 31 21:28:06 2019 (r351649) +++ head/sys/kern/uipc_shm.c Sun Sep 1 00:33:16 2019 (r351650) @@ -549,7 +549,7 @@ shm_alloc(struct ucred *ucred, mode_t mode) shmfd->shm_uid = ucred->cr_uid; shmfd->shm_gid = ucred->cr_gid; shmfd->shm_mode = mode; - shmfd->shm_object = vm_pager_allocate(OBJT_DEFAULT, NULL, + shmfd->shm_object = vm_pager_allocate(OBJT_SWAP, NULL, shmfd->shm_size, VM_PROT_DEFAULT, 0, ucred); KASSERT(shmfd->shm_object != NULL, ("shm_create: vm_pager_allocate")); shmfd->shm_object->pg_color = 0; From owner-svn-src-head@freebsd.org Sun Sep 1 02:52:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 589D1C8830; Sun, 1 Sep 2019 02:52:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Ld691k0Tz4Zk9; Sun, 1 Sep 2019 02:52:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E34222CD1; Sun, 1 Sep 2019 02:52:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x812q1vW020481; Sun, 1 Sep 2019 02:52:01 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x812q0WP020480; Sun, 1 Sep 2019 02:52:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909010252.x812q0WP020480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 1 Sep 2019 02:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351651 - head/sys/fs/nullfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/fs/nullfs X-SVN-Commit-Revision: 351651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 02:52:01 -0000 Author: mjg Date: Sun Sep 1 02:52:00 2019 New Revision: 351651 URL: https://svnweb.freebsd.org/changeset/base/351651 Log: nullfs: reduce areas protected by vnode interlock in null_lock Similarly to the other routine stop taking the interlock for the lower vnode. The interlock for nullfs vnode is still taken to ensure stability of ->v_data. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21480 Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Sun Sep 1 00:33:16 2019 (r351650) +++ head/sys/fs/nullfs/null_vnops.c Sun Sep 1 02:52:00 2019 (r351651) @@ -638,16 +638,16 @@ static int null_lock(struct vop_lock1_args *ap) { struct vnode *vp = ap->a_vp; - int flags = ap->a_flags; + int flags; struct null_node *nn; struct vnode *lvp; int error; - - if ((flags & LK_INTERLOCK) == 0) { + if ((ap->a_flags & LK_INTERLOCK) == 0) VI_LOCK(vp); - ap->a_flags = flags |= LK_INTERLOCK; - } + else + ap->a_flags &= ~LK_INTERLOCK; + flags = ap->a_flags; nn = VTONULL(vp); /* * If we're still active we must ask the lower layer to @@ -655,8 +655,6 @@ null_lock(struct vop_lock1_args *ap) * vop lock. */ if (nn != NULL && (lvp = NULLVPTOLOWERVP(vp)) != NULL) { - VI_LOCK_FLAGS(lvp, MTX_DUPOK); - VI_UNLOCK(vp); /* * We have to hold the vnode here to solve a potential * reclaim race. If we're forcibly vgone'd while we @@ -669,6 +667,7 @@ null_lock(struct vop_lock1_args *ap) * here. */ vholdnz(lvp); + VI_UNLOCK(vp); error = VOP_LOCK(lvp, flags); /* @@ -678,7 +677,7 @@ null_lock(struct vop_lock1_args *ap) * case by reacquiring correct lock in requested mode. */ if (VTONULL(vp) == NULL && error == 0) { - ap->a_flags &= ~(LK_TYPE_MASK | LK_INTERLOCK); + ap->a_flags &= ~LK_TYPE_MASK; switch (flags & LK_TYPE_MASK) { case LK_SHARED: ap->a_flags |= LK_SHARED; @@ -695,8 +694,10 @@ null_lock(struct vop_lock1_args *ap) error = vop_stdlock(ap); } vdrop(lvp); - } else + } else { + VI_UNLOCK(vp); error = vop_stdlock(ap); + } return (error); } From owner-svn-src-head@freebsd.org Sun Sep 1 06:41:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4786ACC936; Sun, 1 Sep 2019 06:41:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46LkBM6j6qz3ypy; Sun, 1 Sep 2019 06:40:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADE6125677; Sun, 1 Sep 2019 06:40:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x816ex7e052869; Sun, 1 Sep 2019 06:40:59 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x816exHn052866; Sun, 1 Sep 2019 06:40:59 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201909010640.x816exHn052866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Sun, 1 Sep 2019 06:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351653 - in head: share/man/man4 sys/dev/rtwn/usb sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/rtwn/usb sys/dev/usb X-SVN-Commit-Revision: 351653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 06:41:00 -0000 Author: jkim Date: Sun Sep 1 06:40:58 2019 New Revision: 351653 URL: https://svnweb.freebsd.org/changeset/base/351653 Log: Add support for TP-Link Archer T2U Nano. MFC after: 2 weeks Modified: head/share/man/man4/rtwn_usb.4 head/sys/dev/rtwn/usb/rtwn_usb_attach.h head/sys/dev/usb/usbdevs Modified: head/share/man/man4/rtwn_usb.4 ============================================================================== --- head/share/man/man4/rtwn_usb.4 Sun Sep 1 04:57:58 2019 (r351652) +++ head/share/man/man4/rtwn_usb.4 Sun Sep 1 06:40:58 2019 (r351653) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd January 28, 2019 +.Dd September 1, 2019 .Dt RTWN_USB 4 .Os .Sh NAME @@ -94,6 +94,7 @@ based USB wireless network adapters, including: .It "Realtek RTL8192CU" Ta RTL8192CU Ta USB 2.0 .It "Realtek RTL8188CUS" Ta RTL8188CUS Ta USB 2.0 .It "Sitecom WLA-7100" Ta RTL8812AU Ta USB 3.0 +.It "TP-Link Archer T2U Nano" Ta RTL8821AU Ta USB 2.0 .It "TP-Link Archer T4U" Ta RTL8812AU Ta USB 3.0 .It "TP-Link Archer T4U v2" Ta RTL8812AU Ta USB 3.0 .It "TP-Link Archer T4UH v1" Ta RTL8812AU Ta USB 3.0 Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_attach.h Sun Sep 1 04:57:58 2019 (r351652) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.h Sun Sep 1 06:40:58 2019 (r351653) @@ -158,7 +158,8 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8821AU_DEV(MELCO, WIU2433DM), RTWN_RTL8821AU_DEV(NETGEAR, A6100), RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU_1), - RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU_2) + RTWN_RTL8821AU_DEV(REALTEK, RTL8821AU_2), + RTWN_RTL8821AU_DEV(TPLINK, T2UNANO) #undef RTWN_RTL8821AU_DEV }; Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Sep 1 04:57:58 2019 (r351652) +++ head/sys/dev/usb/usbdevs Sun Sep 1 06:40:58 2019 (r351653) @@ -4661,6 +4661,7 @@ product TPLINK WN722NV2 0x010c TL-WN722N v2 product TPLINK T4UV2 0x010d Archer T4U ver 2 product TPLINK T4UHV1 0x0103 Archer T4UH ver 1 product TPLINK T4UHV2 0x010e Archer T4UH ver 2 +product TPLINK T2UNANO 0x011e Archer T2U Nano product TPLINK RTL8153 0x0601 RTL8153 USB 10/100/1000 LAN /* Trek Technology products */ From owner-svn-src-head@freebsd.org Sun Sep 1 10:09:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB74DD5AEF; Sun, 1 Sep 2019 10:09:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46LpqQ4DBfz48Cb; Sun, 1 Sep 2019 10:09:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70CA527C62; Sun, 1 Sep 2019 10:09:54 +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 x81A9sQu077046; Sun, 1 Sep 2019 10:09:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81A9rPb077043; Sun, 1 Sep 2019 10:09:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909011009.x81A9rPb077043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 1 Sep 2019 10:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351654 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 351654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 10:09:54 -0000 Author: tuexen Date: Sun Sep 1 10:09:53 2019 New Revision: 351654 URL: https://svnweb.freebsd.org/changeset/base/351654 Log: Improve the handling of state cookie parameters in INIT-ACK chunks. This fixes problem with parameters indicating a zero length or partial parameters after an unknown parameter indicating to stop processing. It also fixes a problem with state cookie parameters after unknown parametes indicating to stop porcessing. Thanks to Mark Wodrich from Google for finding two of these issues by fuzz testing the userland stack and reporting them in https://github.com/sctplab/usrsctp/issues/355 and https://github.com/sctplab/usrsctp/issues/352 MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Sep 1 06:40:58 2019 (r351653) +++ head/sys/netinet/sctp_input.c Sun Sep 1 10:09:53 2019 (r351654) @@ -444,22 +444,48 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int { struct sctp_association *asoc; struct mbuf *op_err; - int retval, abort_flag; - uint32_t initack_limit; + int retval, abort_flag, cookie_found; + int initack_limit; int nat_friendly = 0; /* First verify that we have no illegal param's */ abort_flag = 0; + cookie_found = 0; op_err = sctp_arethere_unrecognized_parameters(m, (offset + sizeof(struct sctp_init_chunk)), - &abort_flag, (struct sctp_chunkhdr *)cp, &nat_friendly); + &abort_flag, (struct sctp_chunkhdr *)cp, + &nat_friendly, &cookie_found); if (abort_flag) { /* Send an abort and notify peer */ sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_no_unlock = 1; return (-1); } + if (!cookie_found) { + uint16_t len; + + len = (uint16_t)(sizeof(struct sctp_error_missing_param) + sizeof(uint16_t)); + /* We abort with an error of missing mandatory param */ + op_err = sctp_get_mbuf_for_msg(len, 0, M_NOWAIT, 1, MT_DATA); + if (op_err != NULL) { + struct sctp_error_missing_param *cause; + + SCTP_BUF_LEN(op_err) = len; + cause = mtod(op_err, struct sctp_error_missing_param *); + /* Subtract the reserved param */ + cause->cause.code = htons(SCTP_CAUSE_MISSING_PARAM); + cause->cause.length = htons(len); + cause->num_missing_params = htonl(1); + cause->type[0] = htons(SCTP_STATE_COOKIE); + } + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, + mflowtype, mflowid, + vrf_id, net->port); + *abort_no_unlock = 1; + return (-3); + } asoc = &stcb->asoc; asoc->peer_supports_nat = (uint8_t)nat_friendly; /* process the peer's parameters in the INIT-ACK */ @@ -524,40 +550,8 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int /* calculate the RTO */ net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, SCTP_RTT_FROM_NON_DATA); - retval = sctp_send_cookie_echo(m, offset, stcb, net); - if (retval < 0) { - /* - * No cookie, we probably should send a op error. But in any - * case if there is no cookie in the INIT-ACK, we can - * abandon the peer, its broke. - */ - if (retval == -3) { - uint16_t len; - - len = (uint16_t)(sizeof(struct sctp_error_missing_param) + sizeof(uint16_t)); - /* We abort with an error of missing mandatory param */ - op_err = sctp_get_mbuf_for_msg(len, 0, M_NOWAIT, 1, MT_DATA); - if (op_err != NULL) { - struct sctp_error_missing_param *cause; - - SCTP_BUF_LEN(op_err) = len; - cause = mtod(op_err, struct sctp_error_missing_param *); - /* Subtract the reserved param */ - cause->cause.code = htons(SCTP_CAUSE_MISSING_PARAM); - cause->cause.length = htons(len); - cause->num_missing_params = htonl(1); - cause->type[0] = htons(SCTP_STATE_COOKIE); - } - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, net->port); - *abort_no_unlock = 1; - } - return (retval); - } - - return (0); + retval = sctp_send_cookie_echo(m, offset, initack_limit, stcb, net); + return (retval); } static void Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Sep 1 06:40:58 2019 (r351653) +++ head/sys/netinet/sctp_output.c Sun Sep 1 10:09:53 2019 (r351654) @@ -4970,7 +4970,10 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp struct mbuf * sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt, - int param_offset, int *abort_processing, struct sctp_chunkhdr *cp, int *nat_friendly) + int param_offset, int *abort_processing, + struct sctp_chunkhdr *cp, + int *nat_friendly, + int *cookie_found) { /* * Given a mbuf containing an INIT or INIT-ACK with the param_offset @@ -4993,6 +4996,9 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_ uint16_t ptype, plen, padded_size; *abort_processing = 0; + if (cookie_found != NULL) { + *cookie_found = 0; + } mat = in_initpkt; limit = ntohs(cp->chunk_length) - sizeof(struct sctp_init_chunk); at = param_offset; @@ -5021,12 +5027,17 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_ switch (ptype) { /* Param's with variable size */ case SCTP_HEARTBEAT_INFO: - case SCTP_STATE_COOKIE: case SCTP_UNRECOG_PARAM: case SCTP_ERROR_CAUSE_IND: /* ok skip fwd */ at += padded_size; break; + case SCTP_STATE_COOKIE: + if (cookie_found != NULL) { + *cookie_found = 1; + } + at += padded_size; + break; /* Param's with variable size within a range */ case SCTP_CHUNK_LIST: case SCTP_SUPPORTED_CHUNK_EXT: @@ -5568,7 +5579,9 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct abort_flag = 0; op_err = sctp_arethere_unrecognized_parameters(init_pkt, (offset + sizeof(struct sctp_init_chunk)), - &abort_flag, (struct sctp_chunkhdr *)init_chk, &nat_friendly); + &abort_flag, + (struct sctp_chunkhdr *)init_chk, + &nat_friendly, NULL); if (abort_flag) { do_a_abort: if (op_err == NULL) { @@ -9001,7 +9014,7 @@ sctp_queue_op_err(struct sctp_tcb *stcb, struct mbuf * int sctp_send_cookie_echo(struct mbuf *m, - int offset, + int offset, int limit, struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -9027,18 +9040,30 @@ sctp_send_cookie_echo(struct mbuf *m, } ptype = ntohs(phdr->param_type); plen = ntohs(phdr->param_length); + if (plen < sizeof(struct sctp_paramhdr)) { + return (-6); + } if (ptype == SCTP_STATE_COOKIE) { int pad; /* found the cookie */ - if ((pad = (plen % 4))) { - plen += 4 - pad; + if (at + plen > limit) { + return (-7); } cookie = SCTP_M_COPYM(m, at, plen, M_NOWAIT); if (cookie == NULL) { /* No memory */ return (-2); } + if ((pad = (plen % 4)) > 0) { + pad = 4 - pad; + } + if (pad > 0) { + cookie = sctp_pad_lastmbuf(cookie, pad, NULL); + if (cookie == NULL) { + return (-8); + } + } #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { sctp_log_mbc(cookie, SCTP_MBUF_ICOPY); @@ -9064,7 +9089,7 @@ sctp_send_cookie_echo(struct mbuf *m, chk->rec.chunk_id.id = SCTP_COOKIE_ECHO; chk->rec.chunk_id.can_take_data = 0; chk->flags = CHUNK_FLAGS_FRAGMENT_OK; - chk->send_size = plen; + chk->send_size = SCTP_SIZE32(plen); chk->sent = SCTP_DATAGRAM_UNSENT; chk->snd_count = 0; chk->asoc = &stcb->asoc; Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Sun Sep 1 06:40:58 2019 (r351653) +++ head/sys/netinet/sctp_output.h Sun Sep 1 10:09:53 2019 (r351654) @@ -92,11 +92,11 @@ sctp_send_initiate_ack(struct sctp_inpcb *, struct sct struct mbuf * sctp_arethere_unrecognized_parameters(struct mbuf *, int, int *, - struct sctp_chunkhdr *, int *); + struct sctp_chunkhdr *, int *, int *); void sctp_queue_op_err(struct sctp_tcb *, struct mbuf *); int -sctp_send_cookie_echo(struct mbuf *, int, struct sctp_tcb *, +sctp_send_cookie_echo(struct mbuf *, int, int, struct sctp_tcb *, struct sctp_nets *); void sctp_send_cookie_ack(struct sctp_tcb *); From owner-svn-src-head@freebsd.org Sun Sep 1 10:39:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 496A0D63BF; Sun, 1 Sep 2019 10:39:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46LqTK0wv1z49Tv; Sun, 1 Sep 2019 10:39:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0018E22C; Sun, 1 Sep 2019 10:39:16 +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 x81AdGV6094888; Sun, 1 Sep 2019 10:39:16 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81AdGWL094887; Sun, 1 Sep 2019 10:39:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909011039.x81AdGWL094887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 1 Sep 2019 10:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351655 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 351655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 10:39:17 -0000 Author: tuexen Date: Sun Sep 1 10:39:16 2019 New Revision: 351655 URL: https://svnweb.freebsd.org/changeset/base/351655 Log: Fix initialization of top_fsn. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.h Modified: head/sys/netinet/sctp_indata.h ============================================================================== --- head/sys/netinet/sctp_indata.h Sun Sep 1 10:09:53 2019 (r351654) +++ head/sys/netinet/sctp_indata.h Sun Sep 1 10:39:16 2019 (r351655) @@ -61,7 +61,6 @@ sctp_build_readq_entry(struct sctp_tcb *stcb, (_ctl)->sinfo_ppid = ppid; \ (_ctl)->sinfo_context = context; \ (_ctl)->fsn_included = 0xffffffff; \ - (_ctl)->top_fsn = 0xffffffff; \ (_ctl)->sinfo_tsn = tsn; \ (_ctl)->sinfo_cumtsn = tsn; \ (_ctl)->sinfo_assoc_id = sctp_get_associd((in_it)); \ From owner-svn-src-head@freebsd.org Sun Sep 1 14:01:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CC92DB07E; Sun, 1 Sep 2019 14:01:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46LvyG1D1fz4LnM; Sun, 1 Sep 2019 14:01:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D869264B; Sun, 1 Sep 2019 14:01:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x81E19nV013636; Sun, 1 Sep 2019 14:01:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81E192l013635; Sun, 1 Sep 2019 14:01:09 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909011401.x81E192l013635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 1 Sep 2019 14:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351656 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 351656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 14:01:10 -0000 Author: mjg Date: Sun Sep 1 14:01:09 2019 New Revision: 351656 URL: https://svnweb.freebsd.org/changeset/base/351656 Log: vfs: stop refing freed mount points in vop_stdgetwritemount The code used blindly ref based on an unsafely red address and then would backpedal if necessary. This was safe in terms of memory access since mounts are type-stable, but made for a potential a bug where the mount was reused and had the count reset to 0 before this code decreased it. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21411 Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Sun Sep 1 10:39:16 2019 (r351655) +++ head/sys/kern/vfs_default.c Sun Sep 1 14:01:09 2019 (r351656) @@ -588,22 +588,28 @@ vop_stdgetwritemount(ap) } */ *ap; { struct mount *mp; + struct vnode *vp; /* - * XXX Since this is called unlocked we may be recycled while - * attempting to ref the mount. If this is the case or mountpoint - * will be set to NULL. We only have to prevent this call from - * returning with a ref to an incorrect mountpoint. It is not - * harmful to return with a ref to our previous mountpoint. + * Note that having a reference does not prevent forced unmount from + * setting ->v_mount to NULL after the lock gets released. This is of + * no consequence for typical consumers (most notably vn_start_write) + * since in this case the vnode is VI_DOOMED. Unmount might have + * progressed far enough that its completion is only delayed by the + * reference obtained here. The consumer only needs to concern itself + * with releasing it. */ - mp = ap->a_vp->v_mount; - if (mp != NULL) { - vfs_ref(mp); - if (mp != ap->a_vp->v_mount) { - vfs_rel(mp); - mp = NULL; - } + vp = ap->a_vp; + mp = vp->v_mount; + MNT_ILOCK(mp); + if (mp != vp->v_mount) { + MNT_IUNLOCK(mp); + mp = NULL; + goto out; } + MNT_REF(mp); + MNT_IUNLOCK(mp); +out: *(ap->a_mpp) = mp; return (0); } From owner-svn-src-head@freebsd.org Sun Sep 1 14:47:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 590BBDBE62; Sun, 1 Sep 2019 14:47:43 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Lwzz2CsPz4NjG; Sun, 1 Sep 2019 14:47:43 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1526E2EEB; Sun, 1 Sep 2019 14:47:43 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x81Elgqq042769; Sun, 1 Sep 2019 14:47:42 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81ElfnD042763; Sun, 1 Sep 2019 14:47:41 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201909011447.x81ElfnD042763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 1 Sep 2019 14:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351657 - in head/sys: dev/netmap net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head/sys: dev/netmap net X-SVN-Commit-Revision: 351657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 14:47:43 -0000 Author: vmaffione Date: Sun Sep 1 14:47:41 2019 New Revision: 351657 URL: https://svnweb.freebsd.org/changeset/base/351657 Log: netmap: import changes from upstream (SHA 137f537eae513) - Rework option processing. - Use larger integers for memory size values in the memory management code. MFC after: 2 weeks Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_kloop.c head/sys/dev/netmap/netmap_mem2.c head/sys/net/netmap.h head/sys/net/netmap_user.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Sun Sep 1 14:01:09 2019 (r351656) +++ head/sys/dev/netmap/netmap.c Sun Sep 1 14:47:41 2019 (r351657) @@ -1037,8 +1037,13 @@ netmap_do_unregif(struct netmap_priv_d *priv) na->nm_krings_delete(na); /* restore the default number of host tx and rx rings */ - na->num_host_tx_rings = 1; - na->num_host_rx_rings = 1; + if (na->na_flags & NAF_HOST_RINGS) { + na->num_host_tx_rings = 1; + na->num_host_rx_rings = 1; + } else { + na->num_host_tx_rings = 0; + na->num_host_rx_rings = 0; + } } /* possibily decrement counter of tx_si/rx_si users */ @@ -2505,17 +2510,11 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c } #ifdef WITH_EXTMEM - opt = nmreq_findoption((struct nmreq_option *)(uintptr_t)hdr->nr_options, - NETMAP_REQ_OPT_EXTMEM); + opt = nmreq_getoption(hdr, NETMAP_REQ_OPT_EXTMEM); if (opt != NULL) { struct nmreq_opt_extmem *e = (struct nmreq_opt_extmem *)opt; - error = nmreq_checkduplicate(opt); - if (error) { - opt->nro_status = error; - break; - } nmd = netmap_mem_ext_create(e->nro_usrptr, &e->nro_info, &error); opt->nro_status = error; @@ -2559,15 +2558,11 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c break; } - opt = nmreq_findoption((struct nmreq_option *)(uintptr_t)hdr->nr_options, - NETMAP_REQ_OPT_CSB); + opt = nmreq_getoption(hdr, NETMAP_REQ_OPT_CSB); if (opt != NULL) { struct nmreq_opt_csb *csbo = (struct nmreq_opt_csb *)opt; - error = nmreq_checkduplicate(opt); - if (!error) { - error = netmap_csb_validate(priv, csbo); - } + error = netmap_csb_validate(priv, csbo); opt->nro_status = error; if (error) { netmap_do_unregif(priv); @@ -2841,19 +2836,15 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c case NETMAP_REQ_CSB_ENABLE: { struct nmreq_option *opt; - opt = nmreq_findoption((struct nmreq_option *)(uintptr_t)hdr->nr_options, - NETMAP_REQ_OPT_CSB); + opt = nmreq_getoption(hdr, NETMAP_REQ_OPT_CSB); if (opt == NULL) { error = EINVAL; } else { struct nmreq_opt_csb *csbo = (struct nmreq_opt_csb *)opt; - error = nmreq_checkduplicate(opt); - if (!error) { - NMG_LOCK(); - error = netmap_csb_validate(priv, csbo); - NMG_UNLOCK(); - } + NMG_LOCK(); + error = netmap_csb_validate(priv, csbo); + NMG_UNLOCK(); opt->nro_status = error; } break; @@ -3021,13 +3012,72 @@ nmreq_opt_size_by_type(uint32_t nro_reqtype, uint64_t return rv - sizeof(struct nmreq_option); } +/* + * nmreq_copyin: create an in-kernel version of the request. + * + * We build the following data structure: + * + * hdr -> +-------+ buf + * | | +---------------+ + * +-------+ |usr body ptr | + * |options|-. +---------------+ + * +-------+ | |usr options ptr| + * |body |--------->+---------------+ + * +-------+ | | | + * | | copy of body | + * | | | + * | +---------------+ + * | | NULL | + * | +---------------+ + * | .---| |\ + * | | +---------------+ | + * | .------| | | + * | | | +---------------+ \ option table + * | | | | ... | / indexed by option + * | | | +---------------+ | type + * | | | | | | + * | | | +---------------+/ + * | | | |usr next ptr 1 | + * `-|----->+---------------+ + * | | | copy of opt 1 | + * | | | | + * | | .-| nro_next | + * | | | +---------------+ + * | | | |usr next ptr 2 | + * | `-`>+---------------+ + * | | copy of opt 2 | + * | | | + * | .-| nro_next | + * | | +---------------+ + * | | | | + * ~ ~ ~ ... ~ + * | .-| | + * `----->+---------------+ + * | |usr next ptr n | + * `>+---------------+ + * | copy of opt n | + * | | + * | nro_next(NULL)| + * +---------------+ + * + * The options and body fields of the hdr structure are overwritten + * with in-kernel valid pointers inside the buf. The original user + * pointers are saved in the buf and restored on copyout. + * The list of options is copied and the pointers adjusted. The + * original pointers are saved before the option they belonged. + * + * The option table has an entry for every availabe option. Entries + * for options that have not been passed contain NULL. + * + */ + int nmreq_copyin(struct nmreq_header *hdr, int nr_body_is_user) { size_t rqsz, optsz, bufsz; - int error; + int error = 0; char *ker = NULL, *p; - struct nmreq_option **next, *src; + struct nmreq_option **next, *src, **opt_tab; struct nmreq_option buf; uint64_t *ptrs; @@ -3058,7 +3108,13 @@ nmreq_copyin(struct nmreq_header *hdr, int nr_body_is_ goto out_err; } - bufsz = 2 * sizeof(void *) + rqsz; + bufsz = 2 * sizeof(void *) + rqsz + + NETMAP_REQ_OPT_MAX * sizeof(opt_tab); + /* compute the size of the buf below the option table. + * It must contain a copy of every received option structure. + * For every option we also need to store a copy of the user + * list pointer. + */ optsz = 0; for (src = (struct nmreq_option *)(uintptr_t)hdr->nr_options; src; src = (struct nmreq_option *)(uintptr_t)buf.nro_next) @@ -3072,15 +3128,16 @@ nmreq_copyin(struct nmreq_header *hdr, int nr_body_is_ error = EMSGSIZE; goto out_err; } - bufsz += optsz + sizeof(void *); + bufsz += sizeof(void *); } + bufsz += optsz; ker = nm_os_malloc(bufsz); if (ker == NULL) { error = ENOMEM; goto out_err; } - p = ker; + p = ker; /* write pointer into the buffer */ /* make a copy of the user pointers */ ptrs = (uint64_t*)p; @@ -3095,6 +3152,9 @@ nmreq_copyin(struct nmreq_header *hdr, int nr_body_is_ /* overwrite the user pointer with the in-kernel one */ hdr->nr_body = (uintptr_t)p; p += rqsz; + /* start of the options table */ + opt_tab = (struct nmreq_option **)p; + p += sizeof(opt_tab) * NETMAP_REQ_OPT_MAX; /* copy the options */ next = (struct nmreq_option **)&hdr->nr_options; @@ -3118,6 +3178,34 @@ nmreq_copyin(struct nmreq_header *hdr, int nr_body_is_ */ opt->nro_status = EOPNOTSUPP; + /* check for invalid types */ + if (opt->nro_reqtype < 1) { + if (netmap_verbose) + nm_prinf("invalid option type: %u", opt->nro_reqtype); + opt->nro_status = EINVAL; + error = EINVAL; + goto next; + } + + if (opt->nro_reqtype >= NETMAP_REQ_OPT_MAX) { + /* opt->nro_status is already EOPNOTSUPP */ + error = EOPNOTSUPP; + goto next; + } + + /* if the type is valid, index the option in the table + * unless it is a duplicate. + */ + if (opt_tab[opt->nro_reqtype] != NULL) { + if (netmap_verbose) + nm_prinf("duplicate option: %u", opt->nro_reqtype); + opt->nro_status = EINVAL; + opt_tab[opt->nro_reqtype]->nro_status = EINVAL; + error = EINVAL; + goto next; + } + opt_tab[opt->nro_reqtype] = opt; + p = (char *)(opt + 1); /* copy the option body */ @@ -3131,11 +3219,14 @@ nmreq_copyin(struct nmreq_header *hdr, int nr_body_is_ p += optsz; } + next: /* move to next option */ next = (struct nmreq_option **)&opt->nro_next; src = *next; } - return 0; + if (error) + nmreq_copyout(hdr, error); + return error; out_restore: ptrs = (uint64_t *)ker; @@ -3218,25 +3309,15 @@ out: } struct nmreq_option * -nmreq_findoption(struct nmreq_option *opt, uint16_t reqtype) +nmreq_getoption(struct nmreq_header *hdr, uint16_t reqtype) { - for ( ; opt; opt = (struct nmreq_option *)(uintptr_t)opt->nro_next) - if (opt->nro_reqtype == reqtype) - return opt; - return NULL; -} + struct nmreq_option **opt_tab; -int -nmreq_checkduplicate(struct nmreq_option *opt) { - uint16_t type = opt->nro_reqtype; - int dup = 0; + if (!hdr->nr_options) + return NULL; - while ((opt = nmreq_findoption((struct nmreq_option *)(uintptr_t)opt->nro_next, - type))) { - dup++; - opt->nro_status = EINVAL; - } - return (dup ? EINVAL : 0); + opt_tab = (struct nmreq_option **)(hdr->nr_options) - (NETMAP_REQ_OPT_MAX + 1); + return opt_tab[reqtype]; } static int Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Sun Sep 1 14:01:09 2019 (r351656) +++ head/sys/dev/netmap/netmap_kern.h Sun Sep 1 14:47:41 2019 (r351657) @@ -2390,8 +2390,7 @@ nm_os_get_mbuf(struct ifnet *ifp, int len) #endif /* __FreeBSD_version >= 1100000 */ #endif /* __FreeBSD__ */ -struct nmreq_option * nmreq_findoption(struct nmreq_option *, uint16_t); -int nmreq_checkduplicate(struct nmreq_option *); +struct nmreq_option * nmreq_getoption(struct nmreq_header *, uint16_t); int netmap_init_bridges(void); void netmap_uninit_bridges(void); Modified: head/sys/dev/netmap/netmap_kloop.c ============================================================================== --- head/sys/dev/netmap/netmap_kloop.c Sun Sep 1 14:01:09 2019 (r351656) +++ head/sys/dev/netmap/netmap_kloop.c Sun Sep 1 14:47:41 2019 (r351657) @@ -649,8 +649,7 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n } /* Validate notification options. */ - opt = nmreq_findoption((struct nmreq_option *)(uintptr_t)hdr->nr_options, - NETMAP_REQ_OPT_SYNC_KLOOP_MODE); + opt = nmreq_getoption(hdr, NETMAP_REQ_OPT_SYNC_KLOOP_MODE); if (opt != NULL) { struct nmreq_opt_sync_kloop_mode *mode_opt = (struct nmreq_opt_sync_kloop_mode *)opt; @@ -664,14 +663,8 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n } opt->nro_status = 0; } - opt = nmreq_findoption((struct nmreq_option *)(uintptr_t)hdr->nr_options, - NETMAP_REQ_OPT_SYNC_KLOOP_EVENTFDS); + opt = nmreq_getoption(hdr, NETMAP_REQ_OPT_SYNC_KLOOP_EVENTFDS); if (opt != NULL) { - err = nmreq_checkduplicate(opt); - if (err) { - opt->nro_status = err; - goto out; - } if (opt->nro_size != sizeof(*eventfds_opt) + sizeof(eventfds_opt->eventfds[0]) * num_rings) { /* Option size not consistent with the number of Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Sun Sep 1 14:01:09 2019 (r351656) +++ head/sys/dev/netmap/netmap_mem2.c Sun Sep 1 14:47:41 2019 (r351657) @@ -100,16 +100,17 @@ struct netmap_obj_pool { /* ---------------------------------------------------*/ /* these are only meaningful if the pool is finalized */ /* (see 'finalized' field in netmap_mem_d) */ - u_int objtotal; /* actual total number of objects. */ - u_int memtotal; /* actual total memory space */ - u_int numclusters; /* actual number of clusters */ + size_t memtotal; /* actual total memory space */ - u_int objfree; /* number of free objects. */ - struct lut_entry *lut; /* virt,phys addresses, objtotal entries */ uint32_t *bitmap; /* one bit per buffer, 1 means free */ uint32_t *invalid_bitmap;/* one bit per buffer, 1 means invalid */ uint32_t bitmap_slots; /* number of uint32 entries in bitmap */ + + u_int objtotal; /* actual total number of objects. */ + u_int numclusters; /* actual number of clusters */ + u_int objfree; /* number of free objects. */ + int alloc_done; /* we have allocated the memory */ /* ---------------------------------------------------*/ @@ -159,7 +160,7 @@ struct netmap_mem_ops { struct netmap_mem_d { NMA_LOCK_T nm_mtx; /* protect the allocator */ - u_int nm_totalsize; /* shorthand */ + size_t nm_totalsize; /* shorthand */ u_int flags; #define NETMAP_MEM_FINALIZED 0x1 /* preallocation done */ @@ -817,7 +818,7 @@ netmap_mem2_ofstophys(struct netmap_mem_d* nmd, vm_oof return pa; } /* this is only in case of errors */ - nm_prerr("invalid ofs 0x%x out of 0x%x 0x%x 0x%x", (u_int)o, + nm_prerr("invalid ofs 0x%x out of 0x%zx 0x%zx 0x%zx", (u_int)o, p[NETMAP_IF_POOL].memtotal, p[NETMAP_IF_POOL].memtotal + p[NETMAP_RING_POOL].memtotal, @@ -947,7 +948,7 @@ netmap_mem2_get_info(struct netmap_mem_d* nmd, uint64_ *size = 0; for (i = 0; i < NETMAP_POOLS_NR; i++) { struct netmap_obj_pool *p = nmd->pools + i; - *size += (p->_numclusters * p->_clustsize); + *size += ((size_t)p->_numclusters * (size_t)p->_clustsize); } } } @@ -1476,9 +1477,9 @@ netmap_finalize_obj_allocator(struct netmap_obj_pool * #endif } } - p->memtotal = p->numclusters * p->_clustsize; + p->memtotal = (size_t)p->numclusters * (size_t)p->_clustsize; if (netmap_verbose) - nm_prinf("Pre-allocated %d clusters (%d/%dKB) for '%s'", + nm_prinf("Pre-allocated %d clusters (%d/%zuKB) for '%s'", p->numclusters, p->_clustsize >> 10, p->memtotal >> 10, p->name); @@ -1639,7 +1640,7 @@ netmap_mem_finalize_all(struct netmap_mem_d *nmd) nmd->flags |= NETMAP_MEM_FINALIZED; if (netmap_verbose) - nm_prinf("interfaces %d KB, rings %d KB, buffers %d MB", + nm_prinf("interfaces %zd KB, rings %zd KB, buffers %zd MB", nmd->pools[NETMAP_IF_POOL].memtotal >> 10, nmd->pools[NETMAP_RING_POOL].memtotal >> 10, nmd->pools[NETMAP_BUF_POOL].memtotal >> 20); @@ -2341,8 +2342,8 @@ netmap_mem_ext_create(uint64_t usrptr, struct nmreq_po } p->objtotal = j; p->numclusters = p->objtotal; - p->memtotal = j * p->_objsize; - nm_prdis("%d memtotal %u", j, p->memtotal); + p->memtotal = j * (size_t)p->_objsize; + nm_prdis("%d memtotal %zu", j, p->memtotal); } netmap_mem_ext_register(nme); @@ -2446,8 +2447,8 @@ netmap_mem_pt_guest_ifp_del(struct netmap_mem_d *nmd, } else { ptnmd->pt_ifs = curr->next; } - nm_prinf("removed (ifp=%s,nifp_offset=%u)", - curr->ifp->if_xname, curr->nifp_offset); + nm_prinf("removed (ifp=%p,nifp_offset=%u)", + curr->ifp, curr->nifp_offset); nm_os_free(curr); ret = 0; break; @@ -2573,7 +2574,7 @@ netmap_mem_pt_guest_finalize(struct netmap_mem_d *nmd) ptnmd->buf_lut.objtotal = nbuffers; ptnmd->buf_lut.objsize = bufsize; - nmd->nm_totalsize = (unsigned int)mem_size; + nmd->nm_totalsize = mem_size; /* Initialize these fields as are needed by * netmap_mem_bufsize(). Modified: head/sys/net/netmap.h ============================================================================== --- head/sys/net/netmap.h Sun Sep 1 14:01:09 2019 (r351656) +++ head/sys/net/netmap.h Sun Sep 1 14:47:41 2019 (r351657) @@ -562,6 +562,10 @@ enum { * This requires the 'ioeventfd' fields to be valid (cannot be < 0). */ NETMAP_REQ_OPT_SYNC_KLOOP_MODE, + + /* This is a marker to count the number of available options. + * New options must be added above it. */ + NETMAP_REQ_OPT_MAX, }; /* Modified: head/sys/net/netmap_user.h ============================================================================== --- head/sys/net/netmap_user.h Sun Sep 1 14:01:09 2019 (r351656) +++ head/sys/net/netmap_user.h Sun Sep 1 14:47:41 2019 (r351657) @@ -117,7 +117,7 @@ (nifp)->ni_host_tx_rings] ) #define NETMAP_BUF(ring, index) \ - ((char *)(ring) + (ring)->buf_ofs + ((index)*(ring)->nr_buf_size)) + ((char *)(ring) + (ring)->buf_ofs + ((size_t)(index)*(ring)->nr_buf_size)) #define NETMAP_BUF_IDX(ring, buf) \ ( ((char *)(buf) - ((char *)(ring) + (ring)->buf_ofs) ) / \ @@ -254,7 +254,7 @@ struct nm_desc { struct nm_desc *self; /* point to self if netmap. */ int fd; void *mem; - uint32_t memsize; + size_t memsize; int done_mmap; /* set if mem is the result of mmap */ struct netmap_if * const nifp; uint16_t first_tx_ring, last_tx_ring, cur_tx_ring; From owner-svn-src-head@freebsd.org Sun Sep 1 15:39:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D70EDDCE67; Sun, 1 Sep 2019 15:39:28 +0000 (UTC) (envelope-from fox@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Ly7h5Lhnz4QvH; Sun, 1 Sep 2019 15:39:28 +0000 (UTC) (envelope-from fox@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B73339C1; Sun, 1 Sep 2019 15:39:28 +0000 (UTC) (envelope-from fox@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x81FdS9h073432; Sun, 1 Sep 2019 15:39:28 GMT (envelope-from fox@FreeBSD.org) Received: (from fox@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81FdSQ4073431; Sun, 1 Sep 2019 15:39:28 GMT (envelope-from fox@FreeBSD.org) Message-Id: <201909011539.x81FdSQ4073431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fox set sender to fox@FreeBSD.org using -f From: Santhosh Raju Date: Sun, 1 Sep 2019 15:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351658 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: fox X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 351658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 15:39:28 -0000 Author: fox (ports committer) Date: Sun Sep 1 15:39:28 2019 New Revision: 351658 URL: https://svnweb.freebsd.org/changeset/base/351658 Log: Add myself (fox) and update the mentor information. Approved by: philip (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sun Sep 1 14:47:41 2019 (r351657) +++ head/share/misc/committers-ports.dot Sun Sep 1 15:39:28 2019 (r351658) @@ -634,6 +634,7 @@ pgollucci -> junovitch pgollucci -> sunpoet pgollucci -> swills +philip -> fox philip -> koitsu pi -> meta From owner-svn-src-head@freebsd.org Sun Sep 1 16:12:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CCC7DDD7B; Sun, 1 Sep 2019 16:12:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46LysQ1LFvz4TGB; Sun, 1 Sep 2019 16:12:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11C7B41C1; Sun, 1 Sep 2019 16:12: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 x81GC6WB097853; Sun, 1 Sep 2019 16:12:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81GC5DW097846; Sun, 1 Sep 2019 16:12:05 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909011612.x81GC5DW097846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 1 Sep 2019 16:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio X-SVN-Commit-Revision: 351659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 16:12:10 -0000 Author: emaste Date: Sun Sep 1 16:12:05 2019 New Revision: 351659 URL: https://svnweb.freebsd.org/changeset/base/351659 Log: libc: remove gets gets is unsafe and shouldn't be used (for many years now). Leave it in the existing symbol version so anything that previously linked aginst it still runs, but do not allow new software to link against it. (The compatability/legacy implementation must not be static so that the symbol and in particular the compat sym gets@FBSD_1.0 make it into libc.) PR: 222796 (exp-run) Reported by: Paul Vixie Reviewed by: allanjude, cy, eadler, gnn, jhb, kib, ngie (some earlier) Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12298 Modified: head/contrib/libc++/include/cstdio head/contrib/netbsd-tests/lib/libc/ssp/h_gets.c head/gnu/lib/libssp/Makefile head/include/stdio.h head/lib/libc/stdio/fgets.3 head/lib/libc/stdio/gets.c head/lib/libc/stdio/stdio.3 Modified: head/contrib/libc++/include/cstdio ============================================================================== --- head/contrib/libc++/include/cstdio Sun Sep 1 15:39:28 2019 (r351658) +++ head/contrib/libc++/include/cstdio Sun Sep 1 16:12:05 2019 (r351659) @@ -74,7 +74,6 @@ int fputc(int c, FILE* stream); int fputs(const char* restrict s, FILE* restrict stream); int getc(FILE* stream); int getchar(void); -char* gets(char* s); // removed in C++14 int putc(int c, FILE* stream); int putchar(int c); int puts(const char* s); @@ -153,9 +152,6 @@ using ::tmpnam; #ifndef _LIBCPP_HAS_NO_STDIN using ::getchar; -#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_MSVCRT) -using ::gets; -#endif using ::scanf; using ::vscanf; #endif Modified: head/contrib/netbsd-tests/lib/libc/ssp/h_gets.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/ssp/h_gets.c Sun Sep 1 15:39:28 2019 (r351658) +++ head/contrib/netbsd-tests/lib/libc/ssp/h_gets.c Sun Sep 1 16:12:05 2019 (r351659) @@ -33,6 +33,24 @@ __RCSID("$NetBSD: h_gets.c,v 1.1 2010/12/27 02:04:19 p #include +#ifdef __FreeBSD__ +/* + * We want to test the gets() implementation, but cannot simply link against + * the gets symbol because it is not in the default version. (We've made it + * unavailable by default on FreeBSD because it should not be used.) + * + * The next two lines create an unsafe_gets() function that resolves to + * gets@FBSD_1.0, which we call from our local gets() implementation. + */ +__sym_compat(gets, unsafe_gets, FBSD_1.0); +char *unsafe_gets(char *); + +char *gets(char *buf) +{ + return unsafe_gets(buf); +} +#endif + int main(int argc, char *argv[]) { Modified: head/gnu/lib/libssp/Makefile ============================================================================== --- head/gnu/lib/libssp/Makefile Sun Sep 1 15:39:28 2019 (r351658) +++ head/gnu/lib/libssp/Makefile Sun Sep 1 16:12:05 2019 (r351659) @@ -17,7 +17,7 @@ LIB= ssp SHLIB_MAJOR= 0 LD_FATAL_WARNINGS= no -SRCS= ssp.c gets-chk.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \ +SRCS= ssp.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \ memset-chk.c snprintf-chk.c sprintf-chk.c stpcpy-chk.c \ strcat-chk.c strcpy-chk.c strncat-chk.c strncpy-chk.c \ vsnprintf-chk.c vsprintf-chk.c Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Sun Sep 1 15:39:28 2019 (r351658) +++ head/include/stdio.h Sun Sep 1 16:12:05 2019 (r351659) @@ -269,7 +269,6 @@ long ftell(FILE *); size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict); int getc(FILE *); int getchar(void); -char *gets(char *); #if __EXT1_VISIBLE char *gets_s(char *, rsize_t); #endif Modified: head/lib/libc/stdio/fgets.3 ============================================================================== --- head/lib/libc/stdio/fgets.3 Sun Sep 1 15:39:28 2019 (r351658) +++ head/lib/libc/stdio/fgets.3 Sun Sep 1 16:12:05 2019 (r351659) @@ -32,12 +32,11 @@ .\" @(#)fgets.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 3, 2018 +.Dd September 1, 2019 .Dt FGETS 3 .Os .Sh NAME .Nm fgets , -.Nm gets , .Nm gets_s .Nd get a line from a stream .Sh LIBRARY @@ -48,8 +47,6 @@ .Fn fgets "char * restrict str" "int size" "FILE * restrict stream" .Ft char * .Fn gets_s "char *str" "rsize_t size" -.Ft char * -.Fn gets "char *str" .Sh DESCRIPTION The .Fn fgets @@ -81,23 +78,12 @@ except that the newline character (if any) is not stor The .Fn gets function -is equivalent to -.Fn fgets -with an infinite -.Fa size -and a -.Fa stream -of -.Dv stdin , -except that the newline character (if any) is not stored in the string. -It is the caller's responsibility to ensure that the input line, -if any, is sufficiently short to fit in the string. +was unsafe and is no longer available. .Sh RETURN VALUES Upon successful completion, -.Fn fgets , -.Fn gets_s , +.Fn fgets and -.Fn gets +.Fn gets_s return a pointer to the string. If end-of-file occurs before any characters are read, @@ -109,10 +95,9 @@ they return .Dv NULL and the buffer contents are indeterminate. The -.Fn fgets , -.Fn gets_s , +.Fn fgets and -.Fn gets +.Fn gets_s functions do not distinguish between end-of-file and error, and callers must use .Xr feof 3 @@ -139,8 +124,6 @@ or .Xr malloc 3 . .Pp The function -.Fn gets -and .Fn gets_s may also fail and set .Va errno @@ -153,11 +136,9 @@ for any of the errors specified for the routine .Xr fgetws 3 , .Xr getline 3 .Sh STANDARDS -The functions +The .Fn fgets -and -.Fn gets -conform to +function conforms to .St -isoC-99 . .Fn gets_s conforms to @@ -166,16 +147,3 @@ K.3.7.4.1. .Fn gets has been removed from .St -isoC-2011 . -.Sh SECURITY CONSIDERATIONS -The -.Fn gets -function cannot be used securely. -Because of its lack of bounds checking, -and the inability for the calling program -to reliably determine the length of the next incoming line, -the use of this function enables malicious users -to arbitrarily change a running program's functionality through -a buffer overflow attack. -It is strongly suggested that the -.Fn fgets -function be used in all cases. Modified: head/lib/libc/stdio/gets.c ============================================================================== --- head/lib/libc/stdio/gets.c Sun Sep 1 15:39:28 2019 (r351658) +++ head/lib/libc/stdio/gets.c Sun Sep 1 16:12:05 2019 (r351659) @@ -45,10 +45,8 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "local.h" -__warn_references(gets, "warning: this program uses gets(), which is unsafe."); - char * -gets(char *buf) +__gets_unsafe(char *buf) { int c; char *s, *ret; @@ -78,3 +76,4 @@ end: FUNLOCKFILE_CANCELSAFE(); return (ret); } +__sym_compat(gets, __gets_unsafe, FBSD_1.0); Modified: head/lib/libc/stdio/stdio.3 ============================================================================== --- head/lib/libc/stdio/stdio.3 Sun Sep 1 15:39:28 2019 (r351658) +++ head/lib/libc/stdio/stdio.3 Sun Sep 1 16:12:05 2019 (r351659) @@ -279,7 +279,6 @@ library conforms to .It "getchar get next character or word from input stream" .It "getdelim get a line from a stream" .It "getline get a line from a stream" -.It "gets get a line from a stream" .It "getw get next character or word from input stream" .It "getwc get next wide character from input stream" .It "getwchar get next wide character from input stream" From owner-svn-src-head@freebsd.org Sun Sep 1 16:41:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 829AEDE5C7; Sun, 1 Sep 2019 16:41:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46LzW92ydnz4VhD; Sun, 1 Sep 2019 16:41:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A1AE4700; Sun, 1 Sep 2019 16:41:25 +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 x81GfPcX011816; Sun, 1 Sep 2019 16:41:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81GfPaZ011815; Sun, 1 Sep 2019 16:41:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909011641.x81GfPaZ011815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 1 Sep 2019 16:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351660 - head/contrib/libstdc++/include/c_std X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/libstdc++/include/c_std X-SVN-Commit-Revision: 351660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 16:41:25 -0000 Author: emaste Date: Sun Sep 1 16:41:24 2019 New Revision: 351660 URL: https://svnweb.freebsd.org/changeset/base/351660 Log: libstdc++: remove gets Removed from libc in r351659 Modified: head/contrib/libstdc++/include/c_std/std_cstdio.h Modified: head/contrib/libstdc++/include/c_std/std_cstdio.h ============================================================================== --- head/contrib/libstdc++/include/c_std/std_cstdio.h Sun Sep 1 16:12:05 2019 (r351659) +++ head/contrib/libstdc++/include/c_std/std_cstdio.h Sun Sep 1 16:41:24 2019 (r351660) @@ -74,7 +74,6 @@ #undef fwrite #undef getc #undef getchar -#undef gets #undef perror #undef printf #undef putc @@ -121,7 +120,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std) using ::fwrite; using ::getc; using ::getchar; - using ::gets; using ::perror; using ::printf; using ::putc; From owner-svn-src-head@freebsd.org Sun Sep 1 16:47:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE385DEA27; Sun, 1 Sep 2019 16:47:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46LzfY46z5z4WFp; Sun, 1 Sep 2019 16:47:49 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71DFC4787; Sun, 1 Sep 2019 16:47:49 +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 x81Glneh016579; Sun, 1 Sep 2019 16:47:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81GlnTS016578; Sun, 1 Sep 2019 16:47:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909011647.x81GlnTS016578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 1 Sep 2019 16:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351661 - in head: share/mk sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: share/mk sys/conf X-SVN-Commit-Revision: 351661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 16:47:49 -0000 Author: emaste Date: Sun Sep 1 16:47:48 2019 New Revision: 351661 URL: https://svnweb.freebsd.org/changeset/base/351661 Log: Remove CLANG_NO_IAS definition CLANG_NO_IAS is not used anywhere in the tree. Sponsored by: The FreeBSD Foundation Modified: head/share/mk/bsd.sys.mk head/sys/conf/kern.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sun Sep 1 16:41:24 2019 (r351660) +++ head/share/mk/bsd.sys.mk Sun Sep 1 16:47:48 2019 (r351661) @@ -198,13 +198,6 @@ CWARNFLAGS+= -Wno-unknown-pragmas # This warning is utter nonsense CFLAGS+= -Wno-format-zero-length -# We need this conditional because many places that use it -# only enable it for some files with CLFAGS.$FILE+=${CLANG_NO_IAS}. -# unconditionally, and can't easily use the CFLAGS.clang= -# mechanism. -.if ${COMPILER_TYPE} == "clang" -CLANG_NO_IAS= -no-integrated-as -.endif CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\ -mllvm -simplifycfg-dup-ret .if ${COMPILER_VERSION} >= 30500 && ${COMPILER_VERSION} < 30700 Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sun Sep 1 16:41:24 2019 (r351660) +++ head/sys/conf/kern.mk Sun Sep 1 16:47:48 2019 (r351661) @@ -37,8 +37,6 @@ CWARNEXTRA+= -Wno-error-shift-negative-value .if ${COMPILER_VERSION} >= 40000 CWARNEXTRA+= -Wno-address-of-packed-member .endif - -CLANG_NO_IAS= -no-integrated-as .endif .if ${COMPILER_TYPE} == "gcc" From owner-svn-src-head@freebsd.org Sun Sep 1 16:50:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1292DEC8D; Sun, 1 Sep 2019 16:50:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Lzjk5yKbz4WXm; Sun, 1 Sep 2019 16:50:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B03B24794; Sun, 1 Sep 2019 16:50: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 x81GoYVN016779; Sun, 1 Sep 2019 16:50:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81GoYMF016778; Sun, 1 Sep 2019 16:50:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909011650.x81GoYMF016778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 1 Sep 2019 16:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351662 - head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD X-SVN-Commit-Revision: 351662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 16:50:35 -0000 Author: emaste Date: Sun Sep 1 16:50:34 2019 New Revision: 351662 URL: https://svnweb.freebsd.org/changeset/base/351662 Log: lldb: shorten thread names to make logs easier to follow lldb prepends the thread name to log entries, and the existing thread name for the FreeBSD ProcessMonitor thread was longer than the kernel's supported thread name length, and so was truncated. This made logs hard to read, as the truncated thread name ran into the log message. Shorten "lldb.process.freebsd.operation" to just "freebsd.op" so that logs are more readable. (Upstreaming to lldb still to be done). Modified: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Modified: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Sun Sep 1 16:47:48 2019 (r351661) +++ head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Sun Sep 1 16:50:34 2019 (r351662) @@ -809,7 +809,7 @@ ProcessMonitor::~ProcessMonitor() { StopMonitor(); } //------------------------------------------------------------------------------ // Thread setup and tear down. void ProcessMonitor::StartLaunchOpThread(LaunchArgs *args, Status &error) { - static const char *g_thread_name = "lldb.process.freebsd.operation"; + static const char *g_thread_name = "freebsd.op"; if (m_operation_thread.IsJoinable()) return; @@ -975,7 +975,7 @@ FINISH: void ProcessMonitor::StartAttachOpThread(AttachArgs *args, lldb_private::Status &error) { - static const char *g_thread_name = "lldb.process.freebsd.operation"; + static const char *g_thread_name = "freebsd.op"; if (m_operation_thread.IsJoinable()) return; From owner-svn-src-head@freebsd.org Sun Sep 1 16:51:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7686DED23; Sun, 1 Sep 2019 16:51:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Lzkj4Tzgz4Wq9; Sun, 1 Sep 2019 16:51:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D4C347DC; Sun, 1 Sep 2019 16:51:25 +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 x81GpPnb019100; Sun, 1 Sep 2019 16:51:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81GpPbJ019099; Sun, 1 Sep 2019 16:51:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909011651.x81GpPbJ019099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 1 Sep 2019 16:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351663 - head/usr.bin/ar X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/ar X-SVN-Commit-Revision: 351663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 16:51:25 -0000 Author: emaste Date: Sun Sep 1 16:51:25 2019 New Revision: 351663 URL: https://svnweb.freebsd.org/changeset/base/351663 Log: ar: use more correct size_t type for loop index Submitted by: cem MFC after: 1 week Modified: head/usr.bin/ar/write.c Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Sun Sep 1 16:50:34 2019 (r351662) +++ head/usr.bin/ar/write.c Sun Sep 1 16:51:25 2019 (r351663) @@ -615,9 +615,9 @@ write_objs(struct bsdar *bsdar) size_t s_sz; /* size of archive symbol table. */ size_t pm_sz; /* size of pseudo members */ size_t w_sz; /* size of words in symbol table */ + size_t i; uint64_t nr; uint32_t nr32; - int i; if (elf_version(EV_CURRENT) == EV_NONE) bsdar_errc(bsdar, EX_SOFTWARE, 0, @@ -671,7 +671,7 @@ write_objs(struct bsdar *bsdar) bsdar->s_sn_sz; pm_sz += s_sz; /* Convert to big-endian. */ - for (i = 0; (size_t)i < bsdar->s_cnt; i++) + for (i = 0; i < bsdar->s_cnt; i++) bsdar->s_so[i] = htobe64(bsdar->s_so[i] + pm_sz); } else { @@ -679,7 +679,7 @@ write_objs(struct bsdar *bsdar) * Convert to big-endian and shuffle in-place to * the front of the allocation. XXX UB */ - for (i = 0; (size_t)i < bsdar->s_cnt; i++) + for (i = 0; i < bsdar->s_cnt; i++) ((uint32_t *)(bsdar->s_so))[i] = htobe32(bsdar->s_so[i] + pm_sz); } From owner-svn-src-head@freebsd.org Sun Sep 1 16:53:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFF74DEF2E; Sun, 1 Sep 2019 16:53:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Lzms5M82z4X2K; Sun, 1 Sep 2019 16:53:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C20C4964; Sun, 1 Sep 2019 16:53:17 +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 x81GrHjg022276; Sun, 1 Sep 2019 16:53:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81GrH2w022275; Sun, 1 Sep 2019 16:53:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909011653.x81GrH2w022275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 1 Sep 2019 16:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351664 - head/sys/dev/vnic X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/vnic X-SVN-Commit-Revision: 351664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 16:53:17 -0000 Author: emaste Date: Sun Sep 1 16:53:17 2019 New Revision: 351664 URL: https://svnweb.freebsd.org/changeset/base/351664 Log: vnic: correct and simplify SIOCSIFFLAGS PR: 223573, 223575 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13028 Modified: head/sys/dev/vnic/nicvf_main.c Modified: head/sys/dev/vnic/nicvf_main.c ============================================================================== --- head/sys/dev/vnic/nicvf_main.c Sun Sep 1 16:51:25 2019 (r351663) +++ head/sys/dev/vnic/nicvf_main.c Sun Sep 1 16:53:17 2019 (r351664) @@ -425,6 +425,7 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t struct nicvf *nic; struct rcv_queue *rq; struct ifreq *ifr; + uint32_t flags; int mask, err; int rq_idx; #if defined(INET) || defined(INET6) @@ -479,10 +480,10 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t break; case SIOCSIFFLAGS: NICVF_CORE_LOCK(nic); - if (if_getflags(ifp) & IFF_UP) { + flags = if_getflags(ifp); + if (flags & IFF_UP) { if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { - if ((nic->if_flags & if_getflags(ifp)) & - IFF_PROMISC) { + if ((flags ^ nic->if_flags) & IFF_PROMISC) { /* Change promiscous mode */ #if 0 /* ARM64TODO */ @@ -490,8 +491,7 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t #endif } - if ((nic->if_flags ^ if_getflags(ifp)) & - IFF_ALLMULTI) { + if ((flags ^ nic->if_flags) & IFF_ALLMULTI) { /* Change multicasting settings */ #if 0 /* ARM64TODO */ @@ -504,7 +504,7 @@ nicvf_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t } else if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) nicvf_stop_locked(nic); - nic->if_flags = if_getflags(ifp); + nic->if_flags = flags; NICVF_CORE_UNLOCK(nic); break; From owner-svn-src-head@freebsd.org Sun Sep 1 16:55:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95CA4DEFBB; Sun, 1 Sep 2019 16:55:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46LzqW3Rclz4X9d; Sun, 1 Sep 2019 16:55: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 552E7496E; Sun, 1 Sep 2019 16:55:35 +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 x81GtZLL022508; Sun, 1 Sep 2019 16:55:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81GtXdD022500; Sun, 1 Sep 2019 16:55:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909011655.x81GtXdD022500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 1 Sep 2019 16:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351665 - in head: sys/fs/msdosfs usr.sbin/makefs usr.sbin/makefs/msdos X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: sys/fs/msdosfs usr.sbin/makefs usr.sbin/makefs/msdos X-SVN-Commit-Revision: 351665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 16:55:35 -0000 Author: emaste Date: Sun Sep 1 16:55:33 2019 New Revision: 351665 URL: https://svnweb.freebsd.org/changeset/base/351665 Log: makefs: share msdosfsmount.h between kernel msdosfs and makefs Sponsored by: The FreeBSD Foundation Deleted: head/usr.sbin/makefs/msdos/msdosfsmount.h Modified: head/sys/fs/msdosfs/msdosfsmount.h head/usr.sbin/makefs/msdos.c head/usr.sbin/makefs/msdos/msdosfs_conv.c head/usr.sbin/makefs/msdos/msdosfs_denode.c head/usr.sbin/makefs/msdos/msdosfs_fat.c head/usr.sbin/makefs/msdos/msdosfs_lookup.c head/usr.sbin/makefs/msdos/msdosfs_vfsops.c head/usr.sbin/makefs/msdos/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/msdosfsmount.h ============================================================================== --- head/sys/fs/msdosfs/msdosfsmount.h Sun Sep 1 16:53:17 2019 (r351664) +++ head/sys/fs/msdosfs/msdosfsmount.h Sun Sep 1 16:55:33 2019 (r351665) @@ -53,7 +53,7 @@ #ifndef _MSDOSFS_MSDOSFSMOUNT_H_ #define _MSDOSFS_MSDOSFSMOUNT_H_ -#ifdef _KERNEL +#if defined (_KERNEL) || defined(MAKEFS) #include #include @@ -224,6 +224,7 @@ struct msdosfs_fileno { #endif /* _KERNEL */ +#ifndef MAKEFS /* * Arguments to mount MSDOS filesystems. */ @@ -241,6 +242,7 @@ struct msdosfs_args { char *cs_local; /* Local Charset */ mode_t dirmask; /* dir mask to be applied for msdosfs perms */ }; +#endif /* MAKEFS */ /* * Msdosfs mount options: Modified: head/usr.sbin/makefs/msdos.c ============================================================================== --- head/usr.sbin/makefs/msdos.c Sun Sep 1 16:53:17 2019 (r351664) +++ head/usr.sbin/makefs/msdos.c Sun Sep 1 16:55:33 2019 (r351665) @@ -63,9 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include "msdos/direntry.h" #include - - -#include "msdos/msdosfsmount.h" +#include static int msdos_populate_dir(const char *, struct denode *, fsnode *, fsnode *, fsinfo_t *); Modified: head/usr.sbin/makefs/msdos/msdosfs_conv.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_conv.c Sun Sep 1 16:53:17 2019 (r351664) +++ head/usr.sbin/makefs/msdos/msdosfs_conv.c Sun Sep 1 16:55:33 2019 (r351665) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include "msdos/direntry.h" -#include "msdos/msdosfsmount.h" +#include #include "makefs.h" #include "msdos.h" Modified: head/usr.sbin/makefs/msdos/msdosfs_denode.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_denode.c Sun Sep 1 16:53:17 2019 (r351664) +++ head/usr.sbin/makefs/msdos/msdosfs_denode.c Sun Sep 1 16:55:33 2019 (r351665) @@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include "msdos/msdosfsmount.h" +#include #include "makefs.h" #include "msdos.h" Modified: head/usr.sbin/makefs/msdos/msdosfs_fat.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_fat.c Sun Sep 1 16:53:17 2019 (r351664) +++ head/usr.sbin/makefs/msdos/msdosfs_fat.c Sun Sep 1 16:55:33 2019 (r351665) @@ -64,7 +64,7 @@ #include "msdos/direntry.h" #include #include -#include "msdos/msdosfsmount.h" +#include #include "makefs.h" #include "msdos.h" Modified: head/usr.sbin/makefs/msdos/msdosfs_lookup.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_lookup.c Sun Sep 1 16:53:17 2019 (r351664) +++ head/usr.sbin/makefs/msdos/msdosfs_lookup.c Sun Sep 1 16:55:33 2019 (r351665) @@ -61,7 +61,7 @@ #include "msdos/direntry.h" #include #include -#include "msdos/msdosfsmount.h" +#include #include "makefs.h" #include "msdos.h" Modified: head/usr.sbin/makefs/msdos/msdosfs_vfsops.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Sun Sep 1 16:53:17 2019 (r351664) +++ head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Sun Sep 1 16:55:33 2019 (r351665) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #include "msdos/direntry.h" #include #include -#include "msdos/msdosfsmount.h" +#include #include Modified: head/usr.sbin/makefs/msdos/msdosfs_vnops.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_vnops.c Sun Sep 1 16:53:17 2019 (r351664) +++ head/usr.sbin/makefs/msdos/msdosfs_vnops.c Sun Sep 1 16:55:33 2019 (r351665) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #include "msdos/direntry.h" #include #include -#include "msdos/msdosfsmount.h" +#include #include "makefs.h" #include "msdos.h" From owner-svn-src-head@freebsd.org Sun Sep 1 18:07:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5962AE0A20; Sun, 1 Sep 2019 18:07:08 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46M1Q32Flmz4bwf; Sun, 1 Sep 2019 18:07:06 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x429.google.com with SMTP id 26so5185062pfp.9; Sun, 01 Sep 2019 11:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=2Sg8Q4RHPqVnWr7IChs8WC/pCNLzKBqHw1zhOBBJgbE=; b=UCMa5wUUv54b8XA3/0JjtaZ5f+NmriJdl/sB1YwKzHAVbZrG5Tm80E2gHPTVGgC79Q VMEH7g1k247P4AFNbtw1c9DnyY86xV9A8GImsGgSPI2tsCjxECELFCttQDotnc61kSU0 HUPcWhyhK1jsrd/vg4QjHdpM53LU5nspRpQaEQgZZkCbxDzTL+BSd7PuVgs1xEb8IcGQ M6WQFt9eqTfzM6Msh0koJ4hcJSKRF21dWMv/XtyOol/hMHXY5hg+SrZ3NB1rziz1C0iF jYe+AK3PcFcQBlhzbDueLbZHpIhqQf+8DA5s4Yb9vyCGwB4kq6z2ptVCBAdZKcPh4R7Z +DDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=2Sg8Q4RHPqVnWr7IChs8WC/pCNLzKBqHw1zhOBBJgbE=; b=eXNKjaPy5VNqC2IGDKq182Q00zCxvaThzIOiFpnQV0rwXsPpVIZN9ZzUoyI+Q6pXAz eZuCwKimkNjYJ/owB5bFqXx4zcIk4hsnC6mikhrmLaKxM+aGgG4hQuHwk8MCKHoIE4h4 MFEAjFRUPS6CSgpD2LsKp5yypZZjMlhjJjUurV87ui9KdMhSATzdJBuzN8x10kVYjIJU RGDILpGPhRL3HWXWtYnliBRsUriTZXxP6uFo4dB94FtPdlxeWO3btifFcEEKgBoXw7vx JUvxOaHRVFDNfPqWNNyNut1hyQg8FMLfcRAuBdZTX8nn+VlmWNtFHvbFad5HBL8DIMAN QwrA== X-Gm-Message-State: APjAAAXVHvj6zhJ8YeetODBd3Lnsu/eexuXOSmuMXkw6rh6j6JCqTZpw jGIbqtjQxkxVK/3fnNVjbxdk478q+Xw= X-Google-Smtp-Source: APXvYqz5RZHq4+sahw95ENEB+iwuUmyJJfYnZGp0OmvH07KxXFGhxFRbXT8M4pVyrWz6wRRAe7ymiQ== X-Received: by 2002:a63:5a0a:: with SMTP id o10mr22256407pgb.282.1567361224896; Sun, 01 Sep 2019 11:07:04 -0700 (PDT) Received: from ?IPv6:2607:fb90:b2d7:b4b0:a1f5:e714:1d1e:dbe5? ([2607:fb90:b2d7:b4b0:a1f5:e714:1d1e:dbe5]) by smtp.gmail.com with ESMTPSA id v18sm2152733pfn.24.2019.09.01.11.07.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Sep 2019 11:07:03 -0700 (PDT) Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r351643 - in head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common: dtraceUtil speculation From: Enji Cooper X-Mailer: iPhone Mail (16G77) In-Reply-To: Date: Sun, 1 Sep 2019 11:07:01 -0700 Cc: "Conrad E. Meyer" , Li-Wen Hsu , src-committers , svn-src-all , svn-src-head Message-Id: References: <201908311441.x7VEfwZ3045957@repo.freebsd.org> To: Warner Losh X-Rspamd-Queue-Id: 46M1Q32Flmz4bwf X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=UCMa5wUU; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::429 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-3.49 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-8.20), ipnet: 2607:f8b0::/32(-2.83), asn: 15169(-2.31), country: US(-0.05)]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[9.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 18:07:08 -0000 > On Aug 31, 2019, at 16:29, Warner Losh wrote: >=20 >=20 >=20 >> On Sat, Aug 31, 2019 at 5:29 PM Conrad Meyer wrote: >> Thanks Li-Wen! Might it be less fragile to have the test fixture >> create a file, if the test(s) will expect one to be present to read? >=20 > Or just use the realpath $0, which you know has to exist :) I don=E2=80=99t know if this would work, with other some of the dtrace tests= are called. Plus, that relies on a FreeBSD utility which doesn=E2=80=99t ne= cessarily exist on Linux and I don=E2=80=99t think exists on IllumOS. It makes more sense to create a file with mktemp and test for it in the loop= to make the tests portable over to IllumOS, since that=E2=80=99s where they= originally came from and can be contributed back to. Thanks, -Enji= From owner-svn-src-head@freebsd.org Sun Sep 1 18:26:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FB7BE1126; Sun, 1 Sep 2019 18:26:22 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46M1rG1rcbz4cqQ; Sun, 1 Sep 2019 18:26:22 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2296559C1; Sun, 1 Sep 2019 18:26:22 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x81IQMY8076584; Sun, 1 Sep 2019 18:26:22 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81IQMUY076583; Sun, 1 Sep 2019 18:26:22 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201909011826.x81IQMUY076583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 1 Sep 2019 18:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351669 - head/stand/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/stand/powerpc/ofw X-SVN-Commit-Revision: 351669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 18:26:22 -0000 Author: bdragon Date: Sun Sep 1 18:26:21 2019 New Revision: 351669 URL: https://svnweb.freebsd.org/changeset/base/351669 Log: Move CAS check in powerpc64 ofw loader until after the PVR check. This unbreaks using the powerpc64 loader on a 32-bit processor. Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D21297 Modified: head/stand/powerpc/ofw/cas.c Modified: head/stand/powerpc/ofw/cas.c ============================================================================== --- head/stand/powerpc/ofw/cas.c Sun Sep 1 18:25:45 2019 (r351668) +++ head/stand/powerpc/ofw/cas.c Sun Sep 1 18:26:21 2019 (r351669) @@ -191,10 +191,6 @@ ppc64_cas(void) ihandle_t ihandle; cell_t err; - /* Skip CAS when running on PowerNV */ - if (!ppc64_hv()) - return (0); - /* Perform CAS only for POWER8 and later cores */ switch (mfpvr() & PVR_VER_MASK) { case PVR_VER_P8: @@ -205,6 +201,10 @@ ppc64_cas(void) default: return (0); } + + /* Skip CAS when running on PowerNV */ + if (!ppc64_hv()) + return (0); ihandle = OF_open("/"); if (ihandle == -1) { From owner-svn-src-head@freebsd.org Sun Sep 1 19:32:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91565E2D90; Sun, 1 Sep 2019 19:32:40 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46M3Jm0zmxz3F0T; Sun, 1 Sep 2019 19:32:39 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 4VaViogUiSrVc4VaXi7IEi; Sun, 01 Sep 2019 13:32:37 -0600 X-Authority-Analysis: v=2.3 cv=L5ZjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=J70Eh1EUuV4A:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=TOZmh0hOhYF69Vy31y0A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 0AD85500; Sun, 1 Sep 2019 12:32:35 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x81JWY0O004077; Sun, 1 Sep 2019 12:32:34 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x81JWYts004074; Sun, 1 Sep 2019 12:32:34 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201909011932.x81JWYts004074@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ed Maste cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio In-reply-to: <201909011612.x81GC5DW097846@repo.freebsd.org> References: <201909011612.x81GC5DW097846@repo.freebsd.org> Comments: In-reply-to Ed Maste message dated "Sun, 01 Sep 2019 16:12:05 -0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 01 Sep 2019 12:32:34 -0700 X-CMAE-Envelope: MS4wfMXqs23pQaEQcU0x4AUfkYc7tIKvTSQ04/3JU1OniiUVHt7M93RyrEuWFAxYnUNDAOsxi3lAhDstnabkX9QRA8E4JH4FtZmSWQuz+22hbvIEXxb1tVwQ lXfo+SVwFdyi3kPxgc+j6aFUAfFdBv1WO24ncApoq0j2UaF1LRlz3OXdrKhvuv6LF+LoDti4e0NnI3/GrsHVH2b5qtusxak1FRczJ/Zqn8ArturFXWzhIXLJ GfSwQ1/tXbl5SqzyD6wGE3YUb2T4OxrLoTgn2q1vrTenjGBBlYRKMpK8tUJUz2fM X-Rspamd-Queue-Id: 46M3Jm0zmxz3F0T X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 19:32:40 -0000 In message <201909011612.x81GC5DW097846@repo.freebsd.org>, Ed Maste writes: > Author: emaste > Date: Sun Sep 1 16:12:05 2019 > New Revision: 351659 > URL: https://svnweb.freebsd.org/changeset/base/351659 > > Log: > libc: remove gets > > gets is unsafe and shouldn't be used (for many years now). Leave it in > the existing symbol version so anything that previously linked aginst it > still runs, but do not allow new software to link against it. > > (The compatability/legacy implementation must not be static so that > the symbol and in particular the compat sym gets@FBSD_1.0 make it > into libc.) > > PR: 222796 (exp-run) > Reported by: Paul Vixie > Reviewed by: allanjude, cy, eadler, gnn, jhb, kib, ngie (some earlie > r) > Relnotes: Yes > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D12298 > > Modified: > head/contrib/libc++/include/cstdio > head/contrib/netbsd-tests/lib/libc/ssp/h_gets.c > head/gnu/lib/libssp/Makefile > head/include/stdio.h > head/lib/libc/stdio/fgets.3 > head/lib/libc/stdio/gets.c > head/lib/libc/stdio/stdio.3 Should we encourage the use of gets_s() in the man page or in other doc? This probably requires a __FreeBSD_version bump. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sun Sep 1 20:33:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3299BE43EA; Sun, 1 Sep 2019 20:33:51 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [18.222.6.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46M4gL1d6Gz3Hm2; Sun, 1 Sep 2019 20:33:49 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (unknown [18.188.142.31]) by mail.soaustin.net (Postfix) with ESMTPSA id 25AF323437; Sun, 1 Sep 2019 20:33:49 +0000 (UTC) Date: Sun, 1 Sep 2019 20:33:48 +0000 From: Mark Linimon To: Cy Schubert Cc: Ed Maste , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio Message-ID: <20190901203347.GA17364@lonesome.com> References: <201909011612.x81GC5DW097846@repo.freebsd.org> <201909011932.x81JWYts004074@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201909011932.x81JWYts004074@slippy.cwsent.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Rspamd-Queue-Id: 46M4gL1d6Gz3Hm2 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of linimon@lonesome.com has no SPF policy when checking 18.222.6.11) smtp.mailfrom=linimon@lonesome.com X-Spamd-Result: default: False [-1.31 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.958,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.15)[0.154,0]; IP_SCORE(-0.25)[ip: (0.03), ipnet: 18.220.0.0/14(0.14), asn: 16509(-1.36), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[lonesome.com]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-0.95)[-0.952,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[11.6.222.18.list.dnswl.org : 127.0.5.2]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16509, ipnet:18.220.0.0/14, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 20:33:51 -0000 On Sun, Sep 01, 2019 at 12:32:34PM -0700, Cy Schubert wrote: > This probably requires a __FreeBSD_version bump. Since it affects FreeBSD ports, yes, please. mcl From owner-svn-src-head@freebsd.org Sun Sep 1 21:12:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5D34E62DF; Sun, 1 Sep 2019 21:12:15 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46M5Wg5Fngz3MDZ; Sun, 1 Sep 2019 21:12:15 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f45.google.com with SMTP id b136so1248002iof.3; Sun, 01 Sep 2019 14:12:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=iB8ZWtNm7LVbmTxrXHxyHiQjRgroNaSdbiY5Vrukxzg=; b=tG6yxgX2otQf+/NlHwQ0swrHf7pG4w4svmV0wX/h76B7mfBZ6Dzg8PUvyNcEusGyCi MLqZGrTh4Y9LUyfMDhg8SMdIyJsHdSY8IUa4b+Wd0HAxYLNgPW/5WsKRALnuzSwYcWeL ZpV0tHInQ/AjpueAZwqk5VBifkm5rEW+W3tVGbPuwsXo+Ewg8BW+1AbI9l71K8E+1fYD W1YdxlhW5gaLtSYnmVIwqp0i/e0N1g09tedES2ccWJKFImM8Gn4bTwl07YPfdP3dwAN4 0ZRjJ+Aeory9o+IlT4AUDjHb0+BjhE5clzTgYEG5HBKJqvvpdWamdYdfso20xTcBkBL7 9TpA== X-Gm-Message-State: APjAAAW/eBND7pxZfdBe0WiJBh1sKNQzvQ1TeOCtqBE0ehSmb2lVPZS6 hlPPMdgY1ahwgAWzoGvQ+lnCsIXR X-Google-Smtp-Source: APXvYqyHbzBbX/h178mF2hZ7faJtMuxbfcHZ0UYRBQp5TKEbdPST9+sjSX5VQMqLHqDQASo+3wl2Hg== X-Received: by 2002:a5d:81ce:: with SMTP id t14mr9544070iol.97.1567372334177; Sun, 01 Sep 2019 14:12:14 -0700 (PDT) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com. [209.85.166.41]) by smtp.gmail.com with ESMTPSA id v12sm13819272ios.16.2019.09.01.14.12.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Sep 2019 14:12:13 -0700 (PDT) Received: by mail-io1-f41.google.com with SMTP id j4so25315925iog.11; Sun, 01 Sep 2019 14:12:13 -0700 (PDT) X-Received: by 2002:a5d:8f86:: with SMTP id l6mr2826243iol.270.1567372333725; Sun, 01 Sep 2019 14:12:13 -0700 (PDT) MIME-Version: 1.0 References: <201909011612.x81GC5DW097846@repo.freebsd.org> In-Reply-To: <201909011612.x81GC5DW097846@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 1 Sep 2019 14:12:02 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46M5Wg5Fngz3MDZ X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 21:12:15 -0000 On Sun, Sep 1, 2019 at 9:12 AM Ed Maste wrote: > > Author: emaste > Date: Sun Sep 1 16:12:05 2019 > New Revision: 351659 > URL: https://svnweb.freebsd.org/changeset/base/351659 > > Log: > libc: remove gets > > gets is unsafe and shouldn't be used (for many years now). Leave it in > the existing symbol version so anything that previously linked aginst it > still runs, but do not allow new software to link against it. > ... > Differential Revision: https://reviews.freebsd.org/D12298 Thanks, Ed! I think I saw someone mention some incarnation of standard C++ removes gets(), but to add context from the standard C side: it was present, but obsolete and deprecated, in C99; and was removed in C11. Best, Conrad From owner-svn-src-head@freebsd.org Sun Sep 1 21:12:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 659E5E6339; Sun, 1 Sep 2019 21:12:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46M5Wv4LSbz3MMb; Sun, 1 Sep 2019 21:12:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f49.google.com with SMTP id b136so1248475iof.3; Sun, 01 Sep 2019 14:12:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=ZuwUP04HEKnNPcZdMtZSZdOKzS2YB6kIJ5ufhi6c8gM=; b=p7UKD3TJPgsK3FfjNpCCy8fIRTSS67iU9MuYDaKY6bSr/SfDzCuG9S9G1k8rMH76yQ Ep1Mei/WZzi0jzUkqReF3gfPTIZQpAWDtH8qBCCiSmSLhIdgbx2mvnLGYVtZhLVmLNnJ gXqpRoc/3Mp6AiCWFP4CK7xYSchhOykJuFpJBELzbSemwuZTz9/qGP8hoCOKEy/9Tnrb MLM9466CRgG85qtBESaJB567WOr2WHklkjX3r6NRrbWzOyTk61nzrrPKN30X9+1qG9CB Iywh2vJz4ROheG0cnhNDdfTjGrXUXKIxX7TWPN6eb1DPh7AGCElc6Wv/Z49H9CiY/ZzR 5kPA== X-Gm-Message-State: APjAAAWQ717xjX7U43BK9wdnN6YtKbUHapZ1IM76QJF9KZcwWSP/WKs9 C6zvNCmXCX9u6bD3wRvjd2O1RpU4 X-Google-Smtp-Source: APXvYqxFfTl5/4hQwPRwN2n6bA6jC4OpWp0dV0N6D5MuDbnZBN4ZL/89amTw0SaMMSo3tUOy/kdZMw== X-Received: by 2002:a5d:8b47:: with SMTP id c7mr13015658iot.42.1567372346528; Sun, 01 Sep 2019 14:12:26 -0700 (PDT) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com. [209.85.166.46]) by smtp.gmail.com with ESMTPSA id q5sm10987122iot.5.2019.09.01.14.12.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Sep 2019 14:12:26 -0700 (PDT) Received: by mail-io1-f46.google.com with SMTP id f12so7869083iog.12; Sun, 01 Sep 2019 14:12:26 -0700 (PDT) X-Received: by 2002:a02:6d24:: with SMTP id m36mr28495390jac.87.1567372345968; Sun, 01 Sep 2019 14:12:25 -0700 (PDT) MIME-Version: 1.0 References: <201909011612.x81GC5DW097846@repo.freebsd.org> <201909011932.x81JWYts004074@slippy.cwsent.com> In-Reply-To: <201909011932.x81JWYts004074@slippy.cwsent.com> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 1 Sep 2019 14:12:14 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio To: Cy Schubert Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46M5Wv4LSbz3MMb X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.49 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-5.50 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; HAS_REPLYTO(0.00)[cem@freebsd.org]; REPLYTO_ADDR_EQ_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; RCVD_IN_DNSWL_NONE(0.00)[49.166.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; IP_SCORE(-2.51)[ip: (-6.87), ipnet: 209.85.128.0/17(-3.34), asn: 15169(-2.31), country: US(-0.05)]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 21:12:28 -0000 On Sun, Sep 1, 2019 at 12:32 PM Cy Schubert wrote: > > In message <201909011612.x81GC5DW097846@repo.freebsd.org>, Ed Maste writes: > > Author: emaste > > Date: Sun Sep 1 16:12:05 2019 > > New Revision: 351659 > > URL: https://svnweb.freebsd.org/changeset/base/351659 > > > > Log: > > libc: remove gets > > > > gets is unsafe and shouldn't be used (for many years now). Leave it in > > the existing symbol version so anything that previously linked aginst it > > still runs, but do not allow new software to link against it. > > > > (The compatability/legacy implementation must not be static so that > > the symbol and in particular the compat sym gets@FBSD_1.0 make it > > into libc.) > > > > PR: 222796 (exp-run) > > Reported by: Paul Vixie > > Reviewed by: allanjude, cy, eadler, gnn, jhb, kib, ngie (some earlie > > r) > > Relnotes: Yes > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D12298 > > > > Modified: > > head/contrib/libc++/include/cstdio > > head/contrib/netbsd-tests/lib/libc/ssp/h_gets.c > > head/gnu/lib/libssp/Makefile > > head/include/stdio.h > > head/lib/libc/stdio/fgets.3 > > head/lib/libc/stdio/gets.c > > head/lib/libc/stdio/stdio.3 > > Should we encourage the use of gets_s() in the man page or in other doc? > > This probably requires a __FreeBSD_version bump. > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > > From owner-svn-src-head@freebsd.org Sun Sep 1 21:13:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D16FFE63E3; Sun, 1 Sep 2019 21:13:12 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46M5Xm0pmvz3MVt; Sun, 1 Sep 2019 21:13:11 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f54.google.com with SMTP id x4so25267046iog.13; Sun, 01 Sep 2019 14:13:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=j4x2rkD/N2+/1BgDPVq+17uCfFU1QGqiw1oAL8bt258=; b=hpC5ZBuQBJBF0KT4CEFiRUQ9Ps8lKZjDmXESsi0RaTkj9IJ4QNwPVq2Spl9qaYW+Xa dH/ojxCZA1DM6z85jxpKOgYWhkUiMh751XYNZtm27Uv6F4LZrsRCjqw9HwGOm+1bFMxL KdaGebB0l2XcUlx9QX+qEdlqkrUuGAzWeWpxQaKJbXhM4s2ijpP232oXt4OfP3kRTor9 rdu0i3srlRuavFApxDhzEz1xWElUrPuwd2+/w9Oke1BZJl8GYSQlMLnrmJma3sSelvIe loU4Oeb6fgelo9Nel+mRsmrOhX1HeQ1/BMK0jg6jA//PWS3ay0iK4dCiPNV9bhaeXKZ6 iDxw== X-Gm-Message-State: APjAAAUv5o4EKgI2P4h4mOjRG2dRwAjjSAQ0Ydsw+LwAzQR4Fz/upuR9 TkhTYTqscn0w+J6WGxtXtyYr/HM7 X-Google-Smtp-Source: APXvYqz4v59EHlhW9RAwxxT1eAlzsi//HbMz1itDY27rY3/dEXFl4aOjHeMRzdPzpaGet6O/20Erzg== X-Received: by 2002:a6b:ea02:: with SMTP id m2mr19052325ioc.155.1567372390831; Sun, 01 Sep 2019 14:13:10 -0700 (PDT) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com. [209.85.166.42]) by smtp.gmail.com with ESMTPSA id c9sm10749928ioc.22.2019.09.01.14.13.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Sep 2019 14:13:10 -0700 (PDT) Received: by mail-io1-f42.google.com with SMTP id n197so23407620iod.9; Sun, 01 Sep 2019 14:13:10 -0700 (PDT) X-Received: by 2002:a5e:dc0b:: with SMTP id b11mr5088431iok.231.1567372390359; Sun, 01 Sep 2019 14:13:10 -0700 (PDT) MIME-Version: 1.0 References: <201909011612.x81GC5DW097846@repo.freebsd.org> <201909011932.x81JWYts004074@slippy.cwsent.com> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 1 Sep 2019 14:12:59 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio To: Cy Schubert Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46M5Xm0pmvz3MVt X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.54 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-5.41 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; HAS_REPLYTO(0.00)[cem@freebsd.org]; REPLYTO_ADDR_EQ_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; RCVD_IN_DNSWL_NONE(0.00)[54.166.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; IP_SCORE(-2.42)[ip: (-6.43), ipnet: 209.85.128.0/17(-3.34), asn: 15169(-2.31), country: US(-0.05)]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 21:13:12 -0000 Sorry. Accidentally hit send instead of clicking in the edit box. On Sun, Sep 1, 2019 at 2:12 PM Conrad Meyer wrote: > > On Sun, Sep 1, 2019 at 12:32 PM Cy Schubert wrote: > > > > In message <201909011612.x81GC5DW097846@repo.freebsd.org>, Ed Maste writes: > > > Author: emaste > > > Date: Sun Sep 1 16:12:05 2019 > > > New Revision: 351659 > > > URL: https://svnweb.freebsd.org/changeset/base/351659 > > > > > > Log: > > > libc: remove gets > > > > > > gets is unsafe and shouldn't be used (for many years now). Leave it in > > > the existing symbol version so anything that previously linked aginst it > > > still runs, but do not allow new software to link against it. > > > > > > (The compatability/legacy implementation must not be static so that > > > the symbol and in particular the compat sym gets@FBSD_1.0 make it > > > into libc.) > > > > > > PR: 222796 (exp-run) > > > Reported by: Paul Vixie > > > Reviewed by: allanjude, cy, eadler, gnn, jhb, kib, ngie (some earlie > > > r) > > > Relnotes: Yes > > > Sponsored by: The FreeBSD Foundation > > > Differential Revision: https://reviews.freebsd.org/D12298 > > > > > > Modified: > > > head/contrib/libc++/include/cstdio > > > head/contrib/netbsd-tests/lib/libc/ssp/h_gets.c > > > head/gnu/lib/libssp/Makefile > > > head/include/stdio.h > > > head/lib/libc/stdio/fgets.3 > > > head/lib/libc/stdio/gets.c > > > head/lib/libc/stdio/stdio.3 > > > > Should we encourage the use of gets_s() in the man page or in other doc? > > > > This probably requires a __FreeBSD_version bump. > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: http://www.FreeBSD.org > > > > The need of the many outweighs the greed of the few. > > > > > > From owner-svn-src-head@freebsd.org Sun Sep 1 21:20:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F420E6AFF; Sun, 1 Sep 2019 21:20:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46M5jD1PsQz3NHS; Sun, 1 Sep 2019 21:20:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1480179E2; Sun, 1 Sep 2019 21:20:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x81LKV6O081470; Sun, 1 Sep 2019 21:20:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81LKVoA081469; Sun, 1 Sep 2019 21:20:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909012120.x81LKVoA081469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 1 Sep 2019 21:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351671 - head/usr.bin/cpuset X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/cpuset X-SVN-Commit-Revision: 351671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 21:20:32 -0000 Author: markj Date: Sun Sep 1 21:20:31 2019 New Revision: 351671 URL: https://svnweb.freebsd.org/changeset/base/351671 Log: Fix an off-by-one bug in the CPU and domain ID parser. The "size" parameter is the size of the corresponding bit set, so the maximum CPU or domain index is size - 1. MFC after: 1 week Modified: head/usr.bin/cpuset/cpuset.c Modified: head/usr.bin/cpuset/cpuset.c ============================================================================== --- head/usr.bin/cpuset/cpuset.c Sun Sep 1 19:13:20 2019 (r351670) +++ head/usr.bin/cpuset/cpuset.c Sun Sep 1 21:20:31 2019 (r351671) @@ -100,10 +100,10 @@ parselist(char *list, struct bitset *mask, int size) for (l = list; *l != '\0';) { if (isdigit(*l)) { curnum = atoi(l); - if (curnum > size) + if (curnum >= size) errx(EXIT_FAILURE, "List entry %d exceeds maximum of %d", - curnum, size); + curnum, size - 1); while (isdigit(*l)) l++; switch (state) { From owner-svn-src-head@freebsd.org Sun Sep 1 21:21:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D744AE6B97; Sun, 1 Sep 2019 21:21:11 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46M5jz0jgYz3NSD; Sun, 1 Sep 2019 21:21:11 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f50.google.com with SMTP id f12so7890781iog.12; Sun, 01 Sep 2019 14:21:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=5geMK8kQB+Dao9cLdhgzYCsC+V39SzGs0BXFUvNNNWg=; b=hE0ikXdHAooBXR0/MEKzLti5lFDAKPDBCEgkB3weFdlN90+UB6hn3E3qMQVbO1i1Op mS7+CmKOp3XuLXmBBx8/xf9O/Nddr5Kfl5IG3Ov2yNiZgvvMLu9NREk8XhKFgibrRrXU E/BNWqKX8a0u0DveEk+6G8LNP9LVs0j01/vW27iPiM6+glRSYq0p+/DB7SPD0Z7jW6Rl tDvaQdodSA0trKAIJwPjmqgNpjxRQDoP1gRXdc9pl46t5JwTErMOgs3cuaMd3mFRZbmO A3Fe3nfeyEWt32z3eib3A1BlStRfPRdpj68c1codxTAdkSNYbFBqDnBR8SdXgAsNbfZL Cb1g== X-Gm-Message-State: APjAAAVn1SePwej/3S8mXSiyDl2fmGcyOBMJda4acbCsJP8BBTX66ccr Ely4FJX+xsFhW4aJA7uGd2p3Brb8 X-Google-Smtp-Source: APXvYqxyQ3E6j/ZactvTC9Pp9boCxcYhIWEGCHDmrXvdvxeqw4fIfct6q+82Zsp0nWqx1IYRS45WDA== X-Received: by 2002:a05:6602:25d5:: with SMTP id d21mr29419314iop.177.1567372869827; Sun, 01 Sep 2019 14:21:09 -0700 (PDT) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com. [209.85.166.46]) by smtp.gmail.com with ESMTPSA id t3sm8018175iom.54.2019.09.01.14.21.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Sep 2019 14:21:09 -0700 (PDT) Received: by mail-io1-f46.google.com with SMTP id j4so25338439iog.11; Sun, 01 Sep 2019 14:21:09 -0700 (PDT) X-Received: by 2002:a5e:dc0b:: with SMTP id b11mr5112270iok.231.1567372869275; Sun, 01 Sep 2019 14:21:09 -0700 (PDT) MIME-Version: 1.0 References: <201909011612.x81GC5DW097846@repo.freebsd.org> <201909011932.x81JWYts004074@slippy.cwsent.com> In-Reply-To: <201909011932.x81JWYts004074@slippy.cwsent.com> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 1 Sep 2019 14:20:58 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio To: Cy Schubert Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46M5jz0jgYz3NSD X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.50 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-5.50 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; HAS_REPLYTO(0.00)[cem@freebsd.org]; REPLYTO_ADDR_EQ_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; RCVD_IN_DNSWL_NONE(0.00)[50.166.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; IP_SCORE(-2.52)[ip: (-6.89), ipnet: 209.85.128.0/17(-3.34), asn: 15169(-2.31), country: US(-0.05)]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 21:21:11 -0000 On Sun, Sep 1, 2019 at 12:32 PM Cy Schubert wrote: > In message <201909011612.x81GC5DW097846@repo.freebsd.org>, Ed Maste writes: > > Author: emaste > > Date: Sun Sep 1 16:12:05 2019 > > New Revision: 351659 > > URL: https://svnweb.freebsd.org/changeset/base/351659 > > > > Log: > > libc: remove gets > > ... > > Should we encourage the use of gets_s() in the man page or in other doc? Hi Cy, Short version: no, we shouldn't. :-) Longer version: Annex K functions like gets_s have zero real adoption (Microsoft's APIs that inspired Annex K are not actually compatible with the version in the standards); broadly terrible APIs; and in this particular case and others, unnecessarily duplicate the functionality of existing long-standing standard C functions (e.g., fgets(3)). Also, it's been a *long* time since gets(3) was known to be extremely broken and rejected by -D_FORTIFY_SOURCE and friends; at least twenty years just going by the C99 standard. I don't think developers need an advisory about using alternatives to gets(3) at this point in time. Best, Conrad From owner-svn-src-head@freebsd.org Sun Sep 1 21:38:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F38DE717E; Sun, 1 Sep 2019 21:38:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46M65Y0SjVz3PCt; Sun, 1 Sep 2019 21:38:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E88E87D65; Sun, 1 Sep 2019 21:38:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x81Lc8bS093266; Sun, 1 Sep 2019 21:38:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81Lc8in093265; Sun, 1 Sep 2019 21:38:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909012138.x81Lc8in093265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 1 Sep 2019 21:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351672 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 351672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 21:38:09 -0000 Author: markj Date: Sun Sep 1 21:38:08 2019 New Revision: 351672 URL: https://svnweb.freebsd.org/changeset/base/351672 Log: Restrict the input domain set in cpuset_setdomain(2) to all_domains. To permit larger values of MAXMEMDOM, which is currently 8 on amd64, cpuset_setdomain(2) accepts a mask of size 256. In the kernel, domain set masks are 64 bits wide, but can only represent a set of MAXMEMDOM domains due to the use of the ds_order table. Domain sets passed to cpuset_setdomain(2) are restricted to a subset of their parent set, which is typically the root set, but before this happens we modify the input set to exclude empty domains. domainset_empty_vm() and other code which manipulates domain sets expect the mask to be a subset of all_domains, so enforce that when performing validation of cpuset_setdomain(2) parameters. Reported and tested by: pho Reviewed by: kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21477 Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Sun Sep 1 21:20:31 2019 (r351671) +++ head/sys/kern/kern_cpuset.c Sun Sep 1 21:38:08 2019 (r351672) @@ -2156,6 +2156,14 @@ kern_cpuset_setdomain(struct thread *td, cpulevel_t le DOMAINSET_COPY(mask, &domain.ds_mask); domain.ds_policy = policy; + /* + * Sanitize the provided mask. + */ + if (!DOMAINSET_SUBSET(&all_domains, &domain.ds_mask)) { + error = EINVAL; + goto out; + } + /* Translate preferred policy into a mask and fallback. */ if (policy == DOMAINSET_POLICY_PREFER) { /* Only support a single preferred domain. */ @@ -2165,12 +2173,12 @@ kern_cpuset_setdomain(struct thread *td, cpulevel_t le } domain.ds_prefer = DOMAINSET_FFS(&domain.ds_mask) - 1; /* This will be constrained by domainset_shadow(). */ - DOMAINSET_FILL(&domain.ds_mask); + DOMAINSET_COPY(&all_domains, &domain.ds_mask); } /* - * When given an impossible policy, fall back to interleaving - * across all domains + * When given an impossible policy, fall back to interleaving + * across all domains. */ if (domainset_empty_vm(&domain)) domainset_copy(&domainset2, &domain); From owner-svn-src-head@freebsd.org Sun Sep 1 22:22:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C58E7C81DD; Sun, 1 Sep 2019 22:22:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46M7515YCqz3R5d; Sun, 1 Sep 2019 22:22:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2F40868D; Sun, 1 Sep 2019 22:22:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x81MMjYT022473; Sun, 1 Sep 2019 22:22:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x81MMh0F022462; Sun, 1 Sep 2019 22:22:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909012222.x81MMh0F022462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 1 Sep 2019 22:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351673 - in head: lib/libmemstat share/man/man9 sys/cddl/compat/opensolaris/kern sys/kern sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: lib/libmemstat share/man/man9 sys/cddl/compat/opensolaris/kern sys/kern sys/vm X-SVN-Commit-Revision: 351673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 22:22:45 -0000 Author: markj Date: Sun Sep 1 22:22:43 2019 New Revision: 351673 URL: https://svnweb.freebsd.org/changeset/base/351673 Log: Extend uma_reclaim() to permit different reclamation targets. The page daemon periodically invokes uma_reclaim() to reclaim cached items from each zone when the system is under memory pressure. This is important since the size of these caches is unbounded by default. However it also results in bursts of high latency when allocating from heavily used zones as threads miss in the per-CPU caches and must access the keg in order to allocate new items. With r340405 we maintain an estimate of each zone's usage of its (per-NUMA domain) cache of full buckets. Start making use of this estimate to avoid reclaiming the entire cache when under memory pressure. In particular, introduce TRIM, DRAIN and DRAIN_CPU verbs for uma_reclaim() and uma_zone_reclaim(). When trimming, only items in excess of the estimate are reclaimed. Draining a zone reclaims all of the cached full buckets (the previous behaviour of uma_reclaim()), and may further drain the per-CPU caches in extreme cases. Now, when under memory pressure, the page daemon will trim zones rather than draining them. As a result, heavily used zones do not incur bursts of bucket cache misses following reclamation, but large, unused caches will be reclaimed as before. Reviewed by: jeff Tested by: pho (an earlier version) MFC after: 2 months Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D16667 Modified: head/lib/libmemstat/memstat_uma.c head/share/man/man9/Makefile head/share/man/man9/zone.9 head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c head/sys/kern/kern_mbuf.c head/sys/kern/subr_vmem.c head/sys/kern/vfs_subr.c head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h head/sys/vm/vm_pageout.c Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Sun Sep 1 21:38:08 2019 (r351672) +++ head/lib/libmemstat/memstat_uma.c Sun Sep 1 22:22:43 2019 (r351673) @@ -474,9 +474,9 @@ skip_percpu: ret = kread(kvm, &uz.uz_domain[i], &uzd, sizeof(uzd), 0); for (ubp = - LIST_FIRST(&uzd.uzd_buckets); + TAILQ_FIRST(&uzd.uzd_buckets); ubp != NULL; - ubp = LIST_NEXT(&ub, ub_link)) { + ubp = TAILQ_NEXT(&ub, ub_link)) { ret = kread(kvm, ubp, &ub, sizeof(ub), 0); mtp->mt_zonefree += ub.ub_cnt; Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Sep 1 21:38:08 2019 (r351672) +++ head/share/man/man9/Makefile Sun Sep 1 22:22:43 2019 (r351673) @@ -2281,6 +2281,8 @@ MLINKS+=vrele.9 vput.9 \ vrele.9 vunref.9 MLINKS+=vslock.9 vsunlock.9 MLINKS+=zone.9 uma.9 \ + zone.9 uma_prealloc.9 \ + zone.9 uma_reclaim.9 \ zone.9 uma_zalloc.9 \ zone.9 uma_zalloc_arg.9 \ zone.9 uma_zalloc_domain.9 \ @@ -2296,7 +2298,7 @@ MLINKS+=zone.9 uma.9 \ zone.9 uma_zfree_pcpu_arg.9 \ zone.9 uma_zone_get_cur.9 \ zone.9 uma_zone_get_max.9 \ - zone.9 uma_zone_prealloc.9 \ + zone.9 uma_zone_reclaim.9 \ zone.9 uma_zone_reserve.9 \ zone.9 uma_zone_reserve_kva.9 \ zone.9 uma_zone_set_allocf.9 \ Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Sun Sep 1 21:38:08 2019 (r351672) +++ head/share/man/man9/zone.9 Sun Sep 1 22:22:43 2019 (r351673) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 30, 2019 +.Dd September 1, 2019 .Dt UMA 9 .Os .Sh NAME @@ -98,6 +98,10 @@ typedef void (*uma_free)(void *item, vm_size_t size, u .Ft void .Fn uma_zone_reserve_kva "uma_zone_t zone" "int nitems" .Ft void +.Fn uma_reclaim "int req" +.Ft void +.Fn uma_zone_reclaim "uma_zone_t zone" "int req" +.Ft void .Fn uma_zone_set_allocf "uma_zone_t zone" "uma_alloc allocf" .Ft void .Fn uma_zone_set_freef "uma_zone_t zone" "uma_free freef" @@ -436,6 +440,32 @@ Note that unlike does not restrict the use of the pre-allocation to .Dv M_USE_RESERVE requests. +.Pp +The +.Fn uma_reclaim +and +.Fn uma_zone_reclaim +functions reclaim cached items from UMA zones, releasing unused memory. +The +.Fn uma_reclaim +function reclaims items from all regular zones, while +.Fn uma_zone_reclaim +reclaims items only from the specified zone. +The +.Fa req +parameter must be one of three values which specify how aggressively +items are to be reclaimed: +.Bl -tag -width indent +.It Dv UMA_RECLAIM_TRIM +Reclaim items only in excess of the zone's estimated working set size. +The working set size is periodically updated and tracks the recent history +of the zone's usage. +.It Dv UMA_RECLAIM_DRAIN +Reclaim all items from the unbounded cache. +Free items in the per-CPU caches are left alone. +.It Dv UMA_RECLAIM_DRAIN_CPU +Reclaim all cached items. +.El .Pp The .Fn uma_zone_set_allocf Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Sun Sep 1 21:38:08 2019 (r351672) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Sun Sep 1 22:22:43 2019 (r351673) @@ -238,14 +238,14 @@ void kmem_cache_reap_soon(kmem_cache_t *cache) { #ifndef KMEM_DEBUG - zone_drain(cache->kc_zone); + uma_zone_reclaim(cache->kc_zone, UMA_RECLAIM_DRAIN); #endif } void kmem_reap(void) { - uma_reclaim(); + uma_reclaim(UMA_RECLAIM_TRIM); } #else void Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sun Sep 1 21:38:08 2019 (r351672) +++ head/sys/kern/kern_mbuf.c Sun Sep 1 22:22:43 2019 (r351673) @@ -711,14 +711,14 @@ mb_dtor_pack(void *mem, int size, void *arg) #endif /* * If there are processes blocked on zone_clust, waiting for pages - * to be freed up, * cause them to be woken up by draining the - * packet zone. We are exposed to a race here * (in the check for + * to be freed up, cause them to be woken up by draining the + * packet zone. We are exposed to a race here (in the check for * the UMA_ZFLAG_FULL) where we might miss the flag set, but that * is deliberate. We don't want to acquire the zone lock for every * mbuf free. */ if (uma_zone_exhausted_nolock(zone_clust)) - zone_drain(zone_pack); + uma_zone_reclaim(zone_pack, UMA_RECLAIM_DRAIN); } /* @@ -1362,7 +1362,7 @@ m_clget(struct mbuf *m, int how) * we might be able to loosen a few clusters up on the drain. */ if ((how & M_NOWAIT) && (m->m_ext.ext_buf == NULL)) { - zone_drain(zone_pack); + uma_zone_reclaim(zone_pack, UMA_RECLAIM_DRAIN); uma_zalloc_arg(zone_clust, m, how); } MBUF_PROBE2(m__clget, m, how); Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Sun Sep 1 21:38:08 2019 (r351672) +++ head/sys/kern/subr_vmem.c Sun Sep 1 22:22:43 2019 (r351673) @@ -588,7 +588,7 @@ qc_drain(vmem_t *vm) qcache_idx_max = vm->vm_qcache_max >> vm->vm_quantum_shift; for (i = 0; i < qcache_idx_max; i++) - zone_drain(vm->vm_qcache[i].qc_cache); + uma_zone_reclaim(vm->vm_qcache[i].qc_cache, UMA_RECLAIM_DRAIN); } #ifndef UMA_MD_SMALL_ALLOC Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Sep 1 21:38:08 2019 (r351672) +++ head/sys/kern/vfs_subr.c Sun Sep 1 22:22:43 2019 (r351673) @@ -1321,7 +1321,7 @@ vnlru_proc(void) } mtx_unlock(&mountlist_mtx); if (onumvnodes > desiredvnodes && numvnodes <= desiredvnodes) - uma_reclaim(); + uma_reclaim(UMA_RECLAIM_DRAIN); if (done == 0) { if (force == 0 || force == 1) { force = 2; Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Sun Sep 1 21:38:08 2019 (r351672) +++ head/sys/vm/uma.h Sun Sep 1 22:22:43 2019 (r351673) @@ -50,8 +50,6 @@ struct uma_zone; /* Opaque type used as a handle to the zone */ typedef struct uma_zone * uma_zone_t; -void zone_drain(uma_zone_t); - /* * Item constructor * @@ -438,17 +436,18 @@ typedef void *(*uma_alloc)(uma_zone_t zone, vm_size_t typedef void (*uma_free)(void *item, vm_size_t size, uint8_t pflag); /* - * Reclaims unused memory for all zones + * Reclaims unused memory * * Arguments: - * None + * req Reclamation request type. * Returns: * None - * - * This should only be called by the page out daemon. */ - -void uma_reclaim(void); +#define UMA_RECLAIM_DRAIN 1 /* release bucket cache */ +#define UMA_RECLAIM_DRAIN_CPU 2 /* release bucket and per-CPU caches */ +#define UMA_RECLAIM_TRIM 3 /* trim bucket cache to WSS */ +void uma_reclaim(int req); +void uma_zone_reclaim(uma_zone_t, int req); /* * Sets the alignment mask to be used for all zones requesting cache Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sun Sep 1 21:38:08 2019 (r351672) +++ head/sys/vm/uma_core.c Sun Sep 1 22:22:43 2019 (r351673) @@ -142,7 +142,7 @@ static struct rwlock_padalign __exclusive_cache_line u static char *bootmem; static int boot_pages; -static struct sx uma_drain_lock; +static struct sx uma_reclaim_lock; /* * kmem soft limit, initialized by uma_set_limit(). Ensure that early @@ -250,7 +250,7 @@ static void pcpu_page_free(void *, vm_size_t, uint8_t) static uma_slab_t keg_alloc_slab(uma_keg_t, uma_zone_t, int, int, int); static void cache_drain(uma_zone_t); static void bucket_drain(uma_zone_t, uma_bucket_t); -static void bucket_cache_drain(uma_zone_t zone); +static void bucket_cache_reclaim(uma_zone_t zone, bool); static int keg_ctor(void *, int, void *, int); static void keg_dtor(void *, int, void *); static int zone_ctor(void *, int, void *, int); @@ -467,27 +467,36 @@ bucket_zone_drain(void) struct uma_bucket_zone *ubz; for (ubz = &bucket_zones[0]; ubz->ubz_entries != 0; ubz++) - zone_drain(ubz->ubz_zone); + uma_zone_reclaim(ubz->ubz_zone, UMA_RECLAIM_DRAIN); } +/* + * Attempt to satisfy an allocation by retrieving a full bucket from one of the + * zone's caches. + */ static uma_bucket_t -zone_try_fetch_bucket(uma_zone_t zone, uma_zone_domain_t zdom, const bool ws) +zone_fetch_bucket(uma_zone_t zone, uma_zone_domain_t zdom) { uma_bucket_t bucket; ZONE_LOCK_ASSERT(zone); - if ((bucket = LIST_FIRST(&zdom->uzd_buckets)) != NULL) { + if ((bucket = TAILQ_FIRST(&zdom->uzd_buckets)) != NULL) { MPASS(zdom->uzd_nitems >= bucket->ub_cnt); - LIST_REMOVE(bucket, ub_link); + TAILQ_REMOVE(&zdom->uzd_buckets, bucket, ub_link); zdom->uzd_nitems -= bucket->ub_cnt; - if (ws && zdom->uzd_imin > zdom->uzd_nitems) + if (zdom->uzd_imin > zdom->uzd_nitems) zdom->uzd_imin = zdom->uzd_nitems; zone->uz_bkt_count -= bucket->ub_cnt; } return (bucket); } +/* + * Insert a full bucket into the specified cache. The "ws" parameter indicates + * whether the bucket's contents should be counted as part of the zone's working + * set. + */ static void zone_put_bucket(uma_zone_t zone, uma_zone_domain_t zdom, uma_bucket_t bucket, const bool ws) @@ -497,7 +506,10 @@ zone_put_bucket(uma_zone_t zone, uma_zone_domain_t zdo KASSERT(zone->uz_bkt_count < zone->uz_bkt_max, ("%s: zone %p overflow", __func__, zone)); - LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); + if (ws) + TAILQ_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link); + else + TAILQ_INSERT_TAIL(&zdom->uzd_buckets, bucket, ub_link); zdom->uzd_nitems += bucket->ub_cnt; if (ws && zdom->uzd_imax < zdom->uzd_nitems) zdom->uzd_imax = zdom->uzd_nitems; @@ -558,7 +570,7 @@ zone_domain_update_wss(uma_zone_domain_t zdom) MPASS(zdom->uzd_imax >= zdom->uzd_imin); wss = zdom->uzd_imax - zdom->uzd_imin; zdom->uzd_imax = zdom->uzd_imin = zdom->uzd_nitems; - zdom->uzd_wss = (3 * wss + 2 * zdom->uzd_wss) / 5; + zdom->uzd_wss = (4 * wss + zdom->uzd_wss) / 5; } /* @@ -609,11 +621,12 @@ zone_timeout(uma_zone_t zone) return; } } + KEG_UNLOCK(keg); + ZONE_LOCK(zone); for (int i = 0; i < vm_ndomains; i++) zone_domain_update_wss(&zone->uz_domain[i]); - - KEG_UNLOCK(keg); + ZONE_UNLOCK(zone); } /* @@ -777,7 +790,7 @@ cache_drain(uma_zone_t zone) * XXX: It would good to be able to assert that the zone is being * torn down to prevent improper use of cache_drain(). * - * XXX: We lock the zone before passing into bucket_cache_drain() as + * XXX: We lock the zone before passing into bucket_cache_reclaim() as * it is used elsewhere. Should the tear-down path be made special * there in some form? */ @@ -797,7 +810,7 @@ cache_drain(uma_zone_t zone) cache->uc_crossbucket = NULL; } ZONE_LOCK(zone); - bucket_cache_drain(zone); + bucket_cache_reclaim(zone, true); ZONE_UNLOCK(zone); } @@ -869,7 +882,7 @@ cache_drain_safe_cpu(uma_zone_t zone) * Zone lock must not be held on call this function. */ static void -cache_drain_safe(uma_zone_t zone) +pcpu_cache_drain_safe(uma_zone_t zone) { int cpu; @@ -897,22 +910,46 @@ cache_drain_safe(uma_zone_t zone) } /* - * Drain the cached buckets from a zone. Expects a locked zone on entry. + * Reclaim cached buckets from a zone. All buckets are reclaimed if the caller + * requested a drain, otherwise the per-domain caches are trimmed to either + * estimated working set size. */ static void -bucket_cache_drain(uma_zone_t zone) +bucket_cache_reclaim(uma_zone_t zone, bool drain) { uma_zone_domain_t zdom; uma_bucket_t bucket; + long target, tofree; int i; - /* - * Drain the bucket queues and free the buckets. - */ for (i = 0; i < vm_ndomains; i++) { zdom = &zone->uz_domain[i]; - while ((bucket = zone_try_fetch_bucket(zone, zdom, false)) != - NULL) { + + /* + * If we were asked to drain the zone, we are done only once + * this bucket cache is empty. Otherwise, we reclaim items in + * excess of the zone's estimated working set size. If the + * difference nitems - imin is larger than the WSS estimate, + * then the estimate will grow at the end of this interval and + * we ignore the historical average. + */ + target = drain ? 0 : lmax(zdom->uzd_wss, zdom->uzd_nitems - + zdom->uzd_imin); + while (zdom->uzd_nitems > target) { + bucket = TAILQ_LAST(&zdom->uzd_buckets, uma_bucketlist); + if (bucket == NULL) + break; + tofree = bucket->ub_cnt; + TAILQ_REMOVE(&zdom->uzd_buckets, bucket, ub_link); + zdom->uzd_nitems -= tofree; + + /* + * Shift the bounds of the current WSS interval to avoid + * perturbing the estimate. + */ + zdom->uzd_imax -= lmin(zdom->uzd_imax, tofree); + zdom->uzd_imin -= lmin(zdom->uzd_imin, tofree); + ZONE_UNLOCK(zone); bucket_drain(zone, bucket); bucket_free(zone, bucket, NULL); @@ -921,8 +958,8 @@ bucket_cache_drain(uma_zone_t zone) } /* - * Shrink further bucket sizes. Price of single zone lock collision - * is probably lower then price of global cache drain. + * Shrink the zone bucket size to ensure that the per-CPU caches + * don't grow too large. */ if (zone->uz_count > zone->uz_count_min) zone->uz_count--; @@ -1020,7 +1057,7 @@ finished: } static void -zone_drain_wait(uma_zone_t zone, int waitok) +zone_reclaim(uma_zone_t zone, int waitok, bool drain) { /* @@ -1030,14 +1067,15 @@ zone_drain_wait(uma_zone_t zone, int waitok) * when it wakes up. */ ZONE_LOCK(zone); - while (zone->uz_flags & UMA_ZFLAG_DRAINING) { + while (zone->uz_flags & UMA_ZFLAG_RECLAIMING) { if (waitok == M_NOWAIT) goto out; msleep(zone, zone->uz_lockptr, PVM, "zonedrain", 1); } - zone->uz_flags |= UMA_ZFLAG_DRAINING; - bucket_cache_drain(zone); + zone->uz_flags |= UMA_ZFLAG_RECLAIMING; + bucket_cache_reclaim(zone, drain); ZONE_UNLOCK(zone); + /* * The DRAINING flag protects us from being freed while * we're running. Normally the uma_rwlock would protect us but we @@ -1045,19 +1083,26 @@ zone_drain_wait(uma_zone_t zone, int waitok) */ keg_drain(zone->uz_keg); ZONE_LOCK(zone); - zone->uz_flags &= ~UMA_ZFLAG_DRAINING; + zone->uz_flags &= ~UMA_ZFLAG_RECLAIMING; wakeup(zone); out: ZONE_UNLOCK(zone); } -void +static void zone_drain(uma_zone_t zone) { - zone_drain_wait(zone, M_NOWAIT); + zone_reclaim(zone, M_NOWAIT, true); } +static void +zone_trim(uma_zone_t zone) +{ + + zone_reclaim(zone, M_NOWAIT, false); +} + /* * Allocate a new slab for a keg. This does not insert the slab onto a list. * If the allocation was successful, the keg lock will be held upon return, @@ -1756,6 +1801,7 @@ zone_ctor(void *mem, int size, void *udata, int flags) uma_zone_t zone = mem; uma_zone_t z; uma_keg_t keg; + int i; bzero(zone, size); zone->uz_name = arg->name; @@ -1783,6 +1829,9 @@ zone_ctor(void *mem, int size, void *udata, int flags) zone->uz_fails = EARLY_COUNTER; } + for (i = 0; i < vm_ndomains; i++) + TAILQ_INIT(&zone->uz_domain[i].uzd_buckets); + /* * This is a pure cache zone, no kegs. */ @@ -1933,7 +1982,7 @@ zone_dtor(void *arg, int size, void *udata) * released and then refilled before we * remove it... we dont care for now */ - zone_drain_wait(zone, M_WAITOK); + zone_reclaim(zone, M_WAITOK, true); /* * We only destroy kegs from non secondary/non cache zones. */ @@ -2138,7 +2187,7 @@ uma_startup2(void) printf("Entering %s with %d boot pages left\n", __func__, boot_pages); #endif booted = BOOT_BUCKETS; - sx_init(&uma_drain_lock, "umadrain"); + sx_init(&uma_reclaim_lock, "umareclaim"); bucket_enable(); } @@ -2233,12 +2282,12 @@ uma_zcreate(const char *name, size_t size, uma_ctor ct if (booted < BOOT_BUCKETS) { locked = false; } else { - sx_slock(&uma_drain_lock); + sx_slock(&uma_reclaim_lock); locked = true; } res = zone_alloc_item(zones, &args, UMA_ANYDOMAIN, M_WAITOK); if (locked) - sx_sunlock(&uma_drain_lock); + sx_sunlock(&uma_reclaim_lock); return (res); } @@ -2267,13 +2316,13 @@ uma_zsecond_create(char *name, uma_ctor ctor, uma_dtor if (booted < BOOT_BUCKETS) { locked = false; } else { - sx_slock(&uma_drain_lock); + sx_slock(&uma_reclaim_lock); locked = true; } /* XXX Attaches only one keg of potentially many. */ res = zone_alloc_item(zones, &args, UMA_ANYDOMAIN, M_WAITOK); if (locked) - sx_sunlock(&uma_drain_lock); + sx_sunlock(&uma_reclaim_lock); return (res); } @@ -2306,9 +2355,9 @@ void uma_zdestroy(uma_zone_t zone) { - sx_slock(&uma_drain_lock); + sx_slock(&uma_reclaim_lock); zone_free_item(zones, zone, NULL, SKIP_NONE); - sx_sunlock(&uma_drain_lock); + sx_sunlock(&uma_reclaim_lock); } void @@ -2521,7 +2570,7 @@ zalloc_start: zdom = &zone->uz_domain[0]; } - if ((bucket = zone_try_fetch_bucket(zone, zdom, true)) != NULL) { + if ((bucket = zone_fetch_bucket(zone, zdom)) != NULL) { KASSERT(bucket->ub_cnt != 0, ("uma_zalloc_arg: Returning an empty bucket.")); cache->uc_allocbucket = bucket; @@ -3672,17 +3721,28 @@ uma_prealloc(uma_zone_t zone, int items) } /* See uma.h */ -static void -uma_reclaim_locked(bool kmem_danger) +void +uma_reclaim(int req) { CTR0(KTR_UMA, "UMA: vm asked us to release pages!"); - sx_assert(&uma_drain_lock, SA_XLOCKED); + sx_xlock(&uma_reclaim_lock); bucket_enable(); - zone_foreach(zone_drain); - if (vm_page_count_min() || kmem_danger) { - cache_drain_safe(NULL); + + switch (req) { + case UMA_RECLAIM_TRIM: + zone_foreach(zone_trim); + break; + case UMA_RECLAIM_DRAIN: + case UMA_RECLAIM_DRAIN_CPU: zone_foreach(zone_drain); + if (req == UMA_RECLAIM_DRAIN_CPU) { + pcpu_cache_drain_safe(NULL); + zone_foreach(zone_drain); + } + break; + default: + panic("unhandled reclamation request %d", req); } /* @@ -3692,17 +3752,9 @@ uma_reclaim_locked(bool kmem_danger) */ zone_drain(slabzone); bucket_zone_drain(); + sx_xunlock(&uma_reclaim_lock); } -void -uma_reclaim(void) -{ - - sx_xlock(&uma_drain_lock); - uma_reclaim_locked(false); - sx_xunlock(&uma_drain_lock); -} - static volatile int uma_reclaim_needed; void @@ -3718,18 +3770,37 @@ uma_reclaim_worker(void *arg __unused) { for (;;) { - sx_xlock(&uma_drain_lock); + sx_xlock(&uma_reclaim_lock); while (atomic_load_int(&uma_reclaim_needed) == 0) - sx_sleep(uma_reclaim, &uma_drain_lock, PVM, "umarcl", + sx_sleep(uma_reclaim, &uma_reclaim_lock, PVM, "umarcl", hz); - sx_xunlock(&uma_drain_lock); + sx_xunlock(&uma_reclaim_lock); EVENTHANDLER_INVOKE(vm_lowmem, VM_LOW_KMEM); - sx_xlock(&uma_drain_lock); - uma_reclaim_locked(true); + uma_reclaim(UMA_RECLAIM_DRAIN_CPU); atomic_store_int(&uma_reclaim_needed, 0); - sx_xunlock(&uma_drain_lock); /* Don't fire more than once per-second. */ pause("umarclslp", hz); + } +} + +/* See uma.h */ +void +uma_zone_reclaim(uma_zone_t zone, int req) +{ + + switch (req) { + case UMA_RECLAIM_TRIM: + zone_trim(zone); + break; + case UMA_RECLAIM_DRAIN: + zone_drain(zone); + break; + case UMA_RECLAIM_DRAIN_CPU: + pcpu_cache_drain_safe(zone); + zone_drain(zone); + break; + default: + panic("unhandled reclamation request %d", req); } } Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Sun Sep 1 21:38:08 2019 (r351672) +++ head/sys/vm/uma_int.h Sun Sep 1 22:22:43 2019 (r351673) @@ -197,7 +197,7 @@ struct uma_hash { */ struct uma_bucket { - LIST_ENTRY(uma_bucket) ub_link; /* Link into the zone */ + TAILQ_ENTRY(uma_bucket) ub_link; /* Link into the zone */ int16_t ub_cnt; /* Count of items in bucket. */ int16_t ub_entries; /* Max items. */ void *ub_bucket[]; /* actual allocation storage */ @@ -306,8 +306,10 @@ struct uma_slab { typedef struct uma_slab * uma_slab_t; +TAILQ_HEAD(uma_bucketlist, uma_bucket); + struct uma_zone_domain { - LIST_HEAD(,uma_bucket) uzd_buckets; /* full buckets */ + struct uma_bucketlist uzd_buckets; /* full buckets */ long uzd_nitems; /* total item count */ long uzd_imax; /* maximum item count this period */ long uzd_imin; /* minimum item count this period */ @@ -384,7 +386,7 @@ struct uma_zone { * These flags must not overlap with the UMA_ZONE flags specified in uma.h. */ #define UMA_ZFLAG_CACHE 0x04000000 /* uma_zcache_create()d it */ -#define UMA_ZFLAG_DRAINING 0x08000000 /* Running zone_drain. */ +#define UMA_ZFLAG_RECLAIMING 0x08000000 /* Running zone_reclaim(). */ #define UMA_ZFLAG_BUCKET 0x10000000 /* Bucket zone. */ #define UMA_ZFLAG_INTERNAL 0x20000000 /* No offpage no PCPU. */ #define UMA_ZFLAG_CACHEONLY 0x80000000 /* Don't ask VM for buckets. */ Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sun Sep 1 21:38:08 2019 (r351672) +++ head/sys/vm/vm_pageout.c Sun Sep 1 22:22:43 2019 (r351673) @@ -1871,9 +1871,12 @@ vm_pageout_lowmem(void) /* * We do this explicitly after the caches have been - * drained above. + * drained above. If we have a severe page shortage on + * our hands, completely drain all UMA zones. Otherwise, + * just prune the caches. */ - uma_reclaim(); + uma_reclaim(vm_page_count_min() ? UMA_RECLAIM_DRAIN_CPU : + UMA_RECLAIM_TRIM); return (true); } return (false); From owner-svn-src-head@freebsd.org Sun Sep 1 22:23:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EA8DC8275; Sun, 1 Sep 2019 22:23:14 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46M75Y4k3vz3RF4; Sun, 1 Sep 2019 22:23:13 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 4YFZib1yAUIS24YFai9N2C; Sun, 01 Sep 2019 16:23:11 -0600 X-Authority-Analysis: v=2.3 cv=N41X6F1B c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=J70Eh1EUuV4A:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=2QSLavsyAAAA:8 a=3JZJobP_s7psWMEtP5AA:9 a=CjuIK1q_8ugA:10 a=UJ0tAi3fqDAA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=9H_80fVQ3bbXSWzY4Kdq:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=jd6J4Gguk5HxikPWLKER:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 74AA473F; Sun, 1 Sep 2019 15:23:07 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x81MN7aP005970; Sun, 1 Sep 2019 15:23:07 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x81MN7jK005967; Sun, 1 Sep 2019 15:23:07 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201909012223.x81MN7jK005967@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: cem@freebsd.org cc: Cy Schubert , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio In-reply-to: References: <201909011612.x81GC5DW097846@repo.freebsd.org> <201909011932.x81JWYts004074@slippy.cwsent.com> Comments: In-reply-to Conrad Meyer message dated "Sun, 01 Sep 2019 14:20:58 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 01 Sep 2019 15:23:07 -0700 X-CMAE-Envelope: MS4wfL26JoVKDNHjvoab91s1STefOGHY25ZCMZkcfA7rb5i0JC/JzSYhMtHgWlnL/cZushTkr5T0BGEggn37Uilu47K/qYPYam7qDzQ7d/bqxpYIBCGZt7Ue C3lAA6iPHQbqKcGnaqXZATfooNcBSNSxOvVdx9gBt7W6+inaXYR4J809FAqP/rN+llD4E6iJBnDPninP8/nJKEM6+Ra7vxQwPXNJwqEUQ5/wXEMgKuW1ASRG cPjWbIjO3r8u4hg8v1KtXC7aln8SWVV7KpSyFZ3bv0zTSPamb53ePXb3pQJ3E1Wg X-Rspamd-Queue-Id: 46M75Y4k3vz3RF4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Sep 2019 22:23:14 -0000 In message , Conrad Meyer writes: > On Sun, Sep 1, 2019 at 12:32 PM Cy Schubert wrote > : > > In message <201909011612.x81GC5DW097846@repo.freebsd.org>, Ed Maste writes: > > > Author: emaste > > > Date: Sun Sep 1 16:12:05 2019 > > > New Revision: 351659 > > > URL: https://svnweb.freebsd.org/changeset/base/351659 > > > > > > Log: > > > libc: remove gets > > > ... > > > > Should we encourage the use of gets_s() in the man page or in other doc? > > Hi Cy, > > Short version: no, we shouldn't. :-) > > Longer version: Annex K functions like gets_s have zero real adoption > (Microsoft's APIs that inspired Annex K are not actually compatible > with the version in the standards); broadly terrible APIs; and in this > particular case and others, unnecessarily duplicate the functionality > of existing long-standing standard C functions (e.g., fgets(3)). That's not quite true. From the man page: The gets_s() function is equivalent to fgets() with a stream of stdin, except that the newline character (if any) is not stored in the string. See: https://en.cppreference.com/w/c/io/gets https://en.cppreference.com/w/c/io/fgets Some apps may be sensitive to this subtle difference. gets_s() preserves this behaviour. > > Also, it's been a *long* time since gets(3) was known to be extremely > broken and rejected by -D_FORTIFY_SOURCE and friends; at least twenty > years just going by the C99 standard. I don't think developers need > an advisory about using alternatives to gets(3) at this point in time. It's not an advisory to highlight the _s function. They are part of the standard and though we support some _s functions it would behoove us to one day (*) support them all. I'm also sure some ports will probably break. Encouraging the use of gets_s() over fgets() due to this difference may avoid bugs in software that rely in the subtle difference. * One day doesn't mean we do it tomorrow but over time is desireable. > > Best, > Conrad -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Mon Sep 2 00:29:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BCFCCB5B6; Mon, 2 Sep 2019 00:29:26 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46M9v83tmsz42fc; Mon, 2 Sep 2019 00:29:24 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92 (FreeBSD)) (envelope-from ) id 1i4aDc-0006iO-QU; Sun, 01 Sep 2019 17:29:17 -0700 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id x820TGdJ025815; Sun, 1 Sep 2019 17:29:16 -0700 (PDT) (envelope-from gonzo@bluezbox.com) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@bluezbox.com using -f Date: Sun, 1 Sep 2019 17:29:16 -0700 From: Oleksandr Tymoshenko To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351616 - head/sys/dev/usb/net Message-ID: <20190902002916.GA25603@bluezbox.com> References: <201908300005.x7U055YI057385@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201908300005.x7U055YI057385@repo.freebsd.org> X-Operating-System: FreeBSD/11.2-RELEASE-p10 (amd64) User-Agent: Mutt/1.12.1 (2019-06-15) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Gleb Smirnoff (glebius@FreeBSD.org) wrote: > Author: glebius > Date: Fri Aug 30 00:05:04 2019 > New Revision: 351616 > URL: https://svnweb.freebsd.org/changeset/base/351616 > > Log: > Use mbuf queue i [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Rspamd-Queue-Id: 46M9v83tmsz42fc X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of gonzo@bluezbox.com designates 45.55.20.155 as permitted sender) smtp.mailfrom=gonzo@bluezbox.com X-Spamd-Result: default: False [-5.48 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[bluezbox.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.24)[ip: (-8.41), ipnet: 45.55.0.0/19(-4.20), asn: 14061(1.44), country: US(-0.05)]; NEURAL_HAM_SHORT(-0.94)[-0.936,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:14061, ipnet:45.55.0.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 00:29:26 -0000 Gleb Smirnoff (glebius@FreeBSD.org) wrote: > Author: glebius > Date: Fri Aug 30 00:05:04 2019 > New Revision: 351616 > URL: https://svnweb.freebsd.org/changeset/base/351616 > > Log: > Use mbuf queue instead of ifqueue in USB network drivers. Hi Gleb, This change broke NFS root on RPi. I suspect it's not just NFS root but USB ethernet functionality in general. Patch below fixes it for me. The same patch probably should also be applied to if_axe and if_axge. Index: sys/dev/usb/net/usb_ethernet.c =================================================================== --- sys/dev/usb/net/usb_ethernet.c (revision 351673) +++ sys/dev/usb/net/usb_ethernet.c (working copy) @@ -219,6 +219,7 @@ ue->ue_unit = alloc_unr(ueunit); usb_callout_init_mtx(&ue->ue_watchdog, ue->ue_mtx, 0); sysctl_ctx_init(&ue->ue_sysctl_ctx); + mbufq_init(&ue->ue_rxq, ifqmaxlen); error = 0; CURVNET_SET_QUIET(vnet0); @@ -330,6 +331,9 @@ /* free sysctl */ sysctl_ctx_free(&ue->ue_sysctl_ctx); + /* drain mbuf queue */ + mbufq_drain(&ue->ue_rxq); + /* free unit */ free_unr(ueunit, ue->ue_unit); } From owner-svn-src-head@freebsd.org Mon Sep 2 00:38:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6641CBB42; Mon, 2 Sep 2019 00:38:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MB535PvXz43Q7; Mon, 2 Sep 2019 00:37:59 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f53.google.com with SMTP id d25so23370691iob.6; Sun, 01 Sep 2019 17:37:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=ei3QaA6s06OJ92IO/j5C+VMM0RTCVlQV1PvI1PcMBgE=; b=KD0ri9DCznik0StD28nrkiYcq1jHDPi2Rm2MAYUyLCPvHq1xQlehOP7X1g/zIM1SAh lEN7fVB/kpLZU0a3EQoM9h8JekOCBzW97fqWdN7+MyPWrqwsfcHwWXz17C2t8j1DMH7e PxBjJLVA0djGMoRgM6YK3Y3if7Nt5rEcG6sZaug3T3xyNWA736zi+J6ip51nxDxNhPZr LbNWcSKoZXljhw8r9/2EGgPAP4zrxKq7KHa9bZ3GLeJSDmeMkNS7+9TtxdG6HGhYiKQD QBFhpb0fk+D940q3Vln6msqpL9CzsPS+Rh1KkOLu6bJU+bVUUf1pU+4fjazU2Shy9ezF P5dw== X-Gm-Message-State: APjAAAV/KkVV3MY7yrK/BexI8oAGTCsnfEDez1Pze+9ltub3ZJrmxCO4 t/pZdwjOMZaA/ibqSduyFvucthTP X-Google-Smtp-Source: APXvYqxnKQ8sULferXkEvzI5vAS203iBasHX3NKJEH0Y5/py65EdJNAHfIlInoaxv+YTWh0+0aaUsA== X-Received: by 2002:a02:698d:: with SMTP id e135mr1165001jac.128.1567384678109; Sun, 01 Sep 2019 17:37:58 -0700 (PDT) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com. [209.85.166.43]) by smtp.gmail.com with ESMTPSA id k66sm4580859iof.25.2019.09.01.17.37.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Sep 2019 17:37:57 -0700 (PDT) Received: by mail-io1-f43.google.com with SMTP id b136so1763768iof.3; Sun, 01 Sep 2019 17:37:57 -0700 (PDT) X-Received: by 2002:a5e:8d0a:: with SMTP id m10mr313413ioj.231.1567384677562; Sun, 01 Sep 2019 17:37:57 -0700 (PDT) MIME-Version: 1.0 References: <201909011612.x81GC5DW097846@repo.freebsd.org> <201909011932.x81JWYts004074@slippy.cwsent.com> <201909012223.x81MN7jK005967@slippy.cwsent.com> In-Reply-To: <201909012223.x81MN7jK005967@slippy.cwsent.com> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 1 Sep 2019 17:37:46 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio To: Cy Schubert Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 46MB535PvXz43Q7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.53 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-4.74 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[53.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.75)[ip: (-3.05), ipnet: 209.85.128.0/17(-3.34), asn: 15169(-2.31), country: US(-0.05)]; RWL_MAILSPIKE_POSSIBLE(0.00)[53.166.85.209.rep.mailspike.net : 127.0.0.17]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 00:38:00 -0000 Hi Cy, On Sun, Sep 1, 2019 at 3:23 PM Cy Schubert wrot= e: > > In message om> > , Conrad Meyer writes: > > > Short version: no, we shouldn't [recommend the use of gets_s]. :-) > > > > Longer version: Annex K functions like gets_s have zero real adoption > > (Microsoft's APIs that inspired Annex K are not actually compatible > > with the version in the standards); broadly terrible APIs; and in this > > particular case and others, unnecessarily duplicate the functionality > > of existing long-standing standard C functions (e.g., fgets(3)). > > That's not quite true. From the man page: > > The gets_s() function is equivalent to fgets() with a stream of stdi= n, > except that the newline character (if any) is not stored in the stri= ng. I tried to make a distinction earlier that I don't think carried well over email. I wrote "unnecessarily duplicate(s) the _functionality_ of existing =E2=80=A6" =E2=80=94 not "is/are an exact duplicate(s) of =E2= =80=A6" =E2=80=94 because you're right, gets_s() has (trivial) behavioral differences from fgets(stdin). The thing that is important to me is that fgets(3) is portable, super well understood, and provides a superset of the functionality of gets_s(). One can easily construct the newline-free version of a line from one containing a trailing newline. I don't think this slight behavioral difference justifies implementing, using, or especially recommending gets_s(). (IMO, it was probably a historical mistake that gets(3) even had different behavior than fgets(3) to begin with. gets(3) maybe predated stdio FILE streams?) > Some apps may be sensitive to this subtle difference. gets_s() preserves > this behaviour. Correct conversion of gets()-using programs requires more analysis than blind replacement with either function. Anyway, gets() use is largely behind us so the point is mostly moot =E2=80= =94 there are few such programs to convert, and they should be viewed with an extremely high level of skepticism given they are still using gets(3) in 2019. > [Annex K functions] are part of the > standard They're an optional part of the standard. Everyone takes the option of "not." Literally no one implements Annex K. It's a bad set of APIs. > and though we support some _s functions it would behoove us to one > day (*) support them all. If and when the C standard committee adopts Annex K as a required part of the standard, then I agree we should make every attempt to support the full standard library. But in general, I am opposed to the further adoption of Annex K, and hope the C2x standard committee finally drops the annex.[1] (It is weakly defended[2], just to provide a counterargument.) [1]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1967.htm (pro-remova= l) [2]: https://www.nccgroup.trust/us/our-research/bounds-checking-interfaces-= field-experience-and-future-directions/ (pro-retention) > I'm also sure some ports will probably break. Check the exp-run PR: 222796 (comment #7). 13 ports. Out of 37601, according to FreshPorts. Of those 13, eight don't have a maintainer. Best, Conrad From owner-svn-src-head@freebsd.org Mon Sep 2 01:55:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D75FCDB0C; Mon, 2 Sep 2019 01:55:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MCq01N6Mz46w7; Mon, 2 Sep 2019 01:55:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F1BFAC1A; Mon, 2 Sep 2019 01:55:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x821ttft046888; Mon, 2 Sep 2019 01:55:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x821ttkN046887; Mon, 2 Sep 2019 01:55:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909020155.x821ttkN046887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 2 Sep 2019 01:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351681 - in head: lib/libc/mips sys/mips/include X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libc/mips sys/mips/include X-SVN-Commit-Revision: 351681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 01:55:56 -0000 Author: kevans Date: Mon Sep 2 01:55:55 2019 New Revision: 351681 URL: https://svnweb.freebsd.org/changeset/base/351681 Log: mips: fix some mcount nits The symbol version for _mcount was removed 12 years ago in r169525 from gmon/Symbol.map, to be added to the per-arch Symbol.map. mips was overlooked in this, so _mcount has no symver. Add it back to where it should have been, rather than where it would go if it were added today, since we're correcting a historical mistake. Additionally, _mcount is getting thrown into .mdebug.abi32 in the llvm80/90 world as it's not getting explicitly thrown into .text, so do this now. This fixes the libc build that was previously failing due to relocations in .mdebug.abi32. This is specifically due to the way clang's integrated AS works and that they emit the .mdebug.abiNN section early in the process. An LLVM bug has been submitted[0] and an agreement has been made that the mips backend should switch to .text following .mdebug.abiNN for compatibility. [0] https://bugs.llvm.org/show_bug.cgi?id=43119 Reviewed by: imp, arichardson MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21435 Modified: head/lib/libc/mips/Symbol.map head/sys/mips/include/profile.h Modified: head/lib/libc/mips/Symbol.map ============================================================================== --- head/lib/libc/mips/Symbol.map Mon Sep 2 00:39:02 2019 (r351680) +++ head/lib/libc/mips/Symbol.map Mon Sep 2 01:55:55 2019 (r351681) @@ -11,6 +11,7 @@ FBSD_1.0 { /* PSEUDO syscalls */ _exit; + _mcount; _setjmp; _longjmp; alloca; Modified: head/sys/mips/include/profile.h ============================================================================== --- head/sys/mips/include/profile.h Mon Sep 2 00:39:02 2019 (r351680) +++ head/sys/mips/include/profile.h Mon Sep 2 01:55:55 2019 (r351681) @@ -46,7 +46,8 @@ /*XXX This is not MIPS64 safe. */ #define MCOUNT \ - __asm(".globl _mcount;" \ + __asm(".text;" \ + ".globl _mcount;" \ ".type _mcount,@function;" \ "_mcount:;" \ ".set noreorder;" \ From owner-svn-src-head@freebsd.org Mon Sep 2 03:37:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52FE9CF6C0; Mon, 2 Sep 2019 03:37:00 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MG3b6KZHz4BWw; Mon, 2 Sep 2019 03:36:59 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 4d9CirVEJSrVc4d9Di8Fgv; Sun, 01 Sep 2019 21:36:57 -0600 X-Authority-Analysis: v=2.3 cv=L5ZjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=8nJEP1OIZ-IA:10 a=J70Eh1EUuV4A:10 a=YxBL1-UpAAAA:8 a=yMhMjlubAAAA:8 a=b4LDLZbEAAAA:8 a=2QSLavsyAAAA:8 a=Emiy2d7DAAAA:8 a=6I5d2MoRAAAA:8 a=J4G2wu7WuvlaZFd2yzQA:9 a=zBj13n3wTMEUmnW8:21 a=6qRUqZAYaaJLL5BX:21 a=wPNLvfGTeEIA:10 a=vo8O1AnaVrUA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=20T61YgZp4ItGotXEy2O:22 a=9H_80fVQ3bbXSWzY4Kdq:22 a=CSRsq1W5fP6ztJawIKk6:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id AE64B909; Sun, 1 Sep 2019 20:36:53 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x823argI054347; Sun, 1 Sep 2019 20:36:53 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x823ar42054344; Sun, 1 Sep 2019 20:36:53 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201909020336.x823ar42054344@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: cem@freebsd.org cc: Cy Schubert , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio In-reply-to: References: <201909011612.x81GC5DW097846@repo.freebsd.org> <201909011932.x81JWYts004074@slippy.cwsent.com> <201909012223.x81MN7jK005967@slippy.cwsent.com> Comments: In-reply-to Conrad Meyer message dated "Sun, 01 Sep 2019 17:37:46 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Sun, 01 Sep 2019 20:36:53 -0700 X-CMAE-Envelope: MS4wfETTE7OED3fVH8s5LJiNnTkjQLvjfd/+uRm+S0uRNLEV8C87VjiZTQhZP8eJ5K1S/F7SVcycC2RJrU5u6q1tvZIzt1mRXrTeSq7R/USbUkyiGHhCy6Tt csknD2p2SFoPk4ZcpjhL208bUxReC5p1CAdhNQdhhi5gU1btVt5swYZZlvG9F2men5haBpXnholJyaSRTtAJ2NOOwzNLRx5s2WqYgF/oZpfKSA+Hjvo3Goq8 8BMqklRrbNeY0P0RC29HDxD9ZKUtZ7YoVA4+QWxSPRoK/MR/Vd0oJEesgemkmN+m X-Rspamd-Queue-Id: 46MG3b6KZHz4BWw X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 03:37:00 -0000 In message , Conrad Meyer writes: > Hi Cy, > > On Sun, Sep 1, 2019 at 3:23 PM Cy Schubert wrote: > > > > In message c > > om> > > , Conrad Meyer writes: > > > > > Short version: no, we shouldn't [recommend the use of gets_s]. :-) > > > > > > Longer version: Annex K functions like gets_s have zero real adoption > > > (Microsoft's APIs that inspired Annex K are not actually compatible > > > with the version in the standards); broadly terrible APIs; and in this > > > particular case and others, unnecessarily duplicate the functionality > > > of existing long-standing standard C functions (e.g., fgets(3)). > > > > That's not quite true. From the man page: > > > > The gets_s() function is equivalent to fgets() with a stream of stdin, > > except that the newline character (if any) is not stored in the string > . > > I tried to make a distinction earlier that I don't think carried well > over email. I wrote "unnecessarily duplicate(s) the _functionality_ > of existing …" — not "is/are an exact duplicate(s) of …" — because > you're right, gets_s() has (trivial) behavioral differences from > fgets(stdin). > > The thing that is important to me is that fgets(3) is portable, super > well understood, and provides a superset of the functionality of > gets_s(). One can easily construct the newline-free version of a line > from one containing a trailing newline. I don't think this slight > behavioral difference justifies implementing, using, or especially > recommending gets_s(). If Microsoft chooses to ignore or anotherfunctions is their problem. However in this case, according to the following they do support gets_s(). https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/gets-s-getw s-s?view=vs-2019 Having said all that, glibc is the odd man out here. In that case I'll pull back my horns. It's sufficient not to not say anything or to highlight both. BTW. we've had gets_s(3) in our tree for 17 months now. We don't need to add anything. It's already there. It is an application developer choice to use one function or another. As someone who also works on the ports side, the newline is significant distinction. As gets_s() is closer in function to gets() than fgets() is, all one needs to concern oneself with is buffer length. As there are no _other_ differences nothing else needs to be addressed. This is important to ports maintainers and who must replace gets() with something else. Agreed this shouldn't be an issue every time but gets_s() is still in our toolbox. > > (IMO, it was probably a historical mistake that gets(3) even had > different behavior than fgets(3) to begin with. gets(3) maybe > predated stdio FILE streams?) I totally agree. > > > Some apps may be sensitive to this subtle difference. gets_s() preserves > > this behaviour. > > Correct conversion of gets()-using programs requires more analysis > than blind replacement with either function. That's where gets_s() is handy. It requires less analysis. Remember, my main concern here are our ports maintainers. Upstream developers should always do analysis. It's not the job of the ports team to perform significant rewrites of upstream software. IMO, if upsteam software needs significant rewrite a port maintainer should notify the upstream maintainer. If the upstream cannot or will not, requiring a maintainer of a port to make significant changes, DEPRECATED= and EXPIRATION_DATE= are the best answer. We are not here to rewrite other people's software for them. > > Anyway, gets() use is largely behind us so the point is mostly moot — > there are few such programs to convert, and they should be viewed with > an extremely high level of skepticism given they are still using > gets(3) in 2019. I'm not arguing for keeping gets(3). We already have gets_s(3). Let's use it where it makes sense. Nor am I saying to use it in exclusion of fgets(3). It (gets_s()) is in our libc. If it eases the job of maintaining a port, use it instead. > > > [Annex K functions] are part of the > > standard > > They're an optional part of the standard. Everyone takes the option > of "not." Literally no one implements Annex K. It's a bad set of > APIs. Microsoft and we have chosen to implement some Annex K functions. We haven't implemented all of them. I don't know if they implemented all _s functions. Linux glibc has not. I don't agree that it's a completely bad set of APIs. gets_s() will help ports maintainers. AFAIK, no ports rely on gets() but that's not to say some new port might not. Don't forget, my motivation for implementing gets_s(3) in libc was to ease the pain of deprecating gets() for ports. > > > and though we support some _s functions it would behoove us to one > > day (*) support them all. > > If and when the C standard committee adopts Annex K as a required part > of the standard, then I agree we should make every attempt to support > the full standard library. But in general, I am opposed to the > further adoption of Annex K, and hope the C2x standard committee > finally drops the annex.[1] (It is weakly defended[2], just to > provide a counterargument.) Again I disagree. > > [1]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1967.htm (pro-removal) This explains glibc's not implementing the _s functions. His focus is almost entirely on string copy and memory copy functions. Implementation of string and memory copy functions would be more complex than the gets_s() I added to FreeBSD. In terms of error detection (for calls to constraint handlers), gets_s() is simple compared to strcpy_s(). I can understand his issues. It would appear a similar lack of consideration of implementation details went into defining the _s string functions as the lack of consistency considerations went into the development of gets() and fgets(). https://en.cppreference.com/w/c/string/byte/strcpy, where clobbring the rest of the destination is IMO "not optimal." Throwing out the baby (functions which were properly defined) with the bath water (functions which make one wonder what they were smoking) isn't the right answer either. > [2]: https://www.nccgroup.trust/us/our-research/bounds-checking-interfaces-fi > eld-experience-and-future-directions/ > (pro-retention) I don't have time to read completely through all of this tonight. The assertion that there are unfounded criticisms as well as actual flaws. The flaws are such that replacing some functions with _s will require some care. Fortunately with gets_s() this is not a concern, except of course having to specify a buffer length. A constraint handler is not required. IMO constraint handlers add unnecessary complexity, good thing they are optional. > > > I'm also sure some ports will probably break. > > Check the exp-run PR: 222796 (comment #7). 13 ports. Out of 37601, > according to FreshPorts. Of those 13, eight don't have a maintainer. Already did. Should someone choose to fix them we the tools are there. I doubt you will convince me nor I convince you. I'm not sure if you or anyone else has a copy of the standard. (I suspect you already have these but maybe someone else might find them useful.) http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3631.pdf > > Best, > Conrad > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Mon Sep 2 08:03:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5806D5C34; Mon, 2 Sep 2019 08:03:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MMz54NB5z4Pmg; Mon, 2 Sep 2019 08:03:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AAE9F130; Mon, 2 Sep 2019 08:03:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8283Tuf067815; Mon, 2 Sep 2019 08:03:29 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8283T7t067814; Mon, 2 Sep 2019 08:03:29 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201909020803.x8283T7t067814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 2 Sep 2019 08:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351690 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 351690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 08:03:29 -0000 Author: brooks Date: Mon Sep 2 08:03:29 2019 New Revision: 351690 URL: https://svnweb.freebsd.org/changeset/base/351690 Log: Remove remnants of optimization for > pagesize allocations. In the past, this allocator seems to have allocated things larger than a page seperately. Much of this code was removed at some point (perhaps along with sbrk() used) so remove the rest. Instead, keep allocating in power-of-two bins up to FIRST_BUCKET_SIZE << (NBUCKETS - 1). If we want something more efficent, we should use a fancier allocator. While here, remove some vestages of sbrk() use. Most importantly, don't try to page align the pagepool since it's always page aligned by mmap(). Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D21453 Modified: head/libexec/rtld-elf/rtld_malloc.c Modified: head/libexec/rtld-elf/rtld_malloc.c ============================================================================== --- head/libexec/rtld-elf/rtld_malloc.c Mon Sep 2 08:02:55 2019 (r351689) +++ head/libexec/rtld-elf/rtld_malloc.c Mon Sep 2 08:03:29 2019 (r351690) @@ -89,15 +89,15 @@ static int morepages(int n); #define MAGIC 0xef /* magic # on accounting info */ /* - * nextf[i] is the pointer to the next free block of size 2^(i+3). The - * smallest allocatable block is 8 bytes. The overhead information - * precedes the data area returned to the user. + * nextf[i] is the pointer to the next free block of size + * (FIRST_BUCKET_SIZE << i). The overhead information precedes the data + * area returned to the user. */ +#define FIRST_BUCKET_SIZE 8 #define NBUCKETS 30 static union overhead *nextf[NBUCKETS]; static int pagesz; /* page size */ -static int pagebucket; /* page size bucket */ /* * The array of supported page sizes is provided by the user, i.e., the @@ -112,50 +112,25 @@ __crt_malloc(size_t nbytes) { union overhead *op; int bucket; - ssize_t n; size_t amt; /* - * First time malloc is called, setup page size and - * align break pointer so all data will be page aligned. + * First time malloc is called, setup page size. */ - if (pagesz == 0) { - pagesz = n = pagesizes[0]; - if (morepages(NPOOLPAGES) == 0) - return NULL; - op = (union overhead *)(pagepool_start); - n = n - sizeof (*op) - ((long)op & (n - 1)); - if (n < 0) - n += pagesz; - if (n) { - pagepool_start += n; - } - bucket = 0; - amt = 8; - while ((unsigned)pagesz > amt) { - amt <<= 1; - bucket++; - } - pagebucket = bucket; - } + if (pagesz == 0) + pagesz = pagesizes[0]; /* * Convert amount of memory requested into closest block size * stored in hash buckets which satisfies request. * Account for space used per block for accounting. */ - if (nbytes <= (unsigned long)(n = pagesz - sizeof(*op))) { - amt = 8; /* size of first bucket */ - bucket = 0; - n = -sizeof(*op); - } else { - amt = pagesz; - bucket = pagebucket; - } - while (nbytes > amt + n) { + amt = FIRST_BUCKET_SIZE; + bucket = 0; + while (nbytes > amt - sizeof(*op)) { amt <<= 1; - if (amt == 0) - return (NULL); bucket++; + if (amt == 0 || bucket >= NBUCKETS) + return (NULL); } /* * If nothing in hash bucket right now, @@ -200,18 +175,12 @@ morecore(int bucket) int amt; /* amount to allocate */ int nblks; /* how many blocks we get */ - /* - * sbrk_size <= 0 only for big, FLUFFY, requests (about - * 2^30 bytes on a VAX, I think) or for a negative arg. - */ - if ((unsigned)bucket >= NBBY * sizeof(int) - 4) - return; - sz = 1 << (bucket + 3); + sz = FIRST_BUCKET_SIZE << bucket; if (sz < pagesz) { amt = pagesz; nblks = amt / sz; } else { - amt = sz + pagesz; + amt = sz; nblks = 1; } if (amt > pagepool_end - pagepool_start) From owner-svn-src-head@freebsd.org Mon Sep 2 08:31:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48F9AD6BEE; Mon, 2 Sep 2019 08:31:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MNbC17kXz4RqQ; Mon, 2 Sep 2019 08:31:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A403F566; Mon, 2 Sep 2019 08:31:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x828VIjO082947; Mon, 2 Sep 2019 08:31:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x828VI5a082946; Mon, 2 Sep 2019 08:31:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909020831.x828VI5a082946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 2 Sep 2019 08:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351692 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 351692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 08:31:19 -0000 Author: hselasky Date: Mon Sep 2 08:31:18 2019 New Revision: 351692 URL: https://svnweb.freebsd.org/changeset/base/351692 Log: Fix regression issue after r351616. Make sure the mbuf queue gets initialized. Found by: gonzo@ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/net/usb_ethernet.c Modified: head/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- head/sys/dev/usb/net/usb_ethernet.c Mon Sep 2 08:20:02 2019 (r351691) +++ head/sys/dev/usb/net/usb_ethernet.c Mon Sep 2 08:31:18 2019 (r351692) @@ -219,6 +219,7 @@ ue_attach_post_task(struct usb_proc_msg *_task) ue->ue_unit = alloc_unr(ueunit); usb_callout_init_mtx(&ue->ue_watchdog, ue->ue_mtx, 0); sysctl_ctx_init(&ue->ue_sysctl_ctx); + mbufq_init(&ue->ue_rxq, 0 /* unlimited length */); error = 0; CURVNET_SET_QUIET(vnet0); @@ -284,6 +285,11 @@ ue_attach_post_task(struct usb_proc_msg *_task) fail: CURVNET_RESTORE(); + + /* drain mbuf queue */ + mbufq_drain(&ue->ue_rxq); + + /* free unit */ free_unr(ueunit, ue->ue_unit); if (ue->ue_ifp != NULL) { if_free(ue->ue_ifp); @@ -329,6 +335,9 @@ uether_ifdetach(struct usb_ether *ue) /* free sysctl */ sysctl_ctx_free(&ue->ue_sysctl_ctx); + + /* drain mbuf queue */ + mbufq_drain(&ue->ue_rxq); /* free unit */ free_unr(ueunit, ue->ue_unit); From owner-svn-src-head@freebsd.org Mon Sep 2 08:33:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62214D6E23; Mon, 2 Sep 2019 08:33:00 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46MNd7455Wz4S9l; Mon, 2 Sep 2019 08:32:59 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E4F4C26047E; Mon, 2 Sep 2019 10:32:56 +0200 (CEST) Subject: Re: svn commit: r351616 - head/sys/dev/usb/net To: Oleksandr Tymoshenko , Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201908300005.x7U055YI057385@repo.freebsd.org> <20190902002916.GA25603@bluezbox.com> From: Hans Petter Selasky Message-ID: <0d3a2c7f-b016-9c42-3f13-32f3e9fb3dde@selasky.org> Date: Mon, 2 Sep 2019 10:32:13 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190902002916.GA25603@bluezbox.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46MNd7455Wz4S9l X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-5.82 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; IP_SCORE(-2.58)[ip: (-9.11), ipnet: 2a01:4f8::/29(-1.97), asn: 24940(-1.81), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 08:33:00 -0000 On 2019-09-02 02:29, Oleksandr Tymoshenko wrote: > Gleb Smirnoff (glebius@FreeBSD.org) wrote: >> Author: glebius >> Date: Fri Aug 30 00:05:04 2019 >> New Revision: 351616 >> URL: https://svnweb.freebsd.org/changeset/base/351616 >> >> Log: >> Use mbuf queue instead of ifqueue in USB network drivers. > > Hi Gleb, > > This change broke NFS root on RPi. I suspect it's not just NFS root > but USB ethernet functionality in general. Patch below fixes it for me. > The same patch probably should also be applied to if_axe and if_axge. > Hi, 1) axe and axge use the common code, so no patch needed there from what I can see. 2) This queue should be unlimited. See: https://svnweb.freebsd.org/changeset/base/351692 --HPS From owner-svn-src-head@freebsd.org Mon Sep 2 08:34:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3039D6ED8; Mon, 2 Sep 2019 08:34:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MNg95jJmz4SL1; Mon, 2 Sep 2019 08:34:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2CE8F6E2; Mon, 2 Sep 2019 08:34:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x828YjpB086478; Mon, 2 Sep 2019 08:34:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x828YjNo086477; Mon, 2 Sep 2019 08:34:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201909020834.x828YjNo086477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 2 Sep 2019 08:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351693 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 351693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 08:34:45 -0000 Author: hselasky Date: Mon Sep 2 08:34:45 2019 New Revision: 351693 URL: https://svnweb.freebsd.org/changeset/base/351693 Log: Use DEVICE memory instead of UNCACHEABLE on aarch64 in ioremap() in the LinuxKPI. This fixes system hangs on reading device registers on aarch64. Tested with: Marvell MACCHIATObin (Armada8k) + mlx4en, amdgpu Submitted by: Greg V Differential Revision: https://reviews.freebsd.org/D20789 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/io.h Modified: head/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/io.h Mon Sep 2 08:31:18 2019 (r351692) +++ head/sys/compat/linuxkpi/common/include/linux/io.h Mon Sep 2 08:34:45 2019 (r351693) @@ -396,16 +396,25 @@ void *_ioremap_attr(vm_paddr_t phys_addr, unsigned lon #define _ioremap_attr(...) NULL #endif +#ifdef VM_MEMATTR_DEVICE #define ioremap_nocache(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_DEVICE) +#define ioremap_wt(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_DEVICE) +#define ioremap(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_DEVICE) +#else +#define ioremap_nocache(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) -#define ioremap_wc(addr, size) \ - _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING) -#define ioremap_wb(addr, size) \ - _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_BACK) #define ioremap_wt(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_THROUGH) #define ioremap(addr, size) \ _ioremap_attr((addr), (size), VM_MEMATTR_UNCACHEABLE) +#endif +#define ioremap_wc(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_COMBINING) +#define ioremap_wb(addr, size) \ + _ioremap_attr((addr), (size), VM_MEMATTR_WRITE_BACK) void iounmap(void *addr); #define memset_io(a, b, c) memset((a), (b), (c)) From owner-svn-src-head@freebsd.org Mon Sep 2 10:45:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1700AD9A49; Mon, 2 Sep 2019 10:45:11 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MRYf6r7Yz4YhJ; Mon, 2 Sep 2019 10:45:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF0F218E4A; Mon, 2 Sep 2019 10:45:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82AjATj064376; Mon, 2 Sep 2019 10:45:10 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82AjAPh064375; Mon, 2 Sep 2019 10:45:10 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909021045.x82AjAPh064375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 2 Sep 2019 10:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351695 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 351695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 10:45:11 -0000 Author: tsoome Date: Mon Sep 2 10:45:10 2019 New Revision: 351695 URL: https://svnweb.freebsd.org/changeset/base/351695 Log: loader.efi: some systems do not translate scan code 0x8 to backspace Add scancode translation for backspace. Modified: head/stand/efi/libefi/efi_console.c Modified: head/stand/efi/libefi/efi_console.c ============================================================================== --- head/stand/efi/libefi/efi_console.c Mon Sep 2 10:20:57 2019 (r351694) +++ head/stand/efi/libefi/efi_console.c Mon Sep 2 10:45:10 2019 (r351695) @@ -478,27 +478,30 @@ keybuf_inschar(EFI_INPUT_KEY *key) { switch (key->ScanCode) { - case 0x1: /* UP */ + case SCAN_UP: /* UP */ keybuf[0] = 0x1b; /* esc */ keybuf[1] = '['; keybuf[2] = 'A'; break; - case 0x2: /* DOWN */ + case SCAN_DOWN: /* DOWN */ keybuf[0] = 0x1b; /* esc */ keybuf[1] = '['; keybuf[2] = 'B'; break; - case 0x3: /* RIGHT */ + case SCAN_RIGHT: /* RIGHT */ keybuf[0] = 0x1b; /* esc */ keybuf[1] = '['; keybuf[2] = 'C'; break; - case 0x4: /* LEFT */ + case SCAN_LEFT: /* LEFT */ keybuf[0] = 0x1b; /* esc */ keybuf[1] = '['; keybuf[2] = 'D'; break; - case 0x17: + case SCAN_DELETE: + keybuf[0] = CHAR_BACKSPACE; + break; + case SCAN_ESC: keybuf[0] = 0x1b; /* esc */ break; default: From owner-svn-src-head@freebsd.org Mon Sep 2 11:04:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E18BD9FD0; Mon, 2 Sep 2019 11:04:18 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MRzj72Qyz4ZS5; Mon, 2 Sep 2019 11:04:17 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D642E191D2; Mon, 2 Sep 2019 11:04:17 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82B4Hkl076528; Mon, 2 Sep 2019 11:04:17 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82B4HdR076527; Mon, 2 Sep 2019 11:04:17 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909021104.x82B4HdR076527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 2 Sep 2019 11:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351696 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 351696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 11:04:18 -0000 Author: tsoome Date: Mon Sep 2 11:04:17 2019 New Revision: 351696 URL: https://svnweb.freebsd.org/changeset/base/351696 Log: loader.efi: use and prefer coninex interface Add support for EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL. Modified: head/stand/efi/libefi/efi_console.c Modified: head/stand/efi/libefi/efi_console.c ============================================================================== --- head/stand/efi/libefi/efi_console.c Mon Sep 2 10:45:10 2019 (r351695) +++ head/stand/efi/libefi/efi_console.c Mon Sep 2 11:04:17 2019 (r351696) @@ -32,8 +32,10 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" +static EFI_GUID simple_input_ex_guid = EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID; static SIMPLE_TEXT_OUTPUT_INTERFACE *conout; static SIMPLE_INPUT_INTERFACE *conin; +static EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *coninex; #ifdef TERM_EMU #define DEFAULT_FGCOLOR EFI_LIGHTGRAY @@ -115,6 +117,8 @@ efi_cons_probe(struct console *cp) static int efi_cons_init(int arg) { + EFI_STATUS status; + #ifdef TERM_EMU conout->SetAttribute(conout, EFI_TEXT_ATTR(DEFAULT_FGCOLOR, DEFAULT_BGCOLOR)); @@ -125,7 +129,11 @@ efi_cons_init(int arg) bg_c = DEFAULT_BGCOLOR; #endif conout->EnableCursor(conout, TRUE); - return 0; + status = BS->OpenProtocol(ST->ConsoleInHandle, &simple_input_ex_guid, + (void **)&coninex, IH, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (status != EFI_SUCCESS) + coninex = NULL; + return (0); } static void @@ -524,6 +532,40 @@ efi_readkey(void) return (false); } +static bool +efi_readkey_ex(void) +{ + EFI_STATUS status; + EFI_INPUT_KEY *kp; + EFI_KEY_DATA key_data; + uint32_t kss; + + status = coninex->ReadKeyStrokeEx(coninex, &key_data); + if (status == EFI_SUCCESS) { + kss = key_data.KeyState.KeyShiftState; + kp = &key_data.Key; + if (kss & EFI_SHIFT_STATE_VALID) { + + /* + * quick mapping to control chars, replace with + * map lookup later. + */ + if (kss & EFI_RIGHT_CONTROL_PRESSED || + kss & EFI_LEFT_CONTROL_PRESSED) { + if (kp->UnicodeChar >= 'a' && + kp->UnicodeChar <= 'z') { + kp->UnicodeChar -= 'a'; + kp->UnicodeChar++; + } + } + } + + keybuf_inschar(kp); + return (true); + } + return (false); +} + int efi_cons_getchar(void) { @@ -534,8 +576,13 @@ efi_cons_getchar(void) key_pending = 0; - if (efi_readkey()) - return (keybuf_getchar()); + if (coninex == NULL) { + if (efi_readkey()) + return (keybuf_getchar()); + } else { + if (efi_readkey_ex()) + return (keybuf_getchar()); + } return (-1); } @@ -543,6 +590,7 @@ efi_cons_getchar(void) int efi_cons_poll(void) { + EFI_STATUS status; if (keybuf_ischar() || key_pending) return (1); @@ -552,10 +600,21 @@ efi_cons_poll(void) * WaitForKey(). * CheckEvent() can clear the signaled state. */ - if (conin->WaitForKey == NULL) - key_pending = efi_readkey(); - else - key_pending = BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS; + if (coninex != NULL) { + if (coninex->WaitForKeyEx == NULL) { + key_pending = efi_readkey_ex(); + } else { + status = BS->CheckEvent(coninex->WaitForKeyEx); + key_pending = status == EFI_SUCCESS; + } + } else { + if (conin->WaitForKey == NULL) { + key_pending = efi_readkey(); + } else { + status = BS->CheckEvent(conin->WaitForKey); + key_pending = status == EFI_SUCCESS; + } + } return (key_pending); } From owner-svn-src-head@freebsd.org Mon Sep 2 12:46:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34832DD255; Mon, 2 Sep 2019 12:46:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MVFw0Yqwz3C8H; Mon, 2 Sep 2019 12:46:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E62711A39D; Mon, 2 Sep 2019 12:46:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82CkhLV035654; Mon, 2 Sep 2019 12:46:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82Ckhah035653; Mon, 2 Sep 2019 12:46:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909021246.x82Ckhah035653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 2 Sep 2019 12:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351697 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 351697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 12:46:44 -0000 Author: mjg Date: Mon Sep 2 12:46:43 2019 New Revision: 351697 URL: https://svnweb.freebsd.org/changeset/base/351697 Log: proc: clear pid bitmap entry after dropping proctree lock There is no correctness change here, but the procid lock is contended in the fork path and taking it while holding proctree avoidably extends its hold time. Note that there are other ids which can end up getting cleared with the lock. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Mon Sep 2 11:04:17 2019 (r351696) +++ head/sys/kern/kern_exit.c Mon Sep 2 12:46:43 2019 (r351697) @@ -906,7 +906,6 @@ proc_reap(struct thread *td, struct proc *p, int *stat LIST_REMOVE(p, p_sibling); reaper_abandon_children(p, true); reaper_clear(p); - proc_id_clear(PROC_ID_PID, p->p_pid); PROC_LOCK(p); proc_clear_orphan(p); PROC_UNLOCK(p); @@ -914,6 +913,8 @@ proc_reap(struct thread *td, struct proc *p, int *stat if (p->p_procdesc != NULL) procdesc_reap(p); sx_xunlock(&proctree_lock); + + proc_id_clear(PROC_ID_PID, p->p_pid); PROC_LOCK(p); knlist_detach(p->p_klist); From owner-svn-src-head@freebsd.org Mon Sep 2 12:48:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5596DD2F7; Mon, 2 Sep 2019 12:48:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MVHk4zm8z3CMp; Mon, 2 Sep 2019 12:48:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FCA91A3A5; Mon, 2 Sep 2019 12:48:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82CmILm035923; Mon, 2 Sep 2019 12:48:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82CmIE9035922; Mon, 2 Sep 2019 12:48:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909021248.x82CmIE9035922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 2 Sep 2019 12:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351698 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 351698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 12:48:18 -0000 Author: emaste Date: Mon Sep 2 12:48:18 2019 New Revision: 351698 URL: https://svnweb.freebsd.org/changeset/base/351698 Log: Belatedly bump __FreeBSD_version for r351659, gets(3) removal Reported by: linimon Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Sep 2 12:46:43 2019 (r351697) +++ head/sys/sys/param.h Mon Sep 2 12:48:18 2019 (r351698) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300042 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300043 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Mon Sep 2 13:55:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5A84DE8C3; Mon, 2 Sep 2019 13:55:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MWnH5PxTz3HP9; Mon, 2 Sep 2019 13:55:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D7971B078; Mon, 2 Sep 2019 13:55:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82DtVGC077668; Mon, 2 Sep 2019 13:55:31 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82DtVvO077667; Mon, 2 Sep 2019 13:55:31 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909021355.x82DtVvO077667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 2 Sep 2019 13:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351699 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 351699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 13:55:31 -0000 Author: mjg Date: Mon Sep 2 13:55:31 2019 New Revision: 351699 URL: https://svnweb.freebsd.org/changeset/base/351699 Log: libutil: remove SIGSYS handling from setusercontext It was a workaround for cases where the kernel lacks setloginclass(2), added in the 9.x era. Submitted by: Pawel Biernacki Modified: head/lib/libutil/login_class.c Modified: head/lib/libutil/login_class.c ============================================================================== --- head/lib/libutil/login_class.c Mon Sep 2 12:48:18 2019 (r351698) +++ head/lib/libutil/login_class.c Mon Sep 2 13:55:31 2019 (r351699) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -428,7 +427,6 @@ setusercontext(login_cap_t *lc, const struct passwd *p rlim_t p; mode_t mymask; login_cap_t *llc = NULL; - struct sigaction sa, prevsa; struct rtprio rtp; int error; @@ -521,16 +519,7 @@ setusercontext(login_cap_t *lc, const struct passwd *p /* Inform the kernel about current login class */ if (lc != NULL && lc->lc_class != NULL && (flags & LOGIN_SETLOGINCLASS)) { - /* - * XXX: This is a workaround to fail gracefully in case the kernel - * does not support setloginclass(2). - */ - bzero(&sa, sizeof(sa)); - sa.sa_handler = SIG_IGN; - sigfillset(&sa.sa_mask); - sigaction(SIGSYS, &sa, &prevsa); error = setloginclass(lc->lc_class); - sigaction(SIGSYS, &prevsa, NULL); if (error != 0) { syslog(LOG_ERR, "setloginclass(%s): %m", lc->lc_class); #ifdef notyet From owner-svn-src-head@freebsd.org Mon Sep 2 13:56:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9B1FDEA6F; Mon, 2 Sep 2019 13:56:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MWph59pZz3HdK; Mon, 2 Sep 2019 13:56:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94D5C1B07D; Mon, 2 Sep 2019 13:56:44 +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 x82DuiAe077766; Mon, 2 Sep 2019 13:56:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82Dui6v077765; Mon, 2 Sep 2019 13:56:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909021356.x82Dui6v077765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 2 Sep 2019 13:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351700 - head/lib/libc/string X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libc/string X-SVN-Commit-Revision: 351700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 13:56:44 -0000 Author: emaste Date: Mon Sep 2 13:56:44 2019 New Revision: 351700 URL: https://svnweb.freebsd.org/changeset/base/351700 Log: libc: Use musl's optimized memchr Parentheses added to HASZERO macro to avoid a GCC warning. Reviewed by: kib, mjg Obtained from: musl (snapshot at commit 4d0a82170a) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17631 Modified: head/lib/libc/string/memchr.c Modified: head/lib/libc/string/memchr.c ============================================================================== --- head/lib/libc/string/memchr.c Mon Sep 2 13:55:31 2019 (r351699) +++ head/lib/libc/string/memchr.c Mon Sep 2 13:56:44 2019 (r351700) @@ -1,55 +1,54 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: MIT * - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2005-2014 Rich Felker, et al. * - * This code is derived from software contributed to Berkeley by - * Chris Torek. + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: * - * 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. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)memchr.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); #include +#include +#include -void * -memchr(const void *s, int c, size_t n) -{ - if (n != 0) { - const unsigned char *p = s; +#define SS (sizeof(size_t)) +#define ALIGN (sizeof(size_t)-1) +#define ONES ((size_t)-1/UCHAR_MAX) +#define HIGHS (ONES * (UCHAR_MAX/2+1)) +#define HASZERO(x) (((x)-ONES) & ~(x) & HIGHS) - do { - if (*p++ == (unsigned char)c) - return ((void *)(p - 1)); - } while (--n != 0); +void *memchr(const void *src, int c, size_t n) +{ + const unsigned char *s = src; + c = (unsigned char)c; +#ifdef __GNUC__ + for (; ((uintptr_t)s & ALIGN) && n && *s != c; s++, n--); + if (n && *s != c) { + typedef size_t __attribute__((__may_alias__)) word; + const word *w; + size_t k = ONES * c; + for (w = (const void *)s; n>=SS && !HASZERO(*w^k); w++, n-=SS); + s = (const void *)w; } - return (NULL); +#endif + for (; n && *s != c; s++, n--); + return n ? (void *)s : 0; } From owner-svn-src-head@freebsd.org Mon Sep 2 14:51:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A415DFDFB; Mon, 2 Sep 2019 14:51:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MY2F3J7hz3LvR; Mon, 2 Sep 2019 14:51:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.6] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id 919662F32B; Mon, 2 Sep 2019 14:51:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r351659 - in head: contrib/libc++/include contrib/netbsd-tests/lib/libc/ssp gnu/lib/libssp include lib/libc/stdio To: Cy Schubert , cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head References: <201909011612.x81GC5DW097846@repo.freebsd.org> <201909011932.x81JWYts004074@slippy.cwsent.com> <201909012223.x81MN7jK005967@slippy.cwsent.com> <201909020336.x823ar42054344@slippy.cwsent.com> From: Pedro Giffuni Organization: FreeBSD Message-ID: Date: Mon, 2 Sep 2019 09:51:47 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201909020336.x823ar42054344@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 14:51:49 -0000 On 01/09/2019 22:36, Cy Schubert wrote: > In message om> > , Conrad Meyer writes: >> Hi Cy, >> >> On Sun, Sep 1, 2019 at 3:23 PM Cy Schubert wrote: >>> In message > c >>> om> >>> , Conrad Meyer writes: >>> >>>> Short version: no, we shouldn't [recommend the use of gets_s]. :-) >>>> >>>> Longer version: Annex K functions like gets_s have zero real adoption >>>> (Microsoft's APIs that inspired Annex K are not actually compatible >>>> with the version in the standards); broadly terrible APIs; and in this >>>> particular case and others, unnecessarily duplicate the functionality >>>> of existing long-standing standard C functions (e.g., fgets(3)). >>> That's not quite true. From the man page: >>> >>> The gets_s() function is equivalent to fgets() with a stream of stdin, >>> except that the newline character (if any) is not stored in the string >> . >> >> I tried to make a distinction earlier that I don't think carried well >> over email. I wrote "unnecessarily duplicate(s) the _functionality_ >> of existing …" — not "is/are an exact duplicate(s) of …" — because >> you're right, gets_s() has (trivial) behavioral differences from >> fgets(stdin). >> >> The thing that is important to me is that fgets(3) is portable, super >> well understood, and provides a superset of the functionality of >> gets_s(). One can easily construct the newline-free version of a line >> from one containing a trailing newline. I don't think this slight >> behavioral difference justifies implementing, using, or especially >> recommending gets_s(). > If Microsoft chooses to ignore or anotherfunctions is their problem. > However in this case, according to the following they do support gets_s(). > https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/gets-s-getw > s-s?view=vs-2019 > > Having said all that, glibc is the odd man out here. In that case I'll pull > back my horns. It's sufficient not to not say anything or to highlight both. > > BTW. we've had gets_s(3) in our tree for 17 months now. We don't need to > add anything. It's already there. > > It is an application developer choice to use one function or another. > > As someone who also works on the ports side, the newline is significant > distinction. As gets_s() is closer in function to gets() than fgets() is, > all one > needs to concern oneself with is buffer length. As there are no _other_ > differences nothing else needs to be addressed. This is important to ports > maintainers and who must replace gets() with something else. Agreed this > shouldn't be an issue every time but gets_s() is still in our toolbox. > >> (IMO, it was probably a historical mistake that gets(3) even had >> different behavior than fgets(3) to begin with. gets(3) maybe >> predated stdio FILE streams?) > I totally agree. > >>> Some apps may be sensitive to this subtle difference. gets_s() preserves >>> this behaviour. >> Correct conversion of gets()-using programs requires more analysis >> than blind replacement with either function. > That's where gets_s() is handy. It requires less analysis. Remember, my > main concern here are our ports maintainers. Upstream developers should > always do analysis. It's not the job of the ports team to perform > significant rewrites of upstream software. IMO, if upsteam software needs > significant rewrite a port maintainer should notify the upstream > maintainer. If the upstream cannot or will not, requiring a maintainer of a > port to make significant changes, DEPRECATED= and EXPIRATION_DATE= are the > best answer. We are not here to rewrite other people's software for them. > >> Anyway, gets() use is largely behind us so the point is mostly moot — >> there are few such programs to convert, and they should be viewed with >> an extremely high level of skepticism given they are still using >> gets(3) in 2019. > I'm not arguing for keeping gets(3). We already have gets_s(3). Let's use > it where it makes sense. Nor am I saying to use it in exclusion of > fgets(3). It (gets_s()) is in our libc. If it eases the job of maintaining > a port, use it instead. > >>> [Annex K functions] are part of the >>> standard >> They're an optional part of the standard. Everyone takes the option >> of "not." Literally no one implements Annex K. It's a bad set of >> APIs. > Microsoft and we have chosen to implement some Annex K functions. We > haven't implemented all of them. I don't know if they implemented all _s > functions. Linux glibc has not. > > I don't agree that it's a completely bad set of APIs. gets_s() will help > ports maintainers. AFAIK, no ports rely on gets() but that's not to say > some new port might not. Don't forget, my motivation for implementing > gets_s(3) in libc was to ease the pain of deprecating gets() for ports. > >>> and though we support some _s functions it would behoove us to one >>> day (*) support them all. >> If and when the C standard committee adopts Annex K as a required part >> of the standard, then I agree we should make every attempt to support >> the full standard library. But in general, I am opposed to the >> further adoption of Annex K, and hope the C2x standard committee >> finally drops the annex.[1] (It is weakly defended[2], just to >> provide a counterargument.) > Again I disagree. > >> [1]: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1967.htm (pro-removal) > This explains glibc's not implementing the _s functions. His focus is > almost entirely on string copy and memory copy functions. Implementation of > string and memory copy functions would be more complex than the gets_s() I > added to FreeBSD. In terms of error detection (for calls to constraint > handlers), gets_s() is simple compared to strcpy_s(). I can understand his > issues. It would appear a similar lack of consideration of implementation > details went into defining the _s string functions as the lack of > consistency considerations went into the development of gets() and fgets(). > > https://en.cppreference.com/w/c/string/byte/strcpy, where clobbring the > rest of the destination is IMO "not optimal." Throwing out the baby > (functions which were properly defined) with the bath water (functions > which make one wonder what they were smoking) isn't the right answer either. > >> [2]: https://www.nccgroup.trust/us/our-research/bounds-checking-interfaces-fi >> eld-experience-and-future-directions/ >> (pro-retention) > I don't have time to read completely through all of this tonight. The > assertion that there are unfounded criticisms as well as actual flaws. The > flaws are such that replacing some functions with _s will require some > care. Fortunately with gets_s() this is not a concern, except of course > having to specify a buffer length. A constraint handler is not required. > IMO constraint handlers add unnecessary complexity, good thing they are > optional. > >>> I'm also sure some ports will probably break. >> Check the exp-run PR: 222796 (comment #7). 13 ports. Out of 37601, >> according to FreshPorts. Of those 13, eight don't have a maintainer. > Already did. Should someone choose to fix them we the tools are there. > > I doubt you will convince me nor I convince you. > > I'm not sure if you or anyone else has a copy of the standard. (I suspect > you already have these but maybe someone else might find them useful.) > > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3631.pdf FWIW, Intel has a safestringlib project which implements many of the _s functions: https://github.com/intel/safestringlib Microsoft has a related policy since 2012: https://docs.microsoft.com/en-us/previous-versions/bb288454(v=msdn.10) but perhaps nowadays we may want to be ready for rust modules. Cheers, Pedro. From owner-svn-src-head@freebsd.org Mon Sep 2 14:52:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D48DBDFE45; Mon, 2 Sep 2019 14:52:00 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MY2S5Lhsz3M3C; Mon, 2 Sep 2019 14:52:00 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 833D21BB52; Mon, 2 Sep 2019 14:52:00 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82Eq0F5014273; Mon, 2 Sep 2019 14:52:00 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82Eq04v014272; Mon, 2 Sep 2019 14:52:00 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201909021452.x82Eq04v014272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Mon, 2 Sep 2019 14:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351701 - in head/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux sys X-SVN-Commit-Revision: 351701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 14:52:00 -0000 Author: johalun Date: Mon Sep 2 14:51:59 2019 New Revision: 351701 URL: https://svnweb.freebsd.org/changeset/base/351701 Log: LinuxKPI: Add sysfs create/remove functions that handles multiple files in one call. Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Differential Revision: D21475 Modified: head/sys/compat/linuxkpi/common/include/linux/sysfs.h head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/linux/sysfs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/sysfs.h Mon Sep 2 13:56:44 2019 (r351700) +++ head/sys/compat/linuxkpi/common/include/linux/sysfs.h Mon Sep 2 14:51:59 2019 (r351701) @@ -152,6 +152,29 @@ sysfs_remove_file(struct kobject *kobj, const struct a sysctl_remove_name(kobj->oidp, attr->name, 1, 1); } +static inline int +sysfs_create_files(struct kobject *kobj, const struct attribute * const *attrs) +{ + int error = 0; + int i; + + for (i = 0; attrs[i] && !error; i++) + error = sysfs_create_file(kobj, attrs[i]); + while (error && --i >= 0) + sysfs_remove_file(kobj, attrs[i]); + + return (error); +} + +static inline void +sysfs_remove_files(struct kobject *kobj, const struct attribute * const *attrs) +{ + int i; + + for (i = 0; attrs[i]; i++) + sysfs_remove_file(kobj, attrs[i]); +} + static inline void sysfs_remove_group(struct kobject *kobj, const struct attribute_group *grp) { Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Sep 2 13:56:44 2019 (r351700) +++ head/sys/sys/param.h Mon Sep 2 14:51:59 2019 (r351701) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300043 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300044 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Mon Sep 2 15:24:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88C4EE0F7B; Mon, 2 Sep 2019 15:24:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MYlt34PQz3Pg7; Mon, 2 Sep 2019 15:24:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49BE01C19F; Mon, 2 Sep 2019 15:24:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82FOQwW033533; Mon, 2 Sep 2019 15:24:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82FOQZO033532; Mon, 2 Sep 2019 15:24:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909021524.x82FOQZO033532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 2 Sep 2019 15:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351702 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 351702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 15:24:26 -0000 Author: mjg Date: Mon Sep 2 15:24:25 2019 New Revision: 351702 URL: https://svnweb.freebsd.org/changeset/base/351702 Log: vfs: restore mp null check in vop_stdgetwritemount The initially read mount point can already be NULL. Reported by: markj Fixes: r351656 ("vfs: stop refing freed mount points in vop_stdgetwritemount") Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Mon Sep 2 14:51:59 2019 (r351701) +++ head/sys/kern/vfs_default.c Mon Sep 2 15:24:25 2019 (r351702) @@ -601,6 +601,8 @@ vop_stdgetwritemount(ap) */ vp = ap->a_vp; mp = vp->v_mount; + if (mp == NULL) + goto out; MNT_ILOCK(mp); if (mp != vp->v_mount) { MNT_IUNLOCK(mp); From owner-svn-src-head@freebsd.org Mon Sep 2 15:26:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 872D6E1029; Mon, 2 Sep 2019 15:26:37 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MYpP2v50z3Ppg; Mon, 2 Sep 2019 15:26:37 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd35.google.com with SMTP id d25so27275236iob.6; Mon, 02 Sep 2019 08:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8H+kZScnWOU/ZvH7QyUteeQwIXGVCdw5BDBM4OAEiok=; b=iLabulUcScbbFQ1XVfp8DciXPB+QiEK36wsl+Lh6f3fw/jKIPT/YADRLCgXDANNN2T 88lRYlgXN9cpaHJe6TjI1O11qhlBfdRBTbBQ849e5S5BvsND/cKKFkgW0R/CLW7U4Y9X T/l3aOMWiGP4VEwm9jk1aUHaykTJBLBmqx1Tt0SweASSqnUH1WFaXLoZuiDanvCjyQg1 PtqmdZ7g2H0mm8zjPdDKfuOT/K8aV9haOVZoAJSeIy9z0aN64NkPjZsQQ4R6HNPGbDSN M7KBmZeAQK0JAtw47EA1MASxWHzIuoWoVrsZAEZgmGg886yJKTvVNCw+rIMU4dEbkhaJ Jqog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=8H+kZScnWOU/ZvH7QyUteeQwIXGVCdw5BDBM4OAEiok=; b=VoLDb0nUGiipSpiPxR1VrRiVCQDlhRuO5/uZFhvwFg2k9VTe3IkotlqFmlqsxRSqkF 6pVfin/4LPV6Mfobur1ldbdrN+kLnGvrG45QArY0GU2C8cc8lPVvj6R6d85a3ewif3aS +MHdfWUHZe2PJLC98TvYEpPSVqjvyfAwxYFaJGm7BVwP84/CLeR6P1P8oNNV+xWGq6ip wN4pDjFDULXMeQ8hjCjZvsV1BT6tFMpWPr375qAqlarX92VRZCdojIGo8Dp/94kd0DmJ 1DMN6chKzRaURP7PEOA4Rm6kGdvRPzPhBToTzYMWNhycrU6vU9NhZM7P3bTNnz3lSvvB QzEQ== X-Gm-Message-State: APjAAAW0px4RFbsG4mwiB/l0uxioHGbL8NnbKfb4xmIoZeLoqNyyim07 H28oHT8Z7wsTzHUFdn18+k/Lk4v/ X-Google-Smtp-Source: APXvYqyeNsOjXL4kYy/1+FI5U3Gf4bWtgMbmCIX0zFR2gjzRlNfTryJA5yP/edSSLgYDHCMcIaG5ng== X-Received: by 2002:a5d:980d:: with SMTP id a13mr19868918iol.240.1567437995826; Mon, 02 Sep 2019 08:26:35 -0700 (PDT) Received: from raichu (toroon0560w-lp140-03-184-148-66-213.dsl.bell.ca. [184.148.66.213]) by smtp.gmail.com with ESMTPSA id i62sm5162940ioa.4.2019.09.02.08.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 08:26:35 -0700 (PDT) Sender: Mark Johnston Date: Mon, 2 Sep 2019 11:26:33 -0400 From: Mark Johnston To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351702 - head/sys/kern Message-ID: <20190902152633.GE68323@raichu> References: <201909021524.x82FOQZO033532@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201909021524.x82FOQZO033532@repo.freebsd.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46MYpP2v50z3Ppg X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.969,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 15:26:37 -0000 On Mon, Sep 02, 2019 at 03:24:26PM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Mon Sep 2 15:24:25 2019 > New Revision: 351702 > URL: https://svnweb.freebsd.org/changeset/base/351702 > > Log: > vfs: restore mp null check in vop_stdgetwritemount > > The initially read mount point can already be NULL. > > Reported by: markj Just a correction: it was Peter that found the bug, not me. > Fixes: r351656 ("vfs: stop refing freed mount points in vop_stdgetwritemount") > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/kern/vfs_default.c > > Modified: head/sys/kern/vfs_default.c > ============================================================================== > --- head/sys/kern/vfs_default.c Mon Sep 2 14:51:59 2019 (r351701) > +++ head/sys/kern/vfs_default.c Mon Sep 2 15:24:25 2019 (r351702) > @@ -601,6 +601,8 @@ vop_stdgetwritemount(ap) > */ > vp = ap->a_vp; > mp = vp->v_mount; > + if (mp == NULL) > + goto out; > MNT_ILOCK(mp); > if (mp != vp->v_mount) { > MNT_IUNLOCK(mp); > From owner-svn-src-head@freebsd.org Mon Sep 2 15:45:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CEC6E1588; Mon, 2 Sep 2019 15:45:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MZDV3RQTz3Qsv; Mon, 2 Sep 2019 15:45:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-ot1-x32c.google.com with SMTP id c7so13987183otp.1; Mon, 02 Sep 2019 08:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xsAvqB9GPeUKl7WXD0QLsF/nU0dWxOPTzJTUJ6Lb3Ik=; b=k1b/b/AwbLbRqqVlpYTv/CntZg1u06ECn+wbjl/2rW4+mHzYRiOiaRAnGiW+e8pcLT I05ZCtwN2vC1MkH0c05EqotD53dN2kADcgXsrxFRmV946g0bxml9PNf81mW26Qw+7832 6GR8Iqxxj+qNYKaZegpF16RfEO8G8E9uv2phIshwU/rGt6fkUgO1Z2mFhM8lFaStuYO6 N0dt7B+NnuBZJ7tnlYQ+3bEnuZh4KBNiwEPHcOnjHCkUVSr+uISvvqditVWShECGPB48 ZHIWM2Nmjs9d1GlI/4UAklXm+z1lPUXSOn8/boicv8Zpy5itMl5g0/Zx/qJ0krp6Ah+5 76LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xsAvqB9GPeUKl7WXD0QLsF/nU0dWxOPTzJTUJ6Lb3Ik=; b=I71NzHtj0VDgFWnjvX68gXci0qFbeomGeebW0qQl/KonPyw46G2oSlaCd+rBTpC3ok mykpUoirCvBVvXNgbE8iHUQhIKMEjtll5l7UtCcEF/b+2/e4zoEvGw6EuixcxVTFS54l mIU+KFJu9KBWhn6ZKbShl6uFaZMnD1TVrKmDzJakTogvaT4eflxeuoMdW7Nh3prwGqLS p4FjSQJbxdqRNsqVZHq2inn8ZhpTXJldN0pIshQDJk7A3JZTlo/lPuKl2KX8URdN0qK2 92TYzb7aTCaLNYTiRneFAG5l8bNhdVaRf1irjwWYfavz0+nlj+OKe1yRoUommLeatYcq 6blg== X-Gm-Message-State: APjAAAWUGR0AsmY36bIMXmDJigxNPaMzjfCF6ors6rFXpMfJAXJ7e1tx wYuVbvQDj52fFX0MlavfPBYv7VDiC0xC0QgwRMNffA== X-Google-Smtp-Source: APXvYqwk/59TjJLPdppU+kcwFEj8TQGnXnAN2HLGOfSpzzG98nbgPDcJ2LafSINNLN7Th0+aD42m6nP8CTqIj7GJszA= X-Received: by 2002:a9d:6e8d:: with SMTP id a13mr22740823otr.235.1567439144817; Mon, 02 Sep 2019 08:45:44 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:458d:0:0:0:0:0 with HTTP; Mon, 2 Sep 2019 08:45:44 -0700 (PDT) In-Reply-To: <20190902152633.GE68323@raichu> References: <201909021524.x82FOQZO033532@repo.freebsd.org> <20190902152633.GE68323@raichu> From: Mateusz Guzik Date: Mon, 2 Sep 2019 17:45:44 +0200 Message-ID: Subject: Re: svn commit: r351702 - head/sys/kern To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46MZDV3RQTz3Qsv X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.982,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 15:45:46 -0000 On 9/2/19, Mark Johnston wrote: > On Mon, Sep 02, 2019 at 03:24:26PM +0000, Mateusz Guzik wrote: >> Author: mjg >> Date: Mon Sep 2 15:24:25 2019 >> New Revision: 351702 >> URL: https://svnweb.freebsd.org/changeset/base/351702 >> >> Log: >> vfs: restore mp null check in vop_stdgetwritemount >> >> The initially read mount point can already be NULL. >> >> Reported by: markj > > Just a correction: it was Peter that found the bug, not me. > Yup, apologies. Automatically credited the person who sent the e-mail. >> Fixes: r351656 ("vfs: stop refing freed mount points in >> vop_stdgetwritemount") >> Sponsored by: The FreeBSD Foundation >> >> Modified: >> head/sys/kern/vfs_default.c >> >> Modified: head/sys/kern/vfs_default.c >> ============================================================================== >> --- head/sys/kern/vfs_default.c Mon Sep 2 14:51:59 2019 (r351701) >> +++ head/sys/kern/vfs_default.c Mon Sep 2 15:24:25 2019 (r351702) >> @@ -601,6 +601,8 @@ vop_stdgetwritemount(ap) >> */ >> vp = ap->a_vp; >> mp = vp->v_mount; >> + if (mp == NULL) >> + goto out; >> MNT_ILOCK(mp); >> if (mp != vp->v_mount) { >> MNT_IUNLOCK(mp); >> > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Mon Sep 2 15:49:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A50EE1653; Mon, 2 Sep 2019 15:49:42 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46MZK11rv8z3R6T; Mon, 2 Sep 2019 15:49:40 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x82Fndhb009861; Mon, 2 Sep 2019 08:49:39 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x82FndM9009860; Mon, 2 Sep 2019 08:49:39 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201909021549.x82FndM9009860@gndrsh.dnsmgr.net> Subject: Re: svn commit: r351643 - in head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common: dtraceUtil speculation In-Reply-To: To: Enji Cooper Date: Mon, 2 Sep 2019 08:49:39 -0700 (PDT) CC: Warner Losh , "Conrad E. Meyer" , Li-Wen Hsu , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 46MZK11rv8z3R6T X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.62 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.38)[0.383,0]; NEURAL_HAM_LONG(-0.07)[-0.066,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; NEURAL_SPAM_MEDIUM(0.36)[0.360,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.04)[ip: (0.15), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.05), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 15:49:42 -0000 > > > On Aug 31, 2019, at 16:29, Warner Losh wrote: > > > > > > > >> On Sat, Aug 31, 2019 at 5:29 PM Conrad Meyer wrote: > >> Thanks Li-Wen! Might it be less fragile to have the test fixture > >> create a file, if the test(s) will expect one to be present to read? > > > > Or just use the realpath $0, which you know has to exist :) > > I don?t know if this would work, with other some of the dtrace tests are called. Plus, that relies on a FreeBSD utility which doesn?t necessarily exist on Linux and I don?t think exists on IllumOS. > > It makes more sense to create a file with mktemp and test for it in the loop to make the tests portable over to IllumOS, since that?s where they originally came from and can be contributed back to. Agreed, especially if these tests are expected to be portable the assumption of existance of /COPYRIGHT is a mistake/bug. > Thanks, > -Enji -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Sep 2 16:57:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E257E2F96; Mon, 2 Sep 2019 16:57:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MbqV75NXz41mP; Mon, 2 Sep 2019 16:57:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D32741D24A; Mon, 2 Sep 2019 16:57:42 +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 x82Gvg2Z089126; Mon, 2 Sep 2019 16:57:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82GvgRi089125; Mon, 2 Sep 2019 16:57:42 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201909021657.x82GvgRi089125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 2 Sep 2019 16:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351703 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 351703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 16:57:43 -0000 Author: trasz Date: Mon Sep 2 16:57:42 2019 New Revision: 351703 URL: https://svnweb.freebsd.org/changeset/base/351703 Log: Relax compat.linux.osrelease checks. This way one can do eg 'compat.linux.osrelease=3.10.0-957.12.1.el7.x86_64', which corresponds to CentOS 7. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20685 Modified: head/sys/compat/linux/linux_mib.c Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Mon Sep 2 15:24:25 2019 (r351702) +++ head/sys/compat/linux/linux_mib.c Mon Sep 2 16:57:42 2019 (r351703) @@ -146,7 +146,8 @@ linux_map_osrel(char *osrelease, int *osrel) return (EINVAL); osrelease = sep + 1; v2 = strtol(osrelease, &sep, 10); - if (osrelease == sep || sep != eosrelease) + if (osrelease == sep || + (sep != eosrelease && (sep + 1 >= eosrelease || *sep != '-'))) return (EINVAL); v = LINUX_KERNVER(v0, v1, v2); From owner-svn-src-head@freebsd.org Mon Sep 2 17:10:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 070C7E33D1; Mon, 2 Sep 2019 17:10:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Mc6Z6FM9z42P3; Mon, 2 Sep 2019 17:10:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B980E1D464; Mon, 2 Sep 2019 17:10:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82HAkNG095243; Mon, 2 Sep 2019 17:10:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82HAkTe095242; Mon, 2 Sep 2019 17:10:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909021710.x82HAkTe095242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 2 Sep 2019 17:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351704 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 351704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 17:10:47 -0000 Author: imp Date: Mon Sep 2 17:10:46 2019 New Revision: 351704 URL: https://svnweb.freebsd.org/changeset/base/351704 Log: Add a brief comment explaining why we can return ETIMEDOUT from the call to the polled interface. Normally this would have the potential to corrupt stack memory because the completion routines would run after we return. In this case, however, we're doing a dump so it's safe for reasons explained in the comment. Modified: head/sys/dev/nvme/nvme_ns_cmd.c Modified: head/sys/dev/nvme/nvme_ns_cmd.c ============================================================================== --- head/sys/dev/nvme/nvme_ns_cmd.c Mon Sep 2 16:57:42 2019 (r351703) +++ head/sys/dev/nvme/nvme_ns_cmd.c Mon Sep 2 17:10:46 2019 (r351704) @@ -191,6 +191,14 @@ nvme_ns_dump(struct nvme_namespace *ns, void *virt, of nvme_qpair_process_completions(req->qpair); } + /* + * Normally, when using the polling interface, we can't return a + * timeout error because we don't know when the completion routines + * will be called if the command later completes. However, in this + * case we're running a system dump, so all interrupts are turned + * off, the scheduler isn't running so there's nothing to complete + * the transaction. + */ if (status.done == FALSE) return (ETIMEDOUT); From owner-svn-src-head@freebsd.org Mon Sep 2 17:11:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 948F1E3574; Mon, 2 Sep 2019 17:11:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Mc7N3QP3z42YR; Mon, 2 Sep 2019 17:11:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EC541D4A0; Mon, 2 Sep 2019 17:11:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82HBScm096295; Mon, 2 Sep 2019 17:11:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82HBRej096292; Mon, 2 Sep 2019 17:11:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909021711.x82HBRej096292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 2 Sep 2019 17:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351705 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 351705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 17:11:28 -0000 Author: imp Date: Mon Sep 2 17:11:27 2019 New Revision: 351705 URL: https://svnweb.freebsd.org/changeset/base/351705 Log: In all the places that we use the polled for completion interface, except crash dump support code, move the while loop into an inline function. These aren't done in the fast path, so if the compiler choses to not inline, any performance hit is tiny. Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_ns.c head/sys/dev/nvme/nvme_private.h Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Mon Sep 2 17:10:46 2019 (r351704) +++ head/sys/dev/nvme/nvme_ctrlr.c Mon Sep 2 17:11:27 2019 (r351705) @@ -394,8 +394,7 @@ nvme_ctrlr_identify(struct nvme_controller *ctrlr) status.done = 0; nvme_ctrlr_cmd_identify_controller(ctrlr, &ctrlr->cdata, nvme_completion_poll_cb, &status); - while (!atomic_load_acq_int(&status.done)) - pause("nvme", 1); + nvme_completion_poll(&status); if (nvme_completion_is_error(&status.cpl)) { nvme_printf(ctrlr, "nvme_identify_controller failed!\n"); return (ENXIO); @@ -424,8 +423,7 @@ nvme_ctrlr_set_num_qpairs(struct nvme_controller *ctrl status.done = 0; nvme_ctrlr_cmd_set_num_queues(ctrlr, ctrlr->num_io_queues, nvme_completion_poll_cb, &status); - while (!atomic_load_acq_int(&status.done)) - pause("nvme", 1); + nvme_completion_poll(&status); if (nvme_completion_is_error(&status.cpl)) { nvme_printf(ctrlr, "nvme_ctrlr_set_num_qpairs failed!\n"); return (ENXIO); @@ -463,8 +461,7 @@ nvme_ctrlr_create_qpairs(struct nvme_controller *ctrlr status.done = 0; nvme_ctrlr_cmd_create_io_cq(ctrlr, qpair, qpair->vector, nvme_completion_poll_cb, &status); - while (!atomic_load_acq_int(&status.done)) - pause("nvme", 1); + nvme_completion_poll(&status); if (nvme_completion_is_error(&status.cpl)) { nvme_printf(ctrlr, "nvme_create_io_cq failed!\n"); return (ENXIO); @@ -473,8 +470,7 @@ nvme_ctrlr_create_qpairs(struct nvme_controller *ctrlr status.done = 0; nvme_ctrlr_cmd_create_io_sq(qpair->ctrlr, qpair, nvme_completion_poll_cb, &status); - while (!atomic_load_acq_int(&status.done)) - pause("nvme", 1); + nvme_completion_poll(&status); if (nvme_completion_is_error(&status.cpl)) { nvme_printf(ctrlr, "nvme_create_io_sq failed!\n"); return (ENXIO); @@ -496,8 +492,7 @@ nvme_ctrlr_destroy_qpairs(struct nvme_controller *ctrl status.done = 0; nvme_ctrlr_cmd_delete_io_sq(ctrlr, qpair, nvme_completion_poll_cb, &status); - while (!atomic_load_acq_int(&status.done)) - pause("nvme", 1); + nvme_completion_poll(&status); if (nvme_completion_is_error(&status.cpl)) { nvme_printf(ctrlr, "nvme_destroy_io_sq failed!\n"); return (ENXIO); @@ -506,8 +501,7 @@ nvme_ctrlr_destroy_qpairs(struct nvme_controller *ctrl status.done = 0; nvme_ctrlr_cmd_delete_io_cq(ctrlr, qpair, nvme_completion_poll_cb, &status); - while (!atomic_load_acq_int(&status.done)) - pause("nvme", 1); + nvme_completion_poll(&status); if (nvme_completion_is_error(&status.cpl)) { nvme_printf(ctrlr, "nvme_destroy_io_cq failed!\n"); return (ENXIO); @@ -789,8 +783,7 @@ nvme_ctrlr_configure_aer(struct nvme_controller *ctrlr status.done = 0; nvme_ctrlr_cmd_get_feature(ctrlr, NVME_FEAT_TEMPERATURE_THRESHOLD, 0, NULL, 0, nvme_completion_poll_cb, &status); - while (!atomic_load_acq_int(&status.done)) - pause("nvme", 1); + nvme_completion_poll(&status); if (nvme_completion_is_error(&status.cpl) || (status.cpl.cdw0 & 0xFFFF) == 0xFFFF || (status.cpl.cdw0 & 0xFFFF) == 0x0000) { Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Mon Sep 2 17:10:46 2019 (r351704) +++ head/sys/dev/nvme/nvme_ns.c Mon Sep 2 17:11:27 2019 (r351705) @@ -530,8 +530,7 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t status.done = 0; nvme_ctrlr_cmd_identify_namespace(ctrlr, id, &ns->data, nvme_completion_poll_cb, &status); - while (!atomic_load_acq_int(&status.done)) - pause("nvme", 1); + nvme_completion_poll(&status); if (nvme_completion_is_error(&status.cpl)) { nvme_printf(ctrlr, "nvme_identify_namespace failed\n"); return (ENXIO); Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Mon Sep 2 17:10:46 2019 (r351704) +++ head/sys/dev/nvme/nvme_private.h Mon Sep 2 17:11:27 2019 (r351705) @@ -446,6 +446,14 @@ int nvme_attach(device_t dev); int nvme_shutdown(device_t dev); int nvme_detach(device_t dev); +static __inline +void +nvme_completion_poll(struct nvme_completion_poll_status *status) +{ + while (!atomic_load_acq_int(&status->done)) + pause("nvme", 1); +} + static __inline void nvme_single_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) { From owner-svn-src-head@freebsd.org Mon Sep 2 17:11:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73656E3595; Mon, 2 Sep 2019 17:11:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Mc7T1fGsz42c3; Mon, 2 Sep 2019 17:11:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AE8A1D4A7; Mon, 2 Sep 2019 17:11:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82HBWvT096349; Mon, 2 Sep 2019 17:11:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82HBWi1096348; Mon, 2 Sep 2019 17:11:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909021711.x82HBWi1096348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 2 Sep 2019 17:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351706 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 351706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 17:11:33 -0000 Author: imp Date: Mon Sep 2 17:11:32 2019 New Revision: 351706 URL: https://svnweb.freebsd.org/changeset/base/351706 Log: In nvme_completion_poll, add a sanity check to make sure that we complete the polling within a second. Panic if we don't. All the commands that use this interface should typically complete within a few tens to hundreds of microseconds. Panic rather than return ETIMEDOUT because if the command somehow does later complete, it will randomly corrupt memory. Also, it helps to get a traceback from where the unexpected failure happens, rather than an infinite loop. Modified: head/sys/dev/nvme/nvme_private.h Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Mon Sep 2 17:11:27 2019 (r351705) +++ head/sys/dev/nvme/nvme_private.h Mon Sep 2 17:11:32 2019 (r351706) @@ -446,12 +446,24 @@ int nvme_attach(device_t dev); int nvme_shutdown(device_t dev); int nvme_detach(device_t dev); +/* + * Wait for a command to complete using the nvme_completion_poll_cb. + * Used in limited contexts where the caller knows it's OK to block + * briefly while the command runs. The ISR will run the callback which + * will set status->done to true.usually within microseconds. A 1s + * pause means something is seriously AFU and we should panic to + * provide the proper context to diagnose. + */ static __inline void nvme_completion_poll(struct nvme_completion_poll_status *status) { - while (!atomic_load_acq_int(&status->done)) + int sanity = hz * 1; + + while (!atomic_load_acq_int(&status->done) && --sanity > 0) pause("nvme", 1); + if (sanity <= 0) + panic("NVME polled command failed to complete within 1s."); } static __inline void From owner-svn-src-head@freebsd.org Mon Sep 2 17:53:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81554E46CA; Mon, 2 Sep 2019 17:53:34 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Md3x39Jxz46cb; Mon, 2 Sep 2019 17:53:33 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92 (FreeBSD)) (envelope-from ) id 1i4qWA-000BAX-US; Mon, 02 Sep 2019 10:53:32 -0700 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id x82HrUSl042936; Mon, 2 Sep 2019 10:53:30 -0700 (PDT) (envelope-from gonzo@bluezbox.com) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@bluezbox.com using -f Date: Mon, 2 Sep 2019 10:53:30 -0700 From: Oleksandr Tymoshenko To: Hans Petter Selasky Cc: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351616 - head/sys/dev/usb/net Message-ID: <20190902175330.GA42895@bluezbox.com> References: <201908300005.x7U055YI057385@repo.freebsd.org> <20190902002916.GA25603@bluezbox.com> <0d3a2c7f-b016-9c42-3f13-32f3e9fb3dde@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0d3a2c7f-b016-9c42-3f13-32f3e9fb3dde@selasky.org> X-Operating-System: FreeBSD/11.2-RELEASE-p10 (amd64) User-Agent: Mutt/1.12.1 (2019-06-15) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Hans Petter Selasky (hps@selasky.org) wrote: > On 2019-09-02 02:29, Oleksandr Tymoshenko wrote: > > Gleb Smirnoff (glebius@FreeBSD.org) wrote: > >> Author: glebius > >> Date: Fri Aug 30 00:05:04 2019 [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Rspamd-Queue-Id: 46Md3x39Jxz46cb X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of gonzo@bluezbox.com designates 45.55.20.155 as permitted sender) smtp.mailfrom=gonzo@bluezbox.com X-Spamd-Result: default: False [-5.50 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[bluezbox.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; IP_SCORE(-2.26)[ip: (-8.45), ipnet: 45.55.0.0/19(-4.23), asn: 14061(1.44), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:14061, ipnet:45.55.0.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 17:53:34 -0000 Hans Petter Selasky (hps@selasky.org) wrote: > On 2019-09-02 02:29, Oleksandr Tymoshenko wrote: > > Gleb Smirnoff (glebius@FreeBSD.org) wrote: > >> Author: glebius > >> Date: Fri Aug 30 00:05:04 2019 > >> New Revision: 351616 > >> URL: https://svnweb.freebsd.org/changeset/base/351616 > >> > >> Log: > >> Use mbuf queue instead of ifqueue in USB network drivers. > > > > Hi Gleb, > > > > This change broke NFS root on RPi. I suspect it's not just NFS root > > but USB ethernet functionality in general. Patch below fixes it for me. > > The same patch probably should also be applied to if_axe and if_axge. > > > > Hi, > > 1) axe and axge use the common code, so no patch needed there from what > I can see. > > 2) This queue should be unlimited. > > See: > https://svnweb.freebsd.org/changeset/base/351692 Thanks for a quick fix. Can confirm that latest HEAD boots fine now with NFS root. -- gonzo From owner-svn-src-head@freebsd.org Mon Sep 2 18:10:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C363E4B33; Mon, 2 Sep 2019 18:10:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MdRc197Mz47LG; Mon, 2 Sep 2019 18:10:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B4E11DF76; Mon, 2 Sep 2019 18:10:36 +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 x82IAZMM032309; Mon, 2 Sep 2019 18:10:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82IAZ6M032308; Mon, 2 Sep 2019 18:10:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201909021810.x82IAZ6M032308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 2 Sep 2019 18:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351723 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 351723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 18:10:36 -0000 Author: trasz Date: Mon Sep 2 18:10:35 2019 New Revision: 351723 URL: https://svnweb.freebsd.org/changeset/base/351723 Log: Bump Linux version to 3.2.0. Without it, binaries linked against glibc 2.24 and up (eg Ubuntu 19.04) fail with "FATAL: kernel too old". This alone is not enough to make newer binaries actually work; fix/hack/workaround is pending review at https://reviews.freebsd.org/D20687. Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20757 Modified: head/sys/compat/linux/linux_mib.h Modified: head/sys/compat/linux/linux_mib.h ============================================================================== --- head/sys/compat/linux/linux_mib.h Mon Sep 2 17:55:39 2019 (r351722) +++ head/sys/compat/linux/linux_mib.h Mon Sep 2 18:10:35 2019 (r351723) @@ -46,9 +46,9 @@ int linux_get_oss_version(struct thread *td); int linux_kernver(struct thread *td); -#define LINUX_KVERSION 2 -#define LINUX_KPATCHLEVEL 6 -#define LINUX_KSUBLEVEL 36 +#define LINUX_KVERSION 3 +#define LINUX_KPATCHLEVEL 2 +#define LINUX_KSUBLEVEL 0 #define LINUX_KERNVER(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #define LINUX_VERSION_CODE LINUX_KERNVER(LINUX_KVERSION, \ From owner-svn-src-head@freebsd.org Mon Sep 2 18:32:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DDEBE5396; Mon, 2 Sep 2019 18:32:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MdwT2n2sz48R0; Mon, 2 Sep 2019 18:32:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 424821E4C9; Mon, 2 Sep 2019 18:32:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82IW9tM048107; Mon, 2 Sep 2019 18:32:09 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82IW9Jl048106; Mon, 2 Sep 2019 18:32:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201909021832.x82IW9Jl048106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 2 Sep 2019 18:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351724 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 351724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 18:32:09 -0000 Author: ian Date: Mon Sep 2 18:32:08 2019 New Revision: 351724 URL: https://svnweb.freebsd.org/changeset/base/351724 Log: Fix the name of the devicetree bindings document file cited in the manpage. Reported by: thj@ Modified: head/share/man/man4/ads111x.4 Modified: head/share/man/man4/ads111x.4 ============================================================================== --- head/share/man/man4/ads111x.4 Mon Sep 2 18:10:35 2019 (r351723) +++ head/share/man/man4/ads111x.4 Mon Sep 2 18:32:08 2019 (r351724) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 12, 2019 +.Dd September 2, 2019 .Dt ADS111x 4 .Os .Sh NAME @@ -160,7 +160,7 @@ based system, the device is defined as a slave device subnode of the i2c bus controller node. All properties documented in the -.Va ads1115.txt +.Va ads1015.txt bindings document can be used with the .Nm device. @@ -182,7 +182,7 @@ I2c slave address of device. .Pp Specific channels can be configured by adding child nodes to the .Nm -node, as described in the standard ads1115.txt bindings document. +node, as described in the standard ads1015.txt bindings document. If no channels are configured, sysctl variables will be created for all possible channels supported by the device type, otherwise only the specified channels are created. From owner-svn-src-head@freebsd.org Mon Sep 2 19:04:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56535E5DC0; Mon, 2 Sep 2019 19:04:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MfdJ1Sxrz4B0Y; Mon, 2 Sep 2019 19:04:04 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15AF81EA95; Mon, 2 Sep 2019 19:04:04 +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 x82J43U3067594; Mon, 2 Sep 2019 19:04:03 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82J43vt067590; Mon, 2 Sep 2019 19:04:03 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909021904.x82J43vt067590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 2 Sep 2019 19:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351725 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 351725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 19:04:04 -0000 Author: tuexen Date: Mon Sep 2 19:04:02 2019 New Revision: 351725 URL: https://svnweb.freebsd.org/changeset/base/351725 Log: This patch improves the DSACK handling to conform with RFC 2883. The lowest SACK block is used when multiple Blocks would be elegible as DSACK blocks ACK blocks get reordered - while maintaining the ordering of SACK blocks not relevant in the DSACK context is maintained. Reviewed by: rrs@, tuexen@ Obtained from: Richard Scheffenegger MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21038 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_stacks/rack_bbr_common.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Sep 2 18:32:08 2019 (r351724) +++ head/sys/netinet/tcp_input.c Mon Sep 2 19:04:02 2019 (r351725) @@ -1486,7 +1486,6 @@ tcp_autorcvbuf(struct mbuf *m, struct tcphdr *th, stru } else { tp->rfbuf_cnt += tlen; /* add up */ } - return (newsize); } Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Mon Sep 2 18:32:08 2019 (r351724) +++ head/sys/netinet/tcp_sack.c Mon Sep 2 19:04:02 2019 (r351725) @@ -149,7 +149,109 @@ SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, globalholes, &VNET_NAME(tcp_sack_globalholes), 0, "Global number of TCP SACK holes currently allocated"); + /* + * This function will find overlaps with the currently stored sackblocks + * and add any overlap as a dsack block upfront + */ +void +tcp_update_dsack_list(struct tcpcb *tp, tcp_seq rcv_start, tcp_seq rcv_end) +{ + struct sackblk head_blk,mid_blk,saved_blks[MAX_SACK_BLKS]; + int i, j, n, identical; + tcp_seq start, end; + + INP_WLOCK_ASSERT(tp->t_inpcb); + + KASSERT(SEQ_LT(rcv_start, rcv_end), ("rcv_start < rcv_end")); + + if (tp->t_inpcb->inp_socket->so_options & SO_DEBUG) { + log(LOG_DEBUG, "\nDSACK update: %d..%d, rcv_nxt: %u\n", + rcv_start, rcv_end, tp->rcv_nxt); + } + + if (SEQ_LT(rcv_end, tp->rcv_nxt) || + ((rcv_end == tp->rcv_nxt) && + (tp->rcv_numsacks > 0 ) && + (tp->sackblks[0].end == tp->rcv_nxt))) { + saved_blks[0].start = rcv_start; + saved_blks[0].end = rcv_end; + } else { + saved_blks[0].start = saved_blks[0].end = 0; + } + + head_blk.start = head_blk.end = 0; + mid_blk.start = rcv_start; + mid_blk.end = rcv_end; + identical = 0; + + for (i = 0; i < tp->rcv_numsacks; i++) { + start = tp->sackblks[i].start; + end = tp->sackblks[i].end; + if (SEQ_LT(rcv_end, start)) { + /* pkt left to sack blk */ + continue; + } + if (SEQ_GT(rcv_start, end)) { + /* pkt right to sack blk */ + continue; + } + if (SEQ_GT(tp->rcv_nxt, end)) { + if ((SEQ_MAX(rcv_start, start) != SEQ_MIN(rcv_end, end)) && + (SEQ_GT(head_blk.start, SEQ_MAX(rcv_start, start)) || + (head_blk.start == head_blk.end))) { + head_blk.start = SEQ_MAX(rcv_start, start); + head_blk.end = SEQ_MIN(rcv_end, end); + } + continue; + } + if (((head_blk.start == head_blk.end) || + SEQ_LT(start, head_blk.start)) && + (SEQ_GT(end, rcv_start) && + SEQ_LEQ(start, rcv_end))) { + head_blk.start = start; + head_blk.end = end; + } + mid_blk.start = SEQ_MIN(mid_blk.start, start); + mid_blk.end = SEQ_MAX(mid_blk.end, end); + if ((mid_blk.start == start) && + (mid_blk.end == end)) + identical = 1; + } + if (SEQ_LT(head_blk.start, head_blk.end)) { + /* store overlapping range */ + saved_blks[0].start = SEQ_MAX(rcv_start, head_blk.start); + saved_blks[0].end = SEQ_MIN(rcv_end, head_blk.end); + } + n = 1; + /* + * Second, if not ACKed, store the SACK block that + * overlaps with the DSACK block unless it is identical + */ + if ((SEQ_LT(tp->rcv_nxt, mid_blk.end) && + !((mid_blk.start == saved_blks[0].start) && + (mid_blk.end == saved_blks[0].end))) || + identical == 1) { + saved_blks[n].start = mid_blk.start; + saved_blks[n++].end = mid_blk.end; + } + for (j = 0; (j < tp->rcv_numsacks) && (j < MAX_SACK_BLKS-1); j++) { + if (((SEQ_LT(tp->sackblks[j].end, mid_blk.start) || + SEQ_GT(tp->sackblks[j].start, mid_blk.end)) && + (SEQ_GT(tp->sackblks[j].start, tp->rcv_nxt)))) + saved_blks[n++] = tp->sackblks[j]; + } + j = 0; + for (i = 0; i < n; i++) { + /* we can end up with a stale inital entry */ + if (SEQ_LT(saved_blks[i].start, saved_blks[i].end)) { + tp->sackblks[j++] = saved_blks[i]; + } + } + tp->rcv_numsacks = j; +} + +/* * This function is called upon receipt of new valid data (while not in * header prediction mode), and it updates the ordered list of sacks. */ @@ -170,9 +272,16 @@ tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_sta /* Check arguments. */ KASSERT(SEQ_LEQ(rcv_start, rcv_end), ("rcv_start <= rcv_end")); - /* SACK block for the received segment. */ - head_blk.start = rcv_start; - head_blk.end = rcv_end; + if ((rcv_start == rcv_end) && + (tp->rcv_numsacks >= 1) && + (rcv_end == tp->sackblks[0].end)) { + /* retaining DSACK block below rcv_nxt (todrop) */ + head_blk = tp->sackblks[0]; + } else { + /* SACK block for the received segment. */ + head_blk.start = rcv_start; + head_blk.end = rcv_end; + } /* * Merge updated SACK blocks into head_blk, and save unchanged SACK @@ -266,6 +375,10 @@ tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_sta */ if (num_saved >= MAX_SACK_BLKS) num_saved--; + } + if ((rcv_start == rcv_end) && + (rcv_start == tp->sackblks[0].end)) { + num_head = 1; } if (num_saved > 0) { /* Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Mon Sep 2 18:32:08 2019 (r351724) +++ head/sys/netinet/tcp_stacks/rack.c Mon Sep 2 19:04:02 2019 (r351725) @@ -1783,6 +1783,14 @@ rack_drop_checks(struct tcpopt *to, struct mbuf *m, st TCPSTAT_INC(tcps_rcvpartduppack); TCPSTAT_ADD(tcps_rcvpartdupbyte, todrop); } + if (tp->t_flags & TF_SACK_PERMIT) { + /* + * record the left, to-be-dropped edge of data + * here, for use as dsack block further down + */ + tcp_update_sack_list(tp, th->th_seq, + th->th_seq + todrop); + } *drop_hdrlen += todrop; /* drop from the top afterwards */ th->th_seq += todrop; tlen -= todrop; @@ -4900,7 +4908,8 @@ dodata: /* XXX */ (TCPS_HAVEESTABLISHED(tp->t_state) || tfo_syn)) { if (DELAY_ACK(tp, tlen) || tfo_syn) { - rack_timer_cancel(tp, rack, rack->r_ctl.rc_rcvtime, __LINE__); + rack_timer_cancel(tp, rack, + rack->r_ctl.rc_rcvtime, __LINE__); tp->t_flags |= TF_DELACK; } else { rack->r_wanted_output++; @@ -4934,18 +4943,29 @@ dodata: /* XXX */ * DSACK actually handled in the fastpath * above. */ - tcp_update_sack_list(tp, save_start, save_start + save_tlen); + tcp_update_sack_list(tp, save_start, + save_start + save_tlen); } else if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { /* * Cleaning sackblks by using zero length * update. */ - tcp_update_sack_list(tp, save_start, save_start); + if ((tp->rcv_numsacks >= 1) && + (tp->sackblks[0].end == save_start)) { + /* partial overlap, recorded at todrop above */ + tcp_update_sack_list(tp, tp->sackblks[0].start, + tp->sackblks[0].end); + } else { + tcp_update_dsack_list(tp, save_start, + save_start + save_tlen); + } } else if ((tlen > 0) && (tlen >= save_tlen)) { /* Update of sackblks. */ - tcp_update_sack_list(tp, save_start, save_start + save_tlen); + tcp_update_dsack_list(tp, save_start, + save_start + save_tlen); } else if (tlen > 0) { - tcp_update_sack_list(tp, save_start, save_start+tlen); + tcp_update_dsack_list(tp, save_start, + save_start + tlen); } } else { m_freem(m); @@ -4967,7 +4987,8 @@ dodata: /* XXX */ * now. */ if (tp->t_flags & TF_NEEDSYN) { - rack_timer_cancel(tp, rack, rack->r_ctl.rc_rcvtime, __LINE__); + rack_timer_cancel(tp, rack, + rack->r_ctl.rc_rcvtime, __LINE__); tp->t_flags |= TF_DELACK; } else { tp->t_flags |= TF_ACKNOW; @@ -4984,7 +5005,8 @@ dodata: /* XXX */ tp->t_starttime = ticks; /* FALLTHROUGH */ case TCPS_ESTABLISHED: - rack_timer_cancel(tp, rack, rack->r_ctl.rc_rcvtime, __LINE__); + rack_timer_cancel(tp, rack, + rack->r_ctl.rc_rcvtime, __LINE__); tcp_state_change(tp, TCPS_CLOSE_WAIT); break; @@ -4993,7 +5015,8 @@ dodata: /* XXX */ * acked so enter the CLOSING state. */ case TCPS_FIN_WAIT_1: - rack_timer_cancel(tp, rack, rack->r_ctl.rc_rcvtime, __LINE__); + rack_timer_cancel(tp, rack, + rack->r_ctl.rc_rcvtime, __LINE__); tcp_state_change(tp, TCPS_CLOSING); break; @@ -5003,7 +5026,8 @@ dodata: /* XXX */ * other standard timers. */ case TCPS_FIN_WAIT_2: - rack_timer_cancel(tp, rack, rack->r_ctl.rc_rcvtime, __LINE__); + rack_timer_cancel(tp, rack, + rack->r_ctl.rc_rcvtime, __LINE__); INP_INFO_RLOCK_ASSERT(&V_tcbinfo); tcp_twstart(tp); return (1); @@ -5012,7 +5036,8 @@ dodata: /* XXX */ /* * Return any desired output. */ - if ((tp->t_flags & TF_ACKNOW) || (sbavail(&so->so_snd) > (tp->snd_max - tp->snd_una))) { + if ((tp->t_flags & TF_ACKNOW) || + (sbavail(&so->so_snd) > (tp->snd_max - tp->snd_una))) { rack->r_wanted_output++; } INP_WLOCK_ASSERT(tp->t_inpcb); Modified: head/sys/netinet/tcp_stacks/rack_bbr_common.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack_bbr_common.c Mon Sep 2 18:32:08 2019 (r351724) +++ head/sys/netinet/tcp_stacks/rack_bbr_common.c Mon Sep 2 19:04:02 2019 (r351725) @@ -495,7 +495,8 @@ ctf_drop_checks(struct tcpopt *to, struct mbuf *m, str * DSACK - add SACK block for dropped range */ if (tp->t_flags & TF_SACK_PERMIT) { - tcp_update_sack_list(tp, th->th_seq, th->th_seq + tlen); + tcp_update_sack_list(tp, th->th_seq, + th->th_seq + todrop); /* * ACK now, as the next in-sequence segment * will clear the DSACK block again Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Mon Sep 2 18:32:08 2019 (r351724) +++ head/sys/netinet/tcp_var.h Mon Sep 2 19:04:02 2019 (r351725) @@ -939,6 +939,7 @@ uint32_t tcp_new_ts_offset(struct in_conninfo *); tcp_seq tcp_new_isn(struct in_conninfo *); int tcp_sack_doack(struct tcpcb *, struct tcpopt *, tcp_seq); +void tcp_update_dsack_list(struct tcpcb *, tcp_seq, tcp_seq); void tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_laststart, tcp_seq rcv_lastend); void tcp_clean_dsack_blocks(struct tcpcb *tp); void tcp_clean_sackreport(struct tcpcb *tp); From owner-svn-src-head@freebsd.org Mon Sep 2 21:54:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 961B5E8BE8; Mon, 2 Sep 2019 21:54:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MkPY3V8Xz4LwR; Mon, 2 Sep 2019 21:54:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C1DA20984; Mon, 2 Sep 2019 21:54:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82Ls9DN070498; Mon, 2 Sep 2019 21:54:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82Ls9Ed070497; Mon, 2 Sep 2019 21:54:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909022154.x82Ls9Ed070497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 2 Sep 2019 21:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351727 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 351727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 21:54:09 -0000 Author: markj Date: Mon Sep 2 21:54:08 2019 New Revision: 351727 URL: https://svnweb.freebsd.org/changeset/base/351727 Log: Replace PMAP_LARGEMAP_MAX_ADDRESS() with a more general predicate. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Sep 2 21:52:18 2019 (r351726) +++ head/sys/amd64/amd64/pmap.c Mon Sep 2 21:54:08 2019 (r351727) @@ -424,8 +424,8 @@ static int pmap_flags = PMAP_PDE_SUPERPAGE; /* flags f static vmem_t *large_vmem; static u_int lm_ents; -#define PMAP_LARGEMAP_MAX_ADDRESS() \ - (LARGEMAP_MIN_ADDRESS + NBPML4 * (u_long)lm_ents) +#define PMAP_ADDRESS_IN_LARGEMAP(va) ((va) >= LARGEMAP_MIN_ADDRESS && \ + (va) < LARGEMAP_MIN_ADDRESS + NBPML4 * (u_long)lm_ents) int pmap_pcid_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, @@ -3091,8 +3091,7 @@ pmap_kextract(vm_offset_t va) if (va >= DMAP_MIN_ADDRESS && va < DMAP_MAX_ADDRESS) { pa = DMAP_TO_PHYS(va); - } else if (LARGEMAP_MIN_ADDRESS <= va && - va < PMAP_LARGEMAP_MAX_ADDRESS()) { + } else if (PMAP_ADDRESS_IN_LARGEMAP(va)) { pa = pmap_large_map_kextract(va); } else { pde = *vtopde(va); @@ -9022,7 +9021,7 @@ pmap_large_map_kextract(vm_offset_t va) pd_entry_t *pde, pd; pt_entry_t *pte, pt; - KASSERT(LARGEMAP_MIN_ADDRESS <= va && va < PMAP_LARGEMAP_MAX_ADDRESS(), + KASSERT(PMAP_ADDRESS_IN_LARGEMAP(va), ("not largemap range %#lx", (u_long)va)); pdpe = pmap_large_map_pdpe(va); pdp = *pdpe; @@ -9164,8 +9163,8 @@ pmap_large_unmap(void *svaa, vm_size_t len) return; SLIST_INIT(&spgf); - KASSERT(LARGEMAP_MIN_ADDRESS <= sva && - sva + len <= PMAP_LARGEMAP_MAX_ADDRESS(), + KASSERT(PMAP_ADDRESS_IN_LARGEMAP(sva) && + PMAP_ADDRESS_IN_LARGEMAP(sva + len - 1), ("not largemap range %#lx %#lx", (u_long)svaa, (u_long)svaa + len)); PMAP_LOCK(kernel_pmap); for (va = sva; va < sva + len; va += inc) { From owner-svn-src-head@freebsd.org Mon Sep 2 21:57:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58684E8D32; Mon, 2 Sep 2019 21:57:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MkTy1WbQz4M58; Mon, 2 Sep 2019 21:57:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 134F720985; Mon, 2 Sep 2019 21:57:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x82Lvv1m070734; Mon, 2 Sep 2019 21:57:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x82LvvUx070733; Mon, 2 Sep 2019 21:57:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909022157.x82LvvUx070733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 2 Sep 2019 21:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351728 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 351728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 21:57:58 -0000 Author: markj Date: Mon Sep 2 21:57:57 2019 New Revision: 351728 URL: https://svnweb.freebsd.org/changeset/base/351728 Log: Add a sysctl to dump kernel mappings and their properties on amd64. The sysctl is called vm.pmap.kernel_maps. It dumps address ranges and their corresponding protection and mapping mode, as well as counts of 2MB and 1GB pages in the range. Reviewed by: kib MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21380 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Sep 2 21:54:08 2019 (r351727) +++ head/sys/amd64/amd64/pmap.c Mon Sep 2 21:57:57 2019 (r351728) @@ -124,6 +124,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2112,6 +2113,41 @@ pmap_cache_mask(pmap_t pmap, boolean_t is_pde) return (mask); } +static int +pmap_pat_index(pmap_t pmap, pt_entry_t pte, bool is_pde) +{ + int pat_flag, pat_idx; + + pat_idx = 0; + switch (pmap->pm_type) { + case PT_X86: + case PT_RVI: + /* The PAT bit is different for PTE's and PDE's. */ + pat_flag = is_pde ? X86_PG_PDE_PAT : X86_PG_PTE_PAT; + + if ((pte & pat_flag) != 0) + pat_idx |= 0x4; + if ((pte & PG_NC_PCD) != 0) + pat_idx |= 0x2; + if ((pte & PG_NC_PWT) != 0) + pat_idx |= 0x1; + break; + case PT_EPT: + if ((pte & EPT_PG_IGNORE_PAT) != 0) + panic("EPT PTE %#lx has no PAT memory type", pte); + pat_idx = (pte & EPT_PG_MEMORY_TYPE(0x7)) >> 3; + break; + } + + /* See pmap_init_pat(). */ + if (pat_idx == 4) + pat_idx = 0; + if (pat_idx == 7) + pat_idx = 3; + + return (pat_idx); +} + bool pmap_ps_enabled(pmap_t pmap) { @@ -9980,6 +10016,268 @@ pmap_pkru_clear(pmap_t pmap, vm_offset_t sva, vm_offse } return (error); } + +/* + * Track a range of the kernel's virtual address space that is contiguous + * in various mapping attributes. + */ +struct pmap_kernel_map_range { + vm_offset_t sva; + pt_entry_t attrs; + int ptes; + int pdes; + int pdpes; +}; + +static void +sysctl_kmaps_dump(struct sbuf *sb, struct pmap_kernel_map_range *range, + vm_offset_t eva) +{ + const char *mode; + int i, pat_idx; + + if (eva <= range->sva) + return; + + pat_idx = pmap_pat_index(kernel_pmap, range->attrs, true); + for (i = 0; i < PAT_INDEX_SIZE; i++) + if (pat_index[i] == pat_idx) + break; + + switch (i) { + case PAT_WRITE_BACK: + mode = "WB"; + break; + case PAT_WRITE_THROUGH: + mode = "WT"; + break; + case PAT_UNCACHEABLE: + mode = "UC"; + break; + case PAT_WRITE_PROTECTED: + mode = "WP"; + break; + case PAT_WRITE_COMBINING: + mode = "WC"; + break; + default: + printf("%s: unknown PAT mode %#x for range %#016lx-%#016lx\n", + __func__, i, range->sva, eva); + mode = "??"; + break; + } + + sbuf_printf(sb, "%#016lx-%#016lx r%c%c%c%c %s %d %d %d\n", + range->sva, eva, + (range->attrs & X86_PG_RW) != 0 ? 'w' : '-', + (range->attrs & pg_nx) != 0 ? '-' : 'x', + (range->attrs & X86_PG_U) != 0 ? 'u' : 's', + (range->attrs & X86_PG_G) != 0 ? 'g' : '-', + mode, range->pdpes, range->pdes, range->ptes); + + /* Reset to sentinel value. */ + range->sva = KVADDR(NPML4EPG - 1, NPDPEPG - 1, NPDEPG - 1, NPTEPG - 1); +} + +/* + * Determine whether the attributes specified by a page table entry match those + * being tracked by the current range. This is not quite as simple as a direct + * flag comparison since some PAT modes have multiple representations. + */ +static bool +sysctl_kmaps_match(struct pmap_kernel_map_range *range, pt_entry_t attrs) +{ + pt_entry_t diff, mask; + + mask = X86_PG_G | X86_PG_RW | X86_PG_U | X86_PG_PDE_CACHE | pg_nx; + diff = (range->attrs ^ attrs) & mask; + if (diff == 0) + return (true); + if ((diff & ~X86_PG_PDE_PAT) == 0 && + pmap_pat_index(kernel_pmap, range->attrs, true) == + pmap_pat_index(kernel_pmap, attrs, true)) + return (true); + return (false); +} + +static void +sysctl_kmaps_reinit(struct pmap_kernel_map_range *range, vm_offset_t va, + pt_entry_t attrs) +{ + + memset(range, 0, sizeof(*range)); + range->sva = va; + range->attrs = attrs; +} + +/* + * Given a leaf PTE, derive the mapping's attributes. If they do not match + * those of the current run, dump the address range and its attributes, and + * begin a new run. + */ +static void +sysctl_kmaps_check(struct sbuf *sb, struct pmap_kernel_map_range *range, + vm_offset_t va, pml4_entry_t pml4e, pdp_entry_t pdpe, pd_entry_t pde, + pt_entry_t pte) +{ + pt_entry_t attrs; + + attrs = pml4e & (X86_PG_RW | X86_PG_U | pg_nx); + + attrs |= pdpe & pg_nx; + attrs &= pg_nx | (pdpe & (X86_PG_RW | X86_PG_U)); + if ((pdpe & PG_PS) != 0) { + attrs |= pdpe & (X86_PG_G | X86_PG_PDE_CACHE); + } else if (pde != 0) { + attrs |= pde & pg_nx; + attrs &= pg_nx | (pde & (X86_PG_RW | X86_PG_U)); + } + if ((pde & PG_PS) != 0) { + attrs |= pde & (X86_PG_G | X86_PG_PDE_CACHE); + } else if (pte != 0) { + attrs |= pte & pg_nx; + attrs &= pg_nx | (pte & (X86_PG_RW | X86_PG_U)); + attrs |= pte & (X86_PG_G | X86_PG_PTE_CACHE); + + /* Canonicalize by always using the PDE PAT bit. */ + if ((attrs & X86_PG_PTE_PAT) != 0) + attrs ^= X86_PG_PDE_PAT | X86_PG_PTE_PAT; + } + + if (range->sva > va || !sysctl_kmaps_match(range, attrs)) { + sysctl_kmaps_dump(sb, range, va); + sysctl_kmaps_reinit(range, va, attrs); + } +} + +static int +sysctl_kmaps(SYSCTL_HANDLER_ARGS) +{ + struct pmap_kernel_map_range range; + struct sbuf sbuf, *sb; + pml4_entry_t pml4e; + pdp_entry_t *pdp, pdpe; + pd_entry_t *pd, pde; + pt_entry_t *pt, pte; + vm_offset_t sva; + vm_paddr_t pa; + int error, i, j, k, l; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + sb = &sbuf; + sbuf_new_for_sysctl(sb, NULL, PAGE_SIZE, req); + + /* Sentinel value. */ + range.sva = KVADDR(NPML4EPG - 1, NPDPEPG - 1, NPDEPG - 1, NPTEPG - 1); + + /* + * Iterate over the kernel page tables without holding the kernel pmap + * lock. Outside of the large map, kernel page table pages are never + * freed, so at worst we will observe inconsistencies in the output. + * Within the large map, ensure that PDP and PD page addresses are + * valid before descending. + */ + for (sva = 0, i = pmap_pml4e_index(sva); i < NPML4EPG; i++) { + switch (i) { + case PML4PML4I: + sbuf_printf(sb, "\nRecursive map:\n"); + break; + case DMPML4I: + sbuf_printf(sb, "\nDirect map:\n"); + break; + case KPML4BASE: + sbuf_printf(sb, "\nKernel map:\n"); + break; + case LMSPML4I: + sbuf_printf(sb, "\nLarge map:\n"); + break; + } + + /* Convert to canonical form. */ + if (sva == 1ul << 47) + sva |= -1ul << 48; + +restart: + pml4e = kernel_pmap->pm_pml4[i]; + if ((pml4e & X86_PG_V) == 0) { + sva = rounddown2(sva, NBPML4); + sysctl_kmaps_dump(sb, &range, sva); + sva += NBPML4; + continue; + } + pa = pml4e & PG_FRAME; + pdp = (pdp_entry_t *)PHYS_TO_DMAP(pa); + + for (j = pmap_pdpe_index(sva); j < NPDPEPG; j++) { + pdpe = pdp[j]; + if ((pdpe & X86_PG_V) == 0) { + sva = rounddown2(sva, NBPDP); + sysctl_kmaps_dump(sb, &range, sva); + sva += NBPDP; + continue; + } + pa = pdpe & PG_FRAME; + if (PMAP_ADDRESS_IN_LARGEMAP(sva) && + vm_phys_paddr_to_vm_page(pa) == NULL) + goto restart; + if ((pdpe & PG_PS) != 0) { + sva = rounddown2(sva, NBPDP); + sysctl_kmaps_check(sb, &range, sva, pml4e, pdpe, + 0, 0); + range.pdpes++; + sva += NBPDP; + continue; + } + pd = (pd_entry_t *)PHYS_TO_DMAP(pa); + + for (k = pmap_pde_index(sva); k < NPDEPG; k++) { + pde = pd[k]; + if ((pde & X86_PG_V) == 0) { + sva = rounddown2(sva, NBPDR); + sysctl_kmaps_dump(sb, &range, sva); + sva += NBPDR; + continue; + } + pa = pde & PG_FRAME; + if (PMAP_ADDRESS_IN_LARGEMAP(sva) && + vm_phys_paddr_to_vm_page(pa) == NULL) + goto restart; + if ((pde & PG_PS) != 0) { + sva = rounddown2(sva, NBPDR); + sysctl_kmaps_check(sb, &range, sva, + pml4e, pdpe, pde, 0); + range.pdes++; + sva += NBPDR; + continue; + } + pt = (pt_entry_t *)PHYS_TO_DMAP(pa); + + for (l = pmap_pte_index(sva); l < NPTEPG; l++, + sva += PAGE_SIZE) { + pte = pt[l]; + if ((pte & X86_PG_V) == 0) { + sysctl_kmaps_dump(sb, &range, + sva); + continue; + } + sysctl_kmaps_check(sb, &range, sva, + pml4e, pdpe, pde, pte); + range.ptes++; + } + } + } + } + + error = sbuf_finish(sb); + sbuf_delete(sb); + return (error); +} +SYSCTL_OID(_vm_pmap, OID_AUTO, kernel_maps, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, sysctl_kmaps, "A", + "Dump kernel address layout"); #ifdef DDB DB_SHOW_COMMAND(pte, pmap_print_pte) From owner-svn-src-head@freebsd.org Mon Sep 2 21:59:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37E26E8D9D; Mon, 2 Sep 2019 21:59:00 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MkW737Gpz4MCt; Mon, 2 Sep 2019 21:58:59 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd2c.google.com with SMTP id h144so16190473iof.7; Mon, 02 Sep 2019 14:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=MNI2C+Stv4ky+M5Ijkp0vF/JeIzMu72hJHSoqlJtCiA=; b=p9uWoOlo5FIHaX4dShrg/vbYoz68q+iXl7mFU1o+1lUnFir03z0+vOWVQJ6b/uTKoB kTYR9X/7fZakU5Ls/+NKVaNw5rld/c4FcMG+zX4IGIrD0E7quv6N6YWrmJ3wuhBtVr6G vGAqrzZeZTV4nCgbTg28Avw/qUvAj83ommCdEZEFHqtguAVOQZXCVTeEfSVhPdqcUbv+ u1d3tof2PuJxyMML/6TUPswIxAcNFBPJR8Qly3oNbl0LiKAC8frFq4LWl7Pu2THrBOKp hnV7Lj5LkpqSIHjiVzWg/kb8kBEu7GBpl6La1eGk/jhF2tHWK4GW/bXWU3ui8sSZ3TNC EXgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=MNI2C+Stv4ky+M5Ijkp0vF/JeIzMu72hJHSoqlJtCiA=; b=aRe24125bECJ6zrViv4nyaE468S7Upc7pMV0Z3AAQKSzrDL4h5T9oKjFFgwkQhsFu8 HfA+nQwVxqnX5al+hH86jPfZF+taXStNdTr52RjZp33qBvtYHrt4m9t9uzaYynnqWFXN opOwtfEWVI7a9ymzVNKy5Sq53LC3vK8uUeFYicVBftDh3wB8QxqKdBuyF7//lUMxpOXi oI3LhaBM7jfqzad7bp5RuFBErvXiJw4r7jOs1c+p0jBaUfhqmYqU2mjOLyZFsvM3OYl+ 2dIenY9Mzqe7pqpqoyFF4aWvkkzDq/k15Wck5kRH/J+thFmqaP2QQagRTGr5XeP7l+p6 S9oQ== X-Gm-Message-State: APjAAAUM6AYIJ1jyQqb0T8vKKIqdC5dbxOQqS7i9RFwnDDraW5IlE0OD gNZaOJaStmcCLFbWXPAN4R/1aX4c X-Google-Smtp-Source: APXvYqx43JYLtcz9aegbEFsR+lYY924OC57nUk2n+6ZIAGsi0nWGmxdLySSGJE97y8vFPLfx0Kb6cg== X-Received: by 2002:a5d:9ac6:: with SMTP id x6mr31382928ion.227.1567461537793; Mon, 02 Sep 2019 14:58:57 -0700 (PDT) Received: from raichu (toroon0560w-lp140-03-184-148-66-213.dsl.bell.ca. [184.148.66.213]) by smtp.gmail.com with ESMTPSA id c11sm13521469ioq.63.2019.09.02.14.58.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 14:58:56 -0700 (PDT) Sender: Mark Johnston Date: Mon, 2 Sep 2019 17:58:52 -0400 From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351727 - head/sys/amd64/amd64 Message-ID: <20190902215852.GA38842@raichu> References: <201909022154.x82Ls9Ed070497@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201909022154.x82Ls9Ed070497@repo.freebsd.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46MkW737Gpz4MCt X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=p9uWoOlo; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::d2c as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-4.77 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.09)[ip: (-5.26), ipnet: 2607:f8b0::/32(-2.82), asn: 15169(-2.30), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; RCVD_IN_DNSWL_NONE(0.00)[c.2.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[213.66.148.184.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2019 21:59:00 -0000 On Mon, Sep 02, 2019 at 09:54:09PM +0000, Mark Johnston wrote: > Author: markj > Date: Mon Sep 2 21:54:08 2019 > New Revision: 351727 > URL: https://svnweb.freebsd.org/changeset/base/351727 > > Log: > Replace PMAP_LARGEMAP_MAX_ADDRESS() with a more general predicate. > > No functional change intended. > > Reviewed by: kib > MFC after: 1 week > Sponsored by: The FreeBSD Foundation Sorry, this should have been Sponsored by: Netflix. It was split out from the patch committed as r351728. From owner-svn-src-head@freebsd.org Tue Sep 3 04:16:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C67AAC9870; Tue, 3 Sep 2019 04:16:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Mttq5Jkmz3HHK; Tue, 3 Sep 2019 04:16:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 952FC24FB5; Tue, 3 Sep 2019 04:16:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x834GZ6Q004211; Tue, 3 Sep 2019 04:16:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x834GVwk004191; Tue, 3 Sep 2019 04:16:31 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909030416.x834GVwk004191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 3 Sep 2019 04:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351729 - in head: lib/libc/gen lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head: lib/libc/gen lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys X-SVN-Commit-Revision: 351729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 04:16:35 -0000 Author: mjg Date: Tue Sep 3 04:16:30 2019 New Revision: 351729 URL: https://svnweb.freebsd.org/changeset/base/351729 Log: Add sysctlbyname system call Previously userspace would issue one syscall to resolve the sysctl and then another one to actually use it. Do it all in one trip. Fallback is provided in case newer libc happens to be running on an older kernel. Submitted by: Pawel Biernacki Reported by: kib, brooks Differential Revision: https://reviews.freebsd.org/D17282 Modified: head/lib/libc/gen/sysctlbyname.c head/lib/libc/sys/Symbol.map head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/compat/freebsd32/syscalls.master head/sys/kern/capabilities.conf head/sys/kern/init_sysent.c head/sys/kern/kern_sysctl.c head/sys/kern/syscalls.c head/sys/kern/syscalls.master head/sys/kern/systrace_args.c head/sys/sys/param.h head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysctl.h head/sys/sys/sysproto.h Modified: head/lib/libc/gen/sysctlbyname.c ============================================================================== --- head/lib/libc/gen/sysctlbyname.c Mon Sep 2 21:57:57 2019 (r351728) +++ head/lib/libc/gen/sysctlbyname.c Tue Sep 3 04:16:30 2019 (r351729) @@ -1,28 +1,59 @@ -/* - * ---------------------------------------------------------------------------- - * "THE BEER-WARE LICENSE" (Revision 42): - * wrote this file. As long as you retain this notice you - * can do whatever you want with this stuff. If we meet some day, and you think - * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp - * ---------------------------------------------------------------------------- +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2019 Pawel Biernacki, Mysterious Code Ltd. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); -#include +#include #include +#include +#include "libc_private.h" + +#define SYSCTLBYNAME_OSREL 1300045 + +extern int __sysctlbyname(const char *name, size_t namelen, void *oldp, + size_t *oldlenp, const void *newp, size_t newlen); + int sysctlbyname(const char *name, void *oldp, size_t *oldlenp, const void *newp, size_t newlen) { - int real_oid[CTL_MAXNAME+2]; - size_t oidlen; + int oid[CTL_MAXNAME]; + size_t len; - oidlen = sizeof(real_oid) / sizeof(int); - if (sysctlnametomib(name, real_oid, &oidlen) < 0) + if (__getosreldate() >= SYSCTLBYNAME_OSREL) { + len = strlen(name); + return (__sysctlbyname(name, len, oldp, oldlenp, newp, + newlen)); + } + len = nitems(oid); + if (sysctlnametomib(name, oid, &len) == -1) return (-1); - return (sysctl(real_oid, oidlen, oldp, oldlenp, newp, newlen)); + return (sysctl(oid, len, oldp, oldlenp, newp, newlen)); } Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Mon Sep 2 21:57:57 2019 (r351728) +++ head/lib/libc/sys/Symbol.map Tue Sep 3 04:16:30 2019 (r351729) @@ -402,6 +402,7 @@ FBSD_1.5 { }; FBSD_1.6 { + __sysctlbyname; copy_file_range; fhlink; fhlinkat; Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Sep 3 04:16:30 2019 (r351729) @@ -2256,6 +2256,32 @@ freebsd32___sysctl(struct thread *td, struct freebsd32 } int +freebsd32___sysctlbyname(struct thread *td, + struct freebsd32___sysctlbyname_args *uap) +{ + size_t oldlen, rv; + int error; + uint32_t tmp; + + if (uap->oldlenp != NULL) { + error = fueword32(uap->oldlenp, &tmp); + oldlen = tmp; + } else { + error = oldlen = 0; + } + if (error != 0) + return (EFAULT); + error = kern___sysctlbyname(td, uap->name, uap->namelen, uap->old, + &oldlen, uap->new, uap->newlen, &rv, SCTL_MASK32, 1); + if (error != 0) + return (error); + if (uap->oldlenp != NULL) + error = suword32(uap->oldlenp, rv); + + return (error); +} + +int freebsd32_jail(struct thread *td, struct freebsd32_jail_args *uap) { uint32_t version; Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/compat/freebsd32/freebsd32_proto.h Tue Sep 3 04:16:30 2019 (r351729) @@ -728,6 +728,14 @@ struct freebsd32_cpuset_setdomain_args { char mask_l_[PADL_(domainset_t *)]; domainset_t * mask; char mask_r_[PADR_(domainset_t *)]; char policy_l_[PADL_(int)]; int policy; char policy_r_[PADR_(int)]; }; +struct freebsd32___sysctlbyname_args { + char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; + char namelen_l_[PADL_(size_t)]; size_t namelen; char namelen_r_[PADR_(size_t)]; + char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)]; + char oldlenp_l_[PADL_(uint32_t *)]; uint32_t * oldlenp; char oldlenp_r_[PADR_(uint32_t *)]; + char new_l_[PADL_(void *)]; void * new; char new_r_[PADR_(void *)]; + char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)]; +}; #if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif @@ -865,6 +873,7 @@ int freebsd32_mknodat(struct thread *, struct freebsd3 int freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *); int freebsd32_cpuset_getdomain(struct thread *, struct freebsd32_cpuset_getdomain_args *); int freebsd32_cpuset_setdomain(struct thread *, struct freebsd32_cpuset_setdomain_args *); +int freebsd32___sysctlbyname(struct thread *, struct freebsd32___sysctlbyname_args *); #ifdef COMPAT_43 @@ -1419,6 +1428,7 @@ int freebsd11_freebsd32_fstatat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_KEVENT #define FREEBSD32_SYS_AUE_freebsd32_cpuset_getdomain AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_cpuset_setdomain AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32___sysctlbyname AUE_SYSCTL #undef PAD_ #undef PADL_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Tue Sep 3 04:16:30 2019 (r351729) @@ -496,4 +496,5 @@ #define FREEBSD32_SYS_fhreadlink 567 #define FREEBSD32_SYS_funlinkat 568 #define FREEBSD32_SYS_copy_file_range 569 -#define FREEBSD32_SYS_MAXSYSCALL 570 +#define FREEBSD32_SYS_freebsd32___sysctlbyname 570 +#define FREEBSD32_SYS_MAXSYSCALL 571 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Tue Sep 3 04:16:30 2019 (r351729) @@ -606,4 +606,5 @@ const char *freebsd32_syscallnames[] = { "fhreadlink", /* 567 = fhreadlink */ "funlinkat", /* 568 = funlinkat */ "copy_file_range", /* 569 = copy_file_range */ + "freebsd32___sysctlbyname", /* 570 = freebsd32___sysctlbyname */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Tue Sep 3 04:16:30 2019 (r351729) @@ -653,4 +653,5 @@ struct sysent freebsd32_sysent[] = { { AS(fhreadlink_args), (sy_call_t *)sys_fhreadlink, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 567 = fhreadlink */ { AS(funlinkat_args), (sy_call_t *)sys_funlinkat, AUE_UNLINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 568 = funlinkat */ { AS(copy_file_range_args), (sy_call_t *)sys_copy_file_range, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 569 = copy_file_range */ + { AS(freebsd32___sysctlbyname_args), (sy_call_t *)freebsd32___sysctlbyname, AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 570 = freebsd32___sysctlbyname */ }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Sep 3 04:16:30 2019 (r351729) @@ -3332,6 +3332,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 6; break; } + /* freebsd32___sysctlbyname */ + case 570: { + struct freebsd32___sysctlbyname_args *p = params; + uarg[0] = (intptr_t) p->name; /* const char * */ + uarg[1] = p->namelen; /* size_t */ + uarg[2] = (intptr_t) p->old; /* void * */ + uarg[3] = (intptr_t) p->oldlenp; /* uint32_t * */ + uarg[4] = (intptr_t) p->new; /* void * */ + uarg[5] = p->newlen; /* size_t */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -8971,6 +8983,31 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* freebsd32___sysctlbyname */ + case 570: + switch(ndx) { + case 0: + p = "userland const char *"; + break; + case 1: + p = "size_t"; + break; + case 2: + p = "userland void *"; + break; + case 3: + p = "userland uint32_t *"; + break; + case 4: + p = "userland void *"; + break; + case 5: + p = "size_t"; + break; + default: + break; + }; + break; default: break; }; @@ -10849,6 +10886,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * case 569: if (ndx == 0 || ndx == 1) p = "ssize_t"; + break; + /* freebsd32___sysctlbyname */ + case 570: + if (ndx == 0 || ndx == 1) + p = "int"; break; default: break; Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/compat/freebsd32/syscalls.master Tue Sep 3 04:16:30 2019 (r351729) @@ -1150,5 +1150,8 @@ 569 AUE_NULL NOPROTO { ssize_t copy_file_range(int infd, \ off_t *inoffp, int outfd, off_t *outoffp, \ size_t len, unsigned int flags); } +570 AUE_SYSCTL STD { int freebsd32___sysctlbyname(const char *name, \ + size_t namelen, void *old, uint32_t *oldlenp, \ + void *new, size_t newlen); } ; vim: syntax=off Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/kern/capabilities.conf Tue Sep 3 04:16:30 2019 (r351729) @@ -58,6 +58,7 @@ __mac_set_proc ## proxying daemon in userspace. ## __sysctl +__sysctlbyname ## ## Allow umtx operations as these are scoped by address space. Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/kern/init_sysent.c Tue Sep 3 04:16:30 2019 (r351729) @@ -619,4 +619,5 @@ struct sysent sysent[] = { { AS(fhreadlink_args), (sy_call_t *)sys_fhreadlink, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 567 = fhreadlink */ { AS(funlinkat_args), (sy_call_t *)sys_funlinkat, AUE_UNLINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 568 = funlinkat */ { AS(copy_file_range_args), (sy_call_t *)sys_copy_file_range, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 569 = copy_file_range */ + { AS(__sysctlbyname_args), (sy_call_t *)sys___sysctlbyname, AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 570 = __sysctlbyname */ }; Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/kern/kern_sysctl.c Tue Sep 3 04:16:30 2019 (r351729) @@ -2145,6 +2145,68 @@ sys___sysctl(struct thread *td, struct sysctl_args *ua return (error); } +int +kern___sysctlbyname(struct thread *td, const char *oname, size_t namelen, + void *old, size_t *oldlenp, void *new, size_t newlen, size_t *retval, + int flags, bool inkernel) +{ + int oid[CTL_MAXNAME]; + char namebuf[16]; + char *name; + size_t oidlen; + int error; + + if (namelen > MAXPATHLEN || namelen == 0) + return (EINVAL); + name = namebuf; + if (namelen > sizeof(namebuf)) + name = malloc(namelen, M_SYSCTL, M_WAITOK); + error = copyin(oname, name, namelen); + if (error != 0) + goto out; + + oid[0] = 0; + oid[1] = 3; + oidlen = sizeof(oid); + error = kernel_sysctl(td, oid, 2, oid, &oidlen, (void *)name, namelen, + retval, flags); + if (error != 0) + goto out; + error = userland_sysctl(td, oid, *retval / sizeof(int), old, oldlenp, + inkernel, new, newlen, retval, flags); + +out: + if (namelen > sizeof(namebuf)) + free(name, M_SYSCTL); + return (error); +} + +#ifndef _SYS_SYSPROTO_H_ +struct __sysctlbyname_args { + const char *name; + size_t namelen; + void *old; + size_t *oldlenp; + void *new; + size_t newlen; +}; +#endif +int +sys___sysctlbyname(struct thread *td, struct __sysctlbyname_args *uap) +{ + size_t rv; + int error; + + error = kern___sysctlbyname(td, uap->name, uap->namelen, uap->old, + uap->oldlenp, uap->new, uap->newlen, &rv, 0, 0); + if (error != 0) + return (error); + if (uap->oldlenp != NULL) + error = copyout(&rv, uap->oldlenp, sizeof(rv)); + + return (error); +} + /* * This is used from various compatibility syscalls too. That's why name * must be in kernel space. Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/kern/syscalls.c Tue Sep 3 04:16:30 2019 (r351729) @@ -576,4 +576,5 @@ const char *syscallnames[] = { "fhreadlink", /* 567 = fhreadlink */ "funlinkat", /* 568 = funlinkat */ "copy_file_range", /* 569 = copy_file_range */ + "__sysctlbyname", /* 570 = __sysctlbyname */ }; Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/kern/syscalls.master Tue Sep 3 04:16:30 2019 (r351729) @@ -3185,6 +3185,15 @@ unsigned int flags ); } +570 AUE_SYSCTL STD { + int __sysctlbyname( + _In_reads_(namelen) const char *name, + size_t namelen, + _Out_writes_bytes_opt_(*oldlenp) void *old, + _Inout_opt_ size_t *oldlenp, + _In_reads_bytes_opt_(newlen) void *new, + size_t newlen); + } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/kern/systrace_args.c Tue Sep 3 04:16:30 2019 (r351729) @@ -3324,6 +3324,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 6; break; } + /* __sysctlbyname */ + case 570: { + struct __sysctlbyname_args *p = params; + uarg[0] = (intptr_t) p->name; /* const char * */ + uarg[1] = p->namelen; /* size_t */ + uarg[2] = (intptr_t) p->old; /* void * */ + uarg[3] = (intptr_t) p->oldlenp; /* size_t * */ + uarg[4] = (intptr_t) p->new; /* void * */ + uarg[5] = p->newlen; /* size_t */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -8876,6 +8888,31 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* __sysctlbyname */ + case 570: + switch(ndx) { + case 0: + p = "userland const char *"; + break; + case 1: + p = "size_t"; + break; + case 2: + p = "userland void *"; + break; + case 3: + p = "userland size_t *"; + break; + case 4: + p = "userland void *"; + break; + case 5: + p = "size_t"; + break; + default: + break; + }; + break; default: break; }; @@ -10781,6 +10818,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * case 569: if (ndx == 0 || ndx == 1) p = "ssize_t"; + break; + /* __sysctlbyname */ + case 570: + if (ndx == 0 || ndx == 1) + p = "int"; break; default: break; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/sys/param.h Tue Sep 3 04:16:30 2019 (r351729) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300044 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300045 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/sys/syscall.h Tue Sep 3 04:16:30 2019 (r351729) @@ -505,4 +505,5 @@ #define SYS_fhreadlink 567 #define SYS_funlinkat 568 #define SYS_copy_file_range 569 -#define SYS_MAXSYSCALL 570 +#define SYS___sysctlbyname 570 +#define SYS_MAXSYSCALL 571 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/sys/syscall.mk Tue Sep 3 04:16:30 2019 (r351729) @@ -410,4 +410,5 @@ MIASM = \ fhlinkat.o \ fhreadlink.o \ funlinkat.o \ - copy_file_range.o + copy_file_range.o \ + __sysctlbyname.o Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/sys/sysctl.h Tue Sep 3 04:16:30 2019 (r351729) @@ -1128,6 +1128,9 @@ int sysctl_find_oid(int *name, u_int namelen, struct s void sysctl_wlock(void); void sysctl_wunlock(void); int sysctl_wire_old_buffer(struct sysctl_req *req, size_t len); +int kern___sysctlbyname(struct thread *td, const char *name, + size_t namelen, void *old, size_t *oldlenp, void *new, + size_t newlen, size_t *retval, int flags, bool inkernel); struct sbuf; struct sbuf *sbuf_new_for_sysctl(struct sbuf *, char *, int, Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Mon Sep 2 21:57:57 2019 (r351728) +++ head/sys/sys/sysproto.h Tue Sep 3 04:16:30 2019 (r351729) @@ -1804,6 +1804,14 @@ struct copy_file_range_args { char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)]; }; +struct __sysctlbyname_args { + char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; + char namelen_l_[PADL_(size_t)]; size_t namelen; char namelen_r_[PADR_(size_t)]; + char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)]; + char oldlenp_l_[PADL_(size_t *)]; size_t * oldlenp; char oldlenp_r_[PADR_(size_t *)]; + char new_l_[PADL_(void *)]; void * new; char new_r_[PADR_(void *)]; + char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2190,6 +2198,7 @@ int sys_fhlinkat(struct thread *, struct fhlinkat_args int sys_fhreadlink(struct thread *, struct fhreadlink_args *); int sys_funlinkat(struct thread *, struct funlinkat_args *); int sys_copy_file_range(struct thread *, struct copy_file_range_args *); +int sys___sysctlbyname(struct thread *, struct __sysctlbyname_args *); #ifdef COMPAT_43 @@ -3098,6 +3107,7 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 #define SYS_AUE_fhreadlink AUE_NULL #define SYS_AUE_funlinkat AUE_UNLINKAT #define SYS_AUE_copy_file_range AUE_NULL +#define SYS_AUE___sysctlbyname AUE_SYSCTL #undef PAD_ #undef PADL_ From owner-svn-src-head@freebsd.org Tue Sep 3 07:03:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65109CEF16; Tue, 3 Sep 2019 07:03:06 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46MyZx2BKCz3xC3; Tue, 3 Sep 2019 07:03:05 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f51.google.com with SMTP id n19so11942262lfe.13; Tue, 03 Sep 2019 00:03:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=DO/KqP9zE2TftCcoLVrHjoMQwQv2fbVldEjY3J5Ftpo=; b=ohfE+15BWl3ZRLAzblp0drXzxb9++AlFlY6gq6TPf3CqwWUS/D+kO5L0e/72WoMU0J 3xF1282EEXTETDoRHIFKcTGQjiNQCdi4vlzx42FBiRvxkHfJePEY3bRse0FE1ByQ+vAA +KW3GIWoQ7EbbutdTPJjh+xrQn9Ad0kbRnRTXozxqpvmSed4AKMRDvLnQ7/A7xeEHXzu OAPbP1Dz/R75GVpoA8LEktaOyW5ykN9AxNxZTzPenmcI37WbYotMYhB8YPcT1GYrx3pg aIPC5k2f9STtXucWEY1G4xvrxkI3tyje8eFAjiZM/y8ko0H63C1S6ghDi8YeOeiyUd8s Tu2g== X-Gm-Message-State: APjAAAU4HBurKrdiWwR2WozX6nFEcY5RntMMC8cWHaqW6YqEpULjhC4d h8uRpAPJcNCepP4Ub7dyv/QMD3na X-Google-Smtp-Source: APXvYqxukjAyGC2T/yObSZN1dkwO3us9qTNODGEPbFG5wR/oXgOi2tN4hQnjGyo4V3VD0r9JvBZMBA== X-Received: by 2002:a19:9145:: with SMTP id y5mr19502111lfj.88.1567494182706; Tue, 03 Sep 2019 00:03:02 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id w27sm259665ljd.55.2019.09.03.00.03.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Sep 2019 00:03:01 -0700 (PDT) Subject: Re: svn commit: r351673 - in head: lib/libmemstat share/man/man9 sys/cddl/compat/opensolaris/kern sys/kern sys/vm To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201909012222.x81MMh0F022462@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <79c74018-1329-ee69-3480-e2f99821fa93@FreeBSD.org> Date: Tue, 3 Sep 2019 10:02:59 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201909012222.x81MMh0F022462@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46MyZx2BKCz3xC3 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.167.51 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-4.24 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.26)[ip: (-0.61), ipnet: 209.85.128.0/17(-3.33), asn: 15169(-2.30), country: US(-0.05)]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; RCVD_IN_DNSWL_NONE(0.00)[51.167.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[96.151.72.93.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 07:03:06 -0000 On 02/09/2019 01:22, Mark Johnston wrote: > Author: markj > Date: Sun Sep 1 22:22:43 2019 > New Revision: 351673 > URL: https://svnweb.freebsd.org/changeset/base/351673 > > Log: > Extend uma_reclaim() to permit different reclamation targets. > > The page daemon periodically invokes uma_reclaim() to reclaim cached > items from each zone when the system is under memory pressure. This > is important since the size of these caches is unbounded by default. > However it also results in bursts of high latency when allocating from > heavily used zones as threads miss in the per-CPU caches and must > access the keg in order to allocate new items. > > With r340405 we maintain an estimate of each zone's usage of its > (per-NUMA domain) cache of full buckets. Start making use of this > estimate to avoid reclaiming the entire cache when under memory > pressure. In particular, introduce TRIM, DRAIN and DRAIN_CPU > verbs for uma_reclaim() and uma_zone_reclaim(). When trimming, only > items in excess of the estimate are reclaimed. Draining a zone > reclaims all of the cached full buckets (the previous behaviour of > uma_reclaim()), and may further drain the per-CPU caches in extreme > cases. > > Now, when under memory pressure, the page daemon will trim zones > rather than draining them. As a result, heavily used zones do not incur > bursts of bucket cache misses following reclamation, but large, unused > caches will be reclaimed as before. Mark, have you considered running UMA_RECLAIM_TRIM periodically, even without a memory pressure? I think that with such a periodic trimming there will be less need to invoke vm_lowmem(). Also, I think that we would be able to retire (or re-purpose) lowmem_period. E.g., the trimming would be done every lowmem_period, but vm_lowmem() would not be throttled. One example of the throttling of vm_lowmem being bad is its interaction with the ZFS ARC. When there is a spike in memory usage we want the ARC to adapt as quickly as possible. But at present the lowmem_period logic interferes with that. > Reviewed by: jeff > Tested by: pho (an earlier version) > MFC after: 2 months > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D16667 -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Sep 3 10:42:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77B66D5E80; Tue, 3 Sep 2019 10:42:14 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yw1-f48.google.com (mail-yw1-f48.google.com [209.85.161.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N3Rp2Qr9z48yx; Tue, 3 Sep 2019 10:42:13 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yw1-f48.google.com with SMTP id 129so4983952ywb.8; Tue, 03 Sep 2019 03:42:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SBvS1/j76CcIiPu14OTGanQa2aZPyrXsrPE+ELIbHLs=; b=CXKqGDGr7Y1nWgq47LCD7nYFFw1qMOpvBE8OelEk7y4n4grqBceSW9FinWuMEEKh6l abN0Sqe2BgPRIGPMNm9fXU52IG1Z2Q2y7R//v5I2DBeb+3RGhQI4hB6byuEM4WOHCyY3 Q+wJSUQVmgezTSYL2jYkqcQoIlOrPsr4PzX3hJ82hOcWGfaGHw3DA550mjUQXKlColin 5HqI/vKCbIZEBlEit6vZeAhJloFC9bsvrFdJlYftcfVGKx8QL4/IVxnDkt8aaJFhHROr HF10LylhsWT9yTBXSAMfXxIAFKLQnqy+ez3vr8D2NIzYFSLlUJQKZCO9dF7lUWzxymtL 3KIA== X-Gm-Message-State: APjAAAXYlJxg/dxzACOAzIDP4QYHljEgCSxXxVqGKhNkNZCMbSLEfCpk fskIrTepmpkRvVPkTicQBtAbsXX4xx0N8UOBQYS5g/C+ X-Google-Smtp-Source: APXvYqzb9ef+3ltFEwk4beDbroF5Ih4+FTusxtiou2YAHGDjNuq0lhC3QdOUE8g7BCRgqYdzYwqsMyqKYi1Et9rTG7c= X-Received: by 2002:a81:9885:: with SMTP id p127mr25387221ywg.380.1567507332454; Tue, 03 Sep 2019 03:42:12 -0700 (PDT) MIME-Version: 1.0 References: <201909021549.x82FndM9009860@gndrsh.dnsmgr.net> In-Reply-To: <201909021549.x82FndM9009860@gndrsh.dnsmgr.net> From: Li-Wen Hsu Date: Tue, 3 Sep 2019 18:42:00 +0800 Message-ID: Subject: Re: svn commit: r351643 - in head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common: dtraceUtil speculation To: rgrimes@freebsd.org Cc: Enji Cooper , Warner Losh , "Conrad E. Meyer" , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46N3Rp2Qr9z48yx X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 10:42:14 -0000 On Mon, Sep 2, 2019 at 11:49 PM Rodney W. Grimes wrote: > > > > > > On Aug 31, 2019, at 16:29, Warner Losh wrote: > > > > > > > > > > > >> On Sat, Aug 31, 2019 at 5:29 PM Conrad Meyer wrote: > > >> Thanks Li-Wen! Might it be less fragile to have the test fixture > > >> create a file, if the test(s) will expect one to be present to read? > > > > > > Or just use the realpath $0, which you know has to exist :) > > > > I don?t know if this would work, with other some of the dtrace tests are called. Plus, that relies on a FreeBSD utility which doesn?t necessarily exist on Linux and I don?t think exists on IllumOS. > > > > It makes more sense to create a file with mktemp and test for it in the loop to make the tests portable over to IllumOS, since that?s where they originally came from and can be contributed back to. > > Agreed, especially if these tests are expected to be portable the > assumption of existance of /COPYRIGHT is a mistake/bug. Thanks for the inputs. Indeed, depending on any irrelevant files or FreeBSD specified tools both do not sound a good solution. After reading these test cases again, I feel that creating a temp file might be slightly over engineering because in the end we also need to take care of cleaning, in normal and abnormal exiting cases. In these tests, we only need someone calls open(2) and read(2). How about changing them to `cat / > /dev/null` ? Best, Li-Wen From owner-svn-src-head@freebsd.org Tue Sep 3 10:49:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBC67D606F; Tue, 3 Sep 2019 10:49:13 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N3bs50R4z49PF; Tue, 3 Sep 2019 10:49:13 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8ECCF1779; Tue, 3 Sep 2019 10:49:13 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x83AnD1F034836; Tue, 3 Sep 2019 10:49:13 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x83AnDIu034835; Tue, 3 Sep 2019 10:49:13 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201909031049.x83AnDIu034835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 3 Sep 2019 10:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351739 - head/tests/sys/sys X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/sys X-SVN-Commit-Revision: 351739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 10:49:13 -0000 Author: lwhsu Date: Tue Sep 3 10:49:13 2019 New Revision: 351739 URL: https://svnweb.freebsd.org/changeset/base/351739 Log: Temporarily skip sys.sys.qmath_test.qdivq_s64q in CI because it is unstable PR: 240219 Discussed with: trasz Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/sys/qmath_test.c Modified: head/tests/sys/sys/qmath_test.c ============================================================================== --- head/tests/sys/sys/qmath_test.c Tue Sep 3 07:09:04 2019 (r351738) +++ head/tests/sys/sys/qmath_test.c Tue Sep 3 10:49:13 2019 (r351739) @@ -275,6 +275,10 @@ ATF_TC_BODY(qdivq_s64q, tc) double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; int error; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/240219"); + + srandomdev(); for (int i = 0; i < 10; i++) { From owner-svn-src-head@freebsd.org Tue Sep 3 11:35:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A0F3D7700 for ; Tue, 3 Sep 2019 11:35:09 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N4cr0wRPz4D8t for ; Tue, 3 Sep 2019 11:35:08 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x742.google.com with SMTP id s14so15526008qkm.4 for ; Tue, 03 Sep 2019 04:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=y0T5eXudBcKypDs9562fvgaLnrMUfuGG1qQolQWJfs0=; b=MYtfN3/dxmFsHvcH+g9gY1CNm/YB01Mau3FpVtdDFYG8ClL3mn27Dn9vwHZrkBstIQ TCMVdd5yBm7J8Yckd3DIOf7mrcmWhmoyfVw9EfkNMAx6jpIAfSXBH8KvNUH35RaGobqU 4cAkEO4OqmWsUhqWmdjyAj6ALEyIy2GBSzD1t80SLqk5zqWNFFxjjctFtZpt+V6aoD+y HImQfAclW3asFuRGXCbvvFBH64TOXrhCjYuI8AUQ44uk7iLAv+XCp3T5D+ivI61N+ITc GmEDtNSaR6XLH1ZDMByjZ1Xrf0sW0QT6QyjVwMrO+XC7ODnuXfGe5db83fIwiXfiZC5G K9Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=y0T5eXudBcKypDs9562fvgaLnrMUfuGG1qQolQWJfs0=; b=Ian6cYP1gRVUd/O5QoDFM3SD/B8BdRhycbW6KUyCApnGLMYE4uBxzdm6OI6/EPPVnn VLmd2rnZENE0hW9Nei1KWKiXEA7pOhJxg9I0GSsBIzMXP87JtFFAK1p6uhSofDFmM6u9 A8uSPW1Icoku2I4xjPtO3iHVlix2i/tgATBa7YrxQ92arnyoToNANtTAMl8MAn6vOyDY DJr/YNT7tQTVZdnXtMJwdkoroNOQ4cGER11mkPd4UP6x7xqWN7qrdIq/D5AeA7Jmw4bs JhOr/Ip0CuTOkQ8mYdAAcol4M3IIlcW6enEgqkc+ygalmfbe10P5+5mdOp1jAnGAL5S5 Gu2w== X-Gm-Message-State: APjAAAVjsHKGA/fUluvBWn7VtUQv89yFpF1OjGLWWnjp4/A1bcdpT2kb UwlCUTYR5PfOUHsR6TzgC9VAqw== X-Google-Smtp-Source: APXvYqzGiZl7TmLx0+HPSmoEUMTm/h93l7iilKGUlW4B3H2qhtd5KBHhD4LhchOelGz9YlSCYaatsg== X-Received: by 2002:a37:9f46:: with SMTP id i67mr10873061qke.108.1567510506965; Tue, 03 Sep 2019 04:35:06 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.108]) by smtp.gmail.com with ESMTPSA id z187sm9090707qke.99.2019.09.03.04.35.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 04:35:06 -0700 (PDT) Date: Tue, 3 Sep 2019 07:35:05 -0400 From: Shawn Webb To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351729 - in head: lib/libc/gen lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys Message-ID: <20190903113505.ckbx5i34onmin557@mutt-hbsd> References: <201909030416.x834GVwk004191@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6jwmsu42m7vqk4ch" Content-Disposition: inline In-Reply-To: <201909030416.x834GVwk004191@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 46N4cr0wRPz4D8t X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=MYtfN3/d; dmarc=none; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::742 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-5.47 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; RCVD_IN_DNSWL_NONE(0.00)[2.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-0.40)[ip: (3.16), ipnet: 2607:f8b0::/32(-2.82), asn: 15169(-2.30), country: US(-0.05)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 11:35:09 -0000 --6jwmsu42m7vqk4ch Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Mateusz, On Tue, Sep 03, 2019 at 04:16:31AM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Tue Sep 3 04:16:30 2019 > New Revision: 351729 > URL: https://svnweb.freebsd.org/changeset/base/351729 >=20 > Log: > Add sysctlbyname system call > =20 > Previously userspace would issue one syscall to resolve the sysctl and = then > another one to actually use it. Do it all in one trip. > =20 > Fallback is provided in case newer libc happens to be running on an old= er > kernel. > =20 > Submitted by: Pawel Biernacki > Reported by: kib, brooks > Differential Revision: https://reviews.freebsd.org/D17282 >=20 > Modified: =2E.. snip ... > head/sys/sys/param.h =2E.. snip ... >=20 > Modified: head/sys/sys/param.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/param.h Mon Sep 2 21:57:57 2019 (r351728) > +++ head/sys/sys/param.h Tue Sep 3 04:16:30 2019 (r351729) > @@ -60,7 +60,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1300044 /* Master, propagated to newvers */ > +#define __FreeBSD_version 1300045 /* Master, propagated to newvers */ To an outsider, it seems that __FreeBSD_version tends to be bumped in a separate commit. Am I remembering that right? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 --6jwmsu42m7vqk4ch Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl1uT+MACgkQ/y5nonf4 4fobbw/9HDo43gynrUH+2IUifg52+wu44dtPTBML9+ERpD9C+ipBkntyuOgD9Nem OoFXi8npNQCGyTx4PTqBR6Pha4x6xNahQLpK1NAgVYlXFyqlMN8sUfJY4+Kijjuc XJPVudTVpDgmsTib1bmF83iwkSmqaeD6WLMjndPdhTLZT26otKhE6PIjpKfEGaD/ suufoze+k2wEe1eBeR20640JCSzIhjrh9XoA+9usjukZ24FYiQvLKf6uky+h9KOE fMUEBIDPPoNHqf9N1JgkS5OPkMv6K0JG0N+IfYAgZNPYQ8MgPvDDEN04/gt3CSov sm4eVyLyxNgbR+6UNt68H8VU4unwYqAPgiqY9oJHKBrRWU0Wq0btheKM7fGkqY4N r+rKhLqB6+74sGDQ/ayr7hm8FHIOb69AV/FdZuoZLBbwYnVUKOuneiq0xChbnvve Y2/CgW/eErB3HD3cRR1gLOfEX4vwCUXeIknhyNrI+KeCpV/ITiT83VQ3jfbJmGYS BGGp13McUr9Z3iK3aR1x0XqlAuIyG6AjwdHbkVo9rMvaQz11n3haAdSrPnKs+3At aX76pMg4oQ+biNZSoJgCEpwkjX+qMiBCnx2USQXHnGtcT4UlE8BCmdD1I8pe4xQK 0l/uKZqDLD+To9ZaGWmYsWuj4SiGiwTmEzgsEmoMaVHGJSn8hYc= =LVWZ -----END PGP SIGNATURE----- --6jwmsu42m7vqk4ch-- From owner-svn-src-head@freebsd.org Tue Sep 3 11:45:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8226AD7B32; Tue, 3 Sep 2019 11:45:32 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46N4rq0zN8z4Dnt; Tue, 3 Sep 2019 11:45:30 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 4E3163C0199; Tue, 3 Sep 2019 11:45:23 +0000 (UTC) Date: Tue, 3 Sep 2019 11:45:23 +0000 From: Brooks Davis To: Shawn Webb Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351729 - in head: lib/libc/gen lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys Message-ID: <20190903114523.GA68094@spindle.one-eyed-alien.net> References: <201909030416.x834GVwk004191@repo.freebsd.org> <20190903113505.ckbx5i34onmin557@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline In-Reply-To: <20190903113505.ckbx5i34onmin557@mutt-hbsd> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 46N4rq0zN8z4Dnt X-Spamd-Bar: ------- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-7.43 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; IP_SCORE(-3.57)[ip: (-9.32), ipnet: 199.48.128.0/22(-4.64), asn: 36236(-3.86), country: US(-0.05)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 11:45:32 -0000 --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 03, 2019 at 07:35:05AM -0400, Shawn Webb wrote: > Hey Mateusz, >=20 > On Tue, Sep 03, 2019 at 04:16:31AM +0000, Mateusz Guzik wrote: > > Author: mjg > > Date: Tue Sep 3 04:16:30 2019 > > New Revision: 351729 > > URL: https://svnweb.freebsd.org/changeset/base/351729 > >=20 > > Log: > > Add sysctlbyname system call > > =20 > > Previously userspace would issue one syscall to resolve the sysctl an= d then > > another one to actually use it. Do it all in one trip. > > =20 > > Fallback is provided in case newer libc happens to be running on an o= lder > > kernel. > > =20 > > Submitted by: Pawel Biernacki > > Reported by: kib, brooks > > Differential Revision: https://reviews.freebsd.org/D17282 > >=20 > > Modified: > ... snip ... > > head/sys/sys/param.h >=20 > ... snip ... >=20 > >=20 > > Modified: head/sys/sys/param.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/sys/param.h Mon Sep 2 21:57:57 2019 (r351728) > > +++ head/sys/sys/param.h Tue Sep 3 04:16:30 2019 (r351729) > > @@ -60,7 +60,7 @@ > > * in the range 5 to 9. > > */ > > #undef __FreeBSD_version > > -#define __FreeBSD_version 1300044 /* Master, propagated to newvers */ > > +#define __FreeBSD_version 1300045 /* Master, propagated to newvers */ >=20 > To an outsider, it seems that __FreeBSD_version tends to be bumped in > a separate commit. Am I remembering that right? It should be bumped in the same commit, but people forget or the bump they have in their review turns into a no-op because someone else does a bump in the interim (the latter has bit me several times). =20 -- Brooks --IS0zKkzwUGydFO0o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJdblJSAAoJEKzQXbSebgfAHnAH/iTwzH5oytRHj7/4d3ztHjKH SfW9Y7YTrAK0rIbDADiB3tU0BPjGGx6ogUMm/Cjly2NDEhVu+b4roVF+UOanp3X0 OoTwExFm+igBtctveuzseAozqnx3wVUDEvjvyzq0XtfPgC/Wnij84WK/rtyybdeg tHunIH1TDbWHZnRLhR+mZrqXcraqYFej72aSa/nY+kjBkALENuynGS/ix636/QTe HRpveQZARezpr9B/aObmb7/SajqQZq9k5jZEsRd5FoE2ECaYe8ys+EVioP7Wo05W jJ4k8Dn/yAHahTabaKctQyb4Wej7ynOjsC/aOXeXS4SYzVor89zc/qZ0jEYutvI= =97Wz -----END PGP SIGNATURE----- --IS0zKkzwUGydFO0o-- From owner-svn-src-head@freebsd.org Tue Sep 3 11:47:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF2E9D7D3A for ; Tue, 3 Sep 2019 11:47:44 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N4vN1zPNz4FBk for ; Tue, 3 Sep 2019 11:47:44 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x844.google.com with SMTP id o12so7861997qtf.3 for ; Tue, 03 Sep 2019 04:47:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fNB1Eu2SR0x5RKyIU4jxeV8BGd/VofhJRh3+4NE4TaQ=; b=bLK2I8v3LsUz58et21mqMGmosBi4rnBVWNyy9qD1A2Yjb6AW6DedwnbQ1wfn1J8H2d pD4wRU61rexnmES6eNkqJ+zyYBIuq/yfQLNfwcmLj/6GMlVtegzNF8toh2GhZNfeh1jU TpTZMDXei9fiG4Nl5s2mZnHp57iwJGHYE2utPZ/WhZW40XjfGsFqbdEBK3dmYWuJPVmF LtM7OtnXHc1tIVFodMah/ysaOH5lHSxghxkaYB/OVUx+/Ml/imn9KLb/8QA5d/WWjsFt bor5BWCQ9VaynAYBblFMXOpiqVAeSOkfXPuQ3dCFwaTCDXMub8DmfyO6qDsZW/MGtQLk ZLwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fNB1Eu2SR0x5RKyIU4jxeV8BGd/VofhJRh3+4NE4TaQ=; b=c6XaOFtwz6hn+VsqAz+BUIG7MWrwrgKyXa3dwTq/61fQtxk+M1wqT8aot9g9tnABuQ GlcI2GTUTC1D/PQE7CucWmc31Anno986o/whwfBUJPluF4HiyVw7Ypu/e2ebBMWvnpPz pjXltYlabeltCItGvVCLl1K8FcgydzPSSwBlLiVVscSN9W2VYGSC1gSzx9aP0hIK8OXt ZUFpBmFEwB/LYZmF7lFOH6so9cm3y0E8fSGl4VS08nZIFqVOioLrxWwTbcsmE+1+t2zA XSr+NjtHYdo9bRmCDihSX1e32FYJUijY+iwQ9o+43r40+OsrSIoRsyrR/FQoPqhqlMnz fqrA== X-Gm-Message-State: APjAAAXHKo8UHrAzLh7vWO5O/nGtH6cFwWY5Ah9QAfsuXuUPzUc2YVK3 NyCtMEoRS20XwmdTsTOLSHNXfg== X-Google-Smtp-Source: APXvYqxdA86nyAsOvlCmynGT+cuaJgz7bjx16H3oLIOOzH2DiHJgSRGChB2k6PQElPH4rufG67rI+w== X-Received: by 2002:a0c:ab49:: with SMTP id i9mr15613269qvb.142.1567511261666; Tue, 03 Sep 2019 04:47:41 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.108]) by smtp.gmail.com with ESMTPSA id 60sm137071qta.77.2019.09.03.04.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 04:47:40 -0700 (PDT) Date: Tue, 3 Sep 2019 07:47:40 -0400 From: Shawn Webb To: Brooks Davis Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r351729 - in head: lib/libc/gen lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys Message-ID: <20190903114740.gbzkeffdce3mkee2@mutt-hbsd> References: <201909030416.x834GVwk004191@repo.freebsd.org> <20190903113505.ckbx5i34onmin557@mutt-hbsd> <20190903114523.GA68094@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jopdem4ihmaajanv" Content-Disposition: inline In-Reply-To: <20190903114523.GA68094@spindle.one-eyed-alien.net> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 46N4vN1zPNz4FBk X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=bLK2I8v3; dmarc=none; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::844 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-5.59 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; RCVD_IN_DNSWL_NONE(0.00)[4.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-0.51)[ip: (2.62), ipnet: 2607:f8b0::/32(-2.82), asn: 15169(-2.30), country: US(-0.05)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 11:47:45 -0000 --jopdem4ihmaajanv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 03, 2019 at 11:45:23AM +0000, Brooks Davis wrote: > On Tue, Sep 03, 2019 at 07:35:05AM -0400, Shawn Webb wrote: > > Hey Mateusz, > >=20 > > On Tue, Sep 03, 2019 at 04:16:31AM +0000, Mateusz Guzik wrote: > > > Author: mjg > > > Date: Tue Sep 3 04:16:30 2019 > > > New Revision: 351729 > > > URL: https://svnweb.freebsd.org/changeset/base/351729 > > >=20 > > > Log: > > > Add sysctlbyname system call > > > =20 > > > Previously userspace would issue one syscall to resolve the sysctl = and then > > > another one to actually use it. Do it all in one trip. > > > =20 > > > Fallback is provided in case newer libc happens to be running on an= older > > > kernel. > > > =20 > > > Submitted by: Pawel Biernacki > > > Reported by: kib, brooks > > > Differential Revision: https://reviews.freebsd.org/D17282 > > >=20 > > > Modified: > > ... snip ... > > > head/sys/sys/param.h > >=20 > > ... snip ... > >=20 > > >=20 > > > Modified: head/sys/sys/param.h > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/sys/sys/param.h Mon Sep 2 21:57:57 2019 (r351728) > > > +++ head/sys/sys/param.h Tue Sep 3 04:16:30 2019 (r351729) > > > @@ -60,7 +60,7 @@ > > > * in the range 5 to 9. > > > */ > > > #undef __FreeBSD_version > > > -#define __FreeBSD_version 1300044 /* Master, propagated to newvers */ > > > +#define __FreeBSD_version 1300045 /* Master, propagated to newvers */ > >=20 > > To an outsider, it seems that __FreeBSD_version tends to be bumped in > > a separate commit. Am I remembering that right? >=20 > It should be bumped in the same commit, but people forget or the bump > they have in their review turns into a no-op because someone else does a > bump in the interim (the latter has bit me several times). Interesting. Thanks for the clarification! --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 --jopdem4ihmaajanv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl1uUtYACgkQ/y5nonf4 4frNJQ/+M8/K5K8o4Z4Xp1KL3op8NO0VFweAF8M2SV8cRkSRFceI/Hs8E2umwtv3 p2lK6nzFwF4aW/Kt5G/uNtnIiL+IRoXtXzFBNjHEvTkL8i/mqQ3CX6Fs4AILyXQ8 GqzO4fnM49Yz1ibLymbMyslMS+KDmY8qJiHOyVf+LvJhQuN03Xm3UHqx/AuzIZ58 O0149gLa9GLlZ0J2/CWEQiOAxhHIkI2zCq542CIghk3Djkclt4nHfwLhbWz5KOGh slN2kRFkfm98Y35mVL434TzarkLGdLGfZYTlu8UWe9j6ffZg+M3Npax9w6acfFn2 k+1TFjyjeyX4qbB4ZlTT7yud5fDrpIAEJ8lmqoAoSl5jWqkv/szkzSMUVXBEo0hu 4CAA9pXuWPnpIkoJvnUfucYuNuXhfqAz3q0A6d14aD1DP3k61n1+s64vx2Rhgy2o 8HReJyt/4g0iG8JM6Y+bPjp9v2FV1ruyhI7jipdQSuFjAgTBaN+lkq6OvH9JM9QB mATHmVXJP+MZdW3kA9TC7Z16JHjwTK4EJJYIpf5PvY0UmNsf7y1q0CuX8sX3jTyr owN5lTK6hdnbF/6PQRlONYSvjG6Roz+4K3ZSTD5YA090QGPwhQnJhMo8GnJAjN6X 0ZjFj7yI+KhTIzEqMxh4uDKoOiAhADbRL6mVKrpiNwSHB/4tQBc= =reGw -----END PGP SIGNATURE----- --jopdem4ihmaajanv-- From owner-svn-src-head@freebsd.org Tue Sep 3 12:12:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96C3DD90AF; Tue, 3 Sep 2019 12:12:58 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from ecc05.stack.nl (ws0.zlo.nu [190.2.135.243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "*.stack.nl", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N5ST2B15z4H3k; Tue, 3 Sep 2019 12:12:56 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mail04.stack.nl (blade.stack.nl [51.15.111.152]) by ecc05.stack.nl (Postfix) with ESMTPS id 8D9FD1001FD; Tue, 3 Sep 2019 12:12:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=stack.nl; s=mail; t=1567512765; bh=bntJbwaoQyPDW2Nj4/WwIbY/z2I3AgUYVmCvFJODDYc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AeN1cEjLhVhAgtYQ0A9wLI8Iu2633DuPRb2UdsIVUA0SLTb4pFG+kbjPwOinpfBxL UvFsXnqIIg5sMmKAVKFg2+um93T7314zGOTGI+3KPylcXyKvLVDNWnIHIUFxQZw1zJ 7ZjANLsqPyawt8nQZSw0bLsWsCkfTJ+QlOjOZ/ubz2nuqMw6heq4hYS6HjDJzifdcS K7EkjseWv1ZYW55mVREXTvirtR9pgyLd9DEwuO/1nnRAuLdNuO/5pLVTI7owAEvWSs oDHn9JREEdN0sczslRMMtV15z4i7S/n0Wbl/JsgtFXifPGgM5Jcm1LvnF0jkM+IOSq VjEe9+JMbIjAg== Received: from localhost (localhost.localdomain [127.0.0.1]) by mail04.stack.nl (Postfix) with ESMTP id 5CAA593E; Tue, 3 Sep 2019 12:12:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail04.stack.nl Received: from mail04.stack.nl ([127.0.0.1]) by localhost (mail04.stack.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PVSfvpST_0Dn; Tue, 3 Sep 2019 12:12:42 +0000 (UTC) Received: from blade.stack.nl (blade.stack.nl [192.168.122.130]) by mail04.stack.nl (Postfix) with ESMTP id AA8F1373; Tue, 3 Sep 2019 12:12:42 +0000 (UTC) Received: by blade.stack.nl (Postfix, from userid 1677) id 8270320DFE; Tue, 3 Sep 2019 14:12:42 +0200 (CEST) Date: Tue, 3 Sep 2019 14:12:42 +0200 From: Jilles Tjoelker To: Li-Wen Hsu Cc: rgrimes@freebsd.org, Enji Cooper , Warner Losh , "Conrad E. Meyer" , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r351643 - in head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common: dtraceUtil speculation Message-ID: <20190903121242.GA23842@stack.nl> References: <201909021549.x82FndM9009860@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 46N5ST2B15z4H3k X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=stack.nl header.s=mail header.b=AeN1cEjL; dmarc=none; spf=pass (mx1.freebsd.org: domain of jilles@stack.nl designates 190.2.135.243 as permitted sender) smtp.mailfrom=jilles@stack.nl X-Spamd-Result: default: False [-3.86 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[stack.nl:s=mail]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:190.2.135.243]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[stack.nl]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[stack.nl:+]; NEURAL_HAM_SHORT(-0.84)[-0.841,0]; RCPT_COUNT_SEVEN(0.00)[8]; IP_SCORE(-0.51)[asn: 49981(-2.59), country: NL(0.01)]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:49981, ipnet:190.2.128.0/20, country:NL]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 12:12:58 -0000 On Tue, Sep 03, 2019 at 06:42:00PM +0800, Li-Wen Hsu wrote: > On Mon, Sep 2, 2019 at 11:49 PM Rodney W. Grimes > wrote: > > > > On Aug 31, 2019, at 16:29, Warner Losh wrote: > > > >> On Sat, Aug 31, 2019 at 5:29 PM Conrad Meyer wrote: > > > >> Thanks Li-Wen! Might it be less fragile to have the test fixture > > > >> create a file, if the test(s) will expect one to be present to read? > > > > Or just use the realpath $0, which you know has to exist :) > > > I don?t know if this would work, with other some of the dtrace > > > tests are called. Plus, that relies on a FreeBSD utility which > > > doesn?t necessarily exist on Linux and I don?t think exists on > > > IllumOS. > > > It makes more sense to create a file with mktemp and test for it > > > in the loop to make the tests portable over to IllumOS, since > > > that?s where they originally came from and can be contributed back > > > to. > > Agreed, especially if these tests are expected to be portable the > > assumption of existance of /COPYRIGHT is a mistake/bug. > Thanks for the inputs. Indeed, depending on any irrelevant files or > FreeBSD specified tools both do not sound a good solution. After > reading these test cases again, I feel that creating a temp file might > be slightly over engineering because in the end we also need to take > care of cleaning, in normal and abnormal exiting cases. In these > tests, we only need someone calls open(2) and read(2). > How about changing them to `cat / > /dev/null` ? Reading a directory as bytes is not portable. For example, FreeBSD fdescfs and nfs do not allow it, and Linux does not allow it at all. Apart from the fact that the resulting bytes depend on the filesystem type, this operation is problematic because it may expose filenames that were previously deleted. The files /etc/group and /etc/passwd exist on most operating systems, but for optimal portability a temporary file seems unavoidable (assuming that data must come from a regular file). -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Tue Sep 3 12:40:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1902FD9C94; Tue, 3 Sep 2019 12:40:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N64p6ydcz4JYK; Tue, 3 Sep 2019 12:40:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA2A82D2D; Tue, 3 Sep 2019 12:40:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x83CewPM001503; Tue, 3 Sep 2019 12:40:58 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x83CewpS001502; Tue, 3 Sep 2019 12:40:58 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201909031240.x83CewpS001502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 3 Sep 2019 12:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351740 - head/sys/dev/superio X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/superio X-SVN-Commit-Revision: 351740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 12:40:59 -0000 Author: avg Date: Tue Sep 3 12:40:58 2019 New Revision: 351740 URL: https://svnweb.freebsd.org/changeset/base/351740 Log: superio: fix the copyright block and update the year MFC after: 2 weeks Modified: head/sys/dev/superio/superio.c head/sys/dev/superio/superio.h Modified: head/sys/dev/superio/superio.c ============================================================================== --- head/sys/dev/superio/superio.c Tue Sep 3 10:49:13 2019 (r351739) +++ head/sys/dev/superio/superio.c Tue Sep 3 12:40:58 2019 (r351740) @@ -1,7 +1,8 @@ -/* - * Copyright (c) 2016 Andriy Gapon - * All rights reserved. +/*- + * SPDX-License-Identifier: BSD-2-Clause * + * Copyright (c) 2019 Andriy Gapon + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,7 +12,7 @@ * 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 + * 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 @@ -22,6 +23,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #include Modified: head/sys/dev/superio/superio.h ============================================================================== --- head/sys/dev/superio/superio.h Tue Sep 3 10:49:13 2019 (r351739) +++ head/sys/dev/superio/superio.h Tue Sep 3 12:40:58 2019 (r351740) @@ -1,6 +1,8 @@ -/* - * Copyright (c) 2016 Andriy Gapon +/*- + * SPDX-License-Identifier: BSD-2-Clause * + * Copyright (c) 2019 Andriy Gapon + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -10,7 +12,7 @@ * 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 + * 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 From owner-svn-src-head@freebsd.org Tue Sep 3 12:54:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52AF8DA100 for ; Tue, 3 Sep 2019 12:54:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N6NG1zDlz4K6T for ; Tue, 3 Sep 2019 12:54:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x730.google.com with SMTP id f10so15778371qkg.7 for ; Tue, 03 Sep 2019 05:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=P5uN4YjRwr9KJtVUFSQQ9H60NF+ba4dFcW2Jay1ozDo=; b=ubaxNTBE27QP3IkC881vd31O4cvE0pk2aJRlgfuEFz2rz82fU20RWQPbDQmIPufIT+ JL4VHr6XQuwufH6l2ujoliyU/pp8l3p1O9eNb6rP336PMyKnftlx3yrx+siamYGawWMv iQOQ+35D10Ovo+dk2MqwxM5O1bomSf4VbmKxAu3e6r9BOLQ0vlLhNxn7zipMB308g9e6 rCOvyov08qW20tDJvflx2yOL3ozTJ0uOVU0F6Mm56PQcyj82MYrgae9O3KUMmDPq1edR o2zR2L1ircejPrQZax1ASXhb24I3Kxh+ZnR9ZGBypVu3iAW0gt0wJVLIuOvlBbAVqIjS dzww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P5uN4YjRwr9KJtVUFSQQ9H60NF+ba4dFcW2Jay1ozDo=; b=j/P+J27PPuZpWqlHxlhrL6+Os7T5VgnA12P2M115GL+LBB4XCcJW3nlbR0E/ptdIyd ulNymBXG4iSYQ8Na4aQU1hEzm2Yp5AR8mnkRTUrPZfqqfIEScG4ebarAFxKsPdmBIyHS zY1FFPB+hRbT0wGnUmKASdLWhdxBOiVsw/HZ1ARkmejstfIDC03+IO/NyJkhrNp6j9Mb cwHVBIy0mT8wiKEKPa8xWjSyhMDzj2uRhfScO884hui9XOZk+qU+Q2ZNR8tZtAtx2wmG bcSC3eSn3x9ZtiPXE5+X8KzeObD/N40Tx13Yaq58QHITaKMRRC5dLo0pQS9rrFr3HLty 7SGw== X-Gm-Message-State: APjAAAWJR4y96p54EAKxgk0ppYMtcimvaPuu1Rbn28en5VWD1s24owah fFHXehNcgPfw4zE5uV5oEhnVQk0OO5KxVB//h3xO0g== X-Google-Smtp-Source: APXvYqyFe/C8PvCFLOJDeD6nNhETm2nKi46L5psku1ER1XsXz8WAwqS9hpE8phP9kjrQ45L2urSW5j2KccaGxE6L+Gs= X-Received: by 2002:a05:620a:16ab:: with SMTP id s11mr6738843qkj.215.1567515260859; Tue, 03 Sep 2019 05:54:20 -0700 (PDT) MIME-Version: 1.0 References: <201909030416.x834GVwk004191@repo.freebsd.org> <20190903113505.ckbx5i34onmin557@mutt-hbsd> <20190903114523.GA68094@spindle.one-eyed-alien.net> In-Reply-To: <20190903114523.GA68094@spindle.one-eyed-alien.net> From: Warner Losh Date: Tue, 3 Sep 2019 06:54:09 -0600 Message-ID: Subject: Re: svn commit: r351729 - in head: lib/libc/gen lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys To: Brooks Davis Cc: Shawn Webb , Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 46N6NG1zDlz4K6T X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=ubaxNTBE; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::730) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-5.91 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; RCVD_IN_DNSWL_NONE(0.00)[0.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.91)[ip: (-9.40), ipnet: 2607:f8b0::/32(-2.82), asn: 15169(-2.30), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 12:54:23 -0000 On Tue, Sep 3, 2019, 5:45 AM Brooks Davis wrote: > On Tue, Sep 03, 2019 at 07:35:05AM -0400, Shawn Webb wrote: > > Hey Mateusz, > > > > On Tue, Sep 03, 2019 at 04:16:31AM +0000, Mateusz Guzik wrote: > > > Author: mjg > > > Date: Tue Sep 3 04:16:30 2019 > > > New Revision: 351729 > > > URL: https://svnweb.freebsd.org/changeset/base/351729 > > > > > > Log: > > > Add sysctlbyname system call > > > > > > Previously userspace would issue one syscall to resolve the sysctl > and then > > > another one to actually use it. Do it all in one trip. > > > > > > Fallback is provided in case newer libc happens to be running on an > older > > > kernel. > > > > > > Submitted by: Pawel Biernacki > > > Reported by: kib, brooks > > > Differential Revision: https://reviews.freebsd.org/D17282 > > > > > > Modified: > > ... snip ... > > > head/sys/sys/param.h > > > > ... snip ... > > > > > > > > Modified: head/sys/sys/param.h > > > > ============================================================================== > > > --- head/sys/sys/param.h Mon Sep 2 21:57:57 2019 (r351728) > > > +++ head/sys/sys/param.h Tue Sep 3 04:16:30 2019 (r351729) > > > @@ -60,7 +60,7 @@ > > > * in the range 5 to 9. > > > */ > > > #undef __FreeBSD_version > > > -#define __FreeBSD_version 1300044 /* Master, propagated to newvers */ > > > +#define __FreeBSD_version 1300045 /* Master, propagated to newvers */ > > > > To an outsider, it seems that __FreeBSD_version tends to be bumped in > > a separate commit. Am I remembering that right? > > It should be bumped in the same commit, but people forget or the bump > they have in their review turns into a no-op because someone else does a > bump in the interim (the latter has bit me several times). > Often when that happens to me, I'll just piggyback off the prior bump by just documenting the version bump as also covering what I just did. Though there is some judgement too based on number of days and how bad the effects in the in between zone might be. It's always a fuzzy thing if you zoom in on it, though, due to after the fact bumps. Warner > From owner-svn-src-head@freebsd.org Tue Sep 3 12:54:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C59CDA165; Tue, 3 Sep 2019 12:54:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N6Nr0Bbzz4KF7; Tue, 3 Sep 2019 12:54:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D96092F99; Tue, 3 Sep 2019 12:54:51 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x83Csp0e012434; Tue, 3 Sep 2019 12:54:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x83Csp8c012433; Tue, 3 Sep 2019 12:54:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909031254.x83Csp8c012433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 3 Sep 2019 12:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351741 - head/sys/fs/pseudofs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/fs/pseudofs X-SVN-Commit-Revision: 351741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 12:54:52 -0000 Author: mjg Date: Tue Sep 3 12:54:51 2019 New Revision: 351741 URL: https://svnweb.freebsd.org/changeset/base/351741 Log: pseudofs: fix a LOR pfs_node vs pidhash (sleepable after non-sleepable) Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Tue Sep 3 12:40:58 2019 (r351740) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Tue Sep 3 12:54:51 2019 (r351741) @@ -132,6 +132,24 @@ pfs_visible(struct thread *td, struct pfs_node *pn, pi PFS_RETURN (0); } +static int +pfs_lookup_proc(pid_t pid, struct proc **p) +{ + struct proc *proc; + + proc = pfind(pid); + if (proc == NULL) + return (0); + if ((proc->p_flag & P_WEXIT) != 0) { + PROC_UNLOCK(proc); + return (0); + } + _PHOLD(proc); + PROC_UNLOCK(proc); + *p = proc; + return (1); +} + /* * Verify permissions */ @@ -791,11 +809,17 @@ pfs_readdir(struct vop_readdir_args *va) if (resid == 0) PFS_RETURN (0); + if (!pfs_lookup_proc(pid, &proc)) + PFS_RETURN (ENOENT); + sx_slock(&allproc_lock); pfs_lock(pd); + PROC_LOCK(proc); /* check if the directory is visible to the caller */ - if (!pfs_visible(curthread, pd, pid, &proc)) { + if (!pfs_visible_proc(curthread, pd, proc)) { + _PRELE(proc); + PROC_UNLOCK(proc); sx_sunlock(&allproc_lock); pfs_unlock(pd); PFS_RETURN (ENOENT); @@ -807,8 +831,10 @@ pfs_readdir(struct vop_readdir_args *va) for (pn = NULL, p = NULL; offset > 0; offset -= PFS_DELEN) { if (pfs_iterate(curthread, proc, pd, &pn, &p) == -1) { /* nothing left... */ - if (proc != NULL) + if (proc != NULL) { + _PRELE(proc); PROC_UNLOCK(proc); + } pfs_unlock(pd); sx_sunlock(&allproc_lock); PFS_RETURN (0); @@ -859,8 +885,10 @@ pfs_readdir(struct vop_readdir_args *va) offset += PFS_DELEN; resid -= PFS_DELEN; } - if (proc != NULL) + if (proc != NULL) { + _PRELE(proc); PROC_UNLOCK(proc); + } pfs_unlock(pd); sx_sunlock(&allproc_lock); i = 0; From owner-svn-src-head@freebsd.org Tue Sep 3 13:02:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB9D8DA495; Tue, 3 Sep 2019 13:02:54 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N6Z620x9z4Kg8; Tue, 3 Sep 2019 13:02:54 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-ot1-x343.google.com with SMTP id 97so13778261otr.4; Tue, 03 Sep 2019 06:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=a68tOxX6Vyoq0I7HSCACMWW0Jgqv+QgVyflgQk89vLI=; b=LIDsf+tCOiU7Lp/n/IIMZOFDfW532wFs4+k8UuO3LH5t4Ib9NMlqYjw170yIw4luwE YUV3Bx/KTJE6HaFzT1x85qt9facMt6/GKXEB3dtXWWdwjdr7Ob35cTsaIeAXJED8+/GH ugmzQwmIpIPcYz79PHduEXucEe1fD5d8RiTNf7Nj8Y1nT6vuYH4se3niiiFasgGJ24iC B+CVJCf/7sdZ4cd/8FNdl0bBjEhaUsSOCoOXGRyYqHMjV2uUrq2I93Vl/ih7HCB4wB7c y17NQeRxT0UxhzQ+o4cHyzSEKQTNEcsP88vMpMDOLt1QkSTzlo5RrZbR6K56OwFhILN5 rUNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=a68tOxX6Vyoq0I7HSCACMWW0Jgqv+QgVyflgQk89vLI=; b=MmlfMFFZ/bKl7nLa8unUOdgP/k07HgjGEJBy3gsc5a+HYWXrqq078+ENgrI/uZG86E 61pYkaI2I9Ht42xcOlqqKVnptN3BCYA+SZ4wG91pdGmqLOBYy0lO7CSxScKPB9ADR8Wp CXqNlpwbxSQLWtyeBRtEYyOI7hNksPFTswfAZ5Ti3/neTvjOjc+c+wJcZIfj84IDrnJe j4gm3JctN5CiToqY8mjan6JJmpaqxgpdmJQlXe+U7IbgyfNH+MJv8pbaHR/vde3aT9wg CxOHMzDYPgTqXFrKShspL8LFpas0nN2b0Wk4M8UJXFbxjZfNpdBw37cPrtGz50P0SKDS KEfw== X-Gm-Message-State: APjAAAV6cTBCgUnpG9wmvKLPyehZMsCqXY6of59GHzJTzgB03cP3S5L+ r0xeNeiAnysz8qdKQEmb8+G9HZmfIlT6uEbYZ56MVA== X-Google-Smtp-Source: APXvYqw/pVLySZjTZ2bGAR7DelfNPknTX7DWiwNenxPAhLqYnOwMnFH/DW7y4mnRzRaa/0tcEbsR4G00RW4g1XdDME4= X-Received: by 2002:a05:6830:187:: with SMTP id q7mr29361873ota.23.1567515773107; Tue, 03 Sep 2019 06:02:53 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:458d:0:0:0:0:0 with HTTP; Tue, 3 Sep 2019 06:02:52 -0700 (PDT) In-Reply-To: References: <201909030416.x834GVwk004191@repo.freebsd.org> <20190903113505.ckbx5i34onmin557@mutt-hbsd> <20190903114523.GA68094@spindle.one-eyed-alien.net> From: Mateusz Guzik Date: Tue, 3 Sep 2019 15:02:52 +0200 Message-ID: Subject: Re: svn commit: r351729 - in head: lib/libc/gen lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys To: Warner Losh Cc: Brooks Davis , Shawn Webb , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46N6Z620x9z4Kg8 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=LIDsf+tC; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2607:f8b0:4864:20::343 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.96 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (3.05), ipnet: 2607:f8b0::/32(-2.82), asn: 15169(-2.30), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[3.4.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 13:02:54 -0000 On 9/3/19, Warner Losh wrote: > On Tue, Sep 3, 2019, 5:45 AM Brooks Davis wrote: > >> On Tue, Sep 03, 2019 at 07:35:05AM -0400, Shawn Webb wrote: >> > Hey Mateusz, >> > >> > On Tue, Sep 03, 2019 at 04:16:31AM +0000, Mateusz Guzik wrote: >> > > Author: mjg >> > > Date: Tue Sep 3 04:16:30 2019 >> > > New Revision: 351729 >> > > URL: https://svnweb.freebsd.org/changeset/base/351729 >> > > >> > > Log: >> > > Add sysctlbyname system call >> > > >> > > Previously userspace would issue one syscall to resolve the sysctl >> and then >> > > another one to actually use it. Do it all in one trip. >> > > >> > > Fallback is provided in case newer libc happens to be running on an >> older >> > > kernel. >> > > >> > > Submitted by: Pawel Biernacki >> > > Reported by: kib, brooks >> > > Differential Revision: https://reviews.freebsd.org/D17282 >> > > >> > > Modified: >> > ... snip ... >> > > head/sys/sys/param.h >> > >> > ... snip ... >> > >> > > >> > > Modified: head/sys/sys/param.h >> > > >> ============================================================================== >> > > --- head/sys/sys/param.h Mon Sep 2 21:57:57 2019 (r351728) >> > > +++ head/sys/sys/param.h Tue Sep 3 04:16:30 2019 (r351729) >> > > @@ -60,7 +60,7 @@ >> > > * in the range 5 to 9. >> > > */ >> > > #undef __FreeBSD_version >> > > -#define __FreeBSD_version 1300044 /* Master, propagated to newvers >> > > */ >> > > +#define __FreeBSD_version 1300045 /* Master, propagated to newvers >> > > */ >> > >> > To an outsider, it seems that __FreeBSD_version tends to be bumped in >> > a separate commit. Am I remembering that right? >> >> It should be bumped in the same commit, but people forget or the bump >> they have in their review turns into a no-op because someone else does a >> bump in the interim (the latter has bit me several times). >> > > Often when that happens to me, I'll just piggyback off the prior bump by > just documenting the version bump as also covering what I just did. Though > there is some judgement too based on number of days and how bad the effects > in the in between zone might be. It's always a fuzzy thing if you zoom in > on it, though, due to after the fact bumps. > How do you run into this one? Your patch should fail on the file, then patch itself exits with an error. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Tue Sep 3 13:08:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9340DA5D6 for ; Tue, 3 Sep 2019 13:08:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N6hG6sTRz4Kry for ; Tue, 3 Sep 2019 13:08:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x729.google.com with SMTP id f10so15832469qkg.7 for ; Tue, 03 Sep 2019 06:08:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=U8zAftZ+jxLDavNvD3FNWCmKNHCxUno6tw5zSBK2K8s=; b=CSpFYD/iqGe5lu+FOFu9/MQQqfoh6TkmsK98zy/uYroKnPOk5D3B1PK4OkVz8LP0jn rlLfGVXyUE0E7/0eKy3pCdqxVno+WtWXKvxVmW9L7m1IuRW2/ux9APTDeXIzwOlt4Cfj xvR7oaGZL9FAsQOvs9llxhbmdKBt5oHrCmTeOPAzZclD7xseXS63KRI5hQpOWpd9THnl MAThQgJzHi24H3UGpclIB9mdjqhEXKlAgXreHawn06Vbsf4x9TZZUa9KpLh4z4lIYMHR bMDTqbH0Kxz6YQQ0CzOji6mCZrgHWPYEDIZm9DWOfG9+voqhjYVUVyEF4sFX9h1ojDm9 xTyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=U8zAftZ+jxLDavNvD3FNWCmKNHCxUno6tw5zSBK2K8s=; b=cp15aUif1HYL489acQ6y140YfoR0wYLyfoivVszLzLl+fWRku2V8/eb5APOnmPEtMD sedHOQxQ2Hh+G4742N3UaS2s5G3401v9sneJM7ZOdKjfg638JFvcCHWfkQft9HxMIbum vaYHdA7ozhH2VPOqH63izs7KRqmuoKX+XeTKGJ9HbHawUDblhRg9ELFu0KtHuum5Z/At oHs+RI0wy5TkcUaR1HAKHJt9UjPS90Khj7mVFgtlg+DVo2LvTyCwG8F3dx0GHvYRf15f 23SW8fBiZt3LGdF6OQ5fzxA58jDEp79yl/KDNL04vHTHGVwNA9OM+1ByH8NLofnIebdv Jtwg== X-Gm-Message-State: APjAAAUQOmmNfoO9GbOduiIitHzAd/kOWBfuScHhuqrSXn7KTZh6y8Go vyh8xRX+f8inF6w2zlFD6fHUvWIHMVyqevl4DUE9BQ== X-Google-Smtp-Source: APXvYqwwLHIn4GSOXOn+ubhozV18vYoYR0MCNty5fH79ZnSJO6+JxIObleW/Arzq/N0j6W4suMwv+0k0yu6+lvH4wb8= X-Received: by 2002:a37:4804:: with SMTP id v4mr34694530qka.60.1567516093158; Tue, 03 Sep 2019 06:08:13 -0700 (PDT) MIME-Version: 1.0 References: <201909030416.x834GVwk004191@repo.freebsd.org> <20190903113505.ckbx5i34onmin557@mutt-hbsd> <20190903114523.GA68094@spindle.one-eyed-alien.net> In-Reply-To: From: Warner Losh Date: Tue, 3 Sep 2019 07:08:00 -0600 Message-ID: Subject: Re: svn commit: r351729 - in head: lib/libc/gen lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys To: Mateusz Guzik Cc: Brooks Davis , Shawn Webb , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 46N6hG6sTRz4Kry X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=CSpFYD/i; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::729) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-5.89 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; RCVD_IN_DNSWL_NONE(0.00)[9.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.90)[ip: (-9.30), ipnet: 2607:f8b0::/32(-2.82), asn: 15169(-2.30), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 13:08:15 -0000 On Tue, Sep 3, 2019, 7:02 AM Mateusz Guzik wrote: > On 9/3/19, Warner Losh wrote: > > On Tue, Sep 3, 2019, 5:45 AM Brooks Davis wrote: > > > >> On Tue, Sep 03, 2019 at 07:35:05AM -0400, Shawn Webb wrote: > >> > Hey Mateusz, > >> > > >> > On Tue, Sep 03, 2019 at 04:16:31AM +0000, Mateusz Guzik wrote: > >> > > Author: mjg > >> > > Date: Tue Sep 3 04:16:30 2019 > >> > > New Revision: 351729 > >> > > URL: https://svnweb.freebsd.org/changeset/base/351729 > >> > > > >> > > Log: > >> > > Add sysctlbyname system call > >> > > > >> > > Previously userspace would issue one syscall to resolve the sysctl > >> and then > >> > > another one to actually use it. Do it all in one trip. > >> > > > >> > > Fallback is provided in case newer libc happens to be running on > an > >> older > >> > > kernel. > >> > > > >> > > Submitted by: Pawel Biernacki > >> > > Reported by: kib, brooks > >> > > Differential Revision: https://reviews.freebsd.org/D17282 > >> > > > >> > > Modified: > >> > ... snip ... > >> > > head/sys/sys/param.h > >> > > >> > ... snip ... > >> > > >> > > > >> > > Modified: head/sys/sys/param.h > >> > > > >> > ============================================================================== > >> > > --- head/sys/sys/param.h Mon Sep 2 21:57:57 2019 > (r351728) > >> > > +++ head/sys/sys/param.h Tue Sep 3 04:16:30 2019 > (r351729) > >> > > @@ -60,7 +60,7 @@ > >> > > * in the range 5 to 9. > >> > > */ > >> > > #undef __FreeBSD_version > >> > > -#define __FreeBSD_version 1300044 /* Master, propagated to newvers > >> > > */ > >> > > +#define __FreeBSD_version 1300045 /* Master, propagated to newvers > >> > > */ > >> > > >> > To an outsider, it seems that __FreeBSD_version tends to be bumped in > >> > a separate commit. Am I remembering that right? > >> > >> It should be bumped in the same commit, but people forget or the bump > >> they have in their review turns into a no-op because someone else does a > >> bump in the interim (the latter has bit me several times). > >> > > > > Often when that happens to me, I'll just piggyback off the prior bump by > > just documenting the version bump as also covering what I just did. > Though > > there is some judgement too based on number of days and how bad the > effects > > in the in between zone might be. It's always a fuzzy thing if you zoom in > > on it, though, due to after the fact bumps. > > > > How do you run into this one? Your patch should fail on the file, then > patch > itself exits with an error. > Git rebase gives no error in this case. Warner -- > Mateusz Guzik > From owner-svn-src-head@freebsd.org Tue Sep 3 13:18:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FAB6DABE8; Tue, 3 Sep 2019 13:18:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N6wX3D72z4LXJ; Tue, 3 Sep 2019 13:18:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51CEE332E; Tue, 3 Sep 2019 13:18:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x83DIqJl024298; Tue, 3 Sep 2019 13:18:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x83DIpWb024294; Tue, 3 Sep 2019 13:18:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909031318.x83DIpWb024294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 3 Sep 2019 13:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351742 - in head/sys: amd64/amd64 amd64/include vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include vm X-SVN-Commit-Revision: 351742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 13:18:52 -0000 Author: markj Date: Tue Sep 3 13:18:51 2019 New Revision: 351742 URL: https://svnweb.freebsd.org/changeset/base/351742 Log: Map the vm_page array into KVA on amd64. r351198 allows the kernel to use domain-local memory to back the vm_page array (up to 2MB boundaries) and reserves a separate PML4 entry for that purpose. One consequence of that change is that the vm_page array is no longer present in minidumps, which only adds pages mapped above VM_MIN_KERNEL_ADDRESS. To avoid the friction caused by having kernel data structures mapped below VM_MIN_KERNEL_ADDRESS, map the vm_page array starting at VM_MIN_KERNEL_ADDRESS instead of using a dedicated PML4 entry. Reviewed by: kib Discussed with: jeff Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21491 Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/vmparam.h head/sys/vm/vm_kern.c head/sys/vm/vm_page.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Sep 3 12:54:51 2019 (r351741) +++ head/sys/amd64/amd64/pmap.c Tue Sep 3 13:18:51 2019 (r351742) @@ -384,9 +384,6 @@ static u_int64_t DMPDphys; /* phys addr of direct mapp static u_int64_t DMPDPphys; /* phys addr of direct mapped level 3 */ static int ndmpdpphys; /* number of DMPDPphys pages */ -static uint64_t PAPDPphys; /* phys addr of page array level 3 */ -static int npapdpphys; /* number of PAPDPphys pages */ - static vm_paddr_t KERNend; /* phys addr of end of bootstrap data */ /* @@ -1431,16 +1428,6 @@ create_pagetables(vm_paddr_t *firstaddr) pml4_entry_t *p4_p; uint64_t DMPDkernphys; - npapdpphys = howmany(ptoa(Maxmem) / sizeof(struct vm_page), NBPML4); - if (npapdpphys > NPAPML4E) { - printf("NDMPML4E limits system to %lu GB\n", - (NDMPML4E * 512) * (PAGE_SIZE / sizeof(struct vm_page))); - npapdpphys = NPAPML4E; - Maxmem = atop(NPAPML4E * NBPML4 * - (PAGE_SIZE / sizeof(struct vm_page))); - } - PAPDPphys = allocpages(firstaddr, npapdpphys); - /* Allocate page table pages for the direct map */ ndmpdp = howmany(ptoa(Maxmem), NBPDP); if (ndmpdp < 4) /* Minimum 4GB of dirmap */ @@ -1587,12 +1574,6 @@ create_pagetables(vm_paddr_t *firstaddr) p4_p[KPML4BASE + i] = KPDPphys + ptoa(i); p4_p[KPML4BASE + i] |= X86_PG_RW | X86_PG_V; } - - /* Connect the page array slots up to the pml4. */ - for (i = 0; i < npapdpphys; i++) { - p4_p[PAPML4I + i] = PAPDPphys + ptoa(i); - p4_p[PAPML4I + i] |= X86_PG_RW | X86_PG_V | pg_nx; - } } /* @@ -3456,11 +3437,6 @@ pmap_pinit_pml4(vm_page_t pml4pg) X86_PG_V; } - for (i = 0; i < npapdpphys; i++) { - pm_pml4[PAPML4I + i] = (PAPDPphys + ptoa(i)) | X86_PG_RW | - X86_PG_V; - } - /* install self-referential address mapping entry(s) */ pm_pml4[PML4PML4I] = VM_PAGE_TO_PHYS(pml4pg) | X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M; @@ -3817,8 +3793,6 @@ pmap_release(pmap_t pmap) pmap->pm_pml4[KPML4BASE + i] = 0; for (i = 0; i < ndmpdpphys; i++)/* Direct Map */ pmap->pm_pml4[DMPML4I + i] = 0; - for (i = 0; i < npapdpphys; i++) - pmap->pm_pml4[PAPML4I + i] = 0; pmap->pm_pml4[PML4PML4I] = 0; /* Recursive Mapping */ for (i = 0; i < lm_ents; i++) /* Large Map */ pmap->pm_pml4[LMSPML4I + i] = 0; @@ -3856,6 +3830,10 @@ kvm_free(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG|CTLFLAG_RD, 0, 0, kvm_free, "LU", "Amount of KVM free"); +/* + * Allocate physical memory for the vm_page array and map it into KVA, + * attempting to back the vm_pages with domain-local memory. + */ void pmap_page_array_startup(long pages) { @@ -3868,14 +3846,15 @@ pmap_page_array_startup(long pages) vm_page_array_size = pages; - start = va = PA_MIN_ADDRESS; - end = va + (pages * sizeof(struct vm_page)); + start = va = VM_MIN_KERNEL_ADDRESS; + end = va + pages * sizeof(struct vm_page); while (va < end) { - pfn = first_page + ((va - start) / sizeof(struct vm_page)); + pfn = first_page + (va - start) / sizeof(struct vm_page); domain = _vm_phys_domain(ctob(pfn)); pdpe = pmap_pdpe(kernel_pmap, va); if ((*pdpe & X86_PG_V) == 0) { pa = vm_phys_early_alloc(domain, PAGE_SIZE); + dump_add_page(pa); bzero((void *)PHYS_TO_DMAP(pa), PAGE_SIZE); *pdpe = (pdp_entry_t)(pa | X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M); @@ -3892,6 +3871,7 @@ pmap_page_array_startup(long pages) pde_store(pde, newpdir); va += NBPDR; } + vm_page_array = (vm_page_t)start; } /* Modified: head/sys/amd64/include/vmparam.h ============================================================================== --- head/sys/amd64/include/vmparam.h Tue Sep 3 12:54:51 2019 (r351741) +++ head/sys/amd64/include/vmparam.h Tue Sep 3 13:18:51 2019 (r351742) @@ -160,13 +160,12 @@ * 0xffff808000000000 - 0xffff847fffffffff large map (can be tuned up) * 0xffff848000000000 - 0xfffff7ffffffffff unused (large map extends there) * 0xfffff80000000000 - 0xfffffbffffffffff 4TB direct map - * 0xfffffc0000000000 - 0xfffffcffffffffff unused - * 0xfffffd0000000000 - 0xfffffd7fffffffff page array 512GB - * 0xfffffd8000000000 - 0xfffffdffffffffff unused + * 0xfffffc0000000000 - 0xfffffdffffffffff unused * 0xfffffe0000000000 - 0xffffffffffffffff 2TB kernel map * * Within the kernel map: * + * 0xfffffe0000000000 vm_page_array * 0xffffffff80000000 KERNBASE */ @@ -216,10 +215,10 @@ (x) & ~DMAP_MIN_ADDRESS; }) /* - * amd64 statically allocates the page array address so that it can - * be more easily allocated on the correct memory domains. + * amd64 maps the page array into KVA so that it can be more easily + * allocated on the correct memory domains. */ -#define PMAP_HAS_PAGE_ARRAY 1 +#define PMAP_HAS_PAGE_ARRAY 1 /* * How many physical pages per kmem arena virtual page. Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Tue Sep 3 12:54:51 2019 (r351741) +++ head/sys/vm/vm_kern.c Tue Sep 3 13:18:51 2019 (r351742) @@ -759,7 +759,7 @@ kmem_init(vm_offset_t start, vm_offset_t end) vm_map_lock(m); /* N.B.: cannot use kgdb to debug, starting with this assignment ... */ kernel_map = m; - (void) vm_map_insert(m, NULL, (vm_ooffset_t) 0, + (void)vm_map_insert(m, NULL, 0, #ifdef __amd64__ KERNBASE, #else @@ -767,6 +767,18 @@ kmem_init(vm_offset_t start, vm_offset_t end) #endif start, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT); /* ... and ending with the completion of the above `insert' */ + +#ifdef __amd64__ + /* + * Mark KVA used for the page array as allocated. Other platforms + * that handle vm_page_array allocation can simply adjust virtual_avail + * instead. + */ + (void)vm_map_insert(m, NULL, 0, (vm_offset_t)vm_page_array, + (vm_offset_t)vm_page_array + round_2mpage(vm_page_array_size * + sizeof(struct vm_page)), + VM_PROT_RW, VM_PROT_RW, MAP_NOFAULT); +#endif vm_map_unlock(m); /* Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Sep 3 12:54:51 2019 (r351741) +++ head/sys/vm/vm_page.c Tue Sep 3 13:18:51 2019 (r351742) @@ -135,11 +135,7 @@ static int vm_pageproc_waiters; */ vm_page_t bogus_page; -#ifdef PMAP_HAS_PAGE_ARRAY -vm_page_t vm_page_array = (vm_page_t)PA_MIN_ADDRESS; -#else vm_page_t vm_page_array; -#endif long vm_page_array_size; long first_page; From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A0E3DBE02; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yd6W1Zz4NpB; Tue, 3 Sep 2019 14:05:45 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id BE65119AC1; Tue, 3 Sep 2019 14:05:45 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id EC3C21810D; Wed, 27 Mar 2019 14:29:06 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74EA577118; Wed, 27 Mar 2019 14:29:06 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 3EDC5180EB; Wed, 27 Mar 2019 14:29:06 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D5C07180E9 for ; Wed, 27 Mar 2019 14:29:03 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F60D77112; Wed, 27 Mar 2019 14:29:03 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-ot1-f42.google.com with SMTP id 103so15043358otd.9; Wed, 27 Mar 2019 07:29:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=qROj6QgUqTHBYeCNB/3YQsnHJ9gBNry/cqFHO62zT5k=; b=SPPvvkfn+jzGa4CWq0pqb9zcUj8knlAn18v3654V/xBXFKVZGsaJwdLwxNMWqwAegX M6oVXtSwlNWGZR81d6xLKQmRWWyjFFnQBw9ymeSuzROmb1Ai95Qnlrs7fkj0R59D1Bof WCkpDhO3oAAejoDbQ5W4IG9qri0gNJsouoWeVX2A+suCRdC5UAFjMFKp8MR36nPJVqei +1s+ZdRxC1LA8nND3bz9/H8dAjn1WJG1G8wet9VW7p7ZGfOCm/fzvoR1hhepEOYFRgqw 83tqn4kR2FHVeZZLqhdSc3QXUmbDSIkdq++LlHhzy/YwNKwIcBINEkLzEx9UxO7w/l1m uq1w== X-Gm-Message-State: APjAAAUFOQ//4HAV7ifEBc6ypjbEVUhTpBjBS3c/VK5Z8MKMIWVVJkhk IwQLKCTY3p567pL17OZF8FxoWFfIR95JDz73NCpD7w== X-Google-Smtp-Source: APXvYqwckZigHlOABskburkbupcSLbcpggnyKV0ygVNQaEuv+SvAs4JknGAxuHaNCJVzgQm1j/5c6GX2bElOrrnl3hs= X-Received: by 2002:a9d:7b50:: with SMTP id f16mr23190266oto.221.1553696476443; Wed, 27 Mar 2019 07:21:16 -0700 (PDT) MIME-Version: 1.0 References: <201903261547.x2QFlDWC099862@repo.freebsd.org> In-Reply-To: <201903261547.x2QFlDWC099862@repo.freebsd.org> From: Edward Napierala Message-ID: Subject: Re: svn commit: r345549 - head/sys/dev/smartpqi To: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 74EA577118 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:46 -0000 X-Original-Date: Wed, 27 Mar 2019 14:21:05 +0000 X-List-Received-Date: Tue, 03 Sep 2019 14:05:46 -0000 On Tue, 26 Mar 2019 at 15:47, Edward Tomasz Napierala wrote: > > Author: trasz > Date: Tue Mar 26 15:47:13 2019 > New Revision: 345549 > URL: https://svnweb.freebsd.org/changeset/base/345549 > > Log: > Make smartpqi(4) behave better when running out of memory, by returning > CAM_RESRC_UNAVAIL instead of CAM_REQUEUE_REQ. This makes CAM delay a bit > before retrying, so that the retries actually get a chance to succeed. > > Reviewed by: sbruno Reviewed by: imp, sbruno Sorry for missing this earlier. From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A052DBE01; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yd6WrSz4NpC; Tue, 3 Sep 2019 14:05:45 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id D7D1719ACB; Tue, 3 Sep 2019 14:05:45 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 24C4918B4A; Wed, 27 Mar 2019 15:17:35 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487F680A38; Wed, 27 Mar 2019 15:17:34 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1CA6918AF9; Wed, 27 Mar 2019 15:17:34 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id ED69618AF7 for ; Wed, 27 Mar 2019 15:17:30 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73E5F80A2E; Wed, 27 Mar 2019 15:17:30 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4783F8FD9; Wed, 27 Mar 2019 15:17:30 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2RFHUuW039712; Wed, 27 Mar 2019 15:17:30 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2RFHTNH039711; Wed, 27 Mar 2019 15:17:29 GMT (envelope-from des@FreeBSD.org) Message-Id: <201903271517.x2RFHTNH039711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345579 - in head: crypto/openssh secure/usr.bin/ssh X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: in head: crypto/openssh secure/usr.bin/ssh X-SVN-Commit-Revision: 345579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 487F680A38 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:46 -0000 X-Original-Date: Wed, 27 Mar 2019 15:17:29 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:46 -0000 Author: des Date: Wed Mar 27 15:17:29 2019 New Revision: 345579 URL: https://svnweb.freebsd.org/changeset/base/345579 Log: Add workaround for a QoS-related bug in VMWare Workstation. Submitted by: yuripv Differential Revision: https://reviews.freebsd.org/D18636 Modified: head/crypto/openssh/readconf.c head/secure/usr.bin/ssh/Makefile Modified: head/crypto/openssh/readconf.c ============================================================================== --- head/crypto/openssh/readconf.c Wed Mar 27 14:51:03 2019 (r345578) +++ head/crypto/openssh/readconf.c Wed Mar 27 15:17:29 2019 (r345579) @@ -16,6 +16,9 @@ __RCSID("$FreeBSD$"); #include +#ifdef VMWARE_GUEST_WORKAROUND +#include +#endif #include #include #include @@ -1954,7 +1957,16 @@ fill_default_options(Options * options) { char *all_cipher, *all_mac, *all_kex, *all_key; int r; +#ifdef VMWARE_GUEST_WORKAROUND + char scval[7]; /* "vmware\0" */ + size_t scsiz = sizeof(scval); + int vmwguest = 0; + if (sysctlbyname("kern.vm_guest", scval, &scsiz, NULL, 0) == 0 && + strcmp(scval, "vmware") == 0) + vmwguest = 1; +#endif + if (options->forward_agent == -1) options->forward_agent = 0; if (options->forward_x11 == -1) @@ -2088,8 +2100,18 @@ fill_default_options(Options * options) if (options->visual_host_key == -1) options->visual_host_key = 0; if (options->ip_qos_interactive == -1) +#ifdef VMWARE_GUEST_WORKAROUND + if (vmwguest) + options->ip_qos_interactive = IPTOS_LOWDELAY; + else +#endif options->ip_qos_interactive = IPTOS_DSCP_AF21; if (options->ip_qos_bulk == -1) +#ifdef VMWARE_GUEST_WORKAROUND + if (vmwguest) + options->ip_qos_bulk = IPTOS_THROUGHPUT; + else +#endif options->ip_qos_bulk = IPTOS_DSCP_CS1; if (options->request_tty == -1) options->request_tty = REQUEST_TTY_AUTO; Modified: head/secure/usr.bin/ssh/Makefile ============================================================================== --- head/secure/usr.bin/ssh/Makefile Wed Mar 27 14:51:03 2019 (r345578) +++ head/secure/usr.bin/ssh/Makefile Wed Mar 27 15:17:29 2019 (r345579) @@ -37,6 +37,9 @@ LIBADD+= crypto CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" .endif +# Workaround VMware Workstation NAT bug +CFLAGS+=-DVMWARE_GUEST_WORKAROUND + .include .PATH: ${SSHDIR} From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5FEDDBDF4; Tue, 3 Sep 2019 14:05:45 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yd5G4Yz4Np4; Tue, 3 Sep 2019 14:05:45 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id ABF5E19ABB; Tue, 3 Sep 2019 14:05:45 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C4BB816B6E; Wed, 27 Mar 2019 12:25:51 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45BF07307C; Wed, 27 Mar 2019 12:25:50 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0F24C16B23; Wed, 27 Mar 2019 12:25:50 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id BE41116B21 for ; Wed, 27 Mar 2019 12:25:47 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81ABF73077; Wed, 27 Mar 2019 12:25:47 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5886D7311; Wed, 27 Mar 2019 12:25:47 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2RCPlHI050577; Wed, 27 Mar 2019 12:25:47 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2RCPkfj050575; Wed, 27 Mar 2019 12:25:46 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201903271225.x2RCPkfj050575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345573 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 345573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 45BF07307C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:45 -0000 X-Original-Date: Wed, 27 Mar 2019 12:25:46 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:45 -0000 Author: scottl Date: Wed Mar 27 12:25:46 2019 New Revision: 345573 URL: https://svnweb.freebsd.org/changeset/base/345573 Log: Add missing break statements. Coverity CID 1400446. Reported by: mav Modified: head/sys/dev/mpr/mpr_table.c head/sys/dev/mps/mps_table.c Modified: head/sys/dev/mpr/mpr_table.c ============================================================================== --- head/sys/dev/mpr/mpr_table.c Wed Mar 27 11:03:07 2019 (r345572) +++ head/sys/dev/mpr/mpr_table.c Wed Mar 27 12:25:46 2019 (r345573) @@ -451,6 +451,7 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOT MPR_PRINTFIELD(sc, data, DevHandle, 0x%x); mpr_print_field(sc, "SASAddress: 0x%jx\n", mpr_to_u64(&data->SASAddress)); + break; } case MPI2_EVENT_SAS_BROADCAST_PRIMITIVE: { @@ -461,6 +462,7 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOT MPR_PRINTFIELD(sc, data, Port, %d); MPR_PRINTFIELD(sc, data, PortWidth, %d); MPR_PRINTFIELD(sc, data, Primitive, 0x%x); + break; } default: break; Modified: head/sys/dev/mps/mps_table.c ============================================================================== --- head/sys/dev/mps/mps_table.c Wed Mar 27 11:03:07 2019 (r345572) +++ head/sys/dev/mps/mps_table.c Wed Mar 27 12:25:46 2019 (r345573) @@ -430,6 +430,7 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOT MPS_PRINTFIELD(sc, data, DevHandle, 0x%x); mps_print_field(sc, "SASAddress: 0x%jx\n", mps_to_u64(&data->SASAddress)); + break; } case MPI2_EVENT_SAS_BROADCAST_PRIMITIVE: { @@ -440,6 +441,7 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOT MPS_PRINTFIELD(sc, data, Port, %d); MPS_PRINTFIELD(sc, data, PortWidth, %d); MPS_PRINTFIELD(sc, data, Primitive, 0x%x); + break; } default: break; From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59928DBE14; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yf1X9rz4NpS; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 24C2219AE6; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 924BE1B4AF; Wed, 27 Mar 2019 18:03:40 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CDA586950; Wed, 27 Mar 2019 18:03:39 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 149C41B479; Wed, 27 Mar 2019 18:03:39 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D568C1B473 for ; Wed, 27 Mar 2019 18:03:35 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CA4D86946; Wed, 27 Mar 2019 18:03:35 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AFD5ACC2; Wed, 27 Mar 2019 18:03:35 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2RI3Z3W028517; Wed, 27 Mar 2019 18:03:35 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2RI3YIa028514; Wed, 27 Mar 2019 18:03:34 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201903271803.x2RI3YIa028514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345585 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 345585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 6CDA586950 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:46 -0000 X-Original-Date: Wed, 27 Mar 2019 18:03:34 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:46 -0000 Author: bde Date: Wed Mar 27 18:03:34 2019 New Revision: 345585 URL: https://svnweb.freebsd.org/changeset/base/345585 Log: Fix accessing pixels under the mouse cursor: Reading of single pixels didn't look under the cursor. Copying of 1x1 bitmaps didn't look under the cursor for either reading or writing. Copying of larger bitmaps looked under the cursor for at most the destination. Copying of larger bitmaps looked under a garbage cursor (for the Display bitmap) when the destination is a MEMBUF. The results are not used, so this only wasted time and flickered the cursor. Writing of single pixels looked under a garbage cursor for MEMBUF destinations, as above except this clobbered the current cursor and didn't update the MEMBUF. Writing of single pixels is not implemented yet in depths > 8. Otherwise, writing of single pixels worked. It was the only working case for accessing pixels under the cursor. Clearing of MEMBUFs wasted time freezing the cursor in the Display bitmap. The fixes abuse the top bits in the color arg to the cursor freezing function to control the function. Also clear the top 8 bits so that applications can't clobber the control bits or create 256 aliases for every 24-bit pixel value in depth 32. Races fixed: Showing and hiding the cursor only tried to avoid races with the mouse event signal handler for internal operations. There are still many shorter races from not using volatile or sig_atomic_t for the variable to control this. This variable also controls freezes, and has more complicated states than before. The internal operation of unfreezing the cursor opened a race window by unsetting the signal/freeze variable before showing the cursor. Modified: head/lib/libvgl/bitmap.c head/lib/libvgl/mouse.c head/lib/libvgl/simple.c Modified: head/lib/libvgl/bitmap.c ============================================================================== --- head/lib/libvgl/bitmap.c Wed Mar 27 17:55:39 2019 (r345584) +++ head/lib/libvgl/bitmap.c Wed Mar 27 18:03:34 2019 (r345585) @@ -361,9 +361,13 @@ VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, { int error; - VGLMouseFreeze(dstx, dsty, width, hight, 0); + if (src->Type != MEMBUF) + VGLMouseFreeze(srcx, srcy, width, hight, 0); + if (dst->Type != MEMBUF) + VGLMouseFreeze(dstx, dsty, width, hight, 0); error = __VGLBitmapCopy(src, srcx, srcy, dst, dstx, dsty, width, hight); - VGLMouseUnFreeze(); + if (src->Type != MEMBUF || dst->Type != MEMBUF) + VGLMouseUnFreeze(); return error; } Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Wed Mar 27 17:55:39 2019 (r345584) +++ head/lib/libvgl/mouse.c Wed Mar 27 18:03:34 2019 (r345585) @@ -102,6 +102,7 @@ VGLMousePointerShow() int i, pos, pos1; if (!VGLMouseVisible) { + VGLMouseFrozen++; VGLMouseVisible = 1; crtcidx = inb(0x3c4); crtcval = inb(0x3c5); @@ -124,6 +125,7 @@ VGLMousePointerShow() outb(0x3c5, crtcval); outb(0x3ce, gdcidx); outb(0x3cf, gdcval); + VGLMouseFrozen--; } } @@ -133,6 +135,7 @@ VGLMousePointerHide() byte crtcidx, crtcval, gdcidx, gdcval; if (VGLMouseVisible) { + VGLMouseFrozen++; VGLMouseVisible = 0; crtcidx = inb(0x3c4); crtcval = inb(0x3c5); @@ -144,6 +147,7 @@ VGLMousePointerHide() outb(0x3c5, crtcval); outb(0x3ce, gdcidx); outb(0x3cf, gdcval); + VGLMouseFrozen--; } } @@ -170,7 +174,7 @@ VGLMouseAction(int dummy) struct mouse_info mouseinfo; if (VGLMouseFrozen) { - VGLMouseFrozen++; + VGLMouseFrozen += 8; return; } mouseinfo.operation = MOUSE_GETINFO; @@ -257,9 +261,8 @@ VGLMouseFreeze(int x, int y, int width, int hight, u_l { int i, xstride, ystride; - if (!VGLMouseFrozen) { - VGLMouseFrozen = 1; - if (width > 1 || hight > 1) { /* bitmap */ + VGLMouseFrozen++; + if (width > 1 || hight > 1 || (color & 0xc0000000) == 0) { /* bitmap */ if (VGLMouseShown == 1) { int overlap; @@ -283,29 +286,38 @@ VGLMouseFreeze(int x, int y, int width, int hight, u_l y >= VGLMouseYpos && y < VGLMouseYpos + MOUSE_IMG_SIZE) { xstride = VGLDisplay->PixelBytes; ystride = MOUSE_IMG_SIZE * xstride; - for (i = 0; i < xstride; i++, color >>= 8) - VGLMouseSave.Bitmap[(y-VGLMouseYpos)*ystride+ - (x-VGLMouseXpos)*xstride+i] = color; - if (VGLMouseAndMask->Bitmap - [(y-VGLMouseYpos)*MOUSE_IMG_SIZE+(x-VGLMouseXpos)]) { - return 1; + if (color & 0x40000000) { /* Get */ + color = 0; + for (i = xstride - 1; i >= 0; i--) + color = (color << 8) | + VGLMouseSave.Bitmap[(y-VGLMouseYpos)*ystride+ + (x-VGLMouseXpos)*xstride+i]; + return 0x40000000 | (color & 0xffffff); + } else { /* Set */ + color &= 0xffffff; /* discard flag and other garbage */ + for (i = 0; i < xstride; i++, color >>= 8) + VGLMouseSave.Bitmap[(y-VGLMouseYpos)*ystride+ + (x-VGLMouseXpos)*xstride+i] = color; + if (VGLMouseAndMask->Bitmap + [(y-VGLMouseYpos)*MOUSE_IMG_SIZE+(x-VGLMouseXpos)]) { + return 1; + } } } } - } return 0; } void VGLMouseUnFreeze() { - if (VGLMouseFrozen > 1) { + if (VGLMouseFrozen > 8) { VGLMouseFrozen = 0; VGLMouseAction(0); } else { - VGLMouseFrozen = 0; if (VGLMouseShown == VGL_MOUSESHOW && !VGLMouseVisible) VGLMousePointerShow(); + VGLMouseFrozen = 0; } } Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Wed Mar 27 17:55:39 2019 (r345584) +++ head/lib/libvgl/simple.c Wed Mar 27 18:03:34 2019 (r345585) @@ -98,7 +98,8 @@ VGLSetXY(VGLBitmap *object, int x, int y, u_long color VGLCheckSwitch(); if (x>=0 && xVXsize && y>=0 && yVYsize) { - if (!VGLMouseFreeze(x, y, 1, 1, color)) { + if (object->Type == MEMBUF || + !VGLMouseFreeze(x, y, 1, 1, 0x80000000 | color)) { switch (object->Type) { case MEMBUF: case VIDBUF8: @@ -139,12 +140,13 @@ set_planar: object->Bitmap[offset] |= (byte)color; } } - VGLMouseUnFreeze(); + if (object->Type != MEMBUF) + VGLMouseUnFreeze(); } } -u_long -VGLGetXY(VGLBitmap *object, int x, int y) +static u_long +__VGLGetXY(VGLBitmap *object, int x, int y) { int offset; byte b[4]; @@ -152,9 +154,6 @@ VGLGetXY(VGLBitmap *object, int x, int y) u_long color; byte mask; - VGLCheckSwitch(); - if (x<0 || x>=object->VXsize || y<0 || y>=object->VYsize) - return 0; switch (object->Type) { case MEMBUF: case VIDBUF8: @@ -195,6 +194,27 @@ get_planar: return 0; /* XXX black? */ } +u_long +VGLGetXY(VGLBitmap *object, int x, int y) +{ + u_long color; + + VGLCheckSwitch(); + if (x<0 || x>=object->VXsize || y<0 || y>=object->VYsize) + return 0; + if (object->Type != MEMBUF) { + color = VGLMouseFreeze(x, y, 1, 1, 0x40000000); + if (color & 0x40000000) { + VGLMouseUnFreeze(); + return color & 0xffffff; + } + } + color = __VGLGetXY(object, x, y); + if (object->Type != MEMBUF) + VGLMouseUnFreeze(); + return color; +} + /* * Symmetric Double Step Line Algorithm by Brian Wyvill from * "Graphics Gems", Academic Press, 1990. @@ -501,7 +521,8 @@ VGLClear(VGLBitmap *object, u_long color) byte b[4]; VGLCheckSwitch(); - VGLMouseFreeze(0, 0, object->Xsize, object->Ysize, color); /* XXX */ + if (object->Type != MEMBUF) + VGLMouseFreeze(0, 0, object->Xsize, object->Ysize, color); switch (object->Type) { case MEMBUF: case VIDBUF8: @@ -565,7 +586,8 @@ VGLClear(VGLBitmap *object, u_long color) outb(0x3ce, 0x05); outb(0x3cf, 0x00); break; } - VGLMouseUnFreeze(); + if (object->Type != MEMBUF) + VGLMouseUnFreeze(); } void From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DFF5DBE03; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yd6ct0z4NpD; Tue, 3 Sep 2019 14:05:45 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id C3D9D19AC3; Tue, 3 Sep 2019 14:05:45 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E84DA182BF; Wed, 27 Mar 2019 14:35:42 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43AD3775C5; Wed, 27 Mar 2019 14:35:42 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1510318296; Wed, 27 Mar 2019 14:35:42 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 1377F18294 for ; Wed, 27 Mar 2019 14:35:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98BA9775C1; Wed, 27 Mar 2019 14:35:38 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 709BF890D; Wed, 27 Mar 2019 14:35:38 +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 x2REZcWD018737; Wed, 27 Mar 2019 14:35:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2REZccs018736; Wed, 27 Mar 2019 14:35:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201903271435.x2REZccs018736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345576 - head/crypto/openssh X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/crypto/openssh X-SVN-Commit-Revision: 345576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 43AD3775C5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:46 -0000 X-Original-Date: Wed, 27 Mar 2019 14:35:38 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:46 -0000 Author: emaste Date: Wed Mar 27 14:35:38 2019 New Revision: 345576 URL: https://svnweb.freebsd.org/changeset/base/345576 Log: Merge r345574 from vendor-crypto: upstream: when checking that filenames sent by the server side match what the client requested, be prepared to handle shell-style brace alternations, e.g. "{foo,bar}". "looks good to me" millert@ + in snaps for the last week courtesy deraadt@ OpenBSD-Commit-ID: 3b1ce7639b0b25b2248e3a30f561a548f6815f3e Discussed with: des Obtained from: OpenSSH-portable 3d896c157c722bc47adca51a58dca859225b5874 Modified: head/crypto/openssh/scp.c Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/scp.c ============================================================================== --- head/crypto/openssh/scp.c Wed Mar 27 14:15:35 2019 (r345575) +++ head/crypto/openssh/scp.c Wed Mar 27 14:35:38 2019 (r345576) @@ -1,4 +1,4 @@ -/* $OpenBSD: scp.c,v 1.203 2019/01/27 07:14:11 jmc Exp $ */ +/* $OpenBSD: scp.c,v 1.204 2019/02/10 11:15:52 djm Exp $ */ /* * scp - secure remote copy. This is basically patched BSD rcp which * uses ssh to do the data transfer (instead of using rcmd). @@ -626,6 +626,253 @@ parse_scp_uri(const char *uri, char **userp, char **ho return r; } +/* Appends a string to an array; returns 0 on success, -1 on alloc failure */ +static int +append(char *cp, char ***ap, size_t *np) +{ + char **tmp; + + if ((tmp = reallocarray(*ap, *np + 1, sizeof(*tmp))) == NULL) + return -1; + tmp[(*np)] = cp; + (*np)++; + *ap = tmp; + return 0; +} + +/* + * Finds the start and end of the first brace pair in the pattern. + * returns 0 on success or -1 for invalid patterns. + */ +static int +find_brace(const char *pattern, int *startp, int *endp) +{ + int i; + int in_bracket, brace_level; + + *startp = *endp = -1; + in_bracket = brace_level = 0; + for (i = 0; i < INT_MAX && *endp < 0 && pattern[i] != '\0'; i++) { + switch (pattern[i]) { + case '\\': + /* skip next character */ + if (pattern[i + 1] != '\0') + i++; + break; + case '[': + in_bracket = 1; + break; + case ']': + in_bracket = 0; + break; + case '{': + if (in_bracket) + break; + if (pattern[i + 1] == '}') { + /* Protect a single {}, for find(1), like csh */ + i++; /* skip */ + break; + } + if (*startp == -1) + *startp = i; + brace_level++; + break; + case '}': + if (in_bracket) + break; + if (*startp < 0) { + /* Unbalanced brace */ + return -1; + } + if (--brace_level <= 0) + *endp = i; + break; + } + } + /* unbalanced brackets/braces */ + if (*endp < 0 && (*startp >= 0 || in_bracket)) + return -1; + return 0; +} + +/* + * Assembles and records a successfully-expanded pattern, returns -1 on + * alloc failure. + */ +static int +emit_expansion(const char *pattern, int brace_start, int brace_end, + int sel_start, int sel_end, char ***patternsp, size_t *npatternsp) +{ + char *cp; + int o = 0, tail_len = strlen(pattern + brace_end + 1); + + if ((cp = malloc(brace_start + (sel_end - sel_start) + + tail_len + 1)) == NULL) + return -1; + + /* Pattern before initial brace */ + if (brace_start > 0) { + memcpy(cp, pattern, brace_start); + o = brace_start; + } + /* Current braced selection */ + if (sel_end - sel_start > 0) { + memcpy(cp + o, pattern + sel_start, + sel_end - sel_start); + o += sel_end - sel_start; + } + /* Remainder of pattern after closing brace */ + if (tail_len > 0) { + memcpy(cp + o, pattern + brace_end + 1, tail_len); + o += tail_len; + } + cp[o] = '\0'; + if (append(cp, patternsp, npatternsp) != 0) { + free(cp); + return -1; + } + return 0; +} + +/* + * Expand the first encountered brace in pattern, appending the expanded + * patterns it yielded to the *patternsp array. + * + * Returns 0 on success or -1 on allocation failure. + * + * Signals whether expansion was performed via *expanded and whether + * pattern was invalid via *invalid. + */ +static int +brace_expand_one(const char *pattern, char ***patternsp, size_t *npatternsp, + int *expanded, int *invalid) +{ + int i; + int in_bracket, brace_start, brace_end, brace_level; + int sel_start, sel_end; + + *invalid = *expanded = 0; + + if (find_brace(pattern, &brace_start, &brace_end) != 0) { + *invalid = 1; + return 0; + } else if (brace_start == -1) + return 0; + + in_bracket = brace_level = 0; + for (i = sel_start = brace_start + 1; i < brace_end; i++) { + switch (pattern[i]) { + case '{': + if (in_bracket) + break; + brace_level++; + break; + case '}': + if (in_bracket) + break; + brace_level--; + break; + case '[': + in_bracket = 1; + break; + case ']': + in_bracket = 0; + break; + case '\\': + if (i < brace_end - 1) + i++; /* skip */ + break; + } + if (pattern[i] == ',' || i == brace_end - 1) { + if (in_bracket || brace_level > 0) + continue; + /* End of a selection, emit an expanded pattern */ + + /* Adjust end index for last selection */ + sel_end = (i == brace_end - 1) ? brace_end : i; + if (emit_expansion(pattern, brace_start, brace_end, + sel_start, sel_end, patternsp, npatternsp) != 0) + return -1; + /* move on to the next selection */ + sel_start = i + 1; + continue; + } + } + if (in_bracket || brace_level > 0) { + *invalid = 1; + return 0; + } + /* success */ + *expanded = 1; + return 0; +} + +/* Expand braces from pattern. Returns 0 on success, -1 on failure */ +static int +brace_expand(const char *pattern, char ***patternsp, size_t *npatternsp) +{ + char *cp, *cp2, **active = NULL, **done = NULL; + size_t i, nactive = 0, ndone = 0; + int ret = -1, invalid = 0, expanded = 0; + + *patternsp = NULL; + *npatternsp = 0; + + /* Start the worklist with the original pattern */ + if ((cp = strdup(pattern)) == NULL) + return -1; + if (append(cp, &active, &nactive) != 0) { + free(cp); + return -1; + } + while (nactive > 0) { + cp = active[nactive - 1]; + nactive--; + if (brace_expand_one(cp, &active, &nactive, + &expanded, &invalid) == -1) { + free(cp); + goto fail; + } + if (invalid) + fatal("%s: invalid brace pattern \"%s\"", __func__, cp); + if (expanded) { + /* + * Current entry expanded to new entries on the + * active list; discard the progenitor pattern. + */ + free(cp); + continue; + } + /* + * Pattern did not expand; append the finename component to + * the completed list + */ + if ((cp2 = strrchr(cp, '/')) != NULL) + *cp2++ = '\0'; + else + cp2 = cp; + if (append(xstrdup(cp2), &done, &ndone) != 0) { + free(cp); + goto fail; + } + free(cp); + } + /* success */ + *patternsp = done; + *npatternsp = ndone; + done = NULL; + ndone = 0; + ret = 0; + fail: + for (i = 0; i < nactive; i++) + free(active[i]); + free(active); + for (i = 0; i < ndone; i++) + free(done[i]); + free(done); + return ret; +} + void toremote(int argc, char **argv) { @@ -989,7 +1236,8 @@ sink(int argc, char **argv, const char *src) unsigned long long ull; int setimes, targisdir, wrerrno = 0; char ch, *cp, *np, *targ, *why, *vect[1], buf[2048], visbuf[2048]; - char *src_copy = NULL, *restrict_pattern = NULL; + char **patterns = NULL; + size_t n, npatterns = 0; struct timeval tv[2]; #define atime tv[0] @@ -1019,16 +1267,13 @@ sink(int argc, char **argv, const char *src) * Prepare to try to restrict incoming filenames to match * the requested destination file glob. */ - if ((src_copy = strdup(src)) == NULL) - fatal("strdup failed"); - if ((restrict_pattern = strrchr(src_copy, '/')) != NULL) { - *restrict_pattern++ = '\0'; - } + if (brace_expand(src, &patterns, &npatterns) != 0) + fatal("%s: could not expand pattern", __func__); } for (first = 1;; first = 0) { cp = buf; if (atomicio(read, remin, cp, 1) != 1) - return; + goto done; if (*cp++ == '\n') SCREWUP("unexpected "); do { @@ -1054,7 +1299,7 @@ sink(int argc, char **argv, const char *src) } if (buf[0] == 'E') { (void) atomicio(vwrite, remout, "", 1); - return; + goto done; } if (ch == '\n') *--cp = 0; @@ -1129,9 +1374,14 @@ sink(int argc, char **argv, const char *src) run_err("error: unexpected filename: %s", cp); exit(1); } - if (restrict_pattern != NULL && - fnmatch(restrict_pattern, cp, 0) != 0) - SCREWUP("filename does not match request"); + if (npatterns > 0) { + for (n = 0; n < npatterns; n++) { + if (fnmatch(patterns[n], cp, 0) == 0) + break; + } + if (n >= npatterns) + SCREWUP("filename does not match request"); + } if (targisdir) { static char *namebuf; static size_t cursize; @@ -1290,7 +1540,15 @@ bad: run_err("%s: %s", np, strerror(errno)); break; } } +done: + for (n = 0; n < npatterns; n++) + free(patterns[n]); + free(patterns); + return; screwup: + for (n = 0; n < npatterns; n++) + free(patterns[n]); + free(patterns); run_err("protocol error: %s", why); exit(1); } From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19E73DBE04; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yd6vlKz4NpF; Tue, 3 Sep 2019 14:05:45 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id E4BCD19ACF; Tue, 3 Sep 2019 14:05:45 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 0EE0B198CF; Wed, 27 Mar 2019 16:26:08 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4603A82FCC; Wed, 27 Mar 2019 16:26:07 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1008819868; Wed, 27 Mar 2019 16:26:07 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 44DED19866 for ; Wed, 27 Mar 2019 16:26:04 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 135E482FC6; Wed, 27 Mar 2019 16:26:04 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAC4D9BC5; Wed, 27 Mar 2019 16:26:03 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2RGQ3iJ076111; Wed, 27 Mar 2019 16:26:03 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2RGQ3e7076110; Wed, 27 Mar 2019 16:26:03 GMT (envelope-from br@FreeBSD.org) Message-Id: <201903271626.x2RGQ3e7076110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345581 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 345581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 4603A82FCC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:46 -0000 X-Original-Date: Wed, 27 Mar 2019 16:26:03 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:46 -0000 Author: br Date: Wed Mar 27 16:26:03 2019 New Revision: 345581 URL: https://svnweb.freebsd.org/changeset/base/345581 Log: Grab timer frequency from FDT. RISC-V timer has no dedicated DTS node and we have to get timer frequency from cpus node. Tested on Government Furnished Equipment (GFE) cores synthesized on Xilinx VCU118. Reviewed by: markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19727 Modified: head/sys/riscv/riscv/timer.c Modified: head/sys/riscv/riscv/timer.c ============================================================================== --- head/sys/riscv/riscv/timer.c Wed Mar 27 16:19:02 2019 (r345580) +++ head/sys/riscv/riscv/timer.c Wed Mar 27 16:26:03 2019 (r345581) @@ -61,7 +61,10 @@ __FBSDID("$FreeBSD$"); #include #include -#define DEFAULT_FREQ 10000000 +#include +#include +#include +#include #define TIMER_COUNTS 0x00 #define TIMER_MTIMECMP(cpu) (cpu * 8) @@ -157,6 +160,32 @@ riscv_timer_intr(void *arg) } static int +riscv_timer_get_timebase(device_t dev, uint32_t *freq) +{ + phandle_t node; + int len; + + node = OF_finddevice("/cpus"); + if (node == -1) { + if (bootverbose) + device_printf(dev, "Can't find cpus node.\n"); + return (ENXIO); + } + + len = OF_getproplen(node, "timebase-frequency"); + if (len != 4) { + if (bootverbose) + device_printf(dev, + "Can't find timebase-frequency property.\n"); + return (ENXIO); + } + + OF_getencprop(node, "timebase-frequency", freq, len); + + return (0); +} + +static int riscv_timer_probe(device_t dev) { @@ -176,10 +205,9 @@ riscv_timer_attach(device_t dev) return (ENXIO); if (device_get_unit(dev) != 0) - return ENXIO; + return (ENXIO); - sc->clkfreq = DEFAULT_FREQ; - if (sc->clkfreq == 0) { + if (riscv_timer_get_timebase(dev, &sc->clkfreq) != 0) { device_printf(dev, "No clock frequency specified\n"); return (ENXIO); } From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60AD2DBE16; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yf1chGz4NpV; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 10F2B19ADC; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id F18731AD47; Wed, 27 Mar 2019 17:55:43 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475FC85EF3; Wed, 27 Mar 2019 17:55:43 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 17D2D1AD07; Wed, 27 Mar 2019 17:55:43 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id A8F821AD03 for ; Wed, 27 Mar 2019 17:55:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5454185EEC; Wed, 27 Mar 2019 17:55:40 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DB0FAB02; Wed, 27 Mar 2019 17:55:40 +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 x2RHtdFX023447; Wed, 27 Mar 2019 17:55:39 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2RHtdSs023446; Wed, 27 Mar 2019 17:55:39 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201903271755.x2RHtdSs023446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345584 - head X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 345584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 475FC85EF3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:47 -0000 X-Original-Date: Wed, 27 Mar 2019 17:55:39 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:47 -0000 Author: manu Date: Wed Mar 27 17:55:39 2019 New Revision: 345584 URL: https://svnweb.freebsd.org/changeset/base/345584 Log: pkgbase: Use uname as ABI_FILE Add some more missed in r345159 MFC after: 1 week Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Mar 27 17:28:23 2019 (r345583) +++ head/Makefile.inc1 Wed Mar 27 17:55:39 2019 (r345584) @@ -1906,11 +1906,11 @@ create-kernel-packages-flavor${flavor:C,^""$,${_defaul /name/ { printf("===> Creating %s-", $$2); next } \ /version/ {print $$2; next } ' \ ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \ create -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \ -p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \ -r ${KSTAGEDIR}/${DISTDIR} \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} . endfor .endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" @@ -1938,24 +1938,24 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_ /name/ { printf("===> Creating %s-", $$2); next } \ /version/ {print $$2; next } ' \ ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \ create -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \ -p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \ -r ${KSTAGEDIR}/kernel.${_kernel} \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} . endfor . endif . endfor .endif sign-packages: _pkgbootstrap .PHONY - @[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \ - unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ - ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + @[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest" ] && \ + unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest ; \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname repo \ + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ + ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ ${PKGSIGNKEY} ; \ - cd ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI); \ + cd ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI); \ ln -s ${PKG_VERSION} latest # From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDAD8DBE33; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yf3xJPz4Nps; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 613F619B0D; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 1E0A31E521; Wed, 27 Mar 2019 19:34:24 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 575778B861; Wed, 27 Mar 2019 19:34:23 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1912F1E4CC; Wed, 27 Mar 2019 19:34:23 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 6206B1E4C7 for ; Wed, 27 Mar 2019 19:34:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E36B8B855; Wed, 27 Mar 2019 19:34:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07CECBE28; Wed, 27 Mar 2019 19:34:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2RJYJkv078083; Wed, 27 Mar 2019 19:34:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2RJYJpI078081; Wed, 27 Mar 2019 19:34:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201903271934.x2RJYJpI078081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345594 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 345594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 575778B861 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:47 -0000 X-Original-Date: Wed, 27 Mar 2019 19:34:19 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:47 -0000 Author: markj Date: Wed Mar 27 19:34:19 2019 New Revision: 345594 URL: https://svnweb.freebsd.org/changeset/base/345594 Log: Stop using -fdebug-prefix-map to map the object directory. We were doing so as a workaround for the problem addressed by r345593, so it's no longer necessary. Reviewed by: jhb Discussed with: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19705 Modified: head/sys/conf/kern.post.mk head/sys/conf/kmod.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Mar 27 19:32:21 2019 (r345593) +++ head/sys/conf/kern.post.mk Wed Mar 27 19:34:19 2019 (r345594) @@ -368,11 +368,6 @@ CFLAGS+= -fdebug-prefix-map=./${_link}=${SYSDIR}/${_li .endif .endfor -.if defined(_MAP_DEBUG_PREFIX) -# Ensure that DWARF info contains a full path for auto-generated headers. -CFLAGS+= -fdebug-prefix-map=.=${.OBJDIR} -.endif - ${_ILINKS}: @case ${.TARGET} in \ machine) \ Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed Mar 27 19:32:21 2019 (r345593) +++ head/sys/conf/kmod.mk Wed Mar 27 19:34:19 2019 (r345594) @@ -302,11 +302,6 @@ CFLAGS+= -fdebug-prefix-map=./${_link}=${SYSDIR}/${_li .endif .endfor -.if defined(_MAP_DEBUG_PREFIX) -# Ensure that DWARF info contains a full path for auto-generated headers. -CFLAGS+= -fdebug-prefix-map=.=${.OBJDIR} -.endif - .NOPATH: ${_ILINKS} ${_ILINKS}: From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22DA9DBEBD; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yg4bS8z4Nr8; Tue, 3 Sep 2019 14:05:47 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 35F4819B7F; Tue, 3 Sep 2019 14:05:47 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id F371625EE; Wed, 27 Mar 2019 22:35:32 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CB096CA27; Wed, 27 Mar 2019 22:35:32 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 12EDE259F; Wed, 27 Mar 2019 22:35:32 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5EA26259D for ; Wed, 27 Mar 2019 22:35:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2ECE96CA21; Wed, 27 Mar 2019 22:35:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09679DCF6; Wed, 27 Mar 2019 22:35:29 +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 x2RMZSw6085273; Wed, 27 Mar 2019 22:35:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2RMZSb3085272; Wed, 27 Mar 2019 22:35:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903272235.x2RMZSb3085272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345620 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 345620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3CB096CA27 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:48 -0000 X-Original-Date: Wed, 27 Mar 2019 22:35:28 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:48 -0000 Author: kib Date: Wed Mar 27 22:35:28 2019 New Revision: 345620 URL: https://svnweb.freebsd.org/changeset/base/345620 Log: rtld: disable relro enforcement for irelative relocation processing. This fixes yet another breakage for relro + bind now. Reported by: emaste Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Mar 27 22:27:25 2019 (r345619) +++ head/libexec/rtld-elf/rtld.c Wed Mar 27 22:35:28 2019 (r345620) @@ -2956,14 +2956,14 @@ resolve_object_ifunc(Obj_Entry *obj, bool bind_now, in if (obj->ifuncs_resolved) return (0); obj->ifuncs_resolved = true; - if (obj->irelative && reloc_iresolve(obj, lockstate) == -1) + if (!obj->irelative && !((obj->bind_now || bind_now) && obj->gnu_ifunc)) + return (0); + if (obj_disable_relro(obj) == -1 || + (obj->irelative && reloc_iresolve(obj, lockstate) == -1) || + ((obj->bind_now || bind_now) && obj->gnu_ifunc && + reloc_gnu_ifunc(obj, flags, lockstate) == -1) || + obj_enforce_relro(obj) == -1) return (-1); - if ((obj->bind_now || bind_now) && obj->gnu_ifunc) { - if (obj_disable_relro(obj) || - reloc_gnu_ifunc(obj, flags, lockstate) == -1 || - obj_enforce_relro(obj)) - return (-1); - } return (0); } From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B497DBE2C; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yf3BSMz4Npk; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 5CFD519B09; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id CBCF71E39B; Wed, 27 Mar 2019 19:32:26 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 346B78B658; Wed, 27 Mar 2019 19:32:26 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 112A11E33C; Wed, 27 Mar 2019 19:32:26 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D36F21E33A for ; Wed, 27 Mar 2019 19:32:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AD2B8B647; Wed, 27 Mar 2019 19:32:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29D64BE10; Wed, 27 Mar 2019 19:32:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2RJWMPM076714; Wed, 27 Mar 2019 19:32:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2RJWMZN076697; Wed, 27 Mar 2019 19:32:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201903271932.x2RJWMZN076697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345593 - head/contrib/elftoolchain/libdwarf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/libdwarf X-SVN-Commit-Revision: 345593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 346B78B658 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:47 -0000 X-Original-Date: Wed, 27 Mar 2019 19:32:22 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:47 -0000 Author: markj Date: Wed Mar 27 19:32:21 2019 New Revision: 345593 URL: https://svnweb.freebsd.org/changeset/base/345593 Log: Prepend DW_AT_comp_dir to relative line number directory table entries. Relative directories may appear in the line number program for a CPU if files were included via a relative path, for instance with "-I.". Previously, dwarf_srclines(3) and dwarf_srcfiles(3) would return the relative path, so addr2line, for instance, would do the same. However, we can get an absolute path by prepending the compilation directory, so change libdwarf to do that to improve compatibility with GNU binutils and since it is more useful in general. Reviewed by: jhb Discussed with: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19705 Modified: head/contrib/elftoolchain/libdwarf/libdwarf_lineno.c Modified: head/contrib/elftoolchain/libdwarf/libdwarf_lineno.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_lineno.c Wed Mar 27 19:24:37 2019 (r345592) +++ head/contrib/elftoolchain/libdwarf/libdwarf_lineno.c Wed Mar 27 19:32:21 2019 (r345593) @@ -33,9 +33,10 @@ _dwarf_lineno_add_file(Dwarf_LineInfo li, uint8_t **p, Dwarf_Error *error, Dwarf_Debug dbg) { Dwarf_LineFile lf; - const char *dirname; + FILE *filepath; + const char *incdir; uint8_t *src; - int slen; + size_t slen; src = *p; @@ -54,20 +55,33 @@ _dwarf_lineno_add_file(Dwarf_LineInfo li, uint8_t **p, return (DW_DLE_DIR_INDEX_BAD); } - /* Make full pathname if need. */ + /* Make a full pathname if needed. */ if (*lf->lf_fname != '/') { - dirname = compdir; + filepath = open_memstream(&lf->lf_fullpath, &slen); + if (filepath == NULL) { + free(lf); + DWARF_SET_ERROR(dbg, error, DW_DLE_MEMORY); + return (DW_DLE_MEMORY); + } + if (lf->lf_dirndx > 0) - dirname = li->li_incdirs[lf->lf_dirndx - 1]; - if (dirname != NULL) { - slen = strlen(dirname) + strlen(lf->lf_fname) + 2; - if ((lf->lf_fullpath = malloc(slen)) == NULL) { - free(lf); - DWARF_SET_ERROR(dbg, error, DW_DLE_MEMORY); - return (DW_DLE_MEMORY); - } - snprintf(lf->lf_fullpath, slen, "%s/%s", dirname, - lf->lf_fname); + incdir = li->li_incdirs[lf->lf_dirndx - 1]; + else + incdir = NULL; + + /* + * Prepend the compilation directory if the directory table + * entry is relative. + */ + if (incdir == NULL || *incdir != '/') + fprintf(filepath, "%s/", compdir); + if (incdir != NULL) + fprintf(filepath, "%s/", incdir); + fprintf(filepath, "%s", lf->lf_fname); + if (fclose(filepath) != 0) { + free(lf); + DWARF_SET_ERROR(dbg, error, DW_DLE_MEMORY); + return (DW_DLE_MEMORY); } } From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5A3EDBECD; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yh1b6Qz4Nrd; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 75D2B19BAE; Tue, 3 Sep 2019 14:05:47 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id F392E7917; Thu, 28 Mar 2019 03:31:55 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CD6380908; Thu, 28 Mar 2019 03:31:55 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 2B04178D4; Thu, 28 Mar 2019 03:31:55 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id EA42A78D2 for ; Thu, 28 Mar 2019 03:31:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8102808FC; Thu, 28 Mar 2019 03:31:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7984F1957B; Thu, 28 Mar 2019 03:31:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2S3Vpg4039843; Thu, 28 Mar 2019 03:31:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2S3Vp3P039842; Thu, 28 Mar 2019 03:31:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201903280331.x2S3Vp3P039842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345627 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 345627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 5CD6380908 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:49 -0000 X-Original-Date: Thu, 28 Mar 2019 03:31:51 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:49 -0000 Author: kevans Date: Thu Mar 28 03:31:51 2019 New Revision: 345627 URL: https://svnweb.freebsd.org/changeset/base/345627 Log: if_bridge(4): ensure all traffic passing over the bridge is accounted for Consider a bridge0 with em0 and em1 members. Traffic rx'd by em0 and transmitted by bridge0 through em1 gets accounted for in IPACKETS/IBYTES and bridge0 bpf -- assuming it's not unicast traffic destined for em1. Unicast traffic destined for em1 traffic is not accounted for by any mechanism, and isn't pushed through bridge0's bpf machinery as any other packets that pass over the bridge do. Fix this and simplify GRAB_OUR_PACKETS by bailing out early if it was rx'd by the interface that it was addressed for. Everything else there is relevant for any traffic that came in from one member that's being directed at another member of the bridge. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19614 Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Thu Mar 28 03:30:04 2019 (r345626) +++ head/sys/net/if_bridge.c Thu Mar 28 03:31:51 2019 (r345627) @@ -2422,22 +2422,6 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) if (memcmp(IF_LLADDR((iface)), eh->ether_dhost, ETHER_ADDR_LEN) == 0 \ OR_CARP_CHECK_WE_ARE_DST((iface)) \ ) { \ - if ((iface)->if_type == IFT_BRIDGE) { \ - ETHER_BPF_MTAP(iface, m); \ - if_inc_counter(iface, IFCOUNTER_IPACKETS, 1); \ - if_inc_counter(iface, IFCOUNTER_IBYTES, m->m_pkthdr.len); \ - /* Filter on the physical interface. */ \ - if (V_pfil_local_phys && \ - (PFIL_HOOKED_IN(V_inet_pfil_head) \ - OR_PFIL_HOOKED_INET6)) { \ - if (bridge_pfil(&m, NULL, ifp, \ - PFIL_IN) != 0 || m == NULL) { \ - BRIDGE_UNLOCK(sc); \ - return (NULL); \ - } \ - eh = mtod(m, struct ether_header *); \ - } \ - } \ if (bif->bif_flags & IFBIF_LEARNING) { \ error = bridge_rtupdate(sc, eh->ether_shost, \ vlan, bif, 0, IFBAF_DYNAMIC); \ @@ -2448,6 +2432,24 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) } \ } \ m->m_pkthdr.rcvif = iface; \ + if ((iface) == ifp) { \ + /* Skip bridge processing... src == dest */ \ + BRIDGE_UNLOCK(sc); \ + return (m); \ + } \ + /* It's passing over or to the bridge, locally. */ \ + ETHER_BPF_MTAP(bifp, m); \ + if_inc_counter(bifp, IFCOUNTER_IPACKETS, 1); \ + if_inc_counter(bifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); \ + /* Filter on the physical interface. */ \ + if (V_pfil_local_phys && (PFIL_HOOKED_IN(V_inet_pfil_head) \ + OR_PFIL_HOOKED_INET6)) { \ + if (bridge_pfil(&m, NULL, ifp, \ + PFIL_IN) != 0 || m == NULL) { \ + BRIDGE_UNLOCK(sc); \ + return (NULL); \ + } \ + } \ BRIDGE_UNLOCK(sc); \ return (m); \ } \ From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA47EDBECF; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yh17RZz4NrT; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 7E2AB19BB1; Tue, 3 Sep 2019 14:05:47 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 319127DDE; Thu, 28 Mar 2019 03:48:57 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 387A681127; Thu, 28 Mar 2019 03:48:56 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0D6B47D97; Thu, 28 Mar 2019 03:48:56 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 774957D95 for ; Thu, 28 Mar 2019 03:48:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52D5181122; Thu, 28 Mar 2019 03:48:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D0B119795; Thu, 28 Mar 2019 03:48:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2S3mr3f048295; Thu, 28 Mar 2019 03:48:53 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2S3mpNw048287; Thu, 28 Mar 2019 03:48:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201903280348.x2S3mpNw048287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345628 - head/usr.bin/dtc X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/dtc X-SVN-Commit-Revision: 345628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 387A681127 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:50 -0000 X-Original-Date: Thu, 28 Mar 2019 03:48:51 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:50 -0000 Author: kevans Date: Thu Mar 28 03:48:51 2019 New Revision: 345628 URL: https://svnweb.freebsd.org/changeset/base/345628 Log: dtc(1): Update to 1a79f5f26631 Highlights: - Bugfix for order in which /delete-node/ and /delete-property/ are processed [0] - /omit-if-no-ref/ support has been added (used only by U-Boot at this point, in theory) - GPL dtc compat version bumped to 1.4.7 - Various small fixes and compatibility improvements Reported by: strejda [0] MFC after: 1 week Modified: head/usr.bin/dtc/dtb.cc head/usr.bin/dtc/dtb.hh head/usr.bin/dtc/dtc.1 head/usr.bin/dtc/dtc.cc head/usr.bin/dtc/fdt.cc head/usr.bin/dtc/fdt.hh head/usr.bin/dtc/input_buffer.cc head/usr.bin/dtc/util.hh Modified: head/usr.bin/dtc/dtb.cc ============================================================================== --- head/usr.bin/dtc/dtb.cc Thu Mar 28 03:31:51 2019 (r345627) +++ head/usr.bin/dtc/dtb.cc Thu Mar 28 03:48:51 2019 (r345628) @@ -37,9 +37,33 @@ #include #include #include +#include using std::string; +namespace { + +void write(dtc::byte_buffer &buffer, int fd) +{ + size_t size = buffer.size(); + uint8_t *data = buffer.data(); + while (size > 0) + { + ssize_t r = ::write(fd, data, size); + if (r >= 0) + { + data += r; + size -= r; + } + else if (errno != EAGAIN) + { + fprintf(stderr, "Writing to file failed\n"); + exit(-1); + } + } +} +} + namespace dtc { namespace dtb @@ -90,8 +114,7 @@ binary_writer::write_data(uint64_t v) void binary_writer::write_to_file(int fd) { - // FIXME: Check return - write(fd, buffer.data(), buffer.size()); + write(buffer, fd); } uint32_t @@ -222,8 +245,7 @@ asm_writer::write_data(uint64_t v) void asm_writer::write_to_file(int fd) { - // FIXME: Check return - write(fd, buffer.data(), buffer.size()); + write(buffer, fd); } uint32_t Modified: head/usr.bin/dtc/dtb.hh ============================================================================== --- head/usr.bin/dtc/dtb.hh Thu Mar 28 03:31:51 2019 (r345627) +++ head/usr.bin/dtc/dtb.hh Thu Mar 28 03:48:51 2019 (r345628) @@ -109,6 +109,8 @@ inline const char *token_type_name(token_type t) return "FDT_END"; } assert(0); + // Not reached. + return nullptr; } /** Modified: head/usr.bin/dtc/dtc.1 ============================================================================== --- head/usr.bin/dtc/dtc.1 Thu Mar 28 03:31:51 2019 (r345627) +++ head/usr.bin/dtc/dtc.1 Thu Mar 28 03:48:51 2019 (r345628) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd April 7, 2018 +.Dd March 27, 2019 .Dt DTC 1 .Os .Sh NAME @@ -304,7 +304,18 @@ Overlay blobs can be applied at boot time by setting in .Xr loader.conf 5 . Multiple overlays may be specified, and they will be applied in the order given. -.El +.Sh NODE OMISSION +This utility supports the +.Va /omit-if-no-ref/ +statement to mark nodes for omission if they are ultimately not referenced +elsewhere in the device tree. +This may be used in more space-constrained environments to remove nodes that may +not be applicable to the specific device the tree is being compiled for. +.Pp +When the +.Fl @ +flag is used to write symbols, nodes with labels will be considered referenced +and will not be removed from the tree. .Sh EXAMPLES The command: .Pp @@ -403,7 +414,11 @@ A dtc tool first appeared in This version of the tool first appeared in .Fx 10.0 . .Sh AUTHORS -.An David T. Chisnall +.Nm +was written by +.An David T. Chisnall . +Some features were added later by +.An Kyle Evans . .Pp Note: The fact that the tool and the author share the same initials is entirely coincidental. Modified: head/usr.bin/dtc/dtc.cc ============================================================================== --- head/usr.bin/dtc/dtc.cc Thu Mar 28 03:31:51 2019 (r345627) +++ head/usr.bin/dtc/dtc.cc Thu Mar 28 03:48:51 2019 (r345628) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -65,7 +66,7 @@ int version_minor_compatible = 4; * The current patch level of the tool. */ int version_patch = 0; -int version_patch_compatible = 0; +int version_patch_compatible = 7; void usage(const string &argv0) { @@ -105,7 +106,7 @@ main(int argc, char **argv) bool debug_mode = false; auto write_fn = &device_tree::write_binary; auto read_fn = &device_tree::parse_dts; - uint32_t boot_cpu; + uint32_t boot_cpu = 0; bool boot_cpu_specified = false; bool keep_going = false; bool sort = false; Modified: head/usr.bin/dtc/fdt.cc ============================================================================== --- head/usr.bin/dtc/fdt.cc Thu Mar 28 03:31:51 2019 (r345627) +++ head/usr.bin/dtc/fdt.cc Thu Mar 28 03:48:51 2019 (r345628) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -491,6 +492,7 @@ property::property(text_input_buffer &input, break; } } + [[fallthrough]]; default: input.parse_error("Invalid property value."); valid = false; @@ -622,6 +624,7 @@ property_value::try_to_merge(property_value &other) return false; case EMPTY: *this = other; + [[fallthrough]]; case STRING: case STRING_LIST: case CROSS_REFERENCE: @@ -846,6 +849,7 @@ node_ptr node::create_special_node(const string &name, } node::node(text_input_buffer &input, + device_tree &tree, string &&n, std::unordered_set &&l, string &&a, @@ -862,6 +866,9 @@ node::node(text_input_buffer &input, // flag set if we find any characters that are only in // the property name character set, not the node bool is_property = false; + // flag set if our node is marked as /omit-if-no-ref/ to be + // garbage collected later if nothing references it + bool marked_omit_if_no_ref = false; string child_name, child_address; std::unordered_set child_labels; auto parse_delete = [&](const char *expected, bool at) @@ -908,6 +915,12 @@ node::node(text_input_buffer &input, } continue; } + if (input.consume("/omit-if-no-ref/")) + { + input.next_token(); + marked_omit_if_no_ref = true; + tree.set_needs_garbage_collection(); + } child_name = parse_name(input, is_property, "Expected property or node name"); while (input.consume(':')) @@ -943,10 +956,11 @@ node::node(text_input_buffer &input, } else if (!is_property && *input == ('{')) { - node_ptr child = node::parse(input, std::move(child_name), + node_ptr child = node::parse(input, tree, std::move(child_name), std::move(child_labels), std::move(child_address), defines); if (child) { + child->omit_if_no_ref = marked_omit_if_no_ref; children.push_back(std::move(child)); } else @@ -998,12 +1012,14 @@ node::sort() node_ptr node::parse(text_input_buffer &input, + device_tree &tree, string &&name, string_set &&label, string &&address, define_map *defines) { node_ptr n(new node(input, + tree, std::move(name), std::move(label), std::move(address), @@ -1046,6 +1062,30 @@ node::merge_node(node_ptr &other) { labels.insert(l); } + children.erase(std::remove_if(children.begin(), children.end(), + [&](const node_ptr &p) { + string full_name = p->name; + if (p->unit_address != string()) + { + full_name += '@'; + full_name += p->unit_address; + } + if (other->deleted_children.count(full_name) > 0) + { + other->deleted_children.erase(full_name); + return true; + } + return false; + }), children.end()); + props.erase(std::remove_if(props.begin(), props.end(), + [&](const property_ptr &p) { + if (other->deleted_props.count(p->get_key()) > 0) + { + other->deleted_props.erase(p->get_key()); + return true; + } + return false; + }), props.end()); // Note: this is an O(n*m) operation. It might be sensible to // optimise this if we find that there are nodes with very // large numbers of properties, but for typical usage the @@ -1085,30 +1125,6 @@ node::merge_node(node_ptr &other) children.push_back(std::move(c)); } } - children.erase(std::remove_if(children.begin(), children.end(), - [&](const node_ptr &p) { - string full_name = p->name; - if (p->unit_address != string()) - { - full_name += '@'; - full_name += p->unit_address; - } - if (other->deleted_children.count(full_name) > 0) - { - other->deleted_children.erase(full_name); - return true; - } - return false; - }), children.end()); - props.erase(std::remove_if(props.begin(), props.end(), - [&](const property_ptr &p) { - if (other->deleted_props.count(p->get_key()) > 0) - { - other->deleted_props.erase(p->get_key()); - return true; - } - return false; - }), props.end()); } void @@ -1187,6 +1203,7 @@ device_tree::collect_names_recursive(node_ptr &n, node { node_names.insert(std::make_pair(name, n.get())); node_paths.insert(std::make_pair(name, path)); + ordered_node_paths.push_back({name, path}); } else { @@ -1243,6 +1260,7 @@ device_tree::collect_names() node_path p; node_names.clear(); node_paths.clear(); + ordered_node_paths.clear(); cross_references.clear(); fixups.clear(); collect_names_recursive(root, p); @@ -1353,7 +1371,6 @@ device_tree::resolve_cross_references(uint32_t &phandl return node::VISIT_RECURSE; }, nullptr); assert(sorted_phandles.size() == fixups.size()); - for (auto &i : sorted_phandles) { string target_name = i.get().val.string_data; @@ -1441,7 +1458,104 @@ device_tree::resolve_cross_references(uint32_t &phandl } } +bool +device_tree::garbage_collect_marked_nodes() +{ + std::unordered_set previously_referenced_nodes; + std::unordered_set newly_referenced_nodes; + auto mark_referenced_nodes_used = [&](node &n) + { + for (auto &p : n.properties()) + { + for (auto &v : *p) + { + if (v.is_phandle()) + { + node *nx = node_names[v.string_data]; + if (nx == nullptr) + { + // Try it again, but as a path + for (auto &s : node_paths) + { + if (v.string_data == s.second.to_string()) + { + nx = node_names[s.first]; + break; + } + } + } + if (nx == nullptr) + { + // Couldn't resolve this one? + continue; + } + // Only mark those currently unmarked + if (!nx->used) + { + nx->used = 1; + newly_referenced_nodes.insert(nx); + } + } + } + } + }; + + // Seed our referenced nodes with those that have been seen by a node that + // either will not be omitted if it's unreferenced or has a symbol. + // Nodes with symbols are explicitly not garbage collected because they may + // be expected for referencing by an overlay, and we do not want surprises + // there. + root->visit([&](node &n, node *) { + if (!n.omit_if_no_ref || (write_symbols && !n.labels.empty())) + { + mark_referenced_nodes_used(n); + } + // Recurse as normal + return node::VISIT_RECURSE; + }, nullptr); + + while (!newly_referenced_nodes.empty()) + { + previously_referenced_nodes = std::move(newly_referenced_nodes); + for (auto *n : previously_referenced_nodes) + { + mark_referenced_nodes_used(*n); + } + } + + previously_referenced_nodes.clear(); + bool children_deleted = false; + + // Delete + root->visit([&](node &n, node *) { + bool gc_children = false; + + for (auto &cn : n.child_nodes()) + { + if (cn->omit_if_no_ref && !cn->used) + { + gc_children = true; + break; + } + } + + if (gc_children) + { + children_deleted = true; + n.delete_children_if([](node_ptr &nx) { + return (nx->omit_if_no_ref && !nx->used); + }); + + return node::VISIT_CONTINUE; + } + + return node::VISIT_RECURSE; + }, nullptr); + + return children_deleted; +} + void device_tree::parse_file(text_input_buffer &input, std::vector &roots, @@ -1486,7 +1600,7 @@ device_tree::parse_file(text_input_buffer &input, if (input.consume('/')) { input.next_token(); - n = node::parse(input, string(), string_set(), string(), &defines); + n = node::parse(input, *this, string(), string_set(), string(), &defines); } else if (input.consume('&')) { @@ -1507,7 +1621,7 @@ device_tree::parse_file(text_input_buffer &input, name = input.parse_node_name(); } input.next_token(); - n = node::parse(input, std::move(name), string_set(), string(), &defines); + n = node::parse(input, *this, std::move(name), string_set(), string(), &defines); n->name_is_path_reference = name_is_path_reference; } else @@ -1890,6 +2004,12 @@ device_tree::parse_dts(const string &fn, FILE *depfile } } collect_names(); + // Return value indicates whether we've dirtied the tree or not and need to + // recollect names + if (garbage_collect && garbage_collect_marked_nodes()) + { + collect_names(); + } uint32_t phandle = 1; // If we're writing symbols, go ahead and assign phandles to the entire // tree. We'll do this before we resolve cross references, just to keep @@ -1906,8 +2026,14 @@ device_tree::parse_dts(const string &fn, FILE *depfile // referenced by other plugins, so we create a __symbols__ node inside // the root that contains mappings (properties) from label names to // paths. - for (auto &s : node_paths) + for (auto i=ordered_node_paths.rbegin(), e=ordered_node_paths.rend() ; i!=e ; ++i) { + auto &s = *i; + if (node_paths.find(s.first) == node_paths.end()) + { + // Erased node, skip it. + continue; + } property_value v; v.string_data = s.second.to_string(); v.type = property_value::STRING; @@ -1986,19 +2112,23 @@ device_tree::parse_dts(const string &fn, FILE *depfile { if (c->name == p.first) { - string path = p.first; - if (!(p.second.empty())) + if (c->unit_address == p.second) { - path += '@'; - path += p.second; + n = c.get(); + found = true; + break; } - n->add_child(node::create_special_node(path, symbols)); - n = (--n->child_end())->get(); } } if (!found) { - n->add_child(node::create_special_node(p.first, symbols)); + string path = p.first; + if (!(p.second.empty())) + { + path += '@'; + path += p.second; + } + n->add_child(node::create_special_node(path, symbols)); n = (--n->child_end())->get(); } } Modified: head/usr.bin/dtc/fdt.hh ============================================================================== --- head/usr.bin/dtc/fdt.hh Thu Mar 28 03:31:51 2019 (r345627) +++ head/usr.bin/dtc/fdt.hh Thu Mar 28 03:48:51 2019 (r345628) @@ -56,6 +56,7 @@ namespace fdt { class property; class node; +class device_tree; /** * Type for (owned) pointers to properties. */ @@ -418,6 +419,17 @@ class node */ std::string unit_address; /** + * A flag indicating that this node has been marked /omit-if-no-ref/ and + * will be omitted if it is not referenced, either directly or indirectly, + * by a node that is not similarly denoted. + */ + bool omit_if_no_ref = false; + /** + * A flag indicating that this node has been referenced, either directly + * or indirectly, by a node that is not marked /omit-if-no-ref/. + */ + bool used = false; + /** * The type for the property vector. */ typedef std::vector property_vector; @@ -507,6 +519,7 @@ class node * already been parsed. */ node(text_input_buffer &input, + device_tree &tree, std::string &&n, std::unordered_set &&l, std::string &&a, @@ -603,6 +616,7 @@ class node * have been parsed. */ static node_ptr parse(text_input_buffer &input, + device_tree &tree, std::string &&name, std::unordered_set &&label=std::unordered_set(), std::string &&address=std::string(), @@ -640,6 +654,13 @@ class node children.push_back(std::move(n)); } /** + * Deletes any children from this node. + */ + inline void delete_children_if(bool (*predicate)(node_ptr &)) + { + children.erase(std::remove_if(children.begin(), children.end(), predicate), children.end()); + } + /** * Merges a node into this one. Any properties present in both are * overridden, any properties present in only one are preserved. */ @@ -710,6 +731,11 @@ class device_tree */ bool valid = true; /** + * Flag indicating that this tree requires garbage collection. This will be + * set to true if a node marked /omit-if-no-ref/ is encountered. + */ + bool garbage_collect = false; + /** * Type used for memory reservations. A reservation is two 64-bit * values indicating a base address and length in memory that the * kernel should not use. The high 32 bits are ignored on 32-bit @@ -736,6 +762,12 @@ class device_tree */ std::unordered_map node_paths; /** + * All of the elements in `node_paths` in the order that they were + * created. This is used for emitting the `__symbols__` section, where + * we want to guarantee stable ordering. + */ + std::vector> ordered_node_paths; + /** * A collection of property values that are references to other nodes. * These should be expanded to the full path of their targets. */ @@ -847,10 +879,20 @@ class device_tree * node must have their values replaced by either the node path or * phandle value. The phandle parameter holds the next phandle to be * assigned, should the need arise. It will be incremented upon each - * assignment of a phandle. + * assignment of a phandle. Garbage collection of unreferenced nodes + * marked for "delete if unreferenced" will also occur here. */ void resolve_cross_references(uint32_t &phandle); /** + * Garbage collects nodes that have been marked /omit-if-no-ref/ and do not + * have any references to them from nodes that are similarly marked. This + * is a fairly expensive operation. The return value indicates whether the + * tree has been dirtied as a result of this operation, so that the caller + * may take appropriate measures to bring the device tree into a consistent + * state as needed. + */ + bool garbage_collect_marked_nodes(); + /** * Parses a dts file in the given buffer and adds the roots to the parsed * set. The `read_header` argument indicates whether the header has * already been read. Some dts files place the header in an include, @@ -931,6 +973,14 @@ class device_tree inline bool is_valid() { return valid; + } + /** + * Mark this tree as needing garbage collection, because an /omit-if-no-ref/ + * node has been encountered. + */ + void set_needs_garbage_collection() + { + garbage_collect = true; } /** * Sets the format for writing phandle properties. Modified: head/usr.bin/dtc/input_buffer.cc ============================================================================== --- head/usr.bin/dtc/input_buffer.cc Thu Mar 28 03:31:51 2019 (r345627) +++ head/usr.bin/dtc/input_buffer.cc Thu Mar 28 03:48:51 2019 (r345628) @@ -126,7 +126,7 @@ mmap_input_buffer::~mmap_input_buffer() { if (buffer != 0) { - munmap((void*)buffer, size); + munmap(const_cast(buffer), size); } } Modified: head/usr.bin/dtc/util.hh ============================================================================== --- head/usr.bin/dtc/util.hh Thu Mar 28 03:31:51 2019 (r345627) +++ head/usr.bin/dtc/util.hh Thu Mar 28 03:48:51 2019 (r345628) @@ -47,6 +47,38 @@ #endif #endif +#ifdef MISSING_DIGITTOINT +namespace +{ + /** + * Glibc doesn't have a definition of digittoint, so provide our own. + */ + inline int digittoint(int c) + { + switch (c) + { + default: + case '0': return 0; + case '1': return 1; + case '2': return 2; + case '3': return 3; + case '4': return 4; + case '5': return 5; + case '6': return 6; + case '7': return 7; + case '8': return 8; + case '9': return 9; + case 'a': return 10; + case 'b': return 11; + case 'c': return 12; + case 'd': return 13; + case 'e': return 14; + case 'f': return 15; + } + } +} +#endif + namespace dtc { /** From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C06ABDBE34; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yf45tHz4Npv; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 739F719B17; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E8AE61E7FB; Wed, 27 Mar 2019 19:40:22 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92AF28BC63; Wed, 27 Mar 2019 19:40:22 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 455121E7F7; Wed, 27 Mar 2019 19:40:22 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 27B881E7EA for ; Wed, 27 Mar 2019 19:40:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEB678BC53; Wed, 27 Mar 2019 19:40:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8743BE32; Wed, 27 Mar 2019 19:40:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2RJeIP8078444; Wed, 27 Mar 2019 19:40:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2RJeIuq078442; Wed, 27 Mar 2019 19:40:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201903271940.x2RJeIuq078442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345596 - in head/lib/libutil: . tests X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/lib/libutil: . tests X-SVN-Commit-Revision: 345596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 92AF28BC63 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:47 -0000 X-Original-Date: Wed, 27 Mar 2019 19:40:18 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:47 -0000 Author: markj Date: Wed Mar 27 19:40:18 2019 New Revision: 345596 URL: https://svnweb.freebsd.org/changeset/base/345596 Log: Fix pidfile_open(3) to handle relative paths with multiple components. r322369's use of basename(3) was incorrect and worked by accident so long as the pidfile path was absolute or consisted of a single component. Fix the basename() usage and add a regression test. Reported by: 0mp Reviewed by: cem MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D19728 Modified: head/lib/libutil/pidfile.c head/lib/libutil/tests/pidfile_test.c Modified: head/lib/libutil/pidfile.c ============================================================================== --- head/lib/libutil/pidfile.c Wed Mar 27 19:37:50 2019 (r345595) +++ head/lib/libutil/pidfile.c Wed Mar 27 19:40:18 2019 (r345596) @@ -100,8 +100,9 @@ pidfile_read(int dirfd, const char *filename, pid_t *p } struct pidfh * -pidfile_open(const char *path, mode_t mode, pid_t *pidptr) +pidfile_open(const char *pathp, mode_t mode, pid_t *pidptr) { + char path[MAXPATHLEN]; struct pidfh *pfh; struct stat sb; int error, fd, dirfd, dirlen, filenamelen, count; @@ -112,19 +113,22 @@ pidfile_open(const char *path, mode_t mode, pid_t *pid if (pfh == NULL) return (NULL); - if (path == NULL) { + if (pathp == NULL) { dirlen = snprintf(pfh->pf_dir, sizeof(pfh->pf_dir), "/var/run/"); filenamelen = snprintf(pfh->pf_filename, sizeof(pfh->pf_filename), "%s.pid", getprogname()); } else { - dirlen = snprintf(pfh->pf_dir, sizeof(pfh->pf_dir), - "%s", path); - filenamelen = snprintf(pfh->pf_filename, - sizeof(pfh->pf_filename), "%s", path); - - dirname(pfh->pf_dir); - basename(pfh->pf_filename); + if (strlcpy(path, pathp, sizeof(path)) >= sizeof(path)) { + free(pfh); + errno = ENAMETOOLONG; + return (NULL); + } + dirlen = strlcpy(pfh->pf_dir, dirname(path), + sizeof(pfh->pf_dir)); + (void)strlcpy(path, pathp, sizeof(path)); + filenamelen = strlcpy(pfh->pf_filename, basename(path), + sizeof(pfh->pf_filename)); } if (dirlen >= (int)sizeof(pfh->pf_dir) || Modified: head/lib/libutil/tests/pidfile_test.c ============================================================================== --- head/lib/libutil/tests/pidfile_test.c Wed Mar 27 19:37:50 2019 (r345595) +++ head/lib/libutil/tests/pidfile_test.c Wed Mar 27 19:40:18 2019 (r345596) @@ -263,6 +263,40 @@ test_pidfile_inherited(void) return (result); } +/* + * Make sure we handle relative pidfile paths correctly. + */ +static const char * +test_pidfile_relative(void) +{ + char path[PATH_MAX], pid[32], tmpdir[PATH_MAX]; + struct pidfh *pfh; + int fd; + + (void)snprintf(tmpdir, sizeof(tmpdir), "%s.XXXXXX", __func__); + if (mkdtemp(tmpdir) == NULL) + return (strerror(errno)); + (void)snprintf(path, sizeof(path), "%s/pidfile", tmpdir); + + pfh = pidfile_open(path, 0600, NULL); + if (pfh == NULL) + return (strerror(errno)); + if (pidfile_write(pfh) != 0) + return (strerror(errno)); + fd = open(path, O_RDONLY); + if (fd < 0) + return (strerror(errno)); + if (read(fd, pid, sizeof(pid)) < 0) + return (strerror(errno)); + if (atoi(pid) != getpid()) + return ("pid mismatch"); + if (close(fd) != 0) + return (strerror(errno)); + if (pidfile_close(pfh) != 0) + return (strerror(errno)); + return (NULL); +} + static struct test { const char *name; const char *(*func)(void); @@ -271,6 +305,7 @@ static struct test { { "pidfile_self", test_pidfile_self }, { "pidfile_contested", test_pidfile_contested }, { "pidfile_inherited", test_pidfile_inherited }, + { "pidfile_relative", test_pidfile_relative }, }; int From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 369D3DBE0B; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yf0Skyz4NpL; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 035B219AD7; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 58C431A465; Wed, 27 Mar 2019 17:28:27 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 296C284CB2; Wed, 27 Mar 2019 17:28:27 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0DB3A1A464; Wed, 27 Mar 2019 17:28:27 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5506E1A45F for ; Wed, 27 Mar 2019 17:28:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E84E84CAD; Wed, 27 Mar 2019 17:28:24 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB412A5D7; Wed, 27 Mar 2019 17:28:23 +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 x2RHSNLd007476; Wed, 27 Mar 2019 17:28:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2RHSN5p007475; Wed, 27 Mar 2019 17:28:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201903271728.x2RHSN5p007475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345583 - head/tools/tools/makeroot X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/makeroot X-SVN-Commit-Revision: 345583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 296C284CB2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; NEURAL_HAM_SHORT(-0.93)[-0.927,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:46 -0000 X-Original-Date: Wed, 27 Mar 2019 17:28:23 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:46 -0000 Author: emaste Date: Wed Mar 27 17:28:23 2019 New Revision: 345583 URL: https://svnweb.freebsd.org/changeset/base/345583 Log: revert r302146: makeroot: zero out subsecond component of time= keywords After r345281 by mhorne subsecond components are supported. PR: 194703 Sponsored by: The FreeBSD Foundation Modified: head/tools/tools/makeroot/makeroot.sh Modified: head/tools/tools/makeroot/makeroot.sh ============================================================================== --- head/tools/tools/makeroot/makeroot.sh Wed Mar 27 16:45:30 2019 (r345582) +++ head/tools/tools/makeroot/makeroot.sh Wed Mar 27 17:28:23 2019 (r345583) @@ -238,9 +238,5 @@ if [ -n "${SIZE}" ]; then SIZEFLAG="-s ${SIZE}" fi -# Zero out subsecond component of time= keywords as they are currently not -# supported by makefs -sed -i '' -E 's/(time=[0-9]*)\.[0-9]*/\1.0/' ${manifest} - cd ${BSDROOT}; makefs ${DUPFLAG} -N ${DBDIR} ${SIZEFLAG} ${BFLAG} \ -t ffs ${LABELFLAG} -f 256 ${IMGFILE} ${manifest} From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79D53DBF05; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yh3k4Qz4Nrn; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id B40C919BD8; Tue, 3 Sep 2019 14:05:47 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id EE617C535; Thu, 28 Mar 2019 09:01:00 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFAF8C521; Thu, 28 Mar 2019 09:01:00 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 176E0C533; Thu, 28 Mar 2019 09:01:00 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C6C74C52F for ; Thu, 28 Mar 2019 09:00:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17BD08C517; Thu, 28 Mar 2019 09:00:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9D791CCE5; Thu, 28 Mar 2019 09:00:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2S90um9008643; Thu, 28 Mar 2019 09:00:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2S90u6N008642; Thu, 28 Mar 2019 09:00:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201903280900.x2S90u6N008642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345633 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 345633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 4CFAF8C521 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:51 -0000 X-Original-Date: Thu, 28 Mar 2019 09:00:56 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:51 -0000 Author: hselasky Date: Thu Mar 28 09:00:56 2019 New Revision: 345633 URL: https://svnweb.freebsd.org/changeset/base/345633 Log: Add new USB PCI ID. Submitted by: Dmitry Luhtionov MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Thu Mar 28 08:59:11 2019 (r345632) +++ head/sys/dev/usb/controller/xhci_pci.c Thu Mar 28 09:00:56 2019 (r345633) @@ -149,6 +149,8 @@ xhci_pci_match(device_t self) return ("Intel Lewisburg USB 3.0 controller"); case 0xa2af8086: return ("Intel Union Point USB 3.0 controller"); + case 0x36d88086: + return ("Intel Cannon Lake USB 3.1 controller"); case 0xa01b177d: return ("Cavium ThunderX USB 3.0 controller"); From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7BAADBECE; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yh0CMyz4NrL; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 6489019BA4; Tue, 3 Sep 2019 14:05:47 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 59F8A625E; Thu, 28 Mar 2019 02:12:37 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29BC1757E4; Thu, 28 Mar 2019 02:12:37 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0FF7A625D; Thu, 28 Mar 2019 02:12:37 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5CDEB624C for ; Thu, 28 Mar 2019 02:12:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 295D4757D6; Thu, 28 Mar 2019 02:12:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEF5D18731; Thu, 28 Mar 2019 02:12:33 +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 x2S2CXMu000734; Thu, 28 Mar 2019 02:12:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2S2CXoG000730; Thu, 28 Mar 2019 02:12:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201903280212.x2S2CXoG000730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345625 - in head: contrib/elftoolchain/readelf lib/libc lib/libthr libexec/rtld-elf sys/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: contrib/elftoolchain/readelf lib/libc lib/libthr libexec/rtld-elf sys/sys X-SVN-Commit-Revision: 345625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 29BC1757E4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:49 -0000 X-Original-Date: Thu, 28 Mar 2019 02:12:33 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:49 -0000 Author: emaste Date: Thu Mar 28 02:12:32 2019 New Revision: 345625 URL: https://svnweb.freebsd.org/changeset/base/345625 Log: revert r341429 "disable BIND_NOW in libc, libthr, and rtld" r345620 by kib@ fixed the rtld issue that caused a crash at startup during resolution of libc's ifuncs with BIND_NOW. PR: 233333 Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c head/lib/libc/Makefile head/lib/libthr/Makefile head/libexec/rtld-elf/Makefile head/sys/sys/elf_common.h Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 01:12:44 2019 (r345624) +++ head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 02:12:32 2019 (r345625) @@ -3490,6 +3490,7 @@ dump_notes(struct readelf *re) static struct flag_desc note_feature_ctl_flags[] = { { NT_FREEBSD_FCTL_ASLR_DISABLE, "ASLR_DISABLE" }, + { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" }, { 0, NULL } }; Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Thu Mar 28 01:12:44 2019 (r345624) +++ head/lib/libc/Makefile Thu Mar 28 02:12:32 2019 (r345625) @@ -6,8 +6,6 @@ SHLIBDIR?= /lib .include -# BIND_NOW in libc results in segfault at startup (PR 233333) -MK_BIND_NOW= no # Force building of libc_pic.a MK_TOOLCHAIN= yes Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Thu Mar 28 01:12:44 2019 (r345624) +++ head/lib/libthr/Makefile Thu Mar 28 02:12:32 2019 (r345625) @@ -9,7 +9,6 @@ PACKAGE= clibs SHLIBDIR?= /lib .include -MK_BIND_NOW= no MK_SSP= no LIB=thr Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Thu Mar 28 01:12:44 2019 (r345624) +++ head/libexec/rtld-elf/Makefile Thu Mar 28 02:12:32 2019 (r345625) @@ -6,7 +6,6 @@ .include PACKAGE= clibs -MK_BIND_NOW= no MK_PIE= no # Always position independent using local rules MK_SSP= no Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Thu Mar 28 01:12:44 2019 (r345624) +++ head/sys/sys/elf_common.h Thu Mar 28 02:12:32 2019 (r345625) @@ -763,7 +763,8 @@ typedef struct { #define NT_FREEBSD_FEATURE_CTL 4 /* NT_FREEBSD_FEATURE_CTL desc[0] bits */ -#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 +#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 +#define NT_FREEBSD_FCTL_IMPLIED_MAX_PROT 0x00000002 /* Values for n_type. Used in core files. */ #define NT_PRSTATUS 1 /* Process status. */ From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E78BDBE56; Tue, 3 Sep 2019 14:05:47 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yf64Vbz4NqD; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 96B8F19B2E; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7DFC21F232; Wed, 27 Mar 2019 20:15:55 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BD968D2F1; Wed, 27 Mar 2019 20:15:55 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 15ADF1F230; Wed, 27 Mar 2019 20:15:55 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E8B321F22E for ; Wed, 27 Mar 2019 20:15:51 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADC398D2ED; Wed, 27 Mar 2019 20:15:51 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B232C50A; Wed, 27 Mar 2019 20:15:51 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2RKFpxS099348; Wed, 27 Mar 2019 20:15:51 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2RKFpYA099347; Wed, 27 Mar 2019 20:15:51 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201903272015.x2RKFpYA099347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345601 - head/sys/x86/iommu X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: head/sys/x86/iommu X-SVN-Commit-Revision: 345601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3BD968D2F1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:47 -0000 X-Original-Date: Wed, 27 Mar 2019 20:15:51 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:47 -0000 Author: tychon Date: Wed Mar 27 20:15:51 2019 New Revision: 345601 URL: https://svnweb.freebsd.org/changeset/base/345601 Log: Use the BUS_DMA_NOWRITE flag to expose and create the read-only VT-d IOMMU mappings. Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19729 Modified: head/sys/x86/iommu/busdma_dmar.c Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Wed Mar 27 19:59:36 2019 (r345600) +++ head/sys/x86/iommu/busdma_dmar.c Wed Mar 27 20:15:51 2019 (r345601) @@ -527,7 +527,8 @@ dmar_bus_dmamap_load_something1(struct bus_dma_tag_dma gas_flags |= DMAR_GM_CANSPLIT; error = dmar_gas_map(domain, &tag->common, size, offset, - DMAR_MAP_ENTRY_READ | DMAR_MAP_ENTRY_WRITE, + DMAR_MAP_ENTRY_READ | + ((flags & BUS_DMA_NOWRITE) == 0 ? DMAR_MAP_ENTRY_WRITE : 0), gas_flags, ma + idx, &entry); if (error != 0) break; From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65779DBE72; Tue, 3 Sep 2019 14:05:47 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yg08hCz4NqX; Tue, 3 Sep 2019 14:05:47 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id E539719B52; Tue, 3 Sep 2019 14:05:46 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7E3AF1143; Wed, 27 Mar 2019 21:50:06 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B0756A33C; Wed, 27 Mar 2019 21:50:05 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 137B710FC; Wed, 27 Mar 2019 21:50:05 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C04B010F7 for ; Wed, 27 Mar 2019 21:50:02 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B24E6A337; Wed, 27 Mar 2019 21:50:02 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F0F0D48A; Wed, 27 Mar 2019 21:50:02 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2RLo2rR051794; Wed, 27 Mar 2019 21:50:02 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2RLo2nQ051793; Wed, 27 Mar 2019 21:50:02 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201903272150.x2RLo2nQ051793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345611 - head/sys/dev/jedec_dimm X-SVN-Group: head X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: head/sys/dev/jedec_dimm X-SVN-Commit-Revision: 345611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 5B0756A33C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:48 -0000 X-Original-Date: Wed, 27 Mar 2019 21:50:02 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:48 -0000 Author: rpokala Date: Wed Mar 27 21:50:01 2019 New Revision: 345611 URL: https://svnweb.freebsd.org/changeset/base/345611 Log: Teach jedec_dimm(4) to be more forgiving of non-fatal errors. It looks like some DIMMs claim to have a TSOD, but actually don't. Some claim they weren't able to change the SPD page, but they did. Neither of those should be fatal errors. PR: 235944 Submitted by: Greg V Reported by: Greg V Reviewed by: cem MFC after: 1 weeks Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D19681 Modified: head/sys/dev/jedec_dimm/jedec_dimm.c Modified: head/sys/dev/jedec_dimm/jedec_dimm.c ============================================================================== --- head/sys/dev/jedec_dimm/jedec_dimm.c Wed Mar 27 21:46:45 2019 (r345610) +++ head/sys/dev/jedec_dimm/jedec_dimm.c Wed Mar 27 21:50:01 2019 (r345611) @@ -270,12 +270,16 @@ jedec_dimm_attach(device_t dev) } /* The MSBit of the TSOD-presence byte reports whether or not the TSOD - * is in fact present. If it is, read manufacturer and device info from - * it to confirm that it's a valid TSOD device. It's an error if any of - * those bytes are unreadable; it's not an error if the device is simply - * not known to us (tsod_match == NULL). - * While DDR3 and DDR4 don't explicitly require a TSOD, essentially all - * DDR3 and DDR4 DIMMs include one. + * is in fact present. (While DDR3 and DDR4 don't explicitly require a + * TSOD, essentially all DDR3 and DDR4 DIMMs include one.) But, as + * discussed in [PR 235944], it turns out that some DIMMs claim to have + * a TSOD when they actually don't. (Or maybe the firmware blocks it?) + * + * If the SPD data says the TSOD is present, try to read manufacturer + * and device info from it to confirm that it's a valid TSOD device. + * If the data is unreadable, just continue as if the TSOD isn't there. + * If the data was read successfully, see if it is a known TSOD device; + * it's okay if it isn't (tsod_match == NULL). */ rc = smbus_readb(sc->smbus, sc->spd_addr, tsod_present_offset, &byte); if (rc != 0) { @@ -289,12 +293,14 @@ jedec_dimm_attach(device_t dev) if (rc != 0) { device_printf(dev, "failed to read TSOD Manufacturer ID\n"); - goto out; + rc = 0; + goto no_tsod; } rc = jedec_dimm_readw_be(sc, TSOD_REG_DEV_REV, &devid); if (rc != 0) { device_printf(dev, "failed to read TSOD Device ID\n"); - goto out; + rc = 0; + goto no_tsod; } tsod_match = jedec_dimm_tsod_match(vendorid, devid); @@ -309,6 +315,7 @@ jedec_dimm_attach(device_t dev) } } } else { +no_tsod: tsod_match = NULL; tsod_present = false; } @@ -621,9 +628,12 @@ jedec_dimm_dump(struct jedec_dimm_softc *sc, enum dram rc = smbus_writeb(sc->smbus, (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET1), 0, 0); if (rc != 0) { + /* Some SPD devices (or SMBus controllers?) claim the + * page-change command failed when it actually + * succeeded. Log a message but soldier on. + */ device_printf(sc->dev, "unable to change page: %d\n", rc); - goto out; } /* Add 256 to the store location, because we're in the second * page. From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 871EDDBECA; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yh1mshz4Nrh; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 9FF9419BBF; Tue, 3 Sep 2019 14:05:47 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id A2CA3BC9F; Thu, 28 Mar 2019 08:30:50 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44C418B136; Thu, 28 Mar 2019 08:30:49 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 10A14BC38; Thu, 28 Mar 2019 08:30:49 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C7C7ABC36 for ; Thu, 28 Mar 2019 08:30:46 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95ABB8B126; Thu, 28 Mar 2019 08:30:46 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7219F1C77C; Thu, 28 Mar 2019 08:30:46 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2S8Uk0X092716; Thu, 28 Mar 2019 08:30:46 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2S8UkPk092715; Thu, 28 Mar 2019 08:30:46 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201903280830.x2S8UkPk092715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345630 - in head/sys/modules: hwpmc_mips24k hwpmc_mips74k X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/sys/modules: hwpmc_mips24k hwpmc_mips74k X-SVN-Commit-Revision: 345630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 44C418B136 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.93)[-0.935,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:49 -0000 X-Original-Date: Thu, 28 Mar 2019 08:30:46 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:49 -0000 Author: lwhsu Date: Thu Mar 28 08:30:45 2019 New Revision: 345630 URL: https://svnweb.freebsd.org/changeset/base/345630 Log: Add dependent header files Reported by: https://ci.freebsd.org/job/FreeBSD-head-mips-build/6702/console Modified: head/sys/modules/hwpmc_mips24k/Makefile head/sys/modules/hwpmc_mips74k/Makefile Modified: head/sys/modules/hwpmc_mips24k/Makefile ============================================================================== --- head/sys/modules/hwpmc_mips24k/Makefile Thu Mar 28 06:10:41 2019 (r345629) +++ head/sys/modules/hwpmc_mips24k/Makefile Thu Mar 28 08:30:45 2019 (r345630) @@ -6,9 +6,12 @@ KMOD= hwpmc_mips24k -SRCS= hwpmc_mod.c hwpmc_logging.c hwpmc_soft.c vnode_if.h +SRCS= bus_if.h device_if.h vnode_if.h +SRCS+= hwpmc_mod.c hwpmc_logging.c hwpmc_soft.c SRCS+= hwpmc_mips.c SRCS+= hwpmc_mips24k.c + +SRCS+= opt_hwpmc_hooks.h .include Modified: head/sys/modules/hwpmc_mips74k/Makefile ============================================================================== --- head/sys/modules/hwpmc_mips74k/Makefile Thu Mar 28 06:10:41 2019 (r345629) +++ head/sys/modules/hwpmc_mips74k/Makefile Thu Mar 28 08:30:45 2019 (r345630) @@ -6,9 +6,12 @@ KMOD= hwpmc_mips74k -SRCS= hwpmc_mod.c hwpmc_logging.c hwpmc_soft.c vnode_if.h +SRCS= bus_if.h device_if.h vnode_if.h +SRCS+= hwpmc_mod.c hwpmc_logging.c hwpmc_soft.c SRCS+= hwpmc_mips.c SRCS+= hwpmc_mips74k.c + +SRCS+= opt_hwpmc_hooks.h .include From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A420DBF08; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yh4dTqz4Ns4; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id F171019BF1; Tue, 3 Sep 2019 14:05:47 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 25C21F169; Thu, 28 Mar 2019 10:56:32 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3EE896B3CF; Thu, 28 Mar 2019 10:56:31 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 12641F119; Thu, 28 Mar 2019 10:56:31 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 92F69F117 for ; Thu, 28 Mar 2019 10:56:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4608E6B3C9; Thu, 28 Mar 2019 10:56:28 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E56A1E247; Thu, 28 Mar 2019 10:56:28 +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 x2SAuR1s070925; Thu, 28 Mar 2019 10:56:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SAuR5E070924; Thu, 28 Mar 2019 10:56:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201903281056.x2SAuR5E070924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345638 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 345638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3EE896B3CF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:51 -0000 X-Original-Date: Thu, 28 Mar 2019 10:56:27 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:51 -0000 Author: emaste Date: Thu Mar 28 10:56:27 2019 New Revision: 345638 URL: https://svnweb.freebsd.org/changeset/base/345638 Log: Revert change accidentally committed along with r345625 Reported by: Oliver Pinter Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Thu Mar 28 09:51:37 2019 (r345637) +++ head/sys/sys/elf_common.h Thu Mar 28 10:56:27 2019 (r345638) @@ -763,8 +763,7 @@ typedef struct { #define NT_FREEBSD_FEATURE_CTL 4 /* NT_FREEBSD_FEATURE_CTL desc[0] bits */ -#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 -#define NT_FREEBSD_FCTL_IMPLIED_MAX_PROT 0x00000002 +#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 /* Values for n_type. Used in core files. */ #define NT_PRSTATUS 1 /* Process status. */ From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85DFDDBF0B; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yh4kwvz4NsL; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 2C56419BFF; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 68F2E11A16; Thu, 28 Mar 2019 13:27:38 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 224B871386; Thu, 28 Mar 2019 13:27:38 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1291111A14; Thu, 28 Mar 2019 13:27:38 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 53F1D11A12 for ; Thu, 28 Mar 2019 13:27:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1231671385; Thu, 28 Mar 2019 13:27: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E30901FBE2; Thu, 28 Mar 2019 13:27: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 x2SDRYgw050254; Thu, 28 Mar 2019 13:27:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SDRY3U050253; Thu, 28 Mar 2019 13:27:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201903281327.x2SDRY3U050253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345640 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 345640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 224B871386 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:52 -0000 X-Original-Date: Thu, 28 Mar 2019 13:27:34 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:52 -0000 Author: emaste Date: Thu Mar 28 13:27:34 2019 New Revision: 345640 URL: https://svnweb.freebsd.org/changeset/base/345640 Log: Revert other accidentally committed part of r345625 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 12:28:29 2019 (r345639) +++ head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 13:27:34 2019 (r345640) @@ -3490,7 +3490,6 @@ dump_notes(struct readelf *re) static struct flag_desc note_feature_ctl_flags[] = { { NT_FREEBSD_FCTL_ASLR_DISABLE, "ASLR_DISABLE" }, - { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" }, { 0, NULL } }; From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C39EFDBEDB; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yh1KmLz4Nrb; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 989E219BBD; Tue, 3 Sep 2019 14:05:47 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id DECEFAFE8; Thu, 28 Mar 2019 07:25:39 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E7C089027; Thu, 28 Mar 2019 07:25:39 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 19ADFAFE4; Thu, 28 Mar 2019 07:25:39 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D4495AFE0 for ; Thu, 28 Mar 2019 07:25:36 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw1-xc2b.google.com (mail-yw1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8834689023 for ; Thu, 28 Mar 2019 07:25:36 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw1-xc2b.google.com with SMTP id l5so14336833ywa.0 for ; Thu, 28 Mar 2019 00:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Eifs04LE3UCVd/dtXNEjMniPgZyjLkvYH0NHulGa8cA=; b=QrCtPKxnsBPN3/N1wOnvCON1E/RvdgYudekfLR+18xFPRIQtH50YGhUO7mptATJqWs 8Hb4a+f+/u21v2em2YCpcltd0uv20siQbqAp/IGaMXzpr97dWNHXZU+vkHboq81ygc+W KgmjsCkVimL//Ipxg7T+KRRE7fYusOjZsnHa5+WptkW+rzRlLiiNO17HI0ldrKzMjq2L nQ4oCwJL0uGepPfZncXseCKiA0AIijpcPYAyvqP2ryAcDEpnmTvPe7pBj6M2I3WqO0ZX cxe47WaS8QkaIJluNHIlwytNZiKAqv3ayUSBeeZJexOQbd4QvFd+DVAXBkfE6CB11mSn vIMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Eifs04LE3UCVd/dtXNEjMniPgZyjLkvYH0NHulGa8cA=; b=WMcQiDVA460MMYUOkbWrYScVnQsuHuM8Pvr3glFIGamIrYf2WNNS/cbGp9G+apLjTS cm9Pcau/dm5UdaZ6A6EOQuv98mOJHdEtqJbOYr6tddOs5UK0TwYx7JqMI0kve4xRrVAB zPNFmCSCzg3PAivuJEWJx1H6Nf0WSS4xvj+VJ+t6RkjDfFrt3TWNwjlNAf320LaDfvyv Df0ySiHAgHsGgsYBNXIpkreGySvCQK20cnGsisO22KuqbuCOf9dHA1wksEHAFc1vjzp5 D0xa66xgf611AJpKVHglWEToCm97wmK/61CvGiGRn2q9LVXv6Jv3X5HUx5DLgQ49c+ZE F6NA== X-Gm-Message-State: APjAAAV4kToqVwIXO8nbsDrn+QQIC5zkb2p1oDCAZbNYfJp6nKeftpUz iUd0SQfquxFO/L4FRH+jVB1N2PJ8OqN7vEl2vBzL0g== X-Google-Smtp-Source: APXvYqy/nTKmJo+7fHQN7BbFOEFNTHPqusjEYm3mNEQdF3aGZ9DCaVQkBNNl5tXijepE4LDDvhwFZMJPORp0cc/uijY= X-Received: by 2002:a81:8583:: with SMTP id v125mr33775235ywf.79.1553757935705; Thu, 28 Mar 2019 00:25:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:1688:0:0:0:0:0 with HTTP; Thu, 28 Mar 2019 00:25:35 -0700 (PDT) In-Reply-To: <201903280212.x2S2CXoG000730@repo.freebsd.org> References: <201903280212.x2S2CXoG000730@repo.freebsd.org> From: Oliver Pinter Message-ID: Subject: Re: svn commit: r345625 - in head: contrib/elftoolchain/readelf lib/libc lib/libthr libexec/rtld-elf sys/sys To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 2E7C089027 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:50 -0000 X-Original-Date: Thu, 28 Mar 2019 08:25:35 +0100 X-List-Received-Date: Tue, 03 Sep 2019 14:05:50 -0000 On Thursday, March 28, 2019, Ed Maste wrote: > Author: emaste > Date: Thu Mar 28 02:12:32 2019 > New Revision: 345625 > URL: https://svnweb.freebsd.org/changeset/base/345625 > > Log: > revert r341429 "disable BIND_NOW in libc, libthr, and rtld" > > r345620 by kib@ fixed the rtld issue that caused a crash at startup > during resolution of libc's ifuncs with BIND_NOW. > > PR: 233333 > Sponsored by: The FreeBSD Foundation > > Modified: > head/contrib/elftoolchain/readelf/readelf.c > head/lib/libc/Makefile > head/lib/libthr/Makefile > head/libexec/rtld-elf/Makefile > head/sys/sys/elf_common.h > > Modified: head/contrib/elftoolchain/readelf/readelf.c > ============================================================ > ================== > --- head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 01:12:44 2019 > (r345624) > +++ head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 02:12:32 2019 > (r345625) > @@ -3490,6 +3490,7 @@ dump_notes(struct readelf *re) > > static struct flag_desc note_feature_ctl_flags[] = { > { NT_FREEBSD_FCTL_ASLR_DISABLE, "ASLR_DISABLE" }, > + { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" }, > { 0, NULL } > }; > > Seems like this and the other hunk belongs to a different patch. > > Modified: head/lib/libc/Makefile > ============================================================ > ================== > --- head/lib/libc/Makefile Thu Mar 28 01:12:44 2019 (r345624) > +++ head/lib/libc/Makefile Thu Mar 28 02:12:32 2019 (r345625) > @@ -6,8 +6,6 @@ SHLIBDIR?= /lib > > .include > > -# BIND_NOW in libc results in segfault at startup (PR 233333) > -MK_BIND_NOW= no > # Force building of libc_pic.a > MK_TOOLCHAIN= yes > > > Modified: head/lib/libthr/Makefile > ============================================================ > ================== > --- head/lib/libthr/Makefile Thu Mar 28 01:12:44 2019 (r345624) > +++ head/lib/libthr/Makefile Thu Mar 28 02:12:32 2019 (r345625) > @@ -9,7 +9,6 @@ PACKAGE= clibs > SHLIBDIR?= /lib > > .include > -MK_BIND_NOW= no > MK_SSP= no > > LIB=thr > > Modified: head/libexec/rtld-elf/Makefile > ============================================================ > ================== > --- head/libexec/rtld-elf/Makefile Thu Mar 28 01:12:44 2019 > (r345624) > +++ head/libexec/rtld-elf/Makefile Thu Mar 28 02:12:32 2019 > (r345625) > @@ -6,7 +6,6 @@ > > .include > PACKAGE= clibs > -MK_BIND_NOW= no > MK_PIE= no # Always position independent using local rules > MK_SSP= no > > > Modified: head/sys/sys/elf_common.h > ============================================================ > ================== > --- head/sys/sys/elf_common.h Thu Mar 28 01:12:44 2019 (r345624) > +++ head/sys/sys/elf_common.h Thu Mar 28 02:12:32 2019 (r345625) > @@ -763,7 +763,8 @@ typedef struct { > #define NT_FREEBSD_FEATURE_CTL 4 > > /* NT_FREEBSD_FEATURE_CTL desc[0] bits */ > -#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 > +#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 > +#define NT_FREEBSD_FCTL_IMPLIED_MAX_PROT 0x00000002 > > /* Values for n_type. Used in core files. */ > #define NT_PRSTATUS 1 /* Process status. */ > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FC64DBEEF; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yh4dYSz4Ns6; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 02E9619BF3; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id DFB80FD1F; Thu, 28 Mar 2019 12:05:44 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3ADF46D81D; Thu, 28 Mar 2019 12:05:44 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0E157FCB9; Thu, 28 Mar 2019 12:05:44 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 69D51FCB4; Thu, 28 Mar 2019 12:05:41 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FCA26D815; Thu, 28 Mar 2019 12:05:40 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 9TmlhfJ5gGusj9TmnhA2O0; Thu, 28 Mar 2019 06:05:33 -0600 X-Authority-Analysis: v=2.3 cv=fOdHIqSe c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=NTGMnVQrEZIA:10 a=6I5d2MoRAAAA:8 a=ypVJL4-jAAAA:8 a=YxBL1-UpAAAA:8 a=_w8LQuDnf3d9whMED7QA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=khIbc0fXALFIcTpOSxgJ:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 9F4FBB8B; Thu, 28 Mar 2019 05:05:31 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x2SC5Vkg057821; Thu, 28 Mar 2019 05:05:31 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x2SC5VpX057818; Thu, 28 Mar 2019 05:05:31 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201903281205.x2SC5VpX057818@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ed Maste cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345638 - head/sys/sys In-Reply-To: Message from Ed Maste of "Thu, 28 Mar 2019 10:56:27 -0000." <201903281056.x2SAuR5E070924@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-CMAE-Envelope: MS4wfBcO9Juow8EaSCu8Rtejh8yAnYnDzVR4BdvJ8gzCPxjCBq/5elzV/QHG9pIYvJNXw58l68UF+r37BDnFIV5bvzA3nUGfSZYJbooLNB/+45BIQYDC6CDR oiHnsJTAVlHMu/Ap1NodNLrcNX8EKQXT1Kma2yz5WBfUQFIjfOPmbS76LbtNwEkwm4NabyROc/RcPlVf1PMwQss8h5lYTQNxmO1pUgAAcswCKkcppohA2ByU w4MOlekef7Ym4a6QFLE7mF7CCmYTO/FT4EVEe8jquZS6O1xZFbDLto4hjd5sCxM0 Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3ADF46D81D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:50 -0000 X-Original-Date: Thu, 28 Mar 2019 05:05:31 -0700 X-List-Received-Date: Tue, 03 Sep 2019 14:05:50 -0000 In message <201903281056.x2SAuR5E070924@repo.freebsd.org>, Ed Maste writes: > Author: emaste > Date: Thu Mar 28 10:56:27 2019 > New Revision: 345638 > URL: https://svnweb.freebsd.org/changeset/base/345638 > > Log: > Revert change accidentally committed along with r345625 > > Reported by: Oliver Pinter > > Modified: > head/sys/sys/elf_common.h > > Modified: head/sys/sys/elf_common.h > ============================================================================= > = > --- head/sys/sys/elf_common.h Thu Mar 28 09:51:37 2019 (r345637) > +++ head/sys/sys/elf_common.h Thu Mar 28 10:56:27 2019 (r345638) > @@ -763,8 +763,7 @@ typedef struct { > #define NT_FREEBSD_FEATURE_CTL 4 > > /* NT_FREEBSD_FEATURE_CTL desc[0] bits */ > -#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 > -#define NT_FREEBSD_FCTL_IMPLIED_MAX_PROT 0x00000002 > +#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 --- readelf.o --- /opt/src/svn-current/contrib/elftoolchain/readelf/readelf.c:3493:4: error: use of undeclared identifier 'NT_FREEBSD_FCTL_IMPLIED_MAX_PROT' { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" }, ^ 1 error generated. *** [readelf.o] Error code 1 > > /* Values for n_type. Used in core files. */ > #define NT_PRSTATUS 1 /* Process status. */ > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CB50DBF0D; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj1SYFz4Nsc; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 66AD619C1C; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 2CDF915D04; Thu, 28 Mar 2019 17:30:52 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3150082A14; Thu, 28 Mar 2019 17:30:51 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 162D015C99; Thu, 28 Mar 2019 17:30:51 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 4472D15C97 for ; Thu, 28 Mar 2019 17:30:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0ED4F82A07; Thu, 28 Mar 2019 17:30:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5ED1225AE; Thu, 28 Mar 2019 17:30:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2SHUlNl079052; Thu, 28 Mar 2019 17:30:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SHUlTt079051; Thu, 28 Mar 2019 17:30:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201903281730.x2SHUlTt079051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345646 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 345646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3150082A14 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:52 -0000 X-Original-Date: Thu, 28 Mar 2019 17:30:47 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:52 -0000 Author: emaste Date: Thu Mar 28 17:30:47 2019 New Revision: 345646 URL: https://svnweb.freebsd.org/changeset/base/345646 Log: readelf: add newline after dumping dynamic FLAGS / FLAGS_1 All three dump_flags() callers need a newline after printing the flags. Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 17:22:31 2019 (r345645) +++ head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 17:30:47 2019 (r345646) @@ -2741,6 +2741,7 @@ dump_flags(struct flag_desc *desc, uint64_t val) } if (val != 0) printf(" unknown (0x%jx)", (uintmax_t)val); + printf("\n"); } static struct flag_desc dt_flags[] = { @@ -3524,7 +3525,6 @@ dump_notes_data(const char *name, uint32_t type, const goto unknown; printf(" Features:"); dump_flags(note_feature_ctl_flags, ubuf[0]); - printf("\n"); return; } } From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9074EDBF0E; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj1f34z4Nsf; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 60D8919C18; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 4B5AA15AD8; Thu, 28 Mar 2019 17:22:37 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4115182777; Thu, 28 Mar 2019 17:22:36 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 153AA15A95; Thu, 28 Mar 2019 17:22:36 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id DA88615A93 for ; Thu, 28 Mar 2019 17:22:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8953E8276C; Thu, 28 Mar 2019 17:22:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B8952258B; Thu, 28 Mar 2019 17:22:32 +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 x2SHMWvP076399; Thu, 28 Mar 2019 17:22:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SHMWrK076398; Thu, 28 Mar 2019 17:22:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201903281722.x2SHMWrK076398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345645 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 345645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 4115182777 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:53 -0000 X-Original-Date: Thu, 28 Mar 2019 17:22:32 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:53 -0000 Author: ngie Date: Thu Mar 28 17:22:31 2019 New Revision: 345645 URL: https://svnweb.freebsd.org/changeset/base/345645 Log: Spam CXXFLAGS with `-I${DESTDIR}/usr/include/private`, instead of GTEST_CXXFLAGS This makes it easier for googletest users to leverage googletest, instead of forcing them to plug GTEST_CXXFLAGS into CXXFLAGS manually (resulting in unnecessary duplication). I will be following this up with a more proper fix in src.libnames.mk, as src.libnames.mk should be automatically adding this directory to CFLAGS/CXXFLAGS when private libraries are referenced. Not doing so can result in mismatches between base-provided private library's and ports-provided library's headers. While here, tweak the comment to clarify what the intent is behind spamming CXXFLAGS. MFC after: 5 weeks MFC with: r345203 Reported by: asomers Reviewed by: asomers Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D19731 Modified: head/share/mk/googletest.test.inc.mk Modified: head/share/mk/googletest.test.inc.mk ============================================================================== --- head/share/mk/googletest.test.inc.mk Thu Mar 28 16:17:33 2019 (r345644) +++ head/share/mk/googletest.test.inc.mk Thu Mar 28 17:22:31 2019 (r345645) @@ -9,7 +9,8 @@ GTESTS_CXXFLAGS+= -DGTEST_HAS_STREAM_REDIRECTION=1 GTESTS_CXXFLAGS+= -frtti GTESTS_CXXFLAGS+= -std=${CXXSTD} -# XXX: src.libnames.mk should handle adding this directory. -GTESTS_CXXFLAGS+= -I${DESTDIR}${INCLUDEDIR}/private +# XXX: src.libnames.mk should handle adding this directory for libgtest's, +# libgmock's, etc, headers. +CXXFLAGS+= -I${DESTDIR}${INCLUDEDIR}/private NO_WTHREAD_SAFETY= From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CB18DBF0C; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yh4dVfz4Ns5; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 0912D19BF5; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 38D96101A3; Thu, 28 Mar 2019 12:28:34 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77C2C6E368; Thu, 28 Mar 2019 12:28:33 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 20F5010178; Thu, 28 Mar 2019 12:28:33 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 6B15D10174 for ; Thu, 28 Mar 2019 12:28:30 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 395B86E360; Thu, 28 Mar 2019 12:28:30 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DD231F1A0; Thu, 28 Mar 2019 12:28:30 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2SCSThB018571; Thu, 28 Mar 2019 12:28:29 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SCSTFt018570; Thu, 28 Mar 2019 12:28:29 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201903281228.x2SCSTFt018570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345639 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 345639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 77C2C6E368 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:52 -0000 X-Original-Date: Thu, 28 Mar 2019 12:28:29 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:52 -0000 Author: bde Date: Thu Mar 28 12:28:29 2019 New Revision: 345639 URL: https://svnweb.freebsd.org/changeset/base/345639 Log: Fix VGLGetXY(), VGLSetXY() and VGLClear() for MEMBUFs in depths > 8. This depends on PixelBytes being properly initialized, which it is for all bitmaps constructed by libvgl except mouse cursor bitmaps. Modified: head/lib/libvgl/simple.c Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Thu Mar 28 10:56:27 2019 (r345638) +++ head/lib/libvgl/simple.c Thu Mar 28 12:28:29 2019 (r345639) @@ -102,6 +102,15 @@ VGLSetXY(VGLBitmap *object, int x, int y, u_long color !VGLMouseFreeze(x, y, 1, 1, 0x80000000 | color)) { switch (object->Type) { case MEMBUF: + switch (object->PixelBytes) { + case 2: + goto vidbuf16; + case 3: + goto vidbuf24; + case 4: + goto vidbuf32; + } + /* fallthrough */ case VIDBUF8: object->Bitmap[y*object->VXsize+x]=((byte)color); break; @@ -109,8 +118,11 @@ VGLSetXY(VGLBitmap *object, int x, int y, u_long color object->Bitmap[VGLSetSegment(y*object->VXsize+x)]=((byte)color); break; case VIDBUF16: +vidbuf16: case VIDBUF24: +vidbuf24: case VIDBUF32: +vidbuf32: color2mem(color, b, object->PixelBytes); bcopy(b, &object->Bitmap[(y*object->VXsize+x) * object->PixelBytes], object->PixelBytes); @@ -156,13 +168,25 @@ __VGLGetXY(VGLBitmap *object, int x, int y) switch (object->Type) { case MEMBUF: + switch (object->PixelBytes) { + case 2: + goto vidbuf16; + case 3: + goto vidbuf24; + case 4: + goto vidbuf32; + } + /* fallthrough */ case VIDBUF8: return object->Bitmap[((y*object->VXsize)+x)]; case VIDBUF8S: return object->Bitmap[VGLSetSegment(y*object->VXsize+x)]; case VIDBUF16: +vidbuf16: case VIDBUF24: +vidbuf24: case VIDBUF32: +vidbuf32: bcopy(&object->Bitmap[(y*object->VXsize+x) * object->PixelBytes], b, object->PixelBytes); return (mem2color(b, object->PixelBytes)); @@ -525,6 +549,15 @@ VGLClear(VGLBitmap *object, u_long color) VGLMouseFreeze(0, 0, object->Xsize, object->Ysize, color); switch (object->Type) { case MEMBUF: + switch (object->PixelBytes) { + case 2: + goto vidbuf16; + case 3: + goto vidbuf24; + case 4: + goto vidbuf32; + } + /* fallthrough */ case VIDBUF8: memset(object->Bitmap, (byte)color, object->VXsize*object->VYsize); break; @@ -539,8 +572,11 @@ VGLClear(VGLBitmap *object, u_long color) } break; case VIDBUF16: +vidbuf16: case VIDBUF24: +vidbuf24: case VIDBUF32: +vidbuf32: color2mem(color, b, object->PixelBytes); total = object->VXsize*object->VYsize*object->PixelBytes; for (i = 0; i < total; i += object->PixelBytes) From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E7B9DBEFC; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj0WC9z4NsV; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 4BF9E19C11; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id EC1ED12E4A; Thu, 28 Mar 2019 14:21:26 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A1047394E; Thu, 28 Mar 2019 14:21:26 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0E33912DDE; Thu, 28 Mar 2019 14:21:26 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 0BAD412DD9 for ; Thu, 28 Mar 2019 14:21:23 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7F607393B; Thu, 28 Mar 2019 14:21:22 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4562204AE; Thu, 28 Mar 2019 14:21:22 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2SELM0C081062; Thu, 28 Mar 2019 14:21:22 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SELMEH081061; Thu, 28 Mar 2019 14:21:22 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201903281421.x2SELMEH081061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345643 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 345643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3A1047394E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:50 -0000 X-Original-Date: Thu, 28 Mar 2019 14:21:22 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:50 -0000 Author: bde Date: Thu Mar 28 14:21:22 2019 New Revision: 345643 URL: https://svnweb.freebsd.org/changeset/base/345643 Log: Fix VGLLine() in depths > 8. It started truncating its color arg to 8 bits using plot() in r229415. The version in r229415 is also more than 3 times slower in segmented modes, by doing more syscalls to move the window. Modified: head/lib/libvgl/simple.c Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Thu Mar 28 13:44:18 2019 (r345642) +++ head/lib/libvgl/simple.c Thu Mar 28 14:21:22 2019 (r345643) @@ -248,7 +248,7 @@ VGLGetXY(VGLBitmap *object, int x, int y) #define SL_ABSOLUTE(i,j,k) ( (i-j)*(k = ( (i-j)<0 ? -1 : 1))) void -plot(VGLBitmap * object, int x, int y, int flag, byte color) +plot(VGLBitmap * object, int x, int y, int flag, u_long color) { /* non-zero flag indicates the pixels need swapping back. */ if (flag) From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51F55DBEF1; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yh3kSwz4Nrt; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id E6AC019BED; Tue, 3 Sep 2019 14:05:47 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 6CE1EDF32; Thu, 28 Mar 2019 09:51:42 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F3138F2DA; Thu, 28 Mar 2019 09:51:42 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1FC36DF2B; Thu, 28 Mar 2019 09:51:42 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id EC333DF1B for ; Thu, 28 Mar 2019 09:51:38 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98BEF8F2B5; Thu, 28 Mar 2019 09:51:38 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C4071D751; Thu, 28 Mar 2019 09:51:38 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2S9pcxZ035713; Thu, 28 Mar 2019 09:51:38 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2S9pcnD035712; Thu, 28 Mar 2019 09:51:38 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201903280951.x2S9pcnD035712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345637 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 345637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 2F3138F2DA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:50 -0000 X-Original-Date: Thu, 28 Mar 2019 09:51:38 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:50 -0000 Author: bde Date: Thu Mar 28 09:51:37 2019 New Revision: 345637 URL: https://svnweb.freebsd.org/changeset/base/345637 Log: Oops, r345496 got the pointer args backwards for bcopy() in VGLClear for segmented modes. Also fix some style bugs in the 2 changed lines. libvgl uses a very non-KNF style with 2-column indentation with no tabs except for regressions. Modified: head/lib/libvgl/simple.c Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Thu Mar 28 09:50:25 2019 (r345636) +++ head/lib/libvgl/simple.c Thu Mar 28 09:51:37 2019 (r345637) @@ -556,8 +556,8 @@ VGLClear(VGLBitmap *object, u_long color) VGLSetSegment(offset); len = min(total - offset, VGLAdpInfo.va_window_size); for (i = 0; i < len; i += object->PixelBytes) - bcopy(object->Bitmap + (offset + i) % VGLAdpInfo.va_window_size, b, - object->PixelBytes); + bcopy(b, object->Bitmap + (offset + i) % VGLAdpInfo.va_window_size, + object->PixelBytes); offset += len; } break; From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78A6EDBF04; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj1NMVz4Nsb; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 6B1BA19C20; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5679215E49; Thu, 28 Mar 2019 17:31:26 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41A6A82BCB; Thu, 28 Mar 2019 17:31:25 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1AA1015DDD; Thu, 28 Mar 2019 17:31:25 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 77D8215DD9; Thu, 28 Mar 2019 17:31:22 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8ACB182BB6; Thu, 28 Mar 2019 17:31:21 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id x2SHVBFn032541 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Mar 2019 04:31:16 +1100 (AEDT) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id x2SHV4G8015886 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 29 Mar 2019 04:31:04 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id x2SHV4q5015885; Fri, 29 Mar 2019 04:31:04 +1100 (AEDT) (envelope-from peter) From: Peter Jeremy To: Renato Botelho Cc: Oliver Pinter , Ed Maste , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r345625 - in head: contrib/elftoolchain/readelf lib/libc lib/libthr libexec/rtld-elf sys/sys Message-ID: <20190328173104.GA15801@server.rulingia.com> References: <201903280212.x2S2CXoG000730@repo.freebsd.org> <3d5e5264-bd98-7c57-b849-45affa974e1b@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <3d5e5264-bd98-7c57-b849-45affa974e1b@FreeBSD.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.11.4 (2019-03-13) Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 41A6A82BCB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:51 -0000 X-Original-Date: Fri, 29 Mar 2019 04:31:04 +1100 X-List-Received-Date: Tue, 03 Sep 2019 14:05:51 -0000 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-Mar-28 09:41:49 -0300, Renato Botelho wrote: >On 3/28/19 4:25 AM, Oliver Pinter wrote: >> On Thursday, March 28, 2019, Ed Maste wrote: >> >>> Author: emaste >>> Date: Thu Mar 28 02:12:32 2019 >>> New Revision: 345625 >>> URL: https://svnweb.freebsd.org/changeset/base/345625 >>> >> Seems like this and the other hunk belongs to a different patch. >Indeed. It broke the build for me No, r345638 broke the build by only reverting one of the two extraneous hun= ks =66rom this commit. --=20 Peter Jeremy --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAlydBNhfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzTXcBAAkyFXB+Rj/XLXmZ9+lSGYVnFu1N9cNaEgcywxWfBB1Lzy8aL8B12HC3CG xchzJxm6IrBNn0+8ggFt8R/1eOZ8IrxYMAvXxS6xaHDq6Z8qmWTAOM+/5l3VgYdu CG1jQUfUZwn7u54zYvzKfHpcZRm/onoo2vIQgls9ma/z+PN9PipBfQpXmvmw0uM9 I/wAneyq1k+W1hsNYo8eMDJUq5g5RG98AG59lckRJ4uPwaYcnUaMhsL4/z/46TVA wB++sbj1sgy8C98TEczAO8DJ4653U+Wdp+ph1eAunO0s2qSKGPBsvyAqEbzKYA+e 2owL9BbHiuxQ+iBuEffrmqK4jWlYp6JOwVoN9+2JlbEzzlnwIYSp1r0OBNV7pae6 gvQaccFNnC/o2ut3KpgbrCPMqzzDzb6rPe67NVHMRDW37IrQU2FXck2IeKniaWPc +WNIw6yGaj7oY1ttOhowi2ljBPCrvPstUw5/E/lFi2uZNr064u/zaOur7Q8ThJoQ qzHtVd6MD+Vr3lxeEuBxMZK2bBomu7FKNjFZgwcoVtEW2iD/CHC5Z1l3TYAOMtfD 2SmxIKDD+rN8YfF3gdFmndoJpYmuUatN6vj68iu+8NU4XzipgLgcwuCC0Z4JMfjf TqeGuodAjilx3vqPI+tUMpMeX//ZloKuQSiCz5J2YiGn38jrZEY= =5DqD -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0-- From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79F3ADBF06; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yh3kD1z4Nrr; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id AFC9719BD2; Tue, 3 Sep 2019 14:05:47 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 39E08C3B8; Thu, 28 Mar 2019 08:59:17 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39F798C284; Thu, 28 Mar 2019 08:59:16 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 10FACC381; Thu, 28 Mar 2019 08:59:16 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 4A170C37F for ; Thu, 28 Mar 2019 08:59:13 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16C6A8C27B; Thu, 28 Mar 2019 08:59:13 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E57261CCBB; Thu, 28 Mar 2019 08:59:12 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2S8xCoq008477; Thu, 28 Mar 2019 08:59:12 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2S8xCe0008473; Thu, 28 Mar 2019 08:59:12 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201903280859.x2S8xCe0008473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345632 - in head/sys/modules: efirt iflib nvdimm tpm X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/sys/modules: efirt iflib nvdimm tpm X-SVN-Commit-Revision: 345632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 39F798C284 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:51 -0000 X-Original-Date: Thu, 28 Mar 2019 08:59:12 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:51 -0000 Author: lwhsu Date: Thu Mar 28 08:59:11 2019 New Revision: 345632 URL: https://svnweb.freebsd.org/changeset/base/345632 Log: Fix `make` in sys/modules Sponsored by: The FreeBSD Foundation Modified: head/sys/modules/efirt/Makefile head/sys/modules/iflib/Makefile head/sys/modules/nvdimm/Makefile head/sys/modules/tpm/Makefile Modified: head/sys/modules/efirt/Makefile ============================================================================== --- head/sys/modules/efirt/Makefile Thu Mar 28 08:38:31 2019 (r345631) +++ head/sys/modules/efirt/Makefile Thu Mar 28 08:59:11 2019 (r345632) @@ -9,6 +9,7 @@ SRCS+= efirtc.c SRCS+= device_if.h bus_if.h clock_if.h .if ${MACHINE_CPUARCH} == "amd64" +SRCS+= opt_hwpmc_hooks.h opt_kstack_pages.h SRCS+= efirt_support.S efirt_support.o: efirt_support.S assym.inc ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ Modified: head/sys/modules/iflib/Makefile ============================================================================== --- head/sys/modules/iflib/Makefile Thu Mar 28 08:38:31 2019 (r345631) +++ head/sys/modules/iflib/Makefile Thu Mar 28 08:59:11 2019 (r345632) @@ -9,5 +9,6 @@ SRCS= \ mp_ring.c SRCS+= ifdi_if.c SRCS+= device_if.h bus_if.h pci_if.h pci_iov_if.h ifdi_if.h +SRCS+= opt_acpi.h opt_inet.h opt_inet6.h opt_sched.h .include Modified: head/sys/modules/nvdimm/Makefile ============================================================================== --- head/sys/modules/nvdimm/Makefile Thu Mar 28 08:38:31 2019 (r345631) +++ head/sys/modules/nvdimm/Makefile Thu Mar 28 08:59:11 2019 (r345632) @@ -9,5 +9,6 @@ SRCS= nvdimm.c \ nvdimm_spa.c SRCS+= acpi_if.h bus_if.h device_if.h +SRCS+= opt_acpi.h opt_ddb.h .include Modified: head/sys/modules/tpm/Makefile ============================================================================== --- head/sys/modules/tpm/Makefile Thu Mar 28 08:38:31 2019 (r345631) +++ head/sys/modules/tpm/Makefile Thu Mar 28 08:59:11 2019 (r345632) @@ -8,6 +8,6 @@ SRCS= tpm.c bus_if.h device_if.h #Bus specific stuff. SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_if.h #TPM 2.0 -SRCS+= tpm20.c tpm_crb.c tpm_tis.c +SRCS+= tpm20.c tpm_crb.c tpm_tis.c opt_tpm.h .include From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2663DBF11; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj25d9z4Nsj; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 5AA0A19C16; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 8ECCD14863; Thu, 28 Mar 2019 16:17:37 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21C6D77E19; Thu, 28 Mar 2019 16:17:37 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0F27F1485E; Thu, 28 Mar 2019 16:17:37 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7498314859 for ; Thu, 28 Mar 2019 16:17:34 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F2DC77E13; Thu, 28 Mar 2019 16:17:34 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 175002194A; Thu, 28 Mar 2019 16:17:34 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2SGHXU5039648; Thu, 28 Mar 2019 16:17:33 GMT (envelope-from olivier@FreeBSD.org) Received: (from olivier@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SGHXCO039647; Thu, 28 Mar 2019 16:17:33 GMT (envelope-from olivier@FreeBSD.org) Message-Id: <201903281617.x2SGHXCO039647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: olivier set sender to olivier@FreeBSD.org using -f From: Olivier Cochard To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345644 - head/tests/sys/netmap X-SVN-Group: head X-SVN-Commit-Author: olivier X-SVN-Commit-Paths: head/tests/sys/netmap X-SVN-Commit-Revision: 345644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 21C6D77E19 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:53 -0000 X-Original-Date: Thu, 28 Mar 2019 16:17:33 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:53 -0000 Author: olivier (ports committer) Date: Thu Mar 28 16:17:33 2019 New Revision: 345644 URL: https://svnweb.freebsd.org/changeset/base/345644 Log: Skip this test if if_tap module is not available PR: 236842 Approved by: asomers MFC after: 1 month Sponsored by: Netflix Modified: head/tests/sys/netmap/Makefile head/tests/sys/netmap/ctrl-api-test.c Modified: head/tests/sys/netmap/Makefile ============================================================================== --- head/tests/sys/netmap/Makefile Thu Mar 28 14:21:22 2019 (r345643) +++ head/tests/sys/netmap/Makefile Thu Mar 28 16:17:33 2019 (r345644) @@ -7,6 +7,7 @@ TEST_METADATA+= required_user="root" TEST_METADATA+= is_exclusive=true LDFLAGS+= -lpthread +CFLAGS+= -I${SRCTOP}/tests PLAIN_TESTS_C+= ctrl-api-test WARNS?= 6 Modified: head/tests/sys/netmap/ctrl-api-test.c ============================================================================== --- head/tests/sys/netmap/ctrl-api-test.c Thu Mar 28 14:21:22 2019 (r345643) +++ head/tests/sys/netmap/ctrl-api-test.c Thu Mar 28 16:17:33 2019 (r345644) @@ -48,9 +48,15 @@ #include #include +#ifdef __FreeBSD__ +#include "freebsd_test_suite/macros.h" +#endif + + #ifdef __linux__ #include #else + static int eventfd(int x __unused, int y __unused) { @@ -1830,6 +1836,10 @@ main(int argc, char **argv) int list = 0; int opt; int i; + +#ifdef __FreeBSD__ + PLAIN_REQUIRE_KERNEL_MODULE("if_tap", 0); +#endif memset(&ctx_, 0, sizeof(ctx_)); From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DD9FDBF09; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yh4ghGz4NsJ; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 0E6A219BF7; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 146BD10584; Thu, 28 Mar 2019 12:41:59 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CA786ED46; Thu, 28 Mar 2019 12:41:58 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 17ABB10561; Thu, 28 Mar 2019 12:41:58 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C87D61055A; Thu, 28 Mar 2019 12:41:54 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F6476ED30; Thu, 28 Mar 2019 12:41:54 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qt1-x842.google.com with SMTP id t28so22828394qte.6; Thu, 28 Mar 2019 05:41:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=Rjp1BTYmDA5fUI1CUTPp6Voe9N2jvb0HpaxWIRaZKIU=; b=i5CgqtRh2NdgXH1KH+cf4rCP92jwXTo0xkpokKlchHleDpNSbr5OOKF3Vf+wOXahgh GrMBPZ4k/nXJRXU86y4ZzlLHIJwTl74k5s2AVhqoxlt5eipAZqRJXGoSBpdekK2gA9du uyheM4QIZRShsfkhBoY3P8RldJ+FFGhNvX0QmJIhlcD8II6wrtVepv/9VcCgPPE44A8n N37udl/QXctX9HHlpVTpzWuoyC6ZTbfiv0KjGZVTlnffq/A2aKT8G308IMyuG+CHGNJi iE1bzZxVRKws7yau7syX2/OeVhPurXsgKeab7/8ZPHaJAPH3wr0Yr8xjLPgcrhIY1aJr BI5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Rjp1BTYmDA5fUI1CUTPp6Voe9N2jvb0HpaxWIRaZKIU=; b=trxKAroswPe9zqPsGEUJ3lOJNY0Z3Iivbccq+DfaACI+/Z/VhG4mjGTk6N5KIzP/SJ 2StibiZlvpq5ACHB4KHxPGI/btYoKJCqujFFkZFCDXbM02f4e0ZeVL1A8j1j01/oqDJk 0e1uRn1nrUOt4zPhSo14kVEmE6DK5myG6Csah6NZKPYPDS84o4BEAtOiHtY5EfbVgJW9 I1XyTK1SR7NLyIFlrwqcffeuQvUyB3cA3Q/dv8H7qh2yjtvP1MTy+usuMUpPSyu+Gc7D 7p3evPPdkGoQ3Dw9j8zMImJDvHpj5PIX4eRvjxPS5M5c0IEFD1kdCBWLJKn3wJIadv3s oSBA== X-Gm-Message-State: APjAAAVI0fSHJBlAOMnEbK4WjdS8SPA/PZMBN0xvZrCIkxTfO4Ns6uZt By2pWXhe9KWD9ZUe4V+ELiYNWMit X-Google-Smtp-Source: APXvYqxlARrhru9JL6wWJwmwJ+Stk1VFE/dReF9Xvowr/IW/seg/dlXdylw6y+pygbBsNM0CYmmfkg== X-Received: by 2002:ac8:2cd6:: with SMTP id 22mr35892597qtx.112.1553776913490; Thu, 28 Mar 2019 05:41:53 -0700 (PDT) Received: from [172.21.4.121] (201-77-127-155.static.desktop.com.br. [201.77.127.155]) by smtp.gmail.com with ESMTPSA id p130sm13963696qka.96.2019.03.28.05.41.50 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 05:41:51 -0700 (PDT) Subject: Re: svn commit: r345625 - in head: contrib/elftoolchain/readelf lib/libc lib/libthr libexec/rtld-elf sys/sys To: Oliver Pinter , Ed Maste Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" References: <201903280212.x2S2CXoG000730@repo.freebsd.org> From: Renato Botelho Message-ID: <3d5e5264-bd98-7c57-b849-45affa974e1b@FreeBSD.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3CA786ED46 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:52 -0000 X-Original-Date: Thu, 28 Mar 2019 09:41:49 -0300 X-List-Received-Date: Tue, 03 Sep 2019 14:05:52 -0000 On 3/28/19 4:25 AM, Oliver Pinter wrote: > On Thursday, March 28, 2019, Ed Maste wrote: > >> Author: emaste >> Date: Thu Mar 28 02:12:32 2019 >> New Revision: 345625 >> URL: https://svnweb.freebsd.org/changeset/base/345625 >> >> Log: >> revert r341429 "disable BIND_NOW in libc, libthr, and rtld" >> >> r345620 by kib@ fixed the rtld issue that caused a crash at startup >> during resolution of libc's ifuncs with BIND_NOW. >> >> PR: 233333 >> Sponsored by: The FreeBSD Foundation >> >> Modified: >> head/contrib/elftoolchain/readelf/readelf.c >> head/lib/libc/Makefile >> head/lib/libthr/Makefile >> head/libexec/rtld-elf/Makefile >> head/sys/sys/elf_common.h >> >> Modified: head/contrib/elftoolchain/readelf/readelf.c >> ============================================================ >> ================== >> --- head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 01:12:44 2019 >> (r345624) >> +++ head/contrib/elftoolchain/readelf/readelf.c Thu Mar 28 02:12:32 2019 >> (r345625) >> @@ -3490,6 +3490,7 @@ dump_notes(struct readelf *re) >> >> static struct flag_desc note_feature_ctl_flags[] = { >> { NT_FREEBSD_FCTL_ASLR_DISABLE, "ASLR_DISABLE" }, >> + { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" }, >> { 0, NULL } >> }; >> >> > Seems like this and the other hunk belongs to a different patch. Indeed. It broke the build for me -- Renato Botelho From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BE12DBF33; Tue, 3 Sep 2019 14:05:50 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj3sgBz4Nt9; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id C332919C65; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 666E61978C; Thu, 28 Mar 2019 20:16:23 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3164489C62; Thu, 28 Mar 2019 20:16:23 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 19C631978B; Thu, 28 Mar 2019 20:16:23 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 73F3619787 for ; Thu, 28 Mar 2019 20:16:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4386089C5E; Thu, 28 Mar 2019 20:16:20 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 203C5242E6; Thu, 28 Mar 2019 20:16:20 +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 x2SKGKtI069533; Thu, 28 Mar 2019 20:16:20 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SKGJVF069532; Thu, 28 Mar 2019 20:16:19 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201903282016.x2SKGJVF069532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345653 - head/usr.sbin/iostat X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/iostat X-SVN-Commit-Revision: 345653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3164489C62 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:54 -0000 X-Original-Date: Thu, 28 Mar 2019 20:16:19 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:54 -0000 Author: trasz Date: Thu Mar 28 20:16:19 2019 New Revision: 345653 URL: https://svnweb.freebsd.org/changeset/base/345653 Log: Make the "KB/s" field one character shorter (by reducing the precision) and use the space to make the "tps" one character longer. It makes the iostat(8) output a bit less messed up. Reviewed by: allanjude MFC after: 2 weeks Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D19710 Modified: head/usr.sbin/iostat/iostat.c Modified: head/usr.sbin/iostat/iostat.c ============================================================================== --- head/usr.sbin/iostat/iostat.c Thu Mar 28 20:13:34 2019 (r345652) +++ head/usr.sbin/iostat/iostat.c Thu Mar 28 20:16:19 2019 (r345653) @@ -769,9 +769,9 @@ phdr(void) (void)printf(" blk xfr msps "); } else { if (Iflag == 0) - printf(" KB/t tps MB/s "); + printf(" KB/t tps MB/s "); else - printf(" KB/t xfrs MB "); + printf(" KB/t xfrs MB "); } printed++; } @@ -945,7 +945,7 @@ devstats(int perf_select, long double etime, int havel ms_per_transaction); } else { if (Iflag == 0) - printf(" %5.2Lf %3.0Lf %5.2Lf ", + printf(" %4.1Lf %4.0Lf %5.2Lf ", kb_per_transfer, transfers_per_second, mb_per_second); @@ -953,7 +953,7 @@ devstats(int perf_select, long double etime, int havel total_mb = total_bytes; total_mb /= 1024 * 1024; - printf(" %5.2Lf %3.1" PRIu64 " %5.2Lf ", + printf(" %4.1Lf %4.1" PRIu64 " %5.2Lf ", kb_per_transfer, total_transfers, total_mb); From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBE5FDBF17; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj2CPPz4Nss; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 8053019C2F; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E73A7178D9; Thu, 28 Mar 2019 18:20:51 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DA2F85453; Thu, 28 Mar 2019 18:20:51 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 118301786F; Thu, 28 Mar 2019 18:20:51 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 639BA1786D for ; Thu, 28 Mar 2019 18:20:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30D3E8543F; Thu, 28 Mar 2019 18:20:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BF7722E98; Thu, 28 Mar 2019 18:20:48 +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 x2SIKl6M007684; Thu, 28 Mar 2019 18:20:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SIKlvQ007683; Thu, 28 Mar 2019 18:20:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201903281820.x2SIKlvQ007683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345647 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 345647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3DA2F85453 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:54 -0000 X-Original-Date: Thu, 28 Mar 2019 18:20:47 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:54 -0000 Author: delphij Date: Thu Mar 28 18:20:47 2019 New Revision: 345647 URL: https://svnweb.freebsd.org/changeset/base/345647 Log: Distinguish between lseek errors and read errores. MFC after: 2 weeks Modified: head/sbin/fsck_msdosfs/dir.c Modified: head/sbin/fsck_msdosfs/dir.c ============================================================================== --- head/sbin/fsck_msdosfs/dir.c Thu Mar 28 17:30:47 2019 (r345646) +++ head/sbin/fsck_msdosfs/dir.c Thu Mar 28 18:20:47 2019 (r345647) @@ -35,6 +35,7 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include #include #include #include @@ -329,8 +330,11 @@ delete(int f, struct bootblock *boot, struct fatEntry } off = startcl * boot->bpbSecPerClust + boot->ClusterOffset; off *= boot->bpbBytesPerSec; - if (lseek(f, off, SEEK_SET) != off - || read(f, delbuf, clsz) != clsz) { + if (lseek(f, off, SEEK_SET) != off) { + perr("Unable to lseek to %" PRId64, off); + return FSFATAL; + } + if (read(f, delbuf, clsz) != clsz) { perr("Unable to read directory"); return FSFATAL; } @@ -338,8 +342,11 @@ delete(int f, struct bootblock *boot, struct fatEntry *s = SLOT_DELETED; s += 32; } - if (lseek(f, off, SEEK_SET) != off - || write(f, delbuf, clsz) != clsz) { + if (lseek(f, off, SEEK_SET) != off) { + perr("Unable to lseek to %" PRId64, off); + return FSFATAL; + } + if (write(f, delbuf, clsz) != clsz) { perr("Unable to write directory"); return FSFATAL; } From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1ACCDBF48; Tue, 3 Sep 2019 14:05:50 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj5FdSz4NtW; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id E614C19C87; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 50B6C1A696; Thu, 28 Mar 2019 20:46:49 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 212B58B783; Thu, 28 Mar 2019 20:46:49 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0CA1D1A692; Thu, 28 Mar 2019 20:46:49 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 8DAE41A690 for ; Thu, 28 Mar 2019 20:46:46 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 393E18B77C; Thu, 28 Mar 2019 20:46:46 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14BA524880; Thu, 28 Mar 2019 20:46:46 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2SKkjxE085451; Thu, 28 Mar 2019 20:46:45 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SKkjQZ085450; Thu, 28 Mar 2019 20:46:45 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201903282046.x2SKkjQZ085450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345658 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 345658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 212B58B783 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:54 -0000 X-Original-Date: Thu, 28 Mar 2019 20:46:45 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:54 -0000 Author: erj Date: Thu Mar 28 20:46:45 2019 New Revision: 345658 URL: https://svnweb.freebsd.org/changeset/base/345658 Log: iflib: return ENETDOWN when the network device is down From Jake: iflib_if_transmit returns ENOBUFS when the device is down, or when the link isn't active. This was changed in r308792 from return (0), so that the function correctly reports an error that it was unable to transmit. However, using ENOBUFS can cause some network applications to produce the following or similar errors: "ping: sendto: No buffer space available" This is a bit confusing as the real cause of the issue is that the network device is down. Replace the ENOBUFS return with ENETDOWN to indicate more clearly that the reason for the failure to send is due to the network device is offline. This will cause the error message to be reported as "ping: sendto: Network is down" Submitted by: Jacob Keller Reviewed by: shurd@, sbruno@, bz@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D19652 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Mar 28 20:43:47 2019 (r345657) +++ head/sys/net/iflib.c Thu Mar 28 20:46:45 2019 (r345658) @@ -3898,7 +3898,7 @@ iflib_if_transmit(if_t ifp, struct mbuf *m) if (__predict_false((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || !LINK_ACTIVE(ctx))) { DBG_COUNTER_INC(tx_frees); m_freem(m); - return (ENOBUFS); + return (ENETDOWN); } MPASS(m->m_nextpkt == NULL); From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85D87DBF0A; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yh4gmqz4NsK; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 1F3C919BFC; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 4DBF0112E1; Thu, 28 Mar 2019 13:18:12 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41913706CA; Thu, 28 Mar 2019 13:18:11 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 18802112A6; Thu, 28 Mar 2019 13:18:11 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 624701129B for ; Thu, 28 Mar 2019 13:18:08 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16E8C706BA for ; Thu, 28 Mar 2019 13:18:08 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id A3C901CBA9 for ; Thu, 28 Mar 2019 13:18:07 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f181.google.com with SMTP id q66so17627416ljq.7 for ; Thu, 28 Mar 2019 06:18:07 -0700 (PDT) X-Gm-Message-State: APjAAAVjCvudog44B3qvHCZapdU63Fq1y8l0y4TGoEnhAY9sdUuD1d5y EhR0c8/JRb2PuBbtakd7wtk7tllJd8Ziasv/h3s= X-Received: by 2002:a2e:1257:: with SMTP id t84mt19656720lje.115.1553779086123; Thu, 28 Mar 2019 06:18:06 -0700 (PDT) MIME-Version: 1.0 References: <201903280348.x2S3mpNw048287@repo.freebsd.org> In-Reply-To: <201903280348.x2S3mpNw048287@repo.freebsd.org> From: Kyle Evans X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r345628 - head/usr.bin/dtc Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 41913706CA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:52 -0000 X-Original-Date: Thu, 28 Mar 2019 08:17:47 -0500 X-List-Received-Date: Tue, 03 Sep 2019 14:05:52 -0000 On Wed, Mar 27, 2019 at 10:49 PM Kyle Evans wrote: > > Author: kevans > Date: Thu Mar 28 03:48:51 2019 > New Revision: 345628 > URL: https://svnweb.freebsd.org/changeset/base/345628 > > Log: > dtc(1): Update to 1a79f5f26631 > > Highlights: > - Bugfix for order in which /delete-node/ and /delete-property/ are > processed [0] > - /omit-if-no-ref/ support has been added (used only by U-Boot at this > point, in theory) > - GPL dtc compat version bumped to 1.4.7 > - Various small fixes and compatibility improvements > > Reported by: strejda [0] > MFC after: 1 week > Sorry- this should have read "Reported by: mmel [0]" From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8145DBF4B; Tue, 3 Sep 2019 14:05:50 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj5djRz4Ntb; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id DD14819C7D; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 63DD31A2D8; Thu, 28 Mar 2019 20:43:51 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C62B8B2B2; Thu, 28 Mar 2019 20:43:51 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0BCDE1A2D6; Thu, 28 Mar 2019 20:43:51 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 0778C1A2D2 for ; Thu, 28 Mar 2019 20:43:48 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B309D8B2AD; Thu, 28 Mar 2019 20:43:47 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FCD924844; Thu, 28 Mar 2019 20:43:47 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2SKhlj3085265; Thu, 28 Mar 2019 20:43:47 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SKhllZ085264; Thu, 28 Mar 2019 20:43:47 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201903282043.x2SKhllZ085264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345657 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 345657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 1C62B8B2B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:55 -0000 X-Original-Date: Thu, 28 Mar 2019 20:43:47 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:55 -0000 Author: erj Date: Thu Mar 28 20:43:47 2019 New Revision: 345657 URL: https://svnweb.freebsd.org/changeset/base/345657 Log: iflib: hold the CTX lock in iflib_pseudo_register From Jake: The iflib_device_register function takes the CTX lock before calling IFDI_ATTACH_PRE, and releases it upon finishing the registration. Mirror this process in iflib_pseudo_register, so that we always hold the CTX lock during the attach process when registering a pseudo interface or a regular interface. This was caught by code inspection while attempting to analyze where the CTX lock was held. Submitted by: Jacob Keller Reviewed by: shurd@, erj@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D19604 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Mar 28 20:41:02 2019 (r345656) +++ head/sys/net/iflib.c Thu Mar 28 20:43:47 2019 (r345657) @@ -4662,10 +4662,10 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc * XXX sanity check that ntxd & nrxd are a power of 2 */ iflib_reset_qvalues(ctx); - + CTX_LOCK(ctx); if ((err = IFDI_ATTACH_PRE(ctx)) != 0) { device_printf(dev, "IFDI_ATTACH_PRE failed %d\n", err); - goto fail_ctx_free; + goto fail_unlock; } if (sctx->isc_flags & IFLIB_GEN_MAC) iflib_gen_mac(ctx); @@ -4819,6 +4819,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc if_setgetcounterfn(ctx->ifc_ifp, iflib_if_get_counter); iflib_add_device_sysctl_post(ctx); ctx->ifc_flags |= IFC_INIT_DONE; + CTX_UNLOCK(ctx); return (0); fail_detach: ether_ifdetach(ctx->ifc_ifp); @@ -4827,6 +4828,8 @@ fail_queues: iflib_rx_structures_free(ctx); fail_iflib_detach: IFDI_DETACH(ctx); +fail_unlock: + CTX_UNLOCK(ctx); fail_ctx_free: free(ctx->ifc_softc, M_IFLIB); free(ctx, M_IFLIB); From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BADF3DBF4E; Tue, 3 Sep 2019 14:05:50 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj5gRNz4Ntc; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id D273A19C73; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 26ABD19C82; Thu, 28 Mar 2019 20:25:41 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76E078A450; Thu, 28 Mar 2019 20:25:40 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 4428519C18; Thu, 28 Mar 2019 20:25:40 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C17E919C13 for ; Thu, 28 Mar 2019 20:25:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A0C08A447; Thu, 28 Mar 2019 20:25:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63A74244BC; Thu, 28 Mar 2019 20:25:37 +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 x2SKPb2X074828; Thu, 28 Mar 2019 20:25:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SKPbku074827; Thu, 28 Mar 2019 20:25:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201903282025.x2SKPbku074827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345655 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 345655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 76E078A450 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:55 -0000 X-Original-Date: Thu, 28 Mar 2019 20:25:37 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:55 -0000 Author: jhb Date: Thu Mar 28 20:25:36 2019 New Revision: 345655 URL: https://svnweb.freebsd.org/changeset/base/345655 Log: Remove nested epochs from lagg(4). lagg_bcast_start appeared to have a bug in that was using the last lagg port structure after exiting the epoch that was keeping that structure alive. However, upon further inspection, the epoch was already entered by the caller (lagg_transmit), so the epoch enter/exit in lagg_bcast_start was actually unnecessary. This commit generally removes uses of the net epoch via LAGG_RLOCK to protect the list of ports when the list of ports was already protected by an existing LAGG_RLOCK in a caller, or the LAGG_XLOCK. It also adds a missing epoch enter/exit in lagg_snd_tag_alloc while accessing the lagg port structures. An ifp is still accessed via an unsafe reference after the epoch is exited, but that is true in the current code and will be fixed in a future change. Reviewed by: gallatin MFC after: 1 month Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19718 Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Thu Mar 28 20:17:14 2019 (r345654) +++ head/sys/net/if_lagg.c Thu Mar 28 20:25:36 2019 (r345655) @@ -751,7 +751,6 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * * is predictable and `ifconfig laggN create ...` command * will lead to the same result each time. */ - LAGG_RLOCK(); CK_SLIST_FOREACH(tlp, &sc->sc_ports, lp_entries) { if (tlp->lp_ifp->if_index < ifp->if_index && ( CK_SLIST_NEXT(tlp, lp_entries) == NULL || @@ -759,7 +758,6 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * ifp->if_index)) break; } - LAGG_RUNLOCK(); if (tlp != NULL) CK_SLIST_INSERT_AFTER(tlp, lp, lp_entries); else @@ -1537,14 +1535,17 @@ lagg_snd_tag_alloc(struct ifnet *ifp, struct lagg_lb *lb; uint32_t p; + LAGG_RLOCK(); switch (sc->sc_proto) { case LAGG_PROTO_FAILOVER: lp = lagg_link_active(sc, sc->sc_primary); break; case LAGG_PROTO_LOADBALANCE: if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) == 0 || - params->hdr.flowtype == M_HASHTYPE_NONE) + params->hdr.flowtype == M_HASHTYPE_NONE) { + LAGG_RUNLOCK(); return (EOPNOTSUPP); + } p = params->hdr.flowid >> sc->flowid_shift; p %= sc->sc_count; lb = (struct lagg_lb *)sc->sc_psc; @@ -1553,16 +1554,22 @@ lagg_snd_tag_alloc(struct ifnet *ifp, break; case LAGG_PROTO_LACP: if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) == 0 || - params->hdr.flowtype == M_HASHTYPE_NONE) + params->hdr.flowtype == M_HASHTYPE_NONE) { + LAGG_RUNLOCK(); return (EOPNOTSUPP); + } lp = lacp_select_tx_port_by_hash(sc, params->hdr.flowid); break; default: + LAGG_RUNLOCK(); return (EOPNOTSUPP); } - if (lp == NULL) + if (lp == NULL) { + LAGG_RUNLOCK(); return (EOPNOTSUPP); + } ifp = lp->lp_ifp; + LAGG_RUNLOCK(); if (ifp == NULL || ifp->if_snd_tag_alloc == NULL || (ifp->if_capenable & IFCAP_TXRTLMT) == 0) return (EOPNOTSUPP); @@ -1853,12 +1860,18 @@ struct lagg_port * lagg_link_active(struct lagg_softc *sc, struct lagg_port *lp) { struct lagg_port *lp_next, *rval = NULL; - struct epoch_tracker net_et; /* * Search a port which reports an active link state. */ + /* + * This is called with either LAGG_RLOCK() held or + * LAGG_XLOCK(sc) held. + */ + if (!in_epoch(net_epoch_preempt)) + LAGG_XLOCK_ASSERT(sc); + if (lp == NULL) goto search; if (LAGG_PORTACTIVE(lp)) { @@ -1871,15 +1884,12 @@ lagg_link_active(struct lagg_softc *sc, struct lagg_po goto found; } - search: - epoch_enter_preempt(net_epoch_preempt, &net_et); +search: CK_SLIST_FOREACH(lp_next, &sc->sc_ports, lp_entries) { if (LAGG_PORTACTIVE(lp_next)) { - epoch_exit_preempt(net_epoch_preempt, &net_et); return (lp_next); } } - epoch_exit_preempt(net_epoch_preempt, &net_et); found: return (rval); } @@ -1961,7 +1971,7 @@ lagg_bcast_start(struct lagg_softc *sc, struct mbuf *m struct lagg_port *lp, *last = NULL; struct mbuf *m0; - LAGG_RLOCK(); + LAGG_RLOCK_ASSERT(); CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { if (!LAGG_PORTACTIVE(lp)) continue; @@ -1982,7 +1992,6 @@ lagg_bcast_start(struct lagg_softc *sc, struct mbuf *m } last = lp; } - LAGG_RUNLOCK(); if (last == NULL) { m_freem(m); @@ -2095,7 +2104,7 @@ lagg_lb_porttable(struct lagg_softc *sc, struct lagg_p rv = 0; bzero(&lb->lb_ports, sizeof(lb->lb_ports)); - LAGG_RLOCK(); + LAGG_XLOCK_ASSERT(sc); CK_SLIST_FOREACH(lp_next, &sc->sc_ports, lp_entries) { if (lp_next == lp) continue; @@ -2108,7 +2117,6 @@ lagg_lb_porttable(struct lagg_softc *sc, struct lagg_p sc->sc_ifname, lp_next->lp_ifp->if_xname, i); lb->lb_ports[i++] = lp_next; } - LAGG_RUNLOCK(); return (rv); } From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE633DBF8F; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yl1DMlz4NvK; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 6A9E419CB4; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D64951F698; Fri, 29 Mar 2019 02:44:24 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3ADFC7193A; Fri, 29 Mar 2019 02:44:24 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1C38C1F65B; Fri, 29 Mar 2019 02:44:24 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 61B8E1F659 for ; Fri, 29 Mar 2019 02:44:21 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2ADEA71931; Fri, 29 Mar 2019 02:44:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05445286E2; Fri, 29 Mar 2019 02:44:21 +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 x2T2iKCT074489; Fri, 29 Mar 2019 02:44:20 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2T2iKng074486; Fri, 29 Mar 2019 02:44:20 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201903290244.x2T2iKng074486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345677 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 345677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3ADFC7193A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:56 -0000 X-Original-Date: Fri, 29 Mar 2019 02:44:20 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:56 -0000 Author: asomers Date: Fri Mar 29 02:44:20 2019 New Revision: 345677 URL: https://svnweb.freebsd.org/changeset/base/345677 Log: Add man page for VOP_FDATASYNC(9) Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19678 Modified: head/share/man/man9/Makefile head/share/man/man9/VOP_FSYNC.9 Directory Properties: head/ (props changed) Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Mar 29 02:38:30 2019 (r345676) +++ head/share/man/man9/Makefile Fri Mar 29 02:44:20 2019 (r345677) @@ -2233,6 +2233,7 @@ MLINKS+=VOP_ATTRIB.9 VOP_GETATTR.9 \ MLINKS+=VOP_CREATE.9 VOP_MKDIR.9 \ VOP_CREATE.9 VOP_MKNOD.9 \ VOP_CREATE.9 VOP_SYMLINK.9 +MLINKS+=VOP_FSYNC.9 VOP_FDATASYNC.9 MLINKS+=VOP_GETPAGES.9 VOP_PUTPAGES.9 MLINKS+=VOP_INACTIVE.9 VOP_RECLAIM.9 MLINKS+=VOP_LOCK.9 vn_lock.9 \ Modified: head/share/man/man9/VOP_FSYNC.9 ============================================================================== --- head/share/man/man9/VOP_FSYNC.9 Fri Mar 29 02:38:30 2019 (r345676) +++ head/share/man/man9/VOP_FSYNC.9 Fri Mar 29 02:44:20 2019 (r345677) @@ -28,20 +28,27 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd March 22, 2019 .Dt VOP_FSYNC 9 .Os .Sh NAME +.Nm VOP_FDATASYNC , .Nm VOP_FSYNC .Nd flush file system buffers for a file .Sh SYNOPSIS .In sys/param.h .In sys/vnode.h .Ft int +.Fn VOP_FDATASYNC "struct vnode *vp" "struct thread *td" +.Ft int .Fn VOP_FSYNC "struct vnode *vp" "int waitfor" "struct thread *td" .Sh DESCRIPTION -This call flushes any dirty file system buffers for the file. -It is used to implement the +.Fn VOP_FSYNC +ensures that a file can be recovered to its current state following a crash. +That typically requires flushing the file's dirty buffers, its inode, and +possibly other filesystem metadata to persistent media. +.Fn VOP_FSYNC +is used to implement the .Xr sync 2 and .Xr fsync 2 @@ -65,8 +72,20 @@ Push data not written by file system syncer. .It Fa td The calling thread. .El +.Pp +.Fn VOP_FDATASYNC +is similar, but it does not require that all of the file's metadata be flushed. +It only requires that the file's data be recoverable after a crash. +That implies that the data itself must be flushed to disk, as well as some +metadata such as the file's size but not necessarily its attributes. +.Fn VOP_FDATASYNC +should always wait for I/O to complete, as if called with +.Dv MNT_WAIT . +.Fn VOP_FDATASYNC +is used to implement +.Xr fdatasync 2 . .Sh LOCKS -The file should be locked on entry. +The vnode should be exclusively locked on entry, and stays locked on return. .Sh RETURN VALUES Zero is returned if the call is successful, otherwise an appropriate error code is returned. From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4DE0DBF92; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yl2CVVz4NvR; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 7EDAC19CC6; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 63404C8B; Fri, 29 Mar 2019 04:00:51 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4190974F2F; Fri, 29 Mar 2019 04:00:50 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1B98FC2E; Fri, 29 Mar 2019 04:00:50 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 42539C29 for ; Fri, 29 Mar 2019 04:00:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C861174F1D; Fri, 29 Mar 2019 04:00:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89E05293F6; Fri, 29 Mar 2019 04:00:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2T40kCw013213; Fri, 29 Mar 2019 04:00:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2T40kp7013212; Fri, 29 Mar 2019 04:00:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201903290400.x2T40kp7013212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345680 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 345680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 4190974F2F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.92)[-0.919,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:56 -0000 X-Original-Date: Fri, 29 Mar 2019 04:00:46 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:56 -0000 Author: kevans Date: Fri Mar 29 04:00:46 2019 New Revision: 345680 URL: https://svnweb.freebsd.org/changeset/base/345680 Log: NOTES: Use non-default value for BOOT_TAG Reported by: jhb MFC after: 1 week (except non-empty value in stable/11) Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Mar 29 03:25:20 2019 (r345679) +++ head/sys/conf/NOTES Fri Mar 29 04:00:46 2019 (r345680) @@ -150,7 +150,7 @@ options BOOTHOWTO=RB_MULTIPLE # # Default boot tag; may use 'kern.boot_tag' loader tunable to override. The # current boot's tag is also exposed via the 'kern.boot_tag' sysctl. -options BOOT_TAG=\"---<>---\" +options BOOT_TAG=\"\" # Maximum boot tag size the kernel's static buffer should accomodate. Maximum # size for both BOOT_TAG and the assocated tunable. options BOOT_TAG_SZ=32 From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54BC9DC003; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ym5JKqz4NwW; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id E056E19D20; Tue, 3 Sep 2019 14:05:50 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 65C1946CA; Fri, 29 Mar 2019 09:49:07 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C49687A6D; Fri, 29 Mar 2019 09:49:07 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1759246C6; Fri, 29 Mar 2019 09:49:07 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 2A86946C2; Fri, 29 Mar 2019 09:49:04 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D673287A67; Fri, 29 Mar 2019 09:49:03 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id C798346C1; Fri, 29 Mar 2019 09:49:03 +0000 (UTC) From: Alexey Dokuchaev To: Bruce Evans Cc: Ravi Pokala , svn-src-head@freebsd.org, Kyle Evans , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r345680 - head/sys/conf Message-ID: <20190329094903.GA12522@FreeBSD.org> References: <201903290400.x2T40kp7013212@repo.freebsd.org> <20190329164644.X957@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190329164644.X957@besplex.bde.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 2C49687A6D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:57 -0000 X-Original-Date: Fri, 29 Mar 2019 09:49:03 +0000 X-List-Received-Date: Tue, 03 Sep 2019 14:05:57 -0000 On Fri, Mar 29, 2019 at 05:40:05PM +1100, Bruce Evans wrote: > >> ... > >> -options BOOT_TAG=\"---<>---\" > >> +options BOOT_TAG=\"\" > > Useful variations are not always easy to invent. I usually just add 1 for > numeric values. This example is useful. It kills the boot tag. It gives > an empty tag, and the kernel does extra work to avoid printing a newline > after an empty tag. That's a nice idea, thanks Bruce. I always had to revert commits that had added this stupid boot tag; if empty tag does not imply a newline, then it makes things much easier. ./danfe P.S. Boot tag of a healthy human is "Copyright (c) 1992-2018 The FreeBSD Project". From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D3B2DBF0F; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj25XZz4Nsh; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 8444119C32; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 9DAFF17D93; Thu, 28 Mar 2019 18:39:28 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 320378603B; Thu, 28 Mar 2019 18:39:28 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1D98B17D8C; Thu, 28 Mar 2019 18:39:28 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 531DA17D85; Thu, 28 Mar 2019 18:39:25 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05D8C86031; Thu, 28 Mar 2019 18:39:25 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qt1-x829.google.com with SMTP id z17so24279532qts.13; Thu, 28 Mar 2019 11:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to; bh=qxPOAM8d/hFG1bxaM5GGFAnM2XhCC5Q226L0fmw+vBY=; b=csVvcpaQRimr9ER6Dh+0MUCIVl8HrVQcwxQbnaV7fPRRAbSzY66RZBGDLdNguw4BQs 72KJduK9xcFkIFd0U7SRzR2skDXuNLvQg3oHeaJcBUL3VXIVYO2MN1xhISbDmATkuBLu CMTHoaTyL/kC4LblS0VEE6YicCvVHIi8CHeNej68F1b1DafLD2y33GUJBBzy9K0tyzNd 9Sv7y1RkAGtnfl+2CUixkHv90LlGaNp23WpkC0MZx+saR86ru8RrD2JRk6UXNRqdazf9 ggI/V4n03i+S2zSIUWZCBoYBbRXqxv6/Gr9RNCUv5fkIsLbxnSdpYZ02YZ2LzwijlN55 pDxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to; bh=qxPOAM8d/hFG1bxaM5GGFAnM2XhCC5Q226L0fmw+vBY=; b=SIiRkZWEZfVoazADw0vNIcMLPr71C2bhhc7LjZRxzw2n3FlXNNtNvteCAIX/O33Lcf /5dMgynMFyvvaoJ7mq651rKo9dZW8FwmyZuRgdmJg1u13hhCcamd9PxuoItL56quQXKA GJ4LFEBmQHx4vnaPMHds+Z/Mf9cWJXlZ9EE3FaimtoFzJJkRoj43Q7Tg89NzG+mtwLlY EwFjpmK5jbwYEIduYQRoTeEJQK/zHfU7GhdHOmnA3Ue0MFXWuEIoWCuZb4Z3XpNvO/Cd vRVD4a5bdx3vf7jlwhpSpY4izjTRshRbZBtMIdoow0KfjaHOcXvUaMiNLDcfUOPLmiSI vXeA== X-Gm-Message-State: APjAAAUl7vU65NbsJKYJn+Roq2jyJtnPant5GciCy2pu1fJs7kpohi0p 3Y+Gjyz/f83Bfs7ZU2Iz9GyHF4at X-Google-Smtp-Source: APXvYqxc1L1wrzYrDRDKRyZp9ZwRR2/b7uHh+xX34R0eQlM5zCkin8g9RCul6tsnQSh3hrn3HNXZAw== X-Received: by 2002:ac8:3861:: with SMTP id r30mr38195559qtb.122.1553798364346; Thu, 28 Mar 2019 11:39:24 -0700 (PDT) Received: from mbp.home (201-77-127-155.static.desktop.com.br. [201.77.127.155]) by smtp.gmail.com with ESMTPSA id q23sm2757854qkc.16.2019.03.28.11.39.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 11:39:23 -0700 (PDT) Subject: Re: svn commit: r345625 - in head: contrib/elftoolchain/readelf lib/libc lib/libthr libexec/rtld-elf sys/sys To: Peter Jeremy Cc: Oliver Pinter , Ed Maste , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" References: <201903280212.x2S2CXoG000730@repo.freebsd.org> <3d5e5264-bd98-7c57-b849-45affa974e1b@FreeBSD.org> <20190328173104.GA15801@server.rulingia.com> From: Renato Botelho Openpgp: preference=signencrypt Autocrypt: addr=garga@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFn4ZqUBCACxJRWi57JkmsCrSU0gZd/CwB+B90OTUeXmF63lDPETOQ+pBA4+vJgzjW1C pv7rR25wxvESJKphxZJOOk9AXTXsg5QrhdP3+KQG/zNcKd2ukbt3ezkhdMx8q81wn4wY2oTl WXdGIVdDKvC8sCp1fc6pPKJin71/skb9wg6ThtlRFlv9en4f8QSVmRuzRKQ6VjCbl+yIpiye /I5BQ4I99uouPzPhzf9ya3cvp4xbiw5wSo1F3nLsThBT2osYy/nRNz2ciuCYyyX87dGhio0T 8Pxl37eBbGQvCGwPQBApCcfoiZBN/5F65Tt4p72gIqT+AYuqq5G7Bhj+fGTC7q0QotL/ABEB AAG0LFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+iQFXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4BAheAFiEExxiLNMqsn7yXmTy7W54E w5ZrhhoFAln4aeUCGQEACgkQW54Ew5ZrhhpTIwf+OS+Gv/ITOy7+8D+8SKXNmkfczsTO+Uqz 6SraXcq32j1C4QcRQCwGPhVJJgKnFSvPm3kbNPFXaQh1zD+mTQ4r/Loc78Rz+fZljYcgNx7n aQKhd9pdpXaELOe+Y10jvGUrT0SE06Y10BP/NmQaLplt9qG8VgLAAB9ZcsuZ9pzbBbQjd9In OK5VcXQzHT/EBBQ1rHsl1Aq8TYdmjbKl+HKc1c8dJ5OfXrgnTIUwQdN1rauXbmH/YW/CKN7z zF59v/sPBTaWfFl2CS/BORhWhe1PBudrVZWFT0oJGNuG6k8dlnssoL/0ojFaN5w5xm8mvMAf uAuixGf4bK6C7hcE34D/ULkBDQRZ+GalAQgApiTibUM0OpeCcxf5YUep4F4y853ClU4TMqZO +ho38sz0GdshQWuBEBqahOtxapHUMtlmC+wJNCBAav5JYjHHrXXE9pgRm5EgVssDpMvplLB4 5CFdx5jBu02Bt9Wp5bD21TPH3rsYJUB3rYmxWfVmdRhNBERrCJu49OIsBSKAlIinx8altYrh Z7bO2C1hKOG6QHWRr4ml4HTD/gZ6TTfsrR+sktBNv/5ZRkcJNDVM+eOGagXkEUOVFe9KXynD 3KcZBbBKpwoaW5GK8OglKJt8ggUfc78CG1xk4b5nL8QCk0CBrC6VPPOYvXTpYSTHmx1QkElm 1iNu1Tc5ccvcyAwTswARAQABiQE8BBgBCgAmFiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAln4 ZqUCGwwFCQWjmoAACgkQW54Ew5ZrhhoH3wf+KuIeDyvIJOui+0C5FD5r44Bwkj/SAUVUerfp 0qtRktc+BZoSifPs3Rqjh/PpwRvLTuJnSsiqWLz8NCTThogRzVqEcQHqZR3vOjtYM60sjYJ+ BGQl/bjm1C/YtWEEmKs7mJc+02U8qJA4rbNKSRRRoz6XngnuN6YC0fkeD7c7rxRhOg6OWasZ JinB9+dO1IH7eZ5c97v518qSaLRp0T7I+FpEGOp7tTFHaepZWEnuojr5D6jI1MOEywy0EWJu 3m0TYlh935I8o7gLABqoHEmUeW7JK7r91SZaFnr8zQ6XOAxkPh50uFMTNtNZTnM7k1pRv5Ov fms0VzARITYzTwmpDQ== Message-ID: <4d96f74c-ad7d-b202-f801-6d6eccdd0490@FreeBSD.org> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <20190328173104.GA15801@server.rulingia.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0mtd7IKUhRIdqRrjWFgH69e5SSxoI2a5r" Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 320378603B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.974,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:53 -0000 X-Original-Date: Thu, 28 Mar 2019 15:39:18 -0300 X-List-Received-Date: Tue, 03 Sep 2019 14:05:53 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0mtd7IKUhRIdqRrjWFgH69e5SSxoI2a5r Content-Type: multipart/mixed; boundary="5uCatmoJ2X2dNcm3Wer3op1U3rCSOIlxH"; protected-headers="v1" From: Renato Botelho To: Peter Jeremy Cc: Oliver Pinter , Ed Maste , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Message-ID: <4d96f74c-ad7d-b202-f801-6d6eccdd0490@FreeBSD.org> Subject: Re: svn commit: r345625 - in head: contrib/elftoolchain/readelf lib/libc lib/libthr libexec/rtld-elf sys/sys References: <201903280212.x2S2CXoG000730@repo.freebsd.org> <3d5e5264-bd98-7c57-b849-45affa974e1b@FreeBSD.org> <20190328173104.GA15801@server.rulingia.com> In-Reply-To: <20190328173104.GA15801@server.rulingia.com> --5uCatmoJ2X2dNcm3Wer3op1U3rCSOIlxH Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 28/03/19 14:31, Peter Jeremy wrote: > On 2019-Mar-28 09:41:49 -0300, Renato Botelho wrote= : >> On 3/28/19 4:25 AM, Oliver Pinter wrote: >>> On Thursday, March 28, 2019, Ed Maste wrote: >>> >>>> Author: emaste >>>> Date: Thu Mar 28 02:12:32 2019 >>>> New Revision: 345625 >>>> URL: https://svnweb.freebsd.org/changeset/base/345625 >>>> >>> Seems like this and the other hunk belongs to a different patch. >> Indeed. It broke the build for me >=20 > No, r345638 broke the build by only reverting one of the two extraneous= hunks > from this commit. >=20 Yes, you are right. And now it's fixed. --=20 Renato Botelho --5uCatmoJ2X2dNcm3Wer3op1U3rCSOIlxH-- --0mtd7IKUhRIdqRrjWFgH69e5SSxoI2a5r Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAlydFNdfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM3 MTg4QjM0Q0FBQzlGQkM5Nzk5M0NCQjVCOUUwNEMzOTY2Qjg2MUEACgkQW54Ew5Zr hhq9iAf6A23X02N5weOD7+7uipMaQm+ruP9xYmXpM3lR30yR9OAWwNV12hCbVePN pt9jobcBa5D1y66uHi1zRfGdDMfJjOYGsP9JR8xLoOI+eV/Wu9/U8Uj5MxFPI5Nl PxiOQiwds1bF09kKqbyaybiYvg5I8SvL5By7H759P1WZHNg6TjPhCS5yu9jamGDX xrgBGqxjL2uicTKzS76FVjm3u7/AIegoVe8yljEBENEkmp3ZitRFOKjY1ECsk2Em JuM5hHiul++MxtdlhwUHSFaBmXlcuyNz65EhCTXk3NvtSwaHlXwRvWfJhysGqz4P nfc7rXc+eHESz5YlFE3K36W2qrgstw== =VEkR -----END PGP SIGNATURE----- --0mtd7IKUhRIdqRrjWFgH69e5SSxoI2a5r-- From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39660DC048; Tue, 3 Sep 2019 14:05:55 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yp6nTbz4NyL; Tue, 3 Sep 2019 14:05:54 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 3A1DA19D8D; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id B0D7A9883; Fri, 29 Mar 2019 14:01:40 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E7CE92FB9; Fri, 29 Mar 2019 14:01:39 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 2F2839816; Fri, 29 Mar 2019 14:01:39 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 0ACCD9811; Fri, 29 Mar 2019 14:01:36 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [18.222.6.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69B0A92F97; Fri, 29 Mar 2019 14:01:35 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (unknown [18.188.142.31]) by mail.soaustin.net (Postfix) with ESMTPSA id 836A12A79F; Fri, 29 Mar 2019 14:01:34 +0000 (UTC) From: Mark Linimon To: Alexey Dokuchaev Cc: Bruce Evans , svn-src-head@freebsd.org, Kyle Evans , Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r345680 - head/sys/conf Message-ID: <20190329140132.GB15592@lonesome.com> References: <201903290400.x2T40kp7013212@repo.freebsd.org> <20190329164644.X957@besplex.bde.org> <20190329094903.GA12522@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190329094903.GA12522@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 7E7CE92FB9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:58 -0000 X-Original-Date: Fri, 29 Mar 2019 14:01:32 +0000 X-List-Received-Date: Tue, 03 Sep 2019 14:05:58 -0000 On Fri, Mar 29, 2019 at 09:49:03AM +0000, Alexey Dokuchaev wrote: > P.S. Boot tag of a healthy human is "Copyright (c) 1992-2018 The FreeBSD > Project". ITYM 2019. mcl From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 247FEDC06C; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yq4BX3z4P08; Tue, 3 Sep 2019 14:05:55 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 609C819DCF; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id BD8BAB59C; Fri, 29 Mar 2019 14:24:24 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461A29583C; Fri, 29 Mar 2019 14:24:24 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 14534B56F; Fri, 29 Mar 2019 14:24:24 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 05CC2B56B; Fri, 29 Mar 2019 14:24:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD0D595834; Fri, 29 Mar 2019 14:24:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 985C22EFD7; Fri, 29 Mar 2019 14:24:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-ua1-f45.google.com with SMTP id v7so714763uak.13; Fri, 29 Mar 2019 07:24:20 -0700 (PDT) X-Gm-Message-State: APjAAAVdtecki3VpunvAcbTxifx+YUPCkALFr6Yiz+VnQmyRiR4lxcgm xOx2T0v2xTOxWcQcPabCUYoa6M/D/5UvlPYhWH0= X-Google-Smtp-Source: APXvYqwH2mnjNW3IfZz9nnYUt565QJbfGyBz3Rm2k1be3zNr01Tcx7ub5ic2GGDE34JLiMAIODZH5RFSCk75QDk1D2o= X-Received: by 2002:ab0:20c1:: with SMTP id z1mr14734644ual.109.1553869460098; Fri, 29 Mar 2019 07:24:20 -0700 (PDT) MIME-Version: 1.0 References: <201903290534.x2T5Y7v2097332@gndrsh.dnsmgr.net> In-Reply-To: <201903290534.x2T5Y7v2097332@gndrsh.dnsmgr.net> From: Kyle Evans X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r345680 - head/sys/conf To: "Rodney W. Grimes" Cc: Ravi Pokala , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 461A29583C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:58 -0000 X-Original-Date: Fri, 29 Mar 2019 09:24:02 -0500 X-List-Received-Date: Tue, 03 Sep 2019 14:05:58 -0000 On Fri, Mar 29, 2019 at 12:34 AM Rodney W. Grimes wrote: > > > -----Original Message----- > > From: on behalf of Kyle Evans > > Date: 2019-03-28, Thursday at 21:00 > > To: , , > > Subject: svn commit: r345680 - head/sys/conf > > > > > Author: kevans > > > Date: Fri Mar 29 04:00:46 2019 > > > New Revision: 345680 > > > URL: https://svnweb.freebsd.org/changeset/base/345680 > > > > > > Log: > > > NOTES: Use non-default value for BOOT_TAG > > > > Why? > > > > (I was on IRC when jhb debugged this, but I didn't quite get it; and of course lots of us *weren't* on IRC at the time.) > > Yes, please, why is this beeing changed, do I need to revise my .sh that > was hunting for the old string to use what now? Or do I need to now > override this in my KERNCONF files? > > I think changing this in stable/12 is a POLA issue. > > > Thanks, > > > > Ravi (rpokala@) > > > > > Reported by: jhb > > > MFC after: 1 week (except non-empty value in stable/11) > > Why is 11 being treated special, or is it that it does not implement > BOOT_TAG at all? > > Does this deserve a RELNOTES Y, or UPDATING entry? > The short answer to all of this is "No, no, no" -- see Bruce's response about the purpose of NOTES, and the NOTES header itself. It's the kitchen sink, and you can't/won't/don't include the kitchen sink when you need a pipelet. 11 is special because BOOT_TAG was implemented after stable/11 branched. I MFC'd it because I used it on stable/11, but the MFC had to result in a no-op to the msgbuf to not violate POLA. From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9F7FDBF8B; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yl1DKhz4NvJ; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 645B119CB2; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 6753B1F3F2; Fri, 29 Mar 2019 02:38:35 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2971A711BA; Fri, 29 Mar 2019 02:38:35 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1339E1F3F0; Fri, 29 Mar 2019 02:38:35 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 324451F3EB for ; Fri, 29 Mar 2019 02:38:32 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDCE8711AD; Fri, 29 Mar 2019 02:38:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB71428534; Fri, 29 Mar 2019 02:38:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2T2cVke069405; Fri, 29 Mar 2019 02:38:31 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2T2cU3C069400; Fri, 29 Mar 2019 02:38:30 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201903290238.x2T2cU3C069400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345676 - in head/sys/powerpc: aim booke ofw powernv powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim booke ofw powernv powerpc X-SVN-Commit-Revision: 345676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 2971A711BA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:56 -0000 X-Original-Date: Fri, 29 Mar 2019 02:38:30 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:56 -0000 Author: jhibbits Date: Fri Mar 29 02:38:30 2019 New Revision: 345676 URL: https://svnweb.freebsd.org/changeset/base/345676 Log: powerpc64: Use medium code model in asm files for TOC references Summary: With a sufficiently large TOC, it's possible to index out of range, as the immediate load instructions only permit 16-bit indices, allowing up to 64kB range (signed) from the base pointer. Allow +/- 2GB range, with the medium code model TOC accesses in asm. Patch originally by Brandon Bergren. The issue appears to impact ELFv2 more than ELFv1. Reviewed by: luporl Differential Revision: https://reviews.freebsd.org/D19708 Modified: head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/booke/locore.S head/sys/powerpc/ofw/ofwcall64.S head/sys/powerpc/powernv/opalcall.S head/sys/powerpc/powerpc/swtch64.S Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Fri Mar 29 02:13:06 2019 (r345675) +++ head/sys/powerpc/aim/trap_subr64.S Fri Mar 29 02:38:30 2019 (r345676) @@ -345,7 +345,8 @@ CNAME(rstcodeend): cpu_reset_handler: GET_TOCBASE(%r2) - ld %r1,TOC_REF(tmpstk)(%r2) /* get new SP */ + addis %r1,%r2,TOC_REF(tmpstk)@ha + ld %r1,TOC_REF(tmpstk)@l(%r1) /* get new SP */ addi %r1,%r1,(TMPSTKSZ-48) bl CNAME(cpudep_ap_early_bootstrap) /* Set PCPU */ @@ -380,7 +381,8 @@ cpu_wakeup_handler: GET_TOCBASE(%r2) /* Check for false wake up due to badly SRR1 set (eg. by OPAL) */ - ld %r3,TOC_REF(can_wakeup)(%r2) + addis %r3,%r2,TOC_REF(can_wakeup)@ha + ld %r3,TOC_REF(can_wakeup)@l(%r3) ld %r3,0(%r3) cmpdi %r3,0 beq cpu_reset_handler @@ -897,7 +899,8 @@ dbtrap: mtsprg3 %r1 GET_TOCBASE(%r1) /* get new SP */ - ld %r1,TOC_REF(trapstk)(%r1) + addis %r1,%r1,TOC_REF(trapstk)@ha + ld %r1,TOC_REF(trapstk)@l(%r1) addi %r1,%r1,(TRAPSTKSZ-48) FRAME_SETUP(PC_DBSAVE) Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Fri Mar 29 02:13:06 2019 (r345675) +++ head/sys/powerpc/booke/locore.S Fri Mar 29 02:38:30 2019 (r345676) @@ -303,7 +303,8 @@ done_mapping: subf %r31,%r31,%r2 /* Subtract from real TOC base to get base */ /* Set up the stack pointer */ - ld %r1,TOC_REF(tmpstack)(%r2) + addis %r1,%r2,TOC_REF(tmpstack)@ha + ld %r1,TOC_REF(tmpstack)@l(%r1) addi %r1,%r1,TMPSTACKSZ-96 add %r1,%r1,%r31 bl 1f @@ -552,7 +553,8 @@ bp_kernload: mtspr SPR_SPRG8, %r2 /* Set up the stack pointer */ - ld %r1,TOC_REF(tmpstack)(%r2) + addis %r1,%r2,TOC_REF(tmpstack)@ha + ld %r1,TOC_REF(tmpstack)@l(%r1) addi %r1,%r1,TMPSTACKSZ-96 #else /* Modified: head/sys/powerpc/ofw/ofwcall64.S ============================================================================== --- head/sys/powerpc/ofw/ofwcall64.S Fri Mar 29 02:13:06 2019 (r345675) +++ head/sys/powerpc/ofw/ofwcall64.S Fri Mar 29 02:38:30 2019 (r345676) @@ -101,11 +101,13 @@ ASENTRY_NOPROF(ofwcall) mfmsr %r6 /* read client interface handler */ - ld %r4,TOC_REF(openfirmware_entry)(%r2) + addis %r4,%r2,TOC_REF(openfirmware_entry)@ha + ld %r4,TOC_REF(openfirmware_entry)@l(%r4) ld %r4,0(%r4) /* Get OF stack pointer */ - ld %r7,TOC_REF(ofwstk)(%r2) + addis %r7,%r2,TOC_REF(ofwstk)@ha + ld %r7,TOC_REF(ofwstk)@l(%r7) addi %r7,%r7,OFWSTKSZ-40 /* @@ -113,7 +115,8 @@ ASENTRY_NOPROF(ofwcall) * exceptions, which is important for the next few steps. */ - ld %r5,TOC_REF(ofmsr)(%r2) + addis %r5,%r2,TOC_REF(ofmsr)@ha + ld %r5,TOC_REF(ofmsr)@l(%r5) ld %r5,0(%r5) mtmsrd %r5 isync @@ -233,16 +236,19 @@ ASENTRY_NOPROF(rtascall) mfmsr %r6 /* Read RTAS entry and reg save area pointers */ - ld %r5,TOC_REF(rtas_entry)(%r2) + addis %r5,%r2,TOC_REF(rtas_entry)@ha + ld %r5,TOC_REF(rtas_entry)@l(%r5) ld %r5,0(%r5) - ld %r8,TOC_REF(rtas_regsave)(%r2) + addis %r8,%r2,TOC_REF(rtas_regsave)@ha + ld %r8,TOC_REF(rtas_regsave)@l(%r8) /* * Set the MSR to the RTAS value. This has the side effect of disabling * exceptions, which is important for the next few steps. */ - ld %r7,TOC_REF(rtasmsr)(%r2) + addis %r7,%r2,TOC_REF(rtasmsr)@ha + ld %r7,TOC_REF(rtasmsr)@l(%r7) ld %r7,0(%r7) mtmsrd %r7 isync Modified: head/sys/powerpc/powernv/opalcall.S ============================================================================== --- head/sys/powerpc/powernv/opalcall.S Fri Mar 29 02:13:06 2019 (r345675) +++ head/sys/powerpc/powernv/opalcall.S Fri Mar 29 02:38:30 2019 (r345676) @@ -53,7 +53,8 @@ ASENTRY(opal_call) /* Load OPAL entry information */ mr %r0,%r3 - ld %r3,TOC_REF(opal_entrypoint)(%r2) + addis %r3,%r2,TOC_REF(opal_entrypoint)@ha + ld %r3,TOC_REF(opal_entrypoint)@l(%r3) ld %r3,0(%r3) mtctr %r3 @@ -62,9 +63,11 @@ ASENTRY(opal_call) mfmsr %r31 /* Load last bits from the TOC */ - ld %r3,TOC_REF(opal_msr)(%r2) + addis %r3,%r2,TOC_REF(opal_msr)@ha + ld %r3,TOC_REF(opal_msr)@l(%r3) ld %r3,0(%r3) - ld %r2,TOC_REF(opal_data)(%r2) + addis %r2,%r2,TOC_REF(opal_data)@ha + ld %r2,TOC_REF(opal_data)@l(%r2) ld %r2,0(%r2) mtmsrd %r3 Modified: head/sys/powerpc/powerpc/swtch64.S ============================================================================== --- head/sys/powerpc/powerpc/swtch64.S Fri Mar 29 02:13:06 2019 (r345675) +++ head/sys/powerpc/powerpc/swtch64.S Fri Mar 29 02:38:30 2019 (r345676) @@ -159,7 +159,8 @@ ENTRY(cpu_switch) cpu_switchin: #if defined(SMP) && defined(SCHED_ULE) /* Wait for the new thread to become unblocked */ - ld %r6,TOC_REF(blocked_lock)(%r2) + addis %r6,%r2,TOC_REF(blocked_lock)@ha + ld %r6,TOC_REF(blocked_lock)@l(%r6) blocked_loop: ld %r7,TD_LOCK(%r13) cmpd %r6,%r7 From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC4B3DBF12; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj293Gz4Nsr; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 75F0319C2C; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E1E7C176CD; Thu, 28 Mar 2019 18:14:38 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56F3F851F9; Thu, 28 Mar 2019 18:14:38 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1DC901767C; Thu, 28 Mar 2019 18:14:38 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 3304B17678 for ; Thu, 28 Mar 2019 18:14:35 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E538F851F0 for ; Thu, 28 Mar 2019 18:14:34 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb1-xb32.google.com with SMTP id a84so449544ybg.10 for ; Thu, 28 Mar 2019 11:14:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UpiXufOAltpWs7khtnuiOy6D/TvH0afQ+8zIZFpCbbQ=; b=JDjzqvIIIxw/yvlRzS7Kl4HasCfgBCEwDcEupfIYTSz/8OtEjz+iOW+HtDZktpJNFE Z+0Wf0KRA99nngZTqbyA/nUoUI2DYDdD1eURzsDeq3w/pKHxAUu5ZcQ0pZogxoXdwJon uJnlEId6e8tclO3/Qjkz2KKwDRALO9NeCug3HTpRM/E4GIk6vlbHin7X17ZNjkVHeY2P 7TJVm4k5wBhA0yuxmS2ZNZBhbIIWC/tu+tbcexeZuNzYa8AVqcTnTGqHASMHDrgA31lP KDHc0EpLixu33c/I0ac3mTlgxWWyfss38kqgeZpKlm8cbgAqsDyAgURIOXUslI2bcblv GEfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UpiXufOAltpWs7khtnuiOy6D/TvH0afQ+8zIZFpCbbQ=; b=X8EN3J4rDpOC3YkQ6hKHrM6Gfuvjnkr5em+09+DbDzreGUbAEjbLbevqqDX8M8Ocw/ hGJ6t8yUgcuLFGczgEF3XD+hFBHZFP0fu5HgsnohWd58t2HocqUE0MfqTJQq2wqW8nWc 36A8QLFFL38k0TlwG6usOHrKBHzMF/G2naho7ZPXVmxm3YWmeQ1tmSNPBUOcxH7JPBzj gYn9ibksBXxAF5YmrImHALZD6U1ucIIlndi+mwMbgaMyHdyYtOWSKWA9AX0S0oeaaiYl OjJuz0VIE13rhRBJo46viZsqDSLJMAAGr2AvtLUTAwChX+406gEteigSItcNvGeBO9ve fX5Q== X-Gm-Message-State: APjAAAW6iq52s0cQgHrcIvigLhnB4ekmlPSkEj/FBVUX5noGGkuVoC8A DdMxgwSWpiHewEcvC8ELDHuTrp2bZLV2lIunItG2TA== X-Google-Smtp-Source: APXvYqwNi620y1K6JYvpUWQHu1RPqyfmAWqVD27jR7+wy/Kqr9oB8QILGN3G0EXDc+dXYyTxWKD3nSOfRcfJO3Vr7lw= X-Received: by 2002:a25:ac5e:: with SMTP id r30mr36486600ybd.208.1553796874225; Thu, 28 Mar 2019 11:14:34 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:1688:0:0:0:0:0 with HTTP; Thu, 28 Mar 2019 11:14:33 -0700 (PDT) In-Reply-To: <201903281205.x2SC5VpX057818@slippy.cwsent.com> References: <201903281056.x2SAuR5E070924@repo.freebsd.org> <201903281205.x2SC5VpX057818@slippy.cwsent.com> From: Oliver Pinter Message-ID: Subject: Re: svn commit: r345638 - head/sys/sys To: Cy Schubert Cc: Ed Maste , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 56F3F851F9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:53 -0000 X-Original-Date: Thu, 28 Mar 2019 19:14:33 +0100 X-List-Received-Date: Tue, 03 Sep 2019 14:05:53 -0000 On Thursday, March 28, 2019, Cy Schubert wrote: > In message <201903281056.x2SAuR5E070924@repo.freebsd.org>, Ed Maste > writes: > > Author: emaste > > Date: Thu Mar 28 10:56:27 2019 > > New Revision: 345638 > > URL: https://svnweb.freebsd.org/changeset/base/345638 > > > > Log: > > Revert change accidentally committed along with r345625 > > > > Reported by: Oliver Pinter > > > > Modified: > > head/sys/sys/elf_common.h > > > > Modified: head/sys/sys/elf_common.h > > ============================================================ > ================= > > = > > --- head/sys/sys/elf_common.h Thu Mar 28 09:51:37 2019 (r345637) > > +++ head/sys/sys/elf_common.h Thu Mar 28 10:56:27 2019 (r345638) > > @@ -763,8 +763,7 @@ typedef struct { > > #define NT_FREEBSD_FEATURE_CTL 4 > > > > /* NT_FREEBSD_FEATURE_CTL desc[0] bits */ > > -#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 > > -#define NT_FREEBSD_FCTL_IMPLIED_MAX_PROT 0x00000002 > > +#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 > > --- readelf.o --- > /opt/src/svn-current/contrib/elftoolchain/readelf/readelf.c:3493:4: > error: use of undeclared identifier 'NT_FREEBSD_FCTL_IMPLIED_MAX_PROT' > { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" }, > ^ > 1 error generated. > *** [readelf.o] Error code 1 > > Sure, the "the other hunk" missing from this revert, but it is fixed now by a different commit. > > > > /* Values for n_type. Used in core files. */ > > #define NT_PRSTATUS 1 /* Process status. */ > > > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD21EDBFD5; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ym0MHxz4Nvv; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 273EA19CEE; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5E307382F; Fri, 29 Mar 2019 08:43:25 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CA56856AF; Fri, 29 Mar 2019 08:43:25 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 18F2E382E; Fri, 29 Mar 2019 08:43:25 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C96703829 for ; Fri, 29 Mar 2019 08:43:22 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90FEE856AC; Fri, 29 Mar 2019 08:43:22 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65C8B2C54A; Fri, 29 Mar 2019 08:43:22 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2T8hMZ0062576; Fri, 29 Mar 2019 08:43:22 GMT (envelope-from olivier@FreeBSD.org) Received: (from olivier@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2T8hLdD062574; Fri, 29 Mar 2019 08:43:21 GMT (envelope-from olivier@FreeBSD.org) Message-Id: <201903290843.x2T8hLdD062574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: olivier set sender to olivier@FreeBSD.org using -f From: Olivier Cochard To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345681 - head/tests/sys/capsicum X-SVN-Group: head X-SVN-Commit-Author: olivier X-SVN-Commit-Paths: head/tests/sys/capsicum X-SVN-Commit-Revision: 345681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 2CA56856AF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.93)[-0.926,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:57 -0000 X-Original-Date: Fri, 29 Mar 2019 08:43:21 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:57 -0000 Author: olivier (ports committer) Date: Fri Mar 29 08:43:21 2019 New Revision: 345681 URL: https://svnweb.freebsd.org/changeset/base/345681 Log: Skip test if feature security_capabilities is not available PR: 236863 Approved by: asomers MFC after: 1 month Sponsored by: Netflix Modified: head/tests/sys/capsicum/Makefile head/tests/sys/capsicum/ioctls_test.c Modified: head/tests/sys/capsicum/Makefile ============================================================================== --- head/tests/sys/capsicum/Makefile Fri Mar 29 04:00:46 2019 (r345680) +++ head/tests/sys/capsicum/Makefile Fri Mar 29 08:43:21 2019 (r345681) @@ -5,7 +5,7 @@ TESTSDIR= ${TESTSBASE}/sys/capsicum ATF_TESTS_C+= bindat_connectat ATF_TESTS_C+= ioctls_test -CFLAGS.bindat_connectat.c+= -I${SRCTOP}/tests +CFLAGS+= -I${SRCTOP}/tests WARNS?= 6 Modified: head/tests/sys/capsicum/ioctls_test.c ============================================================================== --- head/tests/sys/capsicum/ioctls_test.c Fri Mar 29 04:00:46 2019 (r345680) +++ head/tests/sys/capsicum/ioctls_test.c Fri Mar 29 08:43:21 2019 (r345681) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include +#include "freebsd_test_suite/macros.h" + /* * A variant of ATF_REQUIRE that is suitable for use in child * processes. This only works if the parent process is tripped up by @@ -72,6 +74,8 @@ ATF_TC_BODY(cap_ioctls__listen_copy, tc) pid_t pid; char dummy; int s[2], status; + + ATF_REQUIRE_FEATURE("security_capabilities"); s[0] = socket(AF_INET, SOCK_STREAM, 0); ATF_REQUIRE(s[0] > 0); From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF30EDBF14; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj2N4kz4Nsw; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 9090E19C3E; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 602F6185E1; Thu, 28 Mar 2019 19:24:31 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25E69877EB; Thu, 28 Mar 2019 19:24:31 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1276D185E0; Thu, 28 Mar 2019 19:24:31 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D7B9E185DD; Thu, 28 Mar 2019 19:24:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AA7FC877E7; Thu, 28 Mar 2019 19:24:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 9adRhjW6GGusj9adThBmpc; Thu, 28 Mar 2019 13:24:24 -0600 X-Authority-Analysis: v=2.3 cv=fOdHIqSe c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=NTGMnVQrEZIA:10 a=xfDLHkLGAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=ypVJL4-jAAAA:8 a=GhzeE7abcD5Tj7NLkbsA:9 a=CjuIK1q_8ugA:10 a=UJ0tAi3fqDAA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=khIbc0fXALFIcTpOSxgJ:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 06D3A42C; Thu, 28 Mar 2019 12:24:20 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x2SJOHWc042232; Thu, 28 Mar 2019 12:24:17 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x2SJOFiJ042178; Thu, 28 Mar 2019 12:24:16 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201903281924.x2SJOFiJ042178@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Oliver Pinter cc: Cy Schubert , Ed Maste , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r345638 - head/sys/sys In-Reply-To: Message from Oliver Pinter of "Thu, 28 Mar 2019 19:14:33 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-CMAE-Envelope: MS4wfO3M0w98jj/fThFxAO39ynHwNWueBgA6I1HyE10VVPJBakUvo0kr7fuo7ZZKCNZxF8ycgFFpshKnsE5JzTAVhMYXtSA6MSNafcEKM5RGaFq9G42X9ANa AYYSTD47rNKIy9uwSNVHcabwKFuSlhUFqUysNq69mRwB5At0vnK1u62hg+GBpDBMTGyKyreKIxhwqAVQEGu5L0XkvBE9PKbMPZDJot1QGTjXy7WBJBYKlS2D GwOnliZnvVXcKZ2SBmJZngVIYGWHEKxsqydlItLaSLEthI/zJUxt10Np6wfi9kgRKCb0lw4pNC4LwP0ZstLTCmE0SkP9CFI5u5/qH4gdjaY= Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 25E69877EB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:53 -0000 X-Original-Date: Thu, 28 Mar 2019 12:24:15 -0700 X-List-Received-Date: Tue, 03 Sep 2019 14:05:53 -0000 In message , Oliver Pinter writes: > --000000000000bdde9105852b868a > Content-Type: text/plain; charset="UTF-8" > > On Thursday, March 28, 2019, Cy Schubert wrote: > > > In message <201903281056.x2SAuR5E070924@repo.freebsd.org>, Ed Maste > > writes: > > > Author: emaste > > > Date: Thu Mar 28 10:56:27 2019 > > > New Revision: 345638 > > > URL: https://svnweb.freebsd.org/changeset/base/345638 > > > > > > Log: > > > Revert change accidentally committed along with r345625 > > > > > > Reported by: Oliver Pinter > > > > > > Modified: > > > head/sys/sys/elf_common.h > > > > > > Modified: head/sys/sys/elf_common.h > > > ============================================================ > > ================= > > > = > > > --- head/sys/sys/elf_common.h Thu Mar 28 09:51:37 2019 (r345637) > > > +++ head/sys/sys/elf_common.h Thu Mar 28 10:56:27 2019 (r345638) > > > @@ -763,8 +763,7 @@ typedef struct { > > > #define NT_FREEBSD_FEATURE_CTL 4 > > > > > > /* NT_FREEBSD_FEATURE_CTL desc[0] bits */ > > > -#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 > > > -#define NT_FREEBSD_FCTL_IMPLIED_MAX_PROT 0x00000002 > > > +#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 > > > > --- readelf.o --- > > /opt/src/svn-current/contrib/elftoolchain/readelf/readelf.c:3493:4: > > error: use of undeclared identifier 'NT_FREEBSD_FCTL_IMPLIED_MAX_PROT' > > { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" }, > > ^ > > 1 error generated. > > *** [readelf.o] Error code 1 > > > > > Sure, the "the other hunk" missing from this revert, but it is fixed now by > a different commit. Yes, email race condition. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 292CCDBF67; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yk50zjz4Ntt; Tue, 3 Sep 2019 14:05:50 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 038E119C90; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id EDE211B536; Thu, 28 Mar 2019 21:43:05 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3EB0A8D9A2; Thu, 28 Mar 2019 21:43:05 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 109231B4EA; Thu, 28 Mar 2019 21:43:05 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 1B14B1B4E8 for ; Thu, 28 Mar 2019 21:43:02 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C67C38D99C; Thu, 28 Mar 2019 21:43:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7A2825374; Thu, 28 Mar 2019 21:43:01 +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 x2SLh1tx016525; Thu, 28 Mar 2019 21:43:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SLh1Ll016523; Thu, 28 Mar 2019 21:43:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201903282143.x2SLh1Ll016523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345661 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 345661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3EB0A8D9A2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:55 -0000 X-Original-Date: Thu, 28 Mar 2019 21:43:01 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:55 -0000 Author: trasz Date: Thu Mar 28 21:43:01 2019 New Revision: 345661 URL: https://svnweb.freebsd.org/changeset/base/345661 Log: Factor out retrieving the interpreter path from the main ELF loader routine. Reviewed by: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19715 Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Thu Mar 28 21:22:28 2019 (r345660) +++ head/sys/kern/imgact_elf.c Thu Mar 28 21:43:01 2019 (r345661) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); static int __elfN(check_header)(const Elf_Ehdr *hdr); static Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp, - const char *interp, int interp_name_len, int32_t *osrel, uint32_t *fctl0); + const char *interp, int32_t *osrel, uint32_t *fctl0); static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr, u_long *entry); static int __elfN(load_section)(struct image_params *imgp, vm_ooffset_t offset, @@ -272,13 +272,15 @@ __elfN(brand_inuse)(Elf_Brandinfo *entry) static Elf_Brandinfo * __elfN(get_brandinfo)(struct image_params *imgp, const char *interp, - int interp_name_len, int32_t *osrel, uint32_t *fctl0) + int32_t *osrel, uint32_t *fctl0) { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; Elf_Brandinfo *bi, *bi_m; boolean_t ret; - int i; + int i, interp_name_len; + interp_name_len = interp != NULL ? strlen(interp) : 0; + /* * We support four types of branding -- (1) the ELF EI_OSABI field * that SCO added to the ELF spec, (2) FreeBSD 3.x's traditional string @@ -889,6 +891,60 @@ __elfN(enforce_limits)(struct image_params *imgp, cons return (0); } +static int +__elfN(get_interp)(struct image_params *imgp, const Elf_Phdr *phdr, + char **interpp, bool *free_interpp) +{ + struct thread *td; + char *interp; + int error, interp_name_len; + + KASSERT(phdr->p_type == PT_INTERP, + ("%s: p_type %u != PT_INTERP", __func__, phdr->p_type)); + KASSERT(VOP_ISLOCKED(imgp->vp), + ("%s: vp %p is not locked", __func__, imgp->vp)); + + td = curthread; + + /* Path to interpreter */ + if (phdr->p_filesz < 2 || phdr->p_filesz > MAXPATHLEN) { + uprintf("Invalid PT_INTERP\n"); + return (ENOEXEC); + } + + interp_name_len = phdr->p_filesz; + if (phdr->p_offset > PAGE_SIZE || + interp_name_len > PAGE_SIZE - phdr->p_offset) { + VOP_UNLOCK(imgp->vp, 0); + interp = malloc(interp_name_len + 1, M_TEMP, M_WAITOK); + vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + error = vn_rdwr(UIO_READ, imgp->vp, interp, + interp_name_len, phdr->p_offset, + UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, + NOCRED, NULL, td); + if (error != 0) { + free(interp, M_TEMP); + uprintf("i/o error PT_INTERP %d\n", error); + return (error); + } + interp[interp_name_len] = '\0'; + + *interpp = interp; + *free_interpp = true; + return (0); + } + + interp = __DECONST(char *, imgp->image_header) + phdr->p_offset; + if (interp[interp_name_len - 1] != '\0') { + uprintf("Invalid PT_INTERP\n"); + return (ENOEXEC); + } + + *interpp = interp; + *free_interpp = false; + return (0); +} + /* * Impossible et_dyn_addr initial value indicating that the real base * must be calculated later with some randomization applied. @@ -905,7 +961,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i struct vmspace *vmspace; vm_map_t map; const char *newinterp; - char *interp, *interp_buf, *path; + char *interp, *path; Elf_Brandinfo *brand_info; struct sysentvec *sv; vm_prot_t prot; @@ -913,7 +969,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i u_long maxalign, mapsz, maxv, maxv1; uint32_t fctl0; int32_t osrel; - int error, i, n, interp_name_len, have_interp; + bool free_interp; + int error, i, n, have_interp; hdr = (const Elf_Ehdr *)imgp->image_header; @@ -949,9 +1006,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i osrel = 0; fctl0 = 0; entry = proghdr = 0; - interp_name_len = 0; - newinterp = NULL; - interp = interp_buf = NULL; + newinterp = interp = NULL; + free_interp = false; td = curthread; maxalign = PAGE_SIZE; mapsz = 0; @@ -968,44 +1024,15 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i break; case PT_INTERP: /* Path to interpreter */ - if (phdr[i].p_filesz < 2 || - phdr[i].p_filesz > MAXPATHLEN) { - uprintf("Invalid PT_INTERP\n"); - error = ENOEXEC; - goto ret; - } if (interp != NULL) { uprintf("Multiple PT_INTERP headers\n"); error = ENOEXEC; goto ret; } - interp_name_len = phdr[i].p_filesz; - if (phdr[i].p_offset > PAGE_SIZE || - interp_name_len > PAGE_SIZE - phdr[i].p_offset) { - VOP_UNLOCK(imgp->vp, 0); - interp_buf = malloc(interp_name_len + 1, M_TEMP, - M_WAITOK); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); - error = vn_rdwr(UIO_READ, imgp->vp, interp_buf, - interp_name_len, phdr[i].p_offset, - UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, - NOCRED, NULL, td); - if (error != 0) { - uprintf("i/o error PT_INTERP %d\n", - error); - goto ret; - } - interp_buf[interp_name_len] = '\0'; - interp = interp_buf; - } else { - interp = __DECONST(char *, imgp->image_header) + - phdr[i].p_offset; - if (interp[interp_name_len - 1] != '\0') { - uprintf("Invalid PT_INTERP\n"); - error = ENOEXEC; - goto ret; - } - } + error = __elfN(get_interp)(imgp, &phdr[i], &interp, + &free_interp); + if (error != 0) + goto ret; break; case PT_GNU_STACK: if (__elfN(nxstack)) @@ -1016,8 +1043,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i } } - brand_info = __elfN(get_brandinfo)(imgp, interp, interp_name_len, - &osrel, &fctl0); + brand_info = __elfN(get_brandinfo)(imgp, interp, &osrel, &fctl0); if (brand_info == NULL) { uprintf("ELF binary type \"%u\" not known.\n", hdr->e_ident[EI_OSABI]); @@ -1238,7 +1264,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i imgp->proc->p_elf_flags = hdr->e_flags; ret: - free(interp_buf, M_TEMP); + if (free_interp) + free(interp, M_TEMP); return (error); } From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B410DDBF16; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj39kHz4Nt0; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 9929219C45; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 047501874E; Thu, 28 Mar 2019 19:25:28 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3169A87980; Thu, 28 Mar 2019 19:25:27 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1A27D18719; Thu, 28 Mar 2019 19:25:27 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5169C18716; Thu, 28 Mar 2019 19:25:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E4AE87979; Thu, 28 Mar 2019 19:25:23 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id 9aeHh0p7qLdsa9aeJh9jxS; Thu, 28 Mar 2019 13:25:15 -0600 X-Authority-Analysis: v=2.3 cv=G9Zi7Os5 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=NTGMnVQrEZIA:10 a=xfDLHkLGAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=ypVJL4-jAAAA:8 a=MrSD9qDa5H69bE4etmoA:9 a=CjuIK1q_8ugA:10 a=UJ0tAi3fqDAA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=khIbc0fXALFIcTpOSxgJ:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 76CC343F; Thu, 28 Mar 2019 12:25:13 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x2SJPCnN043698; Thu, 28 Mar 2019 12:25:12 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x2SJPCxU043691; Thu, 28 Mar 2019 12:25:12 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201903281925.x2SJPCxU043691@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Oliver Pinter cc: Cy Schubert , Ed Maste , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r345638 - head/sys/sys In-Reply-To: Message from Oliver Pinter of "Thu, 28 Mar 2019 19:14:33 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-CMAE-Envelope: MS4wfMzX/58EfW0MpkEd5EqPwZpim+gYhP4OLTvp/tkR57dCN+lkj5aMAQungejO2WminA4lA+JRiPUZ/rws6uvAt4hetahHX7P6IcpZhou5cRkwfDnID+El rAcd4saHEQPceB9h247npV9yxLFw8yAltkQdg3+m20VstvFsQfq/+0Hw0cXdmatXN5ZwN+kbnEs4Mj9TQzE08J8ADk7wxblqQ+1M7O51QywRVzH6m0YVicRj hqKsj+EzNxRU6mD1PUmWCBsB3BvkNief26rjzhkkA3MEGq/W2PdK3pxkZKsztZ+AabFtRYfWkVkbXgxX+GF1stqWDvbYZ55q6foFaafFl3o= Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3169A87980 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:54 -0000 X-Original-Date: Thu, 28 Mar 2019 12:25:12 -0700 X-List-Received-Date: Tue, 03 Sep 2019 14:05:54 -0000 In message , Oliver Pinter writes: > --000000000000bdde9105852b868a > Content-Type: text/plain; charset="UTF-8" > > On Thursday, March 28, 2019, Cy Schubert wrote: > > > In message <201903281056.x2SAuR5E070924@repo.freebsd.org>, Ed Maste > > writes: > > > Author: emaste > > > Date: Thu Mar 28 10:56:27 2019 > > > New Revision: 345638 > > > URL: https://svnweb.freebsd.org/changeset/base/345638 > > > > > > Log: > > > Revert change accidentally committed along with r345625 > > > > > > Reported by: Oliver Pinter > > > > > > Modified: > > > head/sys/sys/elf_common.h > > > > > > Modified: head/sys/sys/elf_common.h > > > ============================================================ > > ================= > > > = > > > --- head/sys/sys/elf_common.h Thu Mar 28 09:51:37 2019 (r345637) > > > +++ head/sys/sys/elf_common.h Thu Mar 28 10:56:27 2019 (r345638) > > > @@ -763,8 +763,7 @@ typedef struct { > > > #define NT_FREEBSD_FEATURE_CTL 4 > > > > > > /* NT_FREEBSD_FEATURE_CTL desc[0] bits */ > > > -#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 > > > -#define NT_FREEBSD_FCTL_IMPLIED_MAX_PROT 0x00000002 > > > +#define NT_FREEBSD_FCTL_ASLR_DISABLE 0x00000001 > > > > --- readelf.o --- > > /opt/src/svn-current/contrib/elftoolchain/readelf/readelf.c:3493:4: > > error: use of undeclared identifier 'NT_FREEBSD_FCTL_IMPLIED_MAX_PROT' > > { NT_FREEBSD_FCTL_IMPLIED_MAX_PROT, "IMPLIED_MAX_PROT" }, > > ^ > > 1 error generated. > > *** [readelf.o] Error code 1 > > > > > Sure, the "the other hunk" missing from this revert, but it is fixed now by > a different commit. Cursor in the wrong place last reply, making a mess of it. Let's try this again. Email race condition. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5E45DBF49; Tue, 3 Sep 2019 14:05:50 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yj5sXdz4Ntf; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id D8AAA19C77; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E64F71A16B; Thu, 28 Mar 2019 20:41:06 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47C338AEAB; Thu, 28 Mar 2019 20:41:06 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1E37E1A141; Thu, 28 Mar 2019 20:41:06 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id B0EF61A136 for ; Thu, 28 Mar 2019 20:41:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 763FB8AE91; Thu, 28 Mar 2019 20:41:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FE5D246B0; Thu, 28 Mar 2019 20:41:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2SKf3ht083565; Thu, 28 Mar 2019 20:41:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SKf3Iv083564; Thu, 28 Mar 2019 20:41:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201903282041.x2SKf3Iv083564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345656 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 345656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 47C338AEAB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:55 -0000 X-Original-Date: Thu, 28 Mar 2019 20:41:03 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:55 -0000 Author: mav Date: Thu Mar 28 20:41:02 2019 New Revision: 345656 URL: https://svnweb.freebsd.org/changeset/base/345656 Log: Do not map small IOCTL buffers to KVA, but copy. CAM IOCTL interfaces traditionally mapped user-space data buffers to KVA. It was nice originally, but now it takes too much to handle respective TLB shootdowns, while small kernel memory allocations up to 64KB backed by UMA and accompanied by copyin()/copyout() can be much cheaper. For large buffers mapping still may have sense, and unmapped I/O would be even better, but the last unfortunately is more tricky, since unmapped I/O API is too specific to struct bio now. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/cam_periph.c head/sys/cam/cam_periph.h Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Thu Mar 28 20:25:36 2019 (r345655) +++ head/sys/cam/cam_periph.c Thu Mar 28 20:41:02 2019 (r345656) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -104,6 +105,9 @@ TUNABLE_INT("kern.cam.periph_noresrc_delay", &periph_n static int periph_busy_delay = 500; TUNABLE_INT("kern.cam.periph_busy_delay", &periph_busy_delay); +static u_int periph_mapmem_thresh = 65536; +SYSCTL_UINT(_kern_cam, OID_AUTO, mapmem_thresh, CTLFLAG_RWTUN, + &periph_mapmem_thresh, 0, "Threshold for user-space buffer mapping"); void periphdriver_register(void *data) @@ -776,12 +780,12 @@ int cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo, u_int maxmap) { - int numbufs, i, j; - int flags[CAM_PERIPH_MAXMAPS]; + int numbufs, i; u_int8_t **data_ptrs[CAM_PERIPH_MAXMAPS]; u_int32_t lengths[CAM_PERIPH_MAXMAPS]; u_int32_t dirs[CAM_PERIPH_MAXMAPS]; + bzero(mapinfo, sizeof(*mapinfo)); if (maxmap == 0) maxmap = DFLTPHYS; /* traditional default */ else if (maxmap > MAXPHYS) @@ -892,8 +896,6 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma */ for (i = 0; i < numbufs; i++) { - flags[i] = 0; - /* * The userland data pointer passed in may not be page * aligned. vmapbuf() truncates the address to a page @@ -911,15 +913,6 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma (u_long)maxmap); return(E2BIG); } - - if (dirs[i] & CAM_DIR_OUT) { - flags[i] = BIO_WRITE; - } - - if (dirs[i] & CAM_DIR_IN) { - flags[i] = BIO_READ; - } - } /* @@ -933,7 +926,33 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma PHOLD(curproc); for (i = 0; i < numbufs; i++) { + + /* Save the user's data address. */ + mapinfo->orig[i] = *data_ptrs[i]; + /* + * For small buffers use malloc+copyin/copyout instead of + * mapping to KVA to avoid expensive TLB shootdowns. For + * small allocations malloc is backed by UMA, and so much + * cheaper on SMP systems. + */ + if (lengths[i] <= periph_mapmem_thresh && + ccb->ccb_h.func_code != XPT_MMC_IO) { + *data_ptrs[i] = malloc(lengths[i], M_CAMPERIPH, + M_WAITOK); + if (dirs[i] != CAM_DIR_IN) { + if (copyin(mapinfo->orig[i], *data_ptrs[i], + lengths[i]) != 0) { + free(*data_ptrs[i], M_CAMPERIPH); + *data_ptrs[i] = mapinfo->orig[i]; + goto fail; + } + } else + bzero(*data_ptrs[i], lengths[i]); + continue; + } + + /* * Get the buffer. */ mapinfo->bp[i] = uma_zalloc(pbuf_zone, M_WAITOK); @@ -941,14 +960,12 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma /* put our pointer in the data slot */ mapinfo->bp[i]->b_data = *data_ptrs[i]; - /* save the user's data address */ - mapinfo->bp[i]->b_caller1 = *data_ptrs[i]; - /* set the transfer length, we know it's < MAXPHYS */ mapinfo->bp[i]->b_bufsize = lengths[i]; /* set the direction */ - mapinfo->bp[i]->b_iocmd = flags[i]; + mapinfo->bp[i]->b_iocmd = (dirs[i] == CAM_DIR_OUT) ? + BIO_WRITE : BIO_READ; /* * Map the buffer into kernel memory. @@ -959,20 +976,12 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma * vmapbuf() after the useracc() check. */ if (vmapbuf(mapinfo->bp[i], 1) < 0) { - for (j = 0; j < i; ++j) { - *data_ptrs[j] = mapinfo->bp[j]->b_caller1; - vunmapbuf(mapinfo->bp[j]); - uma_zfree(pbuf_zone, mapinfo->bp[j]); - } uma_zfree(pbuf_zone, mapinfo->bp[i]); - PRELE(curproc); - return(EACCES); + goto fail; } /* set our pointer to the new mapped area */ *data_ptrs[i] = mapinfo->bp[i]->b_data; - - mapinfo->num_bufs_used++; } /* @@ -981,11 +990,24 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma * space with locks (on the buffer) held. */ for (i = 0; i < numbufs; i++) { - BUF_KERNPROC(mapinfo->bp[i]); + if (mapinfo->bp[i]) + BUF_KERNPROC(mapinfo->bp[i]); } - + mapinfo->num_bufs_used = numbufs; return(0); + +fail: + for (i--; i >= 0; i--) { + if (mapinfo->bp[i]) { + vunmapbuf(mapinfo->bp[i]); + uma_zfree(pbuf_zone, mapinfo->bp[i]); + } else + free(*data_ptrs[i], M_CAMPERIPH); + *data_ptrs[i] = mapinfo->orig[i]; + } + PRELE(curproc); + return(EACCES); } /* @@ -997,6 +1019,8 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_ { int numbufs, i; u_int8_t **data_ptrs[CAM_PERIPH_MAXMAPS]; + u_int32_t lengths[CAM_PERIPH_MAXMAPS]; + u_int32_t dirs[CAM_PERIPH_MAXMAPS]; if (mapinfo->num_bufs_used <= 0) { /* nothing to free and the process wasn't held. */ @@ -1005,38 +1029,65 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_ switch (ccb->ccb_h.func_code) { case XPT_DEV_MATCH: - numbufs = min(mapinfo->num_bufs_used, 2); - - if (numbufs == 1) { - data_ptrs[0] = (u_int8_t **)&ccb->cdm.matches; - } else { + if (ccb->cdm.pattern_buf_len > 0) { data_ptrs[0] = (u_int8_t **)&ccb->cdm.patterns; + lengths[0] = ccb->cdm.pattern_buf_len; + dirs[0] = CAM_DIR_OUT; data_ptrs[1] = (u_int8_t **)&ccb->cdm.matches; + lengths[1] = ccb->cdm.match_buf_len; + dirs[1] = CAM_DIR_IN; + numbufs = 2; + } else { + data_ptrs[0] = (u_int8_t **)&ccb->cdm.matches; + lengths[0] = ccb->cdm.match_buf_len; + dirs[0] = CAM_DIR_IN; + numbufs = 1; } break; case XPT_SCSI_IO: case XPT_CONT_TARGET_IO: data_ptrs[0] = &ccb->csio.data_ptr; - numbufs = min(mapinfo->num_bufs_used, 1); + lengths[0] = ccb->csio.dxfer_len; + dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK; + numbufs = 1; break; case XPT_ATA_IO: data_ptrs[0] = &ccb->ataio.data_ptr; - numbufs = min(mapinfo->num_bufs_used, 1); + lengths[0] = ccb->ataio.dxfer_len; + dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK; + numbufs = 1; break; + case XPT_MMC_IO: + data_ptrs[0] = (u_int8_t **)&ccb->mmcio.cmd.data; + lengths[0] = sizeof(struct mmc_data *); + dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK; + data_ptrs[1] = (u_int8_t **)&ccb->mmcio.cmd.data->data; + lengths[1] = ccb->mmcio.cmd.data->len; + dirs[1] = ccb->ccb_h.flags & CAM_DIR_MASK; + numbufs = 2; + break; case XPT_SMP_IO: - numbufs = min(mapinfo->num_bufs_used, 2); data_ptrs[0] = &ccb->smpio.smp_request; + lengths[0] = ccb->smpio.smp_request_len; + dirs[0] = CAM_DIR_OUT; data_ptrs[1] = &ccb->smpio.smp_response; + lengths[1] = ccb->smpio.smp_response_len; + dirs[1] = CAM_DIR_IN; + numbufs = 2; break; - case XPT_DEV_ADVINFO: - numbufs = min(mapinfo->num_bufs_used, 1); - data_ptrs[0] = (uint8_t **)&ccb->cdai.buf; - break; case XPT_NVME_IO: case XPT_NVME_ADMIN: data_ptrs[0] = &ccb->nvmeio.data_ptr; - numbufs = min(mapinfo->num_bufs_used, 1); + lengths[0] = ccb->nvmeio.dxfer_len; + dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK; + numbufs = 1; break; + case XPT_DEV_ADVINFO: + data_ptrs[0] = (uint8_t **)&ccb->cdai.buf; + lengths[0] = ccb->cdai.bufsiz; + dirs[0] = CAM_DIR_IN; + numbufs = 1; + break; default: /* allow ourselves to be swapped once again */ PRELE(curproc); @@ -1045,14 +1096,22 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_ } for (i = 0; i < numbufs; i++) { - /* Set the user's pointer back to the original value */ - *data_ptrs[i] = mapinfo->bp[i]->b_caller1; + if (mapinfo->bp[i]) { + /* unmap the buffer */ + vunmapbuf(mapinfo->bp[i]); - /* unmap the buffer */ - vunmapbuf(mapinfo->bp[i]); + /* release the buffer */ + uma_zfree(pbuf_zone, mapinfo->bp[i]); + } else { + if (dirs[i] != CAM_DIR_OUT) { + copyout(*data_ptrs[i], mapinfo->orig[i], + lengths[i]); + } + free(*data_ptrs[i], M_CAMPERIPH); + } - /* release the buffer */ - uma_zfree(pbuf_zone, mapinfo->bp[i]); + /* Set the user's pointer back to the original value */ + *data_ptrs[i] = mapinfo->orig[i]; } /* allow ourselves to be swapped once again */ Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Thu Mar 28 20:25:36 2019 (r345655) +++ head/sys/cam/cam_periph.h Thu Mar 28 20:41:02 2019 (r345656) @@ -149,6 +149,7 @@ struct cam_periph { struct cam_periph_map_info { int num_bufs_used; + void *orig[CAM_PERIPH_MAXMAPS]; struct buf *bp[CAM_PERIPH_MAXMAPS]; }; From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24F0FDBF64; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yk4vpgz4Nts; Tue, 3 Sep 2019 14:05:50 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id EA66519C8C; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C427F1AB7C; Thu, 28 Mar 2019 21:01:00 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65AFC8C15C; Thu, 28 Mar 2019 21:00:59 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 4796C1AB4A; Thu, 28 Mar 2019 21:00:59 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D01901AB48 for ; Thu, 28 Mar 2019 21:00:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 183EE8C14C; Thu, 28 Mar 2019 21:00:55 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8DF324A8D; Thu, 28 Mar 2019 21:00:54 +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 x2SL0sND091612; Thu, 28 Mar 2019 21:00:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SL0sMa091611; Thu, 28 Mar 2019 21:00:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201903282100.x2SL0sMa091611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345659 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 345659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 65AFC8C15C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:55 -0000 X-Original-Date: Thu, 28 Mar 2019 21:00:54 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:55 -0000 Author: jhb Date: Thu Mar 28 21:00:54 2019 New Revision: 345659 URL: https://svnweb.freebsd.org/changeset/base/345659 Log: Use a dedicated malloc type for lagg(4)'s structures. Reviewed by: gallatin MFC after: 1 month Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19719 Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Thu Mar 28 20:46:45 2019 (r345658) +++ head/sys/net/if_lagg.c Thu Mar 28 21:00:54 2019 (r345659) @@ -111,6 +111,7 @@ static void lagg_clone_destroy(struct ifnet *); VNET_DEFINE_STATIC(struct if_clone *, lagg_cloner); #define V_lagg_cloner VNET(lagg_cloner) static const char laggname[] = "lagg"; +static MALLOC_DEFINE(M_LAGG, laggname, "802.3AD Link Aggregation Interface"); static void lagg_capabilities(struct lagg_softc *); static int lagg_port_create(struct lagg_softc *, struct ifnet *); @@ -479,10 +480,10 @@ lagg_clone_create(struct if_clone *ifc, int unit, cadd struct ifnet *ifp; static const u_char eaddr[6]; /* 00:00:00:00:00:00 */ - sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO); + sc = malloc(sizeof(*sc), M_LAGG, M_WAITOK|M_ZERO); ifp = sc->sc_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - free(sc, M_DEVBUF); + free(sc, M_LAGG); return (ENOSPC); } LAGG_SX_INIT(sc); @@ -570,7 +571,7 @@ lagg_clone_destroy(struct ifnet *ifp) LAGG_LIST_UNLOCK(); LAGG_SX_DESTROY(sc); - free(sc, M_DEVBUF); + free(sc, M_LAGG); } static void @@ -684,7 +685,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * ifr.ifr_mtu = oldmtu; } - lp = malloc(sizeof(struct lagg_port), M_DEVBUF, M_WAITOK|M_ZERO); + lp = malloc(sizeof(struct lagg_port), M_LAGG, M_WAITOK|M_ZERO); lp->lp_softc = sc; /* Check if port is a stacked lagg */ @@ -692,7 +693,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * SLIST_FOREACH(sc_ptr, &V_lagg_list, sc_entries) { if (ifp == sc_ptr->sc_ifp) { LAGG_LIST_UNLOCK(); - free(lp, M_DEVBUF); + free(lp, M_LAGG); if (oldmtu != -1) (*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr); @@ -703,7 +704,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * if (lagg_port_checkstacking(sc_ptr) >= LAGG_MAX_STACKING) { LAGG_LIST_UNLOCK(); - free(lp, M_DEVBUF); + free(lp, M_LAGG); if (oldmtu != -1) (*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr); @@ -812,7 +813,7 @@ lagg_port_destroy_cb(epoch_context_t ec) ifp = lp->lp_ifp; if_rele(ifp); - free(lp, M_DEVBUF); + free(lp, M_LAGG); } static int @@ -1600,7 +1601,7 @@ lagg_setmulti(struct lagg_port *lp) CK_STAILQ_FOREACH(ifma, &scifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - mc = malloc(sizeof(struct lagg_mc), M_DEVBUF, M_NOWAIT); + mc = malloc(sizeof(struct lagg_mc), M_LAGG, M_NOWAIT); if (mc == NULL) { IF_ADDR_WUNLOCK(scifp); return (ENOMEM); @@ -1631,7 +1632,7 @@ lagg_clrmulti(struct lagg_port *lp) SLIST_REMOVE(&lp->lp_mc_head, mc, lagg_mc, mc_entries); if (mc->mc_ifma && lp->lp_detaching == 0) if_delmulti_ifma(mc->mc_ifma); - free(mc, M_DEVBUF); + free(mc, M_LAGG); } return (0); } @@ -2077,7 +2078,7 @@ lagg_lb_attach(struct lagg_softc *sc) struct lagg_lb *lb; LAGG_XLOCK_ASSERT(sc); - lb = malloc(sizeof(struct lagg_lb), M_DEVBUF, M_WAITOK | M_ZERO); + lb = malloc(sizeof(struct lagg_lb), M_LAGG, M_WAITOK | M_ZERO); lb->lb_key = m_ether_tcpip_hash_init(); sc->sc_psc = lb; @@ -2092,7 +2093,7 @@ lagg_lb_detach(struct lagg_softc *sc) lb = (struct lagg_lb *)sc->sc_psc; if (lb != NULL) - free(lb, M_DEVBUF); + free(lb, M_LAGG); } static int From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25FDFDBF65; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yk5fJ2z4Nv0; Tue, 3 Sep 2019 14:05:50 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 0917419C92; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 05D181B820; Thu, 28 Mar 2019 21:52:35 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E3788DF69; Thu, 28 Mar 2019 21:52:34 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 15E4B1B7CE; Thu, 28 Mar 2019 21:52:34 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 11BAC1B7C8; Thu, 28 Mar 2019 21:52:31 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FBE88DF53; Thu, 28 Mar 2019 21:52:29 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id B90EE1B75D; Thu, 28 Mar 2019 21:52:22 +0000 (UTC) Subject: Re: svn commit: r345491 - in head/sys: conf fs/tmpfs modules/tmpfs To: Cy Schubert , Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201903251917.x2PJHTnc068310@slippy.cwsent.com> From: Allan Jude Openpgp: preference=signencrypt Autocrypt: addr=allanjude@freebsd.org; prefer-encrypt=mutual; keydata= mQINBFVwZcYBEADwrZDH0xe0ZVjc9ORCc6PcBLwS/RTXA6NkvpD6ea02pZ8lPOVgteuuugFc D34LdDbiWr+479vfrKBh+Y38GL0oZ0/13j10tIlDMHSa5BU0y6ACtnhupFvVlQ57+XaJAb/q 7qkfSiuxVwQ3FY3PL3cl1RrIP5eGHLA9hu4eVbu+FOX/q/XVKz49HaeIaxzo2Q54572VzIo6 C28McX9m65UL5fXMUGJDDLCItLmehZlHsQQ+uBxvODLFpVV2lUgDR/0rDa0B9zHZX8jY8qQ7 ZdCSy7CwClXI054CkXZCaBzgxYh/CotdI8ezmaw7NLs5vWNTxaDEFXaFMQtMVhvqQBpHkfOD 7rjjOmFw00nJL4FuPE5Yut0CPyx8vLjVmNJSt/Y8WxxmhutsqJYFgYfWl/vaWkrFLur/Zcmz IklwLw35HLsCZytCN5A3rGKdRbQjD6QPXOTJu0JPrJF6t2xFkWAT7oxnSV0ELhl2g+JfMMz2 Z1PDmS3NRnyEdqEm7NoRGXJJ7bgxDbN+9SXTyOletqGNXj/bSrBvhvZ0RQrzdHAPwQUfVSU2 qBhQEi2apSZstgVNMan0GUPqCdbE2zpysg+zT7Yhvf9EUQbzPL4LpdK1llT9fZbrdMzEXvEF oSvwJFdV3sqKmZc7b+E3PuxK6GTsKqaukd/3Cj8aLHG1T1im1QARAQABtCJBbGxhbiBKdWRl IDxhbGxhbmp1ZGVAZnJlZWJzZC5vcmc+iQI/BBMBAgApBQJVcGXGAhsjBQkSzAMABwsJCAcD AgEGFQgCCQoLBBYCAwECHgECF4AACgkQGZU1PhKYC34Muw/+JOKpSfhhysWFYiRXynGRDe07 Z6pVsn7DzrPUMRNZfHu8Uujmmy3p2nx9FelIY9yjd2UKHhug+whM54MiIFs90eCRVa4XEsPR 4FFAm0DAWrrb7qhZFcE/GhHdRWpZ341WAElWf6Puj2devtRjfYbikvj5+1V1QmDbju7cEw5D mEET44pTuD2VMRJpu2yZZzkM0i+wKFuPxlhqreufA1VNkZXI/rIfkYWK+nkXd9Efw3YdCyCQ zUgTUCb88ttSqcyhik/li1CDbXBpkzDCKI6I/8fAb7jjOC9LAtrZJrdgONywcVFoyK9ZN7EN AVA+xvYCmuYhR/3zHWH1g4hAm1v1+gIsufhajhfo8/wY1SetlzPaYkSkVQLqD8T6zZyhf+AN bC7ci44UsiKGAplB3phAXrtSPUEqM86kbnHg3fSx37kWKUiYNOnx4AC2VXvEiKsOBlpyt3dw WQbOtOYM+vkfbBwDtoGOOPYAKxc4LOIt9r+J8aD+gTooi9Eo5tvphATf9WkCpl9+aaGbSixB tUpvQMRnSMqTqq4Z7DeiG6VMRQIjsXDSLJEUqcfhnLFo0Ko/RiaHd5xyAQ4DhQ9QpkyQjjNf /3f/dYG7JAtoD30txaQ5V8uHrz210/77DRRX+HJjEj6xCxWUGvQgvEZf5XXyxeePvqZ+zQyT DX61bYw6w6a5Ag0EVXBlxgEQAMy7YVnCCLN4oAOBVLZ5nUbVPvpUhsdA94/0/P+uqCIh28Cz ar56OCX0X19N/nAWecxL4H32zFbIRyDB2V/MEh4p9Qvyu/j4i1r3Ex5GhOT2hnit43Ng46z5 29Es4TijrHJP4/l/rB2VOqMKBS7Cq8zk1cWqaI9XZ59imxDNjtLLPPM+zQ1yE3OAMb475QwN UgWxTMw8rkA7CEaqeIn4sqpTSD5C7kT1Bh26+rbgJDZ77D6Uv1LaCZZOaW52okW3bFbdozV8 yM2u+xz2Qs8bHz67p+s+BlygryiOyYytpkiK6Iy4N7FTolyj5EIwCuqzfk0SaRHeOKX2ZRjC qatkgoD/t13PNT38V9tw3qZVOJDS0W6WM8VSg+F+bkM9LgJ8CmKV+Hj0k3pfGfYPOZJ/v18i +SmZmL/Uw2RghnwDWGAsPCKu4uZR777iw7n9Io6Vfxndw2dcS0e9klvFYoaGS6H2F13Asygr WBzFNGFQscN4mUW+ZYBzpTOcHkdT7w8WS55BmXYLna+dYer9/HaAuUrONjujukN4SPS1fMJ2 /CS/idAUKyyVVX5vozoNK2JVC1h1zUAVsdnmhEzNPsvBoqcVNfyqBFROEVLIPwq+lQMGNVjH ekLTKRWf59MEhUC2ztjSKkGmwdg73d6xSXMuq45EgIJV2wPvOgWQonoHH/kxABEBAAGJAiUE GAECAA8FAlVwZcYCGwwFCRLMAwAACgkQGZU1PhKYC34w5A//YViBtZyDV5O+SJT9FFO3lb9x Zdxf0trA3ooCt7gdBkdnBM6T5EmjgVZ3KYYyFfwXZVkteuCCycMF/zVw5eE9FL1+zz9gg663 nY9q2F77TZTKXVWOLlOV2bY+xaK94U4ytogOGhh9b4UnQ/Ct3+6aviCF78Go608BXbmF/GVT 7uhddemk7ItxM1gE5Hscx3saxGKlayaOsdPKeGTVJCDEtHDuOc7/+jGh5Zxpk/Hpi+DUt1ot 8e6hPYLIQa4uVx4f1xxxV858PQ7QysSLr9pTV7FAQ18JclCaMc7JWIa3homZQL/MNKOfST0S 2e+msuRwQo7AnnfFKBUtb02KwpA4GhWryhkjUh/kbVc1wmGxaU3DgXYQ5GV5+Zf4kk/wqr/7 KG0dkTz6NLCVLyDlmAzuFhf66DJ3zzz4yIo3pbDYi3HB/BwJXVSKB3Ko0oUo+6/qMrOIS02L s++QE/z7K12CCcs7WwOjfCYHK7VtE0Sr/PfybBdTbuDncOuAyAIeIKxdI2nmQHzl035hhvQX s4CSghsP319jAOQiIolCeSbTMD4QWMK8RL/Pe1FI1jC3Nw9s+jq8Dudtbcj2UwAP/STUEbJ9 5rznzuuhPjE0e++EU/RpWmcaIMK/z1zZDMN+ce2v1qzgV936ZhJ3iaVzyqbEE81gDxg3P+IM kiYh4ZtPB4Q= Message-ID: <730eb214-5e6d-a16c-9f9d-a7ca90b5ca77@freebsd.org> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: <201903251917.x2PJHTnc068310@slippy.cwsent.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Eq7AemuNwer8zsg8kRxRNlu7YrwmxReJX" Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3E3788DF69 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:55 -0000 X-Original-Date: Thu, 28 Mar 2019 17:52:17 -0400 X-List-Received-Date: Tue, 03 Sep 2019 14:05:55 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Eq7AemuNwer8zsg8kRxRNlu7YrwmxReJX Content-Type: multipart/mixed; boundary="BSy5TzBEnR5Vqw0Wdb85v5Xw7TyqeQu40"; protected-headers="v1" From: Allan Jude To: Cy Schubert , Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <730eb214-5e6d-a16c-9f9d-a7ca90b5ca77@freebsd.org> Subject: Re: svn commit: r345491 - in head/sys: conf fs/tmpfs modules/tmpfs References: <201903251917.x2PJHTnc068310@slippy.cwsent.com> In-Reply-To: <201903251917.x2PJHTnc068310@slippy.cwsent.com> --BSy5TzBEnR5Vqw0Wdb85v5Xw7TyqeQu40 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2019-03-25 15:17, Cy Schubert wrote: > In message <3398a21318a4a6715609004d569d20de86f1dc7a.camel@freebsd.org>= > , Ian Le > pore writes: >> On Mon, 2019-03-25 at 05:42 -0700, Cy Schubert wrote: >>> In message <201903250746.x2P7kKUu019786@repo.freebsd.org>, Allan >>> Jude=20 >>> writes: >>>> Author: allanjude >>>> Date: Mon Mar 25 07:46:20 2019 >>>> New Revision: 345491 >>>> URL: https://svnweb.freebsd.org/changeset/base/345491 >>>> >>>> Log: >>>> Make TMPFS_PAGES_MINRESERVED a kernel option >>>> =20 >>>> TMPFS_PAGES_MINRESERVED controls how much memory is reserved for >>>> the system >>>> and not used by tmpfs. >>>> =20 >>>> On very small memory systems, the default value may be too high >>>> and this >>>> prevents these small memory systems from using reroot, which is >>>> required >>>> for them to install firmware updates. >>>> =20 >>>> Submitted by: Hiroki Mori >>>> Reviewed by: mizhka >>>> Differential Revision: https://reviews.freebsd.org/D13583 >>>> >>>> Modified: >>>> head/sys/conf/options >>>> head/sys/fs/tmpfs/tmpfs.h >>>> head/sys/fs/tmpfs/tmpfs_vfsops.c >>>> head/sys/modules/tmpfs/Makefile >>>> >>> >>> Would this be a good candidate for a sysctl or tuneable? >>> >> >> The small-memory embedded systems most affected by this often don't us= e >> loader(8) at all, so tunables aren't an option, and sysctl may be too >> late. No reason it can't be a tunable as well, but it'll probably nee= d >> to remain as a compile-time option too. >=20 > Yes, I should have been more clear. I can see using a tuneable on a 2=20 > GB or 4 GB Intel pandaboard. (Perfect for a firewall or a UPS=20 > management station.) >=20 >=20 The default value is 4MB. For any system with more than 32mb of memory, it shouldn't require tuning, although you may wish to prevent tmpfs from using all but 4mb of your memory. I think the only case where you definitely need to override the default, is when you have so little memory that you can't create a tmpfs image of your root filesystem to reroot into, as is the case on many tiny router boards, with 8-32mb of ram, and 4-16mb of flash. --=20 Allan Jude --BSy5TzBEnR5Vqw0Wdb85v5Xw7TyqeQu40-- --Eq7AemuNwer8zsg8kRxRNlu7YrwmxReJX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJcnUIWAAoJEBmVNT4SmAt+2x8QALxzOf2UlvsiUEmxMlzYLcmM 4ycHqze/pXT/AbuGu/xrKWoU5LUq4TJrEbVyl5o66RtZTieBTWU6h60zi1FLQcdd 4M9qG5o8blpqFBJWLgUy8fVYyCR9ECpahdc9mzHH+qCwcRtzoFnRDntBomnouXWK pOUrYEIFAnqE5kfgNWkgcBWKM/+8VKTK9DPO7oXzJPrQ06RgL7EY7RYWV+PKZTke gwzmeljlZjhbdyT4Fix0RS+BFjMxNwwnsrxb96tLy4ZrqWsT+5znk2ODqNHHid4V NlvYoMWRFFkBPPxs1c7JxdKJYnEM4Fndzrbru1YQT4L7gLVkeAu3pYf74ha+KjCI Ariz6oizrVBvIIk3T+ADUY+DgadOOVct/5zIhQbfKGl5bcH+TvLZ5Qab/2LuMCxz +hcg5Vgy7+YzLrCq1+rrNuLcebyf7aNX9EghcCxOxW2obWURkWFSJfqJ09KQH/+l e6j7KSchcmyW2C6sCxBUyW6UzkzhLXn5bs8YyusN601EyvXGgwvc/Wf2ZfkQ80vY luFmJ8PbUQUK5FoKcv45StjH8Xh4fK4vZtnl2DXUIiURZPO1TwhgcD02fuReAkuA ELfQXwogo4kDczZxpKzcNAxXrUDukisLA19CLm+1bg8L5+qy51KK/ebAkpDN8kDW bB87+YnuiqEmwS8etKC/ =Ag0V -----END PGP SIGNATURE----- --Eq7AemuNwer8zsg8kRxRNlu7YrwmxReJX-- From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A54DDBF69; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yk58gCz4Nty; Tue, 3 Sep 2019 14:05:50 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id F271A19C8E; Tue, 3 Sep 2019 14:05:48 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 1F3C91B01B; Thu, 28 Mar 2019 21:22:33 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 685888CE4A; Thu, 28 Mar 2019 21:22:32 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 30F9D1AFAF; Thu, 28 Mar 2019 21:22:32 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 4F5571AF9B for ; Thu, 28 Mar 2019 21:22:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21F7E8CE2C; Thu, 28 Mar 2019 21:22:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBF8324FA0; Thu, 28 Mar 2019 21:22:28 +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 x2SLMS6O006041; Thu, 28 Mar 2019 21:22:28 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2SLMSfS006038; Thu, 28 Mar 2019 21:22:28 GMT (envelope-from np@FreeBSD.org) Message-Id: <201903282122.x2SLMSfS006038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345660 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 345660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 685888CE4A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:56 -0000 X-Original-Date: Thu, 28 Mar 2019 21:22:28 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:56 -0000 Author: np Date: Thu Mar 28 21:22:28 2019 New Revision: 345660 URL: https://svnweb.freebsd.org/changeset/base/345660 Log: cxgbe(4): Count and clear interrupts generated at the software's request. An interrupt can be requested by setting the F_SWINT bit in PL_PF_CTL. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Mar 28 21:00:54 2019 (r345659) +++ head/sys/dev/cxgbe/adapter.h Thu Mar 28 21:22:28 2019 (r345660) @@ -895,6 +895,8 @@ struct adapter { const char *last_op; const void *last_op_thr; int last_op_flags; + + int swintr; }; #define ADAPTER_LOCK(sc) mtx_lock(&(sc)->sc_lock) Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Mar 28 21:00:54 2019 (r345659) +++ head/sys/dev/cxgbe/t4_main.c Thu Mar 28 21:22:28 2019 (r345660) @@ -6031,6 +6031,9 @@ t4_sysctls(struct adapter *sc) CTLTYPE_STRING | CTLFLAG_RD, sc, INTR_CPUS, sysctl_cpus, "A", "preferred CPUs for interrupts"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "swintr", CTLFLAG_RW, + &sc->swintr, 0, "software triggered interrupts"); + /* * dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload. */ Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Mar 28 21:00:54 2019 (r345659) +++ head/sys/dev/cxgbe/t4_sge.c Thu Mar 28 21:22:28 2019 (r345660) @@ -1394,10 +1394,17 @@ void t4_intr_err(void *arg) { struct adapter *sc = arg; + uint32_t v; const bool verbose = (sc->debug_flags & DF_VERBOSE_SLOWINTR) != 0; if (sc->flags & ADAP_ERR) return; + + v = t4_read_reg(sc, MYPF_REG(A_PL_PF_INT_CAUSE)); + if (v & F_PFSW) { + sc->swintr++; + t4_write_reg(sc, MYPF_REG(A_PL_PF_INT_CAUSE), v); + } t4_slow_intr_handler(sc, verbose); } From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC6EFDC0CA; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ys1ySbz4P1j; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 06EE419E52; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 8CEEE11F33; Fri, 29 Mar 2019 18:39:30 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 217B17344D; Fri, 29 Mar 2019 18:39:30 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0F49F11F32; Fri, 29 Mar 2019 18:39:30 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 0119D11F2F; Fri, 29 Mar 2019 18:39:27 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2AC673449; Fri, 29 Mar 2019 18:39:26 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x42a.google.com with SMTP id c8so1442724pfd.10; Fri, 29 Mar 2019 11:39:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=k02HTVdBV1Xzfa7A5FDW0wclAztgbB8C3skOTf6Nv7U=; b=HWZ2XbvYNSHxamyHILJasYkd4gZ6ERLdpbO0NMnWDPwOB4ySLL6md+9SsvntkUehaX CyZfWgram7Bq0iYyYiblhf5ctEFFbRM9i2co/3stKMyf3LlabK/FN4Z7Qptw2b62B/pV 5ma7BIS8JgVrAS03J0Af91vVI1RsPWD09eHClMzkGvgohclEKH3MCpg8Y9eOljWygc6A UM6hExKZjtp+Tu8NEqZrz8hPnUMJjlmh2Q1FOz6cTyiuXVgEijYloa6nsGKWca6QL9sM oOUeSowrJUJoiGbPJhc0VAZw9B1Gtt9zrCnqCeD7/cWgOGBsQsutupQgbnx55E2bZze/ XuNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=k02HTVdBV1Xzfa7A5FDW0wclAztgbB8C3skOTf6Nv7U=; b=UyHFXfkrnN50MTo0UhxuFyVJFb9lGUe9uaL/JGPOD3N7At6Q8KIyc0LgO2oTMNkdgR TFjd2K3atv/bba+B5leuvI3Ne7HsioGR63EjMjJrGDJUczRkBSNwPU36SZmUAlD6E/a8 uKd3+TKCkJafffDDhCLoBGTm+JVsbE+/T1ggzh+EDJik3qOq3MeSmHJt0/WTcL0qEKAq evr98zUrM/DpQyzoOYMqEBQH8sUP23hR/h6z7UmUeC4sn/Ieaj763FLji0lrqjAq6SOF DvSn7uYkNcSKeOt9cYVh8r54jLn9q0zXKM5pT5G2V0WwQZnKlSEaltx4zKl9yjtkqYmd xufQ== X-Gm-Message-State: APjAAAVffpVkCVS4xPsf0IwQEmsOBxfZYKd06M0bWrtkZGBzgIT1W6Oi zChvs5YiQ4zie+o5IL8fsV6AmcZsM2w= X-Google-Smtp-Source: APXvYqwlWuFdOyaa91785SJrooNCvToATc8roJQsfxnAGA4srNI+ws23Kg2m+XjGB47y1Low109MHA== X-Received: by 2002:a65:6283:: with SMTP id f3mr48124496pgv.108.1553884765070; Fri, 29 Mar 2019 11:39:25 -0700 (PDT) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id p3sm4877255pfn.167.2019.03.29.11.39.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Mar 2019 11:39:23 -0700 (PDT) From: Enji Cooper Message-Id: Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r345706 - in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libc/tests/stdlib lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk us... In-Reply-To: <201903291831.x2TIVnEv082235@repo.freebsd.org> Cc: src-committers , svn-src-all , svn-src-head@freebsd.org To: Enji Cooper References: <201903291831.x2TIVnEv082235@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.102.3) Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 217B17344D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.972,0] Status: O Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:01 -0000 X-Original-Date: Fri, 29 Mar 2019 11:39:23 -0700 X-List-Received-Date: Tue, 03 Sep 2019 14:06:01 -0000 > On Mar 29, 2019, at 11:31 AM, Enji Cooper wrote: >=20 > Author: ngie > Date: Fri Mar 29 18:31:48 2019 > New Revision: 345706 > URL: https://svnweb.freebsd.org/changeset/base/345706 = *grumbles* I downloaded the last version posted on Phabricator, which = (sadly) was the version from r345704 :>. -Enji= From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CED9FDC0CC; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ys4576z4P29; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 373A719E76; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 3B42A13C39; Fri, 29 Mar 2019 19:47:47 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A84D76E12; Fri, 29 Mar 2019 19:47:46 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 266EB13BFA; Fri, 29 Mar 2019 19:47:46 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7B65C13BF8 for ; Fri, 29 Mar 2019 19:47:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C4AE76E0E; Fri, 29 Mar 2019 19:47:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10FBD3962; Fri, 29 Mar 2019 19:47: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 x2TJlgAQ021411; Fri, 29 Mar 2019 19:47:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TJlgJV021410; Fri, 29 Mar 2019 19:47:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201903291947.x2TJlgJV021410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345712 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 345712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 4A84D76E12 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:01 -0000 X-Original-Date: Fri, 29 Mar 2019 19:47:42 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:01 -0000 Author: jhb Date: Fri Mar 29 19:47:42 2019 New Revision: 345712 URL: https://svnweb.freebsd.org/changeset/base/345712 Log: Don't check the inp socket pointer in in_pcboutput_eagain. Reviewed by: hps (by saying it was ok to be removed) MFC after: 1 month Sponsored by: Netflix Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Fri Mar 29 19:40:04 2019 (r345711) +++ head/sys/netinet/in_pcb.c Fri Mar 29 19:47:42 2019 (r345712) @@ -3397,14 +3397,9 @@ in_pcboutput_txrtlmt(struct inpcb *inp, struct ifnet * void in_pcboutput_eagain(struct inpcb *inp) { - struct socket *socket; bool did_upgrade; if (inp == NULL) - return; - - socket = inp->inp_socket; - if (socket == NULL) return; if (inp->inp_snd_tag == NULL) From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF9E2DC0CE; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ys2XzHz4P1l; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 0D2EF19E54; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7D3931208B; Fri, 29 Mar 2019 18:43:52 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37B157386D; Fri, 29 Mar 2019 18:43:52 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1B86D12089; Fri, 29 Mar 2019 18:43:52 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id B004312087 for ; Fri, 29 Mar 2019 18:43:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B1237386A; Fri, 29 Mar 2019 18:43:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 680D52D36; Fri, 29 Mar 2019 18:43:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2TIhnK4087578; Fri, 29 Mar 2019 18:43:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TIhkMF087562; Fri, 29 Mar 2019 18:43:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201903291843.x2TIhkMF087562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345707 - in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libc/tests/stdlib lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk us... X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libc/tests/stdlib lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk usr.bin/dtc usr.sbin/pmc X-SVN-Commit-Revision: 345707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 37B157386D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:01 -0000 X-Original-Date: Fri, 29 Mar 2019 18:43:46 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:01 -0000 Author: ngie Date: Fri Mar 29 18:43:46 2019 New Revision: 345707 URL: https://svnweb.freebsd.org/changeset/base/345707 Log: Revert r345706: the third time will be the charm When a review is closed via Phabricator it updates the patch attached to the review. I downloaded the raw patch from Phabricator, applied it, and repeated my mistake from r345704 by accident mixing content from D19732 and D19738. For my own personal sanity, I will try not to mix reviews like this in the future. MFC after: 1 month MFC with: r345706 Approved by: emaste (mentor, implicit) Modified: head/lib/clang/llvm.build.mk head/lib/libc++/Makefile head/lib/libc++experimental/Makefile head/lib/libc++fs/Makefile head/lib/libc/tests/stdlib/Makefile head/lib/libclang_rt/Makefile.inc head/lib/libcxxrt/Makefile head/lib/libgcc_eh/Makefile.inc head/lib/libomp/Makefile head/lib/ofed/libibnetdisc/Makefile head/share/mk/bsd.progs.mk head/share/mk/bsd.sys.mk head/share/mk/googletest.test.inc.mk head/usr.bin/dtc/Makefile head/usr.sbin/pmc/Makefile Modified: head/lib/clang/llvm.build.mk ============================================================================== --- head/lib/clang/llvm.build.mk Fri Mar 29 18:31:48 2019 (r345706) +++ head/lib/clang/llvm.build.mk Fri Mar 29 18:43:46 2019 (r345707) @@ -95,7 +95,7 @@ CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections LDFLAGS+= -Wl,--gc-sections -CXXSTD?= c++11 +CXXFLAGS+= -std=c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti CXXFLAGS.clang+= -stdlib=libc++ Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Fri Mar 29 18:31:48 2019 (r345706) +++ head/lib/libc++/Makefile Fri Mar 29 18:43:46 2019 (r345707) @@ -76,7 +76,9 @@ CFLAGS+= -nostdinc++ CFLAGS+= -nostdlib CFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CFLAGS+= -DLIBCXXRT -CXXSTD= c++11 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif LIBADD+= cxxrt INCSGROUPS= STD EXP EXT Modified: head/lib/libc++experimental/Makefile ============================================================================== --- head/lib/libc++experimental/Makefile Fri Mar 29 18:31:48 2019 (r345706) +++ head/lib/libc++experimental/Makefile Fri Mar 29 18:43:46 2019 (r345707) @@ -20,6 +20,8 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -CXXSTD= c++14 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++14 +.endif .include Modified: head/lib/libc++fs/Makefile ============================================================================== --- head/lib/libc++fs/Makefile Fri Mar 29 18:31:48 2019 (r345706) +++ head/lib/libc++fs/Makefile Fri Mar 29 18:43:46 2019 (r345707) @@ -22,6 +22,8 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -CXXSTD= c++14 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++14 +.endif .include Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Fri Mar 29 18:31:48 2019 (r345706) +++ head/lib/libc/tests/stdlib/Makefile Fri Mar 29 18:43:46 2019 (r345707) @@ -50,8 +50,8 @@ PROGS+= h_getopt h_getopt_long CFLAGS+= -I${.CURDIR} -CXXSTD.cxa_thread_atexit_test= c++11 -CXXSTD.cxa_thread_atexit_nothr_test= c++11 +CXXFLAGS.cxa_thread_atexit_test+= -std=c++11 +CXXFLAGS.cxa_thread_atexit_nothr_test+= -std=c++11 LIBADD.cxa_thread_atexit_test+= pthread .for t in h_getopt h_getopt_long Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Fri Mar 29 18:31:48 2019 (r345706) +++ head/lib/libclang_rt/Makefile.inc Fri Mar 29 18:43:46 2019 (r345707) @@ -41,4 +41,4 @@ CFLAGS+= -funwind-tables CXXFLAGS+= -fvisibility-inlines-hidden CXXFLAGS+= -fvisibility=hidden CFLAGS+= -I${CRTSRC}/lib -CXXSTD= c++11 +CXXFLAGS+= -std=c++11 Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Fri Mar 29 18:31:48 2019 (r345706) +++ head/lib/libcxxrt/Makefile Fri Mar 29 18:43:46 2019 (r345707) @@ -22,7 +22,9 @@ SRCS+= libelftc_dem_gnu3.c\ WARNS= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ -CXXSTD= c++11 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif VERSION_MAP= ${.CURDIR}/Version.map .include Modified: head/lib/libgcc_eh/Makefile.inc ============================================================================== --- head/lib/libgcc_eh/Makefile.inc Fri Mar 29 18:31:48 2019 (r345706) +++ head/lib/libgcc_eh/Makefile.inc Fri Mar 29 18:43:46 2019 (r345707) @@ -27,8 +27,10 @@ CXXFLAGS.${file}+= -fno-exceptions -funwind-tables .endfor CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif CXXFLAGS+= -fno-rtti -CXXSTD= c++11 STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC # Probably need to just move this earlier or use CXXFLAGS .if ${MK_DIRDEPS_BUILD} == "yes" Modified: head/lib/libomp/Makefile ============================================================================== --- head/lib/libomp/Makefile Fri Mar 29 18:31:48 2019 (r345706) +++ head/lib/libomp/Makefile Fri Mar 29 18:43:46 2019 (r345707) @@ -53,9 +53,9 @@ CFLAGS+= -I${ITTSRC} CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections CXXFLAGS+= -fvisibility-inlines-hidden +CXXFLAGS+= -std=c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti -CXXSTD= c++11 LDFLAGS+= -Wl,--warn-shared-textrel LDFLAGS+= -Wl,--gc-sections Modified: head/lib/ofed/libibnetdisc/Makefile ============================================================================== --- head/lib/ofed/libibnetdisc/Makefile Fri Mar 29 18:31:48 2019 (r345706) +++ head/lib/ofed/libibnetdisc/Makefile Fri Mar 29 18:43:46 2019 (r345707) @@ -31,6 +31,9 @@ LIBADD= osmcomp ibmad ibumad CFLAGS+= -DHAVE_CONFIG_H=1 CFLAGS+= -I${_spath} CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband +.if ${COMPILER_FEATURES:Mc++11} +CXXFLAGS+= -std=c++11 +.endif VERSION_MAP= ${_spath}/libibnetdisc.map .include Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Fri Mar 29 18:31:48 2019 (r345706) +++ head/share/mk/bsd.progs.mk Fri Mar 29 18:43:46 2019 (r345707) @@ -22,8 +22,8 @@ PROGS += ${PROGS_CXX} .if defined(PROG) # just one of many -PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE CSTD CXXSTD DPSRCS MAN \ - NO_WERROR PROGNAME SRCS STRIP WARNS +PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ + PROGNAME SRCS STRIP WARNS PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD INTERNALPROG LDADD LIBADD \ LINKS LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Mar 29 18:31:48 2019 (r345706) +++ head/share/mk/bsd.sys.mk Fri Mar 29 18:43:46 2019 (r345707) @@ -24,19 +24,6 @@ CFLAGS+= -std=iso9899:1999 .else # CSTD CFLAGS+= -std=${CSTD} .endif # CSTD - -.if ${COMPILER_FEATURES:Mc++11} -CXXSTD?= c++11 -.elif ${COMPILER_TYPE} == "gcc" -# Prior versions of g++ support C++98 with GNU extensions by default. -CXXSTD?= gnu++98 -.else -# Assume that the compiler supports at least C++98. -CXXSTD?= c++98 -.endif -CXXFLAGS+= -std=${CXXSTD} -# CXXSTD - # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS+= -pedantic .if defined(WARNS) Modified: head/share/mk/googletest.test.inc.mk ============================================================================== --- head/share/mk/googletest.test.inc.mk Fri Mar 29 18:31:48 2019 (r345706) +++ head/share/mk/googletest.test.inc.mk Fri Mar 29 18:43:46 2019 (r345707) @@ -1,9 +1,13 @@ # $FreeBSD$ +# XXX: this should be defined in bsd.sys.mk +CXXSTD?= c++11 + GTESTS_CXXFLAGS+= -DGTEST_HAS_POSIX_RE=1 GTESTS_CXXFLAGS+= -DGTEST_HAS_PTHREAD=1 GTESTS_CXXFLAGS+= -DGTEST_HAS_STREAM_REDIRECTION=1 GTESTS_CXXFLAGS+= -frtti +GTESTS_CXXFLAGS+= -std=${CXXSTD} # XXX: src.libnames.mk should handle adding this directory for libgtest's, # libgmock's, etc, headers. Modified: head/usr.bin/dtc/Makefile ============================================================================== --- head/usr.bin/dtc/Makefile Fri Mar 29 18:31:48 2019 (r345706) +++ head/usr.bin/dtc/Makefile Fri Mar 29 18:43:46 2019 (r345707) @@ -6,7 +6,7 @@ MAN= dtc.1 WARNS?= 3 -CXXFLAGS+= -fno-rtti -fno-exceptions +CXXFLAGS+= -std=c++11 -fno-rtti -fno-exceptions NO_SHARED?=NO Modified: head/usr.sbin/pmc/Makefile ============================================================================== --- head/usr.sbin/pmc/Makefile Fri Mar 29 18:31:48 2019 (r345706) +++ head/usr.sbin/pmc/Makefile Fri Mar 29 18:43:46 2019 (r345707) @@ -6,8 +6,7 @@ PROG_CXX= pmc MAN= WARNS?= 3 -CXXFLAGS+= -O0 -CXXSTD= c++14 +CXXFLAGS+= -O0 -std=c++14 CWARNFLAGS.gcc+= -Wno-redundant-decls LIBADD= kvm pmc m ncursesw pmcstat elf From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F041DC112; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yt488vz4P34; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 9CB7E19EBE; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E86D81BFA1; Sat, 30 Mar 2019 03:09:19 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DD9769F35; Sat, 30 Mar 2019 03:09:19 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1B62E1BF86; Sat, 30 Mar 2019 03:09:19 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 0ADAF1BF6C; Sat, 30 Mar 2019 03:09:16 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8B7969F14; Sat, 30 Mar 2019 03:09:15 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x2U39Dmh002527; Fri, 29 Mar 2019 20:09:13 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x2U39DtW002526; Fri, 29 Mar 2019 20:09:13 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201903300309.x2U39DtW002526@gndrsh.dnsmgr.net> Subject: Re: svn commit: r345707 - in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libc/tests/stdlib lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk us... In-Reply-To: <201903291843.x2TIhkMF087562@repo.freebsd.org> To: Enji Cooper CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3DD9769F35 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:02 -0000 X-Original-Date: Fri, 29 Mar 2019 20:09:13 -0700 (PDT) X-List-Received-Date: Tue, 03 Sep 2019 14:06:02 -0000 > Author: ngie > Date: Fri Mar 29 18:43:46 2019 > New Revision: 345707 > URL: https://svnweb.freebsd.org/changeset/base/345707 > > Log: > Revert r345706: the third time will be the charm > > When a review is closed via Phabricator it updates the patch attached to the > review. I downloaded the raw patch from Phabricator, applied it, and repeated > my mistake from r345704 by accident mixing content from D19732 and D19738. Which, arguable is a feature or mis feature depending on the point of view. I do not like it when I go to look at someone elses committed code siting a review, as I want to actually see what it was that was committed. You can find the pre-commit diff, but it takes a bit of probling. The upside is you can get both diffs from the same place and diff the diffs :-) > For my own personal sanity, I will try not to mix reviews like this in the > future. :-) Been there, almost did that too. Pre commit last minute svn diff saved me. > MFC after: 1 month > MFC with: r345706 > Approved by: emaste (mentor, implicit) ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07B81DC15A; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv1W9Cz4P4Q; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 7EE7819F34; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 8282817855; Sun, 31 Mar 2019 09:52:41 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 807247185E; Sun, 31 Mar 2019 09:52:40 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1A4B01780B; Sun, 31 Mar 2019 09:52:40 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id BE58E17809 for ; Sun, 31 Mar 2019 09:52:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9021771859; Sun, 31 Mar 2019 09:52:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B5EB251B0; Sun, 31 Mar 2019 09:52:37 +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 x2V9qbAC048822; Sun, 31 Mar 2019 09:52:37 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2V9qaAC048820; Sun, 31 Mar 2019 09:52:36 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201903310952.x2V9qaAC048820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345751 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 345751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 807247185E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:04 -0000 X-Original-Date: Sun, 31 Mar 2019 09:52:36 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:04 -0000 Author: avos Date: Sun Mar 31 09:52:36 2019 New Revision: 345751 URL: https://svnweb.freebsd.org/changeset/base/345751 Log: uath(4), urtw(4): restart driver if device does not respond after Tx request MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_urtw.c Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Sun Mar 31 06:21:32 2019 (r345750) +++ head/sys/dev/usb/wlan/if_uath.c Sun Mar 31 09:52:36 2019 (r345751) @@ -1276,8 +1276,8 @@ uath_watchdog(void *arg) if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { device_printf(sc->sc_dev, "device timeout\n"); - /*uath_init(sc); XXX needs a process context! */ counter_u64_add(ic->ic_oerrors, 1); + ieee80211_restart_all(ic); return; } callout_reset(&sc->watchdog_ch, hz, uath_watchdog, sc); Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Sun Mar 31 06:21:32 2019 (r345750) +++ head/sys/dev/usb/wlan/if_urtw.c Sun Mar 31 09:52:36 2019 (r345751) @@ -1891,11 +1891,13 @@ static void urtw_watchdog(void *arg) { struct urtw_softc *sc = arg; + struct ieee80211com *ic = &sc->sc_ic; if (sc->sc_txtimer > 0) { if (--sc->sc_txtimer == 0) { device_printf(sc->sc_dev, "device timeout\n"); - counter_u64_add(sc->sc_ic.ic_oerrors, 1); + counter_u64_add(ic->ic_oerrors, 1); + ieee80211_restart_all(ic); return; } callout_reset(&sc->sc_watchdog_ch, hz, urtw_watchdog, sc); From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC806DC0CB; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ys3HZzz4P1x; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 14CEA19E5A; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id B5CC7122F9; Fri, 29 Mar 2019 18:45:33 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 347A773AE4; Fri, 29 Mar 2019 18:45:33 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1050F122C3; Fri, 29 Mar 2019 18:45:33 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 901D1122BD for ; Fri, 29 Mar 2019 18:45:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D3C973AD5; Fri, 29 Mar 2019 18:45:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 143FD2D3A; Fri, 29 Mar 2019 18:45:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2TIjTiY087878; Fri, 29 Mar 2019 18:45:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TIjRMb087865; Fri, 29 Mar 2019 18:45:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201903291845.x2TIjRMb087865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345708 - in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk usr.bin/dtc usr.sbin/pmc X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk usr.bin/dtc usr.sbin/pmc X-SVN-Commit-Revision: 345708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 347A773AE4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:01 -0000 X-Original-Date: Fri, 29 Mar 2019 18:45:27 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:01 -0000 Author: ngie Date: Fri Mar 29 18:45:27 2019 New Revision: 345708 URL: https://svnweb.freebsd.org/changeset/base/345708 Log: Standardize `-std=c++* as `CXXSTD` CXXSTD was added as the C++ analogue to CSTD. CXXSTD defaults to `-std=c++11` with supporting compilers; `-std=gnu++98`, otherwise for older versions of g++. This change standardizes the CXXSTD variable, originally added to googletest.test.inc.mk as part of r345203. As part of this effort, convert all `CXXFLAGS+= -std=*` calls to use `CXXSTD`. Notes: This value is not sanity checked in bsd.sys.mk, however, given the two most used C++ compilers on FreeBSD (clang++ and g++) support both modes, it is likely to work with both toolchains. This method will be refined in the future to support more variants of C++, as not all versions of clang++ and g++ (for instance) support C++14, C++17, etc. Any manual appending of `-std=*` to `CXXFLAGS` should be replaced with CXXSTD. Example: Before this commit: ``` CXXFLAGS+= -std=c++14 ``` After this commit: ``` CXXSTD= c++14 ``` Reviewed by: asomers Approved by: emaste (mentor) MFC after: 1 month MFC with: r345203, r345704, r345705 Relnotes: yes Tested with: make tinderbox Differential Revision: https://reviews.freebsd.org/D19732 Modified: head/lib/clang/llvm.build.mk head/lib/libc++/Makefile head/lib/libc++experimental/Makefile head/lib/libc++fs/Makefile head/lib/libclang_rt/Makefile.inc head/lib/libcxxrt/Makefile head/lib/libgcc_eh/Makefile.inc head/lib/libomp/Makefile head/lib/ofed/libibnetdisc/Makefile head/share/mk/bsd.sys.mk head/share/mk/googletest.test.inc.mk head/usr.bin/dtc/Makefile head/usr.sbin/pmc/Makefile Modified: head/lib/clang/llvm.build.mk ============================================================================== --- head/lib/clang/llvm.build.mk Fri Mar 29 18:43:46 2019 (r345707) +++ head/lib/clang/llvm.build.mk Fri Mar 29 18:45:27 2019 (r345708) @@ -95,7 +95,7 @@ CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections LDFLAGS+= -Wl,--gc-sections -CXXFLAGS+= -std=c++11 +CXXSTD?= c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti CXXFLAGS.clang+= -stdlib=libc++ Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Fri Mar 29 18:43:46 2019 (r345707) +++ head/lib/libc++/Makefile Fri Mar 29 18:45:27 2019 (r345708) @@ -76,9 +76,7 @@ CFLAGS+= -nostdinc++ CFLAGS+= -nostdlib CFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif +CXXSTD= c++11 LIBADD+= cxxrt INCSGROUPS= STD EXP EXT Modified: head/lib/libc++experimental/Makefile ============================================================================== --- head/lib/libc++experimental/Makefile Fri Mar 29 18:43:46 2019 (r345707) +++ head/lib/libc++experimental/Makefile Fri Mar 29 18:45:27 2019 (r345708) @@ -20,8 +20,6 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++14 -.endif +CXXSTD= c++14 .include Modified: head/lib/libc++fs/Makefile ============================================================================== --- head/lib/libc++fs/Makefile Fri Mar 29 18:43:46 2019 (r345707) +++ head/lib/libc++fs/Makefile Fri Mar 29 18:45:27 2019 (r345708) @@ -22,8 +22,6 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++14 -.endif +CXXSTD= c++14 .include Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Fri Mar 29 18:43:46 2019 (r345707) +++ head/lib/libclang_rt/Makefile.inc Fri Mar 29 18:45:27 2019 (r345708) @@ -41,4 +41,4 @@ CFLAGS+= -funwind-tables CXXFLAGS+= -fvisibility-inlines-hidden CXXFLAGS+= -fvisibility=hidden CFLAGS+= -I${CRTSRC}/lib -CXXFLAGS+= -std=c++11 +CXXSTD= c++11 Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Fri Mar 29 18:43:46 2019 (r345707) +++ head/lib/libcxxrt/Makefile Fri Mar 29 18:45:27 2019 (r345708) @@ -22,9 +22,7 @@ SRCS+= libelftc_dem_gnu3.c\ WARNS= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif +CXXSTD= c++11 VERSION_MAP= ${.CURDIR}/Version.map .include Modified: head/lib/libgcc_eh/Makefile.inc ============================================================================== --- head/lib/libgcc_eh/Makefile.inc Fri Mar 29 18:43:46 2019 (r345707) +++ head/lib/libgcc_eh/Makefile.inc Fri Mar 29 18:45:27 2019 (r345708) @@ -27,10 +27,8 @@ CXXFLAGS.${file}+= -fno-exceptions -funwind-tables .endfor CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif CXXFLAGS+= -fno-rtti +CXXSTD= c++11 STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC # Probably need to just move this earlier or use CXXFLAGS .if ${MK_DIRDEPS_BUILD} == "yes" Modified: head/lib/libomp/Makefile ============================================================================== --- head/lib/libomp/Makefile Fri Mar 29 18:43:46 2019 (r345707) +++ head/lib/libomp/Makefile Fri Mar 29 18:45:27 2019 (r345708) @@ -53,9 +53,9 @@ CFLAGS+= -I${ITTSRC} CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections CXXFLAGS+= -fvisibility-inlines-hidden -CXXFLAGS+= -std=c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti +CXXSTD= c++11 LDFLAGS+= -Wl,--warn-shared-textrel LDFLAGS+= -Wl,--gc-sections Modified: head/lib/ofed/libibnetdisc/Makefile ============================================================================== --- head/lib/ofed/libibnetdisc/Makefile Fri Mar 29 18:43:46 2019 (r345707) +++ head/lib/ofed/libibnetdisc/Makefile Fri Mar 29 18:45:27 2019 (r345708) @@ -31,9 +31,6 @@ LIBADD= osmcomp ibmad ibumad CFLAGS+= -DHAVE_CONFIG_H=1 CFLAGS+= -I${_spath} CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband -.if ${COMPILER_FEATURES:Mc++11} -CXXFLAGS+= -std=c++11 -.endif VERSION_MAP= ${_spath}/libibnetdisc.map .include Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Mar 29 18:43:46 2019 (r345707) +++ head/share/mk/bsd.sys.mk Fri Mar 29 18:45:27 2019 (r345708) @@ -24,6 +24,19 @@ CFLAGS+= -std=iso9899:1999 .else # CSTD CFLAGS+= -std=${CSTD} .endif # CSTD + +.if ${COMPILER_FEATURES:Mc++11} +CXXSTD?= c++11 +.elif ${COMPILER_TYPE} == "gcc" +# Prior versions of g++ support C++98 with GNU extensions by default. +CXXSTD?= gnu++98 +.else +# Assume that the compiler supports at least C++98. +CXXSTD?= c++98 +.endif +CXXFLAGS+= -std=${CXXSTD} +# CXXSTD + # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS+= -pedantic .if defined(WARNS) Modified: head/share/mk/googletest.test.inc.mk ============================================================================== --- head/share/mk/googletest.test.inc.mk Fri Mar 29 18:43:46 2019 (r345707) +++ head/share/mk/googletest.test.inc.mk Fri Mar 29 18:45:27 2019 (r345708) @@ -1,13 +1,9 @@ # $FreeBSD$ -# XXX: this should be defined in bsd.sys.mk -CXXSTD?= c++11 - GTESTS_CXXFLAGS+= -DGTEST_HAS_POSIX_RE=1 GTESTS_CXXFLAGS+= -DGTEST_HAS_PTHREAD=1 GTESTS_CXXFLAGS+= -DGTEST_HAS_STREAM_REDIRECTION=1 GTESTS_CXXFLAGS+= -frtti -GTESTS_CXXFLAGS+= -std=${CXXSTD} # XXX: src.libnames.mk should handle adding this directory for libgtest's, # libgmock's, etc, headers. Modified: head/usr.bin/dtc/Makefile ============================================================================== --- head/usr.bin/dtc/Makefile Fri Mar 29 18:43:46 2019 (r345707) +++ head/usr.bin/dtc/Makefile Fri Mar 29 18:45:27 2019 (r345708) @@ -6,7 +6,7 @@ MAN= dtc.1 WARNS?= 3 -CXXFLAGS+= -std=c++11 -fno-rtti -fno-exceptions +CXXFLAGS+= -fno-rtti -fno-exceptions NO_SHARED?=NO Modified: head/usr.sbin/pmc/Makefile ============================================================================== --- head/usr.sbin/pmc/Makefile Fri Mar 29 18:43:46 2019 (r345707) +++ head/usr.sbin/pmc/Makefile Fri Mar 29 18:45:27 2019 (r345708) @@ -6,7 +6,8 @@ PROG_CXX= pmc MAN= WARNS?= 3 -CXXFLAGS+= -O0 -std=c++14 +CXXFLAGS+= -O0 +CXXSTD= c++14 CWARNFLAGS.gcc+= -Wno-redundant-decls LIBADD= kvm pmc m ncursesw pmcstat elf From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7645DC0C5; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ys1qVvz4P1g; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id DF9C619E42; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 92055115EE; Fri, 29 Mar 2019 18:16:40 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D30A722A8; Fri, 29 Mar 2019 18:16:40 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1F459115ED; Fri, 29 Mar 2019 18:16:40 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 49438115EB for ; Fri, 29 Mar 2019 18:16:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00756722A7; Fri, 29 Mar 2019 18:16:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE1792835; Fri, 29 Mar 2019 18:16:36 +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 x2TIGa5V072178; Fri, 29 Mar 2019 18:16:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TIGXdw072164; Fri, 29 Mar 2019 18:16:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201903291816.x2TIGXdw072164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345705 - in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libc/tests/stdlib lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk us... X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libc/tests/stdlib lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk usr.bin/dtc usr.sbin/pmc X-SVN-Commit-Revision: 345705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3D30A722A8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:00 -0000 X-Original-Date: Fri, 29 Mar 2019 18:16:33 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:00 -0000 Author: ngie Date: Fri Mar 29 18:16:33 2019 New Revision: 345705 URL: https://svnweb.freebsd.org/changeset/base/345705 Log: Revert r345704 I accidentally committed code from two reviews. I will reintroduce the code to bsd.progs.mk as part of a separate commit from r345704. Approved by: emaste (mentor, implicit) MFC after: 2 months MFC with: r345704 Modified: head/lib/clang/llvm.build.mk head/lib/libc++/Makefile head/lib/libc++experimental/Makefile head/lib/libc++fs/Makefile head/lib/libc/tests/stdlib/Makefile head/lib/libclang_rt/Makefile.inc head/lib/libcxxrt/Makefile head/lib/libgcc_eh/Makefile.inc head/lib/libomp/Makefile head/lib/ofed/libibnetdisc/Makefile head/share/mk/bsd.progs.mk head/share/mk/bsd.sys.mk head/share/mk/googletest.test.inc.mk head/usr.bin/dtc/Makefile head/usr.sbin/pmc/Makefile Modified: head/lib/clang/llvm.build.mk ============================================================================== --- head/lib/clang/llvm.build.mk Fri Mar 29 18:13:44 2019 (r345704) +++ head/lib/clang/llvm.build.mk Fri Mar 29 18:16:33 2019 (r345705) @@ -95,7 +95,7 @@ CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections LDFLAGS+= -Wl,--gc-sections -CXXSTD?= c++11 +CXXFLAGS+= -std=c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti CXXFLAGS.clang+= -stdlib=libc++ Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Fri Mar 29 18:13:44 2019 (r345704) +++ head/lib/libc++/Makefile Fri Mar 29 18:16:33 2019 (r345705) @@ -76,7 +76,9 @@ CFLAGS+= -nostdinc++ CFLAGS+= -nostdlib CFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CFLAGS+= -DLIBCXXRT -CXXSTD= c++11 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif LIBADD+= cxxrt INCSGROUPS= STD EXP EXT Modified: head/lib/libc++experimental/Makefile ============================================================================== --- head/lib/libc++experimental/Makefile Fri Mar 29 18:13:44 2019 (r345704) +++ head/lib/libc++experimental/Makefile Fri Mar 29 18:16:33 2019 (r345705) @@ -20,6 +20,8 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -CXXSTD= c++14 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++14 +.endif .include Modified: head/lib/libc++fs/Makefile ============================================================================== --- head/lib/libc++fs/Makefile Fri Mar 29 18:13:44 2019 (r345704) +++ head/lib/libc++fs/Makefile Fri Mar 29 18:16:33 2019 (r345705) @@ -22,6 +22,8 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -CXXSTD= c++14 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++14 +.endif .include Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Fri Mar 29 18:13:44 2019 (r345704) +++ head/lib/libc/tests/stdlib/Makefile Fri Mar 29 18:16:33 2019 (r345705) @@ -50,8 +50,8 @@ PROGS+= h_getopt h_getopt_long CFLAGS+= -I${.CURDIR} -CXXSTD.cxa_thread_atexit_test= c++11 -CXXSTD.cxa_thread_atexit_nothr_test= c++11 +CXXFLAGS.cxa_thread_atexit_test+= -std=c++11 +CXXFLAGS.cxa_thread_atexit_nothr_test+= -std=c++11 LIBADD.cxa_thread_atexit_test+= pthread .for t in h_getopt h_getopt_long Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Fri Mar 29 18:13:44 2019 (r345704) +++ head/lib/libclang_rt/Makefile.inc Fri Mar 29 18:16:33 2019 (r345705) @@ -41,4 +41,4 @@ CFLAGS+= -funwind-tables CXXFLAGS+= -fvisibility-inlines-hidden CXXFLAGS+= -fvisibility=hidden CFLAGS+= -I${CRTSRC}/lib -CXXSTD= c++11 +CXXFLAGS+= -std=c++11 Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Fri Mar 29 18:13:44 2019 (r345704) +++ head/lib/libcxxrt/Makefile Fri Mar 29 18:16:33 2019 (r345705) @@ -22,7 +22,9 @@ SRCS+= libelftc_dem_gnu3.c\ WARNS= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ -CXXSTD= c++11 +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif VERSION_MAP= ${.CURDIR}/Version.map .include Modified: head/lib/libgcc_eh/Makefile.inc ============================================================================== --- head/lib/libgcc_eh/Makefile.inc Fri Mar 29 18:13:44 2019 (r345704) +++ head/lib/libgcc_eh/Makefile.inc Fri Mar 29 18:16:33 2019 (r345705) @@ -27,8 +27,10 @@ CXXFLAGS.${file}+= -fno-exceptions -funwind-tables .endfor CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY +.if empty(CXXFLAGS:M-std=*) +CXXFLAGS+= -std=c++11 +.endif CXXFLAGS+= -fno-rtti -CXXSTD= c++11 STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC # Probably need to just move this earlier or use CXXFLAGS .if ${MK_DIRDEPS_BUILD} == "yes" Modified: head/lib/libomp/Makefile ============================================================================== --- head/lib/libomp/Makefile Fri Mar 29 18:13:44 2019 (r345704) +++ head/lib/libomp/Makefile Fri Mar 29 18:16:33 2019 (r345705) @@ -53,9 +53,9 @@ CFLAGS+= -I${ITTSRC} CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections CXXFLAGS+= -fvisibility-inlines-hidden +CXXFLAGS+= -std=c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti -CXXSTD= c++11 LDFLAGS+= -Wl,--warn-shared-textrel LDFLAGS+= -Wl,--gc-sections Modified: head/lib/ofed/libibnetdisc/Makefile ============================================================================== --- head/lib/ofed/libibnetdisc/Makefile Fri Mar 29 18:13:44 2019 (r345704) +++ head/lib/ofed/libibnetdisc/Makefile Fri Mar 29 18:16:33 2019 (r345705) @@ -31,6 +31,9 @@ LIBADD= osmcomp ibmad ibumad CFLAGS+= -DHAVE_CONFIG_H=1 CFLAGS+= -I${_spath} CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband +.if ${COMPILER_FEATURES:Mc++11} +CXXFLAGS+= -std=c++11 +.endif VERSION_MAP= ${_spath}/libibnetdisc.map .include Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Fri Mar 29 18:13:44 2019 (r345704) +++ head/share/mk/bsd.progs.mk Fri Mar 29 18:16:33 2019 (r345705) @@ -22,8 +22,8 @@ PROGS += ${PROGS_CXX} .if defined(PROG) # just one of many -PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE CSTD CXXSTD DPSRCS MAN \ - NO_WERROR PROGNAME SRCS STRIP WARNS +PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ + PROGNAME SRCS STRIP WARNS PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD INTERNALPROG LDADD LIBADD \ LINKS LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Mar 29 18:13:44 2019 (r345704) +++ head/share/mk/bsd.sys.mk Fri Mar 29 18:16:33 2019 (r345705) @@ -24,19 +24,6 @@ CFLAGS+= -std=iso9899:1999 .else # CSTD CFLAGS+= -std=${CSTD} .endif # CSTD - -.if ${COMPILER_FEATURES:Mc++11} -CXXSTD?= c++11 -.elif ${COMPILER_TYPE} == "gcc" -# Prior versions of g++ support C++98 with GNU extensions by default. -CXXSTD?= gnu++98 -.else -# Assume that the compiler supports at least C++98. -CXXSTD?= c++98 -.endif -CXXFLAGS+= -std=${CXXSTD} -# CXXSTD - # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS+= -pedantic .if defined(WARNS) Modified: head/share/mk/googletest.test.inc.mk ============================================================================== --- head/share/mk/googletest.test.inc.mk Fri Mar 29 18:13:44 2019 (r345704) +++ head/share/mk/googletest.test.inc.mk Fri Mar 29 18:16:33 2019 (r345705) @@ -1,9 +1,13 @@ # $FreeBSD$ +# XXX: this should be defined in bsd.sys.mk +CXXSTD?= c++11 + GTESTS_CXXFLAGS+= -DGTEST_HAS_POSIX_RE=1 GTESTS_CXXFLAGS+= -DGTEST_HAS_PTHREAD=1 GTESTS_CXXFLAGS+= -DGTEST_HAS_STREAM_REDIRECTION=1 GTESTS_CXXFLAGS+= -frtti +GTESTS_CXXFLAGS+= -std=${CXXSTD} # XXX: src.libnames.mk should handle adding this directory for libgtest's, # libgmock's, etc, headers. Modified: head/usr.bin/dtc/Makefile ============================================================================== --- head/usr.bin/dtc/Makefile Fri Mar 29 18:13:44 2019 (r345704) +++ head/usr.bin/dtc/Makefile Fri Mar 29 18:16:33 2019 (r345705) @@ -6,7 +6,7 @@ MAN= dtc.1 WARNS?= 3 -CXXFLAGS+= -fno-rtti -fno-exceptions +CXXFLAGS+= -std=c++11 -fno-rtti -fno-exceptions NO_SHARED?=NO Modified: head/usr.sbin/pmc/Makefile ============================================================================== --- head/usr.sbin/pmc/Makefile Fri Mar 29 18:13:44 2019 (r345704) +++ head/usr.sbin/pmc/Makefile Fri Mar 29 18:16:33 2019 (r345705) @@ -6,8 +6,7 @@ PROG_CXX= pmc MAN= WARNS?= 3 -CXXFLAGS+= -O0 -CXXSTD= c++14 +CXXFLAGS+= -O0 -std=c++14 CWARNFLAGS.gcc+= -Wno-redundant-decls LIBADD= kvm pmc m ncursesw pmcstat elf From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CAE13DC0C9; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ys2mDZz4P1m; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 1E26919E65; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id DE771124C9; Fri, 29 Mar 2019 18:49:13 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDAE73CD4; Fri, 29 Mar 2019 18:49:13 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 19A541245E; Fri, 29 Mar 2019 18:49:13 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D5AFD1245C for ; Fri, 29 Mar 2019 18:49:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83CE973CCE; Fri, 29 Mar 2019 18:49:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C5C52D3F; Fri, 29 Mar 2019 18:49:09 +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 x2TIn9H1088067; Fri, 29 Mar 2019 18:49:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TIn8VR088066; Fri, 29 Mar 2019 18:49:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201903291849.x2TIn8VR088066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345709 - in head: lib/libc/tests/stdlib share/mk X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: lib/libc/tests/stdlib share/mk X-SVN-Commit-Revision: 345709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 4DDAE73CD4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:00 -0000 X-Original-Date: Fri, 29 Mar 2019 18:49:08 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:00 -0000 Author: ngie Date: Fri Mar 29 18:49:08 2019 New Revision: 345709 URL: https://svnweb.freebsd.org/changeset/base/345709 Log: Allow users to override CSTD/CXXSTD on a per-prog basis The current logic for CSTD/CXXSTD requires homogenity as far as the supported C/C++ standards, which is a sensible default. However, when dealing with differing versions of C++, some code may compile with C++11, but not C++17 (for instance). So in order to avoid having people convert over their code to the new standard, give the users the ability to specify the standard on a per-program basis. This will allow a user to override the supporting standard for a set of programs, mixing C++11 with C++14 (for instance). Reviewed by: asomers Apprved by: emaste (mentor) MFC after: 1 month MFC with: r345708 Differential Revision: https://reviews.freebsd.org/D19738 Modified: head/lib/libc/tests/stdlib/Makefile head/share/mk/bsd.progs.mk Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Fri Mar 29 18:45:27 2019 (r345708) +++ head/lib/libc/tests/stdlib/Makefile Fri Mar 29 18:49:08 2019 (r345709) @@ -50,8 +50,8 @@ PROGS+= h_getopt h_getopt_long CFLAGS+= -I${.CURDIR} -CXXFLAGS.cxa_thread_atexit_test+= -std=c++11 -CXXFLAGS.cxa_thread_atexit_nothr_test+= -std=c++11 +CXXSTD.cxa_thread_atexit_test= c++11 +CXXSTD.cxa_thread_atexit_nothr_test= c++11 LIBADD.cxa_thread_atexit_test+= pthread .for t in h_getopt h_getopt_long Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Fri Mar 29 18:45:27 2019 (r345708) +++ head/share/mk/bsd.progs.mk Fri Mar 29 18:49:08 2019 (r345709) @@ -22,8 +22,8 @@ PROGS += ${PROGS_CXX} .if defined(PROG) # just one of many -PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ - PROGNAME SRCS STRIP WARNS +PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE CSTD CXXSTD DPSRCS MAN \ + NO_WERROR PROGNAME SRCS STRIP WARNS PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD INTERNALPROG LDADD LIBADD \ LINKS LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38682DC047; Tue, 3 Sep 2019 14:05:55 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yp6qVMz4NyN; Tue, 3 Sep 2019 14:05:54 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 43A9D19D9B; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 851AF9E31; Fri, 29 Mar 2019 14:07:36 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D1BC9382E; Fri, 29 Mar 2019 14:07:36 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 279549E2C; Fri, 29 Mar 2019 14:07:36 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id F39BF9E20 for ; Fri, 29 Mar 2019 14:07:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54A029380F; Fri, 29 Mar 2019 14:07:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E91ED2FCA3; Fri, 29 Mar 2019 14:07:30 +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 x2TE7UPd034554; Fri, 29 Mar 2019 14:07:30 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TE7UEb034553; Fri, 29 Mar 2019 14:07:30 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201903291407.x2TE7UEb034553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345689 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 345689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3D1BC9382E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:58 -0000 X-Original-Date: Fri, 29 Mar 2019 14:07:30 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:58 -0000 Author: asomers Date: Fri Mar 29 14:07:30 2019 New Revision: 345689 URL: https://svnweb.freebsd.org/changeset/base/345689 Log: fix the GENERIC-NODEBUG build after r345675 Submitted by: cy Reported by: cy, Michael Butler MFC after: 2 weeks X-MFC-With: 345675 Modified: head/sys/fs/fuse/fuse_ipc.c Modified: head/sys/fs/fuse/fuse_ipc.c ============================================================================== --- head/sys/fs/fuse/fuse_ipc.c Fri Mar 29 13:38:47 2019 (r345688) +++ head/sys/fs/fuse/fuse_ipc.c Fri Mar 29 14:07:30 2019 (r345689) @@ -220,7 +220,9 @@ fticket_ctor(void *mem, int size, void *arg, int flags static void fticket_dtor(void *mem, int size, void *arg) { +#ifdef INVARIANTS struct fuse_ticket *ftick = mem; +#endif FUSE_ASSERT_MS_DONE(ftick); FUSE_ASSERT_AW_DONE(ftick); From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12AADDC160; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv0pYXz4P3c; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id D757219EE3; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id AF4611127; Sat, 30 Mar 2019 09:24:10 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 337137741C; Sat, 30 Mar 2019 09:24:10 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 11CB41110; Sat, 30 Mar 2019 09:24:10 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id A4339110E for ; Sat, 30 Mar 2019 09:24:07 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7666B77416; Sat, 30 Mar 2019 09:24:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E2F6CD1A; Sat, 30 Mar 2019 09:24:07 +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 x2U9O7k7054218; Sat, 30 Mar 2019 09:24:07 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2U9O79B054217; Sat, 30 Mar 2019 09:24:07 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201903300924.x2U9O79B054217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345729 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 345729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 337137741C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.89 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.89)[-0.890,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:04 -0000 X-Original-Date: Sat, 30 Mar 2019 09:24:07 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:04 -0000 Author: avos Date: Sat Mar 30 09:24:06 2019 New Revision: 345729 URL: https://svnweb.freebsd.org/changeset/base/345729 Log: urtw(4): export TSF timestamp for received frames via radiotap Tested with Netgear WG111 v3 (RTL8187B), STA mode. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwvar.h Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Sat Mar 30 07:29:20 2019 (r345728) +++ head/sys/dev/usb/wlan/if_urtw.c Sat Mar 30 09:24:06 2019 (r345729) @@ -3932,6 +3932,7 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da struct urtw_softc *sc = data->sc; struct ieee80211com *ic = &sc->sc_ic; uint8_t noise = 0, rate; + uint64_t mactime; usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); @@ -3951,6 +3952,9 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da /* XXX correct? */ rssi = rx->rssi & URTW_RX_RSSI_MASK; noise = rx->noise; + + if (ieee80211_radiotap_active(ic)) + mactime = rx->mactime; } else { struct urtw_8187l_rxhdr *rx; @@ -3967,6 +3971,9 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da /* XXX correct? */ rssi = rx->rssi & URTW_RX_8187L_RSSI_MASK; noise = rx->noise; + + if (ieee80211_radiotap_active(ic)) + mactime = rx->mactime; } if (flen < IEEE80211_ACK_LEN) @@ -3986,6 +3993,7 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da if (ieee80211_radiotap_active(ic)) { struct urtw_rx_radiotap_header *tap = &sc->sc_rxtap; + tap->wr_tsf = mactime; tap->wr_flags = 0; tap->wr_dbm_antsignal = (int8_t)rssi; } Modified: head/sys/dev/usb/wlan/if_urtwvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwvar.h Sat Mar 30 07:29:20 2019 (r345728) +++ head/sys/dev/usb/wlan/if_urtwvar.h Sat Mar 30 09:24:06 2019 (r345729) @@ -55,6 +55,7 @@ typedef STAILQ_HEAD(, urtw_data) urtw_datahead; struct urtw_rx_radiotap_header { struct ieee80211_radiotap_header wr_ihdr; + uint64_t wr_tsf; uint8_t wr_flags; uint8_t wr_pad; uint16_t wr_chan_freq; @@ -63,7 +64,8 @@ struct urtw_rx_radiotap_header { } __packed __aligned(8); #define URTW_RX_RADIOTAP_PRESENT \ - ((1 << IEEE80211_RADIOTAP_FLAGS) | \ + ((1 << IEEE80211_RADIOTAP_TSFT) | \ + (1 << IEEE80211_RADIOTAP_FLAGS) | \ (1 << IEEE80211_RADIOTAP_CHANNEL) | \ (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL)) From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40555DC0F1; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ys5f4pz4P2N; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 40BFC19E83; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 6BBDB145B7; Fri, 29 Mar 2019 20:21:40 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EC2D8041F; Fri, 29 Mar 2019 20:21:40 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 14CFF145B6; Fri, 29 Mar 2019 20:21:40 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 3AE71145B4 for ; Fri, 29 Mar 2019 20:21:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11F1B80417; Fri, 29 Mar 2019 20:21:37 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFB8340B2; Fri, 29 Mar 2019 20:21:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2TKLa0J039452; Fri, 29 Mar 2019 20:21:36 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TKLSZR039409; Fri, 29 Mar 2019 20:21:28 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201903292021.x2TKLSZR039409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345713 - in head: sys/amd64/acpica sys/arm64/acpica sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: sys/amd64/acpica sys/arm64/acpica sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... X-SVN-Commit-Revision: 345713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 2EC2D8041F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:02 -0000 X-Original-Date: Fri, 29 Mar 2019 20:21:28 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:02 -0000 Author: jkim Date: Fri Mar 29 20:21:28 2019 New Revision: 345713 URL: https://svnweb.freebsd.org/changeset/base/345713 Log: Merge ACPICA 20190329. Modified: head/sys/amd64/acpica/acpi_machdep.c head/sys/arm64/acpica/acpi_machdep.c head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/acfileio.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/ahpredef.c head/sys/contrib/dev/acpica/common/ahtable.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtables.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmethod.c head/sys/contrib/dev/acpica/compiler/asloffset.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/asltransform.c head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dttemplate.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/components/disassembler/dmnames.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c head/sys/contrib/dev/acpica/components/events/evgpeinit.c head/sys/contrib/dev/acpica/components/executer/exnames.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nsdump.c head/sys/contrib/dev/acpica/components/namespace/nsinit.c head/sys/contrib/dev/acpica/components/namespace/nsnames.c head/sys/contrib/dev/acpica/components/namespace/nsobject.c head/sys/contrib/dev/acpica/components/namespace/nsparse.c head/sys/contrib/dev/acpica/components/namespace/nsrepair.c head/sys/contrib/dev/acpica/components/namespace/nsrepair2.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/namespace/nsxfname.c head/sys/contrib/dev/acpica/components/parser/psargs.c head/sys/contrib/dev/acpica/components/resources/rsxface.c head/sys/contrib/dev/acpica/components/tables/tbdata.c head/sys/contrib/dev/acpica/components/tables/tbfind.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbprint.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/components/tables/tbxfload.c head/sys/contrib/dev/acpica/components/utilities/utascii.c head/sys/contrib/dev/acpica/components/utilities/utdecode.c head/sys/contrib/dev/acpica/components/utilities/utmisc.c head/sys/contrib/dev/acpica/components/utilities/utpredef.c head/sys/contrib/dev/acpica/components/utilities/utstring.c head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actbl.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/dev/acpica/Osd/OsdTable.c head/sys/dev/acpica/acpi_quirk.c head/sys/i386/acpica/acpi_machdep.c head/usr.sbin/acpi/acpidump/acpi.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/amd64/acpica/acpi_machdep.c ============================================================================== --- head/sys/amd64/acpica/acpi_machdep.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/amd64/acpica/acpi_machdep.c Fri Mar 29 20:21:28 2019 (r345713) @@ -164,7 +164,7 @@ map_table(vm_paddr_t pa, int offset, const char *sig) void *table; header = table_map(pa, offset, sizeof(ACPI_TABLE_HEADER)); - if (strncmp(header->Signature, sig, ACPI_NAME_SIZE) != 0) { + if (strncmp(header->Signature, sig, ACPI_NAMESEG_SIZE) != 0) { table_unmap(header, sizeof(ACPI_TABLE_HEADER)); return (NULL); } @@ -202,7 +202,7 @@ probe_table(vm_paddr_t address, const char *sig) printf("Table '%.4s' at 0x%jx\n", table->Signature, (uintmax_t)address); - if (strncmp(table->Signature, sig, ACPI_NAME_SIZE) != 0) { + if (strncmp(table->Signature, sig, ACPI_NAMESEG_SIZE) != 0) { table_unmap(table, sizeof(ACPI_TABLE_HEADER)); return (0); } Modified: head/sys/arm64/acpica/acpi_machdep.c ============================================================================== --- head/sys/arm64/acpica/acpi_machdep.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/arm64/acpica/acpi_machdep.c Fri Mar 29 20:21:28 2019 (r345713) @@ -70,7 +70,7 @@ map_table(vm_paddr_t pa, int offset, const char *sig) void *table; header = pmap_mapbios(pa, sizeof(ACPI_TABLE_HEADER)); - if (strncmp(header->Signature, sig, ACPI_NAME_SIZE) != 0) { + if (strncmp(header->Signature, sig, ACPI_NAMESEG_SIZE) != 0) { pmap_unmapbios((vm_offset_t)header, sizeof(ACPI_TABLE_HEADER)); return (NULL); } @@ -109,7 +109,7 @@ probe_table(vm_paddr_t address, const char *sig) printf("Table '%.4s' at 0x%jx\n", table->Signature, (uintmax_t)address); - if (strncmp(table->Signature, sig, ACPI_NAME_SIZE) != 0) { + if (strncmp(table->Signature, sig, ACPI_NAMESEG_SIZE) != 0) { pmap_unmapbios((vm_offset_t)table, sizeof(ACPI_TABLE_HEADER)); return (0); } Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/changes.txt Fri Mar 29 20:21:28 2019 (r345713) @@ -1,7 +1,75 @@ ---------------------------------------- -15 February 2019. Summary of changes for version 20190215: +29 March 2019. Summary of changes for version 20190329: -This release is available at https://acpica.org/downloads + +1) ACPICA kernel-resident subsystem: + +Namespace support: Remove the address nodes from global list after method +termination. The global address list contains pointers to namespace nodes +that represent Operation Regions. This change properly removes Operation +Region namespace nodes that are declared dynamically during method +execution. + +Linux: Use a different debug default than ACPICA. There was a divergence +between Linux and the ACPICA codebases. In order to resolve this +divergence, Linux now declares its own debug default in aclinux.h + +Renamed some internal macros to improve code understanding and +maintenance. The macros below all operate on single 4-character ACPI +NameSegs, not generic strings (old -> new): + ACPI_NAME_SIZE -> ACPI_NAMESEG_SIZE + ACPI_COMPARE_NAME -> ACPI_COMPARE_NAMESEG + ACPI_MOVE_NAME -> ACPI_COPY_NAMESEG + +Fix for missing comma in array declaration for the AcpiGbl_GenericNotify +table. + +Test suite: Update makefiles, add PCC operation region support + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented additional illegal forward reference detection. Now +detect and emit an error upon detection of a forward reference from a +Field to an Operation Region. This will fail at runtime if allowed to +pass the compiler. + +AcpiExec: Add an address list check for dynamic Operation Regions. This +feature performs a sanity test for each node the global address list. +This is done in order to ensure that all dynamic operation regions are +properly removed from the global address list and no dangling pointers +are left behind. + +Disassembler: Improved generation of resource pathnames. This change +improves the code that generates resource descriptor and resource tag +pathnames. The original code used a bunch of str* C library functions +that caused warnings on some compilers. + +iASL: Removed some uses of strncpy and replaced with memmove. The strncpy +function can overwrite buffers if the calling code is not very careful. +In the case of generating a module/table header, use of memmove is a +better implementation. + + +3) Status of new features that have not been completed at this time: + +iASL: Implementing an enhanced multiple file compilation into a single +namespace feature (Status): This feature will be released soon, and +allows multiple ASL files to be compiled into the same single namespace. +By doing so, any unresolved external declarations as well as duplicate +named object declarations can be detected during compilation (rather than +later during runtime). The following commands are examples that utilize +this feature: + iasl dsdt.asl ssdt.asl + iasl dsdt.asl ssdt1.asl ssdt2.asl + iasl dsdt.asl ssdt*.asl + +ASL tutorial status: Feedback is being gathered internally and the +current plan is to publish this tutorial on the ACPICA website after a +final review by a tech writer. + +---------------------------------------- +15 February 2019. Summary of changes for version 20190215: 0) Support for ACPI specification version 6.3: Modified: head/sys/contrib/dev/acpica/common/acfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/common/acfileio.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/common/acfileio.c Fri Mar 29 20:21:28 2019 (r345713) @@ -585,7 +585,7 @@ AcValidateTableHeader ( * These fields must be ASCII: OemId, OemTableId, AslCompilerId. * We allow a NULL terminator in OemId and OemTableId. */ - for (i = 0; i < ACPI_NAME_SIZE; i++) + for (i = 0; i < ACPI_NAMESEG_SIZE; i++) { if (!ACPI_IS_ASCII ((UINT8) TableHeader.AslCompilerId[i])) { Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/common/adisasm.c Fri Mar 29 20:21:28 2019 (r345713) @@ -459,7 +459,7 @@ AdDisassembleOneTable ( */ if (AcpiGbl_CaptureComments) { - strncpy (Table->Signature, AcpiGbl_TableSig, ACPI_NAME_SIZE); + strncpy (Table->Signature, AcpiGbl_TableSig, ACPI_NAMESEG_SIZE); } #endif Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/common/adwalk.c Fri Mar 29 20:21:28 2019 (r345713) @@ -814,7 +814,7 @@ AcpiDmLoadDescendingOp ( while (AcpiGbl_PreDefinedNames[PreDefineIndex].Name) { - if (ACPI_COMPARE_NAME (Node->Name.Ascii, + if (ACPI_COMPARE_NAMESEG (Node->Name.Ascii, AcpiGbl_PreDefinedNames[PreDefineIndex].Name)) { PreDefined = TRUE; Modified: head/sys/contrib/dev/acpica/common/ahpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahpredef.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/common/ahpredef.c Fri Mar 29 20:21:28 2019 (r345713) @@ -490,7 +490,7 @@ AcpiAhMatchPredefinedName ( for (Info = AslPredefinedInfo; Info->Name; Info++) { - if (ACPI_COMPARE_NAME (Nameseg, Info->Name)) + if (ACPI_COMPARE_NAMESEG (Nameseg, Info->Name)) { return (Info); } Modified: head/sys/contrib/dev/acpica/common/ahtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahtable.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/common/ahtable.c Fri Mar 29 20:21:28 2019 (r345713) @@ -183,7 +183,7 @@ AcpiAhGetTableInfo ( for (Info = AcpiGbl_SupportedTables; Info->Signature; Info++) { - if (ACPI_COMPARE_NAME (Signature, Info->Signature)) + if (ACPI_COMPARE_NAMESEG (Signature, Info->Signature)) { return (Info); } Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Fri Mar 29 20:21:28 2019 (r345713) @@ -747,6 +747,7 @@ AcpiGetTagPathname ( UINT8 ResourceTableIndex; ACPI_SIZE RequiredSize; char *Pathname; + char *PathnameEnd; AML_RESOURCE *Aml; ACPI_PARSE_OBJECT *Op; char *InternalPath; @@ -809,20 +810,27 @@ AcpiGetTagPathname ( RequiredSize, FALSE); /* - * Create the full path to the resource and tag by: remove the buffer name, - * append the resource descriptor name, append a dot, append the tag name. + * Create the full path to the resource and tag by: + * 1) Remove the buffer nameseg from the end of the pathname + * 2) Append the resource descriptor nameseg + * 3) Append a dot + * 4) Append the field tag nameseg * - * TBD: Always using the full path is a bit brute force, the path can be + * Always using the full path is a bit brute force, the path can be * often be optimized with carats (if the original buffer namepath is a * single nameseg). This doesn't really matter, because these paths do not * end up in the final compiled AML, it's just an appearance issue for the * disassembled code. */ - Pathname[strlen (Pathname) - ACPI_NAME_SIZE] = 0; - strncat (Pathname, ResourceNode->Name.Ascii, ACPI_NAME_SIZE); - strcat (Pathname, "."); - strncat (Pathname, Tag, ACPI_NAME_SIZE); + PathnameEnd = Pathname + (RequiredSize - ACPI_NAMESEG_SIZE - 1); + ACPI_COPY_NAMESEG (PathnameEnd, ResourceNode->Name.Ascii); + PathnameEnd += ACPI_NAMESEG_SIZE; + *PathnameEnd = '.'; + + PathnameEnd++; + ACPI_COPY_NAMESEG (PathnameEnd, Tag); + /* Internalize the namepath to AML format */ AcpiNsInternalizeName (Pathname, &InternalPath); @@ -863,7 +871,7 @@ static void AcpiDmUpdateResourceName ( ACPI_NAMESPACE_NODE *ResourceNode) { - char Name[ACPI_NAME_SIZE]; + char Name[ACPI_NAMESEG_SIZE]; /* Ignore if a unique name has already been assigned */ Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/common/dmtable.c Fri Mar 29 20:21:28 2019 (r345713) @@ -602,7 +602,7 @@ AcpiDmGetTableData ( for (Info = AcpiDmTableData; Info->Signature; Info++) { - if (ACPI_COMPARE_NAME (Signature, Info->Signature)) + if (ACPI_COMPARE_NAMESEG (Signature, Info->Signature)) { return (Info); } @@ -657,7 +657,7 @@ AcpiDmDumpDataTable ( * Handle tables that don't use the common ACPI table header structure. * Currently, these are the FACS, RSDP, and S3PT. */ - if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS)) + if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_FACS)) { Length = Table->Length; Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs); @@ -670,7 +670,7 @@ AcpiDmDumpDataTable ( { Length = AcpiDmDumpRsdp (Table); } - else if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_S3PT)) + else if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_S3PT)) { Length = AcpiDmDumpS3pt (Table); } Modified: head/sys/contrib/dev/acpica/common/dmtables.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtables.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/common/dmtables.c Fri Mar 29 20:21:28 2019 (r345713) @@ -281,7 +281,7 @@ AdCreateTableHeader ( /* Revision of DSDT controls the ACPI integer width */ - if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT)) + if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_DSDT)) { AcpiOsPrintf (" **** 32-bit table (V1), no 64-bit math support"); } Modified: head/sys/contrib/dev/acpica/compiler/aslanalyze.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslanalyze.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/aslanalyze.c Fri Mar 29 20:21:28 2019 (r345713) @@ -563,14 +563,14 @@ ApCheckForGpeNameConflict ( { ACPI_PARSE_OBJECT *NextOp; UINT32 GpeNumber; - char Name[ACPI_NAME_SIZE + 1]; - char Target[ACPI_NAME_SIZE]; + char Name[ACPI_NAMESEG_SIZE + 1]; + char Target[ACPI_NAMESEG_SIZE]; /* Need a null-terminated string version of NameSeg */ ACPI_MOVE_32_TO_32 (Name, &Op->Asl.NameSeg); - Name[ACPI_NAME_SIZE] = 0; + Name[ACPI_NAMESEG_SIZE] = 0; /* * For a GPE method: @@ -622,7 +622,7 @@ ApCheckForGpeNameConflict ( if ((NextOp->Asl.ParseOpcode == PARSEOP_METHOD) || (NextOp->Asl.ParseOpcode == PARSEOP_NAME)) { - if (ACPI_COMPARE_NAME (Target, NextOp->Asl.NameSeg)) + if (ACPI_COMPARE_NAMESEG (Target, NextOp->Asl.NameSeg)) { /* Found both _Exy and _Lxy in the same scope, error */ @@ -666,7 +666,7 @@ ApCheckRegMethod ( /* We are only interested in _REG methods */ - if (!ACPI_COMPARE_NAME (METHOD_NAME__REG, &Op->Asl.NameSeg)) + if (!ACPI_COMPARE_NAMESEG (METHOD_NAME__REG, &Op->Asl.NameSeg)) { return; } @@ -772,7 +772,7 @@ ApDeviceSubtreeWalk ( /* These are what we are looking for */ - if (ACPI_COMPARE_NAME (Name, Op->Asl.NameSeg)) + if (ACPI_COMPARE_NAMESEG (Name, Op->Asl.NameSeg)) { return (AE_CTRL_TRUE); } @@ -831,7 +831,7 @@ ApFindNameInScope ( if ((Next->Asl.ParseOpcode == PARSEOP_METHOD) || (Next->Asl.ParseOpcode == PARSEOP_NAME)) { - if (ACPI_COMPARE_NAME (Name, Next->Asl.NameSeg)) + if (ACPI_COMPARE_NAMESEG (Name, Next->Asl.NameSeg)) { return (TRUE); } Modified: head/sys/contrib/dev/acpica/compiler/aslcodegen.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcodegen.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/aslcodegen.c Fri Mar 29 20:21:28 2019 (r345713) @@ -523,6 +523,8 @@ CgWriteAmlOpcode ( * * DESCRIPTION: Write a table header corresponding to the DEFINITIONBLOCK * + * NOTE: Input strings should be validated before this function is invoked. + * ******************************************************************************/ static void @@ -534,6 +536,8 @@ CgWriteTableHeader ( ACPI_COMMENT_NODE *Current; + memset (&AslGbl_TableHeader, 0, sizeof (ACPI_TABLE_HEADER)); + /* AML filename */ Child = Op->Asl.Child; @@ -552,11 +556,11 @@ CgWriteTableHeader ( */ if (AcpiGbl_CaptureComments) { - strncpy(AcpiGbl_TableSig, Child->Asl.Value.String, ACPI_NAME_SIZE); + ACPI_COPY_NAMESEG (AcpiGbl_TableSig, Child->Asl.Value.String); Child->Asl.Value.String = ACPI_SIG_XXXX; } - strncpy (AslGbl_TableHeader.Signature, Child->Asl.Value.String, ACPI_NAME_SIZE); + ACPI_COPY_NAMESEG (AslGbl_TableHeader.Signature, Child->Asl.Value.String); /* Revision */ @@ -573,12 +577,14 @@ CgWriteTableHeader ( /* OEMID */ Child = Child->Asl.Next; - strncpy (AslGbl_TableHeader.OemId, Child->Asl.Value.String, ACPI_OEM_ID_SIZE); + memcpy (AslGbl_TableHeader.OemId, Child->Asl.Value.String, + strlen (Child->Asl.Value.String)); /* OEM TableID */ Child = Child->Asl.Next; - strncpy (AslGbl_TableHeader.OemTableId, Child->Asl.Value.String, ACPI_OEM_TABLE_ID_SIZE); + memcpy (AslGbl_TableHeader.OemTableId, Child->Asl.Value.String, + strlen (Child->Asl.Value.String)); /* OEM Revision */ @@ -587,7 +593,7 @@ CgWriteTableHeader ( /* Compiler ID */ - ACPI_MOVE_NAME (AslGbl_TableHeader.AslCompilerId, ASL_CREATOR_ID); + ACPI_COPY_NAMESEG (AslGbl_TableHeader.AslCompilerId, ASL_CREATOR_ID); /* Compiler version */ Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.l Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.l Fri Mar 29 20:21:28 2019 (r345713) @@ -813,7 +813,7 @@ NamePathTail [.]{NameSeg} {NameSeg} { char *s; count (0); - s=UtLocalCacheCalloc (ACPI_NAME_SIZE + 1); + s=UtLocalCacheCalloc (ACPI_NAMESEG_SIZE + 1); if (strcmp (AslCompilertext, "\\")) { /* Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asldefine.h Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/asldefine.h Fri Mar 29 20:21:28 2019 (r345713) @@ -162,7 +162,7 @@ #define ASL_CREATOR_ID "INTL" #define ASL_DEFINE "__IASL__" #define ASL_PREFIX "iASL: " -#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.2A" +#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.3" /* Configuration constants */ Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Fri Mar 29 20:21:28 2019 (r345713) @@ -1239,7 +1239,7 @@ AslElevateException ( return (AE_LIMIT); } - AslGbl_ElevatedMessages[AslGbl_ExpectedMessagesIndex] = MessageId; + AslGbl_ElevatedMessages[AslGbl_ElevatedMessagesIndex] = MessageId; AslGbl_ElevatedMessagesIndex++; return (AE_OK); } Modified: head/sys/contrib/dev/acpica/compiler/aslload.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslload.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/aslload.c Fri Mar 29 20:21:28 2019 (r345713) @@ -492,7 +492,7 @@ LdNamespace1Begin ( case AML_FIELD_OP: Status = LdLoadFieldElements (Op, WalkState); - return (Status); + break; case AML_INT_CONNECTION_OP: @@ -556,7 +556,8 @@ LdNamespace1Begin ( * We only want references to named objects: * Store (2, WXYZ) -> Attempt to resolve the name */ - if (OpInfo->Class == AML_CLASS_NAMED_OBJECT) + if ((OpInfo->Class == AML_CLASS_NAMED_OBJECT) && + (OpInfo->Type != AML_TYPE_NAMED_FIELD)) { return (AE_OK); } @@ -702,7 +703,7 @@ LdNamespace1Begin ( /* However, this is an error -- operand to Scope must exist */ - if (strlen (Op->Asl.ExternalName) == ACPI_NAME_SIZE) + if (strlen (Op->Asl.ExternalName) == ACPI_NAMESEG_SIZE) { AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, Op->Asl.ExternalName); @@ -731,7 +732,7 @@ LdNamespace1Begin ( * 10/2015. */ if ((Node->Flags & ANOBJ_IS_EXTERNAL) && - (ACPI_COMPARE_NAME (AslGbl_TableSignature, "DSDT"))) + (ACPI_COMPARE_NAMESEG (AslGbl_TableSignature, "DSDT"))) { /* However, allowed if the reference is within a method */ @@ -1095,7 +1096,7 @@ LdNamespace2Begin ( { /* Standalone NameSeg vs. NamePath */ - if (strlen (Arg->Asl.ExternalName) == ACPI_NAME_SIZE) + if (strlen (Arg->Asl.ExternalName) == ACPI_NAMESEG_SIZE) { AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, Arg->Asl.ExternalName); Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.c Fri Mar 29 20:21:28 2019 (r345713) @@ -342,7 +342,7 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_RANGE */ "Constant out of range", /* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer", /* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency", -/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Illegal forward reference", +/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Forward references are not supported by the ASL language", /* ASL_MSG_ILLEGAL_METHOD_REF */ "Object is declared in a different method", /* ASL_MSG_LOCAL_NOT_USED */ "Method Local is set but never used", /* ASL_MSG_ARG_AS_LOCAL_NOT_USED */ "Method Argument (as a local) is set but never used", Modified: head/sys/contrib/dev/acpica/compiler/aslmethod.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmethod.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/aslmethod.c Fri Mar 29 20:21:28 2019 (r345713) @@ -228,7 +228,7 @@ MtMethodAnalysisWalkBegin ( * 1) _PS0 - One of these must exist: _PS1, _PS2, _PS3 * 2) _PS1/_PS2/_PS3: A _PS0 must exist */ - if (ACPI_COMPARE_NAME (METHOD_NAME__PS0, Op->Asl.NameSeg)) + if (ACPI_COMPARE_NAMESEG (METHOD_NAME__PS0, Op->Asl.NameSeg)) { /* For _PS0, one of _PS1/_PS2/_PS3 must exist */ @@ -241,9 +241,9 @@ MtMethodAnalysisWalkBegin ( } } else if ( - ACPI_COMPARE_NAME (METHOD_NAME__PS1, Op->Asl.NameSeg) || - ACPI_COMPARE_NAME (METHOD_NAME__PS2, Op->Asl.NameSeg) || - ACPI_COMPARE_NAME (METHOD_NAME__PS3, Op->Asl.NameSeg)) + ACPI_COMPARE_NAMESEG (METHOD_NAME__PS1, Op->Asl.NameSeg) || + ACPI_COMPARE_NAMESEG (METHOD_NAME__PS2, Op->Asl.NameSeg) || + ACPI_COMPARE_NAMESEG (METHOD_NAME__PS3, Op->Asl.NameSeg)) { /* For _PS1/_PS2/_PS3, a _PS0 must exist */ Modified: head/sys/contrib/dev/acpica/compiler/asloffset.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloffset.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/asloffset.c Fri Mar 29 20:21:28 2019 (r345713) @@ -258,7 +258,7 @@ LsAmlOffsetWalk ( /* Get offset of last nameseg and the actual data */ NamepathOffset = AslGbl_CurrentAmlOffset + Length + - (Op->Asl.FinalAmlLength - ACPI_NAME_SIZE); + (Op->Asl.FinalAmlLength - ACPI_NAMESEG_SIZE); DataOffset = AslGbl_CurrentAmlOffset + Length + Op->Asl.FinalAmlLength; @@ -323,7 +323,7 @@ LsAmlOffsetWalk ( /* Get offset of last nameseg and the actual data */ NamepathOffset = AslGbl_CurrentAmlOffset + Length + - (NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE); + (NextOp->Asl.FinalAmlLength - ACPI_NAMESEG_SIZE); DataOffset = AslGbl_CurrentAmlOffset + Length + (NextOp->Asl.FinalAmlLength + 1); @@ -370,7 +370,7 @@ LsAmlOffsetWalk ( /* Get offset of last nameseg and the actual data (flags byte) */ NamepathOffset = AslGbl_CurrentAmlOffset + Length + - (NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE); + (NextOp->Asl.FinalAmlLength - ACPI_NAMESEG_SIZE); DataOffset = AslGbl_CurrentAmlOffset + Length + NextOp->Asl.FinalAmlLength; @@ -394,7 +394,7 @@ LsAmlOffsetWalk ( /* Get offset of last nameseg and the actual data (PBlock address) */ NamepathOffset = AslGbl_CurrentAmlOffset + Length + - (NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE); + (NextOp->Asl.FinalAmlLength - ACPI_NAMESEG_SIZE); DataOffset = AslGbl_CurrentAmlOffset + Length + (NextOp->Asl.FinalAmlLength + 1); @@ -419,7 +419,7 @@ LsAmlOffsetWalk ( /* Get offset of last nameseg */ NamepathOffset = AslGbl_CurrentAmlOffset + Length + - (NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE); + (NextOp->Asl.FinalAmlLength - ACPI_NAMESEG_SIZE); LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, 0, Op->Asl.ParseOpName, 0, (UINT8) 0, Op->Asl.AmlOpcode); Modified: head/sys/contrib/dev/acpica/compiler/asloperands.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloperands.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/asloperands.c Fri Mar 29 20:21:28 2019 (r345713) @@ -1087,13 +1087,13 @@ OpnDoDefinitionBlock ( if (Child->Asl.Value.String) { AslGbl_TableSignature = Child->Asl.Value.String; - if (strlen (AslGbl_TableSignature) != ACPI_NAME_SIZE) + if (strlen (AslGbl_TableSignature) != ACPI_NAMESEG_SIZE) { AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child, "Length must be exactly 4 characters"); } - for (i = 0; i < ACPI_NAME_SIZE; i++) + for (i = 0; i < ACPI_NAMESEG_SIZE; i++) { if (!isalnum ((int) AslGbl_TableSignature[i])) { Modified: head/sys/contrib/dev/acpica/compiler/aslopt.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopt.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/aslopt.c Fri Mar 29 20:21:28 2019 (r345713) @@ -241,7 +241,7 @@ OptSearchToRoot ( * not match, and we cannot use this optimization. */ Path = &(((char *) TargetPath->Pointer)[ - TargetPath->Length - ACPI_NAME_SIZE]); + TargetPath->Length - ACPI_NAMESEG_SIZE]); ScopeInfo.Scope.Node = CurrentNode; /* Lookup the NameSeg using SEARCH_PARENT (search-to-root) */ @@ -275,7 +275,7 @@ OptSearchToRoot ( /* We must allocate a new string for the name (TargetPath gets deleted) */ - *NewPath = UtLocalCacheCalloc (ACPI_NAME_SIZE + 1); + *NewPath = UtLocalCacheCalloc (ACPI_NAMESEG_SIZE + 1); strcpy (*NewPath, Path); if (strncmp (*NewPath, "_T_", 3)) @@ -343,7 +343,7 @@ OptBuildShortestPath ( * can possibly have in common. (To optimize, we have to have at least 1) * * Note: The external NamePath string lengths are always a multiple of 5 - * (ACPI_NAME_SIZE + separator) + * (ACPI_NAMESEG_SIZE + separator) */ MaxCommonSegments = TargetPath->Length / ACPI_PATH_SEGMENT_LENGTH; if (CurrentPath->Length < TargetPath->Length) @@ -363,7 +363,7 @@ OptBuildShortestPath ( Index = (NumCommonSegments * ACPI_PATH_SEGMENT_LENGTH) + 1; - if (!ACPI_COMPARE_NAME ( + if (!ACPI_COMPARE_NAMESEG ( &(ACPI_CAST_PTR (char, TargetPath->Pointer)) [Index], &(ACPI_CAST_PTR (char, CurrentPath->Pointer)) [Index])) { @@ -713,7 +713,7 @@ OptOptimizeNamePath ( * to be any possibility that it can be optimized to a shorter string */ AmlNameStringLength = strlen (AmlNameString); - if (AmlNameStringLength <= ACPI_NAME_SIZE) + if (AmlNameStringLength <= ACPI_NAMESEG_SIZE) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAMESEG %4.4s\n", AmlNameString)); Modified: head/sys/contrib/dev/acpica/compiler/aslpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslpredef.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/aslpredef.c Fri Mar 29 20:21:28 2019 (r345713) @@ -578,7 +578,7 @@ ApCheckForPredefinedName ( ThisName = AcpiGbl_PredefinedMethods; for (i = 0; ThisName->Info.Name[0]; i++) { - if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name)) + if (ACPI_COMPARE_NAMESEG (Name, ThisName->Info.Name)) { /* Return index into predefined array */ return (i); @@ -592,7 +592,7 @@ ApCheckForPredefinedName ( ThisName = AcpiGbl_ResourceNames; while (ThisName->Info.Name[0]) { - if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name)) + if (ACPI_COMPARE_NAMESEG (Name, ThisName->Info.Name)) { return (ACPI_PREDEFINED_NAME); } @@ -603,7 +603,7 @@ ApCheckForPredefinedName ( ThisName = AcpiGbl_ScopeNames; while (ThisName->Info.Name[0]) { - if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name)) + if (ACPI_COMPARE_NAMESEG (Name, ThisName->Info.Name)) { return (ACPI_PREDEFINED_NAME); } Modified: head/sys/contrib/dev/acpica/compiler/asltransform.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asltransform.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/asltransform.c Fri Mar 29 20:21:28 2019 (r345713) @@ -553,7 +553,7 @@ TrDoDefinitionBlock ( * to be at the root of the namespace; Therefore, namepath * optimization can only be performed on the DSDT. */ - if (!ACPI_COMPARE_NAME (Next->Asl.Value.String, ACPI_SIG_DSDT)) + if (!ACPI_COMPARE_NAMESEG (Next->Asl.Value.String, ACPI_SIG_DSDT)) { AslGbl_ReferenceOptimizationFlag = FALSE; } Modified: head/sys/contrib/dev/acpica/compiler/aslutils.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslutils.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/aslutils.c Fri Mar 29 20:21:28 2019 (r345713) @@ -752,7 +752,7 @@ UtPadNameWithUnderscores ( UINT32 i; - for (i = 0; (i < ACPI_NAME_SIZE); i++) + for (i = 0; (i < ACPI_NAMESEG_SIZE); i++) { if (*NameSeg) { @@ -823,7 +823,7 @@ UtAttachNameseg ( UtPadNameWithUnderscores (Name, PaddedNameSeg); } - ACPI_MOVE_NAME (Op->Asl.NameSeg, PaddedNameSeg); + ACPI_COPY_NAMESEG (Op->Asl.NameSeg, PaddedNameSeg); } Modified: head/sys/contrib/dev/acpica/compiler/aslxref.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslxref.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/aslxref.c Fri Mar 29 20:21:28 2019 (r345713) @@ -613,7 +613,8 @@ XfNamespaceLocateBegin ( (Op->Asl.ParseOpcode != PARSEOP_NAMESTRING) && (Op->Asl.ParseOpcode != PARSEOP_NAMESEG) && (Op->Asl.ParseOpcode != PARSEOP_METHODCALL) && - (Op->Asl.ParseOpcode != PARSEOP_EXTERNAL)) + (Op->Asl.ParseOpcode != PARSEOP_EXTERNAL) && + (OpInfo->Type != AML_TYPE_NAMED_FIELD)) { return_ACPI_STATUS (AE_OK); } @@ -637,7 +638,8 @@ XfNamespaceLocateBegin ( if ((Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) || (Op->Asl.ParseOpcode == PARSEOP_NAMESEG) || (Op->Asl.ParseOpcode == PARSEOP_METHODCALL) || - (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL)) + (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) || + (OpInfo->Type == AML_TYPE_NAMED_FIELD)) { /* * These are name references, do not push the scope stack @@ -674,6 +676,10 @@ XfNamespaceLocateBegin ( Path = NextOp->Asl.Value.String; } + else if (OpInfo->Type == AML_TYPE_NAMED_FIELD) + { + Path = Op->Asl.Child->Asl.Value.String; + } else { Path = Op->Asl.Value.String; @@ -702,7 +708,7 @@ XfNamespaceLocateBegin ( * We didn't find the name reference by path -- we can qualify this * a little better before we print an error message */ - if (strlen (Path) == ACPI_NAME_SIZE) + if (strlen (Path) == ACPI_NAMESEG_SIZE) { /* A simple, one-segment ACPI name */ @@ -764,7 +770,7 @@ XfNamespaceLocateBegin ( * doesn't exist or just can't be reached. However, we * can differentiate between a NameSeg vs. NamePath. */ - if (strlen (Op->Asl.ExternalName) == ACPI_NAME_SIZE) + if (strlen (Op->Asl.ExternalName) == ACPI_NAMESEG_SIZE) { AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, Op->Asl.ExternalName); Modified: head/sys/contrib/dev/acpica/compiler/dtcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtcompile.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/dtcompile.c Fri Mar 29 20:21:28 2019 (r345713) @@ -418,7 +418,7 @@ DtCompileDataTable ( * Currently, these are the FACS and RSDP. Also check for an OEMx table, * these tables have user-defined contents. */ - if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS)) + if (ACPI_COMPARE_NAMESEG (Signature, ACPI_SIG_FACS)) { Status = DtCompileFacs (FieldList); if (ACPI_FAILURE (Status)) @@ -434,7 +434,7 @@ DtCompileDataTable ( Status = DtCompileRsdp (FieldList); return (Status); } - else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_S3PT)) + else if (ACPI_COMPARE_NAMESEG (Signature, ACPI_SIG_S3PT)) { Status = DtCompileS3pt (FieldList); if (ACPI_FAILURE (Status)) Modified: head/sys/contrib/dev/acpica/compiler/dttemplate.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dttemplate.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/compiler/dttemplate.c Fri Mar 29 20:21:28 2019 (r345713) @@ -204,11 +204,11 @@ AcpiUtIsSpecialTable ( char *Signature) { - if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT) || - ACPI_COMPARE_NAME (Signature, ACPI_SIG_OSDT) || - ACPI_COMPARE_NAME (Signature, ACPI_SIG_SSDT) || - ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS) || - ACPI_COMPARE_NAME (Signature, ACPI_RSDP_NAME)) + if (ACPI_COMPARE_NAMESEG (Signature, ACPI_SIG_DSDT) || + ACPI_COMPARE_NAMESEG (Signature, ACPI_SIG_OSDT) || + ACPI_COMPARE_NAMESEG (Signature, ACPI_SIG_SSDT) || + ACPI_COMPARE_NAMESEG (Signature, ACPI_SIG_FACS) || + ACPI_COMPARE_NAMESEG (Signature, ACPI_RSDP_NAME)) { return (TRUE); } @@ -346,7 +346,7 @@ DtCreateOneTemplateFile ( * 2) Signature must be a recognized ACPI table * 3) There must be a template associated with the signature */ - if (strlen (Signature) != ACPI_NAME_SIZE) + if (strlen (Signature) != ACPI_NAMESEG_SIZE) { fprintf (stderr, "%s: Invalid ACPI table signature " @@ -567,7 +567,7 @@ DtCreateOneTemplate ( AcpiOsPrintf (" (AML byte code table)\n"); AcpiOsPrintf (" */\n"); - if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT)) + if (ACPI_COMPARE_NAMESEG (Signature, ACPI_SIG_DSDT)) { Actual = DtEmitDefinitionBlock ( File, DisasmFilename, ACPI_SIG_DSDT, 1); @@ -590,7 +590,7 @@ DtCreateOneTemplate ( } } } - else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_SSDT)) + else if (ACPI_COMPARE_NAMESEG (Signature, ACPI_SIG_SSDT)) { Actual = DtEmitDefinitionBlock ( File, DisasmFilename, ACPI_SIG_SSDT, 1); @@ -600,7 +600,7 @@ DtCreateOneTemplate ( goto Cleanup; } } - else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_OSDT)) + else if (ACPI_COMPARE_NAMESEG (Signature, ACPI_SIG_OSDT)) { Actual = DtEmitDefinitionBlock ( File, DisasmFilename, ACPI_SIG_OSDT, 1); @@ -610,12 +610,12 @@ DtCreateOneTemplate ( goto Cleanup; } } - else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS)) + else if (ACPI_COMPARE_NAMESEG (Signature, ACPI_SIG_FACS)) { AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, TemplateFacs)); } - else if (ACPI_COMPARE_NAME (Signature, ACPI_RSDP_NAME)) + else if (ACPI_COMPARE_NAMESEG (Signature, ACPI_RSDP_NAME)) { AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, TemplateRsdp)); Modified: head/sys/contrib/dev/acpica/components/debugger/dbexec.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbexec.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/components/debugger/dbexec.c Fri Mar 29 20:21:28 2019 (r345713) @@ -658,7 +658,7 @@ AcpiDbExecute ( /* Dump a _PLD buffer if present */ - if (ACPI_COMPARE_NAME ((ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, + if (ACPI_COMPARE_NAMESEG ((ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, AcpiGbl_DbMethodInfo.Method)->Name.Ascii), METHOD_NAME__PLD)) { Modified: head/sys/contrib/dev/acpica/components/debugger/dbnames.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbnames.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/components/debugger/dbnames.c Fri Mar 29 20:21:28 2019 (r345713) @@ -557,7 +557,7 @@ AcpiDbFindNameInNamespace ( char *AcpiNamePtr = AcpiName; - if (strlen (NameArg) > ACPI_NAME_SIZE) + if (strlen (NameArg) > ACPI_NAMESEG_SIZE) { AcpiOsPrintf ("Name must be no longer than 4 characters\n"); return (AE_OK); Modified: head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c ============================================================================== --- head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c Fri Mar 29 20:21:28 2019 (r345713) @@ -736,7 +736,7 @@ AcpiDmIsPldBuffer ( { Node = ParentOp->Common.Node; - if (ACPI_COMPARE_NAME (Node->Name.Ascii, METHOD_NAME__PLD)) + if (ACPI_COMPARE_NAMESEG (Node->Name.Ascii, METHOD_NAME__PLD)) { /* Ignore the Size argument in the disassembly of this buffer op */ @@ -770,7 +770,7 @@ AcpiDmIsPldBuffer ( { Node = ParentOp->Common.Node; - if (ACPI_COMPARE_NAME (Node->Name.Ascii, METHOD_NAME__PLD)) + if (ACPI_COMPARE_NAMESEG (Node->Name.Ascii, METHOD_NAME__PLD)) { /* Ignore the Size argument in the disassembly of this buffer op */ @@ -1100,7 +1100,7 @@ AcpiDmCheckForHardwareId ( /* Check for _HID - has one argument */ - if (ACPI_COMPARE_NAME (&Name, METHOD_NAME__HID)) + if (ACPI_COMPARE_NAMESEG (&Name, METHOD_NAME__HID)) { AcpiDmGetHardwareIdType (NextOp); return; @@ -1108,7 +1108,7 @@ AcpiDmCheckForHardwareId ( /* Exit if not _CID */ - if (!ACPI_COMPARE_NAME (&Name, METHOD_NAME__CID)) + if (!ACPI_COMPARE_NAMESEG (&Name, METHOD_NAME__CID)) { return; } Modified: head/sys/contrib/dev/acpica/components/disassembler/dmnames.c ============================================================================== --- head/sys/contrib/dev/acpica/components/disassembler/dmnames.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/components/disassembler/dmnames.c Fri Mar 29 20:21:28 2019 (r345713) @@ -199,8 +199,8 @@ AcpiDmDumpName ( /* Remove all trailing underscores from the name */ - Length = ACPI_NAME_SIZE; - for (i = (ACPI_NAME_SIZE - 1); i != 0; i--) + Length = ACPI_NAMESEG_SIZE; + for (i = (ACPI_NAMESEG_SIZE - 1); i != 0; i--) { if (NewName[i] == '_') { @@ -378,7 +378,7 @@ AcpiDmNamestring ( AcpiOsPrintf ("."); } - Name += ACPI_NAME_SIZE; + Name += ACPI_NAMESEG_SIZE; } } Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c Fri Mar 29 20:21:28 2019 (r345713) @@ -685,7 +685,7 @@ AcpiDsCreateField ( Info.RegionNode = RegionNode; Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next); - if (Info.RegionNode->Type == ACPI_ADR_SPACE_PLATFORM_COMM && + if (Info.RegionNode->Object->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_COMM && !(RegionNode->Object->Field.InternalPccBuffer = ACPI_ALLOCATE_ZEROED(Info.RegionNode->Object->Region.Length))) { Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c Fri Mar 29 20:21:28 2019 (r345713) @@ -359,7 +359,7 @@ AcpiDsInitializeObjects ( /* DSDT is always the first AML table */ - if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT)) + if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_DSDT)) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "\nInitializing Namespace objects:\n")); Modified: head/sys/contrib/dev/acpica/components/events/evgpeinit.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evgpeinit.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/components/events/evgpeinit.c Fri Mar 29 20:21:28 2019 (r345713) @@ -447,7 +447,7 @@ AcpiEvMatchGpeMethod ( ACPI_STATUS Status; UINT32 GpeNumber; UINT8 TempGpeNumber; - char Name[ACPI_NAME_SIZE + 1]; + char Name[ACPI_NAMESEG_SIZE + 1]; UINT8 Type; @@ -468,7 +468,7 @@ AcpiEvMatchGpeMethod ( * 1) Extract the method name and null terminate it */ ACPI_MOVE_32_TO_32 (Name, &MethodNode->Name.Integer); - Name[ACPI_NAME_SIZE] = 0; + Name[ACPI_NAMESEG_SIZE] = 0; /* 2) Name must begin with an underscore */ Modified: head/sys/contrib/dev/acpica/components/executer/exnames.c ============================================================================== --- head/sys/contrib/dev/acpica/components/executer/exnames.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/components/executer/exnames.c Fri Mar 29 20:21:28 2019 (r345713) @@ -207,11 +207,11 @@ AcpiExAllocateNameString ( { /* Special case for root */ - SizeNeeded = 1 + (ACPI_NAME_SIZE * NumNameSegs) + 2 + 1; + SizeNeeded = 1 + (ACPI_NAMESEG_SIZE * NumNameSegs) + 2 + 1; } else { - SizeNeeded = PrefixCount + (ACPI_NAME_SIZE * NumNameSegs) + 2 + 1; + SizeNeeded = PrefixCount + (ACPI_NAMESEG_SIZE * NumNameSegs) + 2 + 1; } /* @@ -310,7 +310,7 @@ AcpiExNameSegment ( } for (Index = 0; - (Index < ACPI_NAME_SIZE) && (AcpiUtValidNameChar (*AmlAddress, 0)); + (Index < ACPI_NAMESEG_SIZE) && (AcpiUtValidNameChar (*AmlAddress, 0)); Index++) { CharBuf[Index] = *AmlAddress++; Modified: head/sys/contrib/dev/acpica/components/namespace/nsaccess.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsaccess.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/components/namespace/nsaccess.c Fri Mar 29 20:21:28 2019 (r345713) @@ -851,7 +851,7 @@ AcpiNsLookup ( /* Point to next name segment and make this node current */ - Path += ACPI_NAME_SIZE; + Path += ACPI_NAMESEG_SIZE; CurrentNode = ThisNode; } Modified: head/sys/contrib/dev/acpica/components/namespace/nsdump.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsdump.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/components/namespace/nsdump.c Fri Mar 29 20:21:28 2019 (r345713) @@ -236,7 +236,7 @@ AcpiNsPrintPathname ( AcpiOsPrintf ("?"); } - Pathname += ACPI_NAME_SIZE; + Pathname += ACPI_NAMESEG_SIZE; NumSegments--; if (NumSegments) { Modified: head/sys/contrib/dev/acpica/components/namespace/nsinit.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsinit.c Fri Mar 29 19:47:42 2019 (r345712) +++ head/sys/contrib/dev/acpica/components/namespace/nsinit.c Fri Mar 29 20:21:28 2019 (r345713) @@ -662,7 +662,7 @@ AcpiNsFindIniMethods ( /* We are only looking for methods named _INI */ - if (!ACPI_COMPARE_NAME (Node->Name.Ascii, METHOD_NAME__INI)) + if (!ACPI_COMPARE_NAMESEG (Node->Name.Ascii, METHOD_NAME__INI)) { return (AE_OK); } @@ -839,7 +839,7 @@ AcpiNsInitOneDevice ( * Note: We know there is an _INI within this subtree, but it may not be * under this particular device, it may be lower in the branch. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE71DDBF90; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yl20dCz4NvQ; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 7367919CBC; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C42BF1FECE; Fri, 29 Mar 2019 03:04:34 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C434E7265F; Fri, 29 Mar 2019 03:03:48 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 397F71FBBF; Fri, 29 Mar 2019 03:02:45 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 2DC1B1FBA5 for ; Fri, 29 Mar 2019 03:02:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1F937227D; Fri, 29 Mar 2019 03:01:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD19C28949; Fri, 29 Mar 2019 03:01:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2T31L4v083838; Fri, 29 Mar 2019 03:01:21 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2T31LOr083837; Fri, 29 Mar 2019 03:01:21 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201903290301.x2T31LOr083837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345678 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 345678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: C434E7265F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:56 -0000 X-Original-Date: Fri, 29 Mar 2019 03:01:21 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:56 -0000 Author: jhibbits Date: Fri Mar 29 03:01:21 2019 New Revision: 345678 URL: https://svnweb.freebsd.org/changeset/base/345678 Log: powerpc64: Fix kernel ldscript to only emit one PT_LOAD segment Summary: kexec-lite cannot currently handle multiple PT_LOAD segments. In some cases the compiler generates multiple PT_LOAD segments for an unknown reason, causing boot to fail from kexec-lite. Submitted by: Brandon Bergren (older version) Differential Revision: https://reviews.freebsd.org/D19574 Modified: head/sys/conf/ldscript.powerpc64 Modified: head/sys/conf/ldscript.powerpc64 ============================================================================== --- head/sys/conf/ldscript.powerpc64 Fri Mar 29 02:44:20 2019 (r345677) +++ head/sys/conf/ldscript.powerpc64 Fri Mar 29 03:01:21 2019 (r345678) @@ -6,12 +6,17 @@ OUTPUT_ARCH(powerpc:common64) ENTRY(__start) SEARCH_DIR(/usr/lib); PROVIDE (__stack = 0); +PHDRS +{ + text PT_LOAD ; + dynamic PT_DYNAMIC ; +} SECTIONS { /* Low-address wrapper for bootloaders (kexec/kboot) that can't parse ELF */ . = kernbase - 0x100; - .kboot : { *(.text.kboot) } + .kboot : { *(.text.kboot) } :text /* Read-only sections, merged into text segment: */ . = kernbase; @@ -19,6 +24,7 @@ SECTIONS .text : { + *(.glink) *(.text) *(.stub) /* .gnu.warning sections are handled specially by elf32.em. */ @@ -29,7 +35,6 @@ SECTIONS PROVIDE (etext = .); /* Do not emit PT_INTERP section, which confuses some loaders (kexec-lite) */ - .interpX : { *(.interp) } : NONE /DISCARD/ : { *(.interp) } /* Also delete notes */ @@ -95,7 +100,7 @@ SECTIONS . = ALIGN(4096); .got : ALIGN(8) { __tocbase = .; *(.got .toc) } - .dynamic : { *(.dynamic) } + .dynamic : { *(.dynamic) } :text :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. The current compiler no longer needs this, but keep it around for 2.7.2 */ From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1464FDBF9B; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yl52P3z4Nvd; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 878AA19CCA; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7E97312A0; Fri, 29 Mar 2019 04:47:09 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38AAA7638D; Fri, 29 Mar 2019 04:47:09 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 28AA7129E; Fri, 29 Mar 2019 04:47:09 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D18D6129B; Fri, 29 Mar 2019 04:47:05 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BFB776389; Fri, 29 Mar 2019 04:47:05 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.15] (c-71-198-162-232.hsd1.ca.comcast.net [71.198.162.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id EF0D72B0DB; Fri, 29 Mar 2019 04:47:04 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.17.0.190309 Subject: Re: svn commit: r345680 - head/sys/conf From: Ravi Pokala To: Kyle Evans , , , Message-ID: Thread-Topic: svn commit: r345680 - head/sys/conf References: <201903290400.x2T40kp7013212@repo.freebsd.org> In-Reply-To: <201903290400.x2T40kp7013212@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 38AAA7638D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.929,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:57 -0000 X-Original-Date: Thu, 28 Mar 2019 21:47:01 -0700 X-List-Received-Date: Tue, 03 Sep 2019 14:05:57 -0000 -----Original Message----- From: on behalf of Kyle Evans Date: 2019-03-28, Thursday at 21:00 To: , , Subject: svn commit: r345680 - head/sys/conf > Author: kevans > Date: Fri Mar 29 04:00:46 2019 > New Revision: 345680 > URL: https://svnweb.freebsd.org/changeset/base/345680 > > Log: > NOTES: Use non-default value for BOOT_TAG Why? (I was on IRC when jhb debugged this, but I didn't quite get it; and of course lots of us *weren't* on IRC at the time.) Thanks, Ravi (rpokala@) > Reported by: jhb > MFC after: 1 week (except non-empty value in stable/11) > > Modified: > head/sys/conf/NOTES > > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Fri Mar 29 03:25:20 2019 (r345679) > +++ head/sys/conf/NOTES Fri Mar 29 04:00:46 2019 (r345680) > @@ -150,7 +150,7 @@ options BOOTHOWTO=RB_MULTIPLE > # > # Default boot tag; may use 'kern.boot_tag' loader tunable to override. The > # current boot's tag is also exposed via the 'kern.boot_tag' sysctl. > -options BOOT_TAG=\"---<>---\" > +options BOOT_TAG=\"\" > # Maximum boot tag size the kernel's static buffer should accomodate. Maximum > # size for both BOOT_TAG and the assocated tunable. > options BOOT_TAG_SZ=32 From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B68D5DBF84; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yl12S2z4NvG; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 5E73919CB0; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id B15CB1EF37; Fri, 29 Mar 2019 02:13:11 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39E8370229; Fri, 29 Mar 2019 02:13:11 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 144831EF35; Fri, 29 Mar 2019 02:13:11 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D5ECC1EF33 for ; Fri, 29 Mar 2019 02:13:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE42970226; Fri, 29 Mar 2019 02:13:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8759F281AD; Fri, 29 Mar 2019 02:13:08 +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 x2T2D8KF058610; Fri, 29 Mar 2019 02:13:08 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2T2D7kd058602; Fri, 29 Mar 2019 02:13:07 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201903290213.x2T2D7kd058602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345675 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 345675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 39E8370229 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:56 -0000 X-Original-Date: Fri, 29 Mar 2019 02:13:07 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:56 -0000 Author: asomers Date: Fri Mar 29 02:13:06 2019 New Revision: 345675 URL: https://svnweb.freebsd.org/changeset/base/345675 Log: fusefs: convert debug printfs into dtrace probes fuse(4) was heavily instrumented with debug printf statements that could only be enabled with compile-time flags. They fell into three basic groups: 1. Totally redundant with dtrace FBT probes. These I deleted. 2. Print textual information, usually error messages. These I converted to SDT probes of the form fuse:fuse:FILE:trace. They work just like the old printf statements except they can be enabled at runtime with dtrace. They can be filtered by FILE and/or by priority. 3. More complicated probes that print detailed information. These I converted into ad-hoc SDT probes. Also, de-inline fuse_internal_cache_attrs. It's big enough to be a regular function, and this way it gets a dtrace FBT probe. This commit is a merge of r345304, r344914, r344703, and r344664 from projects/fuse2. Reviewed by: cem MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19667 Deleted: head/sys/fs/fuse/fuse_debug.h Modified: head/sys/fs/fuse/fuse.h head/sys/fs/fuse/fuse_device.c head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_internal.c head/sys/fs/fuse/fuse_internal.h head/sys/fs/fuse/fuse_io.c head/sys/fs/fuse/fuse_ipc.c head/sys/fs/fuse/fuse_ipc.h head/sys/fs/fuse/fuse_main.c head/sys/fs/fuse/fuse_node.c head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/fuse/fuse_vnops.c Directory Properties: head/ (props changed) Modified: head/sys/fs/fuse/fuse.h ============================================================================== --- head/sys/fs/fuse/fuse.h Fri Mar 29 02:11:48 2019 (r345674) +++ head/sys/fs/fuse/fuse.h Fri Mar 29 02:13:06 2019 (r345675) @@ -159,65 +159,8 @@ do { \ (cred) = (td)->td_ucred; \ } while (0) -/* Debug related stuff */ - -#ifndef FUSE_DEBUG_DEVICE -#define FUSE_DEBUG_DEVICE 0 -#endif - -#ifndef FUSE_DEBUG_FILE -#define FUSE_DEBUG_FILE 0 -#endif - -#ifndef FUSE_DEBUG_INTERNAL -#define FUSE_DEBUG_INTERNAL 0 -#endif - -#ifndef FUSE_DEBUG_IO -#define FUSE_DEBUG_IO 0 -#endif - -#ifndef FUSE_DEBUG_IPC -#define FUSE_DEBUG_IPC 0 -#endif - -#ifndef FUSE_DEBUG_LOCK -#define FUSE_DEBUG_LOCK 0 -#endif - -#ifndef FUSE_DEBUG_VFSOPS -#define FUSE_DEBUG_VFSOPS 0 -#endif - -#ifndef FUSE_DEBUG_VNOPS -#define FUSE_DEBUG_VNOPS 0 -#endif - -#ifndef FUSE_TRACE -#define FUSE_TRACE 0 -#endif - -#define DEBUGX(cond, fmt, ...) do { \ - if (((cond))) { \ - printf("%s: " fmt, __func__, ## __VA_ARGS__); \ - } \ -} while (0) - -#define fuse_lck_mtx_lock(mtx) do { \ - DEBUGX(FUSE_DEBUG_LOCK, "0: lock(%s): %s@%d by %d\n", \ - __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ - mtx_lock(&(mtx)); \ - DEBUGX(FUSE_DEBUG_LOCK, "1: lock(%s): %s@%d by %d\n", \ - __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ -} while (0) - -#define fuse_lck_mtx_unlock(mtx) do { \ - DEBUGX(FUSE_DEBUG_LOCK, "0: unlock(%s): %s@%d by %d\n", \ - __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ - mtx_unlock(&(mtx)); \ - DEBUGX(FUSE_DEBUG_LOCK, "1: unlock(%s): %s@%d by %d\n", \ - __STRING(mtx), __func__, __LINE__, curthread->td_proc->p_pid); \ -} while (0) +#define fuse_lck_mtx_lock(mtx) mtx_lock(&(mtx)) +#define fuse_lck_mtx_unlock(mtx) mtx_unlock(&(mtx)) void fuse_ipc_init(void); void fuse_ipc_destroy(void); Modified: head/sys/fs/fuse/fuse_device.c ============================================================================== --- head/sys/fs/fuse/fuse_device.c Fri Mar 29 02:11:48 2019 (r345674) +++ head/sys/fs/fuse/fuse_device.c Fri Mar 29 02:13:06 2019 (r345675) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -82,8 +83,13 @@ __FBSDID("$FreeBSD$"); #include "fuse.h" #include "fuse_ipc.h" -#define FUSE_DEBUG_MODULE DEVICE -#include "fuse_debug.h" +SDT_PROVIDER_DECLARE(fuse); +/* + * Fuse trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(fuse, , device, trace, "int", "char*"); static struct cdev *fuse_dev; @@ -127,15 +133,14 @@ fuse_device_open(struct cdev *dev, int oflags, int dev struct fuse_data *fdata; int error; - FS_DEBUG("device %p\n", dev); + SDT_PROBE2(fuse, , device, trace, 1, "device open"); fdata = fdata_alloc(dev, td->td_ucred); error = devfs_set_cdevpriv(fdata, fdata_dtor); if (error != 0) fdata_trydestroy(fdata); else - FS_DEBUG("%s: device opened by thread %d.\n", dev->si_name, - td->td_tid); + SDT_PROBE2(fuse, , device, trace, 1, "device open success"); return (error); } @@ -170,7 +175,7 @@ fuse_device_close(struct cdev *dev, int fflag, int dev fuse_lck_mtx_unlock(data->aw_mtx); FUSE_UNLOCK(); - FS_DEBUG("%s: device closed by thread %d.\n", dev->si_name, td->td_tid); + SDT_PROBE2(fuse, , device, trace, 1, "device close"); return (0); } @@ -214,7 +219,7 @@ fuse_device_read(struct cdev *dev, struct uio *uio, in int buflen[3]; int i; - FS_DEBUG("fuse device being read on thread %d\n", uio->uio_td->td_tid); + SDT_PROBE2(fuse, , device, trace, 1, "fuse device read"); err = devfs_get_cdevpriv((void **)&data); if (err != 0) @@ -223,7 +228,9 @@ fuse_device_read(struct cdev *dev, struct uio *uio, in fuse_lck_mtx_lock(data->ms_mtx); again: if (fdata_get_dead(data)) { - FS_DEBUG2G("we know early on that reader should be kicked so we don't wait for news\n"); + SDT_PROBE2(fuse, , device, trace, 2, + "we know early on that reader should be kicked so we " + "don't wait for news"); fuse_lck_mtx_unlock(data->ms_mtx); return (ENODEV); } @@ -249,7 +256,7 @@ again: * -- and some other cases, too, tho not totally clear, when * (cv_signal/wakeup_one signals the whole process ?) */ - FS_DEBUG("no message on thread #%d\n", uio->uio_td->td_tid); + SDT_PROBE2(fuse, , device, trace, 1, "no message on thread"); goto again; } fuse_lck_mtx_unlock(data->ms_mtx); @@ -259,16 +266,18 @@ again: * somebody somewhere -- eg., umount routine -- * wants this liaison finished off */ - FS_DEBUG2G("reader is to be sacked\n"); + SDT_PROBE2(fuse, , device, trace, 2, "reader is to be sacked"); if (tick) { - FS_DEBUG2G("weird -- \"kick\" is set tho there is message\n"); + SDT_PROBE2(fuse, , device, trace, 2, "weird -- " + "\"kick\" is set tho there is message"); FUSE_ASSERT_MS_DONE(tick); fuse_ticket_drop(tick); } return (ENODEV); /* This should make the daemon get off * of us */ } - FS_DEBUG("message got on thread #%d\n", uio->uio_td->td_tid); + SDT_PROBE2(fuse, , device, trace, 1, + "fuse device read message successfully"); KASSERT(tick->tk_ms_bufdata || tick->tk_ms_bufsize == 0, ("non-null buf pointer with positive size")); @@ -302,7 +311,8 @@ again: */ if (uio->uio_resid < buflen[i]) { fdata_set_dead(data); - FS_DEBUG2G("daemon is stupid, kick it off...\n"); + SDT_PROBE2(fuse, , device, trace, 2, + "daemon is stupid, kick it off..."); err = ENODEV; break; } @@ -320,16 +330,14 @@ again: static inline int fuse_ohead_audit(struct fuse_out_header *ohead, struct uio *uio) { - FS_DEBUG("Out header -- len: %i, error: %i, unique: %llu; iovecs: %d\n", - ohead->len, ohead->error, (unsigned long long)ohead->unique, - uio->uio_iovcnt); - if (uio->uio_resid + sizeof(struct fuse_out_header) != ohead->len) { - FS_DEBUG("Format error: body size differs from size claimed by header\n"); + SDT_PROBE2(fuse, , device, trace, 1, "Format error: body size " + "differs from size claimed by header"); return (EINVAL); } if (uio->uio_resid && ohead->error) { - FS_DEBUG("Format error: non zero error but message had a body\n"); + SDT_PROBE2(fuse, , device, trace, 1, + "Format error: non zero error but message had a body"); return (EINVAL); } /* Sanitize the linuxism of negative errnos */ @@ -338,6 +346,8 @@ fuse_ohead_audit(struct fuse_out_header *ohead, struct return (0); } +SDT_PROBE_DEFINE1(fuse, , device, fuse_device_write_bumped_into_callback, + "uint64_t"); /* * fuse_device_write first reads the header sent by the daemon. * If that's OK, looks up ticket/callback node by the unique id seen in header. @@ -353,15 +363,13 @@ fuse_device_write(struct cdev *dev, struct uio *uio, i struct fuse_ticket *tick, *x_tick; int found = 0; - FS_DEBUG("resid: %zd, iovcnt: %d, thread: %d\n", - uio->uio_resid, uio->uio_iovcnt, uio->uio_td->td_tid); - err = devfs_get_cdevpriv((void **)&data); if (err != 0) return (err); if (uio->uio_resid < sizeof(struct fuse_out_header)) { - FS_DEBUG("got less than a header!\n"); + SDT_PROBE2(fuse, , device, trace, 1, + "fuse_device_write got less than a header!"); fdata_set_dead(data); return (EINVAL); } @@ -385,8 +393,9 @@ fuse_device_write(struct cdev *dev, struct uio *uio, i fuse_lck_mtx_lock(data->aw_mtx); TAILQ_FOREACH_SAFE(tick, &data->aw_head, tk_aw_link, x_tick) { - FS_DEBUG("bumped into callback #%llu\n", - (unsigned long long)tick->tk_unique); + SDT_PROBE1(fuse, , device, + fuse_device_write_bumped_into_callback, + tick->tk_unique); if (tick->tk_unique == ohead.unique) { found = 1; fuse_aw_remove(tick); @@ -405,12 +414,14 @@ fuse_device_write(struct cdev *dev, struct uio *uio, i * via ticket_drop(), so no manual mucking * around...) */ - FS_DEBUG("pass ticket to a callback\n"); + SDT_PROBE2(fuse, , device, trace, 1, + "pass ticket to a callback"); memcpy(&tick->tk_aw_ohead, &ohead, sizeof(ohead)); err = tick->tk_aw_handler(tick, uio); } else { /* pretender doesn't wanna do anything with answer */ - FS_DEBUG("stuff devalidated, so we drop it\n"); + SDT_PROBE2(fuse, , device, trace, 1, + "stuff devalidated, so we drop it"); } /* @@ -421,7 +432,8 @@ fuse_device_write(struct cdev *dev, struct uio *uio, i fuse_ticket_drop(tick); } else { /* no callback at all! */ - FS_DEBUG("erhm, no handler for this response\n"); + SDT_PROBE2(fuse, , device, trace, 1, + "erhm, no handler for this response"); err = EINVAL; } Modified: head/sys/fs/fuse/fuse_file.c ============================================================================== --- head/sys/fs/fuse/fuse_file.c Fri Mar 29 02:11:48 2019 (r345674) +++ head/sys/fs/fuse/fuse_file.c Fri Mar 29 02:13:06 2019 (r345675) @@ -58,11 +58,10 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include -#include #include #include #include @@ -74,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "fuse.h" @@ -82,8 +82,13 @@ __FBSDID("$FreeBSD$"); #include "fuse_ipc.h" #include "fuse_node.h" -#define FUSE_DEBUG_MODULE FILE -#include "fuse_debug.h" +SDT_PROVIDER_DECLARE(fuse); +/* + * Fuse trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(fuse, , file, trace, "int", "char*"); static int fuse_fh_count = 0; @@ -102,9 +107,6 @@ fuse_filehandle_open(struct vnode *vp, fufh_type_t fuf int oflags = 0; int op = FUSE_OPEN; - fuse_trace_printf("fuse_filehandle_open(vp=%p, fufh_type=%d)\n", - vp, fufh_type); - if (fuse_filehandle_valid(vp, fufh_type)) { panic("FUSE: filehandle_open called despite valid fufh (type=%d)", fufh_type); @@ -118,6 +120,8 @@ fuse_filehandle_open(struct vnode *vp, fufh_type_t fuf if (vnode_isdir(vp)) { op = FUSE_OPENDIR; if (fufh_type != FUFH_RDONLY) { + SDT_PROBE2(fuse, , file, trace, 1, + "non-rdonly fh requested for a directory?"); printf("FUSE:non-rdonly fh requested for a directory?\n"); fufh_type = FUFH_RDONLY; } @@ -129,7 +133,8 @@ fuse_filehandle_open(struct vnode *vp, fufh_type_t fuf foi->flags = oflags; if ((err = fdisp_wait_answ(&fdi))) { - debug_printf("OUCH ... daemon didn't give fh (err = %d)\n", err); + SDT_PROBE2(fuse, , file, trace, 1, + "OUCH ... daemon didn't give fh"); if (err == ENOENT) { fuse_internal_vnode_disappear(vp); } @@ -167,9 +172,6 @@ fuse_filehandle_close(struct vnode *vp, fufh_type_t fu int err = 0; int op = FUSE_RELEASE; - fuse_trace_printf("fuse_filehandle_put(vp=%p, fufh_type=%d)\n", - vp, fufh_type); - fufh = &(fvdat->fufh[fufh_type]); if (!FUFH_IS_VALID(fufh)) { panic("FUSE: filehandle_put called on invalid fufh (type=%d)", @@ -266,7 +268,6 @@ fuse_filehandle_init(struct vnode *vp, fufh_type_t fuf struct fuse_vnode_data *fvdat = VTOFUD(vp); struct fuse_filehandle *fufh; - FS_DEBUG("id=%jd type=%d\n", (intmax_t)fh_id, fufh_type); fufh = &(fvdat->fufh[fufh_type]); MPASS(!FUFH_IS_VALID(fufh)); fufh->fh_id = fh_id; Modified: head/sys/fs/fuse/fuse_internal.c ============================================================================== --- head/sys/fs/fuse/fuse_internal.c Fri Mar 29 02:11:48 2019 (r345674) +++ head/sys/fs/fuse/fuse_internal.c Fri Mar 29 02:13:06 2019 (r345675) @@ -58,11 +58,10 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include -#include #include #include #include @@ -70,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -94,8 +94,13 @@ __FBSDID("$FreeBSD$"); #include "fuse_file.h" #include "fuse_param.h" -#define FUSE_DEBUG_MODULE INTERNAL -#include "fuse_debug.h" +SDT_PROVIDER_DECLARE(fuse); +/* + * Fuse trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(fuse, , internal, trace, "int", "char*"); #ifdef ZERO_PAD_INCOMPLETE_BUFS static int isbzero(void *buf, size_t len); @@ -127,8 +132,6 @@ fuse_internal_access(struct vnode *vp, */ /* return 0;*/ - fuse_trace_printf_func(); - mp = vnode_mount(vp); vtype = vnode_vtype(vp); @@ -204,13 +207,71 @@ fuse_internal_access(struct vnode *vp, return err; } +/* + * Cache FUSE attributes from feo, in attr cache associated with vnode 'vp'. + * Optionally, if argument 'vap' is not NULL, store a copy of the converted + * attributes there as well. + * + * If the nominal attribute cache TTL is zero, do not cache on the 'vp' (but do + * return the result to the caller). + */ +void +fuse_internal_cache_attrs(struct vnode *vp, struct fuse_attr *attr, + uint64_t attr_valid, uint32_t attr_valid_nsec, struct vattr *vap) +{ + struct mount *mp; + struct fuse_vnode_data *fvdat; + struct vattr *vp_cache_at; + + mp = vnode_mount(vp); + fvdat = VTOFUD(vp); + + /* Honor explicit do-not-cache requests from user filesystems. */ + if (attr_valid == 0 && attr_valid_nsec == 0) + fvdat->valid_attr_cache = false; + else + fvdat->valid_attr_cache = true; + + vp_cache_at = VTOVA(vp); + + if (vap == NULL && vp_cache_at == NULL) + return; + + if (vap == NULL) + vap = vp_cache_at; + + vattr_null(vap); + + vap->va_fsid = mp->mnt_stat.f_fsid.val[0]; + vap->va_fileid = attr->ino; + vap->va_mode = attr->mode & ~S_IFMT; + vap->va_nlink = attr->nlink; + vap->va_uid = attr->uid; + vap->va_gid = attr->gid; + vap->va_rdev = attr->rdev; + vap->va_size = attr->size; + /* XXX on i386, seconds are truncated to 32 bits */ + vap->va_atime.tv_sec = attr->atime; + vap->va_atime.tv_nsec = attr->atimensec; + vap->va_mtime.tv_sec = attr->mtime; + vap->va_mtime.tv_nsec = attr->mtimensec; + vap->va_ctime.tv_sec = attr->ctime; + vap->va_ctime.tv_nsec = attr->ctimensec; + vap->va_blocksize = PAGE_SIZE; + vap->va_type = IFTOVT(attr->mode); + vap->va_bytes = attr->blocks * S_BLKSIZE; + vap->va_flags = 0; + + if (vap != vp_cache_at && vp_cache_at != NULL) + memcpy(vp_cache_at, vap, sizeof(*vap)); +} + + /* fsync */ int fuse_internal_fsync_callback(struct fuse_ticket *tick, struct uio *uio) { - fuse_trace_printf_func(); - if (tick->tk_aw_ohead.error == ENOSYS) { fsess_set_notimpl(tick->tk_data->mp, fticket_opcode(tick)); } @@ -227,8 +288,6 @@ fuse_internal_fsync(struct vnode *vp, struct fuse_fsync_in *ffsi; struct fuse_dispatcher fdi; - fuse_trace_printf_func(); - if (vnode_isdir(vp)) { op = FUSE_FSYNCDIR; } @@ -386,8 +445,6 @@ fuse_internal_remove(struct vnode *dvp, err = 0; fvdat = VTOFUD(vp); - debug_printf("dvp=%p, cnp=%p, op=%d\n", vp, cnp, op); - fdisp_init(&fdi, cnp->cn_namelen + 1); fdisp_make_vp(&fdi, op, dvp, cnp->cn_thread, cnp->cn_cred); @@ -442,8 +499,6 @@ fuse_internal_newentry_makerequest(struct mount *mp, size_t bufsize, struct fuse_dispatcher *fdip) { - debug_printf("fdip=%p\n", fdip); - fdip->iosize = bufsize + cnp->cn_namelen + 1; fdisp_make(fdip, op, mp, dnid, cnp->cn_thread, cnp->cn_cred); @@ -477,7 +532,8 @@ fuse_internal_newentry_core(struct vnode *dvp, feo->nodeid, 1); return err; } - cache_attrs(*vpp, feo, NULL); + fuse_internal_cache_attrs(*vpp, &feo->attr, feo->attr_valid, + feo->attr_valid_nsec, NULL); return err; } @@ -526,9 +582,6 @@ fuse_internal_forget_send(struct mount *mp, struct fuse_dispatcher fdi; struct fuse_forget_in *ffi; - debug_printf("mp=%p, nodeid=%ju, nlookup=%ju\n", - mp, (uintmax_t)nodeid, (uintmax_t)nlookup); - /* * KASSERT(nlookup > 0, ("zero-times forget for vp #%llu", * (long long unsigned) nodeid)); @@ -574,7 +627,8 @@ fuse_internal_init_callback(struct fuse_ticket *tick, /* XXX: Do we want to check anything further besides this? */ if (fiio->major < 7) { - debug_printf("userpace version too low\n"); + SDT_PROBE2(fuse, , internal, trace, 1, + "userpace version too low"); err = EPROTONOSUPPORT; goto out; } Modified: head/sys/fs/fuse/fuse_internal.h ============================================================================== --- head/sys/fs/fuse/fuse_internal.h Fri Mar 29 02:11:48 2019 (r345674) +++ head/sys/fs/fuse/fuse_internal.h Fri Mar 29 02:13:06 2019 (r345675) @@ -193,75 +193,9 @@ int fuse_internal_access(struct vnode *vp, mode_t mode struct fuse_access_param *facp, struct thread *td, struct ucred *cred); /* attributes */ +void fuse_internal_cache_attrs(struct vnode *vp, struct fuse_attr *attr, + uint64_t attr_valid, uint32_t attr_valid_nsec, struct vattr *vap); -/* - * Cache FUSE attributes 'fat', with nominal expiration - * 'attr_valid'.'attr_valid_nsec', in attr cache associated with vnode 'vp'. - * Optionally, if argument 'vap' is not NULL, store a copy of the converted - * attributes there as well. - * - * If the nominal attribute cache TTL is zero, do not cache on the 'vp' (but do - * return the result to the caller). - */ -static inline void -fuse_internal_attr_fat2vat(struct vnode *vp, struct fuse_attr *fat, - uint64_t attr_valid, uint32_t attr_valid_nsec, struct vattr *vap) -{ - struct mount *mp; - struct fuse_vnode_data *fvdat; - struct vattr *vp_cache_at; - - mp = vnode_mount(vp); - fvdat = VTOFUD(vp); - - DEBUGX(FUSE_DEBUG_INTERNAL, "node #%ju, mode 0%o\n", - (uintmax_t)fat->ino, fat->mode); - - /* Honor explicit do-not-cache requests from user filesystems. */ - if (attr_valid == 0 && attr_valid_nsec == 0) - fvdat->valid_attr_cache = false; - else - fvdat->valid_attr_cache = true; - - vp_cache_at = VTOVA(vp); - - if (vap == NULL && vp_cache_at == NULL) - return; - - if (vap == NULL) - vap = vp_cache_at; - - vattr_null(vap); - - vap->va_fsid = mp->mnt_stat.f_fsid.val[0]; - vap->va_fileid = fat->ino; - vap->va_mode = fat->mode & ~S_IFMT; - vap->va_nlink = fat->nlink; - vap->va_uid = fat->uid; - vap->va_gid = fat->gid; - vap->va_rdev = fat->rdev; - vap->va_size = fat->size; - /* XXX on i386, seconds are truncated to 32 bits */ - vap->va_atime.tv_sec = fat->atime; - vap->va_atime.tv_nsec = fat->atimensec; - vap->va_mtime.tv_sec = fat->mtime; - vap->va_mtime.tv_nsec = fat->mtimensec; - vap->va_ctime.tv_sec = fat->ctime; - vap->va_ctime.tv_nsec = fat->ctimensec; - vap->va_blocksize = PAGE_SIZE; - vap->va_type = IFTOVT(fat->mode); - vap->va_bytes = fat->blocks * S_BLKSIZE; - vap->va_flags = 0; - - if (vap != vp_cache_at && vp_cache_at != NULL) - memcpy(vp_cache_at, vap, sizeof(*vap)); -} - - -#define cache_attrs(vp, fuse_out, vap_out) \ - fuse_internal_attr_fat2vat((vp), &(fuse_out)->attr, \ - (fuse_out)->attr_valid, (fuse_out)->attr_valid_nsec, (vap_out)) - /* fsync */ int fuse_internal_fsync(struct vnode *vp, struct thread *td, @@ -300,24 +234,15 @@ void fuse_internal_vnode_disappear(struct vnode *vp); static inline int fuse_internal_checkentry(struct fuse_entry_out *feo, enum vtype vtyp) { - DEBUGX(FUSE_DEBUG_INTERNAL, - "feo=%p, vtype=%d\n", feo, vtyp); - if (vtyp != IFTOVT(feo->attr.mode)) { - DEBUGX(FUSE_DEBUG_INTERNAL, - "EINVAL -- %x != %x\n", vtyp, IFTOVT(feo->attr.mode)); return (EINVAL); } if (feo->nodeid == FUSE_NULL_ID) { - DEBUGX(FUSE_DEBUG_INTERNAL, - "EINVAL -- feo->nodeid is NULL\n"); return (EINVAL); } if (feo->nodeid == FUSE_ROOT_ID) { - DEBUGX(FUSE_DEBUG_INTERNAL, - "EINVAL -- feo->nodeid is FUSE_ROOT_ID\n"); return (EINVAL); } Modified: head/sys/fs/fuse/fuse_io.c ============================================================================== --- head/sys/fs/fuse/fuse_io.c Fri Mar 29 02:11:48 2019 (r345674) +++ head/sys/fs/fuse/fuse_io.c Fri Mar 29 02:13:06 2019 (r345675) @@ -98,10 +98,14 @@ __FBSDID("$FreeBSD$"); #include "fuse_ipc.h" #include "fuse_io.h" -#define FUSE_DEBUG_MODULE IO -#include "fuse_debug.h" +SDT_PROVIDER_DECLARE(fuse); +/* + * Fuse trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(fuse, , io, trace, "int", "char*"); - static int fuse_read_directbackend(struct vnode *vp, struct uio *uio, struct ucred *cred, struct fuse_filehandle *fufh); @@ -115,6 +119,8 @@ static int fuse_write_biobackend(struct vnode *vp, struct uio *uio, struct ucred *cred, struct fuse_filehandle *fufh, int ioflag); +SDT_PROBE_DEFINE5(fuse, , io, io_dispatch, "struct vnode*", "struct uio*", + "int", "struct ucred*", "struct fuse_filehandle*"); int fuse_io_dispatch(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) @@ -130,6 +136,8 @@ fuse_io_dispatch(struct vnode *vp, struct uio *uio, in printf("FUSE: io dispatch: filehandles are closed\n"); return err; } + SDT_PROBE5(fuse, , io, io_dispatch, vp, uio, ioflag, cred, fufh); + /* * Ideally, when the daemon asks for direct io at open time, the * standard file flag should be set according to this, so that would @@ -145,12 +153,12 @@ fuse_io_dispatch(struct vnode *vp, struct uio *uio, in switch (uio->uio_rw) { case UIO_READ: if (directio) { - FS_DEBUG("direct read of vnode %ju via file handle %ju\n", - (uintmax_t)VTOILLU(vp), (uintmax_t)fufh->fh_id); + SDT_PROBE2(fuse, , io, trace, 1, + "direct read of vnode"); err = fuse_read_directbackend(vp, uio, cred, fufh); } else { - FS_DEBUG("buffered read of vnode %ju\n", - (uintmax_t)VTOILLU(vp)); + SDT_PROBE2(fuse, , io, trace, 1, + "buffered read of vnode"); err = fuse_read_biobackend(vp, uio, cred, fufh); } break; @@ -162,12 +170,12 @@ fuse_io_dispatch(struct vnode *vp, struct uio *uio, in * cached. */ if (directio || fuse_data_cache_mode == FUSE_CACHE_WT) { - FS_DEBUG("direct write of vnode %ju via file handle %ju\n", - (uintmax_t)VTOILLU(vp), (uintmax_t)fufh->fh_id); + SDT_PROBE2(fuse, , io, trace, 1, + "direct write of vnode"); err = fuse_write_directbackend(vp, uio, cred, fufh, ioflag); } else { - FS_DEBUG("buffered write of vnode %ju\n", - (uintmax_t)VTOILLU(vp)); + SDT_PROBE2(fuse, , io, trace, 1, + "buffered write of vnode"); err = fuse_write_biobackend(vp, uio, cred, fufh, ioflag); } break; @@ -178,6 +186,9 @@ fuse_io_dispatch(struct vnode *vp, struct uio *uio, in return (err); } +SDT_PROBE_DEFINE3(fuse, , io, read_bio_backend_start, "int", "int", "int"); +SDT_PROBE_DEFINE2(fuse, , io, read_bio_backend_feed, "int", "int"); +SDT_PROBE_DEFINE3(fuse, , io, read_bio_backend_end, "int", "ssize_t", "int"); static int fuse_read_biobackend(struct vnode *vp, struct uio *uio, struct ucred *cred, struct fuse_filehandle *fufh) @@ -190,9 +201,6 @@ fuse_read_biobackend(struct vnode *vp, struct uio *uio const int biosize = fuse_iosize(vp); - FS_DEBUG("resid=%zx offset=%jx fsize=%jx\n", - uio->uio_resid, uio->uio_offset, VTOFUD(vp)->filesize); - if (uio->uio_resid == 0) return (0); if (uio->uio_offset < 0) @@ -209,7 +217,8 @@ fuse_read_biobackend(struct vnode *vp, struct uio *uio lbn = uio->uio_offset / biosize; on = uio->uio_offset & (biosize - 1); - FS_DEBUG2G("biosize %d, lbn %d, on %d\n", biosize, (int)lbn, on); + SDT_PROBE3(fuse, , io, read_bio_backend_start, + biosize, (int)lbn, on); /* * Obtain the buffer cache block. Figure out the buffer size @@ -258,19 +267,22 @@ fuse_read_biobackend(struct vnode *vp, struct uio *uio if (on < bcount) n = MIN((unsigned)(bcount - on), uio->uio_resid); if (n > 0) { - FS_DEBUG2G("feeding buffeater with %d bytes of buffer %p," - " saying %d was asked for\n", - n, bp->b_data + on, n + (int)bp->b_resid); + SDT_PROBE2(fuse, , io, read_bio_backend_feed, + n, n + (int)bp->b_resid); err = uiomove(bp->b_data + on, n, uio); } brelse(bp); - FS_DEBUG2G("end of turn, err %d, uio->uio_resid %zd, n %d\n", - err, uio->uio_resid, n); + SDT_PROBE3(fuse, , io, read_bio_backend_end, err, + uio->uio_resid, n); } while (err == 0 && uio->uio_resid > 0 && n > 0); return (err); } +SDT_PROBE_DEFINE1(fuse, , io, read_directbackend_start, "struct fuse_read_in*"); +SDT_PROBE_DEFINE2(fuse, , io, read_directbackend_complete, + "struct fuse_dispatcher*", "struct uio*"); + static int fuse_read_directbackend(struct vnode *vp, struct uio *uio, struct ucred *cred, struct fuse_filehandle *fufh) @@ -301,17 +313,13 @@ fuse_read_directbackend(struct vnode *vp, struct uio * fri->size = MIN(uio->uio_resid, fuse_get_mpdata(vp->v_mount)->max_read); - FS_DEBUG2G("fri->fh %ju, fri->offset %ju, fri->size %ju\n", - (uintmax_t)fri->fh, (uintmax_t)fri->offset, - (uintmax_t)fri->size); + SDT_PROBE1(fuse, , io, read_directbackend_start, fri); if ((err = fdisp_wait_answ(&fdi))) goto out; - FS_DEBUG2G("complete: got iosize=%d, requested fri.size=%zd; " - "resid=%zd offset=%ju\n", - fri->size, fdi.iosize, uio->uio_resid, - (uintmax_t)uio->uio_offset); + SDT_PROBE2(fuse, , io, read_directbackend_complete, + fdi.iosize, uio); if ((err = uiomove(fdi.answ, MIN(fri->size, fdi.iosize), uio))) break; @@ -361,13 +369,24 @@ fuse_write_directbackend(struct vnode *vp, struct uio if ((err = fdisp_wait_answ(&fdi))) break; + /* Adjust the uio in the case of short writes */ diff = chunksize - ((struct fuse_write_out *)fdi.answ)->size; if (diff < 0) { err = EINVAL; break; + } else if (diff > 0 && !(ioflag & IO_DIRECT)) { + /* + * XXX We really should be directly checking whether + * the file was opened with FOPEN_DIRECT_IO, not + * IO_DIRECT. IO_DIRECT can be set in multiple ways. + */ + SDT_PROBE2(fuse, , io, trace, 1, + "misbehaving filesystem: short writes are only " + "allowed with direct_io"); } uio->uio_resid += diff; uio->uio_offset -= diff; + if (uio->uio_offset > fvdat->filesize && fuse_data_cache_mode != FUSE_CACHE_UC) { fuse_vnode_setsize(vp, cred, uio->uio_offset); @@ -380,6 +399,10 @@ fuse_write_directbackend(struct vnode *vp, struct uio return (err); } +SDT_PROBE_DEFINE6(fuse, , io, write_biobackend_start, "int64_t", "int", "int", + "struct uio*", "int", "bool"); +SDT_PROBE_DEFINE2(fuse, , io, write_biobackend_append_race, "long", "int"); + static int fuse_write_biobackend(struct vnode *vp, struct uio *uio, struct ucred *cred, struct fuse_filehandle *fufh, int ioflag) @@ -393,8 +416,6 @@ fuse_write_biobackend(struct vnode *vp, struct uio *ui const int biosize = fuse_iosize(vp); KASSERT(uio->uio_rw == UIO_WRITE, ("ncl_write mode")); - FS_DEBUG("resid=%zx offset=%jx fsize=%jx\n", - uio->uio_resid, uio->uio_offset, fvdat->filesize); if (vp->v_type != VREG) return (EIO); if (uio->uio_offset < 0) @@ -421,10 +442,6 @@ fuse_write_biobackend(struct vnode *vp, struct uio *ui on = uio->uio_offset & (biosize - 1); n = MIN((unsigned)(biosize - on), uio->uio_resid); - FS_DEBUG2G("lbn %ju, on %d, n %d, uio offset %ju, uio resid %zd\n", - (uintmax_t)lbn, on, n, - (uintmax_t)uio->uio_offset, uio->uio_resid); - again: /* * Handle direct append and file extension cases, calculate @@ -438,7 +455,8 @@ again: * readers from reading garbage. */ bcount = on; - FS_DEBUG("getting block from OS, bcount %d\n", bcount); + SDT_PROBE6(fuse, , io, write_biobackend_start, + lbn, on, n, uio, bcount, true); bp = getblk(vp, lbn, bcount, PCATCH, 0, 0); if (bp != NULL) { @@ -468,7 +486,8 @@ again: bcount = fvdat->filesize - (off_t)lbn *biosize; } - FS_DEBUG("getting block from OS, bcount %d\n", bcount); + SDT_PROBE6(fuse, , io, write_biobackend_start, + lbn, on, n, uio, bcount, false); bp = getblk(vp, lbn, bcount, PCATCH, 0, 0); if (bp && uio->uio_offset + n > fvdat->filesize) { err = fuse_vnode_setsize(vp, cred, @@ -530,7 +549,7 @@ again: */ if (bp->b_dirtyend > bcount) { - FS_DEBUG("FUSE append race @%lx:%d\n", + SDT_PROBE2(fuse, , io, write_biobackend_append_race, (long)bp->b_blkno * biosize, bp->b_dirtyend - bcount); bp->b_dirtyend = bcount; @@ -626,9 +645,6 @@ fuse_io_strategy(struct vnode *vp, struct buf *bp) MPASS(vp->v_type == VREG || vp->v_type == VDIR); MPASS(bp->b_iocmd == BIO_READ || bp->b_iocmd == BIO_WRITE); - FS_DEBUG("inode=%ju offset=%jd resid=%ld\n", - (uintmax_t)VTOI(vp), (intmax_t)(((off_t)bp->b_blkno) * biosize), - bp->b_bcount); error = fuse_filehandle_getrw(vp, (bp->b_iocmd == BIO_READ) ? FUFH_RDONLY : FUFH_WRONLY, &fufh); @@ -701,7 +717,8 @@ fuse_io_strategy(struct vnode *vp, struct buf *bp) * If we only need to commit, try to commit */ if (bp->b_flags & B_NEEDCOMMIT) { - FS_DEBUG("write: B_NEEDCOMMIT flags set\n"); + SDT_PROBE2(fuse, , io, trace, 1, + "write: B_NEEDCOMMIT flags set"); } /* * Setup for actual write Modified: head/sys/fs/fuse/fuse_ipc.c ============================================================================== --- head/sys/fs/fuse/fuse_ipc.c Fri Mar 29 02:11:48 2019 (r345674) +++ head/sys/fs/fuse/fuse_ipc.c Fri Mar 29 02:13:06 2019 (r345675) @@ -58,11 +58,10 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include -#include #include #include #include @@ -73,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -84,8 +84,13 @@ __FBSDID("$FreeBSD$"); #include "fuse_ipc.h" #include "fuse_internal.h" -#define FUSE_DEBUG_MODULE IPC -#include "fuse_debug.h" +SDT_PROVIDER_DECLARE(fuse); +/* + * Fuse trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(fuse, , ipc, trace, "int", "char*"); static struct fuse_ticket *fticket_alloc(struct fuse_data *data); static void fticket_refresh(struct fuse_ticket *ftick); @@ -146,8 +151,6 @@ fiov_init(struct fuse_iov *fiov, size_t size) { uint32_t msize = FU_AT_LEAST(size); - debug_printf("fiov=%p, size=%zd\n", fiov, size); - fiov->len = 0; fiov->base = malloc(msize, M_FUSEMSG, M_WAITOK | M_ZERO); @@ -159,8 +162,6 @@ fiov_init(struct fuse_iov *fiov, size_t size) void fiov_teardown(struct fuse_iov *fiov) { - debug_printf("fiov=%p\n", fiov); - MPASS(fiov->base != NULL); free(fiov->base, M_FUSEMSG); } @@ -168,8 +169,6 @@ fiov_teardown(struct fuse_iov *fiov) void fiov_adjust(struct fuse_iov *fiov, size_t size) { - debug_printf("fiov=%p, size=%zd\n", fiov, size); - if (fiov->allocated_size < size || (fuse_iov_permanent_bufsize >= 0 && fiov->allocated_size - size > fuse_iov_permanent_bufsize && @@ -189,8 +188,6 @@ fiov_adjust(struct fuse_iov *fiov, size_t size) void fiov_refresh(struct fuse_iov *fiov) { - debug_printf("fiov=%p\n", fiov); - bzero(fiov->base, fiov->len); fiov_adjust(fiov, 0); } @@ -201,8 +198,6 @@ fticket_ctor(void *mem, int size, void *arg, int flags struct fuse_ticket *ftick = mem; struct fuse_data *data = arg; - debug_printf("ftick=%p data=%p\n", ftick, data); - FUSE_ASSERT_MS_DONE(ftick); FUSE_ASSERT_AW_DONE(ftick); @@ -227,8 +222,6 @@ fticket_dtor(void *mem, int size, void *arg) { struct fuse_ticket *ftick = mem; - debug_printf("ftick=%p\n", ftick); - FUSE_ASSERT_MS_DONE(ftick); FUSE_ASSERT_AW_DONE(ftick); @@ -240,8 +233,6 @@ fticket_init(void *mem, int size, int flags) { struct fuse_ticket *ftick = mem; - FS_DEBUG("ftick=%p\n", ftick); - bzero(ftick, sizeof(struct fuse_ticket)); fiov_init(&ftick->tk_ms_fiov, sizeof(struct fuse_in_header)); @@ -259,8 +250,6 @@ fticket_fini(void *mem, int size) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B12E2DBFDA; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yl72DLz4Nvr; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id D46AB19CDB; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 53CBA2708; Fri, 29 Mar 2019 06:40:41 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D51F81B3E; Fri, 29 Mar 2019 06:40:40 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 13F0026A1; Fri, 29 Mar 2019 06:40:40 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id AC679269A; Fri, 29 Mar 2019 06:40:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 991F181AF0; Fri, 29 Mar 2019 06:40:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 11ED543E10C; Fri, 29 Mar 2019 17:40:23 +1100 (AEDT) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ravi Pokala cc: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345680 - head/sys/conf In-Reply-To: Message-ID: <20190329164644.X957@besplex.bde.org> References: <201903290400.x2T40kp7013212@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=v9tAofYSONCGxLRHZBoA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3D51F81B3E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:57 -0000 X-Original-Date: Fri, 29 Mar 2019 17:40:05 +1100 (EST) X-List-Received-Date: Tue, 03 Sep 2019 14:05:57 -0000 On Thu, 28 Mar 2019, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Kyle Evans > Date: 2019-03-28, Thursday at 21:00 > To: , , > Subject: svn commit: r345680 - head/sys/conf > >> Author: kevans >> Date: Fri Mar 29 04:00:46 2019 >> New Revision: 345680 >> URL: https://svnweb.freebsd.org/changeset/base/345680 >> >> Log: >> NOTES: Use non-default value for BOOT_TAG > > Why? > > (I was on IRC when jhb debugged this, but I didn't quite get it; and of course lots of us *weren't* on IRC at the time.) Because NOTES is primarily for generating LINT, and LINT's reason for existence is to test as many cases as possible. Testing the default cases again is not very useful, so by convention NOTES never configures defaults, except of course where it is broken. This commit is to fix 1 broken place. Not repeating the default is also good for NOTES' secondary purpose of documentation. Defaults are easy to find by grepping the source code for them if there is no documentation. Changing defaults to valid and useful values requires understanding more of the source if there is no documentation. >> Modified: head/sys/conf/NOTES >> ============================================================================== >> --- head/sys/conf/NOTES Fri Mar 29 03:25:20 2019 (r345679) >> +++ head/sys/conf/NOTES Fri Mar 29 04:00:46 2019 (r345680) >> @@ -150,7 +150,7 @@ options BOOTHOWTO=RB_MULTIPLE >> # >> # Default boot tag; may use 'kern.boot_tag' loader tunable to override. The >> # current boot's tag is also exposed via the 'kern.boot_tag' sysctl. >> -options BOOT_TAG=\"---<>---\" >> +options BOOT_TAG=\"\" Useful variations are not always easy to invent. I usually just add 1 for numeric values. This example is useful. It kills the boot tag. It gives an empty tag, and the kernel does extra work to avoid printing a newline after an empty tag. >> # Maximum boot tag size the kernel's static buffer should accomodate. Maximum >> # size for both BOOT_TAG and the assocated tunable. >> options BOOT_TAG_SZ=32 This bug remains unfixed. 32 is the default. This option shouldn't exist. Instead, just use size strlen(BOOT_TAG) + 1 for the static string and keep the dynamic string in the environment. The string is only used once, and msgbufinit() already has to check both the static string and the environment to find the right string (it does this by fetching the dynamic string to overwrite the static string, but it is easier to not use a tunable or support a sysctl and just keep the dynamic string in the environment). Bruce From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3150CDC168; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv1vx7z4P4c; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 8705419F38; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 1510918E68; Sun, 31 Mar 2019 11:28:19 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 449D075495; Sun, 31 Mar 2019 11:28:18 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1C9C818E48; Sun, 31 Mar 2019 11:28:18 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id CAC6E18E46 for ; Sun, 31 Mar 2019 11:28:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 76BF875490; Sun, 31 Mar 2019 11:28:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 0B273105D0D5; Sun, 31 Mar 2019 22:27:55 +1100 (AEDT) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345696 - head/lib/libvgl In-Reply-To: <20190330094558.GA1923@kib.kiev.ua> Message-ID: <20190331214235.K961@besplex.bde.org> References: <201903291557.x2TFv9AW097226@repo.freebsd.org> <20190329182100.GZ1923@kib.kiev.ua> <20190330142319.I1011@besplex.bde.org> <20190330094558.GA1923@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=UJetJGXy c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=fx17AMauYh6YMvl-fBgA:9 a=owp30hQRNWXAININ:21 a=82lPrFZ9h1KNQv0H:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 449D075495 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:05 -0000 X-Original-Date: Sun, 31 Mar 2019 22:27:54 +1100 (EST) X-List-Received-Date: Tue, 03 Sep 2019 14:06:05 -0000 On Sat, 30 Mar 2019, Konstantin Belousov wrote: > On Sat, Mar 30, 2019 at 03:24:40PM +1100, Bruce Evans wrote: >> On Fri, 29 Mar 2019, Konstantin Belousov wrote: >> >>> On Fri, Mar 29, 2019 at 03:57:09PM +0000, Bruce Evans wrote: >>>> Author: bde >>>> Date: Fri Mar 29 15:57:08 2019 >>>> New Revision: 345696 >>>> URL: https://svnweb.freebsd.org/changeset/base/345696 >>>> >>>> Log: >>>> Fix endless loops for handling SIGBUS and SIGSEGV. >>>> >>>> r80270 has the usual wrong fix for unsafe signal handling -- just set >>>> a flag and return to let an event loop check the flag and do safe >>>> handling. This never works for signals like SIGBUS and SIGSEGV that >>>> repeat and works poorly for others unless the application has an event >>>> loop designed to support this. >>>> >>>> For these signals, clean up unsafely as before, except for arranging that >>>> nested signals are fatal and forcing a nested signal if the cleanup doesn't >>>> cause one. >>>> >>>> Modified: >>>> head/lib/libvgl/main.c >>>> >>>> Modified: head/lib/libvgl/main.c >>>> ============================================================================== >>>> --- head/lib/libvgl/main.c Fri Mar 29 15:20:48 2019 (r345695) >>>> +++ head/lib/libvgl/main.c Fri Mar 29 15:57:08 2019 (r345696) >>>> ... >>>> @@ -107,14 +107,22 @@ struct vt_mode smode; >>>> } >>>> >>>> static void >>>> -VGLAbort(int arg __unused) >>>> +VGLAbort(int arg) >>>> { >>>> + sigset_t mask; >>>> + >>>> VGLAbortPending = 1; >>>> signal(SIGINT, SIG_IGN); >>>> signal(SIGTERM, SIG_IGN); >>>> - signal(SIGSEGV, SIG_IGN); >>>> - signal(SIGBUS, SIG_IGN); >>>> signal(SIGUSR2, SIG_IGN); >>>> + if (arg == SIGBUS || arg == SIGSEGV) { >>>> + signal(arg, SIG_DFL); >>>> + sigemptyset(&mask); >>>> + sigaddset(&mask, arg); >>>> + sigprocmask(SIG_UNBLOCK, &mask, NULL); >>>> + VGLEnd(); >>>> + kill(getpid(), arg); >>> This of course misses the siginfo information from the real fault. >> >> It is in the nested signal frame. >> >>> Why SIGBUS/SIGSEGV are caught at all ? >> >> Otherwise, the screen is left in an application mode that the kernel >> doesn't support (except to not write to the screen, so that the >> application has full control). Also, the keyboard may be left in a strange state. Usually this is no worse than termios raw mode, but it may be raw scancodes. In raw scancodes mode, Alt-Fn to switch to another vty to fix the problem. libvgl disables switching to another vty without going through a libvgl handler anyway. The combination is usually enough to break switching to vty0 to run ddb, though that should work for at least breakpoints in the kernel. IIRC, sc_cngrab() switches the keyboard mode, and my version of it restores ignoring of the anti-switch flag. > ... > I am more about not doing kill(2) from the handler, instead do plain > return to the context which caused the original signal. That won't work well for SIGBUS's and SIGSEGV's related to the library. If the above cleanup is not done, then it is too hard to debug the problem, and if the above cleanup is done then it is impossible to debug the original problem if it was for and invalid access in libvgl code. The latter is a problem for the above cleanup too -- the cleanup clobbers the libvgl state. However, I could do a more limited cleanup of just restoring the screen and keyboard state using ioctls. ioctl() isn't async-signal safe in POSIX, but most ioctls are async-signal safe in practice provided they don't use global variables that were set too recently or too non-atomically. VGLEnd() uses main globals established by VGLInit(). It depends on program order which is not guaranteed in signal handlers for testing the flags set by initialization. The cleanup now also does: - screen clearing. This breaks debugging and is dangerous if the bug is in screen clearing. Screen clearing is also very slow, and belongs in the kernel. It is now done 4 times per libvgl use, but its slowness is limited by the kernel not clearing properly and the kernel not allowing the application to mmap() the whole physical frame buffer in some versions of FreeBSD (this breaks panning). - munmap(). This breaks debugging. - free() of backing store buffer and the main VGLDisplay data. This breaks debugging and is unnecessary if we are going to exit. Bruce From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F3E1DC0B2; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ys108Xz4P1b; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id D90F119E40; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 6F38E1144B; Fri, 29 Mar 2019 18:13:51 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3416C720AB; Fri, 29 Mar 2019 18:13:51 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 13F101144A; Fri, 29 Mar 2019 18:13:51 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C4DEA11448 for ; Fri, 29 Mar 2019 18:13:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92AFF720AA; Fri, 29 Mar 2019 18:13:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A8622822; Fri, 29 Mar 2019 18:13:48 +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 x2TIDmGp071983; Fri, 29 Mar 2019 18:13:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TIDjFr071966; Fri, 29 Mar 2019 18:13:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201903291813.x2TIDjFr071966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345704 - in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libc/tests/stdlib lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk us... X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libc/tests/stdlib lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk usr.bin/dtc usr.sbin/pmc X-SVN-Commit-Revision: 345704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3416C720AB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:59 -0000 X-Original-Date: Fri, 29 Mar 2019 18:13:45 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:59 -0000 Author: ngie Date: Fri Mar 29 18:13:44 2019 New Revision: 345704 URL: https://svnweb.freebsd.org/changeset/base/345704 Log: CXXSTD is the C++ analogue to CSTD. CXXSTD defaults to `-std=c++11` with supporting compilers; `-std=gnu++98`, otherwise for older versions of g++. This change standardizes the CXXSTD variable, originally added to googletest.test.inc.mk as part of r345203. As part of this effort, convert all `CXXFLAGS+= -std=*` calls to use `CXXSTD`. Notes: This value is not sanity checked in bsd.sys.mk, however, given the two most used C++ compilers on FreeBSD (clang++ and g++) support both modes, it is likely to work with both toolchains. This method will be refined in the future to support more variants of C++, as not all versions of clang++ and g++ (for instance) support C++14, C++17, etc. Any manual appending of `-std=*` to `CXXFLAGS` should be replaced with CXXSTD. Example: Before this commit: ``` CXXFLAGS+= -std=c++14 ``` After this commit: ``` CXXSTD= c++14 ``` Reviewed by: asomers Approved by: emaste (mentor) MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D19732 Modified: head/lib/clang/llvm.build.mk head/lib/libc++/Makefile head/lib/libc++experimental/Makefile head/lib/libc++fs/Makefile head/lib/libc/tests/stdlib/Makefile head/lib/libclang_rt/Makefile.inc head/lib/libcxxrt/Makefile head/lib/libgcc_eh/Makefile.inc head/lib/libomp/Makefile head/lib/ofed/libibnetdisc/Makefile head/share/mk/bsd.progs.mk head/share/mk/bsd.sys.mk head/share/mk/googletest.test.inc.mk head/usr.bin/dtc/Makefile head/usr.sbin/pmc/Makefile Modified: head/lib/clang/llvm.build.mk ============================================================================== --- head/lib/clang/llvm.build.mk Fri Mar 29 17:52:57 2019 (r345703) +++ head/lib/clang/llvm.build.mk Fri Mar 29 18:13:44 2019 (r345704) @@ -95,7 +95,7 @@ CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections LDFLAGS+= -Wl,--gc-sections -CXXFLAGS+= -std=c++11 +CXXSTD?= c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti CXXFLAGS.clang+= -stdlib=libc++ Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Fri Mar 29 17:52:57 2019 (r345703) +++ head/lib/libc++/Makefile Fri Mar 29 18:13:44 2019 (r345704) @@ -76,9 +76,7 @@ CFLAGS+= -nostdinc++ CFLAGS+= -nostdlib CFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif +CXXSTD= c++11 LIBADD+= cxxrt INCSGROUPS= STD EXP EXT Modified: head/lib/libc++experimental/Makefile ============================================================================== --- head/lib/libc++experimental/Makefile Fri Mar 29 17:52:57 2019 (r345703) +++ head/lib/libc++experimental/Makefile Fri Mar 29 18:13:44 2019 (r345704) @@ -20,8 +20,6 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++14 -.endif +CXXSTD= c++14 .include Modified: head/lib/libc++fs/Makefile ============================================================================== --- head/lib/libc++fs/Makefile Fri Mar 29 17:52:57 2019 (r345703) +++ head/lib/libc++fs/Makefile Fri Mar 29 18:13:44 2019 (r345704) @@ -22,8 +22,6 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++14 -.endif +CXXSTD= c++14 .include Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Fri Mar 29 17:52:57 2019 (r345703) +++ head/lib/libc/tests/stdlib/Makefile Fri Mar 29 18:13:44 2019 (r345704) @@ -50,8 +50,8 @@ PROGS+= h_getopt h_getopt_long CFLAGS+= -I${.CURDIR} -CXXFLAGS.cxa_thread_atexit_test+= -std=c++11 -CXXFLAGS.cxa_thread_atexit_nothr_test+= -std=c++11 +CXXSTD.cxa_thread_atexit_test= c++11 +CXXSTD.cxa_thread_atexit_nothr_test= c++11 LIBADD.cxa_thread_atexit_test+= pthread .for t in h_getopt h_getopt_long Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Fri Mar 29 17:52:57 2019 (r345703) +++ head/lib/libclang_rt/Makefile.inc Fri Mar 29 18:13:44 2019 (r345704) @@ -41,4 +41,4 @@ CFLAGS+= -funwind-tables CXXFLAGS+= -fvisibility-inlines-hidden CXXFLAGS+= -fvisibility=hidden CFLAGS+= -I${CRTSRC}/lib -CXXFLAGS+= -std=c++11 +CXXSTD= c++11 Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Fri Mar 29 17:52:57 2019 (r345703) +++ head/lib/libcxxrt/Makefile Fri Mar 29 18:13:44 2019 (r345704) @@ -22,9 +22,7 @@ SRCS+= libelftc_dem_gnu3.c\ WARNS= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif +CXXSTD= c++11 VERSION_MAP= ${.CURDIR}/Version.map .include Modified: head/lib/libgcc_eh/Makefile.inc ============================================================================== --- head/lib/libgcc_eh/Makefile.inc Fri Mar 29 17:52:57 2019 (r345703) +++ head/lib/libgcc_eh/Makefile.inc Fri Mar 29 18:13:44 2019 (r345704) @@ -27,10 +27,8 @@ CXXFLAGS.${file}+= -fno-exceptions -funwind-tables .endfor CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif CXXFLAGS+= -fno-rtti +CXXSTD= c++11 STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC # Probably need to just move this earlier or use CXXFLAGS .if ${MK_DIRDEPS_BUILD} == "yes" Modified: head/lib/libomp/Makefile ============================================================================== --- head/lib/libomp/Makefile Fri Mar 29 17:52:57 2019 (r345703) +++ head/lib/libomp/Makefile Fri Mar 29 18:13:44 2019 (r345704) @@ -53,9 +53,9 @@ CFLAGS+= -I${ITTSRC} CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections CXXFLAGS+= -fvisibility-inlines-hidden -CXXFLAGS+= -std=c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti +CXXSTD= c++11 LDFLAGS+= -Wl,--warn-shared-textrel LDFLAGS+= -Wl,--gc-sections Modified: head/lib/ofed/libibnetdisc/Makefile ============================================================================== --- head/lib/ofed/libibnetdisc/Makefile Fri Mar 29 17:52:57 2019 (r345703) +++ head/lib/ofed/libibnetdisc/Makefile Fri Mar 29 18:13:44 2019 (r345704) @@ -31,9 +31,6 @@ LIBADD= osmcomp ibmad ibumad CFLAGS+= -DHAVE_CONFIG_H=1 CFLAGS+= -I${_spath} CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband -.if ${COMPILER_FEATURES:Mc++11} -CXXFLAGS+= -std=c++11 -.endif VERSION_MAP= ${_spath}/libibnetdisc.map .include Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Fri Mar 29 17:52:57 2019 (r345703) +++ head/share/mk/bsd.progs.mk Fri Mar 29 18:13:44 2019 (r345704) @@ -22,8 +22,8 @@ PROGS += ${PROGS_CXX} .if defined(PROG) # just one of many -PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ - PROGNAME SRCS STRIP WARNS +PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE CSTD CXXSTD DPSRCS MAN \ + NO_WERROR PROGNAME SRCS STRIP WARNS PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD INTERNALPROG LDADD LIBADD \ LINKS LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Mar 29 17:52:57 2019 (r345703) +++ head/share/mk/bsd.sys.mk Fri Mar 29 18:13:44 2019 (r345704) @@ -24,6 +24,19 @@ CFLAGS+= -std=iso9899:1999 .else # CSTD CFLAGS+= -std=${CSTD} .endif # CSTD + +.if ${COMPILER_FEATURES:Mc++11} +CXXSTD?= c++11 +.elif ${COMPILER_TYPE} == "gcc" +# Prior versions of g++ support C++98 with GNU extensions by default. +CXXSTD?= gnu++98 +.else +# Assume that the compiler supports at least C++98. +CXXSTD?= c++98 +.endif +CXXFLAGS+= -std=${CXXSTD} +# CXXSTD + # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS+= -pedantic .if defined(WARNS) Modified: head/share/mk/googletest.test.inc.mk ============================================================================== --- head/share/mk/googletest.test.inc.mk Fri Mar 29 17:52:57 2019 (r345703) +++ head/share/mk/googletest.test.inc.mk Fri Mar 29 18:13:44 2019 (r345704) @@ -1,13 +1,9 @@ # $FreeBSD$ -# XXX: this should be defined in bsd.sys.mk -CXXSTD?= c++11 - GTESTS_CXXFLAGS+= -DGTEST_HAS_POSIX_RE=1 GTESTS_CXXFLAGS+= -DGTEST_HAS_PTHREAD=1 GTESTS_CXXFLAGS+= -DGTEST_HAS_STREAM_REDIRECTION=1 GTESTS_CXXFLAGS+= -frtti -GTESTS_CXXFLAGS+= -std=${CXXSTD} # XXX: src.libnames.mk should handle adding this directory for libgtest's, # libgmock's, etc, headers. Modified: head/usr.bin/dtc/Makefile ============================================================================== --- head/usr.bin/dtc/Makefile Fri Mar 29 17:52:57 2019 (r345703) +++ head/usr.bin/dtc/Makefile Fri Mar 29 18:13:44 2019 (r345704) @@ -6,7 +6,7 @@ MAN= dtc.1 WARNS?= 3 -CXXFLAGS+= -std=c++11 -fno-rtti -fno-exceptions +CXXFLAGS+= -fno-rtti -fno-exceptions NO_SHARED?=NO Modified: head/usr.sbin/pmc/Makefile ============================================================================== --- head/usr.sbin/pmc/Makefile Fri Mar 29 17:52:57 2019 (r345703) +++ head/usr.sbin/pmc/Makefile Fri Mar 29 18:13:44 2019 (r345704) @@ -6,7 +6,8 @@ PROG_CXX= pmc MAN= WARNS?= 3 -CXXFLAGS+= -O0 -std=c++14 +CXXFLAGS+= -O0 +CXXSTD= c++14 CWARNFLAGS.gcc+= -Wno-redundant-decls LIBADD= kvm pmc m ncursesw pmcstat elf From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C8E1DC11F; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yt4syZz4P3G; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id A22E519EC1; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id F02571C278; Sat, 30 Mar 2019 03:15:09 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A4816A5EF; Sat, 30 Mar 2019 03:15:09 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0C5EF1C229; Sat, 30 Mar 2019 03:15:09 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 054C11C225; Sat, 30 Mar 2019 03:15:06 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B1456A5E7; Sat, 30 Mar 2019 03:15:05 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x531.google.com with SMTP id q1so2064606pgv.13; Fri, 29 Mar 2019 20:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qeSjQHnTkQQS95Sm7vWD0otCok02oWPYQy9RUPRHrbE=; b=or017AqJcouF79F4r91+ASPp/9SvtsALCq+JwOyCOoTrnvSOK9owvfK/MqoKpvNY1V oUUXmEhYC/4VqHky/Kt8Uoy8KWFqacU2of8RF/wgixwsitHZCqGGg+2/1wQpGfC2VXeU pGQPQ6eVSXcRl+IhIBXqoatdH/ve9Bxi1fDKed1N3dOszapJ9YLxpI9zclN9y4XcmSXF xcVZoXehtwrTWf4NSr1bmlhh/FXkniQuXYTPtCbmx22GnHoI+oWaarsF8xfGB6dehBwl Jn6KsdCGtrTOyHNjVZKqw0IXrBGtxpPC0XxQMaLF7eda0cg3v/kmkjgwpvWLzn138eT6 WUYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qeSjQHnTkQQS95Sm7vWD0otCok02oWPYQy9RUPRHrbE=; b=b2ffPC0cZJMfONVppHLcyjFvV32Ln2Mt1doKSvKXirC6cT2nh9tEUGAWbzgnBEBKR6 1pjMDEYIn0cGYsKHxGCTeVC7/KubzZ0WosEECOytVt8ePdifXRj/UUIssXHPC/s9IVRK REWt+ECMKb5gk06ak67pKij+ooxNlUExQbJRFp1X2iuBXaMzVW8WTciQKsTehhqKPBBb J4E/YNTjcEFZi4b6lNgiuNhozbJdlwOk000XlbI6q0vx4jK+zIOWb84RTh21av3ABVYV EQFyaeRitTndDD2DkuqyqQiaRNAqQhTkD5FUTW2kem/ry9CiBcUTcagj1Vh6PJKIjoSP xSbA== X-Gm-Message-State: APjAAAWfKNK0RYh4RD0VCDSUNDM9qm8OYnQ69tyiplA2PwCiHfa1jT7a QXBEPwU1djhACa4PWZKuHGr10f3cGX0= X-Google-Smtp-Source: APXvYqwOuT9McJTGZIjusnEgHSGj4c0xy3O8KowEnR3xIQc/nF+BSAdMDc/WYjr366nDwA63jwKHQA== X-Received: by 2002:a65:6144:: with SMTP id o4mr11970203pgv.247.1553915704198; Fri, 29 Mar 2019 20:15:04 -0700 (PDT) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id v7sm4404732pgh.53.2019.03.29.20.15.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Mar 2019 20:15:03 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r345707 - in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libc/tests/stdlib lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk us... From: Enji Cooper In-Reply-To: <201903300309.x2U39DtW002526@gndrsh.dnsmgr.net> Cc: Enji Cooper , src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201903300309.x2U39DtW002526@gndrsh.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3445.102.3) Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3A4816A5EF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:03 -0000 X-Original-Date: Fri, 29 Mar 2019 20:15:02 -0700 X-List-Received-Date: Tue, 03 Sep 2019 14:06:03 -0000 > On Mar 29, 2019, at 8:09 PM, Rodney W. Grimes = wrote: >=20 >> Author: ngie >> Date: Fri Mar 29 18:43:46 2019 >> New Revision: 345707 >> URL: https://svnweb.freebsd.org/changeset/base/345707 >>=20 >> Log: >> Revert r345706: the third time will be the charm >>=20 >> When a review is closed via Phabricator it updates the patch = attached to the >> review. I downloaded the raw patch from Phabricator, applied it, and = repeated >> my mistake from r345704 by accident mixing content from D19732 and = D19738. >=20 > Which, arguable is a feature or mis feature depending on the point > of view. I do not like it when I go to look at someone elses > committed code siting a review, as I want to actually see what > it was that was committed. You can find the pre-commit diff, > but it takes a bit of probling. The upside is you can get > both diffs from the same place and diff the diffs :-) >=20 >> For my own personal sanity, I will try not to mix reviews like this = in the >> future. >=20 > :-) Been there, almost did that too. > Pre commit last minute svn diff saved me. =E2=80=A6 This is why I=E2=80=99m doing the following from here on out: $ arc patch $ svn ci Unfortunately svn doesn=E2=80=99t support all of the niceties of =E2=80=9C= arc land=E2=80=9D. Otherwise, I would have used that. The Facebook version of =E2=80=9Carc land=E2=80=9D (before their new = non-public variation) supported verifying diffs in local repos vs = Phabricator to make sure that the diff content was consistent/correct. * Pro: it would catch issues like what I did the first time. * Con: I couldn=E2=80=99t make last minute changes (I would need to = resubmit the change and have it re-reviewed, which I argue is a good = feature). Just some food for thought. For now, arc patch/svn ci works for me. Thanks :), -Enji= From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47E84DC0AF; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yr6Xd4z4P1Q; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id BFB5519E32; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id B4119FB9B; Fri, 29 Mar 2019 16:53:50 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43DFF6E889; Fri, 29 Mar 2019 16:53:50 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 18F87FB77; Fri, 29 Mar 2019 16:53:50 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7779EFB75 for ; Fri, 29 Mar 2019 16:53:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50D896E885; Fri, 29 Mar 2019 16:53:47 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10E811A62; Fri, 29 Mar 2019 16:53:47 +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 x2TGrl5T029683; Fri, 29 Mar 2019 16:53:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TGrk0X029681; Fri, 29 Mar 2019 16:53:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903291653.x2TGrk0X029681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345702 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 345702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 43DFF6E889 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:00 -0000 X-Original-Date: Fri, 29 Mar 2019 16:53:46 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:00 -0000 Author: kib Date: Fri Mar 29 16:53:46 2019 New Revision: 345702 URL: https://svnweb.freebsd.org/changeset/base/345702 Log: Eliminate adj_free field from vm_map_entry. Drop the adj_free field from vm_map_entry_t. Refine the max_free field so that p->max_free is the size of the largest gap with one endpoint in the subtree rooted at p. Change vm_map_findspace so that, first, the address-based splay is restricted to tree nodes with large-enough max_free value, to avoid searching for the right starting point in a subtree where all the gaps are too small. Second, when the address search leads to a tree search for the first large-enough gap, that gap is the subject of a splay-search that brings the gap to the top of the tree, so that an immediate insertion will take constant time. Break up the splay code into separate components, one for searching and breaking up the tree and another for reassembling it. Use these components, and not splay itself, for linking and unlinking. Drop the after-where parameter to link, as it is computed as a side-effect of the splay search. Submitted by: Doug Moore Reviewed by: markj Tested by: pho MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D17794 Modified: head/sys/vm/vm_kern.c head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Fri Mar 29 16:43:24 2019 (r345701) +++ head/sys/vm/vm_kern.c Fri Mar 29 16:53:46 2019 (r345702) @@ -641,7 +641,8 @@ kmap_alloc_wait(vm_map_t map, vm_size_t size) * to lock out sleepers/wakers. */ vm_map_lock(map); - if (vm_map_findspace(map, vm_map_min(map), size, &addr) == 0) + addr = vm_map_findspace(map, vm_map_min(map), size); + if (addr + size <= vm_map_max(map)) break; /* no space now; see if we can ever get space */ if (vm_map_max(map) - vm_map_min(map) < size) { Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Mar 29 16:43:24 2019 (r345701) +++ head/sys/vm/vm_map.c Fri Mar 29 16:53:46 2019 (r345702) @@ -132,9 +132,6 @@ static int vmspace_zinit(void *mem, int size, int flag static int vm_map_zinit(void *mem, int ize, int flags); static void _vm_map_init(vm_map_t map, pmap_t pmap, vm_offset_t min, vm_offset_t max); -static int vm_map_alignspace(vm_map_t map, vm_object_t object, - vm_ooffset_t offset, vm_offset_t *addr, vm_size_t length, - vm_offset_t max_addr, vm_offset_t alignment); static void vm_map_entry_deallocate(vm_map_entry_t entry, boolean_t system_map); static void vm_map_entry_dispose(vm_map_t map, vm_map_entry_t entry); static void vm_map_entry_unwire(vm_map_t map, vm_map_entry_t entry); @@ -672,8 +669,51 @@ _vm_map_assert_locked(vm_map_t map, const char *file, #define VM_MAP_ASSERT_LOCKED(map) \ _vm_map_assert_locked(map, LOCK_FILE, LOCK_LINE) + +static void +_vm_map_assert_consistent(vm_map_t map) +{ + vm_map_entry_t entry; + vm_map_entry_t child; + vm_size_t max_left, max_right; + + for (entry = map->header.next; entry != &map->header; + entry = entry->next) { + KASSERT(entry->prev->end <= entry->start, + ("map %p prev->end = %jx, start = %jx", map, + (uintmax_t)entry->prev->end, (uintmax_t)entry->start)); + KASSERT(entry->start < entry->end, + ("map %p start = %jx, end = %jx", map, + (uintmax_t)entry->start, (uintmax_t)entry->end)); + KASSERT(entry->end <= entry->next->start, + ("map %p end = %jx, next->start = %jx", map, + (uintmax_t)entry->end, (uintmax_t)entry->next->start)); + KASSERT(entry->left == NULL || + entry->left->start < entry->start, + ("map %p left->start = %jx, start = %jx", map, + (uintmax_t)entry->left->start, (uintmax_t)entry->start)); + KASSERT(entry->right == NULL || + entry->start < entry->right->start, + ("map %p start = %jx, right->start = %jx", map, + (uintmax_t)entry->start, (uintmax_t)entry->right->start)); + child = entry->left; + max_left = (child != NULL) ? child->max_free : + entry->start - entry->prev->end; + child = entry->right; + max_right = (child != NULL) ? child->max_free : + entry->next->start - entry->end; + KASSERT(entry->max_free == MAX(max_left, max_right), + ("map %p max = %jx, max_left = %jx, max_right = %jx", map, + (uintmax_t)entry->max_free, + (uintmax_t)max_left, (uintmax_t)max_right)); + } +} + +#define VM_MAP_ASSERT_CONSISTENT(map) \ + _vm_map_assert_consistent(map) #else #define VM_MAP_ASSERT_LOCKED(map) +#define VM_MAP_ASSERT_CONSISTENT(map) #endif /* @@ -865,100 +905,117 @@ vm_map_entry_set_behavior(vm_map_entry_t entry, u_char static inline void vm_map_entry_set_max_free(vm_map_entry_t entry) { + vm_map_entry_t child; + vm_size_t max_left, max_right; - entry->max_free = entry->adj_free; - if (entry->left != NULL && entry->left->max_free > entry->max_free) - entry->max_free = entry->left->max_free; - if (entry->right != NULL && entry->right->max_free > entry->max_free) - entry->max_free = entry->right->max_free; + child = entry->left; + max_left = (child != NULL) ? child->max_free : + entry->start - entry->prev->end; + child = entry->right; + max_right = (child != NULL) ? child->max_free : + entry->next->start - entry->end; + entry->max_free = MAX(max_left, max_right); } +#define SPLAY_LEFT_STEP(root, y, rlist, test) do { \ + y = root->left; \ + if (y != NULL && (test)) { \ + /* Rotate right and make y root. */ \ + root->left = y->right; \ + y->right = root; \ + vm_map_entry_set_max_free(root); \ + root = y; \ + y = root->left; \ + } \ + /* Put root on rlist. */ \ + root->left = rlist; \ + rlist = root; \ + root = y; \ +} while (0) + +#define SPLAY_RIGHT_STEP(root, y, llist, test) do { \ + y = root->right; \ + if (y != NULL && (test)) { \ + /* Rotate left and make y root. */ \ + root->right = y->left; \ + y->left = root; \ + vm_map_entry_set_max_free(root); \ + root = y; \ + y = root->right; \ + } \ + /* Put root on llist. */ \ + root->right = llist; \ + llist = root; \ + root = y; \ +} while (0) + /* - * vm_map_entry_splay: - * - * The Sleator and Tarjan top-down splay algorithm with the - * following variation. Max_free must be computed bottom-up, so - * on the downward pass, maintain the left and right spines in - * reverse order. Then, make a second pass up each side to fix - * the pointers and compute max_free. The time bound is O(log n) - * amortized. - * - * The new root is the vm_map_entry containing "addr", or else an - * adjacent entry (lower or higher) if addr is not in the tree. - * - * The map must be locked, and leaves it so. - * - * Returns: the new root. + * Walk down the tree until we find addr or a NULL pointer where addr would go, + * breaking off left and right subtrees of nodes less than, or greater than + * addr. Treat pointers to nodes with max_free < length as NULL pointers. + * llist and rlist are the two sides in reverse order (bottom-up), with llist + * linked by the right pointer and rlist linked by the left pointer in the + * vm_map_entry. */ static vm_map_entry_t -vm_map_entry_splay(vm_offset_t addr, vm_map_entry_t root) +vm_map_splay_split(vm_offset_t addr, vm_size_t length, + vm_map_entry_t root, vm_map_entry_t *out_llist, vm_map_entry_t *out_rlist) { vm_map_entry_t llist, rlist; - vm_map_entry_t ltree, rtree; vm_map_entry_t y; - /* Special case of empty tree. */ - if (root == NULL) - return (root); - - /* - * Pass One: Splay down the tree until we find addr or a NULL - * pointer where addr would go. llist and rlist are the two - * sides in reverse order (bottom-up), with llist linked by - * the right pointer and rlist linked by the left pointer in - * the vm_map_entry. Wait until Pass Two to set max_free on - * the two spines. - */ llist = NULL; rlist = NULL; - for (;;) { - /* root is never NULL in here. */ + while (root != NULL && root->max_free >= length) { if (addr < root->start) { - y = root->left; - if (y == NULL) - break; - if (addr < y->start && y->left != NULL) { - /* Rotate right and put y on rlist. */ - root->left = y->right; - y->right = root; - vm_map_entry_set_max_free(root); - root = y->left; - y->left = rlist; - rlist = y; - } else { - /* Put root on rlist. */ - root->left = rlist; - rlist = root; - root = y; - } + SPLAY_LEFT_STEP(root, y, rlist, + y->max_free >= length && addr < y->start); } else if (addr >= root->end) { - y = root->right; - if (y == NULL) - break; - if (addr >= y->end && y->right != NULL) { - /* Rotate left and put y on llist. */ - root->right = y->left; - y->left = root; - vm_map_entry_set_max_free(root); - root = y->right; - y->right = llist; - llist = y; - } else { - /* Put root on llist. */ - root->right = llist; - llist = root; - root = y; - } + SPLAY_RIGHT_STEP(root, y, llist, + y->max_free >= length && addr >= y->end); } else break; } + *out_llist = llist; + *out_rlist = rlist; + return (root); +} - /* - * Pass Two: Walk back up the two spines, flip the pointers - * and set max_free. The subtrees of the root go at the - * bottom of llist and rlist. - */ - ltree = root->left; +static void +vm_map_splay_findnext(vm_map_entry_t root, vm_map_entry_t *iolist) +{ + vm_map_entry_t rlist, y; + + root = root->right; + rlist = *iolist; + while (root != NULL) + SPLAY_LEFT_STEP(root, y, rlist, true); + *iolist = rlist; +} + +static void +vm_map_splay_findprev(vm_map_entry_t root, vm_map_entry_t *iolist) +{ + vm_map_entry_t llist, y; + + root = root->left; + llist = *iolist; + while (root != NULL) + SPLAY_RIGHT_STEP(root, y, llist, true); + *iolist = llist; +} + +/* + * Walk back up the two spines, flip the pointers and set max_free. The + * subtrees of the root go at the bottom of llist and rlist. + */ +static vm_map_entry_t +vm_map_splay_merge(vm_map_entry_t root, + vm_map_entry_t llist, vm_map_entry_t rlist, + vm_map_entry_t ltree, vm_map_entry_t rtree) +{ + vm_map_entry_t y; + while (llist != NULL) { y = llist->right; llist->right = ltree; @@ -966,7 +1023,6 @@ vm_map_entry_splay(vm_offset_t addr, vm_map_entry_t ro ltree = llist; llist = y; } - rtree = root->right; while (rlist != NULL) { y = rlist->left; rlist->left = rtree; @@ -986,73 +1042,143 @@ vm_map_entry_splay(vm_offset_t addr, vm_map_entry_t ro } /* + * vm_map_entry_splay: + * + * The Sleator and Tarjan top-down splay algorithm with the + * following variation. Max_free must be computed bottom-up, so + * on the downward pass, maintain the left and right spines in + * reverse order. Then, make a second pass up each side to fix + * the pointers and compute max_free. The time bound is O(log n) + * amortized. + * + * The new root is the vm_map_entry containing "addr", or else an + * adjacent entry (lower if possible) if addr is not in the tree. + * + * The map must be locked, and leaves it so. + * + * Returns: the new root. + */ +static vm_map_entry_t +vm_map_entry_splay(vm_offset_t addr, vm_map_entry_t root) +{ + vm_map_entry_t llist, rlist; + + root = vm_map_splay_split(addr, 0, root, &llist, &rlist); + if (root != NULL) { + /* do nothing */ + } else if (llist != NULL) { + /* + * Recover the greatest node in the left + * subtree and make it the root. + */ + root = llist; + llist = root->right; + root->right = NULL; + } else if (rlist != NULL) { + /* + * Recover the least node in the right + * subtree and make it the root. + */ + root = rlist; + rlist = root->left; + root->left = NULL; + } else { + /* There is no root. */ + return (NULL); + } + return (vm_map_splay_merge(root, llist, rlist, + root->left, root->right)); +} + +/* * vm_map_entry_{un,}link: * * Insert/remove entries from maps. */ static void vm_map_entry_link(vm_map_t map, - vm_map_entry_t after_where, vm_map_entry_t entry) { + vm_map_entry_t llist, rlist, root; - CTR4(KTR_VM, - "vm_map_entry_link: map %p, nentries %d, entry %p, after %p", map, - map->nentries, entry, after_where); + CTR3(KTR_VM, + "vm_map_entry_link: map %p, nentries %d, entry %p", map, + map->nentries, entry); VM_MAP_ASSERT_LOCKED(map); - KASSERT(after_where->end <= entry->start, - ("vm_map_entry_link: prev end %jx new start %jx overlap", - (uintmax_t)after_where->end, (uintmax_t)entry->start)); - KASSERT(entry->end <= after_where->next->start, - ("vm_map_entry_link: new end %jx next start %jx overlap", - (uintmax_t)entry->end, (uintmax_t)after_where->next->start)); - map->nentries++; - entry->prev = after_where; - entry->next = after_where->next; - entry->next->prev = entry; - after_where->next = entry; - - if (after_where != &map->header) { - if (after_where != map->root) - vm_map_entry_splay(after_where->start, map->root); - entry->right = after_where->right; - entry->left = after_where; - after_where->right = NULL; - after_where->adj_free = entry->start - after_where->end; - vm_map_entry_set_max_free(after_where); - } else { - entry->right = map->root; - entry->left = NULL; - } - entry->adj_free = entry->next->start - entry->end; - vm_map_entry_set_max_free(entry); + root = map->root; + root = vm_map_splay_split(entry->start, 0, root, &llist, &rlist); + KASSERT(root == NULL, + ("vm_map_entry_link: link object already mapped")); + entry->prev = (llist == NULL) ? &map->header : llist; + entry->next = (rlist == NULL) ? &map->header : rlist; + entry->prev->next = entry->next->prev = entry; + root = vm_map_splay_merge(entry, llist, rlist, NULL, NULL); map->root = entry; + VM_MAP_ASSERT_CONSISTENT(map); } +enum unlink_merge_type { + UNLINK_MERGE_PREV, + UNLINK_MERGE_NONE, + UNLINK_MERGE_NEXT +}; + static void vm_map_entry_unlink(vm_map_t map, - vm_map_entry_t entry) + vm_map_entry_t entry, + enum unlink_merge_type op) { - vm_map_entry_t next, prev, root; + vm_map_entry_t llist, rlist, root, y; VM_MAP_ASSERT_LOCKED(map); - if (entry != map->root) - vm_map_entry_splay(entry->start, map->root); - if (entry->left == NULL) - root = entry->right; - else { - root = vm_map_entry_splay(entry->start, entry->left); - root->right = entry->right; - root->adj_free = entry->next->start - root->end; - vm_map_entry_set_max_free(root); + llist = entry->prev; + rlist = entry->next; + llist->next = rlist; + rlist->prev = llist; + root = map->root; + root = vm_map_splay_split(entry->start, 0, root, &llist, &rlist); + KASSERT(root != NULL, + ("vm_map_entry_unlink: unlink object not mapped")); + + switch (op) { + case UNLINK_MERGE_PREV: + vm_map_splay_findprev(root, &llist); + llist->end = root->end; + y = root->right; + root = llist; + llist = root->right; + root->right = y; + break; + case UNLINK_MERGE_NEXT: + vm_map_splay_findnext(root, &rlist); + rlist->start = root->start; + rlist->offset = root->offset; + y = root->left; + root = rlist; + rlist = root->left; + root->left = y; + break; + case UNLINK_MERGE_NONE: + vm_map_splay_findprev(root, &llist); + vm_map_splay_findnext(root, &rlist); + if (llist != NULL) { + root = llist; + llist = root->right; + root->right = NULL; + } else if (rlist != NULL) { + root = rlist; + rlist = root->left; + root->left = NULL; + } else + root = NULL; + break; } + if (root != NULL) + root = vm_map_splay_merge(root, llist, rlist, + root->left, root->right); map->root = root; - - prev = entry->prev; - next = entry->next; - next->prev = prev; - prev->next = next; + VM_MAP_ASSERT_CONSISTENT(map); map->nentries--; CTR3(KTR_VM, "vm_map_entry_unlink: map %p, nentries %d, entry %p", map, map->nentries, entry); @@ -1061,27 +1187,30 @@ vm_map_entry_unlink(vm_map_t map, /* * vm_map_entry_resize_free: * - * Recompute the amount of free space following a vm_map_entry - * and propagate that value up the tree. Call this function after - * resizing a map entry in-place, that is, without a call to - * vm_map_entry_link() or _unlink(). + * Recompute the amount of free space following a modified vm_map_entry + * and propagate those values up the tree. Call this function after + * resizing a map entry in-place by changing the end value, without a + * call to vm_map_entry_link() or _unlink(). * * The map must be locked, and leaves it so. */ static void vm_map_entry_resize_free(vm_map_t map, vm_map_entry_t entry) { + vm_map_entry_t llist, rlist, root; - /* - * Using splay trees without parent pointers, propagating - * max_free up the tree is done by moving the entry to the - * root and making the change there. - */ - if (entry != map->root) - map->root = vm_map_entry_splay(entry->start, map->root); - - entry->adj_free = entry->next->start - entry->end; - vm_map_entry_set_max_free(entry); + VM_MAP_ASSERT_LOCKED(map); + root = map->root; + root = vm_map_splay_split(entry->start, 0, root, &llist, &rlist); + KASSERT(root != NULL, + ("vm_map_entry_resize_free: resize_free object not mapped")); + vm_map_splay_findnext(root, &rlist); + root->right = NULL; + map->root = vm_map_splay_merge(root, llist, rlist, + root->left, root->right); + VM_MAP_ASSERT_CONSISTENT(map); + CTR3(KTR_VM, "vm_map_entry_resize_free: map %p, nentries %d, entry %p", map, + map->nentries, entry); } /* @@ -1100,7 +1229,7 @@ vm_map_lookup_entry( vm_offset_t address, vm_map_entry_t *entry) /* OUT */ { - vm_map_entry_t cur; + vm_map_entry_t cur, lbound; boolean_t locked; /* @@ -1108,12 +1237,15 @@ vm_map_lookup_entry( * "address" is the map's header. */ cur = map->root; - if (cur == NULL) + if (cur == NULL) { *entry = &map->header; - else if (address >= cur->start && cur->end > address) { + return (FALSE); + } + if (address >= cur->start && cur->end > address) { *entry = cur; return (TRUE); - } else if ((locked = vm_map_locked(map)) || + } + if ((locked = vm_map_locked(map)) || sx_try_upgrade(&map->lock)) { /* * Splay requires a write lock on the map. However, it only @@ -1122,6 +1254,7 @@ vm_map_lookup_entry( * on a temporary upgrade. */ map->root = cur = vm_map_entry_splay(address, cur); + VM_MAP_ASSERT_CONSISTENT(map); if (!locked) sx_downgrade(&map->lock); @@ -1130,35 +1263,30 @@ vm_map_lookup_entry( * is that map entry. Otherwise, the new root is a map entry * immediately before or after "address". */ - if (address >= cur->start) { + if (address < cur->start) { + *entry = &map->header; + return (FALSE); + } + *entry = cur; + return (address < cur->end); + } + /* + * Since the map is only locked for read access, perform a + * standard binary search tree lookup for "address". + */ + lbound = &map->header; + do { + if (address < cur->start) { + cur = cur->left; + } else if (cur->end <= address) { + lbound = cur; + cur = cur->right; + } else { *entry = cur; - if (cur->end > address) - return (TRUE); - } else - *entry = cur->prev; - } else - /* - * Since the map is only locked for read access, perform a - * standard binary search tree lookup for "address". - */ - for (;;) { - if (address < cur->start) { - if (cur->left == NULL) { - *entry = cur->prev; - break; - } - cur = cur->left; - } else if (cur->end > address) { - *entry = cur; - return (TRUE); - } else { - if (cur->right == NULL) { - *entry = cur; - break; - } - cur = cur->right; - } + return (TRUE); } + } while (cur != NULL); + *entry = lbound; return (FALSE); } @@ -1351,7 +1479,7 @@ charged: /* * Insert the new entry into the list */ - vm_map_entry_link(map, prev_entry, new_entry); + vm_map_entry_link(map, new_entry); if ((new_entry->eflags & MAP_ENTRY_GUARD) == 0) map->size += new_entry->end - new_entry->start; @@ -1377,23 +1505,22 @@ charged: * Find the first fit (lowest VM address) for "length" free bytes * beginning at address >= start in the given map. * - * In a vm_map_entry, "adj_free" is the amount of free space - * adjacent (higher address) to this entry, and "max_free" is the - * maximum amount of contiguous free space in its subtree. This - * allows finding a free region in one path down the tree, so - * O(log n) amortized with splay trees. + * In a vm_map_entry, "max_free" is the maximum amount of + * contiguous free space between an entry in its subtree and a + * neighbor of that entry. This allows finding a free region in + * one path down the tree, so O(log n) amortized with splay + * trees. * * The map must be locked, and leaves it so. * - * Returns: 0 on success, and starting address in *addr, - * 1 if insufficient space. + * Returns: starting address if sufficient space, + * vm_map_max(map)-length+1 if insufficient space. */ -int -vm_map_findspace(vm_map_t map, vm_offset_t start, vm_size_t length, - vm_offset_t *addr) /* OUT */ +vm_offset_t +vm_map_findspace(vm_map_t map, vm_offset_t start, vm_size_t length) { - vm_map_entry_t entry; - vm_offset_t st; + vm_map_entry_t llist, rlist, root, y; + vm_size_t left_length; /* * Request must fit within min/max VM address and must avoid @@ -1401,57 +1528,87 @@ vm_map_findspace(vm_map_t map, vm_offset_t start, vm_s */ start = MAX(start, vm_map_min(map)); if (start + length > vm_map_max(map) || start + length < start) - return (1); + return (vm_map_max(map) - length + 1); /* Empty tree means wide open address space. */ - if (map->root == NULL) { - *addr = start; - return (0); - } + if (map->root == NULL) + return (start); /* * After splay, if start comes before root node, then there * must be a gap from start to the root. */ - map->root = vm_map_entry_splay(start, map->root); - if (start + length <= map->root->start) { - *addr = start; - return (0); + root = vm_map_splay_split(start, length, map->root, + &llist, &rlist); + if (root != NULL) + start = root->end; + else if (rlist != NULL) { + root = rlist; + rlist = root->left; + root->left = NULL; + } else { + root = llist; + llist = root->right; + root->right = NULL; } + map->root = vm_map_splay_merge(root, llist, rlist, + root->left, root->right); + VM_MAP_ASSERT_CONSISTENT(map); + if (start + length <= root->start) + return (start); /* * Root is the last node that might begin its gap before * start, and this is the last comparison where address * wrap might be a problem. */ - st = (start > map->root->end) ? start : map->root->end; - if (length <= map->root->end + map->root->adj_free - st) { - *addr = st; - return (0); - } + if (root->right == NULL && + start + length <= vm_map_max(map)) + return (start); /* With max_free, can immediately tell if no solution. */ - entry = map->root->right; - if (entry == NULL || length > entry->max_free) - return (1); + if (root->right == NULL || length > root->right->max_free) + return (vm_map_max(map) - length + 1); /* - * Search the right subtree in the order: left subtree, root, - * right subtree (first fit). The previous splay implies that - * all regions in the right subtree have addresses > start. + * Splay for the least large-enough gap in the right subtree. */ - while (entry != NULL) { - if (entry->left != NULL && entry->left->max_free >= length) - entry = entry->left; - else if (entry->adj_free >= length) { - *addr = entry->end; - return (0); - } else - entry = entry->right; + llist = NULL; + rlist = NULL; + for (left_length = 0; ; + left_length = root->left != NULL ? + root->left->max_free : root->start - llist->end) { + if (length <= left_length) + SPLAY_LEFT_STEP(root, y, rlist, + length <= (y->left != NULL ? + y->left->max_free : y->start - llist->end)); + else + SPLAY_RIGHT_STEP(root, y, llist, + length > (y->left != NULL ? + y->left->max_free : y->start - root->end)); + if (root == NULL) + break; } - - /* Can't get here, so panic if we do. */ - panic("vm_map_findspace: max_free corrupt"); + root = llist; + llist = root->right; + if ((y = rlist) == NULL) + root->right = NULL; + else { + rlist = y->left; + y->left = NULL; + root->right = y->right; + } + root = vm_map_splay_merge(root, llist, rlist, + root->left, root->right); + if (y != NULL) { + y->right = root->right; + vm_map_entry_set_max_free(y); + root->right = y; + vm_map_entry_set_max_free(root); + } + map->root = root; + VM_MAP_ASSERT_CONSISTENT(map); + return (root->end); } int @@ -1532,8 +1689,9 @@ vm_map_alignspace(vm_map_t map, vm_object_t object, vm VM_MAP_ASSERT_LOCKED(map); free_addr = *addr; - KASSERT(!vm_map_findspace(map, free_addr, length, addr) && - free_addr == *addr, ("caller provided insufficient free space")); + KASSERT(free_addr == vm_map_findspace(map, free_addr, length), + ("caller failed to provide space %d at address %p", + (int)length, (void*)free_addr)); for (;;) { /* * At the start of every iteration, the free space at address @@ -1559,8 +1717,10 @@ vm_map_alignspace(vm_map_t map, vm_object_t object, vm * be a valid address, in which case vm_map_findspace() cannot * be relied upon to fail. */ - if (aligned_addr < free_addr || - vm_map_findspace(map, aligned_addr, length, addr) || + if (aligned_addr < free_addr) + return (KERN_NO_SPACE); + *addr = vm_map_findspace(map, aligned_addr, length); + if (*addr + length > vm_map_max(map) || (max_addr != 0 && *addr + length > max_addr)) return (KERN_NO_SPACE); free_addr = *addr; @@ -1672,22 +1832,27 @@ again: gap = vm_map_max(map) > MAP_32BIT_MAX_ADDR && (max_addr == 0 || max_addr > MAP_32BIT_MAX_ADDR) ? aslr_pages_rnd_64[pidx] : aslr_pages_rnd_32[pidx]; - if (vm_map_findspace(map, curr_min_addr, length + - gap * pagesizes[pidx], addr)) + *addr = vm_map_findspace(map, curr_min_addr, + length + gap * pagesizes[pidx]); + if (*addr + length + gap * pagesizes[pidx] > ++ vm_map_max(map)) goto again; /* And randomize the start address. */ *addr += (arc4random() % gap) * pagesizes[pidx]; if (max_addr != 0 && *addr + length > max_addr) goto again; - } else if (vm_map_findspace(map, curr_min_addr, length, addr) || - (max_addr != 0 && *addr + length > max_addr)) { - if (cluster) { - cluster = false; - MPASS(try == 1); - goto again; + } else { + *addr = vm_map_findspace(map, curr_min_addr, length); + if (*addr + length > vm_map_max(map) || + (max_addr != 0 && *addr + length > max_addr)) { + if (cluster) { + cluster = false; + MPASS(try == 1); + goto again; + } + rv = KERN_NO_SPACE; + goto done; } - rv = KERN_NO_SPACE; - goto done; } if (find_space != VMFS_ANY_SPACE && @@ -1825,18 +1990,12 @@ vm_map_simplify_entry(vm_map_t map, vm_map_entry_t ent return; prev = entry->prev; if (vm_map_mergeable_neighbors(prev, entry)) { - vm_map_entry_unlink(map, prev); - entry->start = prev->start; - entry->offset = prev->offset; - if (entry->prev != &map->header) - vm_map_entry_resize_free(map, entry->prev); + vm_map_entry_unlink(map, prev, UNLINK_MERGE_NEXT); vm_map_merged_neighbor_dispose(map, prev); } next = entry->next; if (vm_map_mergeable_neighbors(entry, next)) { - vm_map_entry_unlink(map, next); - entry->end = next->end; - vm_map_entry_resize_free(map, entry); + vm_map_entry_unlink(map, next, UNLINK_MERGE_PREV); vm_map_merged_neighbor_dispose(map, next); } } @@ -1914,7 +2073,7 @@ _vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, if (new_entry->cred != NULL) crhold(entry->cred); - vm_map_entry_link(map, entry->prev, new_entry); + vm_map_entry_link(map, new_entry); if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) { vm_object_reference(new_entry->object.vm_object); @@ -1996,7 +2155,7 @@ _vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, v if (new_entry->cred != NULL) crhold(entry->cred); - vm_map_entry_link(map, entry, new_entry); + vm_map_entry_link(map, new_entry); if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) { vm_object_reference(new_entry->object.vm_object); @@ -3132,7 +3291,7 @@ vm_map_entry_delete(vm_map_t map, vm_map_entry_t entry vm_pindex_t offidxstart, offidxend, count, size1; vm_size_t size; - vm_map_entry_unlink(map, entry); + vm_map_entry_unlink(map, entry, UNLINK_MERGE_NONE); object = entry->object.vm_object; if ((entry->eflags & MAP_ENTRY_GUARD) != 0) { @@ -3675,8 +3834,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c * Insert the entry into the new map -- we know we're * inserting at the end of the new map. */ - vm_map_entry_link(new_map, new_map->header.prev, - new_entry); + vm_map_entry_link(new_map, new_entry); vmspace_map_entry_forked(vm1, vm2, new_entry); /* @@ -3703,8 +3861,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c new_entry->wired_count = 0; new_entry->object.vm_object = NULL; new_entry->cred = NULL; - vm_map_entry_link(new_map, new_map->header.prev, - new_entry); + vm_map_entry_link(new_map, new_entry); vmspace_map_entry_forked(vm1, vm2, new_entry); vm_map_copy_entry(old_map, new_map, old_entry, new_entry, fork_charge); @@ -3727,8 +3884,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c new_entry->max_protection = old_entry->max_protection; new_entry->inheritance = VM_INHERIT_ZERO; - vm_map_entry_link(new_map, new_map->header.prev, - new_entry); + vm_map_entry_link(new_map, new_entry); vmspace_map_entry_forked(vm1, vm2, new_entry); new_entry->cred = curthread->td_ucred; Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Fri Mar 29 16:43:24 2019 (r345701) +++ head/sys/vm/vm_map.h Fri Mar 29 16:53:46 2019 (r345702) @@ -106,7 +106,6 @@ struct vm_map_entry { vm_offset_t start; /* start address */ vm_offset_t end; /* end address */ vm_offset_t next_read; /* vaddr of the next sequential read */ - vm_size_t adj_free; /* amount of adjacent free space */ vm_size_t max_free; /* max free space in subtree */ union vm_map_object object; /* object I point to */ vm_ooffset_t offset; /* offset into object */ @@ -402,7 +401,7 @@ int vm_map_find_min(vm_map_t, vm_object_t, vm_ooffset_ vm_size_t, vm_offset_t, vm_offset_t, int, vm_prot_t, vm_prot_t, int); int vm_map_fixed(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t, vm_size_t, vm_prot_t, vm_prot_t, int); -int vm_map_findspace (vm_map_t, vm_offset_t, vm_size_t, vm_offset_t *); +vm_offset_t vm_map_findspace(vm_map_t, vm_offset_t, vm_size_t); int vm_map_inherit (vm_map_t, vm_offset_t, vm_offset_t, vm_inherit_t); void vm_map_init(vm_map_t, pmap_t, vm_offset_t, vm_offset_t); int vm_map_insert (vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t, vm_offset_t, vm_prot_t, vm_prot_t, int); From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA813DC08C; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yr2jwgz4P0m; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 8A38E19E04; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5D9E8CC29; Fri, 29 Mar 2019 15:07:04 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 293F097E29; Fri, 29 Mar 2019 15:07:04 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 15210CC26; Fri, 29 Mar 2019 15:07:04 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 17C2CCC1F for ; Fri, 29 Mar 2019 15:07:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4C9797E21; Fri, 29 Mar 2019 15:07:00 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9766274D; Fri, 29 Mar 2019 15:07:00 +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 x2TF70uf069475; Fri, 29 Mar 2019 15:07:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TF70Nc069474; Fri, 29 Mar 2019 15:07:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201903291507.x2TF70Nc069474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345694 - head/libexec/rtld-elf/mips X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/libexec/rtld-elf/mips X-SVN-Commit-Revision: 345694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 293F097E29 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:58 -0000 X-Original-Date: Fri, 29 Mar 2019 15:07:00 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:58 -0000 Author: emaste Date: Fri Mar 29 15:07:00 2019 New Revision: 345694 URL: https://svnweb.freebsd.org/changeset/base/345694 Log: rtld: attempt to fix reloc_non_plt TLS allocation on MIPS allocate_tls_offset returns true on success. The same issue existed on arm and was fixed in r345693. PR: 236880 MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/libexec/rtld-elf/mips/reloc.c Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Fri Mar 29 14:35:23 2019 (r345693) +++ head/libexec/rtld-elf/mips/reloc.c Fri Mar 29 15:07:00 2019 (r345694) @@ -588,7 +588,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int if (def == NULL) return -1; - if (!defobj->tls_done && allocate_tls_offset(obj)) + if (!defobj->tls_done && !allocate_tls_offset(obj)) return -1; val += (Elf_Addr)def->st_value - TLS_DTP_OFFSET; @@ -616,7 +616,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int if (def == NULL) return -1; - if (!defobj->tls_done && allocate_tls_offset(obj)) + if (!defobj->tls_done && !allocate_tls_offset(obj)) return -1; val += (Elf_Addr)(def->st_value + defobj->tlsoffset From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9946DC08F; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yr4lvcz4P0s; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 9239019E13; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5F864D0BB; Fri, 29 Mar 2019 15:20:53 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FB9B69A78; Fri, 29 Mar 2019 15:20:52 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0C180D046; Fri, 29 Mar 2019 15:20:52 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7A27FD039 for ; Fri, 29 Mar 2019 15:20:49 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44C3869A4B; Fri, 29 Mar 2019 15:20:49 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DB6CA49; Fri, 29 Mar 2019 15:20:49 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2TFKnbh076141; Fri, 29 Mar 2019 15:20:49 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TFKm5e076140; Fri, 29 Mar 2019 15:20:48 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201903291520.x2TFKm5e076140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345695 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 345695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 8FB9B69A78 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:58 -0000 X-Original-Date: Fri, 29 Mar 2019 15:20:48 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:58 -0000 Author: bde Date: Fri Mar 29 15:20:48 2019 New Revision: 345695 URL: https://svnweb.freebsd.org/changeset/base/345695 Log: Fix races in mouse signal handling almost properly using the INTOFF/INTON method as in /bin/sh. We still do technically undefined things in the signal handler, but it is safe in practice to access state that is protected by INTOFF/INTON. In a recent commit, I sprinkled VGLMouseFrozen++/-- operations in places that need INTOFF/INTON. This prevented clobbering of pixels under the mouse, but left mouse signals deferred for too long. It is necessary to call the signal handler when the count goes to 0. Old versions did this in the unfreeze function, but didn't block actual signals, so the signal handler raced itself. The sprinkled operations reduced the races, but when then worked to block a race they left signals deferred for too long. Use INTOFF/INTON to fix complete loss of mouse signals while reading the mouse status. Clobbering of the state was prevented by SIG_IGN'ing mouse signals, but that has a high overhead and broke more than it fixed by losing mouse signals completely. sigprocmask() works to block signals without losing them completely, but its overhead is also too high. libvgl's mouse signal handling is often worse than none. Applications can't block waiting for a mouse or keyboard or other event, but have to busy-wait. The SIG_IGN's lost about half of all mouse events while busy-waiting for mouse events. Modified: head/lib/libvgl/mouse.c Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Fri Mar 29 15:07:00 2019 (r345694) +++ head/lib/libvgl/mouse.c Fri Mar 29 15:20:48 2019 (r345695) @@ -86,12 +86,19 @@ static byte map[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE*4]; static VGLBitmap VGLMouseSave = VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, map); static int VGLMouseVisible = 0; -static int VGLMouseFrozen = 0; static int VGLMouseShown = 0; static int VGLMouseXpos = 0; static int VGLMouseYpos = 0; static int VGLMouseButtons = 0; +static volatile sig_atomic_t VGLMintpending; +static volatile sig_atomic_t VGLMsuppressint; +#define INTOFF() (VGLMsuppressint++) +#define INTON() do { \ + if (--VGLMsuppressint == 0 && VGLMintpending) \ + VGLMouseAction(0); \ + } while (0) + void VGLMousePointerShow() { @@ -102,7 +109,7 @@ VGLMousePointerShow() int i, pos, pos1; if (!VGLMouseVisible) { - VGLMouseFrozen++; + INTOFF(); VGLMouseVisible = 1; crtcidx = inb(0x3c4); crtcval = inb(0x3c5); @@ -125,7 +132,7 @@ VGLMousePointerShow() outb(0x3c5, crtcval); outb(0x3ce, gdcidx); outb(0x3cf, gdcval); - VGLMouseFrozen--; + INTON(); } } @@ -135,7 +142,7 @@ VGLMousePointerHide() byte crtcidx, crtcval, gdcidx, gdcval; if (VGLMouseVisible) { - VGLMouseFrozen++; + INTOFF(); VGLMouseVisible = 0; crtcidx = inb(0x3c4); crtcval = inb(0x3c5); @@ -147,7 +154,7 @@ VGLMousePointerHide() outb(0x3c5, crtcval); outb(0x3ce, gdcidx); outb(0x3cf, gdcval); - VGLMouseFrozen--; + INTON(); } } @@ -173,10 +180,13 @@ VGLMouseAction(int dummy) { struct mouse_info mouseinfo; - if (VGLMouseFrozen) { - VGLMouseFrozen += 8; + if (VGLMsuppressint) { + VGLMintpending = 1; return; } +again: + INTOFF(); + VGLMintpending = 0; mouseinfo.operation = MOUSE_GETINFO; ioctl(0, CONS_MOUSECTL, &mouseinfo); if (VGLMouseShown == VGL_MOUSESHOW) @@ -186,6 +196,15 @@ VGLMouseAction(int dummy) VGLMouseButtons = mouseinfo.u.data.buttons; if (VGLMouseShown == VGL_MOUSESHOW) VGLMousePointerShow(); + + /* + * Loop to handle any new (suppressed) signals. This is INTON() without + * recursion. !SA_RESTART prevents recursion in signal handling. So the + * maximum recursion is 2 levels. + */ + VGLMsuppressint = 0; + if (VGLMintpending) + goto again; } void @@ -248,11 +267,11 @@ VGLMouseInit(int mode) int VGLMouseStatus(int *x, int *y, char *buttons) { - signal(SIGUSR2, SIG_IGN); + INTOFF(); *x = VGLMouseXpos; *y = VGLMouseYpos; *buttons = VGLMouseButtons; - signal(SIGUSR2, VGLMouseAction); + INTON(); return VGLMouseShown; } @@ -261,7 +280,7 @@ VGLMouseFreeze(int x, int y, int width, int hight, u_l { int i, xstride, ystride; - VGLMouseFrozen++; + INTOFF(); if (width > 1 || hight > 1 || (color & 0xc0000000) == 0) { /* bitmap */ if (VGLMouseShown == 1) { int overlap; @@ -311,13 +330,8 @@ VGLMouseFreeze(int x, int y, int width, int hight, u_l void VGLMouseUnFreeze() { - if (VGLMouseFrozen > 8) { - VGLMouseFrozen = 0; - VGLMouseAction(0); - } - else { - if (VGLMouseShown == VGL_MOUSESHOW && !VGLMouseVisible) - VGLMousePointerShow(); - VGLMouseFrozen = 0; - } + if (VGLMouseShown == VGL_MOUSESHOW && !VGLMouseVisible && !VGLMintpending) + VGLMousePointerShow(); + while (VGLMsuppressint) + INTON(); } From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4382CDC0A7; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yr5nhhz4P16; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 9E21319E23; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D673FE7BC; Fri, 29 Mar 2019 16:05:35 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A3EF6C248; Fri, 29 Mar 2019 16:05:34 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 13D20E772; Fri, 29 Mar 2019 16:05:34 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 94A9EE770 for ; Fri, 29 Mar 2019 16:05:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B8416C240; Fri, 29 Mar 2019 16:05:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22AC611BE; Fri, 29 Mar 2019 16:05:31 +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 x2TG5Umh002375; Fri, 29 Mar 2019 16:05:30 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TG5UwL002374; Fri, 29 Mar 2019 16:05:30 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201903291605.x2TG5UwL002374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345697 - head/usr.sbin/iostat X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/iostat X-SVN-Commit-Revision: 345697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 5A3EF6C248 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:59 -0000 X-Original-Date: Fri, 29 Mar 2019 16:05:30 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:59 -0000 Author: trasz Date: Fri Mar 29 16:05:30 2019 New Revision: 345697 URL: https://svnweb.freebsd.org/changeset/base/345697 Log: Reduce the precision of "MB/s" by one, making room for displaying transfer rates larger 99MB/s. MFC after: 2 weeks Modified: head/usr.sbin/iostat/iostat.c Modified: head/usr.sbin/iostat/iostat.c ============================================================================== --- head/usr.sbin/iostat/iostat.c Fri Mar 29 15:57:08 2019 (r345696) +++ head/usr.sbin/iostat/iostat.c Fri Mar 29 16:05:30 2019 (r345697) @@ -945,7 +945,7 @@ devstats(int perf_select, long double etime, int havel ms_per_transaction); } else { if (Iflag == 0) - printf(" %4.1Lf %4.0Lf %5.2Lf ", + printf(" %4.1Lf %4.0Lf %5.1Lf ", kb_per_transfer, transfers_per_second, mb_per_second); From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44138DC0A9; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yr5kW1z4P14; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id A6C4F19E27; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 71810EDD2; Fri, 29 Mar 2019 16:30:23 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 275C96D01B; Fri, 29 Mar 2019 16:30:23 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 16099EDD0; Fri, 29 Mar 2019 16:30:23 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 52450EDCE for ; Fri, 29 Mar 2019 16:30:20 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 210B76D018; Fri, 29 Mar 2019 16:30:20 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBB741554; Fri, 29 Mar 2019 16:30:19 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2TGUJaB013567; Fri, 29 Mar 2019 16:30:19 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TGUJuI013566; Fri, 29 Mar 2019 16:30:19 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201903291630.x2TGUJuI013566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345698 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 345698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 275C96D01B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:59 -0000 X-Original-Date: Fri, 29 Mar 2019 16:30:19 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:59 -0000 Author: bde Date: Fri Mar 29 16:30:19 2019 New Revision: 345698 URL: https://svnweb.freebsd.org/changeset/base/345698 Log: Fix restoring to graphics modes in VGLEnd(). Correct restoring was only attempted for mode 258 (800x600x4 P). (This was the only useful graphics mode supported in the kernel until 10-15 years ago, and is still the only one explicitly documented in the man page). The comment says that it is the geometry (subscreen size) that is restored, but it seems to only be necessary to restore the font size, with the geometry only needed since it is set by the same ioctl. The font size was not restored for this mode, but was forced to 16. For other graphics modes, the font size was clobbered to 0. This confuses but doesn't crash the kernel (font size 0 gives null text). This confuses and crashes vidcontrol. The only way to recover was to use vidcontrol to set the mode to any text mode on the way back to the original graphics mode. vidcontrol gets this wrong in the opposite way when backing out of changes after an error. It restores the font size correctly, but forces the geometry to the full screen size. Modified: head/lib/libvgl/main.c Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Fri Mar 29 16:05:30 2019 (r345697) +++ head/lib/libvgl/main.c Fri Mar 29 16:30:19 2019 (r345698) @@ -61,12 +61,14 @@ static int VGLAbortPending; static int VGLOnDisplay; static unsigned int VGLCurWindow; static int VGLInitDone = 0; +static video_info_t VGLOldModeInfo; static vid_info_t VGLOldVInfo; void VGLEnd() { struct vt_mode smode; + int size[3]; if (!VGLInitDone) return; @@ -81,18 +83,15 @@ struct vt_mode smode; munmap(VGLMem, VGLAdpInfo.va_window_size); } - if (VGLOldMode >= M_VESA_BASE) { - /* ugly, but necessary */ + if (VGLOldMode >= M_VESA_BASE) ioctl(0, _IO('V', VGLOldMode - M_VESA_BASE), 0); - if (VGLOldMode == M_VESA_800x600) { - int size[3]; - size[0] = VGLOldVInfo.mv_csz; - size[1] = VGLOldVInfo.mv_rsz; - size[2] = 16; - ioctl(0, KDRASTER, size); - } - } else { + else ioctl(0, _IO('S', VGLOldMode), 0); + if (VGLOldModeInfo.vi_flags & V_INFO_GRAPHICS) { + size[0] = VGLOldVInfo.mv_csz; + size[1] = VGLOldVInfo.mv_rsz; + size[2] = VGLOldVInfo.font_size;; + ioctl(0, KDRASTER, size); } ioctl(0, KDDISABIO, 0); ioctl(0, KDSETMODE, KD_TEXT); @@ -165,12 +164,13 @@ VGLInit(int mode) if (ioctl(0, CONS_MODEINFO, &VGLModeInfo)) /* FBIO_MODEINFO */ return -1; - /* If current mode is VESA_800x600 then save its geometry to restore later */ - if ((VGLOldMode >= M_VESA_BASE) && (VGLOldMode == M_VESA_800x600)) { - VGLOldVInfo.size = sizeof(VGLOldVInfo); - if (ioctl(0, CONS_GETINFO, &VGLOldVInfo)) - return -1; - } + /* Save info for old mode to restore font size if old mode is graphics. */ + VGLOldModeInfo.vi_mode = VGLOldMode; + if (ioctl(0, CONS_MODEINFO, &VGLOldModeInfo)) + return -1; + VGLOldVInfo.size = sizeof(VGLOldVInfo); + if (ioctl(0, CONS_GETINFO, &VGLOldVInfo)) + return -1; VGLDisplay = (VGLBitmap *)malloc(sizeof(VGLBitmap)); if (VGLDisplay == NULL) From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 543D8DC0F3; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ys5qcyz4P2T; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 451E519E8D; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 415B815951; Fri, 29 Mar 2019 21:39:52 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FEEE830D2; Fri, 29 Mar 2019 21:39:51 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 11967158FD; Fri, 29 Mar 2019 21:39:51 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 8EE20158FB for ; Fri, 29 Mar 2019 21:39:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E8E2830CC; Fri, 29 Mar 2019 21:39:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 186D94CD7; Fri, 29 Mar 2019 21:39:48 +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 x2TLdlNt081205; Fri, 29 Mar 2019 21:39:47 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TLdlsC081204; Fri, 29 Mar 2019 21:39:47 GMT (envelope-from np@FreeBSD.org) Message-Id: <201903292139.x2TLdlsC081204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345714 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 345714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3FEEE830D2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:02 -0000 X-Original-Date: Fri, 29 Mar 2019 21:39:47 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:02 -0000 Author: np Date: Fri Mar 29 21:39:47 2019 New Revision: 345714 URL: https://svnweb.freebsd.org/changeset/base/345714 Log: tcp_autorcvbuf_inc was removed in r344433. Discussed with: tuexen@ Sponsored by: Chelsio Communications Modified: head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Fri Mar 29 20:21:28 2019 (r345713) +++ head/sys/netinet/tcp_var.h Fri Mar 29 21:39:47 2019 (r345714) @@ -754,7 +754,6 @@ extern int tcp_log_in_vain; VNET_DECLARE(int, drop_synfin); VNET_DECLARE(int, path_mtu_discovery); VNET_DECLARE(int, tcp_abc_l_var); -VNET_DECLARE(int, tcp_autorcvbuf_inc); VNET_DECLARE(int, tcp_autorcvbuf_max); VNET_DECLARE(int, tcp_autosndbuf_inc); VNET_DECLARE(int, tcp_autosndbuf_max); @@ -789,7 +788,6 @@ VNET_DECLARE(struct inpcbinfo, tcbinfo); #define V_tcb VNET(tcb) #define V_tcbinfo VNET(tcbinfo) #define V_tcp_abc_l_var VNET(tcp_abc_l_var) -#define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) #define V_tcp_autosndbuf_inc VNET(tcp_autosndbuf_inc) #define V_tcp_autosndbuf_max VNET(tcp_autosndbuf_max) From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47149DC0AD; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yr5kJ2z4P13; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 97A7319E1E; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 637F5E2DB; Fri, 29 Mar 2019 15:57:12 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27A596B9AD; Fri, 29 Mar 2019 15:57:12 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1024CE2D8; Fri, 29 Mar 2019 15:57:12 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 93EFDE2D6 for ; Fri, 29 Mar 2019 15:57:09 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0A96B9AA; Fri, 29 Mar 2019 15:57:09 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2531D1018; Fri, 29 Mar 2019 15:57:09 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2TFv9b5097227; Fri, 29 Mar 2019 15:57:09 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TFv9AW097226; Fri, 29 Mar 2019 15:57:09 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201903291557.x2TFv9AW097226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345696 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 345696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 27A596B9AD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:59 -0000 X-Original-Date: Fri, 29 Mar 2019 15:57:09 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:59 -0000 Author: bde Date: Fri Mar 29 15:57:08 2019 New Revision: 345696 URL: https://svnweb.freebsd.org/changeset/base/345696 Log: Fix endless loops for handling SIGBUS and SIGSEGV. r80270 has the usual wrong fix for unsafe signal handling -- just set a flag and return to let an event loop check the flag and do safe handling. This never works for signals like SIGBUS and SIGSEGV that repeat and works poorly for others unless the application has an event loop designed to support this. For these signals, clean up unsafely as before, except for arranging that nested signals are fatal and forcing a nested signal if the cleanup doesn't cause one. Modified: head/lib/libvgl/main.c Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Fri Mar 29 15:20:48 2019 (r345695) +++ head/lib/libvgl/main.c Fri Mar 29 15:57:08 2019 (r345696) @@ -31,9 +31,9 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include -#include #include #include #include @@ -107,14 +107,22 @@ struct vt_mode smode; } static void -VGLAbort(int arg __unused) +VGLAbort(int arg) { + sigset_t mask; + VGLAbortPending = 1; signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); - signal(SIGSEGV, SIG_IGN); - signal(SIGBUS, SIG_IGN); signal(SIGUSR2, SIG_IGN); + if (arg == SIGBUS || arg == SIGSEGV) { + signal(arg, SIG_DFL); + sigemptyset(&mask); + sigaddset(&mask, arg); + sigprocmask(SIG_UNBLOCK, &mask, NULL); + VGLEnd(); + kill(getpid(), arg); + } } static void From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E338DC17C; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv0t5hz4P45; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 2F5FB19F09; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 903A6A73B; Sat, 30 Mar 2019 18:00:48 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3294B6E501; Sat, 30 Mar 2019 18:00:48 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1447CA73A; Sat, 30 Mar 2019 18:00:48 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id A659BA738 for ; Sat, 30 Mar 2019 18:00:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 620086E4FB; Sat, 30 Mar 2019 18:00:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BBF91A64D; Sat, 30 Mar 2019 18:00:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2UI0j0w038484; Sat, 30 Mar 2019 18:00:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2UI0itq038480; Sat, 30 Mar 2019 18:00:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201903301800.x2UI0itq038480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345739 - in head/sys: net netinet6 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: net netinet6 X-SVN-Commit-Revision: 345739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3294B6E501 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:05 -0000 X-Original-Date: Sat, 30 Mar 2019 18:00:44 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:05 -0000 Author: markj Date: Sat Mar 30 18:00:44 2019 New Revision: 345739 URL: https://svnweb.freebsd.org/changeset/base/345739 Log: Do not perform DAD on stf(4) interfaces. stf(4) interfaces are not multicast-capable so they can't perform DAD. They also did not set IFF_DRV_RUNNING when an address was assigned, so the logic in nd6_timer() would periodically flag such an address as tentative, resulting in interface flapping. Fix the problem by setting IFF_DRV_RUNNING when an address is assigned, and do some related cleanup: - In in6if_do_dad(), remove a redundant check for !UP || !RUNNING. There is only one caller in the tree, and it only looks at whether the return value is non-zero. - Have in6if_do_dad() return false if the interface is not multicast-capable. - Set ND6_IFF_NO_DAD when an address is assigned to an stf(4) interface and the interface goes UP as a result. Note that this is not sufficient to fix the problem because the new address is marked as tentative and DAD is started before in6_ifattach() is called. However, setting no_dad is formally correct. - Change nd6_timer() to not flag addresses as tentative if no_dad is set. This is based on a patch from Viktor Dukhovni. Reported by: Viktor Dukhovni Reviewed by: ae MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19751 Modified: head/sys/net/if_stf.c head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/nd6.c Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Sat Mar 30 17:42:27 2019 (r345738) +++ head/sys/net/if_stf.c Sat Mar 30 18:00:44 2019 (r345739) @@ -724,6 +724,7 @@ stf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } ifp->if_flags |= IFF_UP; + ifp->if_drv_flags |= IFF_DRV_RUNNING; break; case SIOCADDMULTI: Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sat Mar 30 17:42:27 2019 (r345738) +++ head/sys/netinet6/in6.c Sat Mar 30 18:00:44 2019 (r345739) @@ -1951,26 +1951,14 @@ in6_if_up(struct ifnet *ifp) int in6if_do_dad(struct ifnet *ifp) { + if ((ifp->if_flags & IFF_LOOPBACK) != 0) return (0); - - if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) || - (ND_IFINFO(ifp)->flags & ND6_IFF_NO_DAD)) + if ((ifp->if_flags & IFF_MULTICAST) == 0) return (0); - - /* - * Our DAD routine requires the interface up and running. - * However, some interfaces can be up before the RUNNING - * status. Additionally, users may try to assign addresses - * before the interface becomes up (or running). - * This function returns EAGAIN in that case. - * The caller should mark "tentative" on the address instead of - * performing DAD immediately. - */ - if (!((ifp->if_flags & IFF_UP) && - (ifp->if_drv_flags & IFF_DRV_RUNNING))) - return (EAGAIN); - + if ((ND_IFINFO(ifp)->flags & + (ND6_IFF_IFDISABLED | ND6_IFF_NO_DAD)) != 0) + return (0); return (1); } Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Sat Mar 30 17:42:27 2019 (r345738) +++ head/sys/netinet6/in6_ifattach.c Sat Mar 30 18:00:44 2019 (r345739) @@ -692,6 +692,7 @@ in6_ifattach(struct ifnet *ifp, struct ifnet *altifp) * it is rather harmful to have one. */ ND_IFINFO(ifp)->flags &= ~ND6_IFF_AUTO_LINKLOCAL; + ND_IFINFO(ifp)->flags |= ND6_IFF_NO_DAD; break; default: break; Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sat Mar 30 17:42:27 2019 (r345738) +++ head/sys/netinet6/nd6.c Sat Mar 30 18:00:44 2019 (r345739) @@ -900,6 +900,7 @@ nd6_timer(void *arg) struct nd_prhead prl; struct nd_defrouter *dr, *ndr; struct nd_prefix *pr, *npr; + struct ifnet *ifp; struct in6_ifaddr *ia6, *nia6; uint64_t genid; @@ -996,14 +997,15 @@ nd6_timer(void *arg) * Check status of the interface. If it is down, * mark the address as tentative for future DAD. */ - if ((ia6->ia_ifp->if_flags & IFF_UP) == 0 || - (ia6->ia_ifp->if_drv_flags & IFF_DRV_RUNNING) - == 0 || - (ND_IFINFO(ia6->ia_ifp)->flags & - ND6_IFF_IFDISABLED) != 0) { + ifp = ia6->ia_ifp; + if ((ND_IFINFO(ifp)->flags & ND6_IFF_NO_DAD) == 0 && + ((ifp->if_flags & IFF_UP) == 0 || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) != 0)){ ia6->ia6_flags &= ~IN6_IFF_DUPLICATED; ia6->ia6_flags |= IN6_IFF_TENTATIVE; } + /* * A new RA might have made a deprecated address * preferred. From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 541AEDC185; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv4Pwnz4P4m; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 9875019F47; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 6392F194DE; Sun, 31 Mar 2019 12:10:35 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D06276856; Sun, 31 Mar 2019 12:10:35 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0EBC0194DC; Sun, 31 Mar 2019 12:10:35 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 67B4A194DA for ; Sun, 31 Mar 2019 12:10:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8767776849; Sun, 31 Mar 2019 12:10:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x2VCAFb8063504 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 31 Mar 2019 15:10:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x2VCAFb8063504 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x2VCAF3A063503; Sun, 31 Mar 2019 15:10:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345696 - head/lib/libvgl Message-ID: <20190331121015.GK1923@kib.kiev.ua> References: <201903291557.x2TFv9AW097226@repo.freebsd.org> <20190329182100.GZ1923@kib.kiev.ua> <20190330142319.I1011@besplex.bde.org> <20190330094558.GA1923@kib.kiev.ua> <20190331214235.K961@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190331214235.K961@besplex.bde.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 1D06276856 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:06 -0000 X-Original-Date: Sun, 31 Mar 2019 15:10:15 +0300 X-List-Received-Date: Tue, 03 Sep 2019 14:06:06 -0000 On Sun, Mar 31, 2019 at 10:27:54PM +1100, Bruce Evans wrote: > On Sat, 30 Mar 2019, Konstantin Belousov wrote: > > > On Sat, Mar 30, 2019 at 03:24:40PM +1100, Bruce Evans wrote: > >> On Fri, 29 Mar 2019, Konstantin Belousov wrote: > >> > >>> On Fri, Mar 29, 2019 at 03:57:09PM +0000, Bruce Evans wrote: > >>>> Author: bde > >>>> Date: Fri Mar 29 15:57:08 2019 > >>>> New Revision: 345696 > >>>> URL: https://svnweb.freebsd.org/changeset/base/345696 > >>>> > >>>> Log: > >>>> Fix endless loops for handling SIGBUS and SIGSEGV. > >>>> > >>>> r80270 has the usual wrong fix for unsafe signal handling -- just set > >>>> a flag and return to let an event loop check the flag and do safe > >>>> handling. This never works for signals like SIGBUS and SIGSEGV that > >>>> repeat and works poorly for others unless the application has an event > >>>> loop designed to support this. > >>>> > >>>> For these signals, clean up unsafely as before, except for arranging that > >>>> nested signals are fatal and forcing a nested signal if the cleanup doesn't > >>>> cause one. > >>>> > >>>> Modified: > >>>> head/lib/libvgl/main.c > >>>> > >>>> Modified: head/lib/libvgl/main.c > >>>> ============================================================================== > >>>> --- head/lib/libvgl/main.c Fri Mar 29 15:20:48 2019 (r345695) > >>>> +++ head/lib/libvgl/main.c Fri Mar 29 15:57:08 2019 (r345696) > >>>> ... > >>>> @@ -107,14 +107,22 @@ struct vt_mode smode; > >>>> } > >>>> > >>>> static void > >>>> -VGLAbort(int arg __unused) > >>>> +VGLAbort(int arg) > >>>> { > >>>> + sigset_t mask; > >>>> + > >>>> VGLAbortPending = 1; > >>>> signal(SIGINT, SIG_IGN); > >>>> signal(SIGTERM, SIG_IGN); > >>>> - signal(SIGSEGV, SIG_IGN); > >>>> - signal(SIGBUS, SIG_IGN); > >>>> signal(SIGUSR2, SIG_IGN); > >>>> + if (arg == SIGBUS || arg == SIGSEGV) { > >>>> + signal(arg, SIG_DFL); > >>>> + sigemptyset(&mask); > >>>> + sigaddset(&mask, arg); > >>>> + sigprocmask(SIG_UNBLOCK, &mask, NULL); > >>>> + VGLEnd(); > >>>> + kill(getpid(), arg); > >>> This of course misses the siginfo information from the real fault. > >> > >> It is in the nested signal frame. > >> > >>> Why SIGBUS/SIGSEGV are caught at all ? > >> > >> Otherwise, the screen is left in an application mode that the kernel > >> doesn't support (except to not write to the screen, so that the > >> application has full control). > > Also, the keyboard may be left in a strange state. Usually this is no > worse than termios raw mode, but it may be raw scancodes. In raw scancodes > mode, Alt-Fn to switch to another vty to fix the problem. libvgl disables > switching to another vty without going through a libvgl handler anyway. > The combination is usually enough to break switching to vty0 to run ddb, > though that should work for at least breakpoints in the kernel. IIRC, > sc_cngrab() switches the keyboard mode, and my version of it restores > ignoring of the anti-switch flag. > > > ... > > I am more about not doing kill(2) from the handler, instead do plain > > return to the context which caused the original signal. > > That won't work well for SIGBUS's and SIGSEGV's related to the library. > If the above cleanup is not done, then it is too hard to debug the problem, > and if the above cleanup is done then it is impossible to debug the original > problem if it was for and invalid access in libvgl code. > > The latter is a problem for the above cleanup too -- the cleanup clobbers > the libvgl state. > > However, I could do a more limited cleanup of just restoring the screen and > keyboard state using ioctls. ioctl() isn't async-signal safe in POSIX, but > most ioctls are async-signal safe in practice provided they don't use > global variables that were set too recently or too non-atomically. > VGLEnd() uses main globals established by VGLInit(). It depends on program > order which is not guaranteed in signal handlers for testing the flags set > by initialization. The cleanup now also does: > - screen clearing. This breaks debugging and is dangerous if the bug is > in screen clearing. Screen clearing is also very slow, and belongs > in the kernel. It is now done 4 times per libvgl use, but its > slowness is limited by the kernel not clearing properly and the > kernel not allowing the application to mmap() the whole physical > frame buffer in some versions of FreeBSD (this breaks panning). > - munmap(). This breaks debugging. > - free() of backing store buffer and the main VGLDisplay data. This breaks > debugging and is unnecessary if we are going to exit. You can only try to do async-safe calls from SIGSEGV handler, to not break a limited chances to success. Also you should not modify in-memory state for the library, for the same reason, and then it fits your goal of keeping the state intact for debugging. Then you should return to re-create the original situation causing and not kill(2). I find it weird to try to debug mode-switched code without serial console. From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31C3ADC117; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yt42q8z4P31; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 80CEC19EB4; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E554E190DE; Sat, 30 Mar 2019 00:57:38 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CA48AB5A; Sat, 30 Mar 2019 00:57:38 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1976019075; Sat, 30 Mar 2019 00:57:38 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id CE3AF1906D for ; Sat, 30 Mar 2019 00:57:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 812398AB51; Sat, 30 Mar 2019 00:57:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A2A06F74; Sat, 30 Mar 2019 00:57:34 +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 x2U0vY8l088426; Sat, 30 Mar 2019 00:57:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2U0vYcH088425; Sat, 30 Mar 2019 00:57:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201903300057.x2U0vYcH088425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345723 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 345723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 48CA48AB5A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:03 -0000 X-Original-Date: Sat, 30 Mar 2019 00:57:34 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:03 -0000 Author: ngie Date: Sat Mar 30 00:57:33 2019 New Revision: 345723 URL: https://svnweb.freebsd.org/changeset/base/345723 Log: PROG_OVERRIDE_VARS should override default values if specified The behavior prior to this change would not override default values if set in `bsd.own.mk`, or (in the more general case) globally before `bsd.progs.mk` was included. This affected `bsd.test.mk` as well, since it consumes `bsd.progs.mk`. Some examples of this failing behavior are as follows: * `BINMODE` defaults to 0555 per `bsd.own.mk`. If someone wanted to set the `BINMODE` to `NOBINMODE` (0444) for `prog`, for example, like `BINMODE.prog= ${NOBINMODE}`, `bsd.progs.mk` would not honor the per-PROG setting. * An application, `prog`, does not build at `WARNS?= 6`. Before this change, setting to a lower `WARNS` value, e.g., `WARNS.prog= 3`, would have been impossible, requiring that `prog` be built from another directory, the global `WARNS` be lowered, or a per-PROG value needing to be set across the board. None of the above workarounds is desirable. This change unbreaks variables defined in `PROG_OVERRIDE_VARS` which have defaults set before `bsd.progs.mk` is included, by setting them to their defined values if set on a per-PROG basis. Reviewed by: asomers Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19755 Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Sat Mar 30 00:57:07 2019 (r345722) +++ head/share/mk/bsd.progs.mk Sat Mar 30 00:57:33 2019 (r345723) @@ -34,6 +34,11 @@ $v += ${${v}.${PROG}} $v += ${${v}_${PROG}} .endif .else +.if defined(${v}.${PROG}) +$v = ${${v}.${PROG}} +.elif defined(${v}_${PROG}) +$v = ${${v}_${PROG}} +.endif $v ?= .endif .endfor From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE523DC0C3; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ys1SpXz4P1c; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id E76AC19E46; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 77D9F1182A; Fri, 29 Mar 2019 18:21:13 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B069A7259F; Fri, 29 Mar 2019 18:21:12 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 12AA4117BE; Fri, 29 Mar 2019 18:21:12 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 49D4B117B2; Fri, 29 Mar 2019 18:21:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DC067257B; Fri, 29 Mar 2019 18:21:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x2TIL0nQ052388 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 29 Mar 2019 20:21:03 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x2TIL0nQ052388 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x2TIL039052386; Fri, 29 Mar 2019 20:21:00 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345696 - head/lib/libvgl Message-ID: <20190329182100.GZ1923@kib.kiev.ua> References: <201903291557.x2TFv9AW097226@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201903291557.x2TFv9AW097226@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: B069A7259F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:00 -0000 X-Original-Date: Fri, 29 Mar 2019 20:21:00 +0200 X-List-Received-Date: Tue, 03 Sep 2019 14:06:00 -0000 On Fri, Mar 29, 2019 at 03:57:09PM +0000, Bruce Evans wrote: > Author: bde > Date: Fri Mar 29 15:57:08 2019 > New Revision: 345696 > URL: https://svnweb.freebsd.org/changeset/base/345696 > > Log: > Fix endless loops for handling SIGBUS and SIGSEGV. > > r80270 has the usual wrong fix for unsafe signal handling -- just set > a flag and return to let an event loop check the flag and do safe > handling. This never works for signals like SIGBUS and SIGSEGV that > repeat and works poorly for others unless the application has an event > loop designed to support this. > > For these signals, clean up unsafely as before, except for arranging that > nested signals are fatal and forcing a nested signal if the cleanup doesn't > cause one. > > Modified: > head/lib/libvgl/main.c > > Modified: head/lib/libvgl/main.c > ============================================================================== > --- head/lib/libvgl/main.c Fri Mar 29 15:20:48 2019 (r345695) > +++ head/lib/libvgl/main.c Fri Mar 29 15:57:08 2019 (r345696) > @@ -31,9 +31,9 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include > #include > #include > -#include > #include > #include > #include > @@ -107,14 +107,22 @@ struct vt_mode smode; > } > > static void > -VGLAbort(int arg __unused) > +VGLAbort(int arg) > { > + sigset_t mask; > + > VGLAbortPending = 1; > signal(SIGINT, SIG_IGN); > signal(SIGTERM, SIG_IGN); > - signal(SIGSEGV, SIG_IGN); > - signal(SIGBUS, SIG_IGN); > signal(SIGUSR2, SIG_IGN); > + if (arg == SIGBUS || arg == SIGSEGV) { > + signal(arg, SIG_DFL); > + sigemptyset(&mask); > + sigaddset(&mask, arg); > + sigprocmask(SIG_UNBLOCK, &mask, NULL); > + VGLEnd(); > + kill(getpid(), arg); This of course misses the siginfo information from the real fault. Why SIGBUS/SIGSEGV are caught at all ? > + } > } > > static void From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 463BCDC0AC; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yr6g7Yz4P1V; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id B9D4319E30; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 73BC2F8B0; Fri, 29 Mar 2019 16:43:29 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2891B6E1CA; Fri, 29 Mar 2019 16:43:29 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 107A8F8AF; Fri, 29 Mar 2019 16:43:29 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5D588F8AD for ; Fri, 29 Mar 2019 16:43:26 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26EDB6E1C9; Fri, 29 Mar 2019 16:43:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1F6918A7; Fri, 29 Mar 2019 16:43:25 +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 x2TGhPQH024195; Fri, 29 Mar 2019 16:43:25 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TGhOLl024190; Fri, 29 Mar 2019 16:43:24 GMT (envelope-from np@FreeBSD.org) Message-Id: <201903291643.x2TGhOLl024190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345701 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 345701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 2891B6E1CA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:59 -0000 X-Original-Date: Fri, 29 Mar 2019 16:43:24 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:59 -0000 Author: np Date: Fri Mar 29 16:43:24 2019 New Revision: 345701 URL: https://svnweb.freebsd.org/changeset/base/345701 Log: cxgbe/t4_tom: Catch up with r344433, which removed tcb_autorcvbuf_inc. The declaration in tcp_var.h is still around so t4_tom continued to compile but wouldn't load. A separate commit will fix tcp_var.h Reported By: Dustin Marquess (dmarquess at gmail) Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_tls.c Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Fri Mar 29 16:41:01 2019 (r345700) +++ head/sys/dev/cxgbe/offload.h Fri Mar 29 16:43:24 2019 (r345701) @@ -230,6 +230,7 @@ struct tom_tunables { int tx_align; int tx_zcopy; int cop_managed_offloading; + int autorcvbuf_inc; }; /* iWARP driver tunables */ struct iw_tunables { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Mar 29 16:41:01 2019 (r345700) +++ head/sys/dev/cxgbe/t4_main.c Fri Mar 29 16:43:24 2019 (r345701) @@ -6266,6 +6266,11 @@ t4_sysctls(struct adapter *sc) &sc->tt.cop_managed_offloading, 0, "COP (Connection Offload Policy) controls all TOE offload"); + sc->tt.autorcvbuf_inc = 16 * 1024; + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "autorcvbuf_inc", + CTLFLAG_RW, &sc->tt.autorcvbuf_inc, 0, + "autorcvbuf increment"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "timer_tick", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_tp_tick, "A", "TP timer tick (us)"); Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Mar 29 16:41:01 2019 (r345700) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Mar 29 16:43:24 2019 (r345701) @@ -1631,7 +1631,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header sb->sb_hiwat < V_tcp_autorcvbuf_max && len > (sbspace(sb) / 8 * 7)) { unsigned int hiwat = sb->sb_hiwat; - unsigned int newsize = min(hiwat + V_tcp_autorcvbuf_inc, + unsigned int newsize = min(hiwat + sc->tt.autorcvbuf_inc, V_tcp_autorcvbuf_max); if (!sbreserve_locked(sb, newsize, so, NULL)) Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Fri Mar 29 16:41:01 2019 (r345700) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Fri Mar 29 16:43:24 2019 (r345701) @@ -549,8 +549,9 @@ handle_ddp_data(struct toepcb *toep, __be32 ddp_report V_tcp_do_autorcvbuf && sb->sb_hiwat < V_tcp_autorcvbuf_max && len > (sbspace(sb) / 8 * 7)) { + struct adapter *sc = td_adapter(toep->td); unsigned int hiwat = sb->sb_hiwat; - unsigned int newsize = min(hiwat + V_tcp_autorcvbuf_inc, + unsigned int newsize = min(hiwat + sc->tt.autorcvbuf_inc, V_tcp_autorcvbuf_max); if (!sbreserve_locked(sb, newsize, so, NULL)) Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Fri Mar 29 16:41:01 2019 (r345700) +++ head/sys/dev/cxgbe/tom/t4_tls.c Fri Mar 29 16:43:24 2019 (r345701) @@ -1588,7 +1588,7 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head sb->sb_hiwat < V_tcp_autorcvbuf_max && sb_length > (sbspace(sb) / 8 * 7)) { unsigned int hiwat = sb->sb_hiwat; - unsigned int newsize = min(hiwat + V_tcp_autorcvbuf_inc, + unsigned int newsize = min(hiwat + sc->tt.autorcvbuf_inc, V_tcp_autorcvbuf_max); if (!sbreserve_locked(sb, newsize, so, NULL)) From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7E24DBF87; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yl0yjfz4NvC; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 55E9619CAE; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E70021EE22; Fri, 29 Mar 2019 02:11:52 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A79070003; Fri, 29 Mar 2019 02:11:52 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1D0D61EDDF; Fri, 29 Mar 2019 02:11:52 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 2FDCA1EDDD for ; Fri, 29 Mar 2019 02:11:49 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F06256FFF2; Fri, 29 Mar 2019 02:11:48 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD05A28171; Fri, 29 Mar 2019 02:11:48 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2T2BmsW056956; Fri, 29 Mar 2019 02:11:48 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2T2BmIf056955; Fri, 29 Mar 2019 02:11:48 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201903290211.x2T2BmIf056955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345674 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 345674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3A79070003 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:56 -0000 X-Original-Date: Fri, 29 Mar 2019 02:11:48 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:56 -0000 Author: jhibbits Date: Fri Mar 29 02:11:48 2019 New Revision: 345674 URL: https://svnweb.freebsd.org/changeset/base/345674 Log: powerpc: Remove now-obsolete P9H MMU name Modified: head/sys/powerpc/include/mmuvar.h Modified: head/sys/powerpc/include/mmuvar.h ============================================================================== --- head/sys/powerpc/include/mmuvar.h Fri Mar 29 01:51:41 2019 (r345673) +++ head/sys/powerpc/include/mmuvar.h Fri Mar 29 02:11:48 2019 (r345674) @@ -116,7 +116,6 @@ DATA_SET(mmu_set, name) #define MMU_TYPE_BOOKE "mmu_booke" /* Book-E MMU specification */ #define MMU_TYPE_OEA "mmu_oea" /* 32-bit OEA */ #define MMU_TYPE_G5 "mmu_g5" /* 64-bit bridge (ibm 970) */ -#define MMU_TYPE_P9H "mmu_p9h" /* 64-bit native ISA 3.0 (POWER9) hash */ #define MMU_TYPE_8xx "mmu_8xx" /* 8xx quicc TLB */ #endif /* _MACHINE_MMUVAR_H_ */ From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 149F5DBF9C; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yl5r6mz4Nvg; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 8BCCB19CCC; Tue, 3 Sep 2019 14:05:49 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7A51F1ACA; Fri, 29 Mar 2019 05:34:14 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E1E577ADB; Fri, 29 Mar 2019 05:34:14 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 149E91AC8; Fri, 29 Mar 2019 05:34:14 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id AE1F41AC4; Fri, 29 Mar 2019 05:34:11 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E60EF77AD6; Fri, 29 Mar 2019 05:34:10 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x2T5Y7lY097333; Thu, 28 Mar 2019 22:34:07 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x2T5Y7v2097332; Thu, 28 Mar 2019 22:34:07 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201903290534.x2T5Y7v2097332@gndrsh.dnsmgr.net> Subject: Re: svn commit: r345680 - head/sys/conf In-Reply-To: To: Ravi Pokala CC: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 2E1E577ADB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.922,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:57 -0000 X-Original-Date: Thu, 28 Mar 2019 22:34:07 -0700 (PDT) X-List-Received-Date: Tue, 03 Sep 2019 14:05:57 -0000 > -----Original Message----- > From: on behalf of Kyle Evans > Date: 2019-03-28, Thursday at 21:00 > To: , , > Subject: svn commit: r345680 - head/sys/conf > > > Author: kevans > > Date: Fri Mar 29 04:00:46 2019 > > New Revision: 345680 > > URL: https://svnweb.freebsd.org/changeset/base/345680 > > > > Log: > > NOTES: Use non-default value for BOOT_TAG > > Why? > > (I was on IRC when jhb debugged this, but I didn't quite get it; and of course lots of us *weren't* on IRC at the time.) Yes, please, why is this beeing changed, do I need to revise my .sh that was hunting for the old string to use what now? Or do I need to now override this in my KERNCONF files? I think changing this in stable/12 is a POLA issue. > Thanks, > > Ravi (rpokala@) > > > Reported by: jhb > > MFC after: 1 week (except non-empty value in stable/11) Why is 11 being treated special, or is it that it does not implement BOOT_TAG at all? Does this deserve a RELNOTES Y, or UPDATING entry? > > Modified: > > head/sys/conf/NOTES > > > > Modified: head/sys/conf/NOTES > > ============================================================================== > > --- head/sys/conf/NOTES Fri Mar 29 03:25:20 2019 (r345679) > > +++ head/sys/conf/NOTES Fri Mar 29 04:00:46 2019 (r345680) > > @@ -150,7 +150,7 @@ options BOOTHOWTO=RB_MULTIPLE > > # > > # Default boot tag; may use 'kern.boot_tag' loader tunable to override. The > > # current boot's tag is also exposed via the 'kern.boot_tag' sysctl. > > -options BOOT_TAG=\"---<>---\" > > +options BOOT_TAG=\"\" > > # Maximum boot tag size the kernel's static buffer should accomodate. Maximum > > # size for both BOOT_TAG and the assocated tunable. > > options BOOT_TAG_SZ=32 > > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 371A9DC119; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yt4tPHz4P3H; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id CEEA619EDA; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 659051F707; Sat, 30 Mar 2019 07:29:24 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32B12733F4; Sat, 30 Mar 2019 07:29:24 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 19BF81F706; Sat, 30 Mar 2019 07:29:24 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7F5491F704 for ; Sat, 30 Mar 2019 07:29:21 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15C03733F0; Sat, 30 Mar 2019 07:29:21 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEB25B739; Sat, 30 Mar 2019 07:29:20 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2U7TKYU091954; Sat, 30 Mar 2019 07:29:20 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2U7TKMX091953; Sat, 30 Mar 2019 07:29:20 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201903300729.x2U7TKMX091953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345728 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 345728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 32B12733F4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.93)[-0.932,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:03 -0000 X-Original-Date: Sat, 30 Mar 2019 07:29:20 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:03 -0000 Author: pjd Date: Sat Mar 30 07:29:20 2019 New Revision: 345728 URL: https://svnweb.freebsd.org/changeset/base/345728 Log: If the autoexpand pool property is turned on and vdev is healthy try to expand the pool automatically when we detect underlying GEOM provider size change. Obtained from: Fudo Security Tested in: AWS Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sat Mar 30 07:24:34 2019 (r345727) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sat Mar 30 07:29:20 2019 (r345728) @@ -158,6 +158,29 @@ vdev_geom_attrchanged(struct g_consumer *cp, const cha } static void +vdev_geom_resize(struct g_consumer *cp) +{ + struct consumer_priv_t *priv; + struct consumer_vdev_elem *elem; + spa_t *spa; + vdev_t *vd; + + priv = (struct consumer_priv_t *)&cp->private; + if (SLIST_EMPTY(priv)) + return; + + SLIST_FOREACH(elem, priv, elems) { + vd = elem->vd; + if (vd->vdev_state != VDEV_STATE_HEALTHY) + continue; + spa = vd->vdev_spa; + if (!spa->spa_autoexpand) + continue; + vdev_online(spa, vd->vdev_guid, ZFS_ONLINE_EXPAND, NULL); + } +} + +static void vdev_geom_orphan(struct g_consumer *cp) { struct consumer_priv_t *priv; @@ -229,6 +252,7 @@ vdev_geom_attach(struct g_provider *pp, vdev_t *vd, bo gp = g_new_geomf(&zfs_vdev_class, "zfs::vdev"); gp->orphan = vdev_geom_orphan; gp->attrchanged = vdev_geom_attrchanged; + gp->resize = vdev_geom_resize; cp = g_new_consumer(gp); error = g_attach(cp, pp); if (error != 0) { From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4543DC037; Tue, 3 Sep 2019 14:05:54 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yp3c98z4Nxq; Tue, 3 Sep 2019 14:05:54 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 2CD8A19D75; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id EE8B49329; Fri, 29 Mar 2019 13:43:37 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EC189228D; Fri, 29 Mar 2019 13:43:37 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 19D3492BD; Fri, 29 Mar 2019 13:43:37 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 558DD92B5; Fri, 29 Mar 2019 13:43:34 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E8629227E; Fri, 29 Mar 2019 13:43:34 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id A9AD52EB82; Fri, 29 Mar 2019 13:43:33 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f42.google.com with SMTP id y18so1498548lfe.1; Fri, 29 Mar 2019 06:43:33 -0700 (PDT) X-Gm-Message-State: APjAAAX+aatVXT4SZasWPefEUFiXr/HXzZUePgFdX13egHD67jzW4EEN IdT2ft4eB6egvDxdoMPYTZB8uH2b4MFCtWn3A/o= X-Google-Smtp-Source: APXvYqwgbhtcnWvxYc5Y7ieuT+gsQ9lCEFgQL6yCihh+0vvpUQYH2pIC8BrLKrV69mf1Xq3XDQ81K+PUdL9D05BO5XQ= X-Received: by 2002:ac2:491a:: with SMTP id n26mr9950035lfi.122.1553867012203; Fri, 29 Mar 2019 06:43:32 -0700 (PDT) MIME-Version: 1.0 References: <201903290400.x2T40kp7013212@repo.freebsd.org> <20190329164644.X957@besplex.bde.org> In-Reply-To: <20190329164644.X957@besplex.bde.org> From: Kyle Evans X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r345680 - head/sys/conf To: Bruce Evans Cc: Ravi Pokala , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 4EC189228D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:58 -0000 X-Original-Date: Fri, 29 Mar 2019 08:43:15 -0500 X-List-Received-Date: Tue, 03 Sep 2019 14:05:58 -0000 On Fri, Mar 29, 2019 at 1:40 AM Bruce Evans wrote: > > On Thu, 28 Mar 2019, Ravi Pokala wrote: > > > -----Original Message----- > > From: on behalf of Kyle Evans > > Date: 2019-03-28, Thursday at 21:00 > > To: , , > > Subject: svn commit: r345680 - head/sys/conf > >> [... snip ...] > >> # Maximum boot tag size the kernel's static buffer should accomodate. Maximum > >> # size for both BOOT_TAG and the assocated tunable. > >> options BOOT_TAG_SZ=32 > > This bug remains unfixed. 32 is the default. This option shouldn't exist. > Instead, just use size strlen(BOOT_TAG) + 1 for the static string and keep > the dynamic string in the environment. The string is only used once, and > msgbufinit() already has to check both the static string and the environment > to find the right string (it does this by fetching the dynamic string to > overwrite the static string, but it is easier to not use a tunable or > support a sysctl and just keep the dynamic string in the environment). > I will consider doing just that. Where I was going with this turned out to be logistically annoying because of kenv's val length limitation. I had some one-off test setups where I wanted to dump some cherry-picked information about the build into the BOOT_TAG via the tunable for reference when looking back and comparing msgbufs between boots. However, we can't reasonably support values the length I need in the environment (with a caveat, see [0]), so I would need to break them up -- likely by hand, which means I'm more inclined to just hunt down the current BOOT_TAG and modify these msgbufs post-mortem to include the information I want to see. This process is still less convenient than it would've been to be able to set it in loader.conf, because for many of these I already have to edit loader.conf for other reasons. Enlarging the BOOT_TAG_SZ in the 'breaking up' scenario is convenient because I'd rather not stitch the boot tag back together from the environment when observed via sysctl -- I want to do this once, and observe it exactly as it is after it's printed, so pushing it into the boot tag buffer that already holds the statically configured boot tag is convenient there. There are other reasons it'd be convenient to push them into the same buffer, but they're rather moot now since I'm likely the only one that wanted to use larger boot tags like that and I'm just not going to go that far to support my use case. [0] Merging into the dynamic environment is kind of broken here, and I didn't really fix it when I touched that. We only verify that the whole assignment line isn't more than MNAMELEN + MVALLEN + 2, rather than the individual components, so I could take advantage of this and have way-too-long values... that's not much more helpful, though. From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 933B8DC081; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yq6rlwz4P0X; Tue, 3 Sep 2019 14:05:55 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 7D1A719DF0; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 8357DBFF0; Fri, 29 Mar 2019 14:35:27 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36CA696559; Fri, 29 Mar 2019 14:35:27 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1A1CDBFEE; Fri, 29 Mar 2019 14:35:27 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 19BC9BFE7 for ; Fri, 29 Mar 2019 14:35:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C65DC9654D; Fri, 29 Mar 2019 14:35:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A071F233; Fri, 29 Mar 2019 14:35:23 +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 x2TEZNMd053371; Fri, 29 Mar 2019 14:35:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TEZNrg053370; Fri, 29 Mar 2019 14:35:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201903291435.x2TEZNrg053370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345693 - head/libexec/rtld-elf/arm X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/libexec/rtld-elf/arm X-SVN-Commit-Revision: 345693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 36CA696559 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:58 -0000 X-Original-Date: Fri, 29 Mar 2019 14:35:23 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:58 -0000 Author: emaste Date: Fri Mar 29 14:35:23 2019 New Revision: 345693 URL: https://svnweb.freebsd.org/changeset/base/345693 Log: rtld: attempt to fix reloc_nonplt_object TLS allocation allocate_tls_offset returns true on success. This still needs more testing and review, but this change is consistent with other archs. PR: 236880 Reported by: Andrew Gierth MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/rtld-elf/arm/reloc.c Modified: head/libexec/rtld-elf/arm/reloc.c ============================================================================== --- head/libexec/rtld-elf/arm/reloc.c Fri Mar 29 14:34:51 2019 (r345692) +++ head/libexec/rtld-elf/arm/reloc.c Fri Mar 29 14:35:23 2019 (r345693) @@ -319,7 +319,7 @@ reloc_nonplt_object(Obj_Entry *obj, const Elf_Rel *rel if (def == NULL) return -1; - if (!defobj->tls_done && allocate_tls_offset(obj)) + if (!defobj->tls_done && !allocate_tls_offset(obj)) return -1; tmp = (Elf_Addr)def->st_value + defobj->tlsoffset; From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE03DDBFD6; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ym16Dzz4Nw8; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 8F9BA19CFD; Tue, 3 Sep 2019 14:05:50 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E921E53B1; Fri, 29 Mar 2019 10:57:41 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6561C89FFE; Fri, 29 Mar 2019 10:57:41 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0FADB5373; Fri, 29 Mar 2019 10:57:41 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 80A58536C; Fri, 29 Mar 2019 10:57:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id D830189FF0; Fri, 29 Mar 2019 10:57:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 2EEBEC785; Fri, 29 Mar 2019 21:57:34 +1100 (AEDT) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexey Dokuchaev cc: Bruce Evans , Ravi Pokala , svn-src-head@freebsd.org, Kyle Evans , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r345680 - head/sys/conf In-Reply-To: <20190329094903.GA12522@FreeBSD.org> Message-ID: <20190329205849.E1647@besplex.bde.org> References: <201903290400.x2T40kp7013212@repo.freebsd.org> <20190329164644.X957@besplex.bde.org> <20190329094903.GA12522@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=i80GM_YtHSBQfDR70X0A:9 a=CjuIK1q_8ugA:10 Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 6561C89FFE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:57 -0000 X-Original-Date: Fri, 29 Mar 2019 21:57:32 +1100 (EST) X-List-Received-Date: Tue, 03 Sep 2019 14:05:57 -0000 On Fri, 29 Mar 2019, Alexey Dokuchaev wrote: > On Fri, Mar 29, 2019 at 05:40:05PM +1100, Bruce Evans wrote: >>>> ... >>>> -options BOOT_TAG=\"---<>---\" >>>> +options BOOT_TAG=\"\" >> >> Useful variations are not always easy to invent. I usually just add 1 for >> numeric values. This example is useful. It kills the boot tag. It gives >> an empty tag, and the kernel does extra work to avoid printing a newline >> after an empty tag. > > That's a nice idea, thanks Bruce. I always had to revert commits that had > added this stupid boot tag; if empty tag does not imply a newline, then it > makes things much easier. > > ./danfe > > P.S. Boot tag of a healthy human is "Copyright (c) 1992-2018 The FreeBSD > Project". Actually, there are ordering problems. After fixing lost messages, I get for the simplest case of a non-verbose cold boot: XX Mar 29 19:14:08 gamplex syslogd: kernel boot file is /kernel This boot file message is the first one. I often grep for it, so as to ignore messages for previous boots. XX Mar 29 19:14:08 gamplex kernel: ---<>--- This is almost first. XX Mar 29 19:14:08 gamplex kernel: Test of early printf to msgbuf XX Mar 29 19:14:08 gamplex kernel: Test of early printf to console Tests for my fixes. msgbufinit() is called early and uses a statically allocated buffer until the dynamic message buffer is mapped. Early messages are thus not lost for the message buffer. They may be lost for the console. XX Mar 29 19:14:08 gamplex kernel: GDB: debug ports: sio XX Mar 29 19:14:08 gamplex kernel: GDB: current port: sio XX Mar 29 19:14:08 gamplex kernel: KDB: debugger backends: ddb gdb XX Mar 29 19:14:08 gamplex kernel: KDB: current backend: ddb Standard early messages if DDB is configured. XX Mar 29 19:14:08 gamplex kernel: WARNING: loader(8) metadata is missing! I don't use loader on i386, and am reminded that I don't like it by this warning. XX Mar 29 19:14:08 gamplex kernel: Copyright (c) 1992-2019 The FreeBSD Project. Finally the copyright message. The source code still obfuscates the order of this using SYSINIT(), and on x86 and powerpc still has a bogus "Good {morning,afternoon,evening, night}" comment that isn't even attached to its code (the printf() of the message). The comment is in cpu_startup() which runs at SI_SUB_CPU, SI_ORDER_FIRST. This is much later than printing the copyright, which runs at SI_SUB_COPYRIGHT. In between, there are SUBs for VM, KMEM, HYPERISOR, WITNESS, MTX_POOL_DYNAMIC, LOCK, EVENTHANDLER, VNET_PRELINK and KLD. Before COPYRIGHT, there are only DUMMY, DONE and TUNABLES under sysinit, but lots more in early initialization including early console use for the above messages and ddb. The comment on SI_SUB_COPYRIGHT wrongly says that it is for the first use of the console. Booting with -v gives many more early messages that are usually lost. E.g., ones about SMAP on x86. Warm boots sometimes give a dynamic message buffer that is actually useful. To be useful, it must be retained at boot. Otherwise, it is easier to put the message buffer in the bss. The dynamic message buffer only works for me on amd64 and i386 with pae_mode=1 (and probably also more than 4GB RAM). Otherwise, it is below 4GB and the BIOS scribbles on it (fairly sparsely, but it doesn't have enough error correcting to recover). Recovering it fixes loss of the last few messages for the previous boot, but risks doubling of non-lost messages. The BOOT tags are useful for seeing where the new messages start. Everything usually works as well as possible: XX Mar 25 02:59:49 iotaplex syslogd: exiting on signal 15 The use of an amd64 kernel a few days ago was terminated by turning the system off. Messages printed after killing syslogd were lost. XX Mar 29 21:33:49 iotaplex syslogd: kernel boot file is /boot/kernel/kernel XX Mar 29 21:33:49 iotaplex kernel: ---<>--- XX Mar 29 21:33:49 iotaplex kernel: Test of early printf to msgbuf XX Mar 29 21:33:49 iotaplex kernel: GDB: debug ports: sio XX Mar 29 21:33:49 iotaplex kernel: GDB: current port: sio XX Mar 29 21:33:49 iotaplex kernel: KDB: debugger backends: ddb gdb XX Mar 29 21:33:49 iotaplex kernel: KDB: current backend: ddb XX Mar 29 21:33:49 iotaplex kernel: Copyright (c) 1992-2019 The FreeBSD Project. Cold boot of the same kernel today (actually, i386 was running before this, but the boot was cold enough for the message buffer). XX ... XX Mar 29 21:34:32 iotaplex syslogd: exiting on signal 15 As usual, messages printed after killing syslogd are not logged properly... XX Mar 29 21:35:55 iotaplex syslogd: kernel boot file is /boot/kernel/kernel Warm boot of the same amd64 kernel. XX Mar 29 21:35:55 iotaplex kernel: Waiting (max 60 seconds) for system process `vnlru' to stop... done XX Mar 29 21:35:55 iotaplex kernel: Waiting (max 60 seconds) for system process `syncer' to stop... XX Mar 29 21:35:55 iotaplex kernel: Syncing disks, vnodes remaining... 0 0 0 done XX Mar 29 21:35:55 iotaplex kernel: Waiting (max 60 seconds) for system thread `bufdaemon' to stop... done XX Mar 29 21:35:55 iotaplex kernel: Waiting (max 60 seconds) for system thread `bufspacedaemon-0' to stop... done XX Mar 29 21:35:55 iotaplex kernel: Waiting (max 60 seconds) for system thread `bufspacedaemon-1' to stop... done XX Mar 29 21:35:55 iotaplex kernel: Waiting (max 60 seconds) for system thread `bufspacedaemon-2' to stop... done XX Mar 29 21:35:55 iotaplex kernel: Waiting (max 60 seconds) for system thread `bufspacedaemon-3' to stop... done XX Mar 29 21:35:55 iotaplex kernel: All buffers synced. ... the new boot finds the lost messages in the old message buffer and logs them. It also finds non-lost messages and the old klog pointer so it knows to not log the non-lost messages again. Everything is as correct as possible except for the timestamps (these are for when the new syslogd reads the messages, not for the events logged by printing the messages). XX Mar 29 21:35:55 iotaplex kernel: ---<>--- XX Mar 29 21:35:55 iotaplex kernel: Test of early printf to msgbuf No "Test of early printf to console" on amd64, since I only do this for i386. XX Mar 29 21:35:55 iotaplex kernel: GDB: debug ports: sio XX Mar 29 21:35:55 iotaplex kernel: GDB: current port: sio XX Mar 29 21:35:55 iotaplex kernel: KDB: debugger backends: ddb gdb XX Mar 29 21:35:55 iotaplex kernel: KDB: current backend: ddb These debugging messages are always before all SYSINIT()s so long before the COPYRIGHT one. XX Mar 29 21:35:55 iotaplex kernel: Copyright (c) 1992-2019 The FreeBSD Project. Continuing with the warm boot. The tag is correctly placed for delimiting messages printed by the new boot. Bruce From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA8AFDC08E; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yr14K2z4P0g; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 818EB19DFB; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 439E5CAF9; Fri, 29 Mar 2019 15:01:21 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6837B97A33; Fri, 29 Mar 2019 15:01:19 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 3822BCA82; Fri, 29 Mar 2019 15:01:19 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id DAC14CA80 for ; Fri, 29 Mar 2019 15:01:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f175.google.com (mail-it1-f175.google.com [209.85.166.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CA4797A24; Fri, 29 Mar 2019 15:01:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f175.google.com with SMTP id e24so4180314itl.1; Fri, 29 Mar 2019 08:01:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=mJorCLMUPOeR4NVCCfPqgDkNjXS4oIlNQs/DvHd+h8o=; b=NIuvSYpaXItoVZllx474p6RsBEQPKmxtY6JubjizmV2OpBJyNbpCDU8m8E5x6vU8fS 6UFyDmclMkFV2rcIBfIyY6a0dZC+QSakAbLX5kzp8FGs5hOBlcYyNASnmuWLfBzBSX6k /1PbbgS4SEfFQjAFINWAC/gR+yJCNPoAdlEz1BRk7cxM/QG5Tgm9p0m+y7fsZnGEt2T+ EZXTHW3D5fL57IcLbMJ3VdwRna2gFjKThTiG/+ImD++qoYFNi/4y7xNEHDWpzJjiIUyK +xojROmPiTWfzDLWDMAuTneRdxY5/wxWm6Z4rIag1ALY6jLHh8Sz6LdbR/B41rzGM0HW CsvA== X-Gm-Message-State: APjAAAX3bmag4/bDhc/SXMWtXLOPuLSJPYKrYkZzZ2h9XXyzzngGlLbn eGeMMdg45UCYD6jjNLRtQO/NtoKtKnhBb7/TpCrpNA== X-Google-Smtp-Source: APXvYqxievZ/5DTrlee0qNSOBgPYVZIa01GHH30RLSIldERXoD4FGZ7OWQv57xqEzWopPODEaCV11o6FnFxLc0Gruqo= X-Received: by 2002:a05:660c:12d2:: with SMTP id k18mr4666062itd.33.1553870257876; Fri, 29 Mar 2019 07:37:37 -0700 (PDT) MIME-Version: 1.0 References: <201903291435.x2TEZNrg053370@repo.freebsd.org> In-Reply-To: <201903291435.x2TEZNrg053370@repo.freebsd.org> From: Ed Maste Message-ID: Subject: Re: svn commit: r345693 - head/libexec/rtld-elf/arm To: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 6837B97A33 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:58 -0000 X-Original-Date: Fri, 29 Mar 2019 10:54:48 -0400 X-List-Received-Date: Tue, 03 Sep 2019 14:05:58 -0000 On Fri, 29 Mar 2019 at 10:35, Ed Maste wrote: > > Author: emaste > Date: Fri Mar 29 14:35:23 2019 > New Revision: 345693 > URL: https://svnweb.freebsd.org/changeset/base/345693 > > Log: > rtld: attempt to fix reloc_nonplt_object TLS allocation ... on arm From owner-svn-src-head@freebsd.org Tue Sep 3 14:05:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 449C7DC0AA; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yr6xfGz4P1X; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id D27A319E3E; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id DDB6410CE8; Fri, 29 Mar 2019 17:53:06 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39DFF70FDE; Fri, 29 Mar 2019 17:53:06 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 18B2110CE7; Fri, 29 Mar 2019 17:53:06 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 3B48D10CE3 for ; Fri, 29 Mar 2019 17:53:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 096AA70FDB; Fri, 29 Mar 2019 17:53:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D70DD2495; Fri, 29 Mar 2019 17:53:02 +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 x2THr2TR061361; Fri, 29 Mar 2019 17:53:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2THqvk4061330; Fri, 29 Mar 2019 17:52:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903291752.x2THqvk4061330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345703 - in head: lib/libc/aarch64 lib/libc/amd64 lib/libc/arm lib/libc/gen lib/libc/i386 lib/libc/include lib/libc/mips lib/libc/powerpc lib/libc/powerpc64 lib/libc/riscv lib/libc/spa... X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/aarch64 lib/libc/amd64 lib/libc/arm lib/libc/gen lib/libc/i386 lib/libc/include lib/libc/mips lib/libc/powerpc lib/libc/powerpc64 lib/libc/riscv lib/libc/sparc64 lib/libc/sys lib/lib... X-SVN-Commit-Revision: 345703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 39DFF70FDE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:05:59 -0000 X-Original-Date: Fri, 29 Mar 2019 17:52:57 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:05:59 -0000 Author: kib Date: Fri Mar 29 17:52:57 2019 New Revision: 345703 URL: https://svnweb.freebsd.org/changeset/base/345703 Log: Fix initial exec TLS mode for dynamically loaded shared objects. If dso uses initial exec TLS mode, rtld tries to allocate TLS in static space. If there is no space left, the dlopen(3) fails. If space if allocated, initial content from PT_TLS segment is distributed to all threads' pcbs, which was missed and caused un-initialized TLS segment for such dso after dlopen(3). The mode is auto-detected either due to the relocation used, or if the DF_STATIC_TLS dynamic flag is set. In the later case, the TLS segment is tried to allocate earlier, which increases chance of the dlopen(3) to succeed. LLD was recently fixed to properly emit the flag, ld.bdf did it always. Initial test by: dumbbell Tested by: emaste (amd64), ian (arm) Tested by: Gerald Aryeetey (arm64) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19072 Added: head/lib/libc/aarch64/static_tls.h (contents, props changed) head/lib/libc/amd64/static_tls.h (contents, props changed) head/lib/libc/arm/static_tls.h (contents, props changed) head/lib/libc/i386/static_tls.h (contents, props changed) head/lib/libc/mips/static_tls.h (contents, props changed) head/lib/libc/powerpc/static_tls.h (contents, props changed) head/lib/libc/powerpc64/static_tls.h (contents, props changed) head/lib/libc/riscv/static_tls.h (contents, props changed) head/lib/libc/sparc64/static_tls.h (contents, props changed) head/lib/libthr/arch/aarch64/include/pthread_tls.h (contents, props changed) head/lib/libthr/arch/amd64/include/pthread_tls.h (contents, props changed) head/lib/libthr/arch/arm/include/pthread_tls.h (contents, props changed) head/lib/libthr/arch/i386/include/pthread_tls.h (contents, props changed) head/lib/libthr/arch/mips/include/pthread_tls.h (contents, props changed) head/lib/libthr/arch/powerpc/include/pthread_tls.h (contents, props changed) head/lib/libthr/arch/riscv/include/pthread_tls.h (contents, props changed) head/lib/libthr/arch/sparc64/include/pthread_tls.h (contents, props changed) Modified: head/lib/libc/gen/Symbol.map head/lib/libc/gen/elf_utils.c head/lib/libc/include/libc_private.h head/lib/libc/sys/interposing_table.c head/lib/libthr/Makefile head/lib/libthr/pthread.map head/lib/libthr/thread/thr_list.c head/lib/libthr/thread/thr_private.h head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Added: head/lib/libc/aarch64/static_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/aarch64/static_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBC_AARCH64_STATIC_TLS_H +#define _LIBC_AARCH64_STATIC_TLS_H + +static __inline uintptr_t +_libc_get_static_tls_base(size_t offset) +{ + uintptr_t tlsbase; + + __asm __volatile("mrs %x0, tpidr_el0" : "=r" (tlsbase)); + tlsbase += offset; + return (tlsbase); +} + +#endif Added: head/lib/libc/amd64/static_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/amd64/static_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBC_AMD64_STATIC_TLS_H +#define _LIBC_AMD64_STATIC_TLS_H + +static __inline uintptr_t +_libc_get_static_tls_base(size_t offset) +{ + uintptr_t tlsbase; + + __asm __volatile("movq %%fs:0, %0" : "=r" (tlsbase)); + tlsbase -= offset; + return (tlsbase); +} + +#endif Added: head/lib/libc/arm/static_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/static_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,51 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBC_ARM_STATIC_TLS_H +#define _LIBC_ARM_STATIC_TLS_H + +static __inline uintptr_t +_libc_get_static_tls_base(size_t offset) +{ + uintptr_t tlsbase; + +#ifdef ARM_TP_ADDRESS + tlsbase = *(uintptr_t *)ARM_TP_ADDRESS; +#else + __asm __volatile("mrc p15, 0, %0, c13, c0, 3" : "=r" (tlsbase)); +#endif + + tlsbase += offset; + return (tlsbase); +} + +#endif Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Fri Mar 29 16:53:46 2019 (r345702) +++ head/lib/libc/gen/Symbol.map Fri Mar 29 17:52:57 2019 (r345703) @@ -542,6 +542,7 @@ FBSDprivate_1.0 { __libc_tcdrain; __elf_aux_vector; + __pthread_distribute_static_tls; __pthread_map_stacks_exec; __fillcontextx; __fillcontextx2; Modified: head/lib/libc/gen/elf_utils.c ============================================================================== --- head/lib/libc/gen/elf_utils.c Fri Mar 29 16:53:46 2019 (r345702) +++ head/lib/libc/gen/elf_utils.c Fri Mar 29 17:52:57 2019 (r345703) @@ -34,10 +34,13 @@ #include #include #include +#include #include "libc_private.h" +#include "static_tls.h" int __elf_phdr_match_addr(struct dl_phdr_info *, void *); void __pthread_map_stacks_exec(void); +void __pthread_distribute_static_tls(size_t, void *, size_t, size_t); int __elf_phdr_match_addr(struct dl_phdr_info *phdr_info, void *addr) @@ -96,4 +99,25 @@ __pthread_map_stacks_exec(void) { ((void (*)(void))__libc_interposing[INTERPOS_map_stacks_exec])(); +} + +void +__libc_distribute_static_tls(size_t offset, void *src, size_t len, + size_t total_len) +{ + uintptr_t tlsbase; + + tlsbase = _libc_get_static_tls_base(offset); + memcpy((void *)tlsbase, src, len); + memset((char *)tlsbase + len, 0, total_len - len); +} + +#pragma weak __pthread_distribute_static_tls +void +__pthread_distribute_static_tls(size_t offset, void *src, size_t len, + size_t total_len) +{ + + ((void (*)(size_t, void *, size_t, size_t))__libc_interposing[ + INTERPOS_distribute_static_tls])(offset, src, len, total_len); } Added: head/lib/libc/i386/static_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/i386/static_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBC_I386_STATIC_TLS_H +#define _LIBC_I386_STATIC_TLS_H + +static __inline uintptr_t +_libc_get_static_tls_base(size_t offset) +{ + uintptr_t tlsbase; + + __asm __volatile("movl %%gs:0, %0" : "=r" (tlsbase)); + tlsbase -= offset; + return (tlsbase); +} + +#endif Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Fri Mar 29 16:53:46 2019 (r345702) +++ head/lib/libc/include/libc_private.h Fri Mar 29 17:52:57 2019 (r345703) @@ -235,6 +235,7 @@ enum { INTERPOS_map_stacks_exec, INTERPOS_fdatasync, INTERPOS_clock_nanosleep, + INTERPOS_distribute_static_tls, INTERPOS_MAX }; @@ -413,6 +414,8 @@ struct dl_phdr_info; int __elf_phdr_match_addr(struct dl_phdr_info *, void *); void __init_elf_aux_vector(void); void __libc_map_stacks_exec(void); +void __libc_distribute_static_tls(__size_t, void *, __size_t, __size_t); +__uintptr_t __libc_static_tls_base(__size_t); void _pthread_cancel_enter(int); void _pthread_cancel_leave(int); Added: head/lib/libc/mips/static_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/mips/static_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,64 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBC_MIPS_STATIC_TLS_H +#define _LIBC_MIPS_STATIC_TLS_H + +#include + +static __inline uintptr_t +_libc_get_static_tls_base(size_t offset) +{ + uintptr_t tlsbase; + +#if defined(__mips_n64) + __asm__ __volatile__ ( + ".set\tpush\n\t" + ".set\tmips64r2\n\t" + "rdhwr\t%0, $29\n\t" + ".set\tpop" + : "=r" (tlsbase)); + tlsbase -= TLS_TP_OFFSET + TLS_TCB_SIZE; +#else /* mips 32 */ + __asm__ __volatile__ ( + ".set\tpush\n\t" + ".set\tmips32r2\n\t" + "rdhwr\t%0, $29\n\t" + ".set\tpop" + : "=r" (tlsbase)); + tlsbase -= TLS_TP_OFFSET + TLS_TCB_SIZE; +#endif /* ! __mips_n64 */ + tlsbase += offset; + return (tlsbase); +} + +#endif Added: head/lib/libc/powerpc/static_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc/static_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBC_POWERPC_STATIC_TLS_H +#define _LIBC_POWERPC_STATIC_TLS_H + +static __inline uintptr_t +_libc_get_static_tls_base(size_t offset) +{ + uintptr_t tlsbase; + + __asm __volatile("mr %0,2" : "=r"(tlsbase)); + tlsbase += offset - 0x7008; + return (tlsbase); +} + +#endif Added: head/lib/libc/powerpc64/static_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/static_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBC_POWERPC64_STATIC_TLS_H +#define _LIBC_POWERPC64_STATIC_TLS_H + +static __inline uintptr_t +_libc_get_static_tls_base(size_t offset) +{ + uintptr_t tlsbase; + + __asm __volatile("mr %0,13" : "=r"(tlsbase)); + tlsbase += offset - 0x7010; + return (tlsbase); +} + +#endif Added: head/lib/libc/riscv/static_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/riscv/static_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBC_RISCV_STATIC_TLS_H +#define _LIBC_RISCV_STATIC_TLS_H + +static __inline uintptr_t +_libc_get_static_tls_base(size_t offset) +{ + uintptr_t tlsbase; + + __asm __volatile("mv %0, tp" : "=r"(tlsbase)); + tlsbase += offset; + return (tlsbase); +} + +#endif Added: head/lib/libc/sparc64/static_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sparc64/static_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,44 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBC_SPARC64_STATIC_TLS_H +#define _LIBC_SPARC64_STATIC_TLS_H + +static __inline uintptr_t +_libc_get_static_tls_base(size_t offset) +{ + register uintptr_t tlsbase __asm("%g7"); + + return (tlsbase + offset); +} + +#endif Modified: head/lib/libc/sys/interposing_table.c ============================================================================== --- head/lib/libc/sys/interposing_table.c Fri Mar 29 16:53:46 2019 (r345702) +++ head/lib/libc/sys/interposing_table.c Fri Mar 29 17:52:57 2019 (r345703) @@ -81,6 +81,7 @@ interpos_func_t __libc_interposing[INTERPOS_MAX] = { SLOT(map_stacks_exec, __libc_map_stacks_exec), SLOT(fdatasync, __sys_fdatasync), SLOT(clock_nanosleep, __sys_clock_nanosleep), + SLOT(distribute_static_tls, __libc_distribute_static_tls), }; #undef SLOT Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Fri Mar 29 16:53:46 2019 (r345702) +++ head/lib/libthr/Makefile Fri Mar 29 17:52:57 2019 (r345703) @@ -16,8 +16,10 @@ SHLIB_MAJOR= 3 NO_WTHREAD_SAFETY=1 NO_WCAST_ALIGN.gcc=1 # for gcc 4.2 CFLAGS+=-DPTHREAD_KERNEL -CFLAGS+=-I${SRCTOP}/lib/libc/include -I${.CURDIR}/thread \ - -I${SRCTOP}/include +CFLAGS+=-I${SRCTOP}/lib/libc/include +CFLAGS+=-I${SRCTOP}/lib/libc/${MACHINE_CPUARCH} +CFLAGS+=-I${.CURDIR}/thread +CFLAGS+=-I${SRCTOP}/include CFLAGS+=-I${.CURDIR}/arch/${MACHINE_CPUARCH}/include CFLAGS+=-I${.CURDIR}/sys CFLAGS+=-I${SRCTOP}/libexec/rtld-elf Added: head/lib/libthr/arch/aarch64/include/pthread_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/arch/aarch64/include/pthread_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ARCH_AARCH64_PTHREAD_TLS_H +#define _ARCH_AARCH64_PTHREAD_TLS_H + +static __inline uintptr_t +_get_static_tls_base(struct pthread *thr, size_t offset) +{ + uintptr_t tlsbase; + + tlsbase = (uintptr_t)thr->tcb; + tlsbase += offset; + return (tlsbase); +} + +#endif Added: head/lib/libthr/arch/amd64/include/pthread_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/arch/amd64/include/pthread_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ARCH_AMD64_PTHREAD_TLS_H +#define _ARCH_AMD64_PTHREAD_TLS_H + +static __inline uintptr_t +_get_static_tls_base(struct pthread *thr, size_t offset) +{ + uintptr_t tlsbase; + + tlsbase = (uintptr_t)thr->tcb; + tlsbase -= offset; + return (tlsbase); +} + +#endif Added: head/lib/libthr/arch/arm/include/pthread_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/arch/arm/include/pthread_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ARCH_ARM_PTHREAD_TLS_H +#define _ARCH_ARM_PTHREAD_TLS_H + +static __inline uintptr_t +_get_static_tls_base(struct pthread *thr, size_t offset) +{ + uintptr_t tlsbase; + + tlsbase = (uintptr_t)thr->tcb; + tlsbase += offset; + return (tlsbase); +} + +#endif Added: head/lib/libthr/arch/i386/include/pthread_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/arch/i386/include/pthread_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ARCH_I386_PTHREAD_TLS_H +#define _ARCH_I386_PTHREAD_TLS_H + +static __inline uintptr_t +_get_static_tls_base(struct pthread *thr, size_t offset) +{ + uintptr_t tlsbase; + + tlsbase = (uintptr_t)thr->tcb; + tlsbase -= offset; + return (tlsbase); +} + +#endif Added: head/lib/libthr/arch/mips/include/pthread_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/arch/mips/include/pthread_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ARCH_MIPS_PTHREAD_TLS_H +#define _ARCH_MIPS_PTHREAD_TLS_H + +static __inline uintptr_t +_get_static_tls_base(struct pthread *thr, size_t offset) +{ + uintptr_t tlsbase; + + tlsbase = (uintptr_t)thr->tcb; + tlsbase += offset; + return (tlsbase); +} + +#endif Added: head/lib/libthr/arch/powerpc/include/pthread_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/arch/powerpc/include/pthread_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ARCH_POWERPC_PTHREAD_TLS_H +#define _ARCH_POWERPC_PTHREAD_TLS_H + +static __inline uintptr_t +_get_static_tls_base(struct pthread *thr, size_t offset) +{ + uintptr_t tlsbase; + + tlsbase = (uintptr_t)thr->tcb; + tlsbase += offset; + return (tlsbase); +} + +#endif Added: head/lib/libthr/arch/riscv/include/pthread_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/arch/riscv/include/pthread_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ARCH_RISCV_PTHREAD_TLS_H +#define _ARCH_RISCV_PTHREAD_TLS_H + +static __inline uintptr_t +_get_static_tls_base(struct pthread *thr, size_t offset) +{ + uintptr_t tlsbase; + + tlsbase = (uintptr_t)thr->tcb; + tlsbase += offset; + return (tlsbase); +} + +#endif Added: head/lib/libthr/arch/sparc64/include/pthread_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/arch/sparc64/include/pthread_tls.h Fri Mar 29 17:52:57 2019 (r345703) @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ARCH_SPARC64_PTHREAD_TLS_H +#define _ARCH_SPARC64_PTHREAD_TLS_H + +static __inline uintptr_t +_get_static_tls_base(struct pthread *thr, size_t offset) +{ + uintptr_t tlsbase; + + tlsbase = (uintptr_t)thr->tcb; + tlsbase -= offset; + return (tlsbase); +} + +#endif Modified: head/lib/libthr/pthread.map ============================================================================== --- head/lib/libthr/pthread.map Fri Mar 29 16:53:46 2019 (r345702) +++ head/lib/libthr/pthread.map Fri Mar 29 17:52:57 2019 (r345703) @@ -137,6 +137,7 @@ FBSDprivate_1.0 { __pthread_mutex_lock; __pthread_mutex_timedlock; __pthread_mutex_trylock; + __pthread_distribute_static_tls; _pthread_atfork; _pthread_barrier_destroy; _pthread_barrier_init; Modified: head/lib/libthr/thread/thr_list.c ============================================================================== --- head/lib/libthr/thread/thr_list.c Fri Mar 29 16:53:46 2019 (r345702) +++ head/lib/libthr/thread/thr_list.c Fri Mar 29 17:52:57 2019 (r345703) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "thr_private.h" +#include "static_tls.h" /*#define DEBUG_THREAD_LIST */ #ifdef DEBUG_THREAD_LIST @@ -361,4 +362,36 @@ _thr_find_thread(struct pthread *curthread, struct pth } THREAD_LIST_UNLOCK(curthread); return (ret); +} + +#include "pthread_tls.h" + +static void +thr_distribute_static_tls(uintptr_t tlsbase, void *src, size_t len, + size_t total_len) +{ + + memcpy((void *)tlsbase, src, len); + memset((char *)tlsbase + len, 0, total_len - len); +} + +void +__pthread_distribute_static_tls(size_t offset, void *src, size_t len, + size_t total_len) +{ + struct pthread *curthread, *thrd; + uintptr_t tlsbase; + + if (!_thr_is_inited()) { + tlsbase = _libc_get_static_tls_base(offset); + thr_distribute_static_tls(tlsbase, src, len, total_len); + return; + } + curthread = _get_curthread(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11063DC15F; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv0t8Kz4P46; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 5281E19F16; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 4F70B14D9D; Sun, 31 Mar 2019 04:57:55 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D4198FF5B; Sun, 31 Mar 2019 04:57:55 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0C6FE14D9C; Sun, 31 Mar 2019 04:57:55 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id ED6F814D97 for ; Sun, 31 Mar 2019 04:57:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A001C8FF58; Sun, 31 Mar 2019 04:57:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 774D721DB9; Sun, 31 Mar 2019 04:57:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2V4vpdn091158; Sun, 31 Mar 2019 04:57:51 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2V4vp1R091156; Sun, 31 Mar 2019 04:57:51 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201903310457.x2V4vp1R091156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345744 - in head/libexec: rc/rc.d save-entropy X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/libexec: rc/rc.d save-entropy X-SVN-Commit-Revision: 345744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 1D4198FF5B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.90 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.90)[-0.899,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:04 -0000 X-Original-Date: Sun, 31 Mar 2019 04:57:51 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:04 -0000 Author: cem Date: Sun Mar 31 04:57:50 2019 New Revision: 345744 URL: https://svnweb.freebsd.org/changeset/base/345744 Log: random(4): Attempt to persist entropy promptly The goal of saving entropy in Fortuna is two-fold: (1) to provide early availability of the random device (unblocking) on next boot; and (2), to have known, high-quality entropy available for that initial seed. We know it is high quality because it's output taken from Fortuna. The FS&K paper makes it clear that Fortuna unblocks when enough bits have been input that the output //may// be safely seeded. But they emphasize that the quality of various entropy sources is unknown, and a saved entropy file is essential for both availability and ensuring initial unpredictability. In FreeBSD we persist entropy using two mechanisms: 1. The /etc/rc.d/random shutdown() function, which is used for ordinary shutdowns and reboots; and, 2. A cron job that runs every dozen minutes or so to persist new entropy, in case the system suffers from power loss or a crash (bypassing the ordinary shutdown path). Filesystems are free to cache dirty data indefinitely, with arbitrary flush policy. Fsync must be used to ensure the data is persisted, especially for the cron job save-entropy, whose entire goal is power loss and crash safe entropy persistence. Ordinary shutdown may not need the fsync because unmount should flush out the dirty entropy file shortly afterwards. But it is always possible power loss or crash occurs during the short window after rc.d/random shutdown runs and before the filesystem is unmounted, so the additional fsync there seems harmless. PR: 230876 Reviewed by: delphij, markj, markm Approved by: secteam (delphij) Differential Revision: https://reviews.freebsd.org/D19742 Modified: head/libexec/rc/rc.d/random head/libexec/save-entropy/save-entropy.sh Modified: head/libexec/rc/rc.d/random ============================================================================== --- head/libexec/rc/rc.d/random Sun Mar 31 04:24:51 2019 (r345743) +++ head/libexec/rc/rc.d/random Sun Mar 31 04:57:50 2019 (r345744) @@ -25,7 +25,8 @@ save_dev_random() for f ; do debug "saving entropy to $f" dd if=/dev/random of="$f" bs=4096 count=1 status=none && - chmod 600 "$f" + chmod 600 "$f" && + fsync "$f" "$(dirname "$f")" done umask ${oumask} } @@ -120,6 +121,9 @@ random_stop() dd if=/dev/random of=${entropy_file_confirmed} \ bs=4096 count=1 2> /dev/null || warn 'write failed (unwriteable file or full fs?)' + fsync "${entropy_file_confirmed}" \ + "$(dirname "${entropy_file_confirmed}")" \ + 2> /dev/null echo '.' ;; esac @@ -145,6 +149,9 @@ random_stop() dd if=/dev/random of=${entropy_boot_file_confirmed} \ bs=4096 count=1 2> /dev/null || warn 'write failed (unwriteable file or full fs?)' + fsync "${entropy_boot_file_confirmed}" \ + "$(dirname "${entropy_boot_file_confirmed}")" \ + 2> /dev/null echo '.' ;; esac Modified: head/libexec/save-entropy/save-entropy.sh ============================================================================== --- head/libexec/save-entropy/save-entropy.sh Sun Mar 31 04:24:51 2019 (r345743) +++ head/libexec/save-entropy/save-entropy.sh Sun Mar 31 04:57:50 2019 (r345744) @@ -90,5 +90,6 @@ while [ ${n} -ge 1 ]; do done dd if=/dev/random of=saved-entropy.1 bs=${entropy_save_sz} count=1 2>/dev/null +fsync saved-entropy.1 "." exit 0 From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CAD94DC0C8; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ys3Gjgz4P1w; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id F2C0619E50; Tue, 3 Sep 2019 14:05:51 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 8383A11D02; Fri, 29 Mar 2019 18:31:57 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB47173014; Fri, 29 Mar 2019 18:31:55 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0B3A111C34; Fri, 29 Mar 2019 18:31:55 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 6C5BD11C2D for ; Fri, 29 Mar 2019 18:31:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D18673000; Fri, 29 Mar 2019 18:31:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9DD92B47; Fri, 29 Mar 2019 18:31:51 +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 x2TIVp2t082249; Fri, 29 Mar 2019 18:31:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TIVnEv082235; Fri, 29 Mar 2019 18:31:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201903291831.x2TIVnEv082235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345706 - in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libc/tests/stdlib lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk us... X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libc/tests/stdlib lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk usr.bin/dtc usr.sbin/pmc X-SVN-Commit-Revision: 345706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: AB47173014 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:00 -0000 X-Original-Date: Fri, 29 Mar 2019 18:31:49 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:00 -0000 Author: ngie Date: Fri Mar 29 18:31:48 2019 New Revision: 345706 URL: https://svnweb.freebsd.org/changeset/base/345706 Log: Standardize `-std=c++* as `CXXSTD` CXXSTD was added as the C++ analogue to CSTD. CXXSTD defaults to `-std=c++11` with supporting compilers; `-std=gnu++98`, otherwise for older versions of g++. This change standardizes the CXXSTD variable, originally added to googletest.test.inc.mk as part of r345203. As part of this effort, convert all `CXXFLAGS+= -std=*` calls to use `CXXSTD`. Notes: This value is not sanity checked in bsd.sys.mk, however, given the two most used C++ compilers on FreeBSD (clang++ and g++) support both modes, it is likely to work with both toolchains. This method will be refined in the future to support more variants of C++, as not all versions of clang++ and g++ (for instance) support C++14, C++17, etc. Any manual appending of `-std=*` to `CXXFLAGS` should be replaced with CXXSTD. Example: Before this commit: ``` CXXFLAGS+= -std=c++14 ``` After this commit: ``` CXXSTD= c++14 ``` Reviewed by: asomers Approved by: emaste (mentor) MFC after: 1 month MFC with: r345203, r345704, r345705 Relnotes: yes Tested with: make tinderbox Differential Revision: https://reviews.freebsd.org/D19732 Modified: head/lib/clang/llvm.build.mk head/lib/libc++/Makefile head/lib/libc++experimental/Makefile head/lib/libc++fs/Makefile head/lib/libc/tests/stdlib/Makefile head/lib/libclang_rt/Makefile.inc head/lib/libcxxrt/Makefile head/lib/libgcc_eh/Makefile.inc head/lib/libomp/Makefile head/lib/ofed/libibnetdisc/Makefile head/share/mk/bsd.progs.mk head/share/mk/bsd.sys.mk head/share/mk/googletest.test.inc.mk head/usr.bin/dtc/Makefile head/usr.sbin/pmc/Makefile Modified: head/lib/clang/llvm.build.mk ============================================================================== --- head/lib/clang/llvm.build.mk Fri Mar 29 18:16:33 2019 (r345705) +++ head/lib/clang/llvm.build.mk Fri Mar 29 18:31:48 2019 (r345706) @@ -95,7 +95,7 @@ CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections LDFLAGS+= -Wl,--gc-sections -CXXFLAGS+= -std=c++11 +CXXSTD?= c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti CXXFLAGS.clang+= -stdlib=libc++ Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Fri Mar 29 18:16:33 2019 (r345705) +++ head/lib/libc++/Makefile Fri Mar 29 18:31:48 2019 (r345706) @@ -76,9 +76,7 @@ CFLAGS+= -nostdinc++ CFLAGS+= -nostdlib CFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif +CXXSTD= c++11 LIBADD+= cxxrt INCSGROUPS= STD EXP EXT Modified: head/lib/libc++experimental/Makefile ============================================================================== --- head/lib/libc++experimental/Makefile Fri Mar 29 18:16:33 2019 (r345705) +++ head/lib/libc++experimental/Makefile Fri Mar 29 18:31:48 2019 (r345706) @@ -20,8 +20,6 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++14 -.endif +CXXSTD= c++14 .include Modified: head/lib/libc++fs/Makefile ============================================================================== --- head/lib/libc++fs/Makefile Fri Mar 29 18:16:33 2019 (r345705) +++ head/lib/libc++fs/Makefile Fri Mar 29 18:31:48 2019 (r345706) @@ -22,8 +22,6 @@ CXXFLAGS+= -nostdinc++ CXXFLAGS+= -nostdlib CXXFLAGS+= -D_LIBCPP_BUILDING_LIBRARY CXXFLAGS+= -DLIBCXXRT -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++14 -.endif +CXXSTD= c++14 .include Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Fri Mar 29 18:16:33 2019 (r345705) +++ head/lib/libc/tests/stdlib/Makefile Fri Mar 29 18:31:48 2019 (r345706) @@ -50,8 +50,8 @@ PROGS+= h_getopt h_getopt_long CFLAGS+= -I${.CURDIR} -CXXFLAGS.cxa_thread_atexit_test+= -std=c++11 -CXXFLAGS.cxa_thread_atexit_nothr_test+= -std=c++11 +CXXSTD.cxa_thread_atexit_test= c++11 +CXXSTD.cxa_thread_atexit_nothr_test= c++11 LIBADD.cxa_thread_atexit_test+= pthread .for t in h_getopt h_getopt_long Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Fri Mar 29 18:16:33 2019 (r345705) +++ head/lib/libclang_rt/Makefile.inc Fri Mar 29 18:31:48 2019 (r345706) @@ -41,4 +41,4 @@ CFLAGS+= -funwind-tables CXXFLAGS+= -fvisibility-inlines-hidden CXXFLAGS+= -fvisibility=hidden CFLAGS+= -I${CRTSRC}/lib -CXXFLAGS+= -std=c++11 +CXXSTD= c++11 Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Fri Mar 29 18:16:33 2019 (r345705) +++ head/lib/libcxxrt/Makefile Fri Mar 29 18:31:48 2019 (r345706) @@ -22,9 +22,7 @@ SRCS+= libelftc_dem_gnu3.c\ WARNS= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif +CXXSTD= c++11 VERSION_MAP= ${.CURDIR}/Version.map .include Modified: head/lib/libgcc_eh/Makefile.inc ============================================================================== --- head/lib/libgcc_eh/Makefile.inc Fri Mar 29 18:16:33 2019 (r345705) +++ head/lib/libgcc_eh/Makefile.inc Fri Mar 29 18:31:48 2019 (r345706) @@ -27,10 +27,8 @@ CXXFLAGS.${file}+= -fno-exceptions -funwind-tables .endfor CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY -.if empty(CXXFLAGS:M-std=*) -CXXFLAGS+= -std=c++11 -.endif CXXFLAGS+= -fno-rtti +CXXSTD= c++11 STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC # Probably need to just move this earlier or use CXXFLAGS .if ${MK_DIRDEPS_BUILD} == "yes" Modified: head/lib/libomp/Makefile ============================================================================== --- head/lib/libomp/Makefile Fri Mar 29 18:16:33 2019 (r345705) +++ head/lib/libomp/Makefile Fri Mar 29 18:31:48 2019 (r345706) @@ -53,9 +53,9 @@ CFLAGS+= -I${ITTSRC} CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections CXXFLAGS+= -fvisibility-inlines-hidden -CXXFLAGS+= -std=c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti +CXXSTD= c++11 LDFLAGS+= -Wl,--warn-shared-textrel LDFLAGS+= -Wl,--gc-sections Modified: head/lib/ofed/libibnetdisc/Makefile ============================================================================== --- head/lib/ofed/libibnetdisc/Makefile Fri Mar 29 18:16:33 2019 (r345705) +++ head/lib/ofed/libibnetdisc/Makefile Fri Mar 29 18:31:48 2019 (r345706) @@ -31,9 +31,6 @@ LIBADD= osmcomp ibmad ibumad CFLAGS+= -DHAVE_CONFIG_H=1 CFLAGS+= -I${_spath} CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband -.if ${COMPILER_FEATURES:Mc++11} -CXXFLAGS+= -std=c++11 -.endif VERSION_MAP= ${_spath}/libibnetdisc.map .include Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Fri Mar 29 18:16:33 2019 (r345705) +++ head/share/mk/bsd.progs.mk Fri Mar 29 18:31:48 2019 (r345706) @@ -22,8 +22,8 @@ PROGS += ${PROGS_CXX} .if defined(PROG) # just one of many -PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ - PROGNAME SRCS STRIP WARNS +PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE CSTD CXXSTD DPSRCS MAN \ + NO_WERROR PROGNAME SRCS STRIP WARNS PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD INTERNALPROG LDADD LIBADD \ LINKS LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Mar 29 18:16:33 2019 (r345705) +++ head/share/mk/bsd.sys.mk Fri Mar 29 18:31:48 2019 (r345706) @@ -24,6 +24,19 @@ CFLAGS+= -std=iso9899:1999 .else # CSTD CFLAGS+= -std=${CSTD} .endif # CSTD + +.if ${COMPILER_FEATURES:Mc++11} +CXXSTD?= c++11 +.elif ${COMPILER_TYPE} == "gcc" +# Prior versions of g++ support C++98 with GNU extensions by default. +CXXSTD?= gnu++98 +.else +# Assume that the compiler supports at least C++98. +CXXSTD?= c++98 +.endif +CXXFLAGS+= -std=${CXXSTD} +# CXXSTD + # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS+= -pedantic .if defined(WARNS) Modified: head/share/mk/googletest.test.inc.mk ============================================================================== --- head/share/mk/googletest.test.inc.mk Fri Mar 29 18:16:33 2019 (r345705) +++ head/share/mk/googletest.test.inc.mk Fri Mar 29 18:31:48 2019 (r345706) @@ -1,13 +1,9 @@ # $FreeBSD$ -# XXX: this should be defined in bsd.sys.mk -CXXSTD?= c++11 - GTESTS_CXXFLAGS+= -DGTEST_HAS_POSIX_RE=1 GTESTS_CXXFLAGS+= -DGTEST_HAS_PTHREAD=1 GTESTS_CXXFLAGS+= -DGTEST_HAS_STREAM_REDIRECTION=1 GTESTS_CXXFLAGS+= -frtti -GTESTS_CXXFLAGS+= -std=${CXXSTD} # XXX: src.libnames.mk should handle adding this directory for libgtest's, # libgmock's, etc, headers. Modified: head/usr.bin/dtc/Makefile ============================================================================== --- head/usr.bin/dtc/Makefile Fri Mar 29 18:16:33 2019 (r345705) +++ head/usr.bin/dtc/Makefile Fri Mar 29 18:31:48 2019 (r345706) @@ -6,7 +6,7 @@ MAN= dtc.1 WARNS?= 3 -CXXFLAGS+= -std=c++11 -fno-rtti -fno-exceptions +CXXFLAGS+= -fno-rtti -fno-exceptions NO_SHARED?=NO Modified: head/usr.sbin/pmc/Makefile ============================================================================== --- head/usr.sbin/pmc/Makefile Fri Mar 29 18:16:33 2019 (r345705) +++ head/usr.sbin/pmc/Makefile Fri Mar 29 18:31:48 2019 (r345706) @@ -6,7 +6,8 @@ PROG_CXX= pmc MAN= WARNS?= 3 -CXXFLAGS+= -O0 -std=c++14 +CXXFLAGS+= -O0 +CXXSTD= c++14 CWARNFLAGS.gcc+= -Wno-redundant-decls LIBADD= kvm pmc m ncursesw pmcstat elf From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF729DC0CD; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7ys3f2qz4P24; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 2E9AC19E6E; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 4165C138AB; Fri, 29 Mar 2019 19:40:06 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4A93767F3; Fri, 29 Mar 2019 19:40:05 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id D2CB7138AA; Fri, 29 Mar 2019 19:40:05 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id BFAB0138A8 for ; Fri, 29 Mar 2019 19:40:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92EFC767F2; Fri, 29 Mar 2019 19:40:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6750437A0; Fri, 29 Mar 2019 19:40:05 +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 x2TJe5Oi016069; Fri, 29 Mar 2019 19:40:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2TJe5PE016068; Fri, 29 Mar 2019 19:40:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201903291940.x2TJe5PE016068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345711 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 345711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: E4A93767F3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:01 -0000 X-Original-Date: Fri, 29 Mar 2019 19:40:05 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:01 -0000 Author: manu Date: Fri Mar 29 19:40:04 2019 New Revision: 345711 URL: https://svnweb.freebsd.org/changeset/base/345711 Log: arm: allwinner: clk: Fix nm_recalc When comparing best frequencies use the absolute value. If we do not do that we end up choosing an always lower value than the best one if the exact freq cannot be met. MFC after: 2 weeks Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_nm.c Fri Mar 29 18:51:14 2019 (r345710) +++ head/sys/arm/allwinner/clkng/aw_clk_nm.c Fri Mar 29 19:40:04 2019 (r345711) @@ -155,7 +155,7 @@ aw_clk_nm_find_best(struct aw_clk_nm_sc *sc, uint64_t for (m = min_m; m <= max_m; ) { for (n = min_m; n <= max_n; ) { cur = fparent / n / m; - if ((*fout - cur) < (*fout - best)) { + if (abs(*fout - cur) < abs(*fout - best)) { best = cur; *factor_n = n; *factor_m = m; From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9422DDC1FF; Tue, 3 Sep 2019 14:06:01 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yx14Kwz4P5v; Tue, 3 Sep 2019 14:06:01 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 7CE4019FAA; Tue, 3 Sep 2019 14:05:54 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5329D111F9; Mon, 1 Apr 2019 18:07:53 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 212AF8275D; Mon, 1 Apr 2019 18:07:53 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1183F111F8; Mon, 1 Apr 2019 18:07:53 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5DC32111F3 for ; Mon, 1 Apr 2019 18:07:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28E3182758; Mon, 1 Apr 2019 18:07:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E95631A0DA; Mon, 1 Apr 2019 18:07:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x31I7nf9062724; Mon, 1 Apr 2019 18:07:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x31I7mKF062717; Mon, 1 Apr 2019 18:07:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904011807.x31I7mKF062717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345770 - in head: contrib/googletest/googletest contrib/googletest/googletest/docs contrib/googletest/googletest/src contrib/googletest/googletest/test lib/googletest/gtest_main/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: contrib/googletest/googletest contrib/googletest/googletest/docs contrib/googletest/googletest/src contrib/googletest/googletest/test lib/googletest/gtest_main/tests X-SVN-Commit-Revision: 345770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 212AF8275D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:07 -0000 X-Original-Date: Mon, 1 Apr 2019 18:07:48 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:07 -0000 Author: ngie Date: Mon Apr 1 18:07:48 2019 New Revision: 345770 URL: https://svnweb.freebsd.org/changeset/base/345770 Log: Import proof-of-concept for handling `GTEST_SKIP()` in `Environment::SetUp` Per the upstream pull-request [1]: ``` gtest prior to this change would completely ignore `GTEST_SKIP()` if called in `Environment::SetUp()`, instead of bailing out early, unlike `Test::SetUp()`, which would cause the tests themselves to be skipped. The only way (prior to this change) to skip the tests would be to trigger a fatal error via `GTEST_FAIL()`. Desirable behavior, in this case, when dealing with `Environment::SetUp()` is to check for prerequisites on a system (example, kernel supports a particular featureset, e.g., capsicum), and skip the tests. The alternatives prior to this change would be undesirable: - Failing sends the wrong message to the test user, as the result of the tests is indeterminate, not failed. - Having to add per-test class abstractions that override `SetUp()` to test for the capsicum feature set, then skip all of the tests in their respective SetUp fixtures, would be a lot of human and computational work; checking for the feature would need to be done for all of the tests, instead of once for all of the tests. For those reasons, making `Environment::SetUp()` handle `GTEST_SKIP()`, by not executing the testcases, is the most desirable solution. In order to properly diagnose what happened when running the tests if they are skipped, print out the diagnostics in an ad hoc manner. Update the documentation to note this change and integrate a new test, gtest_skip_in_environment_setup_test, into the test suite. This change addresses #2189. Signed-off-by: Enji Cooper ``` The goal with my merging in this change is to avoid requiring extensive refactoring/retesting of test suites when ensuring prerequisites are met, e.g., checking for a CAPABILITIES-enabled kernel before running capsicum-test (see D19758 for more details). The proof-of-concept is being imported before accepted by the upstream project due to the fact that the upstream project is undergoing a potential development freeze and the maintainers aren't responding to my PR. 1. https://github.com/google/googletest/pull/2203 Reported by: asomers (https://github.com/google/googletest/issues/2189) Reviewed by: asomers Approved by: emaste (mentor) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D19765 Added: head/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc (contents, props changed) Modified: head/contrib/googletest/googletest/CMakeLists.txt head/contrib/googletest/googletest/Makefile.am head/contrib/googletest/googletest/docs/advanced.md head/contrib/googletest/googletest/src/gtest.cc head/contrib/googletest/googletest/test/BUILD.bazel head/lib/googletest/gtest_main/tests/Makefile Modified: head/contrib/googletest/googletest/CMakeLists.txt ============================================================================== --- head/contrib/googletest/googletest/CMakeLists.txt Mon Apr 1 17:44:20 2019 (r345769) +++ head/contrib/googletest/googletest/CMakeLists.txt Mon Apr 1 18:07:48 2019 (r345770) @@ -217,6 +217,7 @@ if (gtest_build_tests) test/gtest-typed-test2_test.cc) cxx_test(gtest_unittest gtest_main) cxx_test(gtest-unittest-api_test gtest) + cxx_test(gtest_skip_in_environment_setup_test gtest_main) cxx_test(gtest_skip_test gtest_main) ############################################################ Modified: head/contrib/googletest/googletest/Makefile.am ============================================================================== --- head/contrib/googletest/googletest/Makefile.am Mon Apr 1 17:44:20 2019 (r345769) +++ head/contrib/googletest/googletest/Makefile.am Mon Apr 1 18:07:48 2019 (r345770) @@ -290,6 +290,12 @@ test_gtest_all_test_SOURCES = test/gtest_all_test.cc test_gtest_all_test_LDADD = lib/libgtest_main.la \ lib/libgtest.la +TESTS += test/gtest_skip_in_environment_setup_test +check_PROGRAMS += test/gtest_skip_in_environment_setup_test +test_gtest_skip_in_environment_setup_test_SOURCES = test/gtest_skip_in_environment_setup_test.cc +test_gtest_skip_in_environment_setup_test_LDADD= lib/libgtest_main.la \ + lib/libgtest.la + # Tests that fused gtest files compile and work. FUSED_GTEST_SRC = \ fused-src/gtest/gtest-all.cc \ Modified: head/contrib/googletest/googletest/docs/advanced.md ============================================================================== --- head/contrib/googletest/googletest/docs/advanced.md Mon Apr 1 17:44:20 2019 (r345769) +++ head/contrib/googletest/googletest/docs/advanced.md Mon Apr 1 18:07:48 2019 (r345770) @@ -1289,8 +1289,10 @@ Environment* AddGlobalTestEnvironment(Environment* env ``` Now, when `RUN_ALL_TESTS()` is called, it first calls the `SetUp()` method of -the environment object, then runs the tests if there was no fatal failures, and -finally calls `TearDown()` of the environment object. +each environment object, then runs the tests if none of the environments +reported fatal failures and `GTEST_SKIP()` was not called. `RUN_ALL_TESTS()` +always calls `TearDown()` with each environment object, regardless of whether +or not the tests were run. It's OK to register multiple environment objects. In this case, their `SetUp()` will be called in the order they are registered, and their `TearDown()` will be Modified: head/contrib/googletest/googletest/src/gtest.cc ============================================================================== --- head/contrib/googletest/googletest/src/gtest.cc Mon Apr 1 17:44:20 2019 (r345769) +++ head/contrib/googletest/googletest/src/gtest.cc Mon Apr 1 18:07:48 2019 (r345770) @@ -5243,9 +5243,23 @@ bool UnitTestImpl::RunAllTests() { ForEach(environments_, SetUpEnvironment); repeater->OnEnvironmentsSetUpEnd(*parent_); - // Runs the tests only if there was no fatal failure during global - // set-up. - if (!Test::HasFatalFailure()) { + // Runs the tests only if there was no fatal failure or skip triggered + // during global set-up. + if (Test::IsSkipped()) { + // Emit diagnostics when global set-up calls skip, as it will not be + // emitted by default. + TestResult& test_result = + *internal::GetUnitTestImpl()->current_test_result(); + for (int j = 0; j < test_result.total_part_count(); ++j) { + const TestPartResult& test_part_result = + test_result.GetTestPartResult(j); + if (test_part_result.type() == TestPartResult::kSkip) { + const std::string& result = test_part_result.message(); + printf("%s\n", result.c_str()); + } + } + fflush(stdout); + } else if (!Test::HasFatalFailure()) { for (int test_index = 0; test_index < total_test_case_count(); test_index++) { GetMutableTestCase(test_index)->Run(); Modified: head/contrib/googletest/googletest/test/BUILD.bazel ============================================================================== --- head/contrib/googletest/googletest/test/BUILD.bazel Mon Apr 1 17:44:20 2019 (r345769) +++ head/contrib/googletest/googletest/test/BUILD.bazel Mon Apr 1 18:07:48 2019 (r345770) @@ -311,6 +311,13 @@ cc_binary( deps = ["//:gtest"], ) +cc_test( + name = "gtest_skip_in_environment_setup_test", + size = "small", + srcs = ["gtest_skip_in_environment_setup_test.cc"], + deps = ["//:gtest_main"], +) + py_test( name = "googletest-list-tests-unittest", size = "small", Added: head/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc Mon Apr 1 18:07:48 2019 (r345770) @@ -0,0 +1,60 @@ +// Copyright 2019, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * 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. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT +// OWNER 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. +// +// This test verifies that skipping in the environment results in the +// testcases being skipped. +// +// This is a reproduction case for +// https://github.com/google/googletest/issues/2189 . + +#include +#include + +class SetupEnvironment : public testing::Environment { +public: + void SetUp() override { + GTEST_SKIP() << "Skipping the entire environment"; + } +}; + +TEST(Test, AlwaysPasses) { + EXPECT_EQ(true, true); +} + +TEST(Test, AlwaysFails) { + EXPECT_EQ(true, false); +} + +int main(int argc, char **argv) { + testing::InitGoogleTest(&argc, argv); + + testing::AddGlobalTestEnvironment(new SetupEnvironment()); + + return (RUN_ALL_TESTS()); +} Modified: head/lib/googletest/gtest_main/tests/Makefile ============================================================================== --- head/lib/googletest/gtest_main/tests/Makefile Mon Apr 1 17:44:20 2019 (r345769) +++ head/lib/googletest/gtest_main/tests/Makefile Mon Apr 1 18:07:48 2019 (r345770) @@ -19,6 +19,7 @@ GTESTS+= gtest_sole_header_test GTESTS+= googletest-test-part-test GTESTS+= gtest-typed-test_test GTESTS+= gtest_skip_test +GTESTS+= gtest_skip_in_environment_setup_test GTESTS+= gtest_unittest CXXFLAGS+= -I${GOOGLETEST_SRCROOT}/include From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 845F5DC196; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv66tqz4P52; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id AD23419F50; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 894ED1BD44; Sun, 31 Mar 2019 14:18:07 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37EC383C07; Sun, 31 Mar 2019 14:18:07 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1AD611BD42; Sun, 31 Mar 2019 14:18:07 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C7BB91BD40 for ; Sun, 31 Mar 2019 14:18:03 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AB9183C04; Sun, 31 Mar 2019 14:18:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55C6127E08; Sun, 31 Mar 2019 14:18:03 +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 x2VEI36g087611; Sun, 31 Mar 2019 14:18:03 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2VEI3ma087610; Sun, 31 Mar 2019 14:18:03 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201903311418.x2VEI3ma087610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345754 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 345754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 37EC383C07 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.92)[-0.916,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:06 -0000 X-Original-Date: Sun, 31 Mar 2019 14:18:03 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:06 -0000 Author: avos Date: Sun Mar 31 14:18:02 2019 New Revision: 345754 URL: https://svnweb.freebsd.org/changeset/base/345754 Log: run(4): properly set F_DATAPAD radiotap flag if frame has padding between frame header and data. This will fix 'Mysterious OLPC stuff' for received frames and wrong CCMP / TKIP / data decoding for transmitted frames in net/wireshark dissector. While here, drop unneeded comment - net80211 handles padding requirements for Tx & Rx without driver adjustment. Tested with D-Link DWA-140 rev B3, STA mode. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sun Mar 31 13:41:20 2019 (r345753) +++ head/sys/dev/usb/wlan/if_run.c Sun Mar 31 14:18:02 2019 (r345754) @@ -2851,10 +2851,6 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin } if (flags & RT2860_RX_L2PAD) { - /* - * XXX OpenBSD removes padding between header - * and payload here... - */ RUN_DPRINTF(sc, RUN_DEBUG_RECV, "received RT2860_RX_L2PAD frame\n"); len += 2; @@ -2896,6 +2892,8 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin uint16_t phy; tap->wr_flags = 0; + if (flags & RT2860_RX_L2PAD) + tap->wr_flags |= IEEE80211_RADIOTAP_F_DATAPAD; tap->wr_antsignal = rssi; tap->wr_antenna = ant; tap->wr_dbm_antsignal = run_rssi2dbm(sc, rssi, ant); @@ -3162,14 +3160,23 @@ tr_setup: vap = data->ni->ni_vap; if (ieee80211_radiotap_active_vap(vap)) { + const struct ieee80211_frame *wh; struct run_tx_radiotap_header *tap = &sc->sc_txtap; struct rt2860_txwi *txwi = (struct rt2860_txwi *)(&data->desc + sizeof(struct rt2870_txd)); + int has_l2pad; + + wh = mtod(m, struct ieee80211_frame *); + has_l2pad = IEEE80211_HAS_ADDR4(wh) != + IEEE80211_QOS_HAS_SEQ(wh); + tap->wt_flags = 0; tap->wt_rate = rt2860_rates[data->ridx].rate; tap->wt_hwqueue = index; if (le16toh(txwi->phy) & RT2860_PHY_SHPRE) tap->wt_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; + if (has_l2pad) + tap->wt_flags |= IEEE80211_RADIOTAP_F_DATAPAD; ieee80211_radiotap_tx(vap, m); } From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 849D0DC197; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv5ggLz4P4r; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id B2CCB19F52; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7300B1C4EA; Sun, 31 Mar 2019 14:51:40 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26A3F85005; Sun, 31 Mar 2019 14:51:40 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0F7A31C4E8; Sun, 31 Mar 2019 14:51:40 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 375B41C4E6 for ; Sun, 31 Mar 2019 14:51:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89E8284FF7; Sun, 31 Mar 2019 14:51:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x2VEpO3a000811 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 31 Mar 2019 17:51:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x2VEpO3a000811 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x2VEpMJn000810; Sun, 31 Mar 2019 17:51:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345696 - head/lib/libvgl Message-ID: <20190331145122.GL1923@kib.kiev.ua> References: <201903291557.x2TFv9AW097226@repo.freebsd.org> <20190329182100.GZ1923@kib.kiev.ua> <20190330142319.I1011@besplex.bde.org> <20190330094558.GA1923@kib.kiev.ua> <20190331214235.K961@besplex.bde.org> <20190331121015.GK1923@kib.kiev.ua> <20190331231926.M1259@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190331231926.M1259@besplex.bde.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 26A3F85005 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:06 -0000 X-Original-Date: Sun, 31 Mar 2019 17:51:22 +0300 X-List-Received-Date: Tue, 03 Sep 2019 14:06:06 -0000 On Mon, Apr 01, 2019 at 12:04:45AM +1100, Bruce Evans wrote: > Serial consoles are not always available. > > Better debuggers switch the screen mode as necessary. > > I recently noticed another mode switching problem. On i386, cycling > through about 50 modes to test them all takes a small fraction of a > second for each mode switch (done directly in syscons or by a vm86 > BIOS call) even when the monitor takes too long to resync (the monitor > resyncs are coalesced, so 50 resyncs take about 5 seconds instead of > 250). But on amd64, mode switches to VESA mode and back take about > 20 seconds. They are not coalesced, and most of the system is stopped > waiting for them (at least remote network access is stopped). amd64 > can't use vm86, so it emulates BIOS calls. Why does the emulation stop > the rest of the system and take so long? How many CPUs do you have ? x86bios.c x86bios_call() does spinlock_enter() around emulator calls. This disables interrupts. If you have only one CPU, the consequences are obvious. If you have more than one, then perhaps next IPI targeted to this CPU blocks the originator, if IPI requires ack, which typically true for most common TLB shutdown IPIs. Then both this CPU and originator block any other CPU trying to send an IPI. For this reason I have to come through several hoops to not disable interrupts for duration of EFI runtime calls, otherwise spinlocks die due to 'spin lock held too long' on other CPUs. From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29EFDDC115; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yt5Snlz4P3P; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id C066E19ECD; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 42AEA1F4C6; Sat, 30 Mar 2019 07:20:33 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7457772DEF; Sat, 30 Mar 2019 07:20:32 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 2160E1F47A; Sat, 30 Mar 2019 07:20:32 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 86A891F478 for ; Sat, 30 Mar 2019 07:20:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5079972DE9; Sat, 30 Mar 2019 07:20:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EAADB580; Sat, 30 Mar 2019 07:20:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2U7KSZV086903; Sat, 30 Mar 2019 07:20:28 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2U7KSmN086902; Sat, 30 Mar 2019 07:20:28 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201903300720.x2U7KSmN086902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345726 - head/sys/dev/xen/blkfront X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: head/sys/dev/xen/blkfront X-SVN-Commit-Revision: 345726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 7457772DEF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.93)[-0.932,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:03 -0000 X-Original-Date: Sat, 30 Mar 2019 07:20:28 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:03 -0000 Author: pjd Date: Sat Mar 30 07:20:28 2019 New Revision: 345726 URL: https://svnweb.freebsd.org/changeset/base/345726 Log: Implement support for online disk capacity changes. Obtained from: Fudo Security Tested in: AWS Modified: head/sys/dev/xen/blkfront/blkfront.c Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Sat Mar 30 01:56:53 2019 (r345725) +++ head/sys/dev/xen/blkfront/blkfront.c Sat Mar 30 07:20:28 2019 (r345726) @@ -1227,11 +1227,40 @@ xbd_connect(struct xbd_softc *sc) int err, feature_barrier, feature_flush; int i, j; - if (sc->xbd_state == XBD_STATE_CONNECTED || - sc->xbd_state == XBD_STATE_SUSPENDED) + DPRINTK("blkfront.c:connect:%s.\n", xenbus_get_otherend_path(dev)); + + if (sc->xbd_state == XBD_STATE_SUSPENDED) { return; + } - DPRINTK("blkfront.c:connect:%s.\n", xenbus_get_otherend_path(dev)); + if (sc->xbd_state == XBD_STATE_CONNECTED) { + struct disk *disk; + + disk = sc->xbd_disk; + if (disk == NULL) { + return; + } + err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), + "sectors", "%lu", §ors, NULL); + if (err != 0) { + xenbus_dev_error(dev, err, + "reading sectors at %s", + xenbus_get_otherend_path(dev)); + return; + } + disk->d_mediasize = disk->d_sectorsize * sectors; + err = disk_resize(disk, M_NOWAIT); + if (err) { + xenbus_dev_error(dev, err, + "unable to resize disk %s%u", + disk->d_name, disk->d_unit); + return; + } + device_printf(sc->xbd_dev, + "changed capacity to %jd\n", + (intmax_t)disk->d_mediasize); + return; + } err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), "sectors", "%lu", §ors, From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41C9CDC122; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yt4kx6z4P3D; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id CAD7F19ED7; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 6AA771F60F; Sat, 30 Mar 2019 07:24:39 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E94F7319D; Sat, 30 Mar 2019 07:24:38 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1A3811F593; Sat, 30 Mar 2019 07:24:38 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 0C1A51F591 for ; Sat, 30 Mar 2019 07:24:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D216673197; Sat, 30 Mar 2019 07:24:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA9DDB736; Sat, 30 Mar 2019 07:24:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2U7OYIA091724; Sat, 30 Mar 2019 07:24:34 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2U7OY2B091722; Sat, 30 Mar 2019 07:24:34 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201903300724.x2U7OY2B091722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345727 - in head: sbin/devd sys/geom X-SVN-Group: head X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: in head: sbin/devd sys/geom X-SVN-Commit-Revision: 345727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 5E94F7319D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.93)[-0.932,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:04 -0000 X-Original-Date: Sat, 30 Mar 2019 07:24:34 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:04 -0000 Author: pjd Date: Sat Mar 30 07:24:34 2019 New Revision: 345727 URL: https://svnweb.freebsd.org/changeset/base/345727 Log: Introduce new event SIZECHANGE within GEOM system to inform about GEOM providers mediasize changes. While here, use GEOM nomenclature to describe providers instead of calling them device nodes. Obtained from: Fudo Security Tested in: AWS Modified: head/sbin/devd/devd.conf.5 head/sys/geom/geom_dev.c Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Sat Mar 30 07:20:28 2019 (r345726) +++ head/sbin/devd/devd.conf.5 Sat Mar 30 07:24:34 2019 (r345727) @@ -41,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd July 20, 2018 +.Dd March 29, 2019 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -432,15 +432,19 @@ only includes disk-like devices. .It Li CREATE A .Xr geom 4 -device node is created. +provider is created. .It Li DESTROY A .Xr geom 4 -device node is destroyed. +provider is destroyed. .It Li GEOM::physpath The physical path of a device has changed. .It Li MEDIACHANGE Physical media has changed. +.It Li SIZECHANGE +A +.Xr geom 4 +provider size has changed. .El .El .Pp Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Sat Mar 30 07:20:28 2019 (r345726) +++ head/sys/geom/geom_dev.c Sat Mar 30 07:24:34 2019 (r345727) @@ -92,6 +92,7 @@ static g_fini_t g_dev_fini; static g_taste_t g_dev_taste; static g_orphan_t g_dev_orphan; static g_attrchanged_t g_dev_attrchanged; +static g_resize_t g_dev_resize; static struct g_class g_dev_class = { .name = "DEV", @@ -100,7 +101,8 @@ static struct g_class g_dev_class = { .fini = g_dev_fini, .taste = g_dev_taste, .orphan = g_dev_orphan, - .attrchanged = g_dev_attrchanged + .attrchanged = g_dev_attrchanged, + .resize = g_dev_resize }; /* @@ -300,6 +302,15 @@ g_dev_attrchanged(struct g_consumer *cp, const char *a g_dev_set_physpath(cp); return; } +} + +static void +g_dev_resize(struct g_consumer *cp) +{ + char buf[SPECNAMELEN + 6]; + + snprintf(buf, sizeof(buf), "cdev=%s", cp->provider->name); + devctl_notify_f("GEOM", "DEV", "SIZECHANGE", buf, M_WAITOK); } struct g_provider * From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3B74DC208; Tue, 3 Sep 2019 14:06:01 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yx1pLlz4P5x; Tue, 3 Sep 2019 14:06:01 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 74D7C19FA5; Tue, 3 Sep 2019 14:05:54 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C56751068B; Mon, 1 Apr 2019 17:44:24 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3319C81330; Mon, 1 Apr 2019 17:44:24 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1485810652; Mon, 1 Apr 2019 17:44:24 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 832061064D for ; Mon, 1 Apr 2019 17:44:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BDDC8132A; Mon, 1 Apr 2019 17:44:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CFAF19D3E; Mon, 1 Apr 2019 17:44:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x31HiKlo051604; Mon, 1 Apr 2019 17:44:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x31HiK7G051602; Mon, 1 Apr 2019 17:44:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904011744.x31HiK7G051602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345769 - in head: lib/libbe sbin/bectl/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libbe sbin/bectl/tests X-SVN-Commit-Revision: 345769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3319C81330 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:08 -0000 X-Original-Date: Mon, 1 Apr 2019 17:44:20 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:08 -0000 Author: kevans Date: Mon Apr 1 17:44:20 2019 New Revision: 345769 URL: https://svnweb.freebsd.org/changeset/base/345769 Log: libbe: Fix zfs_is_mounted check w/ snapshots 'be_destroy' can destroy a boot environment (by name) or a given snapshot. If the target to be destroyed is a dataset, check if it's mounted. We don't want to check if the origin dataset is mounted when destroying a snapshot. PR: 236043 Submitted by: Rob Fairbanks MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19650 Modified: head/lib/libbe/be.c head/sbin/bectl/tests/bectl_test.sh Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Mon Apr 1 16:36:02 2019 (r345768) +++ head/lib/libbe/be.c Mon Apr 1 17:44:20 2019 (r345769) @@ -265,6 +265,16 @@ be_destroy(libbe_handle_t *lbh, const char *name, int zfs_prop_get(fs, ZFS_PROP_ORIGIN, origin, sizeof(origin), NULL, NULL, 0, 1) != 0) return (set_error(lbh, BE_ERR_NOORIGIN)); + + /* Don't destroy a mounted dataset unless force is specified */ + if ((mounted = zfs_is_mounted(fs, NULL)) != 0) { + if (force) { + zfs_unmount(fs, NULL, 0); + } else { + free(bdd.snapname); + return (set_error(lbh, BE_ERR_DESTROYMNT)); + } + } } else { if (!zfs_dataset_exists(lbh->lzh, path, ZFS_TYPE_SNAPSHOT)) return (set_error(lbh, BE_ERR_NOENT)); @@ -277,16 +287,6 @@ be_destroy(libbe_handle_t *lbh, const char *name, int if (fs == NULL) { free(bdd.snapname); return (set_error(lbh, BE_ERR_ZFSOPEN)); - } - } - - /* Check if mounted, unmount if force is specified */ - if ((mounted = zfs_is_mounted(fs, NULL)) != 0) { - if (force) { - zfs_unmount(fs, NULL, 0); - } else { - free(bdd.snapname); - return (set_error(lbh, BE_ERR_DESTROYMNT)); } } Modified: head/sbin/bectl/tests/bectl_test.sh ============================================================================== --- head/sbin/bectl/tests/bectl_test.sh Mon Apr 1 16:36:02 2019 (r345768) +++ head/sbin/bectl/tests/bectl_test.sh Mon Apr 1 17:44:20 2019 (r345769) @@ -123,12 +123,21 @@ bectl_destroy_body() zpool=$(make_zpool_name) disk=${cwd}/disk.img mount=${cwd}/mnt + root=${mount}/root bectl_create_setup ${zpool} ${disk} ${mount} atf_check bectl -r ${zpool}/ROOT create -e default default2 atf_check -o not-empty zfs get mountpoint ${zpool}/ROOT/default2 atf_check -e ignore bectl -r ${zpool}/ROOT destroy default2 atf_check -e not-empty -s not-exit:0 zfs get mountpoint ${zpool}/ROOT/default2 + + # Test origin snapshot deletion when the snapshot to be destroyed + # belongs to a mounted dataset, see PR 236043. + atf_check mkdir -p ${root} + atf_check -o not-empty bectl -r ${zpool}/ROOT mount default ${root} + atf_check bectl -r ${zpool}/ROOT create -e default default3 + atf_check bectl -r ${zpool}/ROOT destroy -o default3 + atf_check bectl -r ${zpool}/ROOT unmount default } bectl_destroy_cleanup() { From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AD84DC2BE; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yz4NZPz4P89; Tue, 3 Sep 2019 14:06:03 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 8A6CC1A064; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7E6FC1B2D5; Tue, 2 Apr 2019 04:12:10 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 329F57139E; Tue, 2 Apr 2019 04:12:10 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1B3271B2D3; Tue, 2 Apr 2019 04:12:10 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id A5BD91B2CF for ; Tue, 2 Apr 2019 04:12:07 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 609847138E; Tue, 2 Apr 2019 04:12:07 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E97F20B7B; Tue, 2 Apr 2019 04:12:07 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x324C7Y1084525; Tue, 2 Apr 2019 04:12:07 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x324C7q8084524; Tue, 2 Apr 2019 04:12:07 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904020412.x324C7q8084524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345791 - head/sys/dev/ipmi X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/ipmi X-SVN-Commit-Revision: 345791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 329F57139E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:09 -0000 X-Original-Date: Tue, 2 Apr 2019 04:12:07 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:09 -0000 Author: jhibbits Date: Tue Apr 2 04:12:06 2019 New Revision: 345791 URL: https://svnweb.freebsd.org/changeset/base/345791 Log: ipmi: Fixes for ipmi_opal(powernv) * Crank the OPAL state machine during the receive loop, to make sure the pollers are executed * Add a proper detach function, so the module can be unloaded and reloaded at runtime. It still doesn't reliably work 100% of the time on POWER9, and it appears timing and/or cache related. It may work on POWER8 now. MFC after: 2 weeks Modified: head/sys/dev/ipmi/ipmi_opal.c Modified: head/sys/dev/ipmi/ipmi_opal.c ============================================================================== --- head/sys/dev/ipmi/ipmi_opal.c Tue Apr 2 04:02:57 2019 (r345790) +++ head/sys/dev/ipmi/ipmi_opal.c Tue Apr 2 04:12:06 2019 (r345791) @@ -99,6 +99,8 @@ opal_ipmi_polled_request(struct opal_ipmi_softc *sc, s timo *= 10; /* Timeout is in milliseconds, we delay in 100us */ do { msg_len = sizeof(struct opal_ipmi_msg) + IPMI_MAX_RX; + /* Crank the OPAL state machine while we poll for a reply. */ + opal_call(OPAL_POLL_EVENTS, NULL); err = opal_call(OPAL_IPMI_RECV, sc->sc_interface, vtophys(sc->sc_msg), vtophys(&msg_len)); if (err != OPAL_EMPTY) @@ -113,6 +115,7 @@ opal_ipmi_polled_request(struct opal_ipmi_softc *sc, s req->ir_replylen = min(req->ir_replylen, req->ir_replybuflen); memcpy(req->ir_reply, &sc->sc_msg->data[1], req->ir_replylen); req->ir_compcode = sc->sc_msg->data[0]; + err = 0; break; case OPAL_RESOURCE: err = ENOMEM; @@ -223,7 +226,15 @@ opal_ipmi_attach(device_t dev) static int opal_ipmi_detach(device_t dev) { - return (EBUSY); + struct opal_ipmi_softc *sc; + int err; + + sc = device_get_softc(dev); + err = ipmi_detach(dev); + if (err == 0) + free(sc->sc_msg, M_IPMI); + + return (err); } static device_method_t opal_ipmi_methods[] = { From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE8AFDC1BB; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yw1MD6z4P5C; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 2008119F75; Tue, 3 Sep 2019 14:05:54 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 98EA1B323; Mon, 1 Apr 2019 12:14:50 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5676F6CBB5; Mon, 1 Apr 2019 12:14:49 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1E507B2FA; Mon, 1 Apr 2019 12:14:49 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id B857CB2F5 for ; Mon, 1 Apr 2019 12:14:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BE656CBB0; Mon, 1 Apr 2019 12:14:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 428E7E406; Mon, 1 Apr 2019 12:14:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x31CEk40078035; Mon, 1 Apr 2019 12:14:46 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x31CEkpw078034; Mon, 1 Apr 2019 12:14:46 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201904011214.x31CEkpw078034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345763 - head/contrib/bsnmp/snmpd X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/contrib/bsnmp/snmpd X-SVN-Commit-Revision: 345763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 5676F6CBB5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:06 -0000 X-Original-Date: Mon, 1 Apr 2019 12:14:46 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:06 -0000 Author: ae Date: Mon Apr 1 12:14:45 2019 New Revision: 345763 URL: https://svnweb.freebsd.org/changeset/base/345763 Log: Correct a port number assignment. PR: 236930 MFC after: 1 week Modified: head/contrib/bsnmp/snmpd/trap.c Modified: head/contrib/bsnmp/snmpd/trap.c ============================================================================== --- head/contrib/bsnmp/snmpd/trap.c Mon Apr 1 10:51:24 2019 (r345762) +++ head/contrib/bsnmp/snmpd/trap.c Mon Apr 1 12:14:45 2019 (r345763) @@ -726,8 +726,7 @@ target_activate_address(struct target_address *addrs) sa.sin_addr.s_addr = htonl((addrs->address[0] << 24) | (addrs->address[1] << 16) | (addrs->address[2] << 8) | (addrs->address[3] << 0)); - sa.sin_port = htons(addrs->address[4]) << 8 | - htons(addrs->address[5]) << 0; + sa.sin_port = htons(addrs->address[4] << 8 | addrs->address[5]); if (connect(addrs->socket, (struct sockaddr *)&sa, sa.sin_len) == -1) { syslog(LOG_ERR, "connect(%s,%u): %m", From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F99ADC15E; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv0pgjz4P3j; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 10A9F19EFD; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7C7E4676F; Sat, 30 Mar 2019 16:58:55 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 329BC8F508; Sat, 30 Mar 2019 16:58:55 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1EECF676D; Sat, 30 Mar 2019 16:58:55 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 20C5C6762 for ; Sat, 30 Mar 2019 16:58:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFE658F4FD; Sat, 30 Mar 2019 16:58:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C943219B6F; Sat, 30 Mar 2019 16:58:51 +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 x2UGwpTf089494; Sat, 30 Mar 2019 16:58:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2UGwpYm089493; Sat, 30 Mar 2019 16:58:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903301658.x2UGwpYm089493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345734 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 345734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 329BC8F508 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:04 -0000 X-Original-Date: Sat, 30 Mar 2019 16:58:51 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:04 -0000 Author: kib Date: Sat Mar 30 16:58:51 2019 New Revision: 345734 URL: https://svnweb.freebsd.org/changeset/base/345734 Log: Fix branding after r345661. In particular, elf32 FreeBSD binaries were not executed on LP64 hosts. The interp_name_len value should account for the nul terminator. This is needed for strncmp()s in brand checking code to work. Reported by: andreast Sponsored by: The FreeBSD Foundation MFC after: 12 days (together with r345661) Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sat Mar 30 13:59:02 2019 (r345733) +++ head/sys/kern/imgact_elf.c Sat Mar 30 16:58:51 2019 (r345734) @@ -279,7 +279,7 @@ __elfN(get_brandinfo)(struct image_params *imgp, const boolean_t ret; int i, interp_name_len; - interp_name_len = interp != NULL ? strlen(interp) : 0; + interp_name_len = interp != NULL ? strlen(interp) + 1 : 0; /* * We support four types of branding -- (1) the ELF EI_OSABI field From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5DDBDC146; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv0pfDz4P3h; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 39F4A19F0E; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id CAC1910DF1; Sat, 30 Mar 2019 23:44:02 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A0E18513C; Sat, 30 Mar 2019 23:44:02 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 14ED910DD4; Sat, 30 Mar 2019 23:44:02 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 0B4AB10DCF for ; Sat, 30 Mar 2019 23:43:59 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A20D785132; Sat, 30 Mar 2019 23:43:58 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A9691E33D; Sat, 30 Mar 2019 23:43:58 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2UNhwwn028506; Sat, 30 Mar 2019 23:43:58 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2UNhw5m028505; Sat, 30 Mar 2019 23:43:58 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201903302343.x2UNhw5m028505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345741 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: jah X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 345741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 5A0E18513C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:04 -0000 X-Original-Date: Sat, 30 Mar 2019 23:43:58 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:04 -0000 Author: jah Date: Sat Mar 30 23:43:58 2019 New Revision: 345741 URL: https://svnweb.freebsd.org/changeset/base/345741 Log: freebsd32: fix padding of computed control message length for recvmsg() Each control message region must be aligned on a 4-byte boundary on 32-bit architectures. The 32-bit compat shim for recvmsg() gets the actual layout right, but doesn't pad the payload length when computing msg_controllen for the output message header. If a control message contains an unaligned payload, such as the 1-byte TTL field in the example attached to PR 236737, this can produce control message payload boundaries that extend beyond the boundary reported by msg_controllen. PR: 236737 Reported by: Yuval Pavel Zholkover Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19768 Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sat Mar 30 21:04:08 2019 (r345740) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sat Mar 30 23:43:58 2019 (r345741) @@ -1160,8 +1160,8 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf cm = NULL; } - msg->msg_controllen += FREEBSD32_ALIGN(sizeof(*cm)) + - datalen_out; + msg->msg_controllen += + FREEBSD32_CMSG_SPACE(datalen_out); } } if (len == 0 && m != NULL) { From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71061DC2D2; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yz60z1z4P8h; Tue, 3 Sep 2019 14:06:03 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id C85181A07D; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id B427614A4; Tue, 2 Apr 2019 13:38:04 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 611228C407; Tue, 2 Apr 2019 13:38:04 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 3BC5214A0; Tue, 2 Apr 2019 13:38:04 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 11C721498 for ; Tue, 2 Apr 2019 13:38:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5A1C8C3FC; Tue, 2 Apr 2019 13:38:00 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9622526BAE; Tue, 2 Apr 2019 13:38:00 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x32Dc04v079675; Tue, 2 Apr 2019 13:38:00 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x32Dc0Mj079674; Tue, 2 Apr 2019 13:38:00 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201904021338.x32Dc0Mj079674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345798 - head/contrib/bsnmp/snmp_mibII X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/contrib/bsnmp/snmp_mibII X-SVN-Commit-Revision: 345798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 611228C407 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:10 -0000 X-Original-Date: Tue, 2 Apr 2019 13:38:00 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:10 -0000 Author: ae Date: Tue Apr 2 13:38:00 2019 New Revision: 345798 URL: https://svnweb.freebsd.org/changeset/base/345798 Log: Create 64bit mibII counters for all interfaces. PR: 157015 Obtained from: Yandex LLC MFC after: 1 month Modified: head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Modified: head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Tue Apr 2 12:50:01 2019 (r345797) +++ head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Tue Apr 2 13:38:00 2019 (r345798) @@ -373,11 +373,6 @@ op_ifxtable(struct snmp_context *ctx, struct snmp_valu switch (op) { - again: - if (op != SNMP_OP_GETNEXT) - return (SNMP_ERR_NOSUCHNAME); - /* FALLTHROUGH */ - case SNMP_OP_GETNEXT: if ((ifp = NEXT_OBJECT_INT(&mibif_list, &value->var, sub)) == NULL) return (SNMP_ERR_NOSUCHNAME); @@ -460,52 +455,36 @@ op_ifxtable(struct snmp_context *ctx, struct snmp_valu break; case LEAF_ifHCInOctets: - if (!(ifp->flags & MIBIF_HIGHSPEED)) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_inoctets; break; case LEAF_ifHCInUcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_ipackets - MIBIF_PRIV(ifp)->hc_imcasts; break; case LEAF_ifHCInMulticastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_imcasts; break; case LEAF_ifHCInBroadcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = 0; break; case LEAF_ifHCOutOctets: - if (!(ifp->flags & MIBIF_HIGHSPEED)) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_outoctets; break; case LEAF_ifHCOutUcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_opackets - MIBIF_PRIV(ifp)->hc_omcasts; break; case LEAF_ifHCOutMulticastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_omcasts; break; case LEAF_ifHCOutBroadcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = 0; break; From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5EBA1DC312; Tue, 3 Sep 2019 14:06:05 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z02TZDz4P9c; Tue, 3 Sep 2019 14:06:03 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 0D0A11A0A3; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id DBB4F26D4; Tue, 2 Apr 2019 14:08:24 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 434438E4FB; Tue, 2 Apr 2019 14:08:24 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 15D5A26AC; Tue, 2 Apr 2019 14:08:24 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 3483326A8; Tue, 2 Apr 2019 14:08:21 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5918E4F6; Tue, 2 Apr 2019 14:08:20 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x32E8IYu021668; Tue, 2 Apr 2019 07:08:18 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x32E8Ho9021667; Tue, 2 Apr 2019 07:08:17 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904021408.x32E8Ho9021667@gndrsh.dnsmgr.net> Subject: Re: svn commit: r345804 - head/usr.bin/systat In-Reply-To: <201904021401.x32E13Fi092699@repo.freebsd.org> To: Michael Reifenberger CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 434438E4FB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:11 -0000 X-Original-Date: Tue, 2 Apr 2019 07:08:17 -0700 (PDT) X-List-Received-Date: Tue, 03 Sep 2019 14:06:11 -0000 > Author: mr > Date: Tue Apr 2 14:01:03 2019 > New Revision: 345804 > URL: https://svnweb.freebsd.org/changeset/base/345804 > > Log: > systat -zarc to display disk activities like -vm > > PR: 213310 > Submitted by: ota > MFH: 4 weeks ? MFC: > Differential Revision: https://reviews.freebsd.org/D18726 > > Modified: > head/usr.bin/systat/devs.c > head/usr.bin/systat/devs.h > head/usr.bin/systat/iostat.c > head/usr.bin/systat/swap.c > head/usr.bin/systat/systat.h > head/usr.bin/systat/vmstat.c > head/usr.bin/systat/zarc.c > > Modified: head/usr.bin/systat/devs.c > ============================================================================== > --- head/usr.bin/systat/devs.c Tue Apr 2 13:59:04 2019 (r345803) > +++ head/usr.bin/systat/devs.c Tue Apr 2 14:01:03 2019 (r345804) > @@ -2,6 +2,7 @@ > * SPDX-License-Identifier: BSD-3-Clause > * > * Copyright (c) 1998 Kenneth D. Merry. > + * 2015 Yoshihiro Ota > * All rights reserved. Can we get in contact with Yoshihiro Ota about his copyright statements, and correcting this to make it clear that it is Kenneth D. Merry that is asserting "All rights reserved" and if Ota does nor does not wish to assert "All rights reserved". As committed this makes a grey area on Kenneth's assertion, also leaving out the word copyright on Yoshihiro's line is a bit iffy. I am only commenting once, this issue appears several times. We can go back out to D18726 to discuss it if need be. > * > * Redistribution and use in source and binary forms, with or without > @@ -69,7 +70,6 @@ static const char sccsid[] = "@(#)disks.c 8.1 (Berkele > #include > > #include > -#include > #include > #include > #include > @@ -84,6 +84,8 @@ typedef enum { > DS_MATCHTYPE_PATTERN > } last_match_type; > > +struct statinfo cur_dev, last_dev, run_dev; > + > last_match_type last_type; > struct device_selection *dev_select; > long generation; > @@ -101,10 +103,8 @@ static int dsselect(const char *args, devstat_select_m > int maxshowdevs, struct statinfo *s1); > > int > -dsinit(int maxshowdevs, struct statinfo *s1, struct statinfo *s2 __unused, > - struct statinfo *s3 __unused) > +dsinit(int maxshowdevs) > { > - > /* > * Make sure that the userland devstat version matches the kernel > * devstat version. If not, exit and print a message informing > @@ -113,6 +113,18 @@ dsinit(int maxshowdevs, struct statinfo *s1, struct st > if (devstat_checkversion(NULL) < 0) > errx(1, "%s", devstat_errbuf); > > + if( cur_dev.dinfo ) // init was alreay ran > + return(1); > + > + if ((num_devices = devstat_getnumdevs(NULL)) < 0) { > + warnx("%s", devstat_errbuf); > + return(0); > + } > + > + cur_dev.dinfo = calloc(1, sizeof(struct devinfo)); > + last_dev.dinfo = calloc(1, sizeof(struct devinfo)); > + run_dev.dinfo = calloc(1, sizeof(struct devinfo)); > + > generation = 0; > num_devices = 0; > num_selected = 0; > @@ -120,11 +132,11 @@ dsinit(int maxshowdevs, struct statinfo *s1, struct st > select_generation = 0; > last_type = DS_MATCHTYPE_NONE; > > - if (devstat_getdevs(NULL, s1) == -1) > + if (devstat_getdevs(NULL, &cur_dev) == -1) > errx(1, "%s", devstat_errbuf); > > - num_devices = s1->dinfo->numdevs; > - generation = s1->dinfo->generation; > + num_devices = cur_dev.dinfo->numdevs; > + generation = cur_dev.dinfo->generation; > > dev_select = NULL; > > @@ -134,13 +146,31 @@ dsinit(int maxshowdevs, struct statinfo *s1, struct st > * or 1. If we get back -1, though, there is an error. > */ > if (devstat_selectdevs(&dev_select, &num_selected, &num_selections, > - &select_generation, generation, s1->dinfo->devices, num_devices, > + &select_generation, generation, cur_dev.dinfo->devices, num_devices, > NULL, 0, NULL, 0, DS_SELECT_ADD, maxshowdevs, 0) == -1) > errx(1, "%d %s", __LINE__, devstat_errbuf); > > return(1); > } > > + > +void > +dsgetinfo(struct statinfo* dev) > +{ > + switch (devstat_getdevs(NULL, dev)) { > + case -1: > + errx(1, "%s", devstat_errbuf); > + break; > + case 1: > + num_devices = dev->dinfo->numdevs; > + generation = dev->dinfo->generation; > + cmdkre("refresh", NULL); > + break; > + default: > + break; > + } > +} > + > int > dscmd(const char *cmd, const char *args, int maxshowdevs, struct statinfo *s1) > { > @@ -330,4 +360,84 @@ dsselect(const char *args, devstat_select_mode select_ > return(2); > } > return(1); > +} > + > + > +void > +dslabel(int maxdrives, int diskcol, int diskrow) > +{ > + int i, j; > + > + mvprintw(diskrow, diskcol, "Disks"); > + mvprintw(diskrow + 1, diskcol, "KB/t"); > + mvprintw(diskrow + 2, diskcol, "tps"); > + mvprintw(diskrow + 3, diskcol, "MB/s"); > + mvprintw(diskrow + 4, diskcol, "%%busy"); > + /* > + * For now, we don't support a fourth disk statistic. So there's > + * no point in providing a label for it. If someone can think of a > + * fourth useful disk statistic, there is room to add it. > + */ > + /* mvprintw(diskrow + 4, diskcol, " msps"); */ > + j = 0; > + for (i = 0; i < num_devices && j < maxdrives; i++) > + if (dev_select[i].selected) { > + char tmpstr[80]; > + sprintf(tmpstr, "%s%d", dev_select[i].device_name, > + dev_select[i].unit_number); > + mvprintw(diskrow, diskcol + 5 + 6 * j, > + " %5.5s", tmpstr); > + j++; > + } > +} > + > +static void > +dsshow2(int diskcol, int diskrow, int dn, int lc, struct statinfo *now, struct statinfo *then) > +{ > + long double transfers_per_second; > + long double kb_per_transfer, mb_per_second; > + long double elapsed_time, device_busy; > + int di; > + > + di = dev_select[dn].position; > + > + if (then != NULL) { > + /* Calculate relative to previous sample */ > + elapsed_time = now->snap_time - then->snap_time; > + } else { > + /* Calculate relative to device creation */ > + elapsed_time = now->snap_time - devstat_compute_etime( > + &now->dinfo->devices[di].creation_time, NULL); > + } > + > + if (devstat_compute_statistics(&now->dinfo->devices[di], then ? > + &then->dinfo->devices[di] : NULL, elapsed_time, > + DSM_KB_PER_TRANSFER, &kb_per_transfer, > + DSM_TRANSFERS_PER_SECOND, &transfers_per_second, > + DSM_MB_PER_SECOND, &mb_per_second, > + DSM_BUSY_PCT, &device_busy, > + DSM_NONE) != 0) > + errx(1, "%s", devstat_errbuf); > + > + lc = diskcol + lc * 6; > + putlongdouble(kb_per_transfer, diskrow + 1, lc, 5, 2, 0); > + putlongdouble(transfers_per_second, diskrow + 2, lc, 5, 0, 0); > + putlongdouble(mb_per_second, diskrow + 3, lc, 5, 2, 0); > + putlongdouble(device_busy, diskrow + 4, lc, 5, 0, 0); > +} > + > +static void > +dsshow3(int diskcol, int diskrow, int dn, int lc, struct statinfo *now, struct statinfo *then) > +{ > + dsshow2(diskcol, diskrow, dn, lc, now, then); > +} > + > +void > +dsshow(int maxdrives, int diskcol, int diskrow, struct statinfo *now, struct statinfo *then) > +{ > + int i, lc; > + > + for (i = 0, lc = 0; i < num_devices && lc < maxdrives; i++) > + if (dev_select[i].selected) > + dsshow3(diskcol, diskrow, i, ++lc, now, then); > } > > Modified: head/usr.bin/systat/devs.h > ============================================================================== > --- head/usr.bin/systat/devs.h Tue Apr 2 13:59:04 2019 (r345803) > +++ head/usr.bin/systat/devs.h Tue Apr 2 14:01:03 2019 (r345804) > @@ -2,6 +2,7 @@ > * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > * > * Copyright (c) 1998 David E. O'Brien > + * 2015 Yoshihiro Ota > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -28,5 +29,18 @@ > * $FreeBSD$ > */ > > -int dsinit(int, struct statinfo *, struct statinfo *, struct statinfo *); > +#ifndef DEVS_H > +#define DEVS_H > + > +#include > + > +int dsinit(int); > +void dsgetinfo(struct statinfo *); > int dscmd(const char *, const char *, int, struct statinfo *); > + > +void dslabel(int, int, int); > +void dsshow(int, int, int, struct statinfo *, struct statinfo *); > + > +extern struct statinfo cur_dev, last_dev, run_dev; > + > +#endif > > Modified: head/usr.bin/systat/iostat.c > ============================================================================== > --- head/usr.bin/systat/iostat.c Tue Apr 2 13:59:04 2019 (r345803) > +++ head/usr.bin/systat/iostat.c Tue Apr 2 14:01:03 2019 (r345804) > @@ -79,8 +79,6 @@ static const char sccsid[] = "@(#)iostat.c 8.1 (Berkel > #include "extern.h" > #include "devs.h" > > -struct statinfo cur, last; > - > static int linesperregion; > static double etime; > static int numbers = 0; /* default display bar graphs */ > @@ -111,17 +109,11 @@ closeiostat(WINDOW *w) > int > initiostat(void) > { > - if ((num_devices = devstat_getnumdevs(NULL)) < 0) > - return(0); > - > - cur.dinfo = calloc(1, sizeof(struct devinfo)); > - last.dinfo = calloc(1, sizeof(struct devinfo)); > - > /* > * This value for maxshowdevs (100) is bogus. I'm not sure exactly > * how to calculate it, though. > */ > - if (dsinit(100, &cur, &last, NULL) != 1) > + if (dsinit(7) != 1) > return(0); > > return(1); > @@ -133,17 +125,17 @@ fetchiostat(void) > struct devinfo *tmp_dinfo; > size_t len; > > - len = sizeof(cur.cp_time); > - if (sysctlbyname("kern.cp_time", &cur.cp_time, &len, NULL, 0) > - || len != sizeof(cur.cp_time)) { > + len = sizeof(cur_dev.cp_time); > + if (sysctlbyname("kern.cp_time", &cur_dev.cp_time, &len, NULL, 0) > + || len != sizeof(cur_dev.cp_time)) { > perror("kern.cp_time"); > exit (1); > } > - tmp_dinfo = last.dinfo; > - last.dinfo = cur.dinfo; > - cur.dinfo = tmp_dinfo; > + tmp_dinfo = last_dev.dinfo; > + last_dev.dinfo = cur_dev.dinfo; > + cur_dev.dinfo = tmp_dinfo; > > - last.snap_time = cur.snap_time; > + last_dev.snap_time = cur_dev.snap_time; > > /* > * Here what we want to do is refresh our device stats. > @@ -152,7 +144,7 @@ fetchiostat(void) > * the selection process again, in case a device that we > * were previously displaying has gone away. > */ > - switch (devstat_getdevs(NULL, &cur)) { > + switch (devstat_getdevs(NULL, &cur_dev)) { > case -1: > errx(1, "%s", devstat_errbuf); > break; > @@ -162,8 +154,8 @@ fetchiostat(void) > default: > break; > } > - num_devices = cur.dinfo->numdevs; > - generation = cur.dinfo->generation; > + num_devices = cur_dev.dinfo->numdevs; > + generation = cur_dev.dinfo->generation; > > } > > @@ -260,11 +252,11 @@ showiostat(void) > long t; > int i, row, _col; > > -#define X(fld) t = cur.fld[i]; cur.fld[i] -= last.fld[i]; last.fld[i] = t > +#define X(fld) t = cur_dev.fld[i]; cur_dev.fld[i] -= last_dev.fld[i]; last_dev.fld[i] = t > etime = 0; > for(i = 0; i < CPUSTATES; i++) { > X(cp_time); > - etime += cur.cp_time[i]; > + etime += cur_dev.cp_time[i]; > } > if (etime == 0.0) > etime = 1.0; > @@ -313,10 +305,10 @@ devstats(int row, int _col, int dn) > > di = dev_select[dn].position; > > - busy_seconds = cur.snap_time - last.snap_time; > + busy_seconds = cur_dev.snap_time - last_dev.snap_time; > > - if (devstat_compute_statistics(&cur.dinfo->devices[di], > - &last.dinfo->devices[di], busy_seconds, > + if (devstat_compute_statistics(&cur_dev.dinfo->devices[di], > + &last_dev.dinfo->devices[di], busy_seconds, > DSM_KB_PER_TRANSFER, &kb_per_transfer, > DSM_TRANSFERS_PER_SECOND, &transfers_per_second, > DSM_MB_PER_SECOND, &mb_per_second, DSM_NONE) != 0) > @@ -349,12 +341,12 @@ stat1(int row, int o) > > dtime = 0.0; > for (i = 0; i < CPUSTATES; i++) > - dtime += cur.cp_time[i]; > + dtime += cur_dev.cp_time[i]; > if (dtime == 0.0) > dtime = 1.0; > wmove(wnd, row, INSET); > #define CPUSCALE 0.5 > - histogram(100.0 * cur.cp_time[o] / dtime, 50, CPUSCALE); > + histogram(100.0 * cur_dev.cp_time[o] / dtime, 50, CPUSCALE); > } > > static void > @@ -388,7 +380,7 @@ cmdiostat(const char *cmd, const char *args) > numbers = 1; > else if (prefix(cmd, "bars")) > numbers = 0; > - else if (!dscmd(cmd, args, 100, &cur)) > + else if (!dscmd(cmd, args, 100, &cur_dev)) > return (0); > wclear(wnd); > labeliostat(); > > Modified: head/usr.bin/systat/swap.c > ============================================================================== > --- head/usr.bin/systat/swap.c Tue Apr 2 13:59:04 2019 (r345803) > +++ head/usr.bin/systat/swap.c Tue Apr 2 14:01:03 2019 (r345804) > @@ -3,6 +3,7 @@ > * > * Copyright (c) 1980, 1992, 1993 > * The Regents of the University of California. All rights reserved. > + * Copyright (c) 2017 Yoshihiro Ota > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > @@ -55,6 +56,7 @@ static const char sccsid[] = "@(#)swap.c 8.3 (Berkeley > > #include "systat.h" > #include "extern.h" > +#include "devs.h" > > kvm_t *kd; > > @@ -137,13 +139,15 @@ initswap(void) > oulen = ulen; > > once = 1; > + > + dsinit(12); > + > return (1); > } > > void > fetchswap(void) > { > - > okvnsw = kvnsw; > if ((kvnsw = kvm_getswapinfo(kd, kvmsw, NSWAP, 0)) < 0) { > error("systat: kvm_getswapinfo failed"); > @@ -153,6 +157,15 @@ fetchswap(void) > odlen = dlen; > oulen = ulen; > calclens(); > + > + struct devinfo *tmp_dinfo; > + > + tmp_dinfo = last_dev.dinfo; > + last_dev.dinfo = cur_dev.dinfo; > + cur_dev.dinfo = tmp_dinfo; > + > + last_dev.snap_time = cur_dev.snap_time; > + dsgetinfo( &cur_dev ); > } > > void > @@ -178,6 +191,7 @@ labelswap(void) > name = kvmsw[i].ksw_devname; > mvwprintw(wnd, i + 1, 0, "%*s", -dlen, name); > } > + dslabel(12, 0, 18); > } > > void > @@ -217,4 +231,5 @@ showswap(void) > waddch(wnd, 'X'); > wclrtoeol(wnd); > } > + dsshow(12, 0, 18, &cur_dev, &last_dev); > } > > Modified: head/usr.bin/systat/systat.h > ============================================================================== > --- head/usr.bin/systat/systat.h Tue Apr 2 13:59:04 2019 (r345803) > +++ head/usr.bin/systat/systat.h Tue Apr 2 14:01:03 2019 (r345804) > @@ -68,3 +68,7 @@ extern int use_kvm; > #define NVAL(indx) namelist[(indx)].n_value > #define NPTR(indx) (void *)NVAL((indx)) > #define NREAD(indx, buf, len) kvm_ckread(NPTR((indx)), (buf), (len)) > + > +extern void putint(int, int, int, int); > +extern void putfloat(double, int, int, int, int, int); > +extern void putlongdouble(long double, int, int, int, int, int); > > Modified: head/usr.bin/systat/vmstat.c > ============================================================================== > --- head/usr.bin/systat/vmstat.c Tue Apr 2 13:59:04 2019 (r345803) > +++ head/usr.bin/systat/vmstat.c Tue Apr 2 14:01:03 2019 (r345804) > @@ -66,7 +66,6 @@ static const char sccsid[] = "@(#)vmstat.c 8.2 (Berkel > #include > #include > #include > -#include > #include "systat.h" > #include "extern.h" > #include "devs.h" > @@ -125,7 +124,6 @@ static struct Info { > static u_long kmem_size; > static u_int v_page_count; > > -struct statinfo cur, last, run; > > #define total s.Total > #define nchtotal s.nchstats > @@ -137,13 +135,9 @@ enum divisor { IEC = 0, SI = HN_DIVISOR_1000 }; > static void allocinfo(struct Info *); > static void copyinfo(struct Info *, struct Info *); > static float cputime(int); > -static void dinfo(int, int, struct statinfo *, struct statinfo *); > static void do_putuint64(uint64_t, int, int, int, int); > static void getinfo(struct Info *); > -static void putint(int, int, int, int); > static void putuint64(uint64_t, int, int, int); > -static void putfloat(double, int, int, int, int, int); > -static void putlongdouble(long double, int, int, int, int, int); > static int ucount(void); > > static int ncpu; > @@ -209,18 +203,9 @@ initkre(void) > int i; > size_t sz; > > - if ((num_devices = devstat_getnumdevs(NULL)) < 0) { > - warnx("%s", devstat_errbuf); > + if (dsinit(MAXDRIVES) != 1) > return(0); > - } > > - cur.dinfo = calloc(1, sizeof(struct devinfo)); > - last.dinfo = calloc(1, sizeof(struct devinfo)); > - run.dinfo = calloc(1, sizeof(struct devinfo)); > - > - if (dsinit(MAXDRIVES, &cur, &last, &run) != 1) > - return(0); > - > if (nintr == 0) { > if (sysctlbyname("hw.intrcnt", NULL, &sz, NULL, 0) == -1) { > error("sysctl(hw.intrcnt...) failed: %s", > @@ -371,27 +356,7 @@ labelkre(void) > mvprintw(NAMEIROW, NAMEICOL, "Namei Name-cache Dir-cache"); > mvprintw(NAMEIROW + 1, NAMEICOL, > " Calls hits %% hits %%"); > - mvprintw(DISKROW, DISKCOL, "Disks"); > - mvprintw(DISKROW + 1, DISKCOL, "KB/t"); > - mvprintw(DISKROW + 2, DISKCOL, "tps"); > - mvprintw(DISKROW + 3, DISKCOL, "MB/s"); > - mvprintw(DISKROW + 4, DISKCOL, "%%busy"); > - /* > - * For now, we don't support a fourth disk statistic. So there's > - * no point in providing a label for it. If someone can think of a > - * fourth useful disk statistic, there is room to add it. > - */ > - /* mvprintw(DISKROW + 4, DISKCOL, " msps"); */ > - j = 0; > - for (i = 0; i < num_devices && j < MAXDRIVES; i++) > - if (dev_select[i].selected) { > - char tmpstr[80]; > - sprintf(tmpstr, "%s%d", dev_select[i].device_name, > - dev_select[i].unit_number); > - mvprintw(DISKROW, DISKCOL + 5 + 6 * j, > - " %5.5s", tmpstr); > - j++; > - } > + dslabel(MAXDRIVES, DISKCOL, DISKROW); > > for (i = 0; i < nintr; i++) { > if (intrloc[i] == 0) > @@ -401,7 +366,7 @@ labelkre(void) > } > > #define X(fld) {t=s.fld[i]; s.fld[i]-=s1.fld[i]; if(state==TIME) s1.fld[i]=t;} > -#define Q(fld) {t=cur.fld[i]; cur.fld[i]-=last.fld[i]; if(state==TIME) last.fld[i]=t;} > +#define Q(fld) {t=cur_dev.fld[i]; cur_dev.fld[i]-=last_dev.fld[i]; if(state==TIME) last_dev.fld[i]=t;} > #define Y(fld) {t = s.fld; s.fld -= s1.fld; if(state == TIME) s1.fld = t;} > #define Z(fld) {t = s.nchstats.fld; s.nchstats.fld -= s1.nchstats.fld; \ > if(state == TIME) s1.nchstats.fld = t;} > @@ -543,20 +508,17 @@ showkre(void) > PUTRATE(v_intr, GENSTATROW + 1, GENSTATCOL + 15, 4); > PUTRATE(v_soft, GENSTATROW + 1, GENSTATCOL + 20, 4); > PUTRATE(v_vm_faults, GENSTATROW + 1, GENSTATCOL + 25, 4); > - for (i = 0, lc = 0; i < num_devices && lc < MAXDRIVES; i++) > - if (dev_select[i].selected) { > - switch(state) { > - case TIME: > - dinfo(i, ++lc, &cur, &last); > - break; > - case RUN: > - dinfo(i, ++lc, &cur, &run); > - break; > - case BOOT: > - dinfo(i, ++lc, &cur, NULL); > - break; > - } > - } > + switch(state) { > + case TIME: > + dsshow(MAXDRIVES, DISKCOL, DISKROW, &cur_dev, &last_dev); > + break; > + case RUN: > + dsshow(MAXDRIVES, DISKCOL, DISKROW, &cur_dev, &run_dev); > + break; > + case BOOT: > + dsshow(MAXDRIVES, DISKCOL, DISKROW, &cur_dev, NULL); > + break; > + } > putint(s.numdirtybuffers, VNSTATROW, VNSTATCOL, 7); > putint(s.desiredvnodes, VNSTATROW + 1, VNSTATCOL, 7); > putint(s.numvnodes, VNSTATROW + 2, VNSTATCOL, 7); > @@ -582,14 +544,14 @@ cmdkre(const char *cmd, const char *args) > if (prefix(cmd, "run")) { > retval = 1; > copyinfo(&s2, &s1); > - switch (devstat_getdevs(NULL, &run)) { > + switch (devstat_getdevs(NULL, &run_dev)) { > case -1: > errx(1, "%s", devstat_errbuf); > break; > case 1: > - num_devices = run.dinfo->numdevs; > - generation = run.dinfo->generation; > - retval = dscmd("refresh", NULL, MAXDRIVES, &cur); > + num_devices = run_dev.dinfo->numdevs; > + generation = run_dev.dinfo->generation; > + retval = dscmd("refresh", NULL, MAXDRIVES, &cur_dev); > if (retval == 2) > labelkre(); > break; > @@ -612,14 +574,14 @@ cmdkre(const char *cmd, const char *args) > retval = 1; > if (state == RUN) { > getinfo(&s1); > - switch (devstat_getdevs(NULL, &run)) { > + switch (devstat_getdevs(NULL, &run_dev)) { > case -1: > errx(1, "%s", devstat_errbuf); > break; > case 1: > - num_devices = run.dinfo->numdevs; > - generation = run.dinfo->generation; > - retval = dscmd("refresh",NULL, MAXDRIVES, &cur); > + num_devices = run_dev.dinfo->numdevs; > + generation = run_dev.dinfo->generation; > + retval = dscmd("refresh",NULL, MAXDRIVES, &cur_dev); > if (retval == 2) > labelkre(); > break; > @@ -629,7 +591,7 @@ cmdkre(const char *cmd, const char *args) > } > return (retval); > } > - retval = dscmd(cmd, args, MAXDRIVES, &cur); > + retval = dscmd(cmd, args, MAXDRIVES, &cur_dev); > > if (retval == 2) > labelkre(); > @@ -667,7 +629,7 @@ cputime(int indx) > return (s.time[indx] * 100.0 / lt); > } > > -static void > +void > putint(int n, int l, int lc, int w) > { > > @@ -713,7 +675,7 @@ do_putuint64(uint64_t n, int l, int lc, int w, int div > addstr(b); > } > > -static void > +void > putfloat(double f, int l, int lc, int w, int d, int nz) > { > int snr; > @@ -745,7 +707,7 @@ putfloat(double f, int l, int lc, int w, int d, int nz > addstr(b); > } > > -static void > +void > putlongdouble(long double f, int l, int lc, int w, int d, int nz) > { > int snr; > @@ -785,7 +747,7 @@ getinfo(struct Info *ls) > int mib[2]; > > GETSYSCTL("kern.cp_time", ls->time); > - GETSYSCTL("kern.cp_time", cur.cp_time); > + GETSYSCTL("kern.cp_time", cur_dev.cp_time); > GETSYSCTL("vm.stats.sys.v_swtch", ls->v_swtch); > GETSYSCTL("vm.stats.sys.v_trap", ls->v_trap); > GETSYSCTL("vm.stats.sys.v_syscall", ls->v_syscall); > @@ -838,23 +800,12 @@ getinfo(struct Info *ls) > size != sizeof(ncpu)) > ncpu = 1; > > - tmp_dinfo = last.dinfo; > - last.dinfo = cur.dinfo; > - cur.dinfo = tmp_dinfo; > + tmp_dinfo = last_dev.dinfo; > + last_dev.dinfo = cur_dev.dinfo; > + cur_dev.dinfo = tmp_dinfo; > > - last.snap_time = cur.snap_time; > - switch (devstat_getdevs(NULL, &cur)) { > - case -1: > - errx(1, "%s", devstat_errbuf); > - break; > - case 1: > - num_devices = cur.dinfo->numdevs; > - generation = cur.dinfo->generation; > - cmdkre("refresh", NULL); > - break; > - default: > - break; > - } > + last_dev.snap_time = cur_dev.snap_time; > + dsgetinfo(&cur_dev); > } > > static void > @@ -880,39 +831,4 @@ copyinfo(struct Info *from, struct Info *to) > *to = *from; > > bcopy(from->intrcnt, to->intrcnt = intrcnt, nintr * sizeof (int)); > -} > - > -static void > -dinfo(int dn, int lc, struct statinfo *now, struct statinfo *then) > -{ > - long double transfers_per_second; > - long double kb_per_transfer, mb_per_second; > - long double elapsed_time, device_busy; > - int di; > - > - di = dev_select[dn].position; > - > - if (then != NULL) { > - /* Calculate relative to previous sample */ > - elapsed_time = now->snap_time - then->snap_time; > - } else { > - /* Calculate relative to device creation */ > - elapsed_time = now->snap_time - devstat_compute_etime( > - &now->dinfo->devices[di].creation_time, NULL); > - } > - > - if (devstat_compute_statistics(&now->dinfo->devices[di], then ? > - &then->dinfo->devices[di] : NULL, elapsed_time, > - DSM_KB_PER_TRANSFER, &kb_per_transfer, > - DSM_TRANSFERS_PER_SECOND, &transfers_per_second, > - DSM_MB_PER_SECOND, &mb_per_second, > - DSM_BUSY_PCT, &device_busy, > - DSM_NONE) != 0) > - errx(1, "%s", devstat_errbuf); > - > - lc = DISKCOL + lc * 6; > - putlongdouble(kb_per_transfer, DISKROW + 1, lc, 5, 2, 0); > - putlongdouble(transfers_per_second, DISKROW + 2, lc, 5, 0, 0); > - putlongdouble(mb_per_second, DISKROW + 3, lc, 5, 2, 0); > - putlongdouble(device_busy, DISKROW + 4, lc, 5, 0, 0); > } > > Modified: head/usr.bin/systat/zarc.c > ============================================================================== > --- head/usr.bin/systat/zarc.c Tue Apr 2 13:59:04 2019 (r345803) > +++ head/usr.bin/systat/zarc.c Tue Apr 2 14:01:03 2019 (r345804) > @@ -1,6 +1,5 @@ > /*- > - * Copyright (c) 2014 > - * The Regents of the University of California. All rights reserved. > + * Copyright (c) 2014 - 2017 Yoshihiro Ota > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > @@ -33,11 +32,14 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +/* #include */ > #include > #include > +#include > > #include "systat.h" > #include "extern.h" > +#include "devs.h" > > struct zfield{ > uint64_t arcstats; > @@ -77,21 +79,23 @@ closezarc(WINDOW *w) > void > labelzarc(void) > { > + int row = 1; > wmove(wnd, 0, 0); wclrtoeol(wnd); > mvwprintw(wnd, 0, 31+1, "%4.4s %7.7s %7.7s %12.12s %12.12s", > "rate", "hits", "misses", "total hits", "total misses"); > -#define L(row, str) mvwprintw(wnd, row, 5, str); \ > +#define L(str) mvwprintw(wnd, row, 5, #str); \ > mvwprintw(wnd, row, 31, ":"); \ > - mvwprintw(wnd, row, 31+4, "%%") > - L(1, "arcstats"); > - L(2, "arcstats.demand_data"); > - L(3, "arcstats.demand_metadata"); > - L(4, "arcstats.prefetch_data"); > - L(5, "arcstats.prefetch_metadata"); > - L(6, "zfetchstats"); > - L(7, "arcstats.l2"); > - L(8, "vdev_cache_stats"); > + mvwprintw(wnd, row, 31+4, "%%"); ++row > + L(arcstats); > + L(arcstats.demand_data); > + L(arcstats.demand_metadata); > + L(arcstats.prefetch_data); > + L(arcstats.prefetch_metadata); > + L(zfetchstats); > + L(arcstats.l2); > + L(vdev_cache_stats); > #undef L > + dslabel(12, 0, 18); > } > > static int calc(uint64_t hits, uint64_t misses) > @@ -131,6 +135,7 @@ domode(struct zarcstats *delta, struct zarcstats *rate > void > showzarc(void) > { > + int row = 1; > struct zarcstats delta, rate; > > memset(&delta, 0, sizeof delta); > @@ -138,34 +143,37 @@ showzarc(void) > > domode(&delta, &rate); > > -#define DO(stat, row, col, fmt) \ > +#define DO(stat, col, fmt) \ > mvwprintw(wnd, row, col, fmt, stat) > -#define R(row, stat) DO(rate.hits.stat, row, 31+1, "%3"PRIu64) > -#define H(row, stat) DO(delta.hits.stat, row, 31+1+5, "%7"PRIu64); \ > - DO(curstat.hits.stat, row, 31+1+5+8+8, "%12"PRIu64) > -#define M(row, stat) DO(delta.misses.stat, row, 31+1+5+8, "%7"PRIu64); \ > - DO(curstat.misses.stat, row, 31+1+5+8+8+13, "%12"PRIu64) > -#define E(row, stat) R(row, stat); H(row, stat); M(row, stat); > - E(1, arcstats); > - E(2, arcstats_demand_data); > - E(3, arcstats_demand_metadata); > - E(4, arcstats_prefetch_data); > - E(5, arcstats_prefetch_metadata); > - E(6, zfetchstats); > - E(7, arcstats_l2); > - E(8, vdev_cache_stats); > +#define R(stat) DO(rate.hits.stat, 31+1, "%3"PRIu64) > +#define H(stat) DO(delta.hits.stat, 31+1+5, "%7"PRIu64); \ > + DO(curstat.hits.stat, 31+1+5+8+8, "%12"PRIu64) > +#define M(stat) DO(delta.misses.stat, 31+1+5+8, "%7"PRIu64); \ > + DO(curstat.misses.stat, 31+1+5+8+8+13, "%12"PRIu64) > +#define E(stat) R(stat); H(stat); M(stat); ++row > + E(arcstats); > + E(arcstats_demand_data); > + E(arcstats_demand_metadata); > + E(arcstats_prefetch_data); > + E(arcstats_prefetch_metadata); > + E(zfetchstats); > + E(arcstats_l2); > + E(vdev_cache_stats); > #undef DO > #undef E > #undef M > #undef H > #undef R > + dsshow(12, 0, 18, &cur_dev, &last_dev); > } > > int > initzarc(void) > { > + dsinit(12); > getinfo(&initstat); > curstat = oldstat = initstat; > + > return 1; > } > > @@ -178,6 +186,15 @@ resetzarc(void) > static void > getinfo(struct zarcstats *ls) > { > + struct devinfo *tmp_dinfo; > + > + tmp_dinfo = last_dev.dinfo; > + last_dev.dinfo = cur_dev.dinfo; > + cur_dev.dinfo = tmp_dinfo; > + > + last_dev.snap_time = cur_dev.snap_time; > + dsgetinfo( &cur_dev ); > + > size_t size = sizeof( ls->hits.arcstats ); > if ( sysctlbyname("kstat.zfs.misc.arcstats.hits", > &ls->hits.arcstats, &size, NULL, 0 ) != 0 ) > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F128DC2CE; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yz67Z2z4P9G; Tue, 3 Sep 2019 14:06:03 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id E1F591A08C; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D38301D8E; Tue, 2 Apr 2019 13:49:37 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BA6B8D2F4; Tue, 2 Apr 2019 13:49:37 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 108A51D39; Tue, 2 Apr 2019 13:49:37 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 15B421D2F for ; Tue, 2 Apr 2019 13:49:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D97FF8D2DF; Tue, 2 Apr 2019 13:49:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B052C26D6C; Tue, 2 Apr 2019 13:49:33 +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 x32DnXSq084934; Tue, 2 Apr 2019 13:49:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x32DnWe0084928; Tue, 2 Apr 2019 13:49:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904021349.x32DnWe0084928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345800 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 345800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3BA6B8D2F4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:10 -0000 X-Original-Date: Tue, 2 Apr 2019 13:49:32 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:10 -0000 Author: kib Date: Tue Apr 2 13:49:32 2019 New Revision: 345800 URL: https://svnweb.freebsd.org/changeset/base/345800 Log: tmpfs: ignore tmpfs_set_status() if mount point is read-only. In particular, this fixes atimes still changing for ro tmpfs. tmpfs_set_status() gains tmpfs_mount * argument. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19737 Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_fifoops.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Tue Apr 2 13:41:26 2019 (r345799) +++ head/sys/fs/tmpfs/tmpfs.h Tue Apr 2 13:49:32 2019 (r345800) @@ -437,8 +437,8 @@ void tmpfs_dir_destroy(struct tmpfs_mount *, struct tm struct tmpfs_dirent * tmpfs_dir_lookup(struct tmpfs_node *node, struct tmpfs_node *f, struct componentname *cnp); -int tmpfs_dir_getdents(struct tmpfs_node *, struct uio *, int, - u_long *, int *); +int tmpfs_dir_getdents(struct tmpfs_mount *, struct tmpfs_node *, + struct uio *, int, u_long *, int *); int tmpfs_dir_whiteout_add(struct vnode *, struct componentname *); void tmpfs_dir_whiteout_remove(struct vnode *, struct componentname *); int tmpfs_reg_resize(struct vnode *, off_t, boolean_t); @@ -452,7 +452,8 @@ int tmpfs_chtimes(struct vnode *, struct vattr *, stru void tmpfs_itimes(struct vnode *, const struct timespec *, const struct timespec *); -void tmpfs_set_status(struct tmpfs_node *node, int status); +void tmpfs_set_status(struct tmpfs_mount *tm, struct tmpfs_node *node, + int status); void tmpfs_update(struct vnode *); int tmpfs_truncate(struct vnode *, off_t); struct tmpfs_dirent *tmpfs_dir_first(struct tmpfs_node *dnode, Modified: head/sys/fs/tmpfs/tmpfs_fifoops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_fifoops.c Tue Apr 2 13:41:26 2019 (r345799) +++ head/sys/fs/tmpfs/tmpfs_fifoops.c Tue Apr 2 13:49:32 2019 (r345800) @@ -56,7 +56,8 @@ tmpfs_fifo_close(struct vop_close_args *v) struct tmpfs_node *node; node = VP_TO_TMPFS_NODE(v->a_vp); - tmpfs_set_status(node, TMPFS_NODE_ACCESSED); + tmpfs_set_status(VFS_TO_TMPFS(v->a_vp->v_mount), node, + TMPFS_NODE_ACCESSED); tmpfs_update(v->a_vp); return (fifo_specops.vop_close(v)); } Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Tue Apr 2 13:41:26 2019 (r345799) +++ head/sys/fs/tmpfs/tmpfs_subr.c Tue Apr 2 13:49:32 2019 (r345800) @@ -1110,7 +1110,8 @@ tmpfs_dir_destroy(struct tmpfs_mount *tmp, struct tmpf * error happens. */ static int -tmpfs_dir_getdotdent(struct tmpfs_node *node, struct uio *uio) +tmpfs_dir_getdotdent(struct tmpfs_mount *tm, struct tmpfs_node *node, + struct uio *uio) { int error; struct dirent dent; @@ -1130,7 +1131,7 @@ tmpfs_dir_getdotdent(struct tmpfs_node *node, struct u else error = uiomove(&dent, dent.d_reclen, uio); - tmpfs_set_status(node, TMPFS_NODE_ACCESSED); + tmpfs_set_status(tm, node, TMPFS_NODE_ACCESSED); return (error); } @@ -1143,7 +1144,8 @@ tmpfs_dir_getdotdent(struct tmpfs_node *node, struct u * error happens. */ static int -tmpfs_dir_getdotdotdent(struct tmpfs_node *node, struct uio *uio) +tmpfs_dir_getdotdotdent(struct tmpfs_mount *tm, struct tmpfs_node *node, + struct uio *uio) { int error; struct dirent dent; @@ -1174,7 +1176,7 @@ tmpfs_dir_getdotdotdent(struct tmpfs_node *node, struc else error = uiomove(&dent, dent.d_reclen, uio); - tmpfs_set_status(node, TMPFS_NODE_ACCESSED); + tmpfs_set_status(tm, node, TMPFS_NODE_ACCESSED); return (error); } @@ -1187,8 +1189,8 @@ tmpfs_dir_getdotdotdent(struct tmpfs_node *node, struc * error code if another error happens. */ int -tmpfs_dir_getdents(struct tmpfs_node *node, struct uio *uio, int maxcookies, - u_long *cookies, int *ncookies) +tmpfs_dir_getdents(struct tmpfs_mount *tm, struct tmpfs_node *node, + struct uio *uio, int maxcookies, u_long *cookies, int *ncookies) { struct tmpfs_dir_cursor dc; struct tmpfs_dirent *de; @@ -1209,7 +1211,7 @@ tmpfs_dir_getdents(struct tmpfs_node *node, struct uio */ switch (uio->uio_offset) { case TMPFS_DIRCOOKIE_DOT: - error = tmpfs_dir_getdotdent(node, uio); + error = tmpfs_dir_getdotdent(tm, node, uio); if (error != 0) return (error); uio->uio_offset = TMPFS_DIRCOOKIE_DOTDOT; @@ -1217,7 +1219,7 @@ tmpfs_dir_getdents(struct tmpfs_node *node, struct uio cookies[(*ncookies)++] = off = uio->uio_offset; /* FALLTHROUGH */ case TMPFS_DIRCOOKIE_DOTDOT: - error = tmpfs_dir_getdotdotdent(node, uio); + error = tmpfs_dir_getdotdotdent(tm, node, uio); if (error != 0) return (error); de = tmpfs_dir_first(node, &dc); @@ -1319,7 +1321,7 @@ tmpfs_dir_getdents(struct tmpfs_node *node, struct uio node->tn_dir.tn_readdir_lastn = off; node->tn_dir.tn_readdir_lastp = de; - tmpfs_set_status(node, TMPFS_NODE_ACCESSED); + tmpfs_set_status(tm, node, TMPFS_NODE_ACCESSED); return error; } @@ -1774,10 +1776,10 @@ tmpfs_chtimes(struct vnode *vp, struct vattr *vap, } void -tmpfs_set_status(struct tmpfs_node *node, int status) +tmpfs_set_status(struct tmpfs_mount *tm, struct tmpfs_node *node, int status) { - if ((node->tn_status & status) == status) + if ((node->tn_status & status) == status || tm->tm_ronly) return; TMPFS_NODE_LOCK(node); node->tn_status |= status; Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Apr 2 13:41:26 2019 (r345799) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Tue Apr 2 13:49:32 2019 (r345800) @@ -481,7 +481,7 @@ tmpfs_read(struct vop_read_args *v) if (uio->uio_offset < 0) return (EINVAL); node = VP_TO_TMPFS_NODE(vp); - tmpfs_set_status(node, TMPFS_NODE_ACCESSED); + tmpfs_set_status(VFS_TO_TMPFS(vp->v_mount), node, TMPFS_NODE_ACCESSED); return (uiomove_object(node->tn_reg.tn_aobj, node->tn_size, uio)); } @@ -1188,25 +1188,30 @@ tmpfs_symlink(struct vop_symlink_args *v) } static int -tmpfs_readdir(struct vop_readdir_args *v) +tmpfs_readdir(struct vop_readdir_args *va) { - struct vnode *vp = v->a_vp; - struct uio *uio = v->a_uio; - int *eofflag = v->a_eofflag; - u_long **cookies = v->a_cookies; - int *ncookies = v->a_ncookies; - - int error; - ssize_t startresid; - int maxcookies; + struct vnode *vp; + struct uio *uio; + struct tmpfs_mount *tm; struct tmpfs_node *node; + u_long **cookies; + int *eofflag, *ncookies; + ssize_t startresid; + int error, maxcookies; + vp = va->a_vp; + uio = va->a_uio; + eofflag = va->a_eofflag; + cookies = va->a_cookies; + ncookies = va->a_ncookies; + /* This operation only makes sense on directory nodes. */ if (vp->v_type != VDIR) return ENOTDIR; maxcookies = 0; node = VP_TO_TMPFS_DIR(vp); + tm = VFS_TO_TMPFS(vp->v_mount); startresid = uio->uio_resid; @@ -1220,9 +1225,9 @@ tmpfs_readdir(struct vop_readdir_args *v) } if (cookies == NULL) - error = tmpfs_dir_getdents(node, uio, 0, NULL, NULL); + error = tmpfs_dir_getdents(tm, node, uio, 0, NULL, NULL); else - error = tmpfs_dir_getdents(node, uio, maxcookies, *cookies, + error = tmpfs_dir_getdents(tm, node, uio, maxcookies, *cookies, ncookies); /* Buffer was filled without hitting EOF. */ @@ -1258,7 +1263,7 @@ tmpfs_readlink(struct vop_readlink_args *v) error = uiomove(node->tn_link, MIN(node->tn_size, uio->uio_resid), uio); - tmpfs_set_status(node, TMPFS_NODE_ACCESSED); + tmpfs_set_status(VFS_TO_TMPFS(vp->v_mount), node, TMPFS_NODE_ACCESSED); return (error); } From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70EEADC2D0; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yz5BMtz4P8Z; Tue, 3 Sep 2019 14:06:03 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 7F1881A060; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 9266D1AFF2; Tue, 2 Apr 2019 04:03:02 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4078E70DC1; Tue, 2 Apr 2019 04:03:02 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 287311AFF1; Tue, 2 Apr 2019 04:03:02 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 16D061AFEF for ; Tue, 2 Apr 2019 04:02:59 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1BD570DBE; Tue, 2 Apr 2019 04:02:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F445209F5; Tue, 2 Apr 2019 04:02:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3242wir081561; Tue, 2 Apr 2019 04:02:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3242woQ081560; Tue, 2 Apr 2019 04:02:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904020402.x3242woQ081560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345790 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 345790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 4078E70DC1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:11 -0000 X-Original-Date: Tue, 2 Apr 2019 04:02:58 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:11 -0000 Author: jhibbits Date: Tue Apr 2 04:02:57 2019 New Revision: 345790 URL: https://svnweb.freebsd.org/changeset/base/345790 Log: powernv: Port OPAL asynchronous framework to use the new message framework Since OPAL_GET_MSG does not discriminate between message types, asynchronous completion events may be received in the OPAL_GET_MSG call, which dequeues them from the list, thus preventing OPAL_CHECK_ASYNC_COMPLETION from succeeding. Handle this case by integrating with the messaging framework. Modified: head/sys/powerpc/powernv/opal_async.c Modified: head/sys/powerpc/powernv/opal_async.c ============================================================================== --- head/sys/powerpc/powernv/opal_async.c Tue Apr 2 04:00:01 2019 (r345789) +++ head/sys/powerpc/powernv/opal_async.c Tue Apr 2 04:02:57 2019 (r345790) @@ -35,6 +35,8 @@ #include #include "opal.h" +#include + /* * Manage asynchronous tokens for the OPAL abstraction layer. * @@ -45,6 +47,15 @@ */ static vmem_t *async_token_pool; +static void opal_handle_async_completion(void *, struct opal_msg *); + +struct async_completion { + uint64_t rval; + bool completed; +}; + +struct async_completion *completions; + /* Setup the token pool. */ int opal_init_async_tokens(int count) @@ -55,7 +66,12 @@ opal_init_async_tokens(int count) async_token_pool = vmem_create("OPAL Async", 0, count, 1, 1, M_WAITOK | M_FIRSTFIT); + completions = malloc(count * sizeof(struct async_completion), + M_DEVBUF, M_WAITOK | M_ZERO); + EVENTHANDLER_REGISTER(OPAL_ASYNC_COMP, opal_handle_async_completion, + NULL, EVENTHANDLER_PRI_ANY); + return (0); } @@ -65,6 +81,7 @@ opal_alloc_async_token(void) vmem_addr_t token; vmem_alloc(async_token_pool, 1, M_FIRSTFIT | M_WAITOK, &token); + completions[token].completed = false; return (token); } @@ -88,7 +105,20 @@ opal_wait_completion(void *buf, uint64_t size, uint64_ do { err = opal_call(OPAL_CHECK_ASYNC_COMPLETION, vtophys(buf), size, token); + if (err == OPAL_BUSY) + if (completions[token].completed) + return (completions[token].rval); } while (err == OPAL_BUSY); return (err); +} + +static void opal_handle_async_completion(void *arg, struct opal_msg *msg) +{ + int token; + + token = msg->params[0]; + completions[token].rval = msg->params[1]; + isync(); + completions[token].completed = true; } From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5840CDC30F; Tue, 3 Sep 2019 14:06:05 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z01k5qz4P9K; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 28C561A0B4; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C9A0B4657; Tue, 2 Apr 2019 16:43:48 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3616E6CDFD; Tue, 2 Apr 2019 16:43:48 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0EFB94640; Tue, 2 Apr 2019 16:43:48 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 577F9463D; Tue, 2 Apr 2019 16:43:45 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3C4A6CDF8; Tue, 2 Apr 2019 16:43:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x62e.google.com with SMTP id b65so6545229plb.6; Tue, 02 Apr 2019 09:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FwFRc1sFMTLcvAX8/iIRPvWp8m8kbm8OLl/pgECRbHY=; b=iUEoSJEwSNIGia+36XL1KpMBKJPU9vO2gKtNuncvW4JRtZ4fH31oMcGke4iFjdFPd/ SHlzB87BnMAac+KxWlnZxf4UrKM1MACl6apOVxrQevWQX8hKWAFTILs80401k/tdDese +yzcKM/Q2ge/wwulO1UItUJi83vsXR9ptDwE7LGkQou1Hi4NILnDkxrF6VhAcEmpvYNs T1pd/8wKVUT50HmB1Guws2ZjZXNrqryTBb4yQCiVLoT8c8zWcm9qqIIGRdGILMqxFOif D3ZFfFDxqPZD6BZ29mgTxEzO9TI7ZYB1ykHge9o33W5MbpB6UsV8PYRRJFnxRSLyMwIj j0Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FwFRc1sFMTLcvAX8/iIRPvWp8m8kbm8OLl/pgECRbHY=; b=qbyA+hnZUA5mTYyS5hJ1D4MSb6+zi3a1T0TcE40oWgMzpXzeRu5c5IqUaPT6CMqpYY mZvApExUH25XzvNVmadL0bH+co3jaCTmptHMEJuIJYTb8Dhg9mqSiCnTQI9yra3BkWi1 j8VAvD/Xe1bYiC//73bZnUBFlVGoFDoTVlBu0rQVNBtUJe37/H5FcOEbq9aM6fzO9YGg jcM+iUSVUWAddIuIGUlgFd2UYdrv05dtXJAaleyu5PXUWQBWcJWmdEBKA0J26CAn7PCH Ff8Gfy2VInbg5FbL2oCN6HHgGvKz09pwwB0cTNRMFuvBnsX2a9MZAGuqCUCmzo2Ta/Ub z+Rw== X-Gm-Message-State: APjAAAUJK3I6lHC8AclED9mDOtRJEsdeobpXrAxfV9Jq+vihuz5/PY93 cGGQpYd2qSQBFd1Uz4r8qCxOdCSY X-Google-Smtp-Source: APXvYqzXg8Q79LGNiFkW0QlNvrvgPKwbPk28JclRnfK1Eiw9FdRDpcUfjfC0XxAhSwjI0jYWc+niHw== X-Received: by 2002:a17:902:e391:: with SMTP id ch17mr12235729plb.196.1554223423451; Tue, 02 Apr 2019 09:43:43 -0700 (PDT) Received: from ?IPv6:2607:fb90:837c:f605:f5ef:10c5:4773:983b? ([2607:fb90:837c:f605:f5ef:10c5:4773:983b]) by smtp.gmail.com with ESMTPSA id k131sm22742165pfc.183.2019.04.02.09.43.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Apr 2019 09:43:42 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r345805 - head/sys/cam From: Enji Cooper X-Mailer: iPhone Mail (16E227) In-Reply-To: <201904021446.x32EkBM7016545@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201904021446.x32EkBM7016545@repo.freebsd.org> To: Alexander Motin Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3616E6CDFD X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:11 -0000 X-Original-Date: Tue, 2 Apr 2019 09:43:40 -0700 X-List-Received-Date: Tue, 03 Sep 2019 14:06:11 -0000 Hi Alexander, > On Apr 2, 2019, at 07:46, Alexander Motin wrote: >=20 > Author: mav > Date: Tue Apr 2 14:46:10 2019 > New Revision: 345805 > URL: https://svnweb.freebsd.org/changeset/base/345805 >=20 > Log: > Unify SCSI_STATUS_BUSY retry handling with other cases. >=20 > - Do not retry if periph was invalidated. > - Do not decrement retry_count if already zero. > - Report action_string when applicable. >=20 > MFC after: 2 weeks >=20 > Modified: > head/sys/cam/cam_periph.c >=20 > Modified: head/sys/cam/cam_periph.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/sys/cam/cam_periph.c Tue Apr 2 14:01:03 2019 (r345804) > +++ head/sys/cam/cam_periph.c Tue Apr 2 14:46:10 2019 (r345805) > @@ -1513,6 +1513,7 @@ camperiphscsistatuserror(union ccb *ccb, union ccb *= *o > int *openings, u_int32_t *relsim_flags, > u_int32_t *timeout, u_int32_t *action, const char **action_string) > { > + struct cam_periph *periph; > int error; >=20 > switch (ccb->csio.scsi_status) { > @@ -1595,14 +1596,21 @@ camperiphscsistatuserror(union ccb *ccb, union ccb= **o > * Restart the queue after either another > * command completes or a 1 second timeout. > */ > - if ((sense_flags & SF_RETRY_BUSY) !=3D 0 || > - (ccb->ccb_h.retry_count--) > 0) { > + periph =3D xpt_path_periph(ccb->ccb_h.path); > + if (periph->flags & CAM_PERIPH_INVALID) { Is there a reason why this style is inconsistent with the other part of the c= hange by not explicitly testing for =E2=80=9C!=3D 0=E2=80=9D? Thanks! -Enji= From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37657DC169; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv0pmCz4P3n; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 1892619F01; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 1DC23852A; Sat, 30 Mar 2019 17:23:18 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D43D96B403; Sat, 30 Mar 2019 17:23:16 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 9F3C284C2; Sat, 30 Mar 2019 17:23:16 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 8AE7F84C0 for ; Sat, 30 Mar 2019 17:23:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4262C6B3FE; Sat, 30 Mar 2019 17:23:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D77D1A0AE; Sat, 30 Mar 2019 17:23:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2UHNFUV008513; Sat, 30 Mar 2019 17:23:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2UHNFP7008512; Sat, 30 Mar 2019 17:23:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201903301723.x2UHNFP7008512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345735 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 345735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: D43D96B403 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:05 -0000 X-Original-Date: Sat, 30 Mar 2019 17:23:15 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:05 -0000 Author: ngie Date: Sat Mar 30 17:23:15 2019 New Revision: 345735 URL: https://svnweb.freebsd.org/changeset/base/345735 Log: Allow programs to set `NO_SHARED` on a per-PROG basis This is particularly useful when installing programs for tests that need to be linked statically, e.g., mini-me from capsicum-test, which is linked statically to avoid the dynamic library lookup in the upstream project. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19756 Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Sat Mar 30 16:58:51 2019 (r345734) +++ head/share/mk/bsd.progs.mk Sat Mar 30 17:23:15 2019 (r345735) @@ -23,7 +23,7 @@ PROGS += ${PROGS_CXX} .if defined(PROG) # just one of many PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE CSTD CXXSTD DPSRCS MAN \ - NO_WERROR PROGNAME SRCS STRIP WARNS + NO_SHARED NO_WERROR PROGNAME SRCS STRIP WARNS PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD INTERNALPROG LDADD LIBADD \ LINKS LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DB37DC311; Tue, 3 Sep 2019 14:06:05 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z02zWxz4P9r; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 641301A0D0; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 098A170FF; Tue, 2 Apr 2019 18:50:57 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6772C72110; Tue, 2 Apr 2019 18:50:56 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0E6067096; Tue, 2 Apr 2019 18:50:56 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 3D20D708B for ; Tue, 2 Apr 2019 18:50:53 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF077720E7; Tue, 2 Apr 2019 18:50:52 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB48121F0; Tue, 2 Apr 2019 18:50:49 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x32IonAV041954; Tue, 2 Apr 2019 18:50:49 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x32Iondm041953; Tue, 2 Apr 2019 18:50:49 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201904021850.x32Iondm041953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345811 - head/sys/x86/iommu X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: head/sys/x86/iommu X-SVN-Commit-Revision: 345811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 6772C72110 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:11 -0000 X-Original-Date: Tue, 2 Apr 2019 18:50:49 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:11 -0000 Author: tychon Date: Tue Apr 2 18:50:49 2019 New Revision: 345811 URL: https://svnweb.freebsd.org/changeset/base/345811 Log: DMAR driver assumes all physical addresses are backed by a fully initialized struct vm_page. Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19753 Modified: head/sys/x86/iommu/busdma_dmar.c Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Tue Apr 2 18:50:33 2019 (r345810) +++ head/sys/x86/iommu/busdma_dmar.c Tue Apr 2 18:50:49 2019 (r345811) @@ -665,9 +665,9 @@ dmar_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmam { struct bus_dma_tag_dmar *tag; struct bus_dmamap_dmar *map; - vm_page_t *ma; - vm_paddr_t pstart, pend; - int error, i, ma_cnt, offset; + vm_page_t *ma, fma; + vm_paddr_t pstart, pend, paddr; + int error, i, ma_cnt, mflags, offset; tag = (struct bus_dma_tag_dmar *)dmat; map = (struct bus_dmamap_dmar *)map1; @@ -675,14 +675,36 @@ dmar_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmam pend = round_page(buf + buflen); offset = buf & PAGE_MASK; ma_cnt = OFF_TO_IDX(pend - pstart); - ma = malloc(sizeof(vm_page_t) * ma_cnt, M_DEVBUF, map->cansleep ? - M_WAITOK : M_NOWAIT); + mflags = map->cansleep ? M_WAITOK : M_NOWAIT; + ma = malloc(sizeof(vm_page_t) * ma_cnt, M_DEVBUF, mflags); if (ma == NULL) return (ENOMEM); - for (i = 0; i < ma_cnt; i++) - ma[i] = PHYS_TO_VM_PAGE(pstart + i * PAGE_SIZE); + fma = NULL; + for (i = 0; i < ma_cnt; i++) { + paddr = pstart + i * PAGE_SIZE; + ma[i] = PHYS_TO_VM_PAGE(paddr); + if (ma[i] == NULL || VM_PAGE_TO_PHYS(ma[i]) != paddr) { + /* + * If PHYS_TO_VM_PAGE() returned NULL or the + * vm_page was not initialized we'll use a + * fake page. + */ + if (fma == NULL) { + fma = malloc(sizeof(struct vm_page) * ma_cnt, + M_DEVBUF, mflags); + if (fma == NULL) { + free(ma, M_DEVBUF); + return (ENOMEM); + } + } + vm_page_initfake(&fma[i], pstart + i * PAGE_SIZE, + VM_MEMATTR_DEFAULT); + ma[i] = &fma[i]; + } + } error = dmar_bus_dmamap_load_something(tag, map, ma, offset, buflen, flags, segs, segp); + free(fma, M_DEVBUF); free(ma, M_DEVBUF); return (error); } @@ -696,7 +718,7 @@ dmar_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dm struct bus_dmamap_dmar *map; vm_page_t *ma, fma; vm_paddr_t pstart, pend, paddr; - int error, i, ma_cnt, offset; + int error, i, ma_cnt, mflags, offset; tag = (struct bus_dma_tag_dmar *)dmat; map = (struct bus_dmamap_dmar *)map1; @@ -704,41 +726,33 @@ dmar_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dm pend = round_page((vm_offset_t)buf + buflen); offset = (vm_offset_t)buf & PAGE_MASK; ma_cnt = OFF_TO_IDX(pend - pstart); - ma = malloc(sizeof(vm_page_t) * ma_cnt, M_DEVBUF, map->cansleep ? - M_WAITOK : M_NOWAIT); + mflags = map->cansleep ? M_WAITOK : M_NOWAIT; + ma = malloc(sizeof(vm_page_t) * ma_cnt, M_DEVBUF, mflags); if (ma == NULL) return (ENOMEM); - if (dumping) { - /* - * If dumping, do not attempt to call - * PHYS_TO_VM_PAGE() at all. It may return non-NULL - * but the vm_page returned might be not initialized, - * e.g. for the kernel itself. - */ - KASSERT(pmap == kernel_pmap, ("non-kernel address write")); - fma = malloc(sizeof(struct vm_page) * ma_cnt, M_DEVBUF, - M_ZERO | (map->cansleep ? M_WAITOK : M_NOWAIT)); - if (fma == NULL) { - free(ma, M_DEVBUF); - return (ENOMEM); - } - for (i = 0; i < ma_cnt; i++, pstart += PAGE_SIZE) { + fma = NULL; + for (i = 0; i < ma_cnt; i++, pstart += PAGE_SIZE) { + if (pmap == kernel_pmap) paddr = pmap_kextract(pstart); + else + paddr = pmap_extract(pmap, pstart); + ma[i] = PHYS_TO_VM_PAGE(paddr); + if (ma[i] == NULL || VM_PAGE_TO_PHYS(ma[i]) != paddr) { + /* + * If PHYS_TO_VM_PAGE() returned NULL or the + * vm_page was not initialized we'll use a + * fake page. + */ + if (fma == NULL) { + fma = malloc(sizeof(struct vm_page) * ma_cnt, + M_DEVBUF, mflags); + if (fma == NULL) { + free(ma, M_DEVBUF); + return (ENOMEM); + } + } vm_page_initfake(&fma[i], paddr, VM_MEMATTR_DEFAULT); ma[i] = &fma[i]; - } - } else { - fma = NULL; - for (i = 0; i < ma_cnt; i++, pstart += PAGE_SIZE) { - if (pmap == kernel_pmap) - paddr = pmap_kextract(pstart); - else - paddr = pmap_extract(pmap, pstart); - ma[i] = PHYS_TO_VM_PAGE(paddr); - KASSERT(VM_PAGE_TO_PHYS(ma[i]) == paddr, - ("PHYS_TO_VM_PAGE failed %jx %jx m %p", - (uintmax_t)paddr, (uintmax_t)VM_PAGE_TO_PHYS(ma[i]), - ma[i])); } } error = dmar_bus_dmamap_load_something(tag, map, ma, offset, buflen, From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 255E9DC267; Tue, 3 Sep 2019 14:06:03 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yy1zjJz4P7b; Tue, 3 Sep 2019 14:06:02 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 2E8241A036; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D1D24154F9; Mon, 1 Apr 2019 21:24:54 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B26A8AA0F; Mon, 1 Apr 2019 21:24:54 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1BD27154DE; Mon, 1 Apr 2019 21:24:54 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id B0A09154DC for ; Mon, 1 Apr 2019 21:24:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 834458AA0A; Mon, 1 Apr 2019 21:24:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 503291C481; Mon, 1 Apr 2019 21:24:51 +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 x31LOp4w071267; Mon, 1 Apr 2019 21:24:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x31LOoVg071263; Mon, 1 Apr 2019 21:24:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904012124.x31LOoVg071263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345783 - in head: contrib/capsicum-test tests/sys/capsicum X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: contrib/capsicum-test tests/sys/capsicum X-SVN-Commit-Revision: 345783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3B26A8AA0F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:08 -0000 X-Original-Date: Mon, 1 Apr 2019 21:24:50 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:08 -0000 Author: ngie Date: Mon Apr 1 21:24:50 2019 New Revision: 345783 URL: https://svnweb.freebsd.org/changeset/base/345783 Log: Integrate capsicum-test into the FreeBSD test suite This change takes capsicum-test from upstream and applies some local changes to make the tests work on FreeBSD when executed via Kyua. The local modifications are as follows: 1. Make `OpenatTest.WithFlag` pass with the new dot-dot lookup behavior in FreeBSD 12.x+. 2. capsicum-test references a set of helper binaries: `mini-me`, `mini-me.noexec`, and `mini-me.setuid`, as part of the execve/fexecve tests, via execve, fexecve, and open. It achieves this upstream by assuming `mini-me*` is in the current directory, however, in order for Kyua to execute `capsicum-test`, it needs to provide a full path to `mini-me*`. In order to achieve this, I made `capsicum-test` cache the executable's path from argv[0] in main(..) and use the cached value to compute the path to `mini-me*` as part of the execve/fexecve testcases. 3. The capsicum-test test suite assumes that it's always being run on CAPABILITIES enabled kernels. However, there's a chance that the test will be run on a host without a CAPABILITIES enabled kernel, so we must check for the support before running the tests. The way to achieve this is to add the relevant `feature_present("security_capabilities")` check to SetupEnvironment::SetUp() and skip the tests when the support is not available. While here, add a check for `kern.trap_enotcap` being enabled. As noted by markj@ in https://github.com/google/capsicum-test/issues/23, this sysctl being enabled can trigger non-deterministic failures. Therefore, the tests should be skipped if this sysctl is enabled. All local changes have been submitted to the capsicum-test project (https://github.com/google/capsicum-test) and are in various stages of review. Please see the following pull requests for more details: 1. https://github.com/google/capsicum-test/pull/35 2. https://github.com/google/capsicum-test/pull/41 3. https://github.com/google/capsicum-test/pull/42 Reviewed by: asomers Discussed with: emaste, markj Approved by: emaste (mentor) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D19758 Added: head/contrib/capsicum-test/ - copied from r345782, vendor/google/capsicum-test/dist/ Modified: head/contrib/capsicum-test/capsicum-test-main.cc head/contrib/capsicum-test/capsicum.h head/contrib/capsicum-test/fexecve.cc head/contrib/capsicum-test/openat.cc head/tests/sys/capsicum/Makefile Modified: head/contrib/capsicum-test/capsicum-test-main.cc ============================================================================== --- vendor/google/capsicum-test/dist/capsicum-test-main.cc Mon Apr 1 21:04:13 2019 (r345782) +++ head/contrib/capsicum-test/capsicum-test-main.cc Mon Apr 1 21:24:50 2019 (r345783) @@ -2,16 +2,25 @@ #ifdef __linux__ #include #include +#elif defined(__FreeBSD__) +#include #endif #include #include +#include #include #include #include +#include #include #include "gtest/gtest.h" #include "capsicum-test.h" +// For versions of googletest that lack GTEST_SKIP. +#ifndef GTEST_SKIP +#define GTEST_SKIP GTEST_FAIL +#endif + std::string tmpdir; class SetupEnvironment : public ::testing::Environment @@ -19,6 +28,7 @@ class SetupEnvironment : public ::testing::Environment public: SetupEnvironment() : teardown_tmpdir_(false) {} void SetUp() override { + CheckCapsicumSupport(); if (tmpdir.empty()) { std::cerr << "Generating temporary directory root: "; CreateTemporaryRoot(); @@ -27,6 +37,31 @@ class SetupEnvironment : public ::testing::Environment } std::cerr << tmpdir << std::endl; } + void CheckCapsicumSupport() { +#ifdef __FreeBSD__ + int rc; + bool trap_enotcap_enabled; + size_t trap_enotcap_enabled_len = sizeof(trap_enotcap_enabled); + + if (feature_present("security_capabilities") == 0) { + GTEST_SKIP() << "Skipping tests because capsicum support is not " + << "enabled in the kernel."; + } + // If this OID is enabled, it will send SIGTRAP to the process when + // `ENOTCAPABLE` is returned. + const char *oid = "kern.trap_enotcap"; + rc = sysctlbyname(oid, &trap_enotcap_enabled, &trap_enotcap_enabled_len, + nullptr, 0); + if (rc != 0) { + GTEST_FAIL() << "sysctlbyname failed: " << strerror(errno); + } + if (trap_enotcap_enabled) { + GTEST_SKIP() << "Debug sysctl, " << oid << ", enabled. " + << "Skipping tests because its enablement invalidates the " + << "test results."; + } +#endif /* FreeBSD */ + } void CreateTemporaryRoot() { char *tmpdir_name = tempnam(nullptr, "cptst"); @@ -47,7 +82,27 @@ class SetupEnvironment : public ::testing::Environment bool teardown_tmpdir_; }; +std::string capsicum_test_bindir; + int main(int argc, char* argv[]) { + // Set up the test program path, so capsicum-test can find programs, like + // mini-me* when executed from an absolute path. + { + char *new_path, *old_path, *program_name; + + program_name = strdup(argv[0]); + assert(program_name); + capsicum_test_bindir = std::string(dirname(program_name)); + free(program_name); + + old_path = getenv("PATH"); + assert(old_path); + + assert(asprintf(&new_path, "%s:%s", capsicum_test_bindir.c_str(), + old_path) > 0); + assert(setenv("PATH", new_path, 1) == 0); + } + ::testing::InitGoogleTest(&argc, argv); for (int ii = 1; ii < argc; ii++) { if (strcmp(argv[ii], "-v") == 0) { Modified: head/contrib/capsicum-test/capsicum.h ============================================================================== --- vendor/google/capsicum-test/dist/capsicum.h Mon Apr 1 21:04:13 2019 (r345782) +++ head/contrib/capsicum-test/capsicum.h Mon Apr 1 21:24:50 2019 (r345783) @@ -167,4 +167,9 @@ static inline void cap_rights_describe(const cap_right #endif /* new/old style rights manipulation */ +#ifdef __cplusplus +#include +extern std::string capsicum_test_bindir; +#endif + #endif /*__CAPSICUM_H__*/ Modified: head/contrib/capsicum-test/fexecve.cc ============================================================================== --- vendor/google/capsicum-test/dist/fexecve.cc Mon Apr 1 21:04:13 2019 (r345782) +++ head/contrib/capsicum-test/fexecve.cc Mon Apr 1 21:24:50 2019 (r345783) @@ -1,12 +1,12 @@ -#include -#include #include #include #include +#include #include -#include #include #include +#include +#include #include @@ -14,41 +14,76 @@ #include "capsicum.h" #include "capsicum-test.h" -// We need a program to exec(), but for fexecve() to work in capability -// mode that program needs to be statically linked (otherwise ld.so will -// attempt to traverse the filesystem to load (e.g.) /lib/libc.so and -// fail). -#define EXEC_PROG "./mini-me" -#define EXEC_PROG_NOEXEC EXEC_PROG ".noexec" -#define EXEC_PROG_SETUID EXEC_PROG ".setuid" - // Arguments to use in execve() calls. -static char* argv_pass[] = {(char*)EXEC_PROG, (char*)"--pass", NULL}; -static char* argv_fail[] = {(char*)EXEC_PROG, (char*)"--fail", NULL}; -static char* argv_checkroot[] = {(char*)EXEC_PROG, (char*)"--checkroot", NULL}; static char* null_envp[] = {NULL}; class Execve : public ::testing::Test { public: - Execve() : exec_fd_(open(EXEC_PROG, O_RDONLY)) { + Execve() : exec_fd_(-1) { + // We need a program to exec(), but for fexecve() to work in capability + // mode that program needs to be statically linked (otherwise ld.so will + // attempt to traverse the filesystem to load (e.g.) /lib/libc.so and + // fail). + exec_prog_ = capsicum_test_bindir + "/mini-me"; + exec_prog_noexec_ = capsicum_test_bindir + "/mini-me.noexec"; + exec_prog_setuid_ = capsicum_test_bindir + "/mini-me.setuid"; + + exec_fd_ = open(exec_prog_.c_str(), O_RDONLY); if (exec_fd_ < 0) { - fprintf(stderr, "Error! Failed to open %s\n", EXEC_PROG); + fprintf(stderr, "Error! Failed to open %s\n", exec_prog_.c_str()); } + argv_checkroot_[0] = (char*)exec_prog_.c_str(); + argv_fail_[0] = (char*)exec_prog_.c_str(); + argv_pass_[0] = (char*)exec_prog_.c_str(); } - ~Execve() { if (exec_fd_ >= 0) close(exec_fd_); } + ~Execve() { + if (exec_fd_ >= 0) { + close(exec_fd_); + exec_fd_ = -1; + } + } protected: + char* argv_checkroot_[3] = {nullptr, (char*)"--checkroot", nullptr}; + char* argv_fail_[3] = {nullptr, (char*)"--fail", nullptr}; + char* argv_pass_[3] = {nullptr, (char*)"--pass", nullptr}; + std::string exec_prog_, exec_prog_noexec_, exec_prog_setuid_; int exec_fd_; }; +class Fexecve : public Execve { + public: + Fexecve() : Execve() {} +}; + +class FexecveWithScript : public Fexecve { + public: + FexecveWithScript() : + Fexecve(), temp_script_filename_(TmpFile("cap_sh_script")) {} + + void SetUp() override { + // First, build an executable shell script + int fd = open(temp_script_filename_, O_RDWR|O_CREAT, 0755); + EXPECT_OK(fd); + const char* contents = "#!/bin/sh\nexit 99\n"; + EXPECT_OK(write(fd, contents, strlen(contents))); + close(fd); + } + void TearDown() override { + (void)::unlink(temp_script_filename_); + } + + const char *temp_script_filename_; +}; + FORK_TEST_F(Execve, BasicFexecve) { - EXPECT_OK(fexecve_(exec_fd_, argv_pass, null_envp)); + EXPECT_OK(fexecve_(exec_fd_, argv_pass_, null_envp)); // Should not reach here, exec() takes over. EXPECT_TRUE(!"fexecve() should never return"); } FORK_TEST_F(Execve, InCapMode) { EXPECT_OK(cap_enter()); - EXPECT_OK(fexecve_(exec_fd_, argv_pass, null_envp)); + EXPECT_OK(fexecve_(exec_fd_, argv_pass_, null_envp)); // Should not reach here, exec() takes over. EXPECT_TRUE(!"fexecve() should never return"); } @@ -60,7 +95,7 @@ FORK_TEST_F(Execve, FailWithoutCap) { cap_rights_t rights; cap_rights_init(&rights, 0); EXPECT_OK(cap_rights_limit(cap_fd, &rights)); - EXPECT_EQ(-1, fexecve_(cap_fd, argv_fail, null_envp)); + EXPECT_EQ(-1, fexecve_(cap_fd, argv_fail_, null_envp)); EXPECT_EQ(ENOTCAPABLE, errno); } @@ -73,59 +108,54 @@ FORK_TEST_F(Execve, SucceedWithCap) { // rights -- just CAP_FEXECVE|CAP_READ or CAP_FEXECVE would be preferable. cap_rights_init(&rights, CAP_FEXECVE, CAP_LOOKUP, CAP_READ); EXPECT_OK(cap_rights_limit(cap_fd, &rights)); - EXPECT_OK(fexecve_(cap_fd, argv_pass, null_envp)); + EXPECT_OK(fexecve_(cap_fd, argv_pass_, null_envp)); // Should not reach here, exec() takes over. EXPECT_TRUE(!"fexecve() should have succeeded"); } -FORK_TEST(Fexecve, ExecutePermissionCheck) { - int fd = open(EXEC_PROG_NOEXEC, O_RDONLY); +FORK_TEST_F(Fexecve, ExecutePermissionCheck) { + int fd = open(exec_prog_noexec_.c_str(), O_RDONLY); EXPECT_OK(fd); if (fd >= 0) { struct stat data; EXPECT_OK(fstat(fd, &data)); EXPECT_EQ((mode_t)0, data.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)); - EXPECT_EQ(-1, fexecve_(fd, argv_fail, null_envp)); + EXPECT_EQ(-1, fexecve_(fd, argv_fail_, null_envp)); EXPECT_EQ(EACCES, errno); close(fd); } } -FORK_TEST(Fexecve, SetuidIgnored) { +FORK_TEST_F(Fexecve, SetuidIgnored) { if (geteuid() == 0) { TEST_SKIPPED("requires non-root"); return; } - int fd = open(EXEC_PROG_SETUID, O_RDONLY); + int fd = open(exec_prog_setuid_.c_str(), O_RDONLY); EXPECT_OK(fd); EXPECT_OK(cap_enter()); if (fd >= 0) { struct stat data; EXPECT_OK(fstat(fd, &data)); EXPECT_EQ((mode_t)S_ISUID, data.st_mode & S_ISUID); - EXPECT_OK(fexecve_(fd, argv_checkroot, null_envp)); + EXPECT_OK(fexecve_(fd, argv_checkroot_, null_envp)); // Should not reach here, exec() takes over. EXPECT_TRUE(!"fexecve() should have succeeded"); close(fd); } } -FORK_TEST(Fexecve, ExecveFailure) { +FORK_TEST_F(Fexecve, ExecveFailure) { EXPECT_OK(cap_enter()); - EXPECT_EQ(-1, execve(argv_fail[0], argv_fail, null_envp)); + EXPECT_EQ(-1, execve(argv_fail_[0], argv_fail_, null_envp)); EXPECT_EQ(ECAPMODE, errno); } -FORK_TEST_ON(Fexecve, CapModeScriptFail, TmpFile("cap_sh_script")) { - // First, build an executable shell script - int fd = open(TmpFile("cap_sh_script"), O_RDWR|O_CREAT, 0755); - EXPECT_OK(fd); - const char* contents = "#!/bin/sh\nexit 99\n"; - EXPECT_OK(write(fd, contents, strlen(contents))); - close(fd); +FORK_TEST_F(FexecveWithScript, CapModeScriptFail) { + int fd; // Open the script file, with CAP_FEXECVE rights. - fd = open(TmpFile("cap_sh_script"), O_RDONLY); + fd = open(temp_script_filename_, O_RDONLY); cap_rights_t rights; cap_rights_init(&rights, CAP_FEXECVE, CAP_READ, CAP_SEEK); EXPECT_OK(cap_rights_limit(fd, &rights)); @@ -133,12 +163,17 @@ FORK_TEST_ON(Fexecve, CapModeScriptFail, TmpFile("cap_ EXPECT_OK(cap_enter()); // Enter capability mode // Attempt fexecve; should fail, because "/bin/sh" is inaccessible. - EXPECT_EQ(-1, fexecve_(fd, argv_pass, null_envp)); + EXPECT_EQ(-1, fexecve_(fd, argv_pass_, null_envp)); } #ifdef HAVE_EXECVEAT -TEST(Execveat, NoUpwardTraversal) { - char *abspath = realpath(EXEC_PROG, NULL); +class Execveat : public Execve { + public: + Execveat() : Execve() {} +}; + +TEST_F(Execveat, NoUpwardTraversal) { + char *abspath = realpath(exec_prog_, NULL); char cwd[1024]; getcwd(cwd, sizeof(cwd)); @@ -148,9 +183,9 @@ TEST(Execveat, NoUpwardTraversal) { EXPECT_OK(cap_enter()); // Enter capability mode. // Can't execveat() an absolute path, even relative to a dfd. EXPECT_SYSCALL_FAIL(ECAPMODE, - execveat(AT_FDCWD, abspath, argv_pass, null_envp, 0)); + execveat(AT_FDCWD, abspath, argv_pass_, null_envp, 0)); EXPECT_SYSCALL_FAIL(E_NO_TRAVERSE_CAPABILITY, - execveat(dfd, abspath, argv_pass, null_envp, 0)); + execveat(dfd, abspath, argv_pass_, null_envp, 0)); // Can't execveat() a relative path ("..//./"). char *p = cwd + strlen(cwd); @@ -158,9 +193,9 @@ TEST(Execveat, NoUpwardTraversal) { char buffer[1024] = "../"; strcat(buffer, ++p); strcat(buffer, "/"); - strcat(buffer, EXEC_PROG); + strcat(buffer, exec_prog_); EXPECT_SYSCALL_FAIL(E_NO_TRAVERSE_CAPABILITY, - execveat(dfd, buffer, argv_pass, null_envp, 0)); + execveat(dfd, buffer, argv_pass_, null_envp, 0)); exit(HasFailure() ? 99 : 123); } int status; Modified: head/contrib/capsicum-test/openat.cc ============================================================================== --- vendor/google/capsicum-test/dist/openat.cc Mon Apr 1 21:04:13 2019 (r345782) +++ head/contrib/capsicum-test/openat.cc Mon Apr 1 21:24:50 2019 (r345783) @@ -148,7 +148,7 @@ FORK_TEST(Openat, Relative) { } #define TOPDIR "cap_topdir" -#define SUBDIR_ABS TOPDIR "/subdir" +#define SUBDIR TOPDIR "/subdir" class OpenatTest : public ::testing::Test { public: // Build a collection of files, subdirs and symlinks: @@ -156,20 +156,20 @@ class OpenatTest : public ::testing::Test { // /topfile // /subdir/ // /subdir/bottomfile - // /symlink.samedir -> topfile - // /dsymlink.samedir -> ./ - // /symlink.down -> subdir/bottomfile - // /dsymlink.down -> subdir/ - // /symlink.absolute_in -> /tmp/cap_topdir/topfile - // /dsymlink.absolute_in -> /tmp/cap_topdir/ - // /symlink.absolute_out -> /etc/passwd - // /dsymlink.absolute_out -> /etc/ - // /symlink.relative_in -> ../../tmp/cap_topdir/topfile - // /dsymlink.relative_in -> ../../tmp/cap_topdir/ - // /symlink.relative_out -> ../../etc/passwd - // /dsymlink.relative_out -> ../../etc/ - // /subdir/symlink.up -> ../topfile - // /subdir/dsymlink.up -> ../ + // /symlink.samedir -> topfile + // /dsymlink.samedir -> ./ + // /symlink.down -> subdir/bottomfile + // /dsymlink.down -> subdir/ + // /symlink.absolute_out -> /etc/passwd + // /dsymlink.absolute_out -> /etc/ + // /symlink.relative_in -> ../../tmp/cap_topdir/topfile + // /dsymlink.relative_in -> ../../tmp/cap_topdir/ + // /symlink.relative_out -> ../../etc/passwd + // /dsymlink.relative_out -> ../../etc/ + // /subdir/dsymlink.absolute_in -> /tmp/cap_topdir/ + // /subdir/dsymlink.up -> ../ + // /subdir/symlink.absolute_in -> /tmp/cap_topdir/topfile + // /subdir/symlink.up -> ../topfile // (In practice, this is a little more complicated because tmpdir might // not be "/tmp".) OpenatTest() { @@ -179,7 +179,7 @@ class OpenatTest : public ::testing::Test { if (rc < 0) { EXPECT_EQ(EEXIST, errno); } - rc = mkdir(TmpFile(SUBDIR_ABS), 0755); + rc = mkdir(TmpFile(SUBDIR), 0755); EXPECT_OK(rc); if (rc < 0) { EXPECT_EQ(EEXIST, errno); @@ -197,34 +197,34 @@ class OpenatTest : public ::testing::Test { // Create normal files in each. CreateFile(TmpFile(TOPDIR "/topfile"), "Top-level file"); - CreateFile(TmpFile(SUBDIR_ABS "/bottomfile"), "File in subdirectory"); + CreateFile(TmpFile(SUBDIR "/bottomfile"), "File in subdirectory"); // Create various symlinks to files. EXPECT_OK(symlink("topfile", TmpFile(TOPDIR "/symlink.samedir"))); EXPECT_OK(symlink("subdir/bottomfile", TmpFile(TOPDIR "/symlink.down"))); - EXPECT_OK(symlink(TmpFile(TOPDIR "/topfile"), TmpFile(TOPDIR "/symlink.absolute_in"))); + EXPECT_OK(symlink(TmpFile(TOPDIR "/topfile"), TmpFile(SUBDIR "/symlink.absolute_in"))); EXPECT_OK(symlink("/etc/passwd", TmpFile(TOPDIR "/symlink.absolute_out"))); std::string dots2top = dots2root + TmpFile(TOPDIR "/topfile"); EXPECT_OK(symlink(dots2top.c_str(), TmpFile(TOPDIR "/symlink.relative_in"))); std::string dots2passwd = dots2root + "/etc/passwd"; EXPECT_OK(symlink(dots2passwd.c_str(), TmpFile(TOPDIR "/symlink.relative_out"))); - EXPECT_OK(symlink("../topfile", TmpFile(SUBDIR_ABS "/symlink.up"))); + EXPECT_OK(symlink("../topfile", TmpFile(SUBDIR "/symlink.up"))); // Create various symlinks to directories. EXPECT_OK(symlink("./", TmpFile(TOPDIR "/dsymlink.samedir"))); EXPECT_OK(symlink("subdir/", TmpFile(TOPDIR "/dsymlink.down"))); - EXPECT_OK(symlink(TmpFile(TOPDIR "/"), TmpFile(TOPDIR "/dsymlink.absolute_in"))); + EXPECT_OK(symlink(TmpFile(TOPDIR "/"), TmpFile(SUBDIR "/dsymlink.absolute_in"))); EXPECT_OK(symlink("/etc/", TmpFile(TOPDIR "/dsymlink.absolute_out"))); std::string dots2cwd = dots2root + tmpdir + "/"; EXPECT_OK(symlink(dots2cwd.c_str(), TmpFile(TOPDIR "/dsymlink.relative_in"))); std::string dots2etc = dots2root + "/etc/"; EXPECT_OK(symlink(dots2etc.c_str(), TmpFile(TOPDIR "/dsymlink.relative_out"))); - EXPECT_OK(symlink("../", TmpFile(SUBDIR_ABS "/dsymlink.up"))); + EXPECT_OK(symlink("../", TmpFile(SUBDIR "/dsymlink.up"))); // Open directory FDs for those directories and for cwd. dir_fd_ = open(TmpFile(TOPDIR), O_RDONLY); EXPECT_OK(dir_fd_); - sub_fd_ = open(TmpFile(SUBDIR_ABS), O_RDONLY); + sub_fd_ = open(TmpFile(SUBDIR), O_RDONLY); EXPECT_OK(sub_fd_); cwd_ = openat(AT_FDCWD, ".", O_RDONLY); EXPECT_OK(cwd_); @@ -236,23 +236,23 @@ class OpenatTest : public ::testing::Test { close(cwd_); close(sub_fd_); close(dir_fd_); - unlink(TmpFile(SUBDIR_ABS "/symlink.up")); - unlink(TmpFile(TOPDIR "/symlink.absolute_in")); + unlink(TmpFile(SUBDIR "/symlink.up")); + unlink(TmpFile(SUBDIR "/symlink.absolute_in")); unlink(TmpFile(TOPDIR "/symlink.absolute_out")); unlink(TmpFile(TOPDIR "/symlink.relative_in")); unlink(TmpFile(TOPDIR "/symlink.relative_out")); unlink(TmpFile(TOPDIR "/symlink.down")); unlink(TmpFile(TOPDIR "/symlink.samedir")); - unlink(TmpFile(SUBDIR_ABS "/dsymlink.up")); - unlink(TmpFile(TOPDIR "/dsymlink.absolute_in")); + unlink(TmpFile(SUBDIR "/dsymlink.up")); + unlink(TmpFile(SUBDIR "/dsymlink.absolute_in")); unlink(TmpFile(TOPDIR "/dsymlink.absolute_out")); unlink(TmpFile(TOPDIR "/dsymlink.relative_in")); unlink(TmpFile(TOPDIR "/dsymlink.relative_out")); unlink(TmpFile(TOPDIR "/dsymlink.down")); unlink(TmpFile(TOPDIR "/dsymlink.samedir")); - unlink(TmpFile(SUBDIR_ABS "/bottomfile")); + unlink(TmpFile(SUBDIR "/bottomfile")); unlink(TmpFile(TOPDIR "/topfile")); - rmdir(TmpFile(SUBDIR_ABS)); + rmdir(TmpFile(SUBDIR)); rmdir(TmpFile(TOPDIR)); } @@ -281,18 +281,18 @@ class OpenatTest : public ::testing::Test { // Should only be able to open symlinks that stay within the directory. EXPECT_OPEN_OK(openat(dir_fd_, "symlink.samedir", O_RDONLY|oflag)); EXPECT_OPEN_OK(openat(dir_fd_, "symlink.down", O_RDONLY|oflag)); - EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "symlink.absolute_in", O_RDONLY|oflag); EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "symlink.absolute_out", O_RDONLY|oflag); EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "symlink.relative_in", O_RDONLY|oflag); EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "symlink.relative_out", O_RDONLY|oflag); + EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "symlink.absolute_in", O_RDONLY|oflag); EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "symlink.up", O_RDONLY|oflag); EXPECT_OPEN_OK(openat(dir_fd_, "dsymlink.samedir/topfile", O_RDONLY|oflag)); EXPECT_OPEN_OK(openat(dir_fd_, "dsymlink.down/bottomfile", O_RDONLY|oflag)); - EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "dsymlink.absolute_in/topfile", O_RDONLY|oflag); EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "dsymlink.absolute_out/passwd", O_RDONLY|oflag); EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "dsymlink.relative_in/topfile", O_RDONLY|oflag); EXPECT_OPENAT_FAIL_TRAVERSAL(dir_fd_, "dsymlink.relative_out/passwd", O_RDONLY|oflag); + EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "dsymlink.absolute_in/topfile", O_RDONLY|oflag); EXPECT_OPENAT_FAIL_TRAVERSAL(sub_fd_, "dsymlink.up/topfile", O_RDONLY|oflag); // Although recall that O_NOFOLLOW prevents symlink following in final component. @@ -310,10 +310,10 @@ TEST_F(OpenatTest, WithCapability) { // Any kind of symlink can be opened relative to an ordinary directory FD. EXPECT_OPEN_OK(openat(dir_fd_, "symlink.samedir", O_RDONLY)); EXPECT_OPEN_OK(openat(dir_fd_, "symlink.down", O_RDONLY)); - EXPECT_OPEN_OK(openat(dir_fd_, "symlink.absolute_in", O_RDONLY)); EXPECT_OPEN_OK(openat(dir_fd_, "symlink.absolute_out", O_RDONLY)); EXPECT_OPEN_OK(openat(dir_fd_, "symlink.relative_in", O_RDONLY)); EXPECT_OPEN_OK(openat(dir_fd_, "symlink.relative_out", O_RDONLY)); + EXPECT_OPEN_OK(openat(sub_fd_, "symlink.absolute_in", O_RDONLY)); EXPECT_OPEN_OK(openat(sub_fd_, "symlink.up", O_RDONLY)); // Now make both DFDs into Capsicum capabilities. Modified: head/tests/sys/capsicum/Makefile ============================================================================== --- head/tests/sys/capsicum/Makefile Mon Apr 1 21:04:13 2019 (r345782) +++ head/tests/sys/capsicum/Makefile Mon Apr 1 21:24:50 2019 (r345783) @@ -1,11 +1,56 @@ # $FreeBSD$ +.include + TESTSDIR= ${TESTSBASE}/sys/capsicum ATF_TESTS_C+= bindat_connectat ATF_TESTS_C+= ioctls_test CFLAGS+= -I${SRCTOP}/tests + +.if ${MK_GOOGLETEST} != no + +.PATH: ${SRCTOP}/contrib/capsicum-test + +GTESTS+= capsicum-test + +SRCS.capsicum-test+= \ + capsicum-test-main.cc \ + capsicum-test.cc \ + capability-fd.cc \ + fexecve.cc \ + procdesc.cc \ + capmode.cc \ + fcntl.cc \ + ioctl.cc \ + openat.cc \ + sysctl.cc \ + select.cc \ + mqueue.cc \ + socket.cc \ + sctp.cc \ + capability-fd-pair.cc \ + overhead.cc \ + rename.cc + +LIBADD.capsicum-test+= gtest pthread +TEST_METADATA.capsicum-test= required_user="unprivileged" + +.for p in mini-me mini-me.noexec mini-me.setuid +PROGS+= $p +NO_SHARED.$p= +SRCS.$p= mini-me.c +.endfor + +BINDIR= ${TESTSDIR} + +BINMODE.mini-me.noexec= ${NOBINMODE} +BINMODE.mini-me.setuid= 4555 + +WARNS.capsicum-test= 3 + +.endif WARNS?= 6 From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DF0EDC321; Tue, 3 Sep 2019 14:06:05 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z02XdNz4P9k; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 2CFA51A0B7; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 3B2A44DE7; Tue, 2 Apr 2019 17:10:22 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42A896DCC1; Tue, 2 Apr 2019 17:10:21 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1F1D24D99; Tue, 2 Apr 2019 17:10:21 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id CAD1E4D8B for ; Tue, 2 Apr 2019 17:10:17 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A1AA6DCB1; Tue, 2 Apr 2019 17:10:17 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yb1-xb2a.google.com with SMTP id c15so3051166ybk.8; Tue, 02 Apr 2019 10:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=QAVznllPxUJaoHMesKMsb51jVykyFZ/zJQC818DhIHw=; b=hNMQV6q0hUoO1vstKnrfEZBfeKYfEYp0fxlH5FZ8842CVCIsjmP0fS6iyMuBc4FuvE wq8Yg9Bg8Zw87sT7NwHAMWBD8nETd5PVbDUl0iuF6oZczbgs9z5VUtBdoKDBzGFhvnY+ fnYGdlbIiDwm0J9w1F39g//t8uXjbpZv2mBGHQKJrKMtXz0/YkZCn8tRPDrOpiYS0r6N uqhfokUaOe2IEsdqmSyoUeKR64uIMYd7zl7aUHdRymswt4lvw1C+UmO9ejtkJkJq4e3T 9TNjPF6GAJg6CUcp8Y+bYFw9XK3W0ZI4dRSozna1raqCXqr63CXZ45zyKC9ILLjnY3XA l1XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=QAVznllPxUJaoHMesKMsb51jVykyFZ/zJQC818DhIHw=; b=qXXHtm6OSHJURryBqakV3IHycXTHkZQuECQ9oII3dYnaLwx9cxQl3AxZUBMhbQZvls /x4ANyekMCK3w7PVErcHRsgndiuys/HghDkApEUvGl+hxS/jjRcFCnMVh8q/6gidgg1i 7DW/0xMgcWHRkVBd91EHt3H3+/16Chne2B4OX4VPUsip07e4Vtprmp9OW+O6SOVzAn+W fK0BqZzykPtxwiSB1LRb8kgtqTKoqdAyPzzMqL8hv32ZqkiIJxrvOU+zdot7bIo2lIG4 FNh0uVNv8O5DnnizuoE4ajIDhX5YbCHIxjmDGI6w19FhU2U7t3jjMv/rnBKwAy5Jb52e KJbg== X-Gm-Message-State: APjAAAWNjI5sFHbpdd6L+EYb8vswBud50oiTvL7sfEoOgHjCQGMlvqr7 0NTWheSxrmjQ4eCeatuHUKL3pOSs X-Google-Smtp-Source: APXvYqylUlwz3p8fNqWCjxOpLWT5I0cq6EQLbF261gZ44022cEEJsaZ1uUrBVpBUXl1OeFnZFAW65w== X-Received: by 2002:a25:1643:: with SMTP id 64mr3030423ybw.363.1554225016401; Tue, 02 Apr 2019 10:10:16 -0700 (PDT) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id 193sm5431062ywf.22.2019.04.02.10.10.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Apr 2019 10:10:15 -0700 (PDT) Subject: Re: svn commit: r345805 - head/sys/cam To: Enji Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904021446.x32EkBM7016545@repo.freebsd.org> From: Alexander Motin Openpgp: preference=signencrypt Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAHNIUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPsLAlwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raTOwE0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAcLAZQQYAQoADwUCU7PEDAIbDAUJBaOagAAKCRCDGMOVW6sif7FRB/4k9y/GaGqU fcJiXdQHRAKHCUvbKMFgeEDHOg33qx+POS2Ah85/PXVa2jYBldCZDmYc+zl48aEMd163a7s3 0gJaB7CYElwxlKUk6c+5gwoYIJuJJzSzW0JzSD5ch7RIRxbfxrKdsiHrUW8AeduZWzlK6VaW RmWILgLmxfLdhEVFWxbr99GSeVFZaZwn6tl/8CvBcgYoARvJvl0V5zS1akQfEISYkwL9EfUI W44EOHranL5qUXkedXBYp6fRsooGrIimfwYxaC8FbXhk3FMgMjDMRiVq4POHo1iGeYETsUrL NM6184E25gPVtX2fb3RhM8Xh6BkwCZ6ZYbQ+AcD4F/cKwsB8BBgBCgAmAhsMFiEE6YzzxOac w80OV51VgxjDlVurIn8FAllgwtgFCQ0xzMwACgkQgxjDlVurIn9OqAf9FAcKWS95wTTbraXA qg/+bQyHgjlMtGCgkmfxLsbUGeqiFgmSIuoDrF7q6sYPs6p00CXXZRuuNZt0lX7O95re8mgz gxm5iJisZpdbHMVepYlw/AxT2wCHwxGCEe64Lm+A9vjlOd+3D3/6fSLwZ9WFCE6p6lQZ1CDg 09xe+JKSgC+KDqmn0tzGKyfSCuhRAq3XkZyxL1hxBaDeP0eeKlzoy7jXodf3wVvXXc0cmpza B5McuRHK4EU6jIioHo30YqPM4AjPHGxV2X1N6/Aayungzj9EXNZtKCxs6dsTvjniWa5VkZ9F 4SOdSbxEen1DZRYpeWnd7GVmO86n+5USkKCXPg== Message-ID: <56a5de69-fa77-8d34-6743-b74d0db05eec@FreeBSD.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 42A896DCC1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:12 -0000 X-Original-Date: Tue, 2 Apr 2019 13:10:15 -0400 X-List-Received-Date: Tue, 03 Sep 2019 14:06:12 -0000 Hi. On 02.04.2019 12:43, Enji Cooper wrote: >> On Apr 2, 2019, at 07:46, Alexander Motin wrote: >> @@ -1595,14 +1596,21 @@ camperiphscsistatuserror(union ccb *ccb, union ccb **o >> * Restart the queue after either another >> * command completes or a 1 second timeout. >> */ >> - if ((sense_flags & SF_RETRY_BUSY) != 0 || >> - (ccb->ccb_h.retry_count--) > 0) { >> + periph = xpt_path_periph(ccb->ccb_h.path); >> + if (periph->flags & CAM_PERIPH_INVALID) { > > Is there a reason why this style is inconsistent with the other part of the change by not explicitly testing for “!= 0”? Not really, I've just copied this chunk from other place where it was this way. Bug I generally prefer more compact code where possible, and I don't see style(9) saying it is bad to do so here. But if it hurts somebody, I see no problem to change it. -- Alexander Motin From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 806EBDC31A; Tue, 3 Sep 2019 14:06:05 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z01kmFz4P9Q; Tue, 3 Sep 2019 14:06:03 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 1DF1C1A0AB; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E10F03E37; Tue, 2 Apr 2019 16:09:10 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50D916B9B5; Tue, 2 Apr 2019 16:09:10 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1B8423E07; Tue, 2 Apr 2019 16:09:10 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 6D1703E02; Tue, 2 Apr 2019 16:09:07 +0000 (UTC) (envelope-from mike@reifenberger.com) Received: from app.eeeit.de (app.eeeit.de [188.68.43.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 024CE6B9AF; Tue, 2 Apr 2019 16:09:07 +0000 (UTC) (envelope-from mike@reifenberger.com) Received: from [100.92.110.33] (ip-109-41-195-17.web.vodafone.de [109.41.195.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: mike@reifenberger.com) by app.eeeit.de (Postfix) with ESMTPSA id 8778C597A9; Tue, 2 Apr 2019 18:09:05 +0200 (CEST) User-Agent: K-9 Mail for Android In-Reply-To: <201904021408.x32E8Ho9021667@gndrsh.dnsmgr.net> References: <201904021408.x32E8Ho9021667@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r345804 - head/usr.bin/systat To: rgrimes@freebsd.org, "Rodney W. Grimes" , Michael Reifenberger CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Michael Message-ID: Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 50D916B9B5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:12 -0000 X-Original-Date: Tue, 02 Apr 2019 18:09:10 +0200 X-List-Received-Date: Tue, 03 Sep 2019 14:06:12 -0000 Hi, Am 2=2E April 2019 16:08:17 MESZ schrieb "Rodney W=2E Grimes" : >> Author: mr >> Date: Tue Apr 2 14:01:03 2019 >> New Revision: 345804 >> URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/345804 >>=20 >> Log: >> systat -zarc to display disk activities like -vm >> =20 >> PR: 213310 >> Submitted by: ota >> MFH: 4 weeks > >? MFC: Yes, indeed=2E > >> Differential Revision: https://reviews=2Efreebsd=2Eorg/D18726 >>=20 >> Modified: >> head/usr=2Ebin/systat/devs=2Ec >> head/usr=2Ebin/systat/devs=2Eh >> head/usr=2Ebin/systat/iostat=2Ec >> head/usr=2Ebin/systat/swap=2Ec >> head/usr=2Ebin/systat/systat=2Eh >> head/usr=2Ebin/systat/vmstat=2Ec >> head/usr=2Ebin/systat/zarc=2Ec >>=20 >> Modified: head/usr=2Ebin/systat/devs=2Ec >> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/usr=2Ebin/systat/devs=2Ec Tue Apr 2 13:59:04 2019 (r345803) >> +++ head/usr=2Ebin/systat/devs=2Ec Tue Apr 2 14:01:03 2019 (r345804) >> @@ -2,6 +2,7 @@ >> * SPDX-License-Identifier: BSD-3-Clause >> * >> * Copyright (c) 1998 Kenneth D=2E Merry=2E >> + * 2015 Yoshihiro Ota >> * All rights reserved=2E > > >Can we get in contact with Yoshihiro Ota about his >copyright statements, and correcting this to make >it clear that it is Kenneth D=2E Merry that is asserting >"All rights reserved" and if Ota does nor does not wish to assert >"All rights reserved"=2E > >As committed this makes a grey area on Kenneth's assertion, >also leaving out the word copyright on Yoshihiro's line is a bit iffy=2E > >I am only commenting once, this issue appears several times=2E >We can go back out to D18726 to discuss it if need be=2E > You could add a comment in the PR too, I intended to keep it open until MF= C >> * >> * Redistribution and use in source and binary forms, with or >without >> @@ -69,7 +70,6 @@ static const char sccsid[] =3D "@(#)disks=2Ec 8=2E1 >(Berkele >> #include >> =20 >> #include >> -#include >> #include >> #include >> #include >> @@ -84,6 +84,8 @@ typedef enum { >> DS_MATCHTYPE_PATTERN >> } last_match_type; >> =20 >> +struct statinfo cur_dev, last_dev, run_dev; >> + >> last_match_type last_type; >> struct device_selection *dev_select; >> long generation; >> @@ -101,10 +103,8 @@ static int dsselect(const char *args, >devstat_select_m >> int maxshowdevs, struct statinfo *s1); >> =20 >> int >> -dsinit(int maxshowdevs, struct statinfo *s1, struct statinfo *s2 >__unused, >> - struct statinfo *s3 __unused) >> +dsinit(int maxshowdevs) >> { >> - >> /* >> * Make sure that the userland devstat version matches the kernel >> * devstat version=2E If not, exit and print a message informing >> @@ -113,6 +113,18 @@ dsinit(int maxshowdevs, struct statinfo *s1, >struct st >> if (devstat_checkversion(NULL) < 0) >> errx(1, "%s", devstat_errbuf); >> =20 >> + if( cur_dev=2Edinfo ) // init was alreay ran >> + return(1); >> + >> + if ((num_devices =3D devstat_getnumdevs(NULL)) < 0) { >> + warnx("%s", devstat_errbuf); >> + return(0); >> + } >> + >> + cur_dev=2Edinfo =3D calloc(1, sizeof(struct devinfo)); >> + last_dev=2Edinfo =3D calloc(1, sizeof(struct devinfo)); >> + run_dev=2Edinfo =3D calloc(1, sizeof(struct devinfo)); >> + >> generation =3D 0; >> num_devices =3D 0; >> num_selected =3D 0; >> @@ -120,11 +132,11 @@ dsinit(int maxshowdevs, struct statinfo *s1, >struct st >> select_generation =3D 0; >> last_type =3D DS_MATCHTYPE_NONE; >> =20 >> - if (devstat_getdevs(NULL, s1) =3D=3D -1) >> + if (devstat_getdevs(NULL, &cur_dev) =3D=3D -1) >> errx(1, "%s", devstat_errbuf); >> =20 >> - num_devices =3D s1->dinfo->numdevs; >> - generation =3D s1->dinfo->generation; >> + num_devices =3D cur_dev=2Edinfo->numdevs; >> + generation =3D cur_dev=2Edinfo->generation; >> =20 >> dev_select =3D NULL; >> =20 >> @@ -134,13 +146,31 @@ dsinit(int maxshowdevs, struct statinfo *s1, >struct st >> * or 1=2E If we get back -1, though, there is an error=2E >> */ >> if (devstat_selectdevs(&dev_select, &num_selected, &num_selections, >> - &select_generation, generation, s1->dinfo->devices, >num_devices, >> + &select_generation, generation, cur_dev=2Edinfo->devices, >num_devices, >> NULL, 0, NULL, 0, DS_SELECT_ADD, maxshowdevs, 0) =3D=3D -1) >> errx(1, "%d %s", __LINE__, devstat_errbuf); >> =20 >> return(1); >> } >> =20 >> + >> +void >> +dsgetinfo(struct statinfo* dev) >> +{ >> + switch (devstat_getdevs(NULL, dev)) { >> + case -1: >> + errx(1, "%s", devstat_errbuf); >> + break; >> + case 1: >> + num_devices =3D dev->dinfo->numdevs; >> + generation =3D dev->dinfo->generation; >> + cmdkre("refresh", NULL); >> + break; >> + default: >> + break; >> + } >> +} >> + >> int >> dscmd(const char *cmd, const char *args, int maxshowdevs, struct >statinfo *s1) >> { >> @@ -330,4 +360,84 @@ dsselect(const char *args, devstat_select_mode >select_ >> return(2); >> } >> return(1); >> +} >> + >> + >> +void >> +dslabel(int maxdrives, int diskcol, int diskrow) >> +{ >> + int i, j; >> + >> + mvprintw(diskrow, diskcol, "Disks"); >> + mvprintw(diskrow + 1, diskcol, "KB/t"); >> + mvprintw(diskrow + 2, diskcol, "tps"); >> + mvprintw(diskrow + 3, diskcol, "MB/s"); >> + mvprintw(diskrow + 4, diskcol, "%%busy"); >> + /* >> + * For now, we don't support a fourth disk statistic=2E So there's >> + * no point in providing a label for it=2E If someone can think of a >> + * fourth useful disk statistic, there is room to add it=2E >> + */ >> + /* mvprintw(diskrow + 4, diskcol, " msps"); */ >> + j =3D 0; >> + for (i =3D 0; i < num_devices && j < maxdrives; i++) >> + if (dev_select[i]=2Eselected) { >> + char tmpstr[80]; >> + sprintf(tmpstr, "%s%d", dev_select[i]=2Edevice_name, >> + dev_select[i]=2Eunit_number); >> + mvprintw(diskrow, diskcol + 5 + 6 * j, >> + " %5=2E5s", tmpstr); >> + j++; >> + } >> +} >> + >> +static void >> +dsshow2(int diskcol, int diskrow, int dn, int lc, struct statinfo >*now, struct statinfo *then) >> +{ >> + long double transfers_per_second; >> + long double kb_per_transfer, mb_per_second; >> + long double elapsed_time, device_busy; >> + int di; >> + >> + di =3D dev_select[dn]=2Eposition; >> + >> + if (then !=3D NULL) { >> + /* Calculate relative to previous sample */ >> + elapsed_time =3D now->snap_time - then->snap_time; >> + } else { >> + /* Calculate relative to device creation */ >> + elapsed_time =3D now->snap_time - devstat_compute_etime( >> + &now->dinfo->devices[di]=2Ecreation_time, NULL); >> + } >> + >> + if (devstat_compute_statistics(&now->dinfo->devices[di], then ? >> + &then->dinfo->devices[di] : NULL, elapsed_time, >> + DSM_KB_PER_TRANSFER, &kb_per_transfer, >> + DSM_TRANSFERS_PER_SECOND, &transfers_per_second, >> + DSM_MB_PER_SECOND, &mb_per_second, >> + DSM_BUSY_PCT, &device_busy, >> + DSM_NONE) !=3D 0) >> + errx(1, "%s", devstat_errbuf); >> + >> + lc =3D diskcol + lc * 6; >> + putlongdouble(kb_per_transfer, diskrow + 1, lc, 5, 2, 0); >> + putlongdouble(transfers_per_second, diskrow + 2, lc, 5, 0, 0); >> + putlongdouble(mb_per_second, diskrow + 3, lc, 5, 2, 0); >> + putlongdouble(device_busy, diskrow + 4, lc, 5, 0, 0); >> +} >> + >> +static void >> +dsshow3(int diskcol, int diskrow, int dn, int lc, struct statinfo >*now, struct statinfo *then) >> +{ >> + dsshow2(diskcol, diskrow, dn, lc, now, then); >> +} >> + >> +void >> +dsshow(int maxdrives, int diskcol, int diskrow, struct statinfo >*now, struct statinfo *then) >> +{ >> + int i, lc; >> + >> + for (i =3D 0, lc =3D 0; i < num_devices && lc < maxdrives; i++) >> + if (dev_select[i]=2Eselected) >> + dsshow3(diskcol, diskrow, i, ++lc, now, then); >> } >>=20 >> Modified: head/usr=2Ebin/systat/devs=2Eh >> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/usr=2Ebin/systat/devs=2Eh Tue Apr 2 13:59:04 2019 (r345803) >> +++ head/usr=2Ebin/systat/devs=2Eh Tue Apr 2 14:01:03 2019 (r345804) >> @@ -2,6 +2,7 @@ >> * SPDX-License-Identifier: BSD-2-Clause-FreeBSD >> * >> * Copyright (c) 1998 David E=2E O'Brien >> + * 2015 Yoshihiro Ota >> * All rights reserved=2E >> * >> * Redistribution and use in source and binary forms, with or >without >> @@ -28,5 +29,18 @@ >> * $FreeBSD$ >> */ >> =20 >> -int dsinit(int, struct statinfo *, struct statinfo *, struct >statinfo *); >> +#ifndef DEVS_H >> +#define DEVS_H >> + >> +#include >> + >> +int dsinit(int); >> +void dsgetinfo(struct statinfo *); >> int dscmd(const char *, const char *, int, struct statinfo *); >> + >> +void dslabel(int, int, int); >> +void dsshow(int, int, int, struct statinfo *, struct statinfo *); >> + >> +extern struct statinfo cur_dev, last_dev, run_dev; >> + >> +#endif >>=20 >> Modified: head/usr=2Ebin/systat/iostat=2Ec >> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/usr=2Ebin/systat/iostat=2Ec Tue Apr 2 13:59:04 2019 (r345803) >> +++ head/usr=2Ebin/systat/iostat=2Ec Tue Apr 2 14:01:03 2019 (r345804) >> @@ -79,8 +79,6 @@ static const char sccsid[] =3D "@(#)iostat=2Ec 8=2E1 >(Berkel >> #include "extern=2Eh" >> #include "devs=2Eh" >> =20 >> -struct statinfo cur, last; >> - >> static int linesperregion; >> static double etime; >> static int numbers =3D 0; /* default display bar graphs */ >> @@ -111,17 +109,11 @@ closeiostat(WINDOW *w) >> int >> initiostat(void) >> { >> - if ((num_devices =3D devstat_getnumdevs(NULL)) < 0) >> - return(0); >> - >> - cur=2Edinfo =3D calloc(1, sizeof(struct devinfo)); >> - last=2Edinfo =3D calloc(1, sizeof(struct devinfo)); >> - >> /* >> * This value for maxshowdevs (100) is bogus=2E I'm not sure exactly >> * how to calculate it, though=2E >> */ >> - if (dsinit(100, &cur, &last, NULL) !=3D 1) >> + if (dsinit(7) !=3D 1) >> return(0); >> =20 >> return(1); >> @@ -133,17 +125,17 @@ fetchiostat(void) >> struct devinfo *tmp_dinfo; >> size_t len; >> =20 >> - len =3D sizeof(cur=2Ecp_time); >> - if (sysctlbyname("kern=2Ecp_time", &cur=2Ecp_time, &len, NULL, 0) >> - || len !=3D sizeof(cur=2Ecp_time)) { >> + len =3D sizeof(cur_dev=2Ecp_time); >> + if (sysctlbyname("kern=2Ecp_time", &cur_dev=2Ecp_time, &len, NULL, 0) >> + || len !=3D sizeof(cur_dev=2Ecp_time)) { >> perror("kern=2Ecp_time"); >> exit (1); >> } >> - tmp_dinfo =3D last=2Edinfo; >> - last=2Edinfo =3D cur=2Edinfo; >> - cur=2Edinfo =3D tmp_dinfo; >> + tmp_dinfo =3D last_dev=2Edinfo; >> + last_dev=2Edinfo =3D cur_dev=2Edinfo; >> + cur_dev=2Edinfo =3D tmp_dinfo; >> =20 >> - last=2Esnap_time =3D cur=2Esnap_time; >> + last_dev=2Esnap_time =3D cur_dev=2Esnap_time; >> =20 >> /* >> * Here what we want to do is refresh our device stats=2E >> @@ -152,7 +144,7 @@ fetchiostat(void) >> * the selection process again, in case a device that we >> * were previously displaying has gone away=2E >> */ >> - switch (devstat_getdevs(NULL, &cur)) { >> + switch (devstat_getdevs(NULL, &cur_dev)) { >> case -1: >> errx(1, "%s", devstat_errbuf); >> break; >> @@ -162,8 +154,8 @@ fetchiostat(void) >> default: >> break; >> } >> - num_devices =3D cur=2Edinfo->numdevs; >> - generation =3D cur=2Edinfo->generation; >> + num_devices =3D cur_dev=2Edinfo->numdevs; >> + generation =3D cur_dev=2Edinfo->generation; >> =20 >> } >> =20 >> @@ -260,11 +252,11 @@ showiostat(void) >> long t; >> int i, row, _col; >> =20 >> -#define X(fld) t =3D cur=2Efld[i]; cur=2Efld[i] -=3D last=2Efld[i]; >last=2Efld[i] =3D t >> +#define X(fld) t =3D cur_dev=2Efld[i]; cur_dev=2Efld[i] -=3D >last_dev=2Efld[i]; last_dev=2Efld[i] =3D t >> etime =3D 0; >> for(i =3D 0; i < CPUSTATES; i++) { >> X(cp_time); >> - etime +=3D cur=2Ecp_time[i]; >> + etime +=3D cur_dev=2Ecp_time[i]; >> } >> if (etime =3D=3D 0=2E0) >> etime =3D 1=2E0; >> @@ -313,10 +305,10 @@ devstats(int row, int _col, int dn) >> =20 >> di =3D dev_select[dn]=2Eposition; >> =20 >> - busy_seconds =3D cur=2Esnap_time - last=2Esnap_time; >> + busy_seconds =3D cur_dev=2Esnap_time - last_dev=2Esnap_time; >> =20 >> - if (devstat_compute_statistics(&cur=2Edinfo->devices[di], >> - &last=2Edinfo->devices[di], busy_seconds, >> + if (devstat_compute_statistics(&cur_dev=2Edinfo->devices[di], >> + &last_dev=2Edinfo->devices[di], busy_seconds, >> DSM_KB_PER_TRANSFER, &kb_per_transfer, >> DSM_TRANSFERS_PER_SECOND, &transfers_per_second, >> DSM_MB_PER_SECOND, &mb_per_second, DSM_NONE) !=3D 0) >> @@ -349,12 +341,12 @@ stat1(int row, int o) >> =20 >> dtime =3D 0=2E0; >> for (i =3D 0; i < CPUSTATES; i++) >> - dtime +=3D cur=2Ecp_time[i]; >> + dtime +=3D cur_dev=2Ecp_time[i]; >> if (dtime =3D=3D 0=2E0) >> dtime =3D 1=2E0; >> wmove(wnd, row, INSET); >> #define CPUSCALE 0=2E5 >> - histogram(100=2E0 * cur=2Ecp_time[o] / dtime, 50, CPUSCALE); >> + histogram(100=2E0 * cur_dev=2Ecp_time[o] / dtime, 50, CPUSCALE); >> } >> =20 >> static void >> @@ -388,7 +380,7 @@ cmdiostat(const char *cmd, const char *args) >> numbers =3D 1; >> else if (prefix(cmd, "bars")) >> numbers =3D 0; >> - else if (!dscmd(cmd, args, 100, &cur)) >> + else if (!dscmd(cmd, args, 100, &cur_dev)) >> return (0); >> wclear(wnd); >> labeliostat(); >>=20 >> Modified: head/usr=2Ebin/systat/swap=2Ec >> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/usr=2Ebin/systat/swap=2Ec Tue Apr 2 13:59:04 2019 (r345803) >> +++ head/usr=2Ebin/systat/swap=2Ec Tue Apr 2 14:01:03 2019 (r345804) >> @@ -3,6 +3,7 @@ >> * >> * Copyright (c) 1980, 1992, 1993 >> * The Regents of the University of California=2E All rights >reserved=2E >> + * Copyright (c) 2017 Yoshihiro Ota >> * >> * Redistribution and use in source and binary forms, with or >without >> * modification, are permitted provided that the following >conditions >> @@ -55,6 +56,7 @@ static const char sccsid[] =3D "@(#)swap=2Ec 8=2E3 >(Berkeley >> =20 >> #include "systat=2Eh" >> #include "extern=2Eh" >> +#include "devs=2Eh" >> =20 >> kvm_t *kd; >> =20 >> @@ -137,13 +139,15 @@ initswap(void) >> oulen =3D ulen; >> =20 >> once =3D 1; >> + >> + dsinit(12); >> + >> return (1); >> } >> =20 >> void >> fetchswap(void) >> { >> - >> okvnsw =3D kvnsw; >> if ((kvnsw =3D kvm_getswapinfo(kd, kvmsw, NSWAP, 0)) < 0) { >> error("systat: kvm_getswapinfo failed"); >> @@ -153,6 +157,15 @@ fetchswap(void) >> odlen =3D dlen; >> oulen =3D ulen; >> calclens(); >> + >> + struct devinfo *tmp_dinfo; >> + >> + tmp_dinfo =3D last_dev=2Edinfo; >> + last_dev=2Edinfo =3D cur_dev=2Edinfo; >> + cur_dev=2Edinfo =3D tmp_dinfo; >> + >> + last_dev=2Esnap_time =3D cur_dev=2Esnap_time; >> + dsgetinfo( &cur_dev ); >> } >> =20 >> void >> @@ -178,6 +191,7 @@ labelswap(void) >> name =3D kvmsw[i]=2Eksw_devname; >> mvwprintw(wnd, i + 1, 0, "%*s", -dlen, name); >> } >> + dslabel(12, 0, 18); >> } >> =20 >> void >> @@ -217,4 +231,5 @@ showswap(void) >> waddch(wnd, 'X'); >> wclrtoeol(wnd); >> } >> + dsshow(12, 0, 18, &cur_dev, &last_dev); >> } >>=20 >> Modified: head/usr=2Ebin/systat/systat=2Eh >> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/usr=2Ebin/systat/systat=2Eh Tue Apr 2 13:59:04 2019 (r345803) >> +++ head/usr=2Ebin/systat/systat=2Eh Tue Apr 2 14:01:03 2019 (r345804) >> @@ -68,3 +68,7 @@ extern int use_kvm; >> #define NVAL(indx) namelist[(indx)]=2En_value >> #define NPTR(indx) (void *)NVAL((indx)) >> #define NREAD(indx, buf, len) kvm_ckread(NPTR((indx)), (buf), (len)) >> + >> +extern void putint(int, int, int, int); >> +extern void putfloat(double, int, int, int, int, int); >> +extern void putlongdouble(long double, int, int, int, int, int); >>=20 >> Modified: head/usr=2Ebin/systat/vmstat=2Ec >> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/usr=2Ebin/systat/vmstat=2Ec Tue Apr 2 13:59:04 2019 (r345803) >> +++ head/usr=2Ebin/systat/vmstat=2Ec Tue Apr 2 14:01:03 2019 (r345804) >> @@ -66,7 +66,6 @@ static const char sccsid[] =3D "@(#)vmstat=2Ec 8=2E2 >(Berkel >> #include >> #include >> #include >> -#include >> #include "systat=2Eh" >> #include "extern=2Eh" >> #include "devs=2Eh" >> @@ -125,7 +124,6 @@ static struct Info { >> static u_long kmem_size; >> static u_int v_page_count; >> =20 >> -struct statinfo cur, last, run; >> =20 >> #define total s=2ETotal >> #define nchtotal s=2Enchstats >> @@ -137,13 +135,9 @@ enum divisor { IEC =3D 0, SI =3D HN_DIVISOR_1000 }= ; >> static void allocinfo(struct Info *); >> static void copyinfo(struct Info *, struct Info *); >> static float cputime(int); >> -static void dinfo(int, int, struct statinfo *, struct statinfo *); >> static void do_putuint64(uint64_t, int, int, int, int); >> static void getinfo(struct Info *); >> -static void putint(int, int, int, int); >> static void putuint64(uint64_t, int, int, int); >> -static void putfloat(double, int, int, int, int, int); >> -static void putlongdouble(long double, int, int, int, int, int); >> static int ucount(void); >> =20 >> static int ncpu; >> @@ -209,18 +203,9 @@ initkre(void) >> int i; >> size_t sz; >> =20 >> - if ((num_devices =3D devstat_getnumdevs(NULL)) < 0) { >> - warnx("%s", devstat_errbuf); >> + if (dsinit(MAXDRIVES) !=3D 1) >> return(0); >> - } >> =20 >> - cur=2Edinfo =3D calloc(1, sizeof(struct devinfo)); >> - last=2Edinfo =3D calloc(1, sizeof(struct devinfo)); >> - run=2Edinfo =3D calloc(1, sizeof(struct devinfo)); >> - >> - if (dsinit(MAXDRIVES, &cur, &last, &run) !=3D 1) >> - return(0); >> - >> if (nintr =3D=3D 0) { >> if (sysctlbyname("hw=2Eintrcnt", NULL, &sz, NULL, 0) =3D=3D -1) { >> error("sysctl(hw=2Eintrcnt=2E=2E=2E) failed: %s", >> @@ -371,27 +356,7 @@ labelkre(void) >> mvprintw(NAMEIROW, NAMEICOL, "Namei Name-cache Dir-cache"); >> mvprintw(NAMEIROW + 1, NAMEICOL, >> " Calls hits %% hits %%"); >> - mvprintw(DISKROW, DISKCOL, "Disks"); >> - mvprintw(DISKROW + 1, DISKCOL, "KB/t"); >> - mvprintw(DISKROW + 2, DISKCOL, "tps"); >> - mvprintw(DISKROW + 3, DISKCOL, "MB/s"); >> - mvprintw(DISKROW + 4, DISKCOL, "%%busy"); >> - /* >> - * For now, we don't support a fourth disk statistic=2E So there's >> - * no point in providing a label for it=2E If someone can think of a >> - * fourth useful disk statistic, there is room to add it=2E >> - */ >> - /* mvprintw(DISKROW + 4, DISKCOL, " msps"); */ >> - j =3D 0; >> - for (i =3D 0; i < num_devices && j < MAXDRIVES; i++) >> - if (dev_select[i]=2Eselected) { >> - char tmpstr[80]; >> - sprintf(tmpstr, "%s%d", dev_select[i]=2Edevice_name, >> - dev_select[i]=2Eunit_number); >> - mvprintw(DISKROW, DISKCOL + 5 + 6 * j, >> - " %5=2E5s", tmpstr); >> - j++; >> - } >> + dslabel(MAXDRIVES, DISKCOL, DISKROW); >> =20 >> for (i =3D 0; i < nintr; i++) { >> if (intrloc[i] =3D=3D 0) >> @@ -401,7 +366,7 @@ labelkre(void) >> } >> =20 >> #define X(fld) {t=3Ds=2Efld[i]; s=2Efld[i]-=3Ds1=2Efld[i]; if(state=3D= =3DTIME) >s1=2Efld[i]=3Dt;} >> -#define Q(fld) {t=3Dcur=2Efld[i]; cur=2Efld[i]-=3Dlast=2Efld[i]; >if(state=3D=3DTIME) last=2Efld[i]=3Dt;} >> +#define Q(fld) {t=3Dcur_dev=2Efld[i]; cur_dev=2Efld[i]-=3Dlast_dev=2Ef= ld[i]; >if(state=3D=3DTIME) last_dev=2Efld[i]=3Dt;} >> #define Y(fld) {t =3D s=2Efld; s=2Efld -=3D s1=2Efld; if(state =3D=3D = TIME) s1=2Efld >=3D t;} >> #define Z(fld) {t =3D s=2Enchstats=2Efld; s=2Enchstats=2Efld -=3D >s1=2Enchstats=2Efld; \ >> if(state =3D=3D TIME) s1=2Enchstats=2Efld =3D t;} >> @@ -543,20 +508,17 @@ showkre(void) >> PUTRATE(v_intr, GENSTATROW + 1, GENSTATCOL + 15, 4); >> PUTRATE(v_soft, GENSTATROW + 1, GENSTATCOL + 20, 4); >> PUTRATE(v_vm_faults, GENSTATROW + 1, GENSTATCOL + 25, 4); >> - for (i =3D 0, lc =3D 0; i < num_devices && lc < MAXDRIVES; i++) >> - if (dev_select[i]=2Eselected) { >> - switch(state) { >> - case TIME: >> - dinfo(i, ++lc, &cur, &last); >> - break; >> - case RUN: >> - dinfo(i, ++lc, &cur, &run); >> - break; >> - case BOOT: >> - dinfo(i, ++lc, &cur, NULL); >> - break; >> - } >> - } >> + switch(state) { >> + case TIME: >> + dsshow(MAXDRIVES, DISKCOL, DISKROW, &cur_dev, &last_dev); >> + break; >> + case RUN: >> + dsshow(MAXDRIVES, DISKCOL, DISKROW, &cur_dev, &run_dev); >> + break; >> + case BOOT: >> + dsshow(MAXDRIVES, DISKCOL, DISKROW, &cur_dev, NULL); >> + break; >> + } >> putint(s=2Enumdirtybuffers, VNSTATROW, VNSTATCOL, 7); >> putint(s=2Edesiredvnodes, VNSTATROW + 1, VNSTATCOL, 7); >> putint(s=2Enumvnodes, VNSTATROW + 2, VNSTATCOL, 7); >> @@ -582,14 +544,14 @@ cmdkre(const char *cmd, const char *args) >> if (prefix(cmd, "run")) { >> retval =3D 1; >> copyinfo(&s2, &s1); >> - switch (devstat_getdevs(NULL, &run)) { >> + switch (devstat_getdevs(NULL, &run_dev)) { >> case -1: >> errx(1, "%s", devstat_errbuf); >> break; >> case 1: >> - num_devices =3D run=2Edinfo->numdevs; >> - generation =3D run=2Edinfo->generation; >> - retval =3D dscmd("refresh", NULL, MAXDRIVES, &cur); >> + num_devices =3D run_dev=2Edinfo->numdevs; >> + generation =3D run_dev=2Edinfo->generation; >> + retval =3D dscmd("refresh", NULL, MAXDRIVES, &cur_dev); >> if (retval =3D=3D 2) >> labelkre(); >> break; >> @@ -612,14 +574,14 @@ cmdkre(const char *cmd, const char *args) >> retval =3D 1; >> if (state =3D=3D RUN) { >> getinfo(&s1); >> - switch (devstat_getdevs(NULL, &run)) { >> + switch (devstat_getdevs(NULL, &run_dev)) { >> case -1: >> errx(1, "%s", devstat_errbuf); >> break; >> case 1: >> - num_devices =3D run=2Edinfo->numdevs; >> - generation =3D run=2Edinfo->generation; >> - retval =3D dscmd("refresh",NULL, MAXDRIVES, &cur); >> + num_devices =3D run_dev=2Edinfo->numdevs; >> + generation =3D run_dev=2Edinfo->generation; >> + retval =3D dscmd("refresh",NULL, MAXDRIVES, &cur_dev); >> if (retval =3D=3D 2) >> labelkre(); >> break; >> @@ -629,7 +591,7 @@ cmdkre(const char *cmd, const char *args) >> } >> return (retval); >> } >> - retval =3D dscmd(cmd, args, MAXDRIVES, &cur); >> + retval =3D dscmd(cmd, args, MAXDRIVES, &cur_dev); >> =20 >> if (retval =3D=3D 2) >> labelkre(); >> @@ -667,7 +629,7 @@ cputime(int indx) >> return (s=2Etime[indx] * 100=2E0 / lt); >> } >> =20 >> -static void >> +void >> putint(int n, int l, int lc, int w) >> { >> =20 >> @@ -713,7 +675,7 @@ do_putuint64(uint64_t n, int l, int lc, int w, >int div >> addstr(b); >> } >> =20 >> -static void >> +void >> putfloat(double f, int l, int lc, int w, int d, int nz) >> { >> int snr; >> @@ -745,7 +707,7 @@ putfloat(double f, int l, int lc, int w, int d, >int nz >> addstr(b); >> } >> =20 >> -static void >> +void >> putlongdouble(long double f, int l, int lc, int w, int d, int nz) >> { >> int snr; >> @@ -785,7 +747,7 @@ getinfo(struct Info *ls) >> int mib[2]; >> =20 >> GETSYSCTL("kern=2Ecp_time", ls->time); >> - GETSYSCTL("kern=2Ecp_time", cur=2Ecp_time); >> + GETSYSCTL("kern=2Ecp_time", cur_dev=2Ecp_time); >> GETSYSCTL("vm=2Estats=2Esys=2Ev_swtch", ls->v_swtch); >> GETSYSCTL("vm=2Estats=2Esys=2Ev_trap", ls->v_trap); >> GETSYSCTL("vm=2Estats=2Esys=2Ev_syscall", ls->v_syscall); >> @@ -838,23 +800,12 @@ getinfo(struct Info *ls) >> size !=3D sizeof(ncpu)) >> ncpu =3D 1; >> =20 >> - tmp_dinfo =3D last=2Edinfo; >> - last=2Edinfo =3D cur=2Edinfo; >> - cur=2Edinfo =3D tmp_dinfo; >> + tmp_dinfo =3D last_dev=2Edinfo; >> + last_dev=2Edinfo =3D cur_dev=2Edinfo; >> + cur_dev=2Edinfo =3D tmp_dinfo; >> =20 >> - last=2Esnap_time =3D cur=2Esnap_time; >> - switch (devstat_getdevs(NULL, &cur)) { >> - case -1: >> - errx(1, "%s", devstat_errbuf); >> - break; >> - case 1: >> - num_devices =3D cur=2Edinfo->numdevs; >> - generation =3D cur=2Edinfo->generation; >> - cmdkre("refresh", NULL); >> - break; >> - default: >> - break; >> - } >> + last_dev=2Esnap_time =3D cur_dev=2Esnap_time; >> + dsgetinfo(&cur_dev); >> } >> =20 >> static void >> @@ -880,39 +831,4 @@ copyinfo(struct Info *from, struct Info *to) >> *to =3D *from; >> =20 >> bcopy(from->intrcnt, to->intrcnt =3D intrcnt, nintr * sizeof (int)); >> -} >> - >> -static void >> -dinfo(int dn, int lc, struct statinfo *now, struct statinfo *then) >> -{ >> - long double transfers_per_second; >> - long double kb_per_transfer, mb_per_second; >> - long double elapsed_time, device_busy; >> - int di; >> - >> - di =3D dev_select[dn]=2Eposition; >> - >> - if (then !=3D NULL) { >> - /* Calculate relative to previous sample */ >> - elapsed_time =3D now->snap_time - then->snap_time; >> - } else { >> - /* Calculate relative to device creation */ >> - elapsed_time =3D now->snap_time - devstat_compute_etime( >> - &now->dinfo->devices[di]=2Ecreation_time, NULL); >> - } >> - >> - if (devstat_compute_statistics(&now->dinfo->devices[di], then ? >> - &then->dinfo->devices[di] : NULL, elapsed_time, >> - DSM_KB_PER_TRANSFER, &kb_per_transfer, >> - DSM_TRANSFERS_PER_SECOND, &transfers_per_second, >> - DSM_MB_PER_SECOND, &mb_per_second, >> - DSM_BUSY_PCT, &device_busy, >> - DSM_NONE) !=3D 0) >> - errx(1, "%s", devstat_errbuf); >> - >> - lc =3D DISKCOL + lc * 6; >> - putlongdouble(kb_per_transfer, DISKROW + 1, lc, 5, 2, 0); >> - putlongdouble(transfers_per_second, DISKROW + 2, lc, 5, 0, 0); >> - putlongdouble(mb_per_second, DISKROW + 3, lc, 5, 2, 0); >> - putlongdouble(device_busy, DISKROW + 4, lc, 5, 0, 0); >> } >>=20 >> Modified: head/usr=2Ebin/systat/zarc=2Ec >> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/usr=2Ebin/systat/zarc=2Ec Tue Apr 2 13:59:04 2019 (r345803) >> +++ head/usr=2Ebin/systat/zarc=2Ec Tue Apr 2 14:01:03 2019 (r345804) >> @@ -1,6 +1,5 @@ >> /*- >> - * Copyright (c) 2014 >> - * The Regents of the University of California=2E All rights >reserved=2E >> + * Copyright (c) 2014 - 2017 Yoshihiro Ota >> * >> * Redistribution and use in source and binary forms, with or >without >> * modification, are permitted provided that the following >conditions >> @@ -33,11 +32,14 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> =20 >> +/* #include */ >> #include >> #include >> +#include >> =20 >> #include "systat=2Eh" >> #include "extern=2Eh" >> +#include "devs=2Eh" >> =20 >> struct zfield{ >> uint64_t arcstats; >> @@ -77,21 +79,23 @@ closezarc(WINDOW *w) >> void >> labelzarc(void) >> { >> + int row =3D 1; >> wmove(wnd, 0, 0); wclrtoeol(wnd); >> mvwprintw(wnd, 0, 31+1, "%4=2E4s %7=2E7s %7=2E7s %12=2E12s %12=2E12s"= , >> "rate", "hits", "misses", "total hits", "total misses"); >> -#define L(row, str) mvwprintw(wnd, row, 5, str); \ >> +#define L(str) mvwprintw(wnd, row, 5, #str); \ >> mvwprintw(wnd, row, 31, ":"); \ >> - mvwprintw(wnd, row, 31+4, "%%") >> - L(1, "arcstats"); >> - L(2, "arcstats=2Edemand_data"); >> - L(3, "arcstats=2Edemand_metadata"); >> - L(4, "arcstats=2Eprefetch_data"); >> - L(5, "arcstats=2Eprefetch_metadata"); >> - L(6, "zfetchstats"); >> - L(7, "arcstats=2El2"); >> - L(8, "vdev_cache_stats"); >> + mvwprintw(wnd, row, 31+4, "%%"); ++row >> + L(arcstats); >> + L(arcstats=2Edemand_data); >> + L(arcstats=2Edemand_metadata); >> + L(arcstats=2Eprefetch_data); >> + L(arcstats=2Eprefetch_metadata); >> + L(zfetchstats); >> + L(arcstats=2El2); >> + L(vdev_cache_stats); >> #undef L >> + dslabel(12, 0, 18); >> } >> =20 >> static int calc(uint64_t hits, uint64_t misses) >> @@ -131,6 +135,7 @@ domode(struct zarcstats *delta, struct zarcstats >*rate >> void >> showzarc(void) >> { >> + int row =3D 1; >> struct zarcstats delta, rate; >> =20 >> memset(&delta, 0, sizeof delta); >> @@ -138,34 +143,37 @@ showzarc(void) >> =20 >> domode(&delta, &rate); >> =20 >> -#define DO(stat, row, col, fmt) \ >> +#define DO(stat, col, fmt) \ >> mvwprintw(wnd, row, col, fmt, stat) >> -#define R(row, stat) DO(rate=2Ehits=2Estat, row, 31+1, "%3"PRIu64) >> -#define H(row, stat) DO(delta=2Ehits=2Estat, row, 31+1+5, "%7"PRIu64);= \ >> - DO(curstat=2Ehits=2Estat, row, 31+1+5+8+8, "%12"PRIu64) >> -#define M(row, stat) DO(delta=2Emisses=2Estat, row, 31+1+5+8, >"%7"PRIu64); \ >> - DO(curstat=2Emisses=2Estat, row, 31+1+5+8+8+13, "%12"PRIu64) >> -#define E(row, stat) R(row, stat); H(row, stat); M(row, stat);=20 >> - E(1, arcstats); >> - E(2, arcstats_demand_data); >> - E(3, arcstats_demand_metadata); >> - E(4, arcstats_prefetch_data); >> - E(5, arcstats_prefetch_metadata); >> - E(6, zfetchstats); >> - E(7, arcstats_l2); >> - E(8, vdev_cache_stats); >> +#define R(stat) DO(rate=2Ehits=2Estat, 31+1, "%3"PRIu64) >> +#define H(stat) DO(delta=2Ehits=2Estat, 31+1+5, "%7"PRIu64); \ >> + DO(curstat=2Ehits=2Estat, 31+1+5+8+8, "%12"PRIu64) >> +#define M(stat) DO(delta=2Emisses=2Estat, 31+1+5+8, "%7"PRIu64); \ >> + DO(curstat=2Emisses=2Estat, 31+1+5+8+8+13, "%12"PRIu64) >> +#define E(stat) R(stat); H(stat); M(stat); ++row >> + E(arcstats); >> + E(arcstats_demand_data); >> + E(arcstats_demand_metadata); >> + E(arcstats_prefetch_data); >> + E(arcstats_prefetch_metadata); >> + E(zfetchstats); >> + E(arcstats_l2); >> + E(vdev_cache_stats); >> #undef DO >> #undef E >> #undef M >> #undef H >> #undef R >> + dsshow(12, 0, 18, &cur_dev, &last_dev); >> } >> =20 >> int >> initzarc(void) >> { >> + dsinit(12); >> getinfo(&initstat); >> curstat =3D oldstat =3D initstat; >> + >> return 1; >> } >> =20 >> @@ -178,6 +186,15 @@ resetzarc(void) >> static void >> getinfo(struct zarcstats *ls) >> { >> + struct devinfo *tmp_dinfo; >> + >> + tmp_dinfo =3D last_dev=2Edinfo; >> + last_dev=2Edinfo =3D cur_dev=2Edinfo; >> + cur_dev=2Edinfo =3D tmp_dinfo; >> + >> + last_dev=2Esnap_time =3D cur_dev=2Esnap_time; >> + dsgetinfo( &cur_dev ); >> + >> size_t size =3D sizeof( ls->hits=2Earcstats ); >> if ( sysctlbyname("kstat=2Ezfs=2Emisc=2Earcstats=2Ehits", >> &ls->hits=2Earcstats, &size, NULL, 0 ) !=3D 0 ) >>=20 >>=20 Gru=C3=9F ---=20 Michael From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53235DC182; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv5n8Xz4P4y; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id C3C8619F59; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 9F7601FF1E; Sun, 31 Mar 2019 19:27:48 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 593D28E756; Sun, 31 Mar 2019 19:27:48 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 16A341FF1A; Sun, 31 Mar 2019 19:27:48 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 8BCA71FF14 for ; Sun, 31 Mar 2019 19:27:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DE018E74F; Sun, 31 Mar 2019 19:27:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38C9633C2; Sun, 31 Mar 2019 19:27:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2VJRjMr051051; Sun, 31 Mar 2019 19:27:45 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2VJRj1u051050; Sun, 31 Mar 2019 19:27:45 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201903311927.x2VJRj1u051050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345757 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 345757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 593D28E756 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:05 -0000 X-Original-Date: Sun, 31 Mar 2019 19:27:45 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:05 -0000 Author: bz Date: Sun Mar 31 19:27:44 2019 New Revision: 345757 URL: https://svnweb.freebsd.org/changeset/base/345757 Log: Improve debugging options in bcm2835_sdhci.c Similar to bcm2835_sdhost.c add a TUNABLE and SYSCTL to selectively turn on debugging printfs if debugging is turned on at compile time. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Reviewed by: gonzo, andrew Differential Revision: https://reviews.freebsd.org/D19745 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Mar 31 17:27:28 2019 (r345756) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Mar 31 19:27:44 2019 (r345757) @@ -66,8 +66,17 @@ __FBSDID("$FreeBSD$"); #define NUM_DMA_SEGS 2 #ifdef DEBUG -#define dprintf(fmt, args...) do { printf("%s(): ", __func__); \ - printf(fmt,##args); } while (0) +static int bcm2835_sdhci_debug = 0; + +TUNABLE_INT("hw.bcm2835.sdhci.debug", &bcm2835_sdhci_debug); +SYSCTL_INT(_hw_sdhci, OID_AUTO, bcm2835_sdhci_debug, CTLFLAG_RWTUN, + &bcm2835_sdhci_debug, 0, "bcm2835 SDHCI debug level"); + +#define dprintf(fmt, args...) \ + do { \ + if (bcm2835_sdhci_debug) \ + printf("%s: " fmt, __func__, ##args); \ + } while (0) #else #define dprintf(fmt, args...) #endif From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27435DC114; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yt4gl1z4P39; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id B9EA619EC6; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 85F111DA41; Sat, 30 Mar 2019 04:24:57 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 335816D678; Sat, 30 Mar 2019 04:24:57 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1875F1DA3F; Sat, 30 Mar 2019 04:24:57 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E649B1DA3A for ; Sat, 30 Mar 2019 04:24:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 457B86D674; Sat, 30 Mar 2019 04:24:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id D403CBDD; Sat, 30 Mar 2019 15:24:42 +1100 (AEDT) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345696 - head/lib/libvgl In-Reply-To: <20190329182100.GZ1923@kib.kiev.ua> Message-ID: <20190330142319.I1011@besplex.bde.org> References: <201903291557.x2TFv9AW097226@repo.freebsd.org> <20190329182100.GZ1923@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=NNzJ8SZRBfIYbTNitWcA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 335816D678 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.87 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.87)[-0.870,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:02 -0000 X-Original-Date: Sat, 30 Mar 2019 15:24:40 +1100 (EST) X-List-Received-Date: Tue, 03 Sep 2019 14:06:02 -0000 On Fri, 29 Mar 2019, Konstantin Belousov wrote: > On Fri, Mar 29, 2019 at 03:57:09PM +0000, Bruce Evans wrote: >> Author: bde >> Date: Fri Mar 29 15:57:08 2019 >> New Revision: 345696 >> URL: https://svnweb.freebsd.org/changeset/base/345696 >> >> Log: >> Fix endless loops for handling SIGBUS and SIGSEGV. >> >> r80270 has the usual wrong fix for unsafe signal handling -- just set >> a flag and return to let an event loop check the flag and do safe >> handling. This never works for signals like SIGBUS and SIGSEGV that >> repeat and works poorly for others unless the application has an event >> loop designed to support this. >> >> For these signals, clean up unsafely as before, except for arranging that >> nested signals are fatal and forcing a nested signal if the cleanup doesn't >> cause one. >> >> Modified: >> head/lib/libvgl/main.c >> >> Modified: head/lib/libvgl/main.c >> ============================================================================== >> --- head/lib/libvgl/main.c Fri Mar 29 15:20:48 2019 (r345695) >> +++ head/lib/libvgl/main.c Fri Mar 29 15:57:08 2019 (r345696) >> ... >> @@ -107,14 +107,22 @@ struct vt_mode smode; >> } >> >> static void >> -VGLAbort(int arg __unused) >> +VGLAbort(int arg) >> { >> + sigset_t mask; >> + >> VGLAbortPending = 1; >> signal(SIGINT, SIG_IGN); >> signal(SIGTERM, SIG_IGN); >> - signal(SIGSEGV, SIG_IGN); >> - signal(SIGBUS, SIG_IGN); >> signal(SIGUSR2, SIG_IGN); >> + if (arg == SIGBUS || arg == SIGSEGV) { >> + signal(arg, SIG_DFL); >> + sigemptyset(&mask); >> + sigaddset(&mask, arg); >> + sigprocmask(SIG_UNBLOCK, &mask, NULL); >> + VGLEnd(); >> + kill(getpid(), arg); > This of course misses the siginfo information from the real fault. It is in the nested signal frame. > Why SIGBUS/SIGSEGV are caught at all ? Otherwise, the screen is left in an application mode that the kernel doesn't support (except to not write to the screen, so that the application has full control). Of course, it is bad for libraries to catch signals. The man page warns about installing signal handlers and trying to call VGLEnd() and exit(3) [from the signal handler] to end the program, although it is important to use VGLEnd() to end the program. I haven't tried installing signal handlers in programs, but my main application is another graphics library that wraps libvgl, and it installs an atexit() handler which calls its cleanup function which calls VGLEnd(). libvgl should do the same. The cleanup is safe in exit() provided calling exit() is safe. The man page has general nonsense recommending setting a flag and not terminating the program in signal handlers. This was added in the same commit that completely broke the SIGBUS and SIGSEGV handling using this method. A much longer lesson is needed to describe how to use this method correctly. SA_RESTART must be turned off for all signals, and this gives the complexity of handling EINTR returns from all syscalls affected by SA_RESTART ... The man page has almost enough details about which signals the library catches. It doesn't mention SIGUSR1 (used for screen switches) or SIGUSR2 (used for mouse signals). I plan to add use of SIGIO to fix busy-waiting for keyboard events. select() might work for the keyboard, but I doubt that it works for the mouse. What should happen is if the application installs signal handlers and does unsafe things not including calling VGLEnd(), then nested SIGBUS's and SIGSEGV's should reach the above cleanup. Applications should not catch SIGBUS or SIGSEGV unless they can clean up better than the above. It is possible to clean up better than the above, but not in applications. The above can check a soft signal mask flag like the one set by INTOFF() and not do so much when it is set. When it is not set, I think restoring the screen mode is safe in signal handlers, and only things like free() and printf() are not safe in signal handlers. > >> + } >> } >> >> static void > Bruce From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37C99DC11B; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yt4Lhtz4P36; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id A7F4419EC3; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id EEF0C1D128; Sat, 30 Mar 2019 04:10:27 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D0D56C886; Sat, 30 Mar 2019 04:10:27 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0F8E91D0E8; Sat, 30 Mar 2019 04:10:27 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 0E9181D0E0 for ; Sat, 30 Mar 2019 04:10:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E72516C86F for ; Sat, 30 Mar 2019 04:10:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82d.google.com with SMTP id w30so4766039qta.8 for ; Fri, 29 Mar 2019 21:10:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/h33n9/OH8gsuUYw2JJGYJtNFYReSU0fvCH/PkoJJT0=; b=Xd/JkF1D7jtHlVJtRfgVo0x/QEu7qLr8JIddOdGZ9XhJDKRSgHzKJ5hyMsghKZa+Zi bxmExtnfykVsbksgSaLqGWqq/efE7casIXFDLMnrKyxNAaeZtz3Bk2LpyyoIyMYz69Ux R4fol/ARYc2/9PdhahHRz/LOtsr076RAPSn9L8CItuHZ6fwNwbhDaxgNfFrNcSTG0GP+ wJ3yaH9zyAykb+cOK2Zjrlq3GYoHqVBHuIb29ihEeLIvNMiMOqIaJPTDHR7+hH5GJGDU usreJf7hH5PnZ7KTDRXtth2ipqRgE3z7bzeUw5pVQQYCzeQIiC4bOJn5yuHtIE4Wn0S8 FNcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/h33n9/OH8gsuUYw2JJGYJtNFYReSU0fvCH/PkoJJT0=; b=tE61cu9lCYyxnYkGukPCjwLFIJ2SBJbTBaE/f9yABjRuraNiWw65iFyqAYtDKLKRgN VZqAj6XSuPtwi2bqjg93I0bDXHlymI73RRpdFx+aSDCa17IP1HUZ8orJqIdrab4eUv/H LIKfiGf1CMR63g1UpoOpSjRK7grulLUUHQ9QITKqn9FlwrjKD9nDE6Ua5Me2OoKy2YOp 36aERS7rKuJIVFsI9J8ZEI5sfBLxEfNt7bl1XC2TzYEOkhE3rauKrN3QXWCqIX0mMeO7 ByJClB7PpAeQYw/62+5En/q3XTMrDJUQNwDTeKbGRm4fXtUzjuDL3H94fnpk3mBxxLoh 71nQ== X-Gm-Message-State: APjAAAX1J0qVig9g7yv0FyGo6lb1ZYphPVJ0Q66wM0wb5HWA5qXMqnCv 3fdK8lQmQc2dBUuKXyzRTgmS9CD6uM/K9T2zndrM0g== X-Google-Smtp-Source: APXvYqyaGuq6e9/6MTKs0oR1i7mB46gfp/cbIAlIKyQP0JG/DF+bJ20xspXEHsrx4EmJuLxq2Ho7zFj1C+EMuioM5U4= X-Received: by 2002:ac8:304a:: with SMTP id g10mr45047889qte.118.1553919022055; Fri, 29 Mar 2019 21:10:22 -0700 (PDT) MIME-Version: 1.0 References: <201903300309.x2U39DtW002526@gndrsh.dnsmgr.net> In-Reply-To: From: Warner Losh Message-ID: Subject: Re: svn commit: r345707 - in head: lib/clang lib/libc++ lib/libc++experimental lib/libc++fs lib/libc/tests/stdlib lib/libclang_rt lib/libcxxrt lib/libgcc_eh lib/libomp lib/ofed/libibnetdisc share/mk us... To: Garrett Cooper Cc: "Rodney W. Grimes" , Garrett Cooper , src-committers , svn-src-all , svn-src-head@freebsd.org Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 5D0D56C886 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.87 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.87)[-0.871,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] Status: O Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:03 -0000 X-Original-Date: Fri, 29 Mar 2019 22:10:10 -0600 X-List-Received-Date: Tue, 03 Sep 2019 14:06:03 -0000 On Fri, Mar 29, 2019, 9:15 PM Enji Cooper wrote: > > > On Mar 29, 2019, at 8:09 PM, Rodney W. Grimes > wrote: > > > >> Author: ngie > >> Date: Fri Mar 29 18:43:46 2019 > >> New Revision: 345707 > >> URL: https://svnweb.freebsd.org/changeset/base/345707 > >> > >> Log: > >> Revert r345706: the third time will be the charm > >> > >> When a review is closed via Phabricator it updates the patch attached > to the > >> review. I downloaded the raw patch from Phabricator, applied it, and > repeated > >> my mistake from r345704 by accident mixing content from D19732 and > D19738. > > > > Which, arguable is a feature or mis feature depending on the point > > of view. I do not like it when I go to look at someone elses > > committed code siting a review, as I want to actually see what > > it was that was committed. You can find the pre-commit diff, > > but it takes a bit of probling. The upside is you can get > > both diffs from the same place and diff the diffs :-) > > > >> For my own personal sanity, I will try not to mix reviews like this i= n > the > >> future. > > > > :-) Been there, almost did that too. > > Pre commit last minute svn diff saved me. > > =E2=80=A6 > > This is why I=E2=80=99m doing the following from here on out: > > $ arc patch > $ svn ci > > Unfortunately svn doesn=E2=80=99t support all of the niceties of =E2=80= =9Carc land=E2=80=9D. > Otherwise, I would have used that. > > The Facebook version of =E2=80=9Carc land=E2=80=9D (before their new non-= public variation) > supported verifying diffs in local repos vs Phabricator to make sure that > the diff content was consistent/correct. > > * Pro: it would catch issues like what I did the first time. > * Con: I couldn=E2=80=99t make last minute changes (I would need to resub= mit the > change and have it re-reviewed, which I argue is a good feature). > > Just some food for thought. For now, arc patch/svn ci works for me. > I use git svn and git show every commit so I'm sure when I want to do multiple at once. Phab doesn't make that easy, alas, so I often choose the lesser evil of just getting a review on the squashed branch. I only split when there is a good reason. If we had better tools, I wouldn't be forced to pick, but you go to wat with the tools you have... Warner > From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1052DC336; Tue, 3 Sep 2019 14:06:05 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z12LcLz4PBF; Tue, 3 Sep 2019 14:06:05 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 8C1FB1A0E7; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 1BB5988D9; Tue, 2 Apr 2019 20:03:08 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EF2F75A04; Tue, 2 Apr 2019 20:03:07 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 13FB58870; Tue, 2 Apr 2019 20:03:07 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5EE7E886B for ; Tue, 2 Apr 2019 20:03:04 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 162E6759FB; Tue, 2 Apr 2019 20:03:04 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0CFB3039; Tue, 2 Apr 2019 20:03:03 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x32K33Fn084419; Tue, 2 Apr 2019 20:03:03 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x32K33KB084418; Tue, 2 Apr 2019 20:03:03 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201904022003.x32K33KB084418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345816 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 345816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 4EF2F75A04 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:13 -0000 X-Original-Date: Tue, 2 Apr 2019 20:03:03 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:13 -0000 Author: ygy (doc committer) Date: Tue Apr 2 20:03:03 2019 New Revision: 345816 URL: https://svnweb.freebsd.org/changeset/base/345816 Log: Correct SMC definition in asmc(4) man page. MFC after: 3 days PR: 236954 Submitted by: fbsdbugs4@sentry.org Modified: head/share/man/man4/asmc.4 Modified: head/share/man/man4/asmc.4 ============================================================================== --- head/share/man/man4/asmc.4 Tue Apr 2 19:37:52 2019 (r345815) +++ head/share/man/man4/asmc.4 Tue Apr 2 20:03:03 2019 (r345816) @@ -25,12 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd July 27, 2009 +.Dd April 2, 2019 .Dt ASMC 4 .Os .Sh NAME .Nm asmc -.Nd device driver for the Apple System Management Console (SMC) +.Nd device driver for the Apple System Management Controller (SMC) .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: @@ -47,7 +47,7 @@ asmc_load="YES" .Sh DESCRIPTION The .Nm -driver controls the Apple System Management Console (SMC for short) +driver controls the Apple System Management Controller (SMC for short) found on Intel Apple systems. .Pp The SMC is known to be found on the following systems: From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9828CDC19E; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv5k88z4P4v; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id A0F6D19F4B; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 092B519B63; Sun, 31 Mar 2019 13:05:02 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30FE8801C8; Sun, 31 Mar 2019 13:05:01 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 184FF19B23; Sun, 31 Mar 2019 13:05:01 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 0941F19B21 for ; Sun, 31 Mar 2019 13:04:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 52DF8801C6; Sun, 31 Mar 2019 13:04:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id C140A435AFF; Mon, 1 Apr 2019 00:04:46 +1100 (AEDT) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345696 - head/lib/libvgl In-Reply-To: <20190331121015.GK1923@kib.kiev.ua> Message-ID: <20190331231926.M1259@besplex.bde.org> References: <201903291557.x2TFv9AW097226@repo.freebsd.org> <20190329182100.GZ1923@kib.kiev.ua> <20190330142319.I1011@besplex.bde.org> <20190330094558.GA1923@kib.kiev.ua> <20190331214235.K961@besplex.bde.org> <20190331121015.GK1923@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=eXRxiV3CohSvq8xHZQUA:9 a=H1mtotZp0YcqXXkM:21 a=0wmE6ijukHcXjSzu:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 30FE8801C8 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.91 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.906,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:06 -0000 X-Original-Date: Mon, 1 Apr 2019 00:04:45 +1100 (EST) X-List-Received-Date: Tue, 03 Sep 2019 14:06:06 -0000 On Sun, 31 Mar 2019, Konstantin Belousov wrote: > On Sun, Mar 31, 2019 at 10:27:54PM +1100, Bruce Evans wrote: >> On Sat, 30 Mar 2019, Konstantin Belousov wrote: >> >>> On Sat, Mar 30, 2019 at 03:24:40PM +1100, Bruce Evans wrote: >>>> On Fri, 29 Mar 2019, Konstantin Belousov wrote: >>>> >>>>> On Fri, Mar 29, 2019 at 03:57:09PM +0000, Bruce Evans wrote: >>>>>> Author: bde >>>>>> Date: Fri Mar 29 15:57:08 2019 >>>>>> New Revision: 345696 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/345696 >>>>>> >>>>>> Log: >>>>>> Fix endless loops for handling SIGBUS and SIGSEGV. >>>>>> >>>>>> r80270 has the usual wrong fix for unsafe signal handling -- just set >>>>>> a flag and return to let an event loop check the flag and do safe >>>>>> handling. This never works for signals like SIGBUS and SIGSEGV that >>>>>> repeat and works poorly for others unless the application has an event >>>>>> loop designed to support this. >>>>>> >>>>>> For these signals, clean up unsafely as before, except for arranging that >>>>>> nested signals are fatal and forcing a nested signal if the cleanup doesn't >>>>>> cause one. >>>>>> >>>>>> Modified: >>>>>> head/lib/libvgl/main.c >>>>>> >>>>>> Modified: head/lib/libvgl/main.c >>>>>> ============================================================================== >>>>>> --- head/lib/libvgl/main.c Fri Mar 29 15:20:48 2019 (r345695) >>>>>> +++ head/lib/libvgl/main.c Fri Mar 29 15:57:08 2019 (r345696) >>>>>> ... >>>>>> @@ -107,14 +107,22 @@ struct vt_mode smode; >>>>>> } >>>>>> >>>>>> static void >>>>>> -VGLAbort(int arg __unused) >>>>>> +VGLAbort(int arg) >>>>>> { >>>>>> + sigset_t mask; >>>>>> + >>>>>> VGLAbortPending = 1; >>>>>> signal(SIGINT, SIG_IGN); >>>>>> signal(SIGTERM, SIG_IGN); >>>>>> - signal(SIGSEGV, SIG_IGN); >>>>>> - signal(SIGBUS, SIG_IGN); >>>>>> signal(SIGUSR2, SIG_IGN); >>>>>> + if (arg == SIGBUS || arg == SIGSEGV) { >>>>>> + signal(arg, SIG_DFL); >>>>>> + sigemptyset(&mask); >>>>>> + sigaddset(&mask, arg); >>>>>> + sigprocmask(SIG_UNBLOCK, &mask, NULL); >>>>>> + VGLEnd(); >>>>>> + kill(getpid(), arg); >>>>> This of course misses the siginfo information from the real fault. >>>> >>>> It is in the nested signal frame. >>>> >>>>> Why SIGBUS/SIGSEGV are caught at all ? >>>> >>>> Otherwise, the screen is left in an application mode that the kernel >>>> doesn't support (except to not write to the screen, so that the >>>> application has full control). >> >> Also, the keyboard may be left in a strange state. Usually this is no >> worse than termios raw mode, but it may be raw scancodes. In raw scancodes >> mode, Alt-Fn to switch to another vty to fix the problem. libvgl disables >> switching to another vty without going through a libvgl handler anyway. >> The combination is usually enough to break switching to vty0 to run ddb, >> though that should work for at least breakpoints in the kernel. IIRC, >> sc_cngrab() switches the keyboard mode, and my version of it restores >> ignoring of the anti-switch flag. >> >>> ... >>> I am more about not doing kill(2) from the handler, instead do plain >>> return to the context which caused the original signal. >> >> That won't work well for SIGBUS's and SIGSEGV's related to the library. >> If the above cleanup is not done, then it is too hard to debug the problem, >> and if the above cleanup is done then it is impossible to debug the original >> problem if it was for and invalid access in libvgl code. >> >> The latter is a problem for the above cleanup too -- the cleanup clobbers >> the libvgl state. >> >> However, I could do a more limited cleanup of just restoring the screen and >> keyboard state using ioctls. ioctl() isn't async-signal safe in POSIX, but >> most ioctls are async-signal safe in practice provided they don't use >> global variables that were set too recently or too non-atomically. >> VGLEnd() uses main globals established by VGLInit(). It depends on program >> order which is not guaranteed in signal handlers for testing the flags set >> by initialization. The cleanup now also does: >> - screen clearing. This breaks debugging and is dangerous if the bug is >> in screen clearing. Screen clearing is also very slow, and belongs >> in the kernel. It is now done 4 times per libvgl use, but its >> slowness is limited by the kernel not clearing properly and the >> kernel not allowing the application to mmap() the whole physical >> frame buffer in some versions of FreeBSD (this breaks panning). >> - munmap(). This breaks debugging. >> - free() of backing store buffer and the main VGLDisplay data. This breaks >> debugging and is unnecessary if we are going to exit. > > You can only try to do async-safe calls from SIGSEGV handler, to not > break a limited chances to success. Also you should not modify in-memory > state for the library, for the same reason, and then it fits your goal > of keeping the state intact for debugging. Then you should return to > re-create the original situation causing and not kill(2). That is what I suggested in "however". However2, it is extra work to write a different exit path. When running the program directly under gdb, you also have to tell gdb to not stop at any caught signal, since the screen will be unusable then. > I find it weird to try to debug mode-switched code without serial console. Running gdb on a remote system via a remote shell works almost as well. It is inconvenient to type lots of unobvious redirection commands like 0<>/dev/ttyv0. (libvgl needs fd 0 open for both reading and writing for mmap(), while vidcontrol needs fd 0 only open for reading to do write-like ioctls to it, and fd 2 (actually stdio stderr) open for writing to write escape sequences to it.) Serial consoles are not always available. Better debuggers switch the screen mode as necessary. I recently noticed another mode switching problem. On i386, cycling through about 50 modes to test them all takes a small fraction of a second for each mode switch (done directly in syscons or by a vm86 BIOS call) even when the monitor takes too long to resync (the monitor resyncs are coalesced, so 50 resyncs take about 5 seconds instead of 250). But on amd64, mode switches to VESA mode and back take about 20 seconds. They are not coalesced, and most of the system is stopped waiting for them (at least remote network access is stopped). amd64 can't use vm86, so it emulates BIOS calls. Why does the emulation stop the rest of the system and take so long? Bruce From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 297F3DC164; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv0pZkz4P3d; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id DFC4D19EE9; Tue, 3 Sep 2019 14:05:52 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id AFE9B1349; Sat, 30 Mar 2019 09:46:15 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A29877BB2; Sat, 30 Mar 2019 09:46:15 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 135AA1335; Sat, 30 Mar 2019 09:46:15 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 011091333 for ; Sat, 30 Mar 2019 09:46:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47A3C77BAF; Sat, 30 Mar 2019 09:46:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x2U9k1Mf079595 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 30 Mar 2019 11:46:04 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x2U9k1Mf079595 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x2U9jwdT079594; Sat, 30 Mar 2019 11:45:58 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345696 - head/lib/libvgl Message-ID: <20190330094558.GA1923@kib.kiev.ua> References: <201903291557.x2TFv9AW097226@repo.freebsd.org> <20190329182100.GZ1923@kib.kiev.ua> <20190330142319.I1011@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190330142319.I1011@besplex.bde.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3A29877BB2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.88 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.88)[-0.884,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:05 -0000 X-Original-Date: Sat, 30 Mar 2019 11:45:58 +0200 X-List-Received-Date: Tue, 03 Sep 2019 14:06:05 -0000 On Sat, Mar 30, 2019 at 03:24:40PM +1100, Bruce Evans wrote: > On Fri, 29 Mar 2019, Konstantin Belousov wrote: > > > On Fri, Mar 29, 2019 at 03:57:09PM +0000, Bruce Evans wrote: > >> Author: bde > >> Date: Fri Mar 29 15:57:08 2019 > >> New Revision: 345696 > >> URL: https://svnweb.freebsd.org/changeset/base/345696 > >> > >> Log: > >> Fix endless loops for handling SIGBUS and SIGSEGV. > >> > >> r80270 has the usual wrong fix for unsafe signal handling -- just set > >> a flag and return to let an event loop check the flag and do safe > >> handling. This never works for signals like SIGBUS and SIGSEGV that > >> repeat and works poorly for others unless the application has an event > >> loop designed to support this. > >> > >> For these signals, clean up unsafely as before, except for arranging that > >> nested signals are fatal and forcing a nested signal if the cleanup doesn't > >> cause one. > >> > >> Modified: > >> head/lib/libvgl/main.c > >> > >> Modified: head/lib/libvgl/main.c > >> ============================================================================== > >> --- head/lib/libvgl/main.c Fri Mar 29 15:20:48 2019 (r345695) > >> +++ head/lib/libvgl/main.c Fri Mar 29 15:57:08 2019 (r345696) > >> ... > >> @@ -107,14 +107,22 @@ struct vt_mode smode; > >> } > >> > >> static void > >> -VGLAbort(int arg __unused) > >> +VGLAbort(int arg) > >> { > >> + sigset_t mask; > >> + > >> VGLAbortPending = 1; > >> signal(SIGINT, SIG_IGN); > >> signal(SIGTERM, SIG_IGN); > >> - signal(SIGSEGV, SIG_IGN); > >> - signal(SIGBUS, SIG_IGN); > >> signal(SIGUSR2, SIG_IGN); > >> + if (arg == SIGBUS || arg == SIGSEGV) { > >> + signal(arg, SIG_DFL); > >> + sigemptyset(&mask); > >> + sigaddset(&mask, arg); > >> + sigprocmask(SIG_UNBLOCK, &mask, NULL); > >> + VGLEnd(); > >> + kill(getpid(), arg); > > This of course misses the siginfo information from the real fault. > > It is in the nested signal frame. > > > Why SIGBUS/SIGSEGV are caught at all ? > > Otherwise, the screen is left in an application mode that the kernel > doesn't support (except to not write to the screen, so that the > application has full control). > > Of course, it is bad for libraries to catch signals. The man page warns > about installing signal handlers and trying to call VGLEnd() and exit(3) > [from the signal handler] to end the program, although it is important > to use VGLEnd() to end the program. I haven't tried installing signal > handlers in programs, but my main application is another graphics library > that wraps libvgl, and it installs an atexit() handler which calls its > cleanup function which calls VGLEnd(). libvgl should do the same. The > cleanup is safe in exit() provided calling exit() is safe. > > The man page has general nonsense recommending setting a flag and not > terminating the program in signal handlers. This was added in the same > commit that completely broke the SIGBUS and SIGSEGV handling using this > method. A much longer lesson is needed to describe how to use this > method correctly. SA_RESTART must be turned off for all signals, and > this gives the complexity of handling EINTR returns from all syscalls > affected by SA_RESTART ... > > The man page has almost enough details about which signals the library > catches. It doesn't mention SIGUSR1 (used for screen switches) or > SIGUSR2 (used for mouse signals). I plan to add use of SIGIO to fix > busy-waiting for keyboard events. select() might work for the keyboard, > but I doubt that it works for the mouse. > > What should happen is if the application installs signal handlers and > does unsafe things not including calling VGLEnd(), then nested SIGBUS's > and SIGSEGV's should reach the above cleanup. Applications should not > catch SIGBUS or SIGSEGV unless they can clean up better than the above. > It is possible to clean up better than the above, but not in applications. > The above can check a soft signal mask flag like the one set by INTOFF() > and not do so much when it is set. When it is not set, I think restoring > the screen mode is safe in signal handlers, and only things like free() > and printf() are not safe in signal handlers. I am more about not doing kill(2) from the handler, instead do plain return to the context which caused the original signal. From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2AE00DC386; Tue, 3 Sep 2019 14:06:07 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z26R5Yz4PCT; Tue, 3 Sep 2019 14:06:06 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 1ABF71A145; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id DA38910217; Wed, 3 Apr 2019 03:57:43 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37F988ED70; Wed, 3 Apr 2019 03:57:43 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 125F0101DD; Wed, 3 Apr 2019 03:57:43 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 2A019101DB for ; Wed, 3 Apr 2019 03:57:40 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA86A8ED6A; Wed, 3 Apr 2019 03:57:39 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7C36847D; Wed, 3 Apr 2019 03:57:39 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x333vd5J035255; Wed, 3 Apr 2019 03:57:39 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x333vblZ035243; Wed, 3 Apr 2019 03:57:37 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201904030357.x333vblZ035243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345830 - in head: lib/libsecureboot lib/libsecureboot/h share/mk stand stand/common sys/conf sys/security/mac_veriexec_parser tools/build/options X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head: lib/libsecureboot lib/libsecureboot/h share/mk stand stand/common sys/conf sys/security/mac_veriexec_parser tools/build/options X-SVN-Commit-Revision: 345830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 37F988ED70 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:13 -0000 X-Original-Date: Wed, 3 Apr 2019 03:57:37 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:13 -0000 Author: mw Date: Wed Apr 3 03:57:37 2019 New Revision: 345830 URL: https://svnweb.freebsd.org/changeset/base/345830 Log: Create kernel module to parse Veriexec manifest based on envs The current approach of injecting manifest into mac_veriexec is to verify the integrity of it in userspace (veriexec (8)) and pass its entries into kernel using a char device (/dev/veriexec). This requires verifying root partition integrity in loader, for example by using memory disk and checking its hash. Otherwise if rootfs is compromised an attacker could inject their own data. This patch introduces an option to parse manifest in kernel based on envs. The loader sets manifest path and digest. EVENTHANDLER is used to launch the module right after the rootfs is mounted. It has to be done this way, since one might want to verify integrity of the init file. This means that manifest is required to be present on the root partition. Note that the envs have to be set right before boot to make sure that no one can spoof them. Submitted by: Kornel Duleba Reviewed by: sjg Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D19281 Added: head/lib/libsecureboot/pass_manifest.c (contents, props changed) head/sys/security/mac_veriexec_parser/ head/sys/security/mac_veriexec_parser/mac_veriexec_parser.c (contents, props changed) head/tools/build/options/WITH_LOADER_VERIEXEC_PASS_MANFIEST (contents, props changed) Modified: head/lib/libsecureboot/Makefile.libsa.inc head/lib/libsecureboot/h/verify_file.h head/lib/libsecureboot/libsecureboot-priv.h head/lib/libsecureboot/verify_file.c head/share/mk/src.opts.mk head/stand/common/boot.c head/stand/common/module.c head/stand/loader.mk head/sys/conf/files Modified: head/lib/libsecureboot/Makefile.libsa.inc ============================================================================== --- head/lib/libsecureboot/Makefile.libsa.inc Wed Apr 3 03:54:30 2019 (r345829) +++ head/lib/libsecureboot/Makefile.libsa.inc Wed Apr 3 03:57:37 2019 (r345830) @@ -29,6 +29,11 @@ CFLAGS+= \ -I${SRCTOP}/stand/efi/include/${MACHINE} .endif +.if ${MK_LOADER_VERIEXEC_PASS_MANIFEST} == "yes" +SRCS+= \ + pass_manifest.c +.endif + # this is the list of paths (relative to a file # that we need to verify) used to find a signed manifest. # the signature extensions in VE_SIGNATURE_EXT_LIST Modified: head/lib/libsecureboot/h/verify_file.h ============================================================================== --- head/lib/libsecureboot/h/verify_file.h Wed Apr 3 03:54:30 2019 (r345829) +++ head/lib/libsecureboot/h/verify_file.h Wed Apr 3 03:57:37 2019 (r345830) @@ -32,6 +32,7 @@ #define VE_WANT 1 /* we want this verified */ #define VE_MUST 2 /* this must be verified */ +#define VE_NOT_CHECKED -42 #define VE_VERIFIED 1 /* all good */ #define VE_UNVERIFIED_OK 0 /* not verified but that's ok */ #define VE_NOT_VERIFYING 2 /* we are not verifying */ @@ -42,6 +43,8 @@ void ve_debug_set(int); int ve_status_get(int); void ve_efi_init(void); int load_manifest(const char *, const char *, const char *, struct stat *); +int pass_manifest(const char *, const char *); +int pass_manifest_export_envs(void); int verify_file(int, const char *, off_t, int); void verify_pcr_export(void); Modified: head/lib/libsecureboot/libsecureboot-priv.h ============================================================================== --- head/lib/libsecureboot/libsecureboot-priv.h Wed Apr 3 03:54:30 2019 (r345829) +++ head/lib/libsecureboot/libsecureboot-priv.h Wed Apr 3 03:57:37 2019 (r345830) @@ -31,6 +31,8 @@ /* public api */ #include "libsecureboot.h" +struct stat; + typedef struct { unsigned char *data; size_t hash_size; @@ -49,6 +51,9 @@ int verify_rsa_digest(br_rsa_public_key *pkey, const unsigned char *hash_oid, unsigned char *mdata, size_t mlen, unsigned char *sdata, size_t slen); + +int is_verified(struct stat *stp); +void add_verify_status(struct stat *stp, int status); int openpgp_self_tests(void); Added: head/lib/libsecureboot/pass_manifest.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsecureboot/pass_manifest.c Wed Apr 3 03:57:37 2019 (r345830) @@ -0,0 +1,152 @@ +/*- + * Copyright (c) 2019 Stormshield. + * Copyright (c) 2019 Semihalf. + * + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "libsecureboot-priv.h" +#include + +/* + * Values to pass to kernel by envs. + */ +static char manifest_path[MAXPATHLEN]; +static char manifest_prefix[MAXPATHLEN]; +static char manifest_hash[2 * br_sha256_SIZE + 2]; +static int manifest_present = 0; + +/* + * Verify and pass manifest path and digest to kernel through envs. + * The paths in manifest can be either absolute, + * or "prefix", if exists will be added to the ones that are not. + */ +int +pass_manifest(const char *path, const char *prefix) +{ + char *content; + struct stat st; + unsigned char digest[br_sha256_SIZE]; + const br_hash_class *md; + br_hash_compat_context ctx; + int rc; + + content = NULL; + md = &br_sha256_vtable; + + if (strnlen(path, MAXPATHLEN) == MAXPATHLEN || + strnlen(prefix, MAXPATHLEN) == MAXPATHLEN) + return (EINVAL); + + rc = stat(path, &st); + if (rc != 0) + goto out; + + if (!S_ISREG(st.st_mode)) { + rc = EINVAL; + goto out; + } + + rc = is_verified(&st); + + if (rc != VE_NOT_CHECKED && rc != VE_VERIFIED) { + rc = EPERM; + goto out; + } + + if (rc == VE_VERIFIED) + content = read_file(path, NULL); + else + content = (char *)verify_signed(path, VEF_VERBOSE); + + if (content == NULL) { + add_verify_status(&st, VE_FINGERPRINT_WRONG); + rc = EIO; + goto out; + } + + add_verify_status(&st, VE_VERIFIED); + + md->init(&ctx.vtable); + md->update(&ctx.vtable, content, st.st_size); + md->out(&ctx.vtable, digest); + + if (prefix == NULL) + manifest_prefix[0] = '\0'; + else + strcpy(manifest_prefix, prefix); + + strcpy(manifest_path, path); + + hexdigest(manifest_hash, 2 * br_sha256_SIZE + 2, + digest, br_sha256_SIZE); + manifest_hash[2*br_sha256_SIZE] = '\0'; + + manifest_present = 1; + rc = 0; + +out: + if (content != NULL) + free(content); + + return (rc); +} + +/* + * Set appropriate envs to inform kernel about manifest location and digest. + * This should be called right before boot so that envs can't be replaced. + */ +int +pass_manifest_export_envs() +{ + int rc; + + /* If we have nothing to pass make sure that envs are empty. */ + if (!manifest_present) { + unsetenv("veriexec.manifest_path"); + unsetenv("veriexec.manifest_hash"); + unsetenv("veriexec.manifest_prefix"); + return (0); + } + + rc = setenv("veriexec.manifest_path", manifest_path, 1); + if (rc != 0) + return (rc); + + rc = setenv("veriexec.manifest_hash", manifest_hash, 1); + if (rc != 0) { + unsetenv("veriexec.manifest_path"); + return (rc); + } + + if (manifest_prefix[0] != '\0') + rc = setenv("veriexec.manifest_prefix", manifest_prefix, 1); + + return (rc); +} + Modified: head/lib/libsecureboot/verify_file.c ============================================================================== --- head/lib/libsecureboot/verify_file.c Wed Apr 3 03:54:30 2019 (r345829) +++ head/lib/libsecureboot/verify_file.c Wed Apr 3 03:57:37 2019 (r345830) @@ -36,8 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define VE_NOT_CHECKED -42 - #ifdef UNIT_TEST # include # define panic warn @@ -112,7 +110,7 @@ struct verify_status { struct verify_status *vs_next; }; -static int +int is_verified(struct stat *stp) { struct verify_status *vsp; @@ -126,7 +124,7 @@ is_verified(struct stat *stp) } /* most recent first, since most likely to see repeated calls. */ -static void +void add_verify_status(struct stat *stp, int status) { struct verify_status *vsp; Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Apr 3 03:54:30 2019 (r345829) +++ head/share/mk/src.opts.mk Wed Apr 3 03:57:37 2019 (r345830) @@ -205,6 +205,7 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FIREWIRE \ LOADER_FORCE_LE \ LOADER_VERBOSE \ + LOADER_VERIEXEC_PASS_MANIFEST \ NAND \ OFED_EXTRA \ OPENLDAP \ @@ -545,6 +546,10 @@ MK_LLDB:= no MK_CLANG_EXTRAS:= no MK_CLANG_FULL:= no MK_LLVM_COV:= no +.endif + +.if ${MK_LOADER_VERIEXEC} == "no" +MK_LOADER_VERIEXEC_PASS_MANIFEST := no .endif # Modified: head/stand/common/boot.c ============================================================================== --- head/stand/common/boot.c Wed Apr 3 03:54:30 2019 (r345829) +++ head/stand/common/boot.c Wed Apr 3 03:57:37 2019 (r345830) @@ -108,6 +108,9 @@ command_boot(int argc, char *argv[]) #ifdef LOADER_VERIEXEC verify_pcr_export(); /* for measured boot */ +#ifdef LOADER_VERIEXEC_PASS_MANIFEST + pass_manifest_export_envs(); +#endif #endif /* Call the exec handler from the loader matching the kernel */ Modified: head/stand/common/module.c ============================================================================== --- head/stand/common/module.c Wed Apr 3 03:54:30 2019 (r345829) +++ head/stand/common/module.c Wed Apr 3 03:57:37 2019 (r345830) @@ -159,6 +159,13 @@ command_load(int argc, char *argv[]) ve_debug_set(dflag); return (load_manifest(argv[1], prefix, skip, NULL)); } +#ifdef LOADER_VERIEXEC_PASS_MANIFEST + if (strncmp(typestr, "pass_manifest", 13) == 0) { + if (dflag > 0) + ve_debug_set(dflag); + return (pass_manifest(argv[1], prefix)); + } +#endif #endif fp = file_findfile(argv[1], typestr); Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Wed Apr 3 03:54:30 2019 (r345829) +++ head/stand/loader.mk Wed Apr 3 03:57:37 2019 (r345830) @@ -77,6 +77,10 @@ SRCS+= interp_simple.c CFLAGS+= -DLOADER_VERIEXEC -I${SRCTOP}/lib/libsecureboot/h .endif +.if ${MK_LOADER_VERIEXEC_PASS_MANIFEST} != "no" +CFLAGS+= -DLOADER_VERIEXEC_PASS_MANIFEST -I${SRCTOP}/lib/libsecureboot/h +.endif + .if defined(BOOT_PROMPT_123) CFLAGS+= -DBOOT_PROMPT_123 .endif Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Apr 3 03:54:30 2019 (r345829) +++ head/sys/conf/files Wed Apr 3 03:57:37 2019 (r345830) @@ -4890,14 +4890,15 @@ security/mac_portacl/mac_portacl.c optional mac_portac security/mac_seeotheruids/mac_seeotheruids.c optional mac_seeotheruids security/mac_stub/mac_stub.c optional mac_stub security/mac_test/mac_test.c optional mac_test -security/mac_veriexec/mac_veriexec.c optional mac_veriexec -security/mac_veriexec/veriexec_fingerprint.c optional mac_veriexec -security/mac_veriexec/veriexec_metadata.c optional mac_veriexec -security/mac_veriexec/mac_veriexec_rmd160.c optional mac_veriexec_rmd160 -security/mac_veriexec/mac_veriexec_sha1.c optional mac_veriexec_sha1 -security/mac_veriexec/mac_veriexec_sha256.c optional mac_veriexec_sha256 -security/mac_veriexec/mac_veriexec_sha384.c optional mac_veriexec_sha384 -security/mac_veriexec/mac_veriexec_sha512.c optional mac_veriexec_sha512 +security/mac_veriexec/mac_veriexec.c optional mac_veriexec +security/mac_veriexec/veriexec_fingerprint.c optional mac_veriexec +security/mac_veriexec/veriexec_metadata.c optional mac_veriexec +security/mac_veriexec_parser/mac_veriexec_parser.c optional mac_veriexec mac_veriexec_parser +security/mac_veriexec/mac_veriexec_rmd160.c optional mac_veriexec_rmd160 +security/mac_veriexec/mac_veriexec_sha1.c optional mac_veriexec_sha1 +security/mac_veriexec/mac_veriexec_sha256.c optional mac_veriexec_sha256 +security/mac_veriexec/mac_veriexec_sha384.c optional mac_veriexec_sha384 +security/mac_veriexec/mac_veriexec_sha512.c optional mac_veriexec_sha512 teken/teken.c optional sc !SC_NO_TERM_TEKEN | vt ufs/ffs/ffs_alloc.c optional ffs ufs/ffs/ffs_balloc.c optional ffs Added: head/sys/security/mac_veriexec_parser/mac_veriexec_parser.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/security/mac_veriexec_parser/mac_veriexec_parser.c Wed Apr 3 03:57:37 2019 (r345830) @@ -0,0 +1,474 @@ +/*- + * Copyright (c) 2019 Stormshield. + * Copyright (c) 2019 Semihalf. + * + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +/* The following are based on sbin/veriexec */ +struct fingerprint_type { + const char *fp_type; + int fp_size; +}; + +struct fp_flag { + const char *flag_name; + int flag; +}; + +static const struct fingerprint_type fp_table[] = { + {"sha256=", SHA256_DIGEST_LENGTH}, +#if MAXFINGERPRINTLEN >= SHA384_DIGEST_LENGTH + {"sha384=", SHA384_DIGEST_LENGTH}, +#endif +#if MAXFINGERPRINTLEN >= SHA512_DIGEST_LENGTH + {"sha512=", SHA512_DIGEST_LENGTH}, +#endif + {NULL, 0} +}; + +static const struct fp_flag flags_table[] = { + {"indirect", VERIEXEC_INDIRECT}, + {"no_ptrace", VERIEXEC_NOTRACE}, + {"trusted", VERIEXEC_TRUSTED}, + {"no_fips", VERIEXEC_NOFIPS}, + {NULL, 0} +}; + +extern struct mtx ve_mutex; + +static unsigned char hexchar_to_byte(unsigned char c); +static int hexstring_to_bin(unsigned char *buf); + +static int get_flags(const char *entry); +static int get_fp(const char *entry, char **type, + unsigned char **digest, int *flags); +static int verify_digest(const char *data, size_t len, + const unsigned char *expected_hash); + +static int open_file(const char *path, struct nameidata *nid); +static char *read_manifest(char *path, unsigned char *digest); +static int parse_entry(char *entry, char *prefix); +static int parse_manifest(char *path, unsigned char *hash, char *prefix); + +static unsigned char +hexchar_to_byte(unsigned char c) +{ + + if (isdigit(c)) + return (c - '0'); + + return (isupper(c) ? c - 'A' + 10 : c - 'a' + 10); +} + +static int +hexstring_to_bin(unsigned char *buf) +{ + size_t i, len; + unsigned char byte; + + len = strlen(buf); + for (i = 0; i < len / 2; i++) { + if (!isxdigit(buf[2 * i]) || !isxdigit(buf[2 * i + 1])) + return (EINVAL); + + byte = hexchar_to_byte(buf[2 * i]) << 4; + byte += hexchar_to_byte(buf[2 * i + 1]); + buf[i] = byte; + } + return (0); +} + +static int +get_flags(const char *entry) +{ + int i; + int result = 0; + + for (i = 0; flags_table[i].flag_name != NULL; i++) + if (strstr(entry, flags_table[i].flag_name) != NULL) + result |= flags_table[i].flag; + + return (result); +} + +/* + * Parse a single line of manifest looking for a digest and its type. + * We expect it to be in form of "path shaX=hash". + * The line will be split into path, hash type and hash value. + */ +static int +get_fp(const char *entry, char **type, unsigned char **digest, int *flags) +{ + char *delimiter; + char *local_digest; + char *fp_type; + char *prev_fp_type; + size_t min_len; + int i; + + delimiter = NULL; + fp_type = NULL; + prev_fp_type = NULL; + + for (i = 0; fp_table[i].fp_type != NULL; i++) { + fp_type = strstr(entry, fp_table[i].fp_type); + /* Look for the last "shaX=hash" in line */ + while (fp_type != NULL) { + prev_fp_type = fp_type; + fp_type++; + fp_type = strstr(fp_type, fp_table[i].fp_type); + } + fp_type = prev_fp_type; + if (fp_type != NULL) { + if (fp_type == entry || fp_type[-1] != ' ') + return (EINVAL); + + /* + * The entry should contain at least + * fp_type and digest in hexadecimal form. + */ + min_len = strlen(fp_table[i].fp_type) + + 2 * fp_table[i].fp_size; + + if (strnlen(fp_type, min_len) < min_len) + return (EINVAL); + + local_digest = &fp_type[strlen(fp_table[i].fp_type)]; + delimiter = &local_digest[2 * fp_table[i].fp_size]; + + /* + * Make sure that digest is followed by + * some kind of delimiter. + */ + if (*delimiter != '\n' && + *delimiter != '\0' && + *delimiter != ' ') + return (EINVAL); + + /* + * Does the entry contain flags we need to parse? + */ + if (*delimiter == ' ' && flags != NULL) + *flags = get_flags(delimiter); + + /* + * Split entry into three parts: + * path, fp_type and digest. + */ + local_digest[-1] = '\0'; + *delimiter = '\0'; + fp_type[-1] = '\0'; + break; + } + } + + if (fp_type == NULL) + return (EINVAL); + + if (type != NULL) + *type = fp_type; + + if (digest != NULL) + *digest = local_digest; + + return (0); +} + +/* + * Currently we verify manifest using sha256. + * In future another env with hash type could be introduced. + */ +static int +verify_digest(const char *data, size_t len, const unsigned char *expected_hash) +{ + SHA256_CTX ctx; + unsigned char hash[SHA256_DIGEST_LENGTH]; + + SHA256_Init(&ctx); + SHA256_Update(&ctx, data, len); + SHA256_Final(hash, &ctx); + + return (memcmp(expected_hash, hash, SHA256_DIGEST_LENGTH)); +} + + +static int +open_file(const char *path, struct nameidata *nid) +{ + int flags, rc; + + flags = FREAD; + + pwd_ensure_dirs(); + + NDINIT(nid, LOOKUP, 0, UIO_SYSSPACE, path, curthread); + rc = vn_open(nid, &flags, 0, NULL); + NDFREE(nid, NDF_ONLY_PNBUF); + if (rc != 0) + return (rc); + + return (0); +} + +/* + * Read the manifest from location specified in path and verify its digest. + */ +static char* +read_manifest(char *path, unsigned char *digest) +{ + struct nameidata nid; + struct vattr va; + char *data; + ssize_t bytes_read, resid; + int rc; + + data = NULL; + bytes_read = 0; + + rc = open_file(path, &nid); + if (rc != 0) + goto fail; + + rc = VOP_GETATTR(nid.ni_vp, &va, curthread->td_ucred); + if (rc != 0) + goto fail; + + data = (char *)malloc(va.va_size + 1, M_VERIEXEC, M_WAITOK); + + while (bytes_read < va.va_size) { + rc = vn_rdwr( + UIO_READ, nid.ni_vp, data, + va.va_size - bytes_read, bytes_read, + UIO_SYSSPACE, IO_NODELOCKED, + curthread->td_ucred, NOCRED, &resid, curthread); + if (rc != 0) + goto fail; + + bytes_read = va.va_size - resid; + } + + data[bytes_read] = '\0'; + + VOP_UNLOCK(nid.ni_vp, 0); + (void)vn_close(nid.ni_vp, FREAD, curthread->td_ucred, curthread); + + /* + * If digest is wrong someone might be trying to fool us. + */ + if (verify_digest(data, va.va_size, digest)) + panic("Manifest hash doesn't match expected value!"); + + return (data); + +fail: + if (data != NULL) + free(data, M_VERIEXEC); + + return (NULL); +} + +/* + * Process single line. + * First split it into path, digest_type and digest. + * Then try to open the file and insert its fingerprint into metadata store. + */ +static int +parse_entry(char *entry, char *prefix) +{ + struct nameidata nid; + struct vattr va; + char path[MAXPATHLEN]; + char *fp_type; + unsigned char *digest; + int rc, is_exec, flags; + + fp_type = NULL; + digest = NULL; + flags = 0; + + rc = get_fp(entry, &fp_type, &digest, &flags); + if (rc != 0) + return (rc); + + rc = hexstring_to_bin(digest); + if (rc != 0) + return (rc); + + if (strnlen(entry, MAXPATHLEN) == MAXPATHLEN) + return (EINVAL); + + /* If the path is not absolute prepend it with a prefix */ + if (prefix != NULL && entry[0] != '/') { + rc = snprintf(path, MAXPATHLEN, "%s/%s", + prefix, entry); + if (rc < 0) + return (-rc); + } else { + strcpy(path, entry); + } + + rc = open_file(path, &nid); + NDFREE(&nid, NDF_ONLY_PNBUF); + if (rc != 0) + return (rc); + + rc = VOP_GETATTR(nid.ni_vp, &va, curthread->td_ucred); + if (rc != 0) + goto out; + + is_exec = (va.va_mode & VEXEC); + + mtx_lock(&ve_mutex); + rc = mac_veriexec_metadata_add_file( + is_exec == 0, + va.va_fsid, va.va_fileid, va.va_gen, + digest, flags, fp_type, 1); + mtx_unlock(&ve_mutex); + +out: + VOP_UNLOCK(nid.ni_vp, 0); + vn_close(nid.ni_vp, FREAD, curthread->td_ucred, curthread); + return (rc); +} + +/* + * Look for manifest in env that have beed passed by loader. + * This routine should be called right after the rootfs is mounted. + */ +static int +parse_manifest(char *path, unsigned char *hash, char *prefix) +{ + char *data; + char *entry; + char *next_entry; + int rc, success_count; + + data = NULL; + success_count = 0; + rc = 0; + + data = read_manifest(path, hash); + if (data == NULL) { + rc = EIO; + goto out; + } + + entry = data; + while (entry != NULL) { + next_entry = strchr(entry, '\n'); + if (next_entry != NULL) { + *next_entry = '\0'; + next_entry++; + } + if (entry[0] == '\n' || entry[0] == '\0') { + entry = next_entry; + continue; + } + if ((rc = parse_entry(entry, prefix))) + printf("mac_veriexec_parser: Warning: Failed to parse" + " entry with rc:%d, entry:\"%s\"\n", rc, entry); + else + success_count++; + + entry = next_entry; + } + rc = 0; + +out: + if (data != NULL) + free(data, M_VERIEXEC); + + if (success_count == 0) + rc = EINVAL; + + return (rc); +} + +static void +parse_manifest_event(void *dummy) +{ + char *manifest_path; + char *manifest_prefix; + unsigned char *manifest_hash; + int rc; + + /* If the envs are not set fail silently */ + manifest_path = kern_getenv("veriexec.manifest_path"); + if (manifest_path == NULL) + return; + + manifest_hash = kern_getenv("veriexec.manifest_hash"); + if (manifest_hash == NULL) { + freeenv(manifest_path); + return; + } + + manifest_prefix = kern_getenv("veriexec.manifest_prefix"); + + if (strlen(manifest_hash) != 2 * SHA256_DIGEST_LENGTH) + panic("veriexec.manifest_hash has incorrect size"); + + rc = hexstring_to_bin(manifest_hash); + if (rc != 0) + panic("mac_veriexec: veriexec.loader.manifest_hash" + " doesn't contain a hash in hexadecimal form"); + + rc = parse_manifest(manifest_path, manifest_hash, manifest_prefix); + if (rc != 0) + panic("mac_veriexec: Failed to parse manifest err=%d", rc); + + mtx_lock(&ve_mutex); + mac_veriexec_set_state( + VERIEXEC_STATE_LOADED | VERIEXEC_STATE_ACTIVE | + VERIEXEC_STATE_LOCKED | VERIEXEC_STATE_ENFORCE); + mtx_unlock(&ve_mutex); + + freeenv(manifest_path); + freeenv(manifest_hash); + if (manifest_prefix != NULL) + freeenv(manifest_prefix); +} + +EVENTHANDLER_DEFINE(mountroot, parse_manifest_event, NULL, 0); Added: head/tools/build/options/WITH_LOADER_VERIEXEC_PASS_MANFIEST ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LOADER_VERIEXEC_PASS_MANFIEST Wed Apr 3 03:57:37 2019 (r345830) @@ -0,0 +1,8 @@ +.\" $FreeBSD$ +Enable building +.Xr loader 8 +with support to pass a verified manifest to kernel. +Kernel has to be build with a module to parse the manfiest. +.Pp +It depends on +.Va WITH_LOADER_VERIEXEC From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59213DC18D; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yv5GHyz4P4n; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id A510019F4D; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 9FB2A1AE99; Sun, 31 Mar 2019 13:41:23 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68D678225B; Sun, 31 Mar 2019 13:41:23 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 50A7F1AE95; Sun, 31 Mar 2019 13:41:23 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 3EB3E1AE92 for ; Sun, 31 Mar 2019 13:41:23 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2E2382239; Sun, 31 Mar 2019 13:41:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B23B27784; Sun, 31 Mar 2019 13:41:21 +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 x2VDfLYn069601; Sun, 31 Mar 2019 13:41:21 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2VDfL01069600; Sun, 31 Mar 2019 13:41:21 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201903311341.x2VDfL01069600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345753 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 345753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 68D678225B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.91)[-0.914,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:05 -0000 X-Original-Date: Sun, 31 Mar 2019 13:41:21 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:05 -0000 Author: avos Date: Sun Mar 31 13:41:20 2019 New Revision: 345753 URL: https://svnweb.freebsd.org/changeset/base/345753 Log: run(4): do not clear PROTECTED bit if frame was not decrypted by NIC. Tested with D-Link DWA-140 rev B3, STA / MONITOR modes. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sun Mar 31 11:31:01 2019 (r345752) +++ head/sys/dev/usb/wlan/if_run.c Sun Mar 31 13:41:20 2019 (r345753) @@ -2865,8 +2865,8 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin wh = mtod(m, struct ieee80211_frame *); - /* XXX wrong for monitor mode */ - if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { + if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) != 0 && + (flags & RT2860_RX_DEC) != 0) { wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; m->m_flags |= M_WEP; } From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C015DC1CE; Tue, 3 Sep 2019 14:06:01 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yw0xQlz4P58; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id C7EB719F5B; Tue, 3 Sep 2019 14:05:53 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id BCF251578; Sun, 31 Mar 2019 21:35:02 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 269359286D; Sun, 31 Mar 2019 21:35:02 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0EC7E155F; Sun, 31 Mar 2019 21:35:02 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 81C22155D for ; Sun, 31 Mar 2019 21:34:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39D1C92864; Sun, 31 Mar 2019 21:34:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 131B74C9A; Sun, 31 Mar 2019 21:34:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2VLYwo7018670; Sun, 31 Mar 2019 21:34:58 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2VLYwO9018669; Sun, 31 Mar 2019 21:34:58 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201903312134.x2VLYwO9018669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345758 - head/sys/dev/md X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/dev/md X-SVN-Commit-Revision: 345758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 269359286D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:07 -0000 X-Original-Date: Sun, 31 Mar 2019 21:34:58 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:07 -0000 Author: mckusick Date: Sun Mar 31 21:34:58 2019 New Revision: 345758 URL: https://svnweb.freebsd.org/changeset/base/345758 Log: When using the force option to shut down a memory-disk device, I/O operations already in its queue were not being properly drained. The GEOM framework does the queue draining, but the device driver needs to wait for the draining to happen. The waiting is done by adding a g_md_providergone() function to wait for the I/O operations to finish up. It is likely that every GEOM provider that implements orphaning attached GEOM consumers needs to use the "providergone" mechanism for this same reason, but some of them do not do so. Apparently Kenneth Merry (ken@) added the drain for just such races, but he missed adding it to some of the device drivers that needed it. Submitted by: Chuck Silvers Reviewed by: imp Tested by: Chuck Silvers MFC after: 1 week Sponsored by: Netflix Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Sun Mar 31 19:27:44 2019 (r345757) +++ head/sys/dev/md/md.c Sun Mar 31 21:34:58 2019 (r345758) @@ -110,6 +110,7 @@ #define MD_SHUTDOWN 0x10000 /* Tell worker thread to terminate. */ #define MD_EXITING 0x20000 /* Worker thread is exiting. */ +#define MD_PROVIDERGONE 0x40000 /* Safe to free the softc */ #ifndef MD_NSECT #define MD_NSECT (10000 * 2) @@ -199,6 +200,7 @@ static g_start_t g_md_start; static g_access_t g_md_access; static void g_md_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g_consumer *cp __unused, struct g_provider *pp); +static g_provgone_t g_md_providergone; static struct cdev *status_dev = NULL; static struct sx md_sx; @@ -220,6 +222,7 @@ struct g_class g_md_class = { .start = g_md_start, .access = g_md_access, .dumpconf = g_md_dumpconf, + .providergone = g_md_providergone, }; DECLARE_GEOM_CLASS(g_md_class, g_md); @@ -481,8 +484,8 @@ g_md_start(struct bio *bp) } mtx_lock(&sc->queue_mtx); bioq_disksort(&sc->bio_queue, bp); - mtx_unlock(&sc->queue_mtx); wakeup(sc); + mtx_unlock(&sc->queue_mtx); } #define MD_MALLOC_MOVE_ZERO 1 @@ -1496,17 +1499,30 @@ bad: return (error); } +static void +g_md_providergone(struct g_provider *pp) +{ + struct md_s *sc = pp->geom->softc; + + mtx_lock(&sc->queue_mtx); + sc->flags |= MD_PROVIDERGONE; + wakeup(&sc->flags); + mtx_unlock(&sc->queue_mtx); +} + static int mddestroy(struct md_s *sc, struct thread *td) { if (sc->gp) { - sc->gp->softc = NULL; g_topology_lock(); g_wither_geom(sc->gp, ENXIO); g_topology_unlock(); - sc->gp = NULL; - sc->pp = NULL; + + mtx_lock(&sc->queue_mtx); + while (!(sc->flags & MD_PROVIDERGONE)) + msleep(&sc->flags, &sc->queue_mtx, PRIBIO, "mddestroy", 0); + mtx_unlock(&sc->queue_mtx); } if (sc->devstat) { devstat_remove_entry(sc->devstat); From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24D03DC228; Tue, 3 Sep 2019 14:06:02 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yx4dy2z4P6D; Tue, 3 Sep 2019 14:06:01 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 19DF619FE6; Tue, 3 Sep 2019 14:05:54 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 293EF11FB7; Mon, 1 Apr 2019 18:49:45 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 307D984250; Mon, 1 Apr 2019 18:49:44 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 12F4B11F98; Mon, 1 Apr 2019 18:49:44 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 57DED11F96 for ; Mon, 1 Apr 2019 18:49:41 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FE668424C; Mon, 1 Apr 2019 18:49:41 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBD1E1A811; Mon, 1 Apr 2019 18:49:40 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x31Ineee084041; Mon, 1 Apr 2019 18:49:40 GMT (envelope-from kibab@FreeBSD.org) Received: (from kibab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x31IneXA084037; Mon, 1 Apr 2019 18:49:40 GMT (envelope-from kibab@FreeBSD.org) Message-Id: <201904011849.x31IneXA084037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kibab set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345775 - in head/sys: arm/allwinner cam cam/mmc dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: kibab X-SVN-Commit-Paths: in head/sys: arm/allwinner cam cam/mmc dev/sdhci X-SVN-Commit-Revision: 345775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 307D984250 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:08 -0000 X-Original-Date: Mon, 1 Apr 2019 18:49:40 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:08 -0000 Author: kibab Date: Mon Apr 1 18:49:39 2019 New Revision: 345775 URL: https://svnweb.freebsd.org/changeset/base/345775 Log: Use information about max data size that the controller is able to operate Using DFLTPHYS/MAXPHYS is not always OK, instead make it possible for the controller driver to provide maximum data size to MMCCAM, and use it there. The old stack already does this. Reviewed by: manu Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D15892 Modified: head/sys/arm/allwinner/aw_mmc.c head/sys/cam/cam_ccb.h head/sys/cam/mmc/mmc_da.c head/sys/dev/sdhci/sdhci.c Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Mon Apr 1 18:35:27 2019 (r345774) +++ head/sys/arm/allwinner/aw_mmc.c Mon Apr 1 18:49:39 2019 (r345775) @@ -256,6 +256,8 @@ aw_mmc_cam_action(struct cam_sim *sim, union ccb *ccb) cts->proto_specific.mmc.host_f_min = sc->aw_host.f_min; cts->proto_specific.mmc.host_f_max = sc->aw_host.f_max; cts->proto_specific.mmc.host_caps = sc->aw_host.caps; + cts->proto_specific.mmc.host_max_data = (sc->aw_mmc_conf->dma_xferlen * + AW_MMC_DMA_SEGS) / MMC_SECTOR_SIZE; memcpy(&cts->proto_specific.mmc.ios, &sc->aw_host.ios, sizeof(struct mmc_ios)); ccb->ccb_h.status = CAM_REQ_CMP; break; Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Mon Apr 1 18:35:27 2019 (r345774) +++ head/sys/cam/cam_ccb.h Mon Apr 1 18:49:39 2019 (r345775) @@ -1051,6 +1051,7 @@ struct ccb_trans_settings_mmc { #define MMC_CAP_8_BIT_DATA (1 << 1) /* Can do 8-bit data transfers */ #define MMC_CAP_HSPEED (1 << 2) /* Can do High Speed transfers */ uint32_t host_caps; + uint32_t host_max_data; }; /* Get/Set transfer rate/width/disconnection/tag queueing settings */ Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Mon Apr 1 18:35:27 2019 (r345774) +++ head/sys/cam/mmc/mmc_da.c Mon Apr 1 18:49:39 2019 (r345775) @@ -1195,6 +1195,27 @@ sdda_get_host_caps(struct cam_periph *periph, union cc return (cts->host_caps); } +static uint32_t +sdda_get_max_data(struct cam_periph *periph, union ccb *ccb) +{ + struct ccb_trans_settings_mmc *cts; + + cts = &ccb->cts.proto_specific.mmc; + memset(cts, 0, sizeof(struct ccb_trans_settings_mmc)); + + ccb->ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + ccb->ccb_h.flags = CAM_DIR_NONE; + ccb->ccb_h.retry_count = 0; + ccb->ccb_h.timeout = 100; + ccb->ccb_h.cbfcnp = NULL; + xpt_action(ccb); + + if (ccb->ccb_h.status != CAM_REQ_CMP) + panic("Cannot get host max data"); + KASSERT(cts->host_max_data != 0, ("host_max_data == 0?!")); + return (cts->host_max_data); +} + static void sdda_start_init(void *context, union ccb *start_ccb) { @@ -1420,7 +1441,6 @@ sdda_add_part(struct cam_periph *periph, u_int type, c struct sdda_softc *sc = (struct sdda_softc *)periph->softc; struct sdda_part *part; struct ccb_pathinq cpi; - u_int maxio; CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH, ("Partition type '%s', size %ju %s\n", @@ -1479,12 +1499,9 @@ sdda_add_part(struct cam_periph *periph, u_int type, c part->disk->d_gone = sddadiskgonecb; part->disk->d_name = part->name; part->disk->d_drv1 = part; - maxio = cpi.maxio; /* Honor max I/O size of SIM */ - if (maxio == 0) - maxio = DFLTPHYS; /* traditional default */ - else if (maxio > MAXPHYS) - maxio = MAXPHYS; /* for safety */ - part->disk->d_maxsize = maxio; + part->disk->d_maxsize = + MIN(MAXPHYS, sdda_get_max_data(periph, + (union ccb *)&cpi) * mmc_get_sector_size(periph)); part->disk->d_unit = cnt; part->disk->d_flags = 0; strlcpy(part->disk->d_descr, sc->card_id_string, Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Mon Apr 1 18:35:27 2019 (r345774) +++ head/sys/dev/sdhci/sdhci.c Mon Apr 1 18:49:39 2019 (r345775) @@ -2580,6 +2580,7 @@ sdhci_cam_action(struct cam_sim *sim, union ccb *ccb) case XPT_GET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; + uint32_t max_data; if (sdhci_debug > 1) slot_printf(slot, "Got XPT_GET_TRAN_SETTINGS\n"); @@ -2593,6 +2594,19 @@ sdhci_cam_action(struct cam_sim *sim, union ccb *ccb) cts->proto_specific.mmc.host_f_min = slot->host.f_min; cts->proto_specific.mmc.host_f_max = slot->host.f_max; cts->proto_specific.mmc.host_caps = slot->host.caps; + /* + * Re-tuning modes 1 and 2 restrict the maximum data length + * per read/write command to 4 MiB. + */ + if (slot->opt & SDHCI_TUNING_ENABLED && + (slot->retune_mode == SDHCI_RETUNE_MODE_1 || + slot->retune_mode == SDHCI_RETUNE_MODE_2)) { + max_data = 4 * 1024 * 1024 / MMC_SECTOR_SIZE; + } else { + max_data = 65535; + } + cts->proto_specific.mmc.host_max_data = max_data; + memcpy(&cts->proto_specific.mmc.ios, &slot->host.ios, sizeof(struct mmc_ios)); ccb->ccb_h.status = CAM_REQ_CMP; break; From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F284ADC3CE; Tue, 3 Sep 2019 14:06:07 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z34s9bz4PDL; Tue, 3 Sep 2019 14:06:07 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id B95461A189; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5C5201CF9B; Wed, 3 Apr 2019 13:59:39 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B049827B4; Wed, 3 Apr 2019 13:59:39 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 13B131CF98; Wed, 3 Apr 2019 13:59:39 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 975191CF94 for ; Wed, 3 Apr 2019 13:59:36 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49589827AC; Wed, 3 Apr 2019 13:59:36 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F8CBED9C; Wed, 3 Apr 2019 13:59:36 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x33DxZD8057779; Wed, 3 Apr 2019 13:59:35 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x33DxZ12057778; Wed, 3 Apr 2019 13:59:35 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201904031359.x33DxZ12057778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345846 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 345846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 2B049827B4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:16 -0000 X-Original-Date: Wed, 3 Apr 2019 13:59:35 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:16 -0000 Author: 0mp (ports committer) Date: Wed Apr 3 13:59:35 2019 New Revision: 345846 URL: https://svnweb.freebsd.org/changeset/base/345846 Log: bectl.8: Bump date after r345845 Approved by: kevans Modified: head/sbin/bectl/bectl.8 Modified: head/sbin/bectl/bectl.8 ============================================================================== --- head/sbin/bectl/bectl.8 Wed Apr 3 13:46:43 2019 (r345845) +++ head/sbin/bectl/bectl.8 Wed Apr 3 13:59:35 2019 (r345846) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2019 +.Dd April 3, 2019 .Dt BECTL 8 .Os .Sh NAME From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 597D8DC2BA; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yz55V8z4P8R; Tue, 3 Sep 2019 14:06:03 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 0480B1A09C; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id BEA4024C0; Tue, 2 Apr 2019 14:01:09 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4882D8E118; Tue, 2 Apr 2019 14:01:09 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 342DD24BF; Tue, 2 Apr 2019 14:01:09 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id DAFCC24BB for ; Tue, 2 Apr 2019 14:01:05 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 507A88E0FA; Tue, 2 Apr 2019 14:01:05 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12A6526F3A; Tue, 2 Apr 2019 14:01:05 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x32E14NG092706; Tue, 2 Apr 2019 14:01:04 GMT (envelope-from mr@FreeBSD.org) Received: (from mr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x32E13Fi092699; Tue, 2 Apr 2019 14:01:03 GMT (envelope-from mr@FreeBSD.org) Message-Id: <201904021401.x32E13Fi092699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mr set sender to mr@FreeBSD.org using -f From: Michael Reifenberger To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345804 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: mr X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 345804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 4882D8E118 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:10 -0000 X-Original-Date: Tue, 2 Apr 2019 14:01:03 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:10 -0000 Author: mr Date: Tue Apr 2 14:01:03 2019 New Revision: 345804 URL: https://svnweb.freebsd.org/changeset/base/345804 Log: systat -zarc to display disk activities like -vm PR: 213310 Submitted by: ota MFH: 4 weeks Differential Revision: https://reviews.freebsd.org/D18726 Modified: head/usr.bin/systat/devs.c head/usr.bin/systat/devs.h head/usr.bin/systat/iostat.c head/usr.bin/systat/swap.c head/usr.bin/systat/systat.h head/usr.bin/systat/vmstat.c head/usr.bin/systat/zarc.c Modified: head/usr.bin/systat/devs.c ============================================================================== --- head/usr.bin/systat/devs.c Tue Apr 2 13:59:04 2019 (r345803) +++ head/usr.bin/systat/devs.c Tue Apr 2 14:01:03 2019 (r345804) @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1998 Kenneth D. Merry. + * 2015 Yoshihiro Ota * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -69,7 +70,6 @@ static const char sccsid[] = "@(#)disks.c 8.1 (Berkele #include #include -#include #include #include #include @@ -84,6 +84,8 @@ typedef enum { DS_MATCHTYPE_PATTERN } last_match_type; +struct statinfo cur_dev, last_dev, run_dev; + last_match_type last_type; struct device_selection *dev_select; long generation; @@ -101,10 +103,8 @@ static int dsselect(const char *args, devstat_select_m int maxshowdevs, struct statinfo *s1); int -dsinit(int maxshowdevs, struct statinfo *s1, struct statinfo *s2 __unused, - struct statinfo *s3 __unused) +dsinit(int maxshowdevs) { - /* * Make sure that the userland devstat version matches the kernel * devstat version. If not, exit and print a message informing @@ -113,6 +113,18 @@ dsinit(int maxshowdevs, struct statinfo *s1, struct st if (devstat_checkversion(NULL) < 0) errx(1, "%s", devstat_errbuf); + if( cur_dev.dinfo ) // init was alreay ran + return(1); + + if ((num_devices = devstat_getnumdevs(NULL)) < 0) { + warnx("%s", devstat_errbuf); + return(0); + } + + cur_dev.dinfo = calloc(1, sizeof(struct devinfo)); + last_dev.dinfo = calloc(1, sizeof(struct devinfo)); + run_dev.dinfo = calloc(1, sizeof(struct devinfo)); + generation = 0; num_devices = 0; num_selected = 0; @@ -120,11 +132,11 @@ dsinit(int maxshowdevs, struct statinfo *s1, struct st select_generation = 0; last_type = DS_MATCHTYPE_NONE; - if (devstat_getdevs(NULL, s1) == -1) + if (devstat_getdevs(NULL, &cur_dev) == -1) errx(1, "%s", devstat_errbuf); - num_devices = s1->dinfo->numdevs; - generation = s1->dinfo->generation; + num_devices = cur_dev.dinfo->numdevs; + generation = cur_dev.dinfo->generation; dev_select = NULL; @@ -134,13 +146,31 @@ dsinit(int maxshowdevs, struct statinfo *s1, struct st * or 1. If we get back -1, though, there is an error. */ if (devstat_selectdevs(&dev_select, &num_selected, &num_selections, - &select_generation, generation, s1->dinfo->devices, num_devices, + &select_generation, generation, cur_dev.dinfo->devices, num_devices, NULL, 0, NULL, 0, DS_SELECT_ADD, maxshowdevs, 0) == -1) errx(1, "%d %s", __LINE__, devstat_errbuf); return(1); } + +void +dsgetinfo(struct statinfo* dev) +{ + switch (devstat_getdevs(NULL, dev)) { + case -1: + errx(1, "%s", devstat_errbuf); + break; + case 1: + num_devices = dev->dinfo->numdevs; + generation = dev->dinfo->generation; + cmdkre("refresh", NULL); + break; + default: + break; + } +} + int dscmd(const char *cmd, const char *args, int maxshowdevs, struct statinfo *s1) { @@ -330,4 +360,84 @@ dsselect(const char *args, devstat_select_mode select_ return(2); } return(1); +} + + +void +dslabel(int maxdrives, int diskcol, int diskrow) +{ + int i, j; + + mvprintw(diskrow, diskcol, "Disks"); + mvprintw(diskrow + 1, diskcol, "KB/t"); + mvprintw(diskrow + 2, diskcol, "tps"); + mvprintw(diskrow + 3, diskcol, "MB/s"); + mvprintw(diskrow + 4, diskcol, "%%busy"); + /* + * For now, we don't support a fourth disk statistic. So there's + * no point in providing a label for it. If someone can think of a + * fourth useful disk statistic, there is room to add it. + */ + /* mvprintw(diskrow + 4, diskcol, " msps"); */ + j = 0; + for (i = 0; i < num_devices && j < maxdrives; i++) + if (dev_select[i].selected) { + char tmpstr[80]; + sprintf(tmpstr, "%s%d", dev_select[i].device_name, + dev_select[i].unit_number); + mvprintw(diskrow, diskcol + 5 + 6 * j, + " %5.5s", tmpstr); + j++; + } +} + +static void +dsshow2(int diskcol, int diskrow, int dn, int lc, struct statinfo *now, struct statinfo *then) +{ + long double transfers_per_second; + long double kb_per_transfer, mb_per_second; + long double elapsed_time, device_busy; + int di; + + di = dev_select[dn].position; + + if (then != NULL) { + /* Calculate relative to previous sample */ + elapsed_time = now->snap_time - then->snap_time; + } else { + /* Calculate relative to device creation */ + elapsed_time = now->snap_time - devstat_compute_etime( + &now->dinfo->devices[di].creation_time, NULL); + } + + if (devstat_compute_statistics(&now->dinfo->devices[di], then ? + &then->dinfo->devices[di] : NULL, elapsed_time, + DSM_KB_PER_TRANSFER, &kb_per_transfer, + DSM_TRANSFERS_PER_SECOND, &transfers_per_second, + DSM_MB_PER_SECOND, &mb_per_second, + DSM_BUSY_PCT, &device_busy, + DSM_NONE) != 0) + errx(1, "%s", devstat_errbuf); + + lc = diskcol + lc * 6; + putlongdouble(kb_per_transfer, diskrow + 1, lc, 5, 2, 0); + putlongdouble(transfers_per_second, diskrow + 2, lc, 5, 0, 0); + putlongdouble(mb_per_second, diskrow + 3, lc, 5, 2, 0); + putlongdouble(device_busy, diskrow + 4, lc, 5, 0, 0); +} + +static void +dsshow3(int diskcol, int diskrow, int dn, int lc, struct statinfo *now, struct statinfo *then) +{ + dsshow2(diskcol, diskrow, dn, lc, now, then); +} + +void +dsshow(int maxdrives, int diskcol, int diskrow, struct statinfo *now, struct statinfo *then) +{ + int i, lc; + + for (i = 0, lc = 0; i < num_devices && lc < maxdrives; i++) + if (dev_select[i].selected) + dsshow3(diskcol, diskrow, i, ++lc, now, then); } Modified: head/usr.bin/systat/devs.h ============================================================================== --- head/usr.bin/systat/devs.h Tue Apr 2 13:59:04 2019 (r345803) +++ head/usr.bin/systat/devs.h Tue Apr 2 14:01:03 2019 (r345804) @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1998 David E. O'Brien + * 2015 Yoshihiro Ota * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,5 +29,18 @@ * $FreeBSD$ */ -int dsinit(int, struct statinfo *, struct statinfo *, struct statinfo *); +#ifndef DEVS_H +#define DEVS_H + +#include + +int dsinit(int); +void dsgetinfo(struct statinfo *); int dscmd(const char *, const char *, int, struct statinfo *); + +void dslabel(int, int, int); +void dsshow(int, int, int, struct statinfo *, struct statinfo *); + +extern struct statinfo cur_dev, last_dev, run_dev; + +#endif Modified: head/usr.bin/systat/iostat.c ============================================================================== --- head/usr.bin/systat/iostat.c Tue Apr 2 13:59:04 2019 (r345803) +++ head/usr.bin/systat/iostat.c Tue Apr 2 14:01:03 2019 (r345804) @@ -79,8 +79,6 @@ static const char sccsid[] = "@(#)iostat.c 8.1 (Berkel #include "extern.h" #include "devs.h" -struct statinfo cur, last; - static int linesperregion; static double etime; static int numbers = 0; /* default display bar graphs */ @@ -111,17 +109,11 @@ closeiostat(WINDOW *w) int initiostat(void) { - if ((num_devices = devstat_getnumdevs(NULL)) < 0) - return(0); - - cur.dinfo = calloc(1, sizeof(struct devinfo)); - last.dinfo = calloc(1, sizeof(struct devinfo)); - /* * This value for maxshowdevs (100) is bogus. I'm not sure exactly * how to calculate it, though. */ - if (dsinit(100, &cur, &last, NULL) != 1) + if (dsinit(7) != 1) return(0); return(1); @@ -133,17 +125,17 @@ fetchiostat(void) struct devinfo *tmp_dinfo; size_t len; - len = sizeof(cur.cp_time); - if (sysctlbyname("kern.cp_time", &cur.cp_time, &len, NULL, 0) - || len != sizeof(cur.cp_time)) { + len = sizeof(cur_dev.cp_time); + if (sysctlbyname("kern.cp_time", &cur_dev.cp_time, &len, NULL, 0) + || len != sizeof(cur_dev.cp_time)) { perror("kern.cp_time"); exit (1); } - tmp_dinfo = last.dinfo; - last.dinfo = cur.dinfo; - cur.dinfo = tmp_dinfo; + tmp_dinfo = last_dev.dinfo; + last_dev.dinfo = cur_dev.dinfo; + cur_dev.dinfo = tmp_dinfo; - last.snap_time = cur.snap_time; + last_dev.snap_time = cur_dev.snap_time; /* * Here what we want to do is refresh our device stats. @@ -152,7 +144,7 @@ fetchiostat(void) * the selection process again, in case a device that we * were previously displaying has gone away. */ - switch (devstat_getdevs(NULL, &cur)) { + switch (devstat_getdevs(NULL, &cur_dev)) { case -1: errx(1, "%s", devstat_errbuf); break; @@ -162,8 +154,8 @@ fetchiostat(void) default: break; } - num_devices = cur.dinfo->numdevs; - generation = cur.dinfo->generation; + num_devices = cur_dev.dinfo->numdevs; + generation = cur_dev.dinfo->generation; } @@ -260,11 +252,11 @@ showiostat(void) long t; int i, row, _col; -#define X(fld) t = cur.fld[i]; cur.fld[i] -= last.fld[i]; last.fld[i] = t +#define X(fld) t = cur_dev.fld[i]; cur_dev.fld[i] -= last_dev.fld[i]; last_dev.fld[i] = t etime = 0; for(i = 0; i < CPUSTATES; i++) { X(cp_time); - etime += cur.cp_time[i]; + etime += cur_dev.cp_time[i]; } if (etime == 0.0) etime = 1.0; @@ -313,10 +305,10 @@ devstats(int row, int _col, int dn) di = dev_select[dn].position; - busy_seconds = cur.snap_time - last.snap_time; + busy_seconds = cur_dev.snap_time - last_dev.snap_time; - if (devstat_compute_statistics(&cur.dinfo->devices[di], - &last.dinfo->devices[di], busy_seconds, + if (devstat_compute_statistics(&cur_dev.dinfo->devices[di], + &last_dev.dinfo->devices[di], busy_seconds, DSM_KB_PER_TRANSFER, &kb_per_transfer, DSM_TRANSFERS_PER_SECOND, &transfers_per_second, DSM_MB_PER_SECOND, &mb_per_second, DSM_NONE) != 0) @@ -349,12 +341,12 @@ stat1(int row, int o) dtime = 0.0; for (i = 0; i < CPUSTATES; i++) - dtime += cur.cp_time[i]; + dtime += cur_dev.cp_time[i]; if (dtime == 0.0) dtime = 1.0; wmove(wnd, row, INSET); #define CPUSCALE 0.5 - histogram(100.0 * cur.cp_time[o] / dtime, 50, CPUSCALE); + histogram(100.0 * cur_dev.cp_time[o] / dtime, 50, CPUSCALE); } static void @@ -388,7 +380,7 @@ cmdiostat(const char *cmd, const char *args) numbers = 1; else if (prefix(cmd, "bars")) numbers = 0; - else if (!dscmd(cmd, args, 100, &cur)) + else if (!dscmd(cmd, args, 100, &cur_dev)) return (0); wclear(wnd); labeliostat(); Modified: head/usr.bin/systat/swap.c ============================================================================== --- head/usr.bin/systat/swap.c Tue Apr 2 13:59:04 2019 (r345803) +++ head/usr.bin/systat/swap.c Tue Apr 2 14:01:03 2019 (r345804) @@ -3,6 +3,7 @@ * * Copyright (c) 1980, 1992, 1993 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2017 Yoshihiro Ota * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -55,6 +56,7 @@ static const char sccsid[] = "@(#)swap.c 8.3 (Berkeley #include "systat.h" #include "extern.h" +#include "devs.h" kvm_t *kd; @@ -137,13 +139,15 @@ initswap(void) oulen = ulen; once = 1; + + dsinit(12); + return (1); } void fetchswap(void) { - okvnsw = kvnsw; if ((kvnsw = kvm_getswapinfo(kd, kvmsw, NSWAP, 0)) < 0) { error("systat: kvm_getswapinfo failed"); @@ -153,6 +157,15 @@ fetchswap(void) odlen = dlen; oulen = ulen; calclens(); + + struct devinfo *tmp_dinfo; + + tmp_dinfo = last_dev.dinfo; + last_dev.dinfo = cur_dev.dinfo; + cur_dev.dinfo = tmp_dinfo; + + last_dev.snap_time = cur_dev.snap_time; + dsgetinfo( &cur_dev ); } void @@ -178,6 +191,7 @@ labelswap(void) name = kvmsw[i].ksw_devname; mvwprintw(wnd, i + 1, 0, "%*s", -dlen, name); } + dslabel(12, 0, 18); } void @@ -217,4 +231,5 @@ showswap(void) waddch(wnd, 'X'); wclrtoeol(wnd); } + dsshow(12, 0, 18, &cur_dev, &last_dev); } Modified: head/usr.bin/systat/systat.h ============================================================================== --- head/usr.bin/systat/systat.h Tue Apr 2 13:59:04 2019 (r345803) +++ head/usr.bin/systat/systat.h Tue Apr 2 14:01:03 2019 (r345804) @@ -68,3 +68,7 @@ extern int use_kvm; #define NVAL(indx) namelist[(indx)].n_value #define NPTR(indx) (void *)NVAL((indx)) #define NREAD(indx, buf, len) kvm_ckread(NPTR((indx)), (buf), (len)) + +extern void putint(int, int, int, int); +extern void putfloat(double, int, int, int, int, int); +extern void putlongdouble(long double, int, int, int, int, int); Modified: head/usr.bin/systat/vmstat.c ============================================================================== --- head/usr.bin/systat/vmstat.c Tue Apr 2 13:59:04 2019 (r345803) +++ head/usr.bin/systat/vmstat.c Tue Apr 2 14:01:03 2019 (r345804) @@ -66,7 +66,6 @@ static const char sccsid[] = "@(#)vmstat.c 8.2 (Berkel #include #include #include -#include #include "systat.h" #include "extern.h" #include "devs.h" @@ -125,7 +124,6 @@ static struct Info { static u_long kmem_size; static u_int v_page_count; -struct statinfo cur, last, run; #define total s.Total #define nchtotal s.nchstats @@ -137,13 +135,9 @@ enum divisor { IEC = 0, SI = HN_DIVISOR_1000 }; static void allocinfo(struct Info *); static void copyinfo(struct Info *, struct Info *); static float cputime(int); -static void dinfo(int, int, struct statinfo *, struct statinfo *); static void do_putuint64(uint64_t, int, int, int, int); static void getinfo(struct Info *); -static void putint(int, int, int, int); static void putuint64(uint64_t, int, int, int); -static void putfloat(double, int, int, int, int, int); -static void putlongdouble(long double, int, int, int, int, int); static int ucount(void); static int ncpu; @@ -209,18 +203,9 @@ initkre(void) int i; size_t sz; - if ((num_devices = devstat_getnumdevs(NULL)) < 0) { - warnx("%s", devstat_errbuf); + if (dsinit(MAXDRIVES) != 1) return(0); - } - cur.dinfo = calloc(1, sizeof(struct devinfo)); - last.dinfo = calloc(1, sizeof(struct devinfo)); - run.dinfo = calloc(1, sizeof(struct devinfo)); - - if (dsinit(MAXDRIVES, &cur, &last, &run) != 1) - return(0); - if (nintr == 0) { if (sysctlbyname("hw.intrcnt", NULL, &sz, NULL, 0) == -1) { error("sysctl(hw.intrcnt...) failed: %s", @@ -371,27 +356,7 @@ labelkre(void) mvprintw(NAMEIROW, NAMEICOL, "Namei Name-cache Dir-cache"); mvprintw(NAMEIROW + 1, NAMEICOL, " Calls hits %% hits %%"); - mvprintw(DISKROW, DISKCOL, "Disks"); - mvprintw(DISKROW + 1, DISKCOL, "KB/t"); - mvprintw(DISKROW + 2, DISKCOL, "tps"); - mvprintw(DISKROW + 3, DISKCOL, "MB/s"); - mvprintw(DISKROW + 4, DISKCOL, "%%busy"); - /* - * For now, we don't support a fourth disk statistic. So there's - * no point in providing a label for it. If someone can think of a - * fourth useful disk statistic, there is room to add it. - */ - /* mvprintw(DISKROW + 4, DISKCOL, " msps"); */ - j = 0; - for (i = 0; i < num_devices && j < MAXDRIVES; i++) - if (dev_select[i].selected) { - char tmpstr[80]; - sprintf(tmpstr, "%s%d", dev_select[i].device_name, - dev_select[i].unit_number); - mvprintw(DISKROW, DISKCOL + 5 + 6 * j, - " %5.5s", tmpstr); - j++; - } + dslabel(MAXDRIVES, DISKCOL, DISKROW); for (i = 0; i < nintr; i++) { if (intrloc[i] == 0) @@ -401,7 +366,7 @@ labelkre(void) } #define X(fld) {t=s.fld[i]; s.fld[i]-=s1.fld[i]; if(state==TIME) s1.fld[i]=t;} -#define Q(fld) {t=cur.fld[i]; cur.fld[i]-=last.fld[i]; if(state==TIME) last.fld[i]=t;} +#define Q(fld) {t=cur_dev.fld[i]; cur_dev.fld[i]-=last_dev.fld[i]; if(state==TIME) last_dev.fld[i]=t;} #define Y(fld) {t = s.fld; s.fld -= s1.fld; if(state == TIME) s1.fld = t;} #define Z(fld) {t = s.nchstats.fld; s.nchstats.fld -= s1.nchstats.fld; \ if(state == TIME) s1.nchstats.fld = t;} @@ -543,20 +508,17 @@ showkre(void) PUTRATE(v_intr, GENSTATROW + 1, GENSTATCOL + 15, 4); PUTRATE(v_soft, GENSTATROW + 1, GENSTATCOL + 20, 4); PUTRATE(v_vm_faults, GENSTATROW + 1, GENSTATCOL + 25, 4); - for (i = 0, lc = 0; i < num_devices && lc < MAXDRIVES; i++) - if (dev_select[i].selected) { - switch(state) { - case TIME: - dinfo(i, ++lc, &cur, &last); - break; - case RUN: - dinfo(i, ++lc, &cur, &run); - break; - case BOOT: - dinfo(i, ++lc, &cur, NULL); - break; - } - } + switch(state) { + case TIME: + dsshow(MAXDRIVES, DISKCOL, DISKROW, &cur_dev, &last_dev); + break; + case RUN: + dsshow(MAXDRIVES, DISKCOL, DISKROW, &cur_dev, &run_dev); + break; + case BOOT: + dsshow(MAXDRIVES, DISKCOL, DISKROW, &cur_dev, NULL); + break; + } putint(s.numdirtybuffers, VNSTATROW, VNSTATCOL, 7); putint(s.desiredvnodes, VNSTATROW + 1, VNSTATCOL, 7); putint(s.numvnodes, VNSTATROW + 2, VNSTATCOL, 7); @@ -582,14 +544,14 @@ cmdkre(const char *cmd, const char *args) if (prefix(cmd, "run")) { retval = 1; copyinfo(&s2, &s1); - switch (devstat_getdevs(NULL, &run)) { + switch (devstat_getdevs(NULL, &run_dev)) { case -1: errx(1, "%s", devstat_errbuf); break; case 1: - num_devices = run.dinfo->numdevs; - generation = run.dinfo->generation; - retval = dscmd("refresh", NULL, MAXDRIVES, &cur); + num_devices = run_dev.dinfo->numdevs; + generation = run_dev.dinfo->generation; + retval = dscmd("refresh", NULL, MAXDRIVES, &cur_dev); if (retval == 2) labelkre(); break; @@ -612,14 +574,14 @@ cmdkre(const char *cmd, const char *args) retval = 1; if (state == RUN) { getinfo(&s1); - switch (devstat_getdevs(NULL, &run)) { + switch (devstat_getdevs(NULL, &run_dev)) { case -1: errx(1, "%s", devstat_errbuf); break; case 1: - num_devices = run.dinfo->numdevs; - generation = run.dinfo->generation; - retval = dscmd("refresh",NULL, MAXDRIVES, &cur); + num_devices = run_dev.dinfo->numdevs; + generation = run_dev.dinfo->generation; + retval = dscmd("refresh",NULL, MAXDRIVES, &cur_dev); if (retval == 2) labelkre(); break; @@ -629,7 +591,7 @@ cmdkre(const char *cmd, const char *args) } return (retval); } - retval = dscmd(cmd, args, MAXDRIVES, &cur); + retval = dscmd(cmd, args, MAXDRIVES, &cur_dev); if (retval == 2) labelkre(); @@ -667,7 +629,7 @@ cputime(int indx) return (s.time[indx] * 100.0 / lt); } -static void +void putint(int n, int l, int lc, int w) { @@ -713,7 +675,7 @@ do_putuint64(uint64_t n, int l, int lc, int w, int div addstr(b); } -static void +void putfloat(double f, int l, int lc, int w, int d, int nz) { int snr; @@ -745,7 +707,7 @@ putfloat(double f, int l, int lc, int w, int d, int nz addstr(b); } -static void +void putlongdouble(long double f, int l, int lc, int w, int d, int nz) { int snr; @@ -785,7 +747,7 @@ getinfo(struct Info *ls) int mib[2]; GETSYSCTL("kern.cp_time", ls->time); - GETSYSCTL("kern.cp_time", cur.cp_time); + GETSYSCTL("kern.cp_time", cur_dev.cp_time); GETSYSCTL("vm.stats.sys.v_swtch", ls->v_swtch); GETSYSCTL("vm.stats.sys.v_trap", ls->v_trap); GETSYSCTL("vm.stats.sys.v_syscall", ls->v_syscall); @@ -838,23 +800,12 @@ getinfo(struct Info *ls) size != sizeof(ncpu)) ncpu = 1; - tmp_dinfo = last.dinfo; - last.dinfo = cur.dinfo; - cur.dinfo = tmp_dinfo; + tmp_dinfo = last_dev.dinfo; + last_dev.dinfo = cur_dev.dinfo; + cur_dev.dinfo = tmp_dinfo; - last.snap_time = cur.snap_time; - switch (devstat_getdevs(NULL, &cur)) { - case -1: - errx(1, "%s", devstat_errbuf); - break; - case 1: - num_devices = cur.dinfo->numdevs; - generation = cur.dinfo->generation; - cmdkre("refresh", NULL); - break; - default: - break; - } + last_dev.snap_time = cur_dev.snap_time; + dsgetinfo(&cur_dev); } static void @@ -880,39 +831,4 @@ copyinfo(struct Info *from, struct Info *to) *to = *from; bcopy(from->intrcnt, to->intrcnt = intrcnt, nintr * sizeof (int)); -} - -static void -dinfo(int dn, int lc, struct statinfo *now, struct statinfo *then) -{ - long double transfers_per_second; - long double kb_per_transfer, mb_per_second; - long double elapsed_time, device_busy; - int di; - - di = dev_select[dn].position; - - if (then != NULL) { - /* Calculate relative to previous sample */ - elapsed_time = now->snap_time - then->snap_time; - } else { - /* Calculate relative to device creation */ - elapsed_time = now->snap_time - devstat_compute_etime( - &now->dinfo->devices[di].creation_time, NULL); - } - - if (devstat_compute_statistics(&now->dinfo->devices[di], then ? - &then->dinfo->devices[di] : NULL, elapsed_time, - DSM_KB_PER_TRANSFER, &kb_per_transfer, - DSM_TRANSFERS_PER_SECOND, &transfers_per_second, - DSM_MB_PER_SECOND, &mb_per_second, - DSM_BUSY_PCT, &device_busy, - DSM_NONE) != 0) - errx(1, "%s", devstat_errbuf); - - lc = DISKCOL + lc * 6; - putlongdouble(kb_per_transfer, DISKROW + 1, lc, 5, 2, 0); - putlongdouble(transfers_per_second, DISKROW + 2, lc, 5, 0, 0); - putlongdouble(mb_per_second, DISKROW + 3, lc, 5, 2, 0); - putlongdouble(device_busy, DISKROW + 4, lc, 5, 0, 0); } Modified: head/usr.bin/systat/zarc.c ============================================================================== --- head/usr.bin/systat/zarc.c Tue Apr 2 13:59:04 2019 (r345803) +++ head/usr.bin/systat/zarc.c Tue Apr 2 14:01:03 2019 (r345804) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2014 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2014 - 2017 Yoshihiro Ota * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,11 +32,14 @@ __FBSDID("$FreeBSD$"); #include #include +/* #include */ #include #include +#include #include "systat.h" #include "extern.h" +#include "devs.h" struct zfield{ uint64_t arcstats; @@ -77,21 +79,23 @@ closezarc(WINDOW *w) void labelzarc(void) { + int row = 1; wmove(wnd, 0, 0); wclrtoeol(wnd); mvwprintw(wnd, 0, 31+1, "%4.4s %7.7s %7.7s %12.12s %12.12s", "rate", "hits", "misses", "total hits", "total misses"); -#define L(row, str) mvwprintw(wnd, row, 5, str); \ +#define L(str) mvwprintw(wnd, row, 5, #str); \ mvwprintw(wnd, row, 31, ":"); \ - mvwprintw(wnd, row, 31+4, "%%") - L(1, "arcstats"); - L(2, "arcstats.demand_data"); - L(3, "arcstats.demand_metadata"); - L(4, "arcstats.prefetch_data"); - L(5, "arcstats.prefetch_metadata"); - L(6, "zfetchstats"); - L(7, "arcstats.l2"); - L(8, "vdev_cache_stats"); + mvwprintw(wnd, row, 31+4, "%%"); ++row + L(arcstats); + L(arcstats.demand_data); + L(arcstats.demand_metadata); + L(arcstats.prefetch_data); + L(arcstats.prefetch_metadata); + L(zfetchstats); + L(arcstats.l2); + L(vdev_cache_stats); #undef L + dslabel(12, 0, 18); } static int calc(uint64_t hits, uint64_t misses) @@ -131,6 +135,7 @@ domode(struct zarcstats *delta, struct zarcstats *rate void showzarc(void) { + int row = 1; struct zarcstats delta, rate; memset(&delta, 0, sizeof delta); @@ -138,34 +143,37 @@ showzarc(void) domode(&delta, &rate); -#define DO(stat, row, col, fmt) \ +#define DO(stat, col, fmt) \ mvwprintw(wnd, row, col, fmt, stat) -#define R(row, stat) DO(rate.hits.stat, row, 31+1, "%3"PRIu64) -#define H(row, stat) DO(delta.hits.stat, row, 31+1+5, "%7"PRIu64); \ - DO(curstat.hits.stat, row, 31+1+5+8+8, "%12"PRIu64) -#define M(row, stat) DO(delta.misses.stat, row, 31+1+5+8, "%7"PRIu64); \ - DO(curstat.misses.stat, row, 31+1+5+8+8+13, "%12"PRIu64) -#define E(row, stat) R(row, stat); H(row, stat); M(row, stat); - E(1, arcstats); - E(2, arcstats_demand_data); - E(3, arcstats_demand_metadata); - E(4, arcstats_prefetch_data); - E(5, arcstats_prefetch_metadata); - E(6, zfetchstats); - E(7, arcstats_l2); - E(8, vdev_cache_stats); +#define R(stat) DO(rate.hits.stat, 31+1, "%3"PRIu64) +#define H(stat) DO(delta.hits.stat, 31+1+5, "%7"PRIu64); \ + DO(curstat.hits.stat, 31+1+5+8+8, "%12"PRIu64) +#define M(stat) DO(delta.misses.stat, 31+1+5+8, "%7"PRIu64); \ + DO(curstat.misses.stat, 31+1+5+8+8+13, "%12"PRIu64) +#define E(stat) R(stat); H(stat); M(stat); ++row + E(arcstats); + E(arcstats_demand_data); + E(arcstats_demand_metadata); + E(arcstats_prefetch_data); + E(arcstats_prefetch_metadata); + E(zfetchstats); + E(arcstats_l2); + E(vdev_cache_stats); #undef DO #undef E #undef M #undef H #undef R + dsshow(12, 0, 18, &cur_dev, &last_dev); } int initzarc(void) { + dsinit(12); getinfo(&initstat); curstat = oldstat = initstat; + return 1; } @@ -178,6 +186,15 @@ resetzarc(void) static void getinfo(struct zarcstats *ls) { + struct devinfo *tmp_dinfo; + + tmp_dinfo = last_dev.dinfo; + last_dev.dinfo = cur_dev.dinfo; + cur_dev.dinfo = tmp_dinfo; + + last_dev.snap_time = cur_dev.snap_time; + dsgetinfo( &cur_dev ); + size_t size = sizeof( ls->hits.arcstats ); if ( sysctlbyname("kstat.zfs.misc.arcstats.hits", &ls->hits.arcstats, &size, NULL, 0 ) != 0 ) From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE146DC333; Tue, 3 Sep 2019 14:06:05 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z11gcFz4PB6; Tue, 3 Sep 2019 14:06:05 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 726D71A0D5; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E92047526; Tue, 2 Apr 2019 19:06:30 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E37E72C30; Tue, 2 Apr 2019 19:06:30 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1428E74D7; Tue, 2 Apr 2019 19:06:30 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 108BC74D2 for ; Tue, 2 Apr 2019 19:06:27 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C379272C25; Tue, 2 Apr 2019 19:06:26 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 930462544; Tue, 2 Apr 2019 19:06:26 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x32J6Qc2052303; Tue, 2 Apr 2019 19:06:26 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x32J6PJW052299; Tue, 2 Apr 2019 19:06:25 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201904021906.x32J6PJW052299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345812 - in head: sys/dev/ioat tools/tools/ioat X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: in head: sys/dev/ioat tools/tools/ioat X-SVN-Commit-Revision: 345812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3E37E72C30 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:13 -0000 X-Original-Date: Tue, 2 Apr 2019 19:06:25 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:13 -0000 Author: tychon Date: Tue Apr 2 19:06:25 2019 New Revision: 345812 URL: https://svnweb.freebsd.org/changeset/base/345812 Log: ioatcontrol(8) could exercise 8k-aligned copy with page-break, crc and crc-copy modes. Reviewed by: cem Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19780 Modified: head/sys/dev/ioat/ioat_test.c head/sys/dev/ioat/ioat_test.h head/tools/tools/ioat/ioatcontrol.8 head/tools/tools/ioat/ioatcontrol.c Modified: head/sys/dev/ioat/ioat_test.c ============================================================================== --- head/sys/dev/ioat/ioat_test.c Tue Apr 2 18:50:49 2019 (r345811) +++ head/sys/dev/ioat/ioat_test.c Tue Apr 2 19:06:25 2019 (r345812) @@ -65,6 +65,7 @@ struct test_transaction { void *buf[IOAT_MAX_BUFS]; uint32_t length; uint32_t depth; + uint32_t crc[IOAT_MAX_BUFS]; struct ioat_test *test; TAILQ_ENTRY(test_transaction) entry; }; @@ -312,6 +313,28 @@ ioat_test_submit_1_tx(struct ioat_test *test, bus_dmae desc = ioat_copy_8k_aligned(dma, dest, dst2, src, src2, cb, tx, flags); + } else if (test->testkind == IOAT_TEST_DMA_8K_PB) { + bus_addr_t src2, dst2; + + src2 = vtophys((vm_offset_t)tx->buf[2*i+1] + PAGE_SIZE); + dst2 = vtophys((vm_offset_t)tx->buf[2*i] + PAGE_SIZE); + + desc = ioat_copy_8k_aligned(dma, dest, dst2, src, src2, + cb, tx, flags); + } else if (test->testkind == IOAT_TEST_DMA_CRC) { + bus_addr_t crc; + + tx->crc[i] = 0; + crc = vtophys((vm_offset_t)&tx->crc[i]); + desc = ioat_crc(dma, src, tx->length, + NULL, crc, cb, tx, flags | DMA_CRC_STORE); + } else if (test->testkind == IOAT_TEST_DMA_CRC_COPY) { + bus_addr_t crc; + + tx->crc[i] = 0; + crc = vtophys((vm_offset_t)&tx->crc[i]); + desc = ioat_copy_crc(dma, dest, src, tx->length, + NULL, crc, cb, tx, flags | DMA_CRC_STORE); } if (desc == NULL) break; @@ -346,7 +369,8 @@ ioat_dma_test(void *arg) test = arg; memset(__DEVOLATILE(void *, test->status), 0, sizeof(test->status)); - if (test->testkind == IOAT_TEST_DMA_8K && + if ((test->testkind == IOAT_TEST_DMA_8K || + test->testkind == IOAT_TEST_DMA_8K_PB) && test->buffer_size != 2 * PAGE_SIZE) { ioat_test_log(0, "Asked for 8k test and buffer size isn't 8k\n"); test->status[IOAT_TEST_INVALID_INPUT]++; Modified: head/sys/dev/ioat/ioat_test.h ============================================================================== --- head/sys/dev/ioat/ioat_test.h Tue Apr 2 18:50:49 2019 (r345811) +++ head/sys/dev/ioat/ioat_test.h Tue Apr 2 19:06:25 2019 (r345812) @@ -44,6 +44,9 @@ enum ioat_test_kind { IOAT_TEST_RAW_DMA, IOAT_TEST_DMA_8K, IOAT_TEST_MEMCPY, + IOAT_TEST_DMA_8K_PB, + IOAT_TEST_DMA_CRC, + IOAT_TEST_DMA_CRC_COPY, IOAT_NUM_TESTKINDS }; Modified: head/tools/tools/ioat/ioatcontrol.8 ============================================================================== --- head/tools/tools/ioat/ioatcontrol.8 Tue Apr 2 18:50:49 2019 (r345811) +++ head/tools/tools/ioat/ioatcontrol.8 Tue Apr 2 19:06:25 2019 (r345812) @@ -35,9 +35,12 @@ .Nm .Op Fl c Ar period .Op Fl E +.Op Fl e .Op Fl f .Op Fl m .Op Fl V +.Op Fl x +.Op Fl X .Op Fl z .Ar channel_number .Ar num_txns @@ -65,6 +68,8 @@ The arguments are as follows: Configure the channel's interrupt coalescing period, in microseconds (defaults to 0). .It Fl E +Test contiguous 8k copy. +.It Fl e Test non-contiguous 8k copy. .It Fl f Test block fill (by default, @@ -74,6 +79,10 @@ tests copy) Test memcpy instead of DMA. .It Fl V Verify copies/fills for accuracy +.It Fl x +Test DMA CRC. +.It Fl X +Test DMA copy with CRC. .It Fl z Zero device statistics before running test. .El Modified: head/tools/tools/ioat/ioatcontrol.c ============================================================================== --- head/tools/tools/ioat/ioatcontrol.c Tue Apr 2 18:50:49 2019 (r345811) +++ head/tools/tools/ioat/ioatcontrol.c Tue Apr 2 19:06:25 2019 (r345812) @@ -54,13 +54,16 @@ usage(void) printf(" %s -r [-c period] [-vVwz] channel-number address []\n\n", getprogname()); printf(" -c period - Enable interrupt coalescing (us) (default: 0)\n"); - printf(" -E - Test non-contiguous 8k copy.\n"); - printf(" -f - Test block fill (default: DMA copy).\n"); + printf(" -E - Test contiguous 8k copy.\n"); + printf(" -e - Test non-contiguous 8k copy.\n"); + printf(" -f - Test block fill.\n"); printf(" -m - Test memcpy instead of DMA.\n"); printf(" -r - Issue DMA to or from a specific address.\n"); printf(" -V - Enable verification\n"); printf(" -v -
is a kernel virtual address\n"); printf(" -w - Write to the specified address\n"); + printf(" -x - Test DMA CRC.\n"); + printf(" -X - Test DMA CRC copy.\n"); printf(" -z - Zero device stats before test\n"); exit(EX_USAGE); } @@ -107,15 +110,15 @@ main(int argc, char **argv) { struct ioat_test t; int fd, ch; - bool fflag, rflag, Eflag, mflag; + bool fflag, rflag, Eflag, eflag, mflag, xflag, Xflag; unsigned modeflags; memset(&t, 0, sizeof(t)); - fflag = rflag = Eflag = mflag = false; + fflag = rflag = Eflag = eflag = mflag = xflag = Xflag = false; modeflags = 0; - while ((ch = getopt(argc, argv, "c:EfmrvVwz")) != -1) { + while ((ch = getopt(argc, argv, "c:EefmrvVwxXz")) != -1) { switch (ch) { case 'c': t.coalesce_period = atoi(optarg); @@ -124,6 +127,10 @@ main(int argc, char **argv) Eflag = true; modeflags++; break; + case 'e': + eflag = true; + modeflags++; + break; case 'f': fflag = true; modeflags++; @@ -145,6 +152,12 @@ main(int argc, char **argv) case 'w': t.raw_write = true; break; + case 'x': + xflag = true; + break; + case 'X': + Xflag = true; + break; case 'z': t.zero_stats = true; break; @@ -171,11 +184,15 @@ main(int argc, char **argv) if (fflag) t.testkind = IOAT_TEST_FILL; - else if (Eflag) { + else if (Eflag || eflag) { t.testkind = IOAT_TEST_DMA_8K; t.buffer_size = 8 * 1024; } else if (mflag) t.testkind = IOAT_TEST_MEMCPY; + else if (xflag) + t.testkind = IOAT_TEST_DMA_CRC; + else if (xflag) + t.testkind = IOAT_TEST_DMA_CRC_COPY; t.channel_index = atoi(argv[0]); if (t.channel_index > 8) { From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5905CDC2B9; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yz4nVyz4P8L; Tue, 3 Sep 2019 14:06:03 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id CE44A1A07F; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 096351699; Tue, 2 Apr 2019 13:40:24 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 422808C65C; Tue, 2 Apr 2019 13:40:23 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1EE98164A; Tue, 2 Apr 2019 13:40:23 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id BA7601644; Tue, 2 Apr 2019 13:40:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DE4C8C651; Tue, 2 Apr 2019 13:40:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 33E8E6FE2; Tue, 2 Apr 2019 13:40:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 61BEFB73E4; Tue, 2 Apr 2019 15:40:19 +0200 (CEST) From: Baptiste Daroussin To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345797 - in head: contrib/bsnmp/gensnmptree contrib/bsnmp/lib contrib/bsnmp/snmpd lib/libbsnmp/libbsnmp usr.sbin/bsnmpd/bsnmpd Message-ID: <20190402134019.j325zduvwstcgz3s@ivaldir.net> References: <201904021250.x32Co13P053573@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ybi72zk2xf2apl4e" Content-Disposition: inline In-Reply-To: <201904021250.x32Co13P053573@repo.freebsd.org> User-Agent: NeoMutt/20180716 Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 422808C65C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:08 -0000 X-Original-Date: Tue, 2 Apr 2019 15:40:19 +0200 X-List-Received-Date: Tue, 03 Sep 2019 14:06:08 -0000 --ybi72zk2xf2apl4e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 02, 2019 at 12:50:01PM +0000, Andrey V. Elsukov wrote: > Author: ae > Date: Tue Apr 2 12:50:01 2019 > New Revision: 345797 > URL: https://svnweb.freebsd.org/changeset/base/345797 >=20 > Log: > Add IPv6 transport for bsnmp. > =20 > This patch adds a new table begemotSnmpdTransInetTable that uses the > InetAddressType textual convention and can be used to create listening > ports for IPv4, IPv6, zoned IPv6 and based on DNS names. It also suppor= ts > future extension beyond UDP by adding a protocol identifier to the table > index. In order to support this gensnmptree had to be modified. > =20 > Submitted by: harti > MFC after: 1 month > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D16654 >=20 Jumping in this commit, maybe it is time to move bsnmpd out of contrib, giv= en that all the dev appears to only be in our own source tree right? Best regards, Bapt --ybi72zk2xf2apl4e Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlyjZkMACgkQY4mL3PG3 PlqArBAAxD0B7DuGM0mYH92bwr6Tvc0gN1fsXpAqehTMRcQhx3dXboPjrAn4VOKl nhe+CGzp4fV/on34u/ZcaJA7WGcQ8Lk7S4LzT/ADmPy+L7SNbhBxx+LlmWBfzOSd ICjmnI5sl0rIAD9vr5Xdrb9UxudySxgWR7Bojze70Od2HGyb9a+eBCL+xqzj2GT5 xnlE1dxNjp4zgpr8x+ZlT0PhicPgPgCkNO5r5URR7+q+j9gGKU4v/cFFizoqgNZb lKv+OTF3VHWHYjDIKtWWUqMt1CQWgvmcgb2OyMsuIqZpQez1Vbt1vSkVTXQGltfo rjpd/b51fwPZWSibbV+cMg60K13Vc+b2HR1U2zr1HofCXJJYlAoVhftYykEjiO+D 3+9MzmAxw0sFCQ9h4TWXf24LdZSpt6y9NbqXWC4o/ut0MHSraDVyX37ICd/y9AzK oxpTH9ERQY76CtSpnxOq9EkDMxVYTGl7hOx6H0demM9KxBCDXbzszyC4d2/RDhwd jPSNMiyiKXdSy939n47mT8ExBJSBOIOYvy0UHSELqKiNCmb72BeDHjVr1sGJfCYZ wWVwI4hdC8EwBSd0hQOBf4H58JVncFKZda1X+CFrsizNHyAWx1uQQPMcZjc3Pe64 cP+aGma6qdYJmiMA0Z+Ylz/XpFewUEksAohWcinTs5NBb4fbQjU= =a94Y -----END PGP SIGNATURE----- --ybi72zk2xf2apl4e-- From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59BB3DC2BB; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yz4dBZz4P8G; Tue, 3 Sep 2019 14:06:03 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id C0E7D1A07B; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 1B602A8E; Tue, 2 Apr 2019 12:50:06 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488F28AA62; Tue, 2 Apr 2019 12:50:05 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1A490A49; Tue, 2 Apr 2019 12:50:05 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 8F2F9A45 for ; Tue, 2 Apr 2019 12:50:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BFF78AA5C; Tue, 2 Apr 2019 12:50:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 480E02624F; Tue, 2 Apr 2019 12:50:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x32Co2uh053576; Tue, 2 Apr 2019 12:50:02 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x32Co13P053573; Tue, 2 Apr 2019 12:50:01 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201904021250.x32Co13P053573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345797 - in head: contrib/bsnmp/gensnmptree contrib/bsnmp/lib contrib/bsnmp/snmpd lib/libbsnmp/libbsnmp usr.sbin/bsnmpd/bsnmpd X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head: contrib/bsnmp/gensnmptree contrib/bsnmp/lib contrib/bsnmp/snmpd lib/libbsnmp/libbsnmp usr.sbin/bsnmpd/bsnmpd X-SVN-Commit-Revision: 345797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 488F28AA62 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:09 -0000 X-Original-Date: Tue, 2 Apr 2019 12:50:01 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:09 -0000 Author: ae Date: Tue Apr 2 12:50:01 2019 New Revision: 345797 URL: https://svnweb.freebsd.org/changeset/base/345797 Log: Add IPv6 transport for bsnmp. This patch adds a new table begemotSnmpdTransInetTable that uses the InetAddressType textual convention and can be used to create listening ports for IPv4, IPv6, zoned IPv6 and based on DNS names. It also supports future extension beyond UDP by adding a protocol identifier to the table index. In order to support this gensnmptree had to be modified. Submitted by: harti MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16654 Added: head/contrib/bsnmp/snmpd/trans_inet.c head/contrib/bsnmp/snmpd/trans_inet.h Modified: head/contrib/bsnmp/gensnmptree/gensnmptree.1 head/contrib/bsnmp/gensnmptree/gensnmptree.c head/contrib/bsnmp/lib/snmpclient.c head/contrib/bsnmp/lib/snmpclient.h head/contrib/bsnmp/lib/tc.def head/contrib/bsnmp/snmpd/BEGEMOT-SNMPD.txt head/contrib/bsnmp/snmpd/main.c head/contrib/bsnmp/snmpd/snmpd.config head/contrib/bsnmp/snmpd/snmpd.h head/contrib/bsnmp/snmpd/snmpmod.h head/contrib/bsnmp/snmpd/trans_lsock.c head/contrib/bsnmp/snmpd/trans_udp.c head/contrib/bsnmp/snmpd/tree.def head/lib/libbsnmp/libbsnmp/Makefile head/usr.sbin/bsnmpd/bsnmpd/Makefile head/usr.sbin/bsnmpd/bsnmpd/snmpd.config Modified: head/contrib/bsnmp/gensnmptree/gensnmptree.1 ============================================================================== --- head/contrib/bsnmp/gensnmptree/gensnmptree.1 Tue Apr 2 12:02:35 2019 (r345796) +++ head/contrib/bsnmp/gensnmptree/gensnmptree.1 Tue Apr 2 12:50:01 2019 (r345797) @@ -31,7 +31,7 @@ .\" .\" $Begemot: gensnmptree.1 383 2006-05-30 07:40:49Z brandt_h $ .\" -.Dd June 29, 2018 +.Dd April 2, 2019 .Dt GENSNMPTREE 1 .Os .Sh NAME @@ -100,25 +100,11 @@ is the length of the OID. is the last component of the OID. .El .It Fl F -Together with -.Fl E -causes -.Nm -instead of the generation of enum definitions the generation of -functions for checking a value to be one of the enumeration variants and -for conversion between strings and the enum. The file is sent to standard -output and is meant to be included into a C-file for compilation. +emit definitions for C-functions includeable in a C-file that do some basic +stuff on enums like value checking and conversion between value and strings. .It Fl f -This flag can be used together with -.Fl E -or when generating the tree files. It causes -.Nm -to emit static inline functions for checking a value to be one of the -enumeration values and for conversion between strings and the enum. -If used when generating the tree files, the preprocessor symbol -.Ar SNMPTREE_TYPES -must be defined when including the tree header file for these definitions -to become visible. +emit definitions for inline C-functions that do some basic +stuff on enums like value checking and conversion between value and strings. .It Fl h Print a short help page. .It Fl I Ar directory @@ -136,36 +122,6 @@ Instead of normal output print the resulting tree. Prefix the file names and the table name with .Ar prefix . .El -.Pp -The following functions are generated by -.Fl f -or -.Fl F : -.Pp -.Ft static inline int -.Fn isok_EnumName "enum EnumName" ; -.Pp -.Ft static inline const char * -.Fn tostr_EnumName "enum EnumName" ; -.Pp -.Ft static inline int -.Fn fromstr_EnumName "const char *" "enum EnumName *" ; -.Pp -The -.Fa EnumName -is replaced with the enumeration name. -.Fn isok_EnumName -returns 1 if the argument is one of the valid enum values and 0 otherwise. -.Fn tostr_EnumName -returns a string representation of the enumeration value. -If the values is not one of the legal values -.Ar EnumName??? -is returned. -.Fn fromstr_EnumName -returns 1 if the string represents one of the legal enumeration values and -0 otherwise. -If 1 is return the variable pointed to by the second argument is set to -the enumeration value. .Sh MIBS The syntax of the MIB description file can formally be specified as follows: .Bd -unfilled -offset indent Modified: head/contrib/bsnmp/gensnmptree/gensnmptree.c ============================================================================== --- head/contrib/bsnmp/gensnmptree/gensnmptree.c Tue Apr 2 12:02:35 2019 (r345796) +++ head/contrib/bsnmp/gensnmptree/gensnmptree.c Tue Apr 2 12:50:01 2019 (r345797) @@ -110,7 +110,6 @@ static int debug; static const char usgtxt[] = "\ Generate SNMP tables.\n\ -$Id$\n\ usage: gensnmptree [-dEeFfhlt] [-I directory] [-i infile] [-p prefix]\n\ [name]...\n\ options:\n\ @@ -127,6 +126,37 @@ options:\n\ -t generate a .def file\n\ "; +/** + * Program operation. + */ +enum op { + /** generate the tree */ + OP_GEN, + + /** extract OIDs */ + OP_EXTRACT, + + /** print the parsed tree */ + OP_TREE, + + /** extract enums */ + OP_ENUMS, +}; + +/** + * Which functions to create. + */ +enum gen_funcs { + /** none */ + GEN_FUNCS_NONE, + + /** functions for header files */ + GEN_FUNCS_H, + + /** functions for C files */ + GEN_FUNCS_C, +}; + /* * A node in the OID tree */ @@ -162,15 +192,18 @@ struct node { uint32_t index; /* index for table entry */ char *func; /* function for tables */ struct node_list subs; + char *subtypes[SNMP_INDEXES_MAX]; } entry; struct leaf { enum snmp_syntax syntax; /* syntax for this leaf */ char *func; /* function name */ + char *subtype; /* subtype */ } leaf; struct column { enum snmp_syntax syntax; /* syntax for this column */ + char *subtype; /* subtype */ } column; } u; }; @@ -214,7 +247,7 @@ xalloc(size_t size) { void *ptr; - if ((ptr = malloc(size)) == NULL) + if ((ptr = calloc(1, size)) == NULL) err(1, "allocing %zu bytes", size); return (ptr); @@ -710,12 +743,14 @@ make_type(const char *s) * token. */ static u_int -parse_type(enum tok *tok, struct type *t, const char *vname) +parse_type(enum tok *tok, struct type *t, const char *vname, char **subtype) { u_int syntax; struct enums *e; syntax = val; + if (subtype != NULL) + *subtype = NULL; if (*tok == TOK_ENUM || *tok == TOK_BITS) { if (t == NULL && vname != NULL) { @@ -759,6 +794,8 @@ parse_type(enum tok *tok, struct type *t, const char * if ((*tok = gettoken()) == '|') { if (gettoken() != TOK_STR) report("subtype expected after '|'"); + if (subtype != NULL) + *subtype = savetok(); *tok = gettoken(); } } @@ -794,18 +831,21 @@ parse(enum tok tok) if ((tok = gettoken()) == TOK_TYPE || tok == TOK_DEFTYPE || tok == TOK_ENUM || tok == TOK_BITS) { /* LEAF or COLUM */ - u_int syntax = parse_type(&tok, NULL, node->name); + char *subtype; + u_int syntax = parse_type(&tok, NULL, node->name, &subtype); if (tok == TOK_STR) { /* LEAF */ node->type = NODE_LEAF; node->u.leaf.func = savetok(); node->u.leaf.syntax = syntax; + node->u.leaf.subtype = subtype; tok = gettoken(); } else { /* COLUMN */ node->type = NODE_COLUMN; node->u.column.syntax = syntax; + node->u.column.subtype = subtype; } while (tok != ')') { @@ -825,9 +865,12 @@ parse(enum tok tok) tok = gettoken(); while (tok == TOK_TYPE || tok == TOK_DEFTYPE || tok == TOK_ENUM || tok == TOK_BITS) { - u_int syntax = parse_type(&tok, NULL, node->name); - if (index_count++ == SNMP_INDEXES_MAX) + char *subtype; + u_int syntax = parse_type(&tok, NULL, node->name, + &subtype); + if (index_count == SNMP_INDEXES_MAX) report("too many table indexes"); + node->u.entry.subtypes[index_count++] = subtype; node->u.entry.index |= syntax << (SNMP_INDEX_SHIFT * index_count); } @@ -882,7 +925,8 @@ parse_top(enum tok tok) tok = gettoken(); t->is_enum = (tok == TOK_ENUM); t->is_bits = (tok == TOK_BITS); - t->syntax = parse_type(&tok, t, NULL); + + t->syntax = parse_type(&tok, t, NULL, NULL); pushback(tok); return (NULL); @@ -903,7 +947,7 @@ parse_top(enum tok tok) * Generate the C-code table part for one node. */ static void -gen_node(FILE *fp, struct node *np, struct asn_oid *oid, u_int idx, +gen_node(FILE *fp, const struct node *np, struct asn_oid *oid, u_int idx, const char *func) { u_int n; @@ -1008,7 +1052,7 @@ gen_node(FILE *fp, struct node *np, struct asn_oid *oi * Generate the header file with the function declarations. */ static void -gen_header(FILE *fp, struct node *np, u_int oidlen, const char *func) +gen_header(FILE *fp, const struct node *np, u_int oidlen, const char *func) { char f[MAXSTR + 4]; struct node *sub; @@ -1058,7 +1102,7 @@ gen_header(FILE *fp, struct node *np, u_int oidlen, co * Generate the OID table. */ static void -gen_table(FILE *fp, struct node *node) +gen_table(FILE *fp, const struct node *node) { struct asn_oid oid; @@ -1067,7 +1111,6 @@ gen_table(FILE *fp, struct node *node) #ifdef HAVE_STDINT_H fprintf(fp, "#include \n"); #endif - fprintf(fp, "#include \n"); if (localincs) { fprintf(fp, "#include \"asn1.h\"\n"); fprintf(fp, "#include \"snmp.h\"\n"); @@ -1118,6 +1161,8 @@ gen_tree(const struct node *np, int level) case NODE_LEAF: print_syntax(np->u.leaf.syntax); + if (np->u.leaf.subtype != NULL) + printf(" | %s", np->u.leaf.subtype); printf(" %s%s%s)\n", np->u.leaf.func, (np->flags & FL_GET) ? " GET" : "", (np->flags & FL_SET) ? " SET" : ""); @@ -1137,8 +1182,11 @@ gen_tree(const struct node *np, int level) case NODE_ENTRY: printf(" :"); - for (i = 0; i < SNMP_INDEX_COUNT(np->u.entry.index); i++) + for (i = 0; i < SNMP_INDEX_COUNT(np->u.entry.index); i++) { print_syntax(SNMP_INDEX(np->u.entry.index, i)); + if (np->u.entry.subtypes[i] != NULL) + printf(" | %s", np->u.entry.subtypes[i]); + } printf(" %s\n", np->u.entry.func); TAILQ_FOREACH(sp, &np->u.entry.subs, link) gen_tree(sp, level + 1); @@ -1147,6 +1195,8 @@ gen_tree(const struct node *np, int level) case NODE_COLUMN: print_syntax(np->u.column.syntax); + if (np->u.column.subtype != NULL) + printf(" | %s", np->u.column.subtype); printf("%s%s)\n", (np->flags & FL_GET) ? " GET" : "", (np->flags & FL_SET) ? " SET" : ""); break; @@ -1194,15 +1244,6 @@ extract(FILE *fp, const struct node *np, struct asn_oi return (1); } -/** - * Extract the named OID. - * - * \param fp file to extract to - * \param root root of the tree - * \param object name of the object to extract - * - * \return 0 on success, -1 if the object was not found - */ static int gen_extract(FILE *fp, const struct node *root, char *object) { @@ -1391,45 +1432,6 @@ unminus(FILE *fp, const char *s) } /** - * Generate a definition for the enum packed into a guard against multiple - * definitions. - * - * \param fp file to write definition to - * \param t type - */ -static void -gen_enum(FILE *fp, const struct type *t) -{ - const struct enums *e; - long min = LONG_MAX; - - fprintf(fp, "\n"); - fprintf(fp, "#ifndef %s_defined__\n", t->name); - fprintf(fp, "#define %s_defined__\n", t->name); - fprintf(fp, "/*\n"); - fprintf(fp, " * From %s:%u\n", t->from_fname, t->from_lno); - fprintf(fp, " */\n"); - fprintf(fp, "enum %s {\n", t->name); - TAILQ_FOREACH(e, &t->enums, link) { - fprintf(fp, "\t%s_", t->name); - unminus(fp, e->name); - fprintf(fp, " = %ld,\n", e->value); - if (e->value < min) - min = e->value; - } - fprintf(fp, "};\n"); - fprintf(fp, "#define STROFF_%s %ld\n", t->name, min); - fprintf(fp, "#define STRING_%s \\\n", t->name); - TAILQ_FOREACH(e, &t->enums, link) { - fprintf(fp, "\t[%ld] = \"%s_", e->value - min, t->name); - unminus(fp, e->name); - fprintf(fp, "\",\\\n"); - } - fprintf(fp, "\n"); - fprintf(fp, "#endif /* %s_defined__ */\n", t->name); -} - -/** * Generate helper functions for an enum. * * We always generate a switch statement for the isok function. The compiler @@ -1494,6 +1496,54 @@ gen_enum_funcs(FILE *fp, const struct type *t, int cco } /** + * Generate a definition for the enum packed into a guard against multiple + * definitions. + * + * \param fp file to write definition to + * \param t type + * \param dof generate functions too + */ +static void +gen_enum(FILE *fp, const struct type *t, int dof) +{ + const struct enums *e; + long min = LONG_MAX; + + fprintf(fp, "\n"); + fprintf(fp, "#ifndef %s_defined__\n", t->name); + fprintf(fp, "#define %s_defined__\n", t->name); + fprintf(fp, "/*\n"); + fprintf(fp, " * From %s:%u\n", t->from_fname, t->from_lno); + fprintf(fp, " */\n"); + fprintf(fp, "enum %s {\n", t->name); + TAILQ_FOREACH(e, &t->enums, link) { + fprintf(fp, "\t%s_", t->name); + unminus(fp, e->name); + fprintf(fp, " = %ld,\n", e->value); + if (e->value < min) + min = e->value; + } + fprintf(fp, "};\n"); + fprintf(fp, "#define STROFF_%s %ld\n", t->name, min); + fprintf(fp, "#define STRING_%s \\\n", t->name); + TAILQ_FOREACH(e, &t->enums, link) { + fprintf(fp, "\t[%ld] = \"%s_", e->value - min, t->name); + unminus(fp, e->name); + fprintf(fp, "\",\\\n"); + } + fprintf(fp, "\n"); + if (dof) { + fprintf(fp, "#ifdef SNMPENUM_FUNCS\n"); + fprintf(fp, "\n"); + gen_enum_funcs(fp, t, 0); + fprintf(fp, "\n"); + fprintf(fp, "#endif\n"); + fprintf(fp, "\n"); + } + fprintf(fp, "#endif /* %s_defined__ */\n", t->name); +} + +/** * Generate helper functions for an enum. This generates code for a c file. * * \param fp file to write to @@ -1529,6 +1579,16 @@ gen_all_enum_funcs(FILE *fp, int ccode) gen_enum_funcs(fp, t, ccode); } +static void +gen_enums(FILE *fp, int dof) +{ + const struct type *t; + + LIST_FOREACH(t, &types, link) + if (t->is_enum || t->is_bits) + gen_enum(fp, t, dof); +} + /** * Extract a given enum to the specified file and optionally generate static * inline helper functions for them. @@ -1546,9 +1606,7 @@ extract_enum(FILE *fp, const char *name, int gen_funcs LIST_FOREACH(t, &types, link) if ((t->is_enum || t->is_bits) && strcmp(t->name, name) == 0) { - gen_enum(fp, t); - if (gen_funcs) - gen_enum_funcs(fp, t, 0); + gen_enum(fp, t, gen_funcs); return (0); } return (-1); @@ -1567,11 +1625,8 @@ extract_all_enums(FILE *fp, int gen_funcs) const struct type *t; LIST_FOREACH(t, &types, link) - if (t->is_enum || t->is_bits) { - gen_enum(fp, t); - if (gen_funcs) - gen_enum_funcs(fp, t, 0); - } + if (t->is_enum || t->is_bits) + gen_enum(fp, t, gen_funcs); } /** @@ -1579,13 +1634,12 @@ extract_all_enums(FILE *fp, int gen_funcs) * * \param argc number of arguments * \param argv arguments (enum names) - * \param gen_funcs_h generate functions into the header file - * \param gen_funcs_c generate a .c file with functions + * \param gen_funcs which functions to generate */ static void -make_enums(int argc, char *argv[], int gen_funcs_h, int gen_funcs_c) +make_enums(int argc, char *argv[], enum gen_funcs gen_funcs) { - if (gen_funcs_c) { + if (gen_funcs == GEN_FUNCS_C) { if (argc == 0) gen_all_enum_funcs(stdout, 1); else { @@ -1595,30 +1649,58 @@ make_enums(int argc, char *argv[], int gen_funcs_h, in } } else { if (argc == 0) - extract_all_enums(stdout, gen_funcs_h); + extract_all_enums(stdout, gen_funcs == GEN_FUNCS_H); else { for (int i = 0; i < argc; i++) - if (extract_enum(stdout, argv[i], gen_funcs_h)) + if (extract_enum(stdout, argv[i], + gen_funcs == GEN_FUNCS_H)) errx(1, "enum not found: %s", argv[i]); } } } +/** + * Produce the operation tables for the daemon or a module. + * + * \param root tree root + * \param gen_funcs generate enum funcs + */ +static void +make_table(const struct node *root, int gen_funcs) +{ + FILE *fp; + + char fname[MAXPATHLEN + 1]; + sprintf(fname, "%stree.h", file_prefix); + if ((fp = fopen(fname, "w")) == NULL) + err(1, "%s: ", fname); + gen_header(fp, root, PREFIX_LEN, NULL); + + fprintf(fp, "\n#ifdef SNMPTREE_TYPES\n"); + gen_enums(fp, gen_funcs); + fprintf(fp, "\n#endif /* SNMPTREE_TYPES */\n\n"); + + fprintf(fp, "#define %sCTREE_SIZE %u\n", file_prefix, tree_size); + fprintf(fp, "extern const struct snmp_node %sctree[];\n", file_prefix); + + fclose(fp); + + sprintf(fname, "%stree.c", file_prefix); + if ((fp = fopen(fname, "w")) == NULL) + err(1, "%s: ", fname); + gen_table(fp, root); + fclose(fp); +} + int main(int argc, char *argv[]) { - int do_extract = 0; - int do_tree = 0; - int do_enums = 0; - int gen_funcs_h = 0; - int gen_funcs_c = 0; - int opt; - struct node *root; - char fname[MAXPATHLEN + 1]; - int tok; - FILE *fp; + enum op op = OP_GEN; + enum gen_funcs gen_funcs = GEN_FUNCS_NONE; + char *infile = NULL; + int opt; while ((opt = getopt(argc, argv, "dEeFfhI:i:lp:t")) != EOF) switch (opt) { @@ -1627,19 +1709,29 @@ main(int argc, char *argv[]) break; case 'E': - do_enums = 1; + if (op != OP_GEN && op != OP_ENUMS) + errx(1, "-E conflicts with earlier options"); + op = OP_ENUMS; break; case 'e': - do_extract = 1; + if (op != OP_GEN && op != OP_EXTRACT) + errx(1, "-e conflicts with earlier options"); + op = OP_EXTRACT; break; case 'F': - gen_funcs_c = 1; + if (gen_funcs != GEN_FUNCS_NONE && + gen_funcs != GEN_FUNCS_C) + errx(1, "-F conflicts with -f"); + gen_funcs = GEN_FUNCS_C; break; case 'f': - gen_funcs_h = 1; + if (gen_funcs != GEN_FUNCS_NONE && + gen_funcs != GEN_FUNCS_H) + errx(1, "-f conflicts with -F"); + gen_funcs = GEN_FUNCS_H; break; case 'h': @@ -1666,75 +1758,61 @@ main(int argc, char *argv[]) break; case 't': - do_tree = 1; + if (op != OP_GEN && op != OP_TREE) + errx(1, "-t conflicts with earlier options"); + op = OP_TREE; break; } - if (do_extract + do_tree + do_enums > 1) - errx(1, "conflicting options -e/-t/-E"); - if (!do_extract && !do_enums && argc != optind) - errx(1, "no arguments allowed"); - if (do_extract && argc == optind) - errx(1, "no objects specified"); + argc -= optind; + argv += optind; - if ((gen_funcs_h || gen_funcs_c) && (do_extract || do_tree)) - errx(1, "-f and -F not allowed with -e or -t"); - if (gen_funcs_c && !do_enums) - errx(1, "-F requires -E"); - if (gen_funcs_h && gen_funcs_c) - errx(1, "-f and -F are mutually exclusive"); - + /* open input */ if (infile == NULL) { input_new(stdin, NULL, ""); } else { + FILE *fp; if ((fp = fopen(infile, "r")) == NULL) err(1, "%s", infile); input_new(fp, NULL, infile); } - root = parse_top(gettoken()); + /* parse and check input */ + struct node *root = parse_top(gettoken()); + + int tok; while ((tok = gettoken()) != TOK_EOF) merge(&root, parse_top(tok)); if (root) check_tree(root); - if (do_extract) { - while (optind < argc) { - if (gen_extract(stdout, root, argv[optind])) - errx(1, "object not found: %s", argv[optind]); - optind++; - } + /* do what the user has requested */ + switch (op) { + + case OP_EXTRACT: + if (argc == 0) + errx(1, "-e requires arguments"); + + for (int i = 0; i < argc; i++) + if (gen_extract(stdout, root, argv[i])) + errx(1, "object not found: %s", argv[i]); return (0); - } - if (do_enums) { - make_enums(argc - optind, argv + optind, - gen_funcs_h, gen_funcs_c); + + case OP_ENUMS: + make_enums(argc, argv, gen_funcs); return (0); - } - if (do_tree) { + + case OP_TREE: + if (argc != 0) + errx(1, "-t allows no arguments"); gen_tree(root, 0); return (0); - } - sprintf(fname, "%stree.h", file_prefix); - if ((fp = fopen(fname, "w")) == NULL) - err(1, "%s: ", fname); - gen_header(fp, root, PREFIX_LEN, NULL); - fprintf(fp, "\n#ifdef SNMPTREE_TYPES\n"); - extract_all_enums(fp, gen_funcs_h); - fprintf(fp, "\n#endif /* SNMPTREE_TYPES */\n\n"); - - fprintf(fp, "#define %sCTREE_SIZE %u\n", file_prefix, tree_size); - fprintf(fp, "extern const struct snmp_node %sctree[];\n", file_prefix); - - fclose(fp); - - sprintf(fname, "%stree.c", file_prefix); - if ((fp = fopen(fname, "w")) == NULL) - err(1, "%s: ", fname); - gen_table(fp, root); - fclose(fp); - - return (0); + case OP_GEN: + if (argc != 0) + errx(1, "tree generation allows no arguments"); + make_table(root, gen_funcs == GEN_FUNCS_H); + return (0); + } } Modified: head/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- head/contrib/bsnmp/lib/snmpclient.c Tue Apr 2 12:02:35 2019 (r345796) +++ head/contrib/bsnmp/lib/snmpclient.c Tue Apr 2 12:50:01 2019 (r345797) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2005 + * Copyright (c) 2004-2005,2018 * Hartmut Brandt. * All rights reserved. * Copyright (c) 2001-2003 @@ -34,11 +34,13 @@ * * Support functions for SNMP clients. */ -#include +#include #include #include #include #include +#include +#include #include #include #include @@ -58,12 +60,16 @@ #include #endif +#include + #include "support.h" #include "asn1.h" #include "snmp.h" #include "snmpclient.h" #include "snmppriv.h" +#define DEBUG_PARSE 0 + /* global context */ struct snmp_client snmp_client; @@ -924,7 +930,8 @@ open_client_udp(const char *host, const char *port) /* open connection */ memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_INET; + hints.ai_family = snmp_client.trans == SNMP_TRANS_UDP ? AF_INET: + AF_INET6; hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = 0; error = getaddrinfo(snmp_client.chost, snmp_client.cport, &hints, &res0); @@ -1068,6 +1075,7 @@ snmp_open(const char *host, const char *port, const ch switch (snmp_client.trans) { case SNMP_TRANS_UDP: + case SNMP_TRANS_UDP6: if (open_client_udp(host, port) != 0) return (-1); break; @@ -1866,99 +1874,410 @@ snmp_client_set_port(struct snmp_client *cl, const cha return (0); } -/* - * parse a server specification +/** + * Try to get a transport identifier which is a leading alphanumeric string + * (starting with '_' or a letter and including also '_') terminated by + * a double colon. The string may not be empty. The transport identifier + * is optional. * - * [trans::][community@][server][:port] + * \param sc client struct to set errors + * \param strp possible start of transport; updated to point to + * the next character to parse + * + * \return end of transport; equals *strp if there is none; NULL if there + * was an error */ -int -snmp_parse_server(struct snmp_client *sc, const char *str) +static inline const char * +get_transp(struct snmp_client *sc, const char **strp) { - const char *p, *s = str; + const char *p = *strp; - /* look for a double colon */ - for (p = s; *p != '\0'; p++) { - if (*p == '\\' && p[1] != '\0') { + if (isascii(*p) && (isalpha(*p) || *p == '_')) { + p++; + while (isascii(*p) && (isalnum(*p) || *p == '_')) p++; - continue; + if (p[0] == ':' && p[1] == ':') { + *strp = p + 2; + return (p); } - if (*p == ':' && p[1] == ':') - break; } - if (*p != '\0') { - if (p > s) { - if (p - s == 3 && strncmp(s, "udp", 3) == 0) - sc->trans = SNMP_TRANS_UDP; - else if (p - s == 6 && strncmp(s, "stream", 6) == 0) - sc->trans = SNMP_TRANS_LOC_STREAM; - else if (p - s == 5 && strncmp(s, "dgram", 5) == 0) - sc->trans = SNMP_TRANS_LOC_DGRAM; - else { - seterr(sc, "unknown SNMP transport '%.*s'", - (int)(p - s), s); - return (-1); - } - } - s = p + 2; + if (p[0] == ':' && p[1] == ':') { + seterr(sc, "empty transport specifier"); + return (NULL); } + return (*strp); +} - /* look for a @ */ - for (p = s; *p != '\0'; p++) { - if (*p == '\\' && p[1] != '\0') { - p++; - continue; - } - if (*p == '@') - break; +/** + * Try to get community string. Eat everything up to the last @ (if there is + * any) but only if it is not longer than SNMP_COMMUNITY_MAXLEN. Empty + * community strings are legal. + * + * \param sc client struct to set errors + * \param strp possible start of community; updated to the point to + * the next character to parse + * + * \return end of community; equals *strp if there is none; NULL if there + * was an error + */ +static inline const char * +get_comm(struct snmp_client *sc, const char **strp) +{ + const char *p = strrchr(*strp, '@'); + + if (p == NULL) + /* no community string */ + return (*strp); + + if (p - *strp > SNMP_COMMUNITY_MAXLEN) { + seterr(sc, "community string too long '%.*s'", + p - *strp, *strp); + return (NULL); } - if (*p != '\0') { - if (p - s > SNMP_COMMUNITY_MAXLEN) { - seterr(sc, "community string too long"); - return (-1); + *strp = p + 1; + return (p); +} + +/** + * Try to get an IPv6 address. This starts with an [ and should end with an ] + * and everything between should be not longer than INET6_ADDRSTRLEN and + * parseable by inet_pton(). + * + * \param sc client struct to set errors + * \param strp possible start of IPv6 address (the '['); updated to point to + * the next character to parse (the one after the closing ']') + * + * \return end of address (equals *strp + 1 if there is none) or NULL + * on errors + */ +static inline const char * +get_ipv6(struct snmp_client *sc, const char **strp) +{ + char str[INET6_ADDRSTRLEN + IF_NAMESIZE]; + struct addrinfo hints, *res; + int error; + + if (**strp != '[') + return (*strp + 1); + + const char *p = *strp + 1; + while (*p != ']' ) { + if (*p == '\0') { + seterr(sc, "unterminated IPv6 address '%.*s'", + p - *strp, *strp); + return (NULL); } - strncpy(sc->read_community, s, p - s); - sc->read_community[p - s] = '\0'; - strncpy(sc->write_community, s, p - s); - sc->write_community[p - s] = '\0'; - s = p + 1; + p++; } - /* look for a colon */ - for (p = s; *p != '\0'; p++) { - if (*p == '\\' && p[1] != '\0') { - p++; - continue; - } - if (*p == ':') - break; + if (p - *strp > INET6_ADDRSTRLEN + IF_NAMESIZE) { + seterr(sc, "IPv6 address too long '%.*s'", p - *strp, *strp); + return (NULL); } - if (*p == ':') { - if (p > s) { - /* host:port */ - free(sc->chost); - if ((sc->chost = malloc(p - s + 1)) == NULL) { - seterr(sc, "%s", strerror(errno)); - return (-1); - } - strncpy(sc->chost, s, p - s); - sc->chost[p - s] = '\0'; + strncpy(str, *strp + 1, p - (*strp + 1)); + str[p - (*strp + 1)] = '\0'; + + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_CANONNAME | AI_NUMERICHOST; + hints.ai_family = AF_INET6; + hints.ai_socktype = SOCK_DGRAM; + hints.ai_protocol = IPPROTO_UDP; + error = getaddrinfo(str, NULL, &hints, &res); + if (error != 0) { + seterr(sc, "%s: %s", str, gai_strerror(error)); + return (NULL); + } + freeaddrinfo(res); + *strp = p + 1; + return (p); +} + +/** + * Try to get an IPv4 address. This starts with a digit and consists of digits + * and dots, is not longer INET_ADDRSTRLEN and must be parseable by + * inet_aton(). + * + * \param sc client struct to set errors + * \param strp possible start of IPv4 address; updated to point to the + * next character to parse + * + * \return end of address (equals *strp if there is none) or NULL + * on errors + */ +static inline const char * +get_ipv4(struct snmp_client *sc, const char **strp) +{ + const char *p = *strp; + + while (isascii(*p) && (isdigit(*p) || *p == '.')) + p++; + + if (p - *strp > INET_ADDRSTRLEN) { + seterr(sc, "IPv4 address too long '%.*s'", p - *strp, *strp); + return (NULL); + } + if (*strp == p) + return *strp; + + char str[INET_ADDRSTRLEN + 1]; + strncpy(str, *strp, p - *strp); + str[p - *strp] = '\0'; + + struct in_addr addr; + if (inet_aton(str, &addr) != 1) { + seterr(sc, "illegal IPv4 address '%s'", str); + return (NULL); + } + + *strp = p; + return (p); +} + +/** + * Try to get a hostname. This includes everything up to but not including + * the last colon (if any). There is no length restriction. + * + * \param sc client struct to set errors + * \param strp possible start of hostname; updated to point to the next + * character to parse (the trailing NUL character or the last + * colon) + * + * \return end of address (equals *strp if there is none) + */ +static inline const char * +get_host(struct snmp_client *sc __unused, const char **strp) +{ + const char *p = strrchr(*strp, ':'); + + if (p == NULL) { + *strp += strlen(*strp); + return (*strp); + } + + *strp = p; + return (p); +} + +/** + * Try to get a port number. This start with a colon and extends to the end + * of string. The port number must not be empty. + * + * \param sc client struct to set errors *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15AF1DC429; Tue, 3 Sep 2019 14:06:09 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z36Hzlz4PDd; Tue, 3 Sep 2019 14:06:07 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 00AF01A19C; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7A63D3A41; Wed, 3 Apr 2019 19:43:13 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3350F6A65B; Wed, 3 Apr 2019 19:43:13 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1B9F43A3F; Wed, 3 Apr 2019 19:43:13 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 379523A3B for ; Wed, 3 Apr 2019 19:43:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3A7A6A656; Wed, 3 Apr 2019 19:43:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::7c78:2711:3f37:8a5d] (unknown [IPv6:2001:470:7a58:0:7c78:2711:3f37:8a5d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id D05CB3F6D0; Wed, 3 Apr 2019 21:42:59 +0200 (CEST) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_5733E18B-193D-4A27-B386-DDD252477B54"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r345807 - head/usr.bin/top In-Reply-To: <20190403234558.X1970@besplex.bde.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Bruce Evans References: <201904021801.x32I1sxX019439@repo.freebsd.org> <20190403234558.X1970@besplex.bde.org> X-Mailer: Apple Mail (2.3445.104.8) Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3350F6A65B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:17 -0000 X-Original-Date: Wed, 3 Apr 2019 21:42:59 +0200 X-List-Received-Date: Tue, 03 Sep 2019 14:06:17 -0000 --Apple-Mail=_5733E18B-193D-4A27-B386-DDD252477B54 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 3 Apr 2019, at 15:16, Bruce Evans wrote: > > On Tue, 2 Apr 2019, Dimitry Andric wrote: >> Author: dim >> Date: Tue Apr 2 18:01:54 2019 >> New Revision: 345807 >> URL: https://svnweb.freebsd.org/changeset/base/345807 >> >> Log: >> Fix regression in top(1) after r344381, causing informational messages >> to no longer be displayed. This was because the reimplementation of >> setup_buffer() did not copy the previous contents into any reallocated >> buffer. ... > Looks like realloc() hasn't been invented yet. > > realloc() wouldn't clear the new part of the buffer, so a memset() or at > least setting the first byte in a new buffer (starting with buffer == NULL > might be needed). Yeah, I found that a bit ugly, so just using calloc (like the previous implementation of setup_buffer did) and copying only the old contents seemed nicer. I never liked realloc's interface. > The above has some bugs when the new buffer is smaller the old buffer: > - when old_len < len - 1, the new buffer has no space for the old buffer > including its NUL terminator, so the new buffer is left unterminated > after blind truncation No, in this case the old buffer can be copied entirely, and the new buffer will already be NUL terminated, because calloc has filled the entirety of it with zeroes. This is also expected in the rest of the display.c code. > - when old_len == len - 1, the new buffer has no space for the NUL > terminator, so the new buffer is left unterminated after not overrunning > it by copying the NUL terminator No, in this case the old buffer can be copied entirely, and the new buffer will have exactly one zero byte at the end. > - when old_len > len - 1, the new buffer is NUL terminated in an obfuscated > way (calloc() has filled it with NULs and the memcpy() doesn't overwrite > them all). Indeed, that is exactly the intent. -Dimitry --Apple-Mail=_5733E18B-193D-4A27-B386-DDD252477B54 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXKUMwwAKCRCwXqMKLiCW o5KgAJsHYRWGvsFCC9jmrS4ylTKqCR7Z8gCdGcjmXMW6sJIuQMwjUD0KPg0y9BY= =+1zd -----END PGP SIGNATURE----- --Apple-Mail=_5733E18B-193D-4A27-B386-DDD252477B54-- From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38D62DC358; Tue, 3 Sep 2019 14:06:06 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z15w30z4PBh; Tue, 3 Sep 2019 14:06:05 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id BC2801A108; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id A0F2CD5D9; Wed, 3 Apr 2019 01:00:38 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DEBB8896F; Wed, 3 Apr 2019 01:00:37 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 11392D59D; Wed, 3 Apr 2019 01:00:37 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D3067D598; Wed, 3 Apr 2019 01:00:33 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail03.asahi-net.or.jp (mail03.asahi-net.or.jp [202.224.55.15]) by mx1.freebsd.org (Postfix) with ESMTP id 249678895B; Wed, 3 Apr 2019 01:00:32 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from rv515.advok.com (pool-72-76-119-135.nwrknj.fios.verizon.net [72.76.119.135]) (Authenticated sender: NR2Y-OOT) by mail03.asahi-net.or.jp (Postfix) with ESMTPSA id 8F4BB39474; Wed, 3 Apr 2019 10:00:19 +0900 (JST) From: Yoshihiro Ota To: rgrimes@freebsd.org Cc: "Rodney W. Grimes" , Michael Reifenberger , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r345804 - head/usr.bin/systat Message-Id: <20190402210001.3cd9b434a2f521e2dea80009@j.email.ne.jp> In-Reply-To: <201904021408.x32E8Ho9021667@gndrsh.dnsmgr.net> References: <201904021401.x32E13Fi092699@repo.freebsd.org> <201904021408.x32E8Ho9021667@gndrsh.dnsmgr.net> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; i386-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 4DEBB8896F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:13 -0000 X-Original-Date: Tue, 2 Apr 2019 21:00:01 -0400 X-List-Received-Date: Tue, 03 Sep 2019 14:06:13 -0000 Hi, On Tue, 2 Apr 2019 07:08:17 -0700 (PDT) "Rodney W. Grimes" wrote: > > Author: mr > > Date: Tue Apr 2 14:01:03 2019 > > New Revision: 345804 > > URL: https://svnweb.freebsd.org/changeset/base/345804 > > > > Log: > > systat -zarc to display disk activities like -vm > > > > PR: 213310 > > Submitted by: ota > > MFH: 4 weeks > > ? MFC: > > > Differential Revision: https://reviews.freebsd.org/D18726 > > > > Modified: > > head/usr.bin/systat/devs.c > > head/usr.bin/systat/devs.h > > head/usr.bin/systat/iostat.c > > head/usr.bin/systat/swap.c > > head/usr.bin/systat/systat.h > > head/usr.bin/systat/vmstat.c > > head/usr.bin/systat/zarc.c > > > > Modified: head/usr.bin/systat/devs.c > > ============================================================================== > > --- head/usr.bin/systat/devs.c Tue Apr 2 13:59:04 2019 (r345803) > > +++ head/usr.bin/systat/devs.c Tue Apr 2 14:01:03 2019 (r345804) > > @@ -2,6 +2,7 @@ > > * SPDX-License-Identifier: BSD-3-Clause > > * > > * Copyright (c) 1998 Kenneth D. Merry. > > + * 2015 Yoshihiro Ota > > * All rights reserved. > > > Can we get in contact with Yoshihiro Ota about his > copyright statements, and correcting this to make > it clear that it is Kenneth D. Merry that is asserting > "All rights reserved" and if Ota does nor does not wish to assert > "All rights reserved". > > As committed this makes a grey area on Kenneth's assertion, > also leaving out the word copyright on Yoshihiro's line is a bit iffy. > > I am only commenting once, this issue appears several times. > We can go back out to D18726 to discuss it if need be. I've fully written zarc.c (and copied copy-right section from another file) but all other changes in other files are refactoring and adjustments. I don't know the policy/procedure of how to update copy right section of FreeBSD. Please adjust them according the project. Regards, Hiro From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78111DC317; Tue, 3 Sep 2019 14:06:05 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z02j0cz4P9l; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 353411A0B9; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7ED7B5BBB; Tue, 2 Apr 2019 17:51:32 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2399D6F766; Tue, 2 Apr 2019 17:51:32 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 0E4545BB9; Tue, 2 Apr 2019 17:51:32 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5023F5BB7 for ; Tue, 2 Apr 2019 17:51:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 184716F756; Tue, 2 Apr 2019 17:51:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E78B21784; Tue, 2 Apr 2019 17:51:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x32HpSIb014695; Tue, 2 Apr 2019 17:51:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x32HpS8T014694; Tue, 2 Apr 2019 17:51:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201904021751.x32HpS8T014694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345806 - head/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Commit-Revision: 345806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 2399D6F766 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:11 -0000 X-Original-Date: Tue, 2 Apr 2019 17:51:28 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:11 -0000 Author: dim Date: Tue Apr 2 17:51:28 2019 New Revision: 345806 URL: https://svnweb.freebsd.org/changeset/base/345806 Log: Pull in r357362 from upstream clang trunk (by David Chisnall): [objc-gnustep] Use .init_array not .ctors when requested. This doesn't make a difference most of the time but FreeBSD/ARM doesn't run anything in the .ctors array. This should help with updating the libobjc2 port for armv7. Requested by: theraven Upstream PR: https://github.com/gnustep/libobjc2/issues/83 MFC after: 3 days Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp Tue Apr 2 14:46:10 2019 (r345805) +++ head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp Tue Apr 2 17:51:28 2019 (r345806) @@ -1519,7 +1519,12 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { if (CGM.getTriple().isOSBinFormatCOFF()) InitVar->setSection(".CRT$XCLz"); else - InitVar->setSection(".ctors"); + { + if (CGM.getCodeGenOpts().UseInitArray) + InitVar->setSection(".init_array"); + else + InitVar->setSection(".ctors"); + } InitVar->setVisibility(llvm::GlobalValue::HiddenVisibility); InitVar->setComdat(TheModule.getOrInsertComdat(".objc_ctor")); CGM.addUsedGlobal(InitVar); From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 300B7DC26E; Tue, 3 Sep 2019 14:06:03 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yy190sz4P71; Tue, 3 Sep 2019 14:06:02 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 0E13D1A019; Tue, 3 Sep 2019 14:05:55 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 7583F12690; Mon, 1 Apr 2019 19:19:57 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52CF485151; Mon, 1 Apr 2019 19:19:56 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 282771263C; Mon, 1 Apr 2019 19:19:56 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id BF71F1263A for ; Mon, 1 Apr 2019 19:19:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D3E48514B; Mon, 1 Apr 2019 19:19:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F3FD1AD37; Mon, 1 Apr 2019 19:19:52 +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 x31JJqRs000581; Mon, 1 Apr 2019 19:19:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x31JJpOv000579; Mon, 1 Apr 2019 19:19:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904011919.x31JJpOv000579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345778 - in head/gnu/usr.bin/gdb: gdb kgdb X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/gnu/usr.bin/gdb: gdb kgdb X-SVN-Commit-Revision: 345778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 52CF485151 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:08 -0000 X-Original-Date: Mon, 1 Apr 2019 19:19:51 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:08 -0000 Author: emaste Date: Mon Apr 1 19:19:51 2019 New Revision: 345778 URL: https://svnweb.freebsd.org/changeset/base/345778 Log: Fix gdb/kgdb build under WITH_PIE Explicitly specified bare .a libraries need ${PIE_SUFFIX}. Reported by: David E. Cross, on twitter Sponsored by: The FreeBSD Foundation Modified: head/gnu/usr.bin/gdb/gdb/Makefile head/gnu/usr.bin/gdb/kgdb/Makefile Modified: head/gnu/usr.bin/gdb/gdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdb/Makefile Mon Apr 1 19:08:05 2019 (r345777) +++ head/gnu/usr.bin/gdb/gdb/Makefile Mon Apr 1 19:19:51 2019 (r345778) @@ -3,9 +3,10 @@ PROG= gdb${GDB_SUFFIX} SRCS= gdb.c -BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \ - ${OBJ_BU}/libiberty/libiberty.a -GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a +BULIBS= ${OBJ_BU}/libbfd/libbfd${PIE_SUFFIX}.a \ + ${OBJ_BU}/libopcodes/libopcodes${PIE_SUFFIX}.a \ + ${OBJ_BU}/libiberty/libiberty${PIE_SUFFIX}.a +GDBLIBS= ${OBJ_GDB}/libgdb/libgdb${PIE_SUFFIX}.a # libthread_db.so calls back into gdb for the proc services. Make all the # global symbols visible. Modified: head/gnu/usr.bin/gdb/kgdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/Makefile Mon Apr 1 19:08:05 2019 (r345777) +++ head/gnu/usr.bin/gdb/kgdb/Makefile Mon Apr 1 19:19:51 2019 (r345778) @@ -4,9 +4,10 @@ PROG= kgdb${GDB_SUFFIX} SRCS= main.c kld.c kthr.c trgt.c trgt_${TARGET_CPUARCH}.c WARNS?= 2 -BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \ - ${OBJ_BU}/libiberty/libiberty.a -GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a +BULIBS= ${OBJ_BU}/libbfd/libbfd${PIE_SUFFIX}.a \ + ${OBJ_BU}/libopcodes/libopcodes${PIE_SUFFIX}.a \ + ${OBJ_BU}/libiberty/libiberty${PIE_SUFFIX}.a +GDBLIBS= ${OBJ_GDB}/libgdb/libgdb${PIE_SUFFIX}.a DPADD= ${GDBLIBS} ${BULIBS} LDADD= ${GDBLIBS} ${BULIBS} From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B427DC2BF; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yz549dz4P8Q; Tue, 3 Sep 2019 14:06:03 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id D476A1A082; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id EBFD21846; Tue, 2 Apr 2019 13:41:30 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BA258C8FF; Tue, 2 Apr 2019 13:41:30 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1863617EB; Tue, 2 Apr 2019 13:41:30 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 23D0617E6 for ; Tue, 2 Apr 2019 13:41:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E52678C8EA; Tue, 2 Apr 2019 13:41:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEEB726D19; Tue, 2 Apr 2019 13:41:26 +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 x32DfQiR080809; Tue, 2 Apr 2019 13:41:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x32DfQgp080808; Tue, 2 Apr 2019 13:41:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904021341.x32DfQgp080808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345799 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 345799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 6BA258C8FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:09 -0000 X-Original-Date: Tue, 2 Apr 2019 13:41:26 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:09 -0000 Author: kib Date: Tue Apr 2 13:41:26 2019 New Revision: 345799 URL: https://svnweb.freebsd.org/changeset/base/345799 Log: Block creation of the new nodes for read-only tmpfs mounts. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19737 Modified: head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Tue Apr 2 13:38:00 2019 (r345798) +++ head/sys/fs/tmpfs/tmpfs_subr.c Tue Apr 2 13:41:26 2019 (r345799) @@ -218,6 +218,8 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount */ return (EBUSY); } + if ((mp->mnt_kern_flag & MNT_RDONLY) != 0) + return (EROFS); nnode = (struct tmpfs_node *)uma_zalloc_arg(tmp->tm_node_pool, tmp, M_WAITOK); From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FBD9DC38D; Tue, 3 Sep 2019 14:06:07 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z25yXgz4PCQ; Tue, 3 Sep 2019 14:06:06 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 106911A13E; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 1CFB0FF40; Wed, 3 Apr 2019 03:50:21 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E0398E74F; Wed, 3 Apr 2019 03:50:20 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 11813FED8; Wed, 3 Apr 2019 03:50:20 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id EDE06FED3 for ; Wed, 3 Apr 2019 03:50:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B77848E744; Wed, 3 Apr 2019 03:50:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 944F582CB; Wed, 3 Apr 2019 03:50:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x333oGa1030064; Wed, 3 Apr 2019 03:50:16 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x333oG3X030063; Wed, 3 Apr 2019 03:50:16 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201904030350.x333oG3X030063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345828 - head/sys/rpc/rpcsec_gss X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/rpc/rpcsec_gss X-SVN-Commit-Revision: 345828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3E0398E74F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:13 -0000 X-Original-Date: Wed, 3 Apr 2019 03:50:16 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:13 -0000 Author: rmacklem Date: Wed Apr 3 03:50:16 2019 New Revision: 345828 URL: https://svnweb.freebsd.org/changeset/base/345828 Log: Add a comment to the r345818 patch to explain why cl_refs is initialized to 2. PR: 235582 MFC after: 2 weeks Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Wed Apr 3 03:30:57 2019 (r345827) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Wed Apr 3 03:50:16 2019 (r345828) @@ -568,6 +568,11 @@ svc_rpc_gss_create_client(void) client = mem_alloc(sizeof(struct svc_rpc_gss_client)); memset(client, 0, sizeof(struct svc_rpc_gss_client)); + + /* + * Set the initial value of cl_refs to two. One for the caller + * and the other to hold onto the client structure until it expires. + */ refcount_init(&client->cl_refs, 2); sx_init(&client->cl_lock, "GSS-client"); getcredhostid(curthread->td_ucred, &hostid); From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1E52DC3CD; Tue, 3 Sep 2019 14:06:07 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z34pM6z4PDK; Tue, 3 Sep 2019 14:06:07 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id CBBE41A18F; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D513AC87; Wed, 3 Apr 2019 17:02:27 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77A418AE36; Wed, 3 Apr 2019 17:02:24 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1834FBCF; Wed, 3 Apr 2019 17:02:24 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 4EEBEBCA for ; Wed, 3 Apr 2019 17:02:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AB1A8AE19; Wed, 3 Apr 2019 17:02: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 341F418D09; Wed, 3 Apr 2019 17:02: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 x33H2Ix8056775; Wed, 3 Apr 2019 17:02:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x33H2IC9056774; Wed, 3 Apr 2019 17:02:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904031702.x33H2IC9056774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345847 - head/sys/fs/msdosfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/msdosfs X-SVN-Commit-Revision: 345847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 77A418AE36 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:15 -0000 X-Original-Date: Wed, 3 Apr 2019 17:02:18 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:15 -0000 Author: kib Date: Wed Apr 3 17:02:18 2019 New Revision: 345847 URL: https://svnweb.freebsd.org/changeset/base/345847 Log: msdosfs: zero tail of the last block on truncation for VREG vnodes as well. Despite the call to vtruncbuf() from detrunc(), which results in zeroing part of the partial page after EOF, there still is a possibility to retain the stale data which is revived on file enlargement. If the filesystem block size is greater than the page size, partial block might keep other after-EOF pages wired and they get reused then. Fix it by zeroing whole part of the partial buffer after EOF, not relying on vnode_pager_setsize(). PR: 236977 Reported by: asomers Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/msdosfs/msdosfs_denode.c Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Wed Apr 3 13:59:35 2019 (r345846) +++ head/sys/fs/msdosfs/msdosfs_denode.c Wed Apr 3 17:02:18 2019 (r345847) @@ -405,19 +405,21 @@ detrunc(struct denode *dep, u_long length, int flags, bn = cntobn(pmp, eofentry); error = bread(pmp->pm_devvp, bn, pmp->pm_bpcluster, NOCRED, &bp); - if (error) { - brelse(bp); + } else { + error = bread(DETOV(dep), de_cluster(pmp, length), + pmp->pm_bpcluster, cred, &bp); + } + if (error) { #ifdef MSDOSFS_DEBUG - printf("detrunc(): bread fails %d\n", error); + printf("detrunc(): bread fails %d\n", error); #endif - return (error); - } - memset(bp->b_data + boff, 0, pmp->pm_bpcluster - boff); - if (flags & IO_SYNC) - bwrite(bp); - else - bdwrite(bp); + return (error); } + memset(bp->b_data + boff, 0, pmp->pm_bpcluster - boff); + if ((flags & IO_SYNC) != 0) + bwrite(bp); + else + bdwrite(bp); } /* From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 248B3DC227; Tue, 3 Sep 2019 14:06:02 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yx5Y42z4P6M; Tue, 3 Sep 2019 14:06:01 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 54E2A19FF2; Tue, 3 Sep 2019 14:05:55 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D68A512134; Mon, 1 Apr 2019 18:54:21 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 648F78466B; Mon, 1 Apr 2019 18:54:20 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 288B312107; Mon, 1 Apr 2019 18:54:20 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 9A64A12105 for ; Mon, 1 Apr 2019 18:54:16 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 445EC84665; Mon, 1 Apr 2019 18:54:16 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19DCE1A9CF; Mon, 1 Apr 2019 18:54:16 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x31IsFBO089318; Mon, 1 Apr 2019 18:54:15 GMT (envelope-from kibab@FreeBSD.org) Received: (from kibab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x31IsFKR089317; Mon, 1 Apr 2019 18:54:15 GMT (envelope-from kibab@FreeBSD.org) Message-Id: <201904011854.x31IsFKR089317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kibab set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345776 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: kibab X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 345776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 648F78466B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:08 -0000 X-Original-Date: Mon, 1 Apr 2019 18:54:15 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:08 -0000 Author: kibab Date: Mon Apr 1 18:54:15 2019 New Revision: 345776 URL: https://svnweb.freebsd.org/changeset/base/345776 Log: Refactor error handling There is some code duplication in error handling paths in a few functions. Create a function for printing such errors in human-readable way and get rid of duplicates. Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D15912 Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Mon Apr 1 18:49:39 2019 (r345775) +++ head/sys/cam/mmc/mmc_da.c Mon Apr 1 18:54:15 2019 (r345776) @@ -150,6 +150,17 @@ struct sdda_softc { struct timeval log_time; }; +static const char *mmc_errmsg[] = +{ + "None", + "Timeout", + "Bad CRC", + "Fifo", + "Failed", + "Invalid", + "NO MEMORY" +}; + #define ccb_bp ppriv_ptr1 static disk_strategy_t sddastrategy; @@ -165,6 +176,7 @@ static void sddadone(struct cam_periph *periph, static int sddaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags); +static int mmc_handle_reply(union ccb *ccb); static uint16_t get_rca(struct cam_periph *periph); static void sdda_start_init(void *context, union ccb *start_ccb); static void sdda_start_init_task(void *context, int pending); @@ -218,6 +230,37 @@ get_rca(struct cam_periph *periph) { return periph->path->device->mmc_ident_data.card_rca; } +/* + * Figure out if CCB execution resulted in error. + * Look at both CAM-level errors and on MMC protocol errors. +*/ +static int +mmc_handle_reply(union ccb *ccb) +{ + + KASSERT(ccb->ccb_h.func_code == XPT_MMC_IO, + ("ccb %p: cannot handle non-XPT_MMC_IO errors, got func_code=%d", + ccb, ccb->ccb_h.func_code)); + + /* TODO: maybe put MMC-specific handling into cam.c/cam_error_print altogether */ + if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)) { + if (ccb->mmcio.cmd.error != 0) { + xpt_print_path(ccb->ccb_h.path); + printf("CMD%d failed, err %d (%s)\n", + ccb->mmcio.cmd.opcode, + ccb->mmcio.cmd.error, + mmc_errmsg[ccb->mmcio.cmd.error]); + return (EIO); + } + } else { + cam_error_print(ccb, CAM_ESF_ALL, CAM_EPF_ALL); + return (EIO); + } + + return (0); /* Normal return */ +} + + static uint32_t mmc_get_bits(uint32_t *bits, int bit_len, int start, int size) { @@ -777,11 +820,12 @@ mmc_exec_app_cmd(struct cam_periph *periph, union ccb /*mmc_data*/ NULL, /*timeout*/ 0); - err = cam_periph_runccb(ccb, sddaerror, CAM_FLAG_NONE, /*sense_flags*/0, NULL); + cam_periph_runccb(ccb, sddaerror, CAM_FLAG_NONE, /*sense_flags*/0, NULL); + err = mmc_handle_reply(ccb); if (err != 0) - return err; + return (err); if (!(ccb->mmcio.cmd.resp[0] & R1_APP_CMD)) - return MMC_ERR_FAILED; + return (EIO); /* Now exec actual command */ int flags = 0; @@ -803,12 +847,14 @@ mmc_exec_app_cmd(struct cam_periph *periph, union ccb /*mmc_data*/ cmd->data, /*timeout*/ 0); - err = cam_periph_runccb(ccb, sddaerror, CAM_FLAG_NONE, /*sense_flags*/0, NULL); + cam_periph_runccb(ccb, sddaerror, CAM_FLAG_NONE, /*sense_flags*/0, NULL); + err = mmc_handle_reply(ccb); + if (err != 0) + return (err); memcpy(cmd->resp, ccb->mmcio.cmd.resp, sizeof(cmd->resp)); cmd->error = ccb->mmcio.cmd.error; - if (err != 0) - return err; - return 0; + + return (0); } static int @@ -858,10 +904,9 @@ mmc_send_ext_csd(struct cam_periph *periph, union ccb /*mmc_data*/ &d, /*timeout*/ 0); - err = cam_periph_runccb(ccb, sddaerror, CAM_FLAG_NONE, /*sense_flags*/0, NULL); - if (err != 0) - return (err); - return (MMC_ERR_NONE); + cam_periph_runccb(ccb, sddaerror, CAM_FLAG_NONE, /*sense_flags*/0, NULL); + err = mmc_handle_reply(ccb); + return (err); } static void @@ -904,7 +949,7 @@ mmc_switch_fill_mmcio(union ccb *ccb, static int mmc_select_card(struct cam_periph *periph, union ccb *ccb, uint32_t rca) { - int flags; + int flags, err; flags = (rca ? MMC_RSP_R1B : MMC_RSP_NONE) | MMC_CMD_AC; cam_fill_mmcio(&ccb->mmcio, @@ -918,42 +963,20 @@ mmc_select_card(struct cam_periph *periph, union ccb * /*timeout*/ 0); cam_periph_runccb(ccb, sddaerror, CAM_FLAG_NONE, /*sense_flags*/0, NULL); - - if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)) { - if (ccb->mmcio.cmd.error != 0) { - CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_PERIPH, - ("%s: MMC_SELECT command failed", __func__)); - return EIO; - } - return 0; /* Normal return */ - } else { - CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_PERIPH, - ("%s: CAM request failed\n", __func__)); - return EIO; - } + err = mmc_handle_reply(ccb); + return (err); } static int mmc_switch(struct cam_periph *periph, union ccb *ccb, uint8_t set, uint8_t index, uint8_t value, u_int timeout) { + int err; mmc_switch_fill_mmcio(ccb, set, index, value, timeout); cam_periph_runccb(ccb, sddaerror, CAM_FLAG_NONE, /*sense_flags*/0, NULL); - - if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)) { - if (ccb->mmcio.cmd.error != 0) { - CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_PERIPH, - ("%s: MMC command failed", __func__)); - return (EIO); - } - return (0); /* Normal return */ - } else { - CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_PERIPH, - ("%s: CAM request failed\n", __func__)); - return (EIO); - } - + err = mmc_handle_reply(ccb); + return (err); } static uint32_t @@ -987,6 +1010,7 @@ mmc_sd_switch(struct cam_periph *periph, union ccb *cc struct mmc_data mmc_d; uint32_t arg; + int err; memset(res, 0, 64); mmc_d.len = 64; @@ -1009,19 +1033,8 @@ mmc_sd_switch(struct cam_periph *periph, union ccb *cc /*timeout*/ 0); cam_periph_runccb(ccb, sddaerror, CAM_FLAG_NONE, /*sense_flags*/0, NULL); - - if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)) { - if (ccb->mmcio.cmd.error != 0) { - CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_PERIPH, - ("%s: MMC command failed", __func__)); - return EIO; - } - return 0; /* Normal return */ - } else { - CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_PERIPH, - ("%s: CAM request failed\n", __func__)); - return EIO; - } + err = mmc_handle_reply(ccb); + return (err); } static int From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3594DDC355; Tue, 3 Sep 2019 14:06:06 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z14v7Bz4PBZ; Tue, 3 Sep 2019 14:06:05 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id C342F1A10B; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 70DE9D760; Wed, 3 Apr 2019 01:09:48 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B52388E28; Wed, 3 Apr 2019 01:09:48 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1681DD75E; Wed, 3 Apr 2019 01:09:48 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id F3198D759; Wed, 3 Apr 2019 01:09:44 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F92788E24; Wed, 3 Apr 2019 01:09:44 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3319f5n024051; Tue, 2 Apr 2019 18:09:41 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3319f25024050; Tue, 2 Apr 2019 18:09:41 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904030109.x3319f25024050@gndrsh.dnsmgr.net> Subject: Re: svn commit: r345804 - head/usr.bin/systat In-Reply-To: <20190402210001.3cd9b434a2f521e2dea80009@j.email.ne.jp> To: Yoshihiro Ota CC: rgrimes@freebsd.org, "Rodney W. Grimes" , Michael Reifenberger , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 2B52388E28 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:13 -0000 X-Original-Date: Tue, 2 Apr 2019 18:09:41 -0700 (PDT) X-List-Received-Date: Tue, 03 Sep 2019 14:06:13 -0000 > Hi, > > On Tue, 2 Apr 2019 07:08:17 -0700 (PDT) > "Rodney W. Grimes" wrote: > > > > Author: mr > > > Date: Tue Apr 2 14:01:03 2019 > > > New Revision: 345804 > > > URL: https://svnweb.freebsd.org/changeset/base/345804 > > > > > > Log: > > > systat -zarc to display disk activities like -vm > > > > > > PR: 213310 > > > Submitted by: ota > > > MFH: 4 weeks > > > > ? MFC: > > > > > Differential Revision: https://reviews.freebsd.org/D18726 > > > > > > Modified: > > > head/usr.bin/systat/devs.c > > > head/usr.bin/systat/devs.h > > > head/usr.bin/systat/iostat.c > > > head/usr.bin/systat/swap.c > > > head/usr.bin/systat/systat.h > > > head/usr.bin/systat/vmstat.c > > > head/usr.bin/systat/zarc.c > > > > > > Modified: head/usr.bin/systat/devs.c > > > ============================================================================== > > > --- head/usr.bin/systat/devs.c Tue Apr 2 13:59:04 2019 (r345803) > > > +++ head/usr.bin/systat/devs.c Tue Apr 2 14:01:03 2019 (r345804) > > > @@ -2,6 +2,7 @@ > > > * SPDX-License-Identifier: BSD-3-Clause > > > * > > > * Copyright (c) 1998 Kenneth D. Merry. > > > + * 2015 Yoshihiro Ota > > > * All rights reserved. > > > > > > Can we get in contact with Yoshihiro Ota about his > > copyright statements, and correcting this to make > > it clear that it is Kenneth D. Merry that is asserting > > "All rights reserved" and if Ota does nor does not wish to assert > > "All rights reserved". > > > > As committed this makes a grey area on Kenneth's assertion, > > also leaving out the word copyright on Yoshihiro's line is a bit iffy. > > > > I am only commenting once, this issue appears several times. > > We can go back out to D18726 to discuss it if need be. > > I've fully written zarc.c (and copied copy-right section from another file) > but all other changes in other files are refactoring and adjustments. > > I don't know the policy/procedure of how to update copy right section of FreeBSD. > Please adjust them according the project. > > Regards, > Hiro > I'll create a review with you as a reviewer that takes what I believe is the appropriate steps, and seek your approval for changes to your copyright statements. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B83DDC2C0; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yz59Ylz4P8X; Tue, 3 Sep 2019 14:06:03 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 194EE1A0A7; Tue, 3 Sep 2019 14:05:57 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id A6F3E2D32; Tue, 2 Apr 2019 14:46:14 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4643B8F7BC; Tue, 2 Apr 2019 14:46:14 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 28B3F2D2A; Tue, 2 Apr 2019 14:46:14 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C18712D1F for ; Tue, 2 Apr 2019 14:46:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BDC38F78A; Tue, 2 Apr 2019 14:46:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67BE7277CE; Tue, 2 Apr 2019 14:46:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x32EkB19016546; Tue, 2 Apr 2019 14:46:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x32EkBM7016545; Tue, 2 Apr 2019 14:46:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904021446.x32EkBM7016545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345805 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 345805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 4643B8F7BC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:10 -0000 X-Original-Date: Tue, 2 Apr 2019 14:46:11 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:10 -0000 Author: mav Date: Tue Apr 2 14:46:10 2019 New Revision: 345805 URL: https://svnweb.freebsd.org/changeset/base/345805 Log: Unify SCSI_STATUS_BUSY retry handling with other cases. - Do not retry if periph was invalidated. - Do not decrement retry_count if already zero. - Report action_string when applicable. MFC after: 2 weeks Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Tue Apr 2 14:01:03 2019 (r345804) +++ head/sys/cam/cam_periph.c Tue Apr 2 14:46:10 2019 (r345805) @@ -1513,6 +1513,7 @@ camperiphscsistatuserror(union ccb *ccb, union ccb **o int *openings, u_int32_t *relsim_flags, u_int32_t *timeout, u_int32_t *action, const char **action_string) { + struct cam_periph *periph; int error; switch (ccb->csio.scsi_status) { @@ -1595,14 +1596,21 @@ camperiphscsistatuserror(union ccb *ccb, union ccb **o * Restart the queue after either another * command completes or a 1 second timeout. */ - if ((sense_flags & SF_RETRY_BUSY) != 0 || - (ccb->ccb_h.retry_count--) > 0) { + periph = xpt_path_periph(ccb->ccb_h.path); + if (periph->flags & CAM_PERIPH_INVALID) { + error = EIO; + *action_string = "Periph was invalidated"; + } else if ((sense_flags & SF_RETRY_BUSY) != 0 || + ccb->ccb_h.retry_count > 0) { + if ((sense_flags & SF_RETRY_BUSY) == 0) + ccb->ccb_h.retry_count--; error = ERESTART; *relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT | RELSIM_RELEASE_AFTER_CMDCMPLT; *timeout = 1000; } else { error = EIO; + *action_string = "Retries exhausted"; } break; case SCSI_STATUS_RESERV_CONFLICT: From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 691F1DC2CA; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yz4f4Wz4P8H; Tue, 3 Sep 2019 14:06:03 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id BAB9C1A079; Tue, 3 Sep 2019 14:05:56 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 67BEB1FFCD; Tue, 2 Apr 2019 12:02:40 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 860E788F58; Tue, 2 Apr 2019 12:02:39 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 246B71FFA0; Tue, 2 Apr 2019 12:02:39 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 18D2A1FF9E for ; Tue, 2 Apr 2019 12:02:36 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0E3488F41; Tue, 2 Apr 2019 12:02:35 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8316F25B91; Tue, 2 Apr 2019 12:02:35 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x32C2ZO6032460; Tue, 2 Apr 2019 12:02:35 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x32C2Z3T032459; Tue, 2 Apr 2019 12:02:35 GMT (envelope-from br@FreeBSD.org) Message-Id: <201904021202.x32C2Z3T032459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345796 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 345796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 860E788F58 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:10 -0000 X-Original-Date: Tue, 2 Apr 2019 12:02:35 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:10 -0000 Author: br Date: Tue Apr 2 12:02:35 2019 New Revision: 345796 URL: https://svnweb.freebsd.org/changeset/base/345796 Log: o Grab the number of devices supported by PLIC from FDT. o Fix bug in PLIC_ENABLE macro when irq >= 32. Tested on the real hardware, which is HiFive Unleashed board. Thanks to SiFive, Inc. for the board provided. Reviewed by: markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19775 Modified: head/sys/riscv/riscv/plic.c Modified: head/sys/riscv/riscv/plic.c ============================================================================== --- head/sys/riscv/riscv/plic.c Tue Apr 2 09:33:30 2019 (r345795) +++ head/sys/riscv/riscv/plic.c Tue Apr 2 12:02:35 2019 (r345796) @@ -52,9 +52,9 @@ __FBSDID("$FreeBSD$"); #include "pic_if.h" -#define PLIC_NIRQS 32 +#define PLIC_MAX_IRQS 2048 #define PLIC_PRIORITY(n) (0x000000 + (n) * 0x4) -#define PLIC_ENABLE(n, h) (0x002000 + (h) * 0x80 + (n) / 32) +#define PLIC_ENABLE(n, h) (0x002000 + (h) * 0x80 + 4 * ((n) / 32)) #define PLIC_THRESHOLD(h) (0x200000 + (h) * 0x1000 + 0x0) #define PLIC_CLAIM(h) (0x200000 + (h) * 0x1000 + 0x4) @@ -66,7 +66,8 @@ struct plic_irqsrc { struct plic_softc { device_t dev; struct resource * intc_res; - struct plic_irqsrc isrcs[PLIC_NIRQS]; + struct plic_irqsrc isrcs[PLIC_MAX_IRQS]; + int ndev; }; #define RD4(sc, reg) \ @@ -158,7 +159,7 @@ plic_map_intr(device_t dev, struct intr_map_data *data return (ENOTSUP); daf = (struct intr_map_data_fdt *)data; - if (daf->ncells != 1 || daf->cells[0] >= PLIC_NIRQS) + if (daf->ncells != 1 || daf->cells[0] > sc->ndev) return (EINVAL); *isrcp = &sc->isrcs[daf->cells[0]].isrc; @@ -189,6 +190,7 @@ plic_attach(device_t dev) struct intr_pic *pic; uint32_t irq; const char *name; + phandle_t node; phandle_t xref; uint32_t cpu; int error; @@ -198,6 +200,20 @@ plic_attach(device_t dev) sc->dev = dev; + node = ofw_bus_get_node(dev); + if ((OF_getencprop(node, "riscv,ndev", &sc->ndev, + sizeof(sc->ndev))) < 0) { + device_printf(dev, + "Error: could not get number of devices\n"); + return (ENXIO); + } + + if (sc->ndev >= PLIC_MAX_IRQS) { + device_printf(dev, + "Error: invalid ndev (%d)\n", sc->ndev); + return (ENXIO); + } + /* Request memory resources */ rid = 0; sc->intc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, @@ -211,7 +227,7 @@ plic_attach(device_t dev) isrcs = sc->isrcs; name = device_get_nameunit(sc->dev); cpu = PCPU_GET(cpuid); - for (irq = 0; irq < PLIC_NIRQS; irq++) { + for (irq = 1; irq <= sc->ndev; irq++) { isrcs[irq].irq = irq; error = intr_isrc_register(&isrcs[irq].isrc, sc->dev, 0, "%s,%u", name, irq); @@ -223,7 +239,7 @@ plic_attach(device_t dev) } WR4(sc, PLIC_THRESHOLD(cpu), 0); - xref = OF_xref_from_node(ofw_bus_get_node(sc->dev)); + xref = OF_xref_from_node(node); pic = intr_pic_register(sc->dev, xref); if (pic == NULL) return (ENXIO); From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A878DC1C5; Tue, 3 Sep 2019 14:06:01 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yw1cx1z4P5J; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 145B019F71; Tue, 3 Sep 2019 14:05:54 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 8B7298DB7; Mon, 1 Apr 2019 09:02:56 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B0698CED9; Mon, 1 Apr 2019 09:02:56 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 155B58DB5; Mon, 1 Apr 2019 09:02:56 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 77E828DB1 for ; Mon, 1 Apr 2019 09:02:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id C904F8CED4; Mon, 1 Apr 2019 09:02:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 86AB043D588; Mon, 1 Apr 2019 20:02:49 +1100 (AEDT) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r345696 - head/lib/libvgl In-Reply-To: <20190331145122.GL1923@kib.kiev.ua> Message-ID: <20190401185606.Q2155@besplex.bde.org> References: <201903291557.x2TFv9AW097226@repo.freebsd.org> <20190329182100.GZ1923@kib.kiev.ua> <20190330142319.I1011@besplex.bde.org> <20190330094558.GA1923@kib.kiev.ua> <20190331214235.K961@besplex.bde.org> <20190331121015.GK1923@kib.kiev.ua> <20190331231926.M1259@besplex.bde.org> <20190331145122.GL1923@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=UJetJGXy c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=nR6jlSWGY1YSvxl2fiIA:9 a=CjuIK1q_8ugA:10 Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 3B0698CED9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:07 -0000 X-Original-Date: Mon, 1 Apr 2019 20:02:46 +1100 (EST) X-List-Received-Date: Tue, 03 Sep 2019 14:06:07 -0000 On Sun, 31 Mar 2019, Konstantin Belousov wrote: > On Mon, Apr 01, 2019 at 12:04:45AM +1100, Bruce Evans wrote: >> Serial consoles are not always available. >> >> Better debuggers switch the screen mode as necessary. >> >> I recently noticed another mode switching problem. On i386, cycling >> through about 50 modes to test them all takes a small fraction of a >> second for each mode switch (done directly in syscons or by a vm86 >> BIOS call) even when the monitor takes too long to resync (the monitor >> resyncs are coalesced, so 50 resyncs take about 5 seconds instead of >> 250). But on amd64, mode switches to VESA mode and back take about >> 20 seconds. They are not coalesced, and most of the system is stopped >> waiting for them (at least remote network access is stopped). amd64 >> can't use vm86, so it emulates BIOS calls. Why does the emulation stop >> the rest of the system and take so long? > > How many CPUs do you have ? 8 on the machine that shows the problem -- an underdesktop with Haswell graphics. A laptop with Sandybridge graphics only waits for 0.25 seconds (sys time) I don't know if it stops the system for that long (it would be 2 blockages for half that long). The laptop's integrated screen also syncs instantly. The undermydesktop has an LED screen connected by DVI-D. > x86bios.c x86bios_call() does spinlock_enter() around emulator calls. > This disables interrupts. > > If you have only one CPU, the consequences are obvious. If you have > more than one, then perhaps next IPI targeted to this CPU blocks the > originator, if IPI requires ack, which typically true for most common > TLB shutdown IPIs. Then both this CPU and originator block any other CPU > trying to send an IPI. Serial console interrupts on another CPU work to enter ddb instantly and show the emulator stopped. Binding drivers to CPU unimproves scheduling in general, and here it might result in iflib waiting for the CPU with interrupts disabled, but usually the CPU with interrupts disabled is not the one(s) bound to by iflib, and binding the graphics program to one not used by iflib doesn't help. Removing the spinlock_enter/exit() using ddb makes no difference. > For this reason I have to come through several hoops to not disable > interrupts for duration of EFI runtime calls, otherwise spinlocks die > due to 'spin lock held too long' on other CPUs. I turn off the 'spin lock held too long' panics in my fixes for console and message buffer i/o. Printing "spin lock held too long\n" takes 120 seconds at 2 bps. Draining 16K of buffered messages takes 81920 seconds at 2 bps. The main fix is to cancel the timeouts here while any console driver is making progress (hopefully printing messages about the actual error). 2 bps is too slow to be useful, but it gives a good stress test and a check that the timeouts are scaled properly by the console speed. Disabling interrupts might be FUD. vm86 on i386 only uses critical_enter() in addition to its sleep lock. But this is bad for scheduling too. Bruce From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40428DC1EE; Tue, 3 Sep 2019 14:06:01 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7yw4QTbz4P5g; Tue, 3 Sep 2019 14:06:00 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 4E52219F8C; Tue, 3 Sep 2019 14:05:54 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 58A3ACED8; Mon, 1 Apr 2019 14:21:36 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2451F70EC3; Mon, 1 Apr 2019 14:21:36 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 15218CED7; Mon, 1 Apr 2019 14:21:36 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 5AF88CED2 for ; Mon, 1 Apr 2019 14:21:33 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D45A870EB5; Mon, 1 Apr 2019 14:21:32 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B33D0F935; Mon, 1 Apr 2019 14:21:32 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x31ELWiR044156; Mon, 1 Apr 2019 14:21:32 GMT (envelope-from olivier@FreeBSD.org) Received: (from olivier@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x31ELWaR044154; Mon, 1 Apr 2019 14:21:32 GMT (envelope-from olivier@FreeBSD.org) Message-Id: <201904011421.x31ELWaR044154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: olivier set sender to olivier@FreeBSD.org using -f From: Olivier Cochard To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345765 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: olivier X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 345765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 2451F70EC3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:07 -0000 X-Original-Date: Mon, 1 Apr 2019 14:21:32 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:07 -0000 Author: olivier (ports committer) Date: Mon Apr 1 14:21:32 2019 New Revision: 345765 URL: https://svnweb.freebsd.org/changeset/base/345765 Log: Fix and simplify code by using ATF_REQUIRE_FEATURE macro PR: 236857 Reviewed by: asomers, ngie Approved by: emaste MFC after: 1 month Sponsored by: Netflix Modified: head/tests/sys/audit/Makefile head/tests/sys/audit/process-control.c Modified: head/tests/sys/audit/Makefile ============================================================================== --- head/tests/sys/audit/Makefile Mon Apr 1 14:19:09 2019 (r345764) +++ head/tests/sys/audit/Makefile Mon Apr 1 14:21:32 2019 (r345765) @@ -55,4 +55,6 @@ WARNS?= 6 LDFLAGS+= -lbsm -lutil +CFLAGS.process-control.c+= -I${SRCTOP}/tests + .include Modified: head/tests/sys/audit/process-control.c ============================================================================== --- head/tests/sys/audit/process-control.c Mon Apr 1 14:19:09 2019 (r345764) +++ head/tests/sys/audit/process-control.c Mon Apr 1 14:21:32 2019 (r345765) @@ -48,6 +48,8 @@ #include "utils.h" +#include "freebsd_test_suite/macros.h" + static pid_t pid; static int filedesc, status; static struct pollfd fds[1]; @@ -1512,15 +1514,8 @@ ATF_TC_HEAD(cap_enter_success, tc) ATF_TC_BODY(cap_enter_success, tc) { - int capinfo; - size_t len = sizeof(capinfo); - const char *capname = "kern.features.security_capability_mode"; - ATF_REQUIRE_EQ(0, sysctlbyname(capname, &capinfo, &len, NULL, 0)); + ATF_REQUIRE_FEATURE("security_capability_mode"); - /* Without CAPABILITY_MODE enabled, cap_enter() returns ENOSYS */ - if (!capinfo) - atf_tc_skip("Capsicum is not enabled in the system"); - FILE *pipefd = setup(fds, auclass); ATF_REQUIRE((pid = fork()) != -1); if (pid) { @@ -1550,14 +1545,9 @@ ATF_TC_HEAD(cap_getmode_success, tc) ATF_TC_BODY(cap_getmode_success, tc) { - int capinfo, modep; - size_t len = sizeof(capinfo); - const char *capname = "kern.features.security_capability_mode"; - ATF_REQUIRE_EQ(0, sysctlbyname(capname, &capinfo, &len, NULL, 0)); + int modep; - /* Without CAPABILITY_MODE enabled, cap_getmode() returns ENOSYS */ - if (!capinfo) - atf_tc_skip("Capsicum is not enabled in the system"); + ATF_REQUIRE_FEATURE("security_capability_mode"); pid = getpid(); snprintf(pcregex, sizeof(pcregex), "cap_getmode.*%d.*success", pid); From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAD49DC3CA; Tue, 3 Sep 2019 14:06:07 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z34w5Gz4PDM; Tue, 3 Sep 2019 14:06:07 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id D1E2A1A191; Tue, 3 Sep 2019 14:05:58 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 9B24AD6B; Wed, 3 Apr 2019 17:04:42 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486B18B0CD; Wed, 3 Apr 2019 17:04:42 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1F234D62; Wed, 3 Apr 2019 17:04:42 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id D871BD5E for ; Wed, 3 Apr 2019 17:04:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E5C38B0C2; Wed, 3 Apr 2019 17:04:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7481018E25; Wed, 3 Apr 2019 17:04:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x33H4cpX056935; Wed, 3 Apr 2019 17:04:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x33H4c0n056934; Wed, 3 Apr 2019 17:04:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904031704.x33H4c0n056934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345848 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 345848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 486B18B0CD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:15 -0000 X-Original-Date: Wed, 3 Apr 2019 17:04:38 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:15 -0000 Author: kevans Date: Wed Apr 3 17:04:38 2019 New Revision: 345848 URL: https://svnweb.freebsd.org/changeset/base/345848 Log: libbe(3): Add a serial to the generated snapshot names To use bectl in an example, when one creates a new boot environment with either `bectl create ` or `bectl create -e `, libbe will take a snapshot of the original boot environment to clone. Previously, this used %F-%T date format as the snapshot name, but this has some limitations- attempting to create multiple boot environments in quick succession may collide if done within the same second. Tack a serial onto it to reduce the chances of a collision... we could still collide if multiple processes/threads are creating boot environments at the same time, but this is likely not a big concern as this has only been reported as occurring in freebsd-ci setup. MFC after: 3 days Modified: head/lib/libbe/be.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Wed Apr 3 17:02:18 2019 (r345847) +++ head/lib/libbe/be.c Wed Apr 3 17:04:38 2019 (r345848) @@ -56,6 +56,9 @@ static int be_create_child_noent(libbe_handle_t *lbh, static int be_create_child_cloned(libbe_handle_t *lbh, const char *active); #endif +/* Arbitrary... should tune */ +#define BE_SNAP_SERIAL_MAX 1024 + /* * Iterator function for locating the rootfs amongst the children of the * zfs_be_root set by loader(8). data is expected to be a libbe_handle_t *. @@ -320,13 +323,32 @@ be_destroy(libbe_handle_t *lbh, const char *name, int options & ~BE_DESTROY_ORIGIN)); } +static void +be_setup_snapshot_name(libbe_handle_t *lbh, char *buf, size_t buflen) +{ + time_t rawtime; + int len, serial; + + time(&rawtime); + len = strlen(buf); + len += strftime(buf + len, buflen - len, "@%F-%T", localtime(&rawtime)); + /* No room for serial... caller will do its best */ + if (buflen - len < 2) + return; + + for (serial = 0; serial < BE_SNAP_SERIAL_MAX; ++serial) { + snprintf(buf + len, buflen - len, "-%d", serial); + if (!zfs_dataset_exists(lbh->lzh, buf, ZFS_TYPE_SNAPSHOT)) + return; + } +} + int be_snapshot(libbe_handle_t *lbh, const char *source, const char *snap_name, bool recursive, char *result) { char buf[BE_MAXPATHLEN]; - time_t rawtime; - int len, err; + int err; be_root_concat(lbh, source, buf); @@ -344,10 +366,8 @@ be_snapshot(libbe_handle_t *lbh, const char *source, c snprintf(result, BE_MAXPATHLEN, "%s@%s", source, snap_name); } else { - time(&rawtime); - len = strlen(buf); - strftime(buf + len, sizeof(buf) - len, - "@%F-%T", localtime(&rawtime)); + be_setup_snapshot_name(lbh, buf, sizeof(buf)); + if (result != NULL && strlcpy(result, strrchr(buf, '/') + 1, sizeof(buf)) >= sizeof(buf)) return (set_error(lbh, BE_ERR_INVALIDNAME)); From owner-svn-src-head@freebsd.org Tue Sep 3 14:06:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16311DC42F; Tue, 3 Sep 2019 14:06:09 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7z36bdpz4PDh; Tue, 3 Sep 2019 14:06:07 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 3B5141A1B5; Tue, 3 Sep 2019 14:05:59 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 693B86419; Wed, 3 Apr 2019 21:55:45 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 267AA6F86D; Wed, 3 Apr 2019 21:55:45 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 16A1B6418; Wed, 3 Apr 2019 21:55:45 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 53D71640B for ; Wed, 3 Apr 2019 21:55:42 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 165846F85B; Wed, 3 Apr 2019 21:55:42 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E463B1C0EF; Wed, 3 Apr 2019 21:55:41 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x33LtfIR013208; Wed, 3 Apr 2019 21:55:41 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x33LteXp013200; Wed, 3 Apr 2019 21:55:40 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201904032155.x33LteXp013200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345859 - in head: contrib/libxo contrib/libxo/doc contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved contrib/libxo/tests/gettext/po/pig_latin contrib/libxo/tes... X-SVN-Group: head X-SVN-Commit-Author: phil X-SVN-Commit-Paths: in head: contrib/libxo contrib/libxo/doc contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved contrib/libxo/tests/gettext/po/pig_latin contrib/libxo/tests/gettext/saved contrib/... X-SVN-Commit-Revision: 345859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 267AA6F86D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] Status: O X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:18 -0000 X-Original-Date: Wed, 3 Apr 2019 21:55:40 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:18 -0000 Author: phil Date: Wed Apr 3 21:55:39 2019 New Revision: 345859 URL: https://svnweb.freebsd.org/changeset/base/345859 Log: Import libxo-1.0.2 from 1.0.0: Add "continuation" flag, to allow multiple "xo" invocations in a single line of output (#58) Add --top-wrap to make top-level JSON wrappers Add --{open,close}-{list,instace} options Add xo_xml_leader(), to detect use of some bogus XML tags. It's still bad form, but it's a little safer now Avoid call to xo_write before xo_flush, since the latter calls the former Check return code from xo_flush_h properly (<0) (FreeBSD Bug 236935) For JSON output, avoid newline before a container's close brace (#62) Merge branch 'text_only' of https://github.com/zvr/libxo into zvr-text_only Use XO_USE_INT_RETURN_CODES, not USE_INT_RETURN_CODES add docs for --continuation add docs for --not-first call xo_state_set_flags before values and close containers; add XOIF_MADE_OUTPUT flag to track state; make proper empty JSON objects in xo_finish color_map code has to be #ifdef'd out, since the struct definition correct xo_flush_func_t (doesn't use xo_ssize_t) make depth change for --top-wrap only for JSON fix to handle --top-wrap in "xo" by being more consistent with handling trailing newlines fix to handle text-only version #64 (from zvr) fix xo_buf_has_room for round up to the next XO_BUFSIZ, not just add XO_BUFSIZ to the size (FreeBSD Bug 236937) update docs for new "xo" options update functions to use xo_ssize_t update test cases from 1.0.1: Add EINTEGRITY to .pot files under test/gettext/ (fix from FreeBSD) from 1.0.2: handle failure from xo_vnsprintf; don't add -1 to "rc" PR: 236937, 236935 Submitted by: phil Reported by: Alfonso S. Siciliano MFC after: 2 weeks Added: head/contrib/libxo/libxo/xo_explicit.h - copied unchanged from r345857, vendor/Juniper/libxo/dist/libxo/xo_explicit.h head/contrib/libxo/tests/xo/saved/xo_02.H.err - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.H.err head/contrib/libxo/tests/xo/saved/xo_02.H.out - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.H.out head/contrib/libxo/tests/xo/saved/xo_02.HIPx.err - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.HIPx.err head/contrib/libxo/tests/xo/saved/xo_02.HIPx.out - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.HIPx.out head/contrib/libxo/tests/xo/saved/xo_02.HP.err - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.HP.err head/contrib/libxo/tests/xo/saved/xo_02.HP.out - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.HP.out head/contrib/libxo/tests/xo/saved/xo_02.J.err - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.J.err head/contrib/libxo/tests/xo/saved/xo_02.J.out - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.J.out head/contrib/libxo/tests/xo/saved/xo_02.JP.err - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.JP.err head/contrib/libxo/tests/xo/saved/xo_02.JP.out - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.JP.out head/contrib/libxo/tests/xo/saved/xo_02.T.err - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.T.err head/contrib/libxo/tests/xo/saved/xo_02.T.out - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.T.out head/contrib/libxo/tests/xo/saved/xo_02.X.err - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.X.err head/contrib/libxo/tests/xo/saved/xo_02.X.out - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.X.out head/contrib/libxo/tests/xo/saved/xo_02.XP.err - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.XP.err head/contrib/libxo/tests/xo/saved/xo_02.XP.out - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/saved/xo_02.XP.out head/contrib/libxo/tests/xo/xo_02.sh - copied unchanged from r345857, vendor/Juniper/libxo/dist/tests/xo/xo_02.sh Modified: head/contrib/libxo/configure.ac head/contrib/libxo/doc/api.rst head/contrib/libxo/doc/libxo-manual.html head/contrib/libxo/doc/xo.rst head/contrib/libxo/libxo/Makefile.am head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xo.h head/contrib/libxo/libxo/xo_attr.3 head/contrib/libxo/libxo/xo_buf.h head/contrib/libxo/libxo/xo_emit.3 head/contrib/libxo/libxo/xo_emit_f.3 head/contrib/libxo/libxo/xo_finish.3 head/contrib/libxo/libxo/xo_flush.3 head/contrib/libxo/libxo/xo_open_container.3 head/contrib/libxo/libxo/xo_open_list.3 head/contrib/libxo/libxo/xo_open_marker.3 head/contrib/libxo/libxo/xo_set_writer.3 head/contrib/libxo/tests/core/saved/test_01.J.out head/contrib/libxo/tests/core/saved/test_02.J.out head/contrib/libxo/tests/core/saved/test_03.J.out head/contrib/libxo/tests/core/saved/test_04.J.out head/contrib/libxo/tests/core/saved/test_05.J.out head/contrib/libxo/tests/core/saved/test_05.JP.out head/contrib/libxo/tests/core/saved/test_06.J.out head/contrib/libxo/tests/core/saved/test_07.J.out head/contrib/libxo/tests/core/saved/test_08.J.out head/contrib/libxo/tests/core/saved/test_09.J.out head/contrib/libxo/tests/core/saved/test_10.J.out head/contrib/libxo/tests/core/saved/test_11.J.out head/contrib/libxo/tests/core/saved/test_12.E.err head/contrib/libxo/tests/core/saved/test_12.E.out head/contrib/libxo/tests/core/saved/test_12.H.err head/contrib/libxo/tests/core/saved/test_12.H.out head/contrib/libxo/tests/core/saved/test_12.HIPx.err head/contrib/libxo/tests/core/saved/test_12.HIPx.out head/contrib/libxo/tests/core/saved/test_12.HP.err head/contrib/libxo/tests/core/saved/test_12.HP.out head/contrib/libxo/tests/core/saved/test_12.J.err head/contrib/libxo/tests/core/saved/test_12.J.out head/contrib/libxo/tests/core/saved/test_12.JP.err head/contrib/libxo/tests/core/saved/test_12.JP.out head/contrib/libxo/tests/core/saved/test_12.T.err head/contrib/libxo/tests/core/saved/test_12.T.out head/contrib/libxo/tests/core/saved/test_12.X.err head/contrib/libxo/tests/core/saved/test_12.X.out head/contrib/libxo/tests/core/saved/test_12.XP.err head/contrib/libxo/tests/core/saved/test_12.XP.out head/contrib/libxo/tests/core/test_12.c head/contrib/libxo/tests/gettext/po/pig_latin/strerror.po head/contrib/libxo/tests/gettext/saved/gt_01.J.out head/contrib/libxo/tests/xo/Makefile.am head/contrib/libxo/tests/xo/saved/xo_01.H.out head/contrib/libxo/tests/xo/saved/xo_01.HIPx.out head/contrib/libxo/tests/xo/saved/xo_01.HP.out head/contrib/libxo/tests/xo/saved/xo_01.J.out head/contrib/libxo/tests/xo/saved/xo_01.JP.out head/contrib/libxo/tests/xo/saved/xo_01.T.out head/contrib/libxo/tests/xo/xo_01.sh head/contrib/libxo/xo/xo.1 head/contrib/libxo/xo/xo.c head/lib/libxo/xo_config.h head/usr.bin/xohtml/xohtml.sh Directory Properties: head/contrib/libxo/ (props changed) Modified: head/contrib/libxo/configure.ac ============================================================================== --- head/contrib/libxo/configure.ac Wed Apr 3 21:54:47 2019 (r345858) +++ head/contrib/libxo/configure.ac Wed Apr 3 21:55:39 2019 (r345859) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.9.0], [phil@juniper.net]) +AC_INIT([libxo], [1.0.2], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: head/contrib/libxo/doc/api.rst ============================================================================== --- head/contrib/libxo/doc/api.rst Wed Apr 3 21:54:47 2019 (r345858) +++ head/contrib/libxo/doc/api.rst Wed Apr 3 21:55:39 2019 (r345859) @@ -400,28 +400,28 @@ string, since an inappropriate cast can ruin your day. argument to `xo_emit_hv` points to a variable argument list that can be used to retrieve arguments via `va_arg`. -.. c:function:: int xo_emit (const char *fmt, ...) +.. c:function:: xo_ssize_t xo_emit (const char *fmt, ...) :param fmt: The format string, followed by zero or more arguments :returns: If XOF_COLUMNS is set, the number of columns used; otherwise the number of bytes emitted - :rtype: int + :rtype: xo_ssize_t -.. c:function:: int xo_emit_h (xo_handle_t *xop, const char *fmt, ...) +.. c:function:: xo_ssize_t xo_emit_h (xo_handle_t *xop, const char *fmt, ...) :param xop: Handle for modify (or NULL for default handle) :type xop: xo_handle_t \* :param fmt: The format string, followed by zero or more arguments :returns: If XOF_COLUMNS is set, the number of columns used; otherwise the number of bytes emitted - :rtype: int + :rtype: xo_ssize_t -.. c:function:: int xo_emit_hv (xo_handle_t *xop, const char *fmt, va_list vap) +.. c:function:: xo_ssize_t xo_emit_hv (xo_handle_t *xop, const char *fmt, va_list vap) :param xop: Handle for modify (or NULL for default handle) :type xop: xo_handle_t \* :param fmt: The format string :param va_list vap: A set of variadic arguments :returns: If XOF_COLUMNS is set, the number of columns used; otherwise the number of bytes emitted - :rtype: int + :rtype: xo_ssize_t .. index:: xo_emit_field @@ -434,7 +434,7 @@ scenario where one would otherwise need to compose a f descriptors using `snprintf`. The individual parts of the format descriptor are passed in distinctly. -.. c:function:: int xo_emit_field (const char *rolmod, const char *contents, const char *fmt, const char *efmt, ...) +.. c:function:: xo_ssize_t xo_emit_field (const char *rolmod, const char *contents, const char *fmt, const char *efmt, ...) :param rolmod: A comma-separated list of field roles and field modifiers :type rolmod: const char * @@ -445,7 +445,7 @@ descriptor are passed in distinctly. :param efmt: Encoding format string, followed by additional arguments :type efmt: const char * :returns: If XOF_COLUMNS is set, the number of columns used; otherwise the number of bytes emitted - :rtype: int + :rtype: xo_ssize_t :: @@ -453,7 +453,7 @@ descriptor are passed in distinctly. xo_emit_field("T", "Host name is ", NULL, NULL); xo_emit_field("V", "host-name", NULL, NULL, host-name); -.. c:function:: int xo_emit_field_h (xo_handle_t *xop, const char *rolmod, const char *contents, const char *fmt, const char *efmt, ...) +.. c:function:: xo_ssize_t xo_emit_field_h (xo_handle_t *xop, const char *rolmod, const char *contents, const char *fmt, const char *efmt, ...) :param xop: Handle for modify (or NULL for default handle) :type xop: xo_handle_t \* @@ -466,9 +466,9 @@ descriptor are passed in distinctly. :param efmt: Encoding format string, followed by additional arguments :type efmt: const char * :returns: If XOF_COLUMNS is set, the number of columns used; otherwise the number of bytes emitted - :rtype: int + :rtype: xo_ssize_t -.. c:function:: int xo_emit_field_hv (xo_handle_t *xop, const char *rolmod, const char *contents, const char *fmt, const char *efmt, va_list vap) +.. c:function:: xo_ssize_t xo_emit_field_hv (xo_handle_t *xop, const char *rolmod, const char *contents, const char *fmt, const char *efmt, va_list vap) :param xop: Handle for modify (or NULL for default handle) :type xop: xo_handle_t \* @@ -482,7 +482,7 @@ descriptor are passed in distinctly. :type efmt: const char * :param va_list vap: A set of variadic arguments :returns: If XOF_COLUMNS is set, the number of columns used; otherwise the number of bytes emitted - :rtype: int + :rtype: xo_ssize_t .. index:: xo_attr .. _xo_attr: @@ -505,14 +505,14 @@ Since attributes are only emitted in XML, their use sh to meta-data and additional or redundant representations of data already emitted in other form. -.. c:function:: int xo_attr (const char *name, const char *fmt, ...) +.. c:function:: xo_ssize_t xo_attr (const char *name, const char *fmt, ...) :param name: Attribute name :type name: const char * :param fmt: Attribute value, as variadic arguments :type fmt: const char * :returns: -1 for error, or the number of bytes in the formatted attribute value - :rtype: int + :rtype: xo_ssize_t :: @@ -525,7 +525,7 @@ already emitted in other form. 00:14 -.. c:function:: int xo_attr_h (xo_handle_t *xop, const char *name, const char *fmt, ...) +.. c:function:: xo_ssize_t xo_attr_h (xo_handle_t *xop, const char *name, const char *fmt, ...) :param xop: Handle for modify (or NULL for default handle) :type xop: xo_handle_t \* @@ -533,7 +533,7 @@ already emitted in other form. The `xo_attr_h` function follows the conventions of `xo_attr` but adds an explicit libxo handle. -.. c:function:: int xo_attr_hv (xo_handle_t *xop, const char *name, const char *fmt, va_list vap) +.. c:function:: xo_ssize_t xo_attr_hv (xo_handle_t *xop, const char *name, const char *fmt, va_list vap) The `xo_attr_h` function follows the conventions of `xo_attr_h` but replaced the variadic list with a variadic pointer. Modified: head/contrib/libxo/doc/libxo-manual.html ============================================================================== --- head/contrib/libxo/doc/libxo-manual.html Wed Apr 3 21:54:47 2019 (r345858) +++ head/contrib/libxo/doc/libxo-manual.html Wed Apr 3 21:55:39 2019 (r345859) @@ -515,7 +515,7 @@ li.indline1 { } @top-right { - content: "May 2018"; + content: "April 2019"; } @top-center { @@ -22011,7 +22011,7 @@ jQuery(function ($) { -May 21, 2018 +April 2, 2019

libxo: The Easy Way to Generate text, XML, JSON, and HTML output
libxo-manual

Modified: head/contrib/libxo/doc/xo.rst ============================================================================== --- head/contrib/libxo/doc/xo.rst Wed Apr 3 21:54:47 2019 (r345858) +++ head/contrib/libxo/doc/xo.rst Wed Apr 3 21:55:39 2019 (r345859) @@ -75,7 +75,7 @@ prepend data to the XPath values used for HTML output EXAMPLE; #!/bin/sh xo --open top/data - xo --depth 2 '{tag}' value + xo --depth 2 '{:tag}' value xo --close top/data XML: @@ -90,6 +90,84 @@ prepend data to the XPath values used for HTML output } } +When making partial lines of output (where the format string does not +include a newline), use the `--continuation` option to let secondary +invocations know they are adding data to an existing line. + +When emitting a series of objects, use the `--not-first` option to +ensure that any details from the previous object (e.g. commas in JSON) +are handled correctly. + +Use the `--top-wrap` option to ensure any top-level object details are +handled correctly, e.g. wrap the entire output in a top-level set of +braces for JSON output. + + EXAMPLE; + #!/bin/sh + xo --top-wrap --open top/data + xo --depth 2 'First {:tag} ' value1 + xo --depth 2 --continuation 'and then {:tag}\n' value2 + xo --top-wrap --close top/data + TEXT: + First value1 and then value2 + HTML: +
+
First
+
value1
+
+
and then
+
value2
+
+ XML: + + + value1 + value2 + + + JSON: + { + "top": { + "data": { + "tag": "value1", + "tag": "value2" + } + } + } + +Lists and Instances +------------------- + +A "*list*" is set of one or more instances that appear under the same +parent. The instances contain details about a specific object. One +can think of instances as objects or records. A call is needed to +open and close the list, while a distinct call is needed to open and +close each instance of the list. + +Use the `--open-list` and `--open-instances` to open lists and +instances. Use the `--close-list` and `--close-instances` to close +them. Each of these options take a `name` parameter, providing the +name of the list and instance. + +In the following example, a list named "machine" is created with three +instances: + + opts="--json" + xo $opts --open-list machine + NF= + for name in red green blue; do + xo $opts --depth 1 $NF --open-instance machine + xo $opts --depth 2 "Machine {k:name} has {:memory}\n" $name 55 + xo $opts --depth 1 --close-instance machine + NF=--not-first + done + xo $opts $NF --close-list machine + +The normal `libxo` functions use a state machine to help these +transitions, but since each `xo` command is invoked independent of the +previous calls, the state must be passed in explicitly via these +command line options. + Command Line Options -------------------- @@ -97,15 +175,23 @@ Command Line Options Usage: xo [options] format [fields] --close Close tags for the given path + --close-instance Close an open instance name + --close-list Close an open list name + --continuation OR -C Output belongs on same line as previous output --depth Set the depth for pretty printing --help Display this help text --html OR -H Generate HTML output --json OR -J Generate JSON output --leading-xpath Add a prefix to generated XPaths (HTML) + --not-first Indicate this object is not the first (JSON) --open Open tags for the given path + --open-instance Open an instance given by name + --open-list Open a list given by name + --option -or -O Give formatting options --pretty OR -p Make 'pretty' output (add indent, newlines) --style